@repobit/dex-system-design 3.0.2 → 3.1.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/CHANGELOG.md +24 -0
- package/README.md +35 -0
- package/dist/src/components/agent-endpoints/agent-endpoints.d.ts +1 -0
- package/dist/src/components/agent-endpoints/agent-endpoints.js +12 -12
- package/dist/src/components/agent-endpoints/agent-endpoints.js.map +1 -1
- package/dist/src/components/anchor/anchor-nav.d.ts +2 -1
- package/dist/src/components/anchor/anchor-nav.js +10 -10
- package/dist/src/components/anchor/anchor-nav.js.map +1 -1
- package/dist/src/components/audience-card/audience-card.d.ts +1 -0
- package/dist/src/components/audience-card/audience-card.js +7 -7
- package/dist/src/components/audience-card/audience-card.js.map +1 -1
- package/dist/src/components/awards/awards-flex.d.ts +3 -2
- package/dist/src/components/awards/awards-flex.js +16 -16
- package/dist/src/components/awards/awards-flex.js.map +1 -1
- package/dist/src/components/awards/awards-spotlight.d.ts +2 -1
- package/dist/src/components/awards/awards-spotlight.js +8 -8
- package/dist/src/components/awards/awards-spotlight.js.map +1 -1
- package/dist/src/components/awards/awards.d.ts +1 -1
- package/dist/src/components/bento-grid/bento-grid.d.ts +1 -0
- package/dist/src/components/bento-grid/bento-grid.js +10 -10
- package/dist/src/components/bento-grid/bento-grid.js.map +1 -1
- package/dist/src/components/bento-grid/bento-item.d.ts +1 -0
- package/dist/src/components/bento-grid/bento-item.js +9 -9
- package/dist/src/components/bento-grid/bento-item.js.map +1 -1
- package/dist/src/components/button/button.d.ts +1 -1
- package/dist/src/components/cards/card.d.ts +2 -2
- package/dist/src/components/cards/card.js +11 -11
- package/dist/src/components/cards/card.js.map +1 -1
- package/dist/src/components/carousel/carousel.d.ts +2 -2
- package/dist/src/components/carousel/carousel.js +6 -6
- package/dist/src/components/carousel/carousel.js.map +1 -1
- package/dist/src/components/comparison-panel/comparison-panel.d.ts +1 -0
- package/dist/src/components/comparison-panel/comparison-panel.js +12 -12
- package/dist/src/components/comparison-panel/comparison-panel.js.map +1 -1
- package/dist/src/components/compatibility-table/compatibility-table.d.ts +1 -0
- package/dist/src/components/compatibility-table/compatibility-table.js +14 -14
- package/dist/src/components/compatibility-table/compatibility-table.js.map +1 -1
- package/dist/src/components/cta-banner/cta-banner.d.ts +1 -0
- package/dist/src/components/cta-banner/cta-banner.js +8 -8
- package/dist/src/components/cta-banner/cta-banner.js.map +1 -1
- package/dist/src/components/header/header-code.d.ts +3 -2
- package/dist/src/components/header/header-code.js +13 -13
- package/dist/src/components/header/header-code.js.map +1 -1
- package/dist/src/components/heading/heading.d.ts +1 -1
- package/dist/src/components/heading/heading.js +5 -1
- package/dist/src/components/heading/heading.js.map +1 -1
- package/dist/src/components/hero/hero.d.ts +2 -1
- package/dist/src/components/hero/hero.js +8 -8
- package/dist/src/components/hero/hero.js.map +1 -1
- package/dist/src/components/install-options/install-options.d.ts +3 -2
- package/dist/src/components/install-options/install-options.js +17 -17
- package/dist/src/components/install-options/install-options.js.map +1 -1
- package/dist/src/components/link/link.d.ts +1 -1
- package/dist/src/components/list/list-item/list-item.d.ts +1 -1
- package/dist/src/components/logo-marquee/logo-marquee.d.ts +1 -0
- package/dist/src/components/logo-marquee/logo-marquee.js +5 -5
- package/dist/src/components/logo-marquee/logo-marquee.js.map +1 -1
- package/dist/src/components/motion-art/motion-art.js +1 -1
- package/dist/src/components/motion-art/motion-art.js.map +1 -1
- package/dist/src/components/overview/overview.d.ts +1 -0
- package/dist/src/components/overview/overview.js +7 -7
- package/dist/src/components/overview/overview.js.map +1 -1
- package/dist/src/components/page-switcher/page-switcher.d.ts +1 -0
- package/dist/src/components/page-switcher/page-switcher.js +5 -5
- package/dist/src/components/page-switcher/page-switcher.js.map +1 -1
- package/dist/src/components/pagination-dots/pagination-dots.d.ts +1 -1
- package/dist/src/components/partner-banner/partner-banner.d.ts +1 -0
- package/dist/src/components/partner-banner/partner-banner.js +6 -6
- package/dist/src/components/partner-banner/partner-banner.js.map +1 -1
- package/dist/src/components/picture/picture.css.js +1 -1
- package/dist/src/components/picture/picture.css.js.map +1 -1
- package/dist/src/components/post-card/post-card.d.ts +1 -0
- package/dist/src/components/post-card/post-card.js +5 -5
- package/dist/src/components/post-card/post-card.js.map +1 -1
- package/dist/src/components/process-steps/process-steps.d.ts +1 -0
- package/dist/src/components/process-steps/process-steps.js +7 -7
- package/dist/src/components/process-steps/process-steps.js.map +1 -1
- package/dist/src/components/quick-answer/quick-answer.d.ts +1 -0
- package/dist/src/components/quick-answer/quick-answer.js +7 -7
- package/dist/src/components/quick-answer/quick-answer.js.map +1 -1
- package/dist/src/components/review/review-grid.d.ts +1 -0
- package/dist/src/components/review/review-grid.js +3 -3
- package/dist/src/components/review/review-grid.js.map +1 -1
- package/dist/src/components/review/review.d.ts +1 -0
- package/dist/src/components/review/review.js +2 -2
- package/dist/src/components/review/review.js.map +1 -1
- package/dist/src/components/section-header/section-header.d.ts +1 -0
- package/dist/src/components/section-header/section-header.js +3 -3
- package/dist/src/components/section-header/section-header.js.map +1 -1
- package/dist/src/components/shared/controller.observer.d.ts +50 -0
- package/dist/src/components/shared/controller.observer.js +2 -0
- package/dist/src/components/shared/controller.observer.js.map +1 -0
- package/dist/src/components/spotlight-section/spotlight-section.d.ts +1 -0
- package/dist/src/components/spotlight-section/spotlight-section.js +7 -7
- package/dist/src/components/spotlight-section/spotlight-section.js.map +1 -1
- package/dist/src/components/stat/stat-highlight.d.ts +5 -5
- package/dist/src/components/stat/stat-highlight.js +2 -2
- package/dist/src/components/stat/stat-highlight.js.map +1 -1
- package/dist/src/components/stat/stat-tile.d.ts +1 -0
- package/dist/src/components/stat/stat-tile.js +5 -5
- package/dist/src/components/stat/stat-tile.js.map +1 -1
- package/dist/src/components/terminal/terminal-cursor.d.ts +1 -0
- package/dist/src/components/terminal/terminal-cursor.js +1 -1
- package/dist/src/components/terminal/terminal-cursor.js.map +1 -1
- package/dist/src/components/terminal/terminal-message.d.ts +4 -3
- package/dist/src/components/terminal/terminal-message.js +25 -25
- package/dist/src/components/terminal/terminal-message.js.map +1 -1
- package/dist/src/components/tooltip/tooltip.js +1 -1
- package/dist/src/components/tooltip/tooltip.js.map +1 -1
- package/dist/src/components/trust-panel/trust-panel.d.ts +1 -0
- package/dist/src/components/trust-panel/trust-panel.js +19 -19
- package/dist/src/components/trust-panel/trust-panel.js.map +1 -1
- package/dist/src/loader/create-loader.d.ts +13 -0
- package/dist/src/loader/create-loader.js +2 -0
- package/dist/src/loader/create-loader.js.map +1 -0
- package/dist/src/loader/loader.d.ts +44 -0
- package/dist/src/loader/loader.js +2 -0
- package/dist/src/loader/loader.js.map +1 -0
- package/dist/src/loader/registry.d.ts +2 -0
- package/dist/src/loader/registry.js +2 -0
- package/dist/src/loader/registry.js.map +1 -0
- package/dist/src/tokens/tokens.js +1 -1
- package/dist/src/tokens/tokens.js.map +1 -1
- package/package.json +14 -6
- package/schemas/component-manifest.json +1 -1
- package/dist/src/tokens/dark-derivation.d.ts +0 -70
- package/dist/src/tokens/dark-derivation.js +0 -2
- package/dist/src/tokens/dark-derivation.js.map +0 -1
- package/dist/src/tokens/dark-findings.d.ts +0 -59
- package/dist/src/tokens/dark-findings.js +0 -2
- package/dist/src/tokens/dark-findings.js.map +0 -1
- package/dist/src/tokens/story-chrome.d.ts +0 -72
- package/dist/src/tokens/story-chrome.js +0 -292
- package/dist/src/tokens/story-chrome.js.map +0 -1
- package/dist/src/tokens/token-map.d.ts +0 -114
- package/dist/src/tokens/token-map.js +0 -2
- package/dist/src/tokens/token-map.js.map +0 -1
- package/dist/src/tokens/token-purposes.d.ts +0 -63
- package/dist/src/tokens/token-purposes.js +0 -2
- package/dist/src/tokens/token-purposes.js.map +0 -1
- package/dist/src/tokens/type-ceiling-words.d.ts +0 -96
- package/dist/src/tokens/type-ceiling-words.js +0 -2
- package/dist/src/tokens/type-ceiling-words.js.map +0 -1
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A dark value for every semantic colour role, derived from the light theme's
|
|
3
|
-
* own measurements. This is the method behind the 🔬 Dark mode study page in
|
|
4
|
-
* the Figma foundation file, and the data behind Foundations/Theming/Dark mode.
|
|
5
|
-
*
|
|
6
|
-
* Code has no dark theme. These are proposals, computed from tokens.css each
|
|
7
|
-
* time they are read, so they follow the palette instead of describing it.
|
|
8
|
-
*
|
|
9
|
-
* The method is the point: a dark value is chosen to KEEP what the light value
|
|
10
|
-
* measures, not to look like a dark theme.
|
|
11
|
-
*
|
|
12
|
-
* text keeps its contrast against the ground it is read on: the step
|
|
13
|
-
* whose ratio is nearest the light ratio, never below 4.5 where
|
|
14
|
-
* light clears 4.5, with the hierarchy order kept.
|
|
15
|
-
* grounds keep their tonal step from the page, matched by a step LIGHTER
|
|
16
|
-
* than the dark page (on dark, a container is one step lighter).
|
|
17
|
-
* edges keep their ratio class against the page: under 3:1 stays
|
|
18
|
-
* decorative, 3:1 and over stays a boundary.
|
|
19
|
-
* status tints sit at the dark end of the tone's ramp; ink is the
|
|
20
|
-
* nearest-to-light step that clears 4.5 on the tint; accent clears
|
|
21
|
-
* 3:1 on the page AND on its own tint; a fill keeps its light pair
|
|
22
|
-
* unless it would vanish into the dark page, then the chip inverts.
|
|
23
|
-
* action fills are self-contained, so they keep their light value, and
|
|
24
|
-
* their ink (--color-action-on-fill) stays white. The label
|
|
25
|
-
* clears 4.5:1 in every state; a RESTING fill also clears 3:1 on
|
|
26
|
-
* the page, kept by choice. Hover and press are exempt from the
|
|
27
|
-
* page bar: WCAG 1.4.11 treats a hover treatment as supplemental,
|
|
28
|
-
* and a button with a text label needs no boundary at all. On the
|
|
29
|
-
* dark page no ramp could keep it anyway -- label-on-fill times
|
|
30
|
-
* fill-on-page is 19.45 for every fill, so both bars leave a band
|
|
31
|
-
* only 1.44:1 wide (decision 4, decided 2026-10-02).
|
|
32
|
-
*
|
|
33
|
-
* A role is measured on every ground code draws it on, not only the page --
|
|
34
|
-
* the first version measured accent and brand text on the page alone, and the
|
|
35
|
-
* Alert atom is what showed it. Only existing primitives are used: where no
|
|
36
|
-
* step meets a rule, the nearest is returned and the row fails, because adding
|
|
37
|
-
* a primitive is its own decision.
|
|
38
|
-
*
|
|
39
|
-
* Not a story file: Storybook only globs *.stories.js. Pure, so it runs under
|
|
40
|
-
* Node too -- the parity check against the original script did.
|
|
41
|
-
*/
|
|
42
|
-
type Step = [ramp: string, step: number];
|
|
43
|
-
interface Row<S = Step> {
|
|
44
|
-
token: string;
|
|
45
|
-
light: S | null;
|
|
46
|
-
lightRatio: number | null;
|
|
47
|
-
dark: S | null;
|
|
48
|
-
darkRatio: number | null;
|
|
49
|
-
against: string;
|
|
50
|
-
rule: string;
|
|
51
|
-
need: number | null;
|
|
52
|
-
ok: boolean | null;
|
|
53
|
-
groundRatio?: number;
|
|
54
|
-
state?: boolean;
|
|
55
|
-
}
|
|
56
|
-
export interface DarkRow extends Row<string> {
|
|
57
|
-
lightHex: string | null;
|
|
58
|
-
darkHex: string | null;
|
|
59
|
-
}
|
|
60
|
-
export declare const blank: (text: string) => string;
|
|
61
|
-
/** name -> declared value, first declaration wins. */
|
|
62
|
-
export declare function declarations(cssText: string): Map<string, string>;
|
|
63
|
-
export declare function luminance(hex: string): number;
|
|
64
|
-
export declare function contrast(a: string, b: string): number;
|
|
65
|
-
export declare function derive(cssText: string): {
|
|
66
|
-
page: string;
|
|
67
|
-
ramps: Record<string, Record<number, string>>;
|
|
68
|
-
rows: DarkRow[];
|
|
69
|
-
};
|
|
70
|
-
export {};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var e=/^--color-(blue|red|green|yellow|neutral)-(\d+)$/,t=e=>e.replace(/\/\*[\s\S]*?\*\//g,``);function n(e){let n=/* @__PURE__ */ new Map;for(let r of t(e).matchAll(/(?:^|[\s;{])(--[A-Za-z0-9-]+)\s*:\s*([^;]*);/g))n.has(r[1])||n.set(r[1],r[2]);return n}function r(e){let t=[1,3,5].map(t=>parseInt(e.slice(t,t+2),16)/255).map(e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4);return .2126*t[0]+.7152*t[1]+.0722*t[2]}function i(e,t){let[n,i]=[r(e),r(t)].sort((e,t)=>t-e);return(n+.05)/(i+.05)}var a=e=>e.toFixed(2),o=e=>e.toFixed(3);function s(t){let s=n(t),c={};for(let[t,n]of s){let r=t.match(e);r&&((c[r[1]]??={})[Number(r[2])]=n.trim().toLowerCase())}let l=e=>{let t=e.trim(),n=t.match(/^var\(\s*(--color-brand-(?:\d+|on-fill))\s*\)$/);n&&s.has(n[1])&&(t=s.get(n[1]).trim());let r=t.match(/^var\(\s*--color-(blue|red|green|yellow|neutral)-(\d+)\s*\)$/);return r?[r[1],Number(r[2])]:null},u=e=>c[e[0]][e[1]],d=e=>e?u(e):null,f=e=>Object.keys(c[e]).map(Number).sort((e,t)=>e-t),p=e=>s.has(e)?l(s.get(e)):null,m=(e,t)=>e&&t&&e[0]===t[0]&&e[1]===t[1],h=r,g=i;function _(e,t,n,{floor:r=null,lighterThan:i=null,exclude:a=[],also:o=[]}={}){let s=null,l=null;for(let u of f(e)){if(a.some(t=>m(t,[e,u])))continue;let d=c[e][u];if(i&&h(d)<=h(i))continue;let f=g(d,t),p=Math.abs(f-n);r&&(f<r||o.some(e=>g(d,e)<r))?(l===null||p<l[0])&&(l=[p,[e,u]]):(s===null||p<s[0])&&(s=[p,[e,u]])}return(s??l)?.[1]??null}let v=[],y=(e,t,n,r,i,a,o=null,s=[])=>{let c=p(e),l=c&&r?g(u(c),r):null,d=t&&i?g(u(t),i):null,f=o===null?null:t!==null&&d!==null&&d>=o&&s.every(e=>g(u(t),e)>=o);return v.push({token:e,light:c,lightRatio:l,dark:t,darkRatio:d,against:n,rule:a,need:o,ok:f}),t},b=c.neutral[0],x={};for(let e of s.keys()){let t=p(e);t&&(x[e]=u(t))}let S=[`neutral`,950],C=u(S);y(`--color-surface-default`,S,`itself`,x[`--color-surface-default`],C,`the dark page: near-black rather than pure black, so a lighter container step exists above it`);let w={},T=S;for(let e of[`--color-surface-container`,`--color-surface-subtle`,`--color-surface-muted`,`--color-surface-disabled`,`--color-surface-pressed`]){if(!x[e])continue;let t=Object.keys(w).find(t=>x[t]===x[e]),n=g(x[e],x[`--color-surface-default`]),r=t?w[t]:_(`neutral`,C,n,{lighterThan:u(T)});w[e]=r,r&&(T=r),y(e,r,`surface-default`,x[`--color-surface-default`],C,t?`shares ${t.slice(16)}'s value in light, so shares it in dark`:`keeps its tonal step from the page (light ${o(n)}), further out than the ground before it`)}y(`--color-surface-inverse`,[`neutral`,50],`surface-default`,x[`--color-surface-default`],C,`flips: on a dark theme the inverse ground is the light one (Foundations/Surfaces)`),y(`--color-surface-brand`,p(`--color-surface-brand`),`surface-default`,x[`--color-surface-default`],C,`follows the brand, not the neutral ramp: unchanged`);let E=null;for(let e of[`--color-text-primary`,`--color-text-secondary`,`--color-text-muted`,`--color-text-subtle`]){let t=g(x[e],b),n=t>=4.5?4.5:null,r=_(`neutral`,C,t,{floor:n,lighterThan:C});if(r&&E&&h(u(r))>=h(u(E))){let e=h(u(E)),i=f(`neutral`).filter(t=>h(c.neutral[t])<e&&(!n||g(c.neutral[t],C)>=n));if(i.length)r=[`neutral`,Math.min(...i)];else{let n=f(`neutral`).filter(t=>h(c.neutral[t])<e&&h(c.neutral[t])>h(C));n.length&&(r=[`neutral`,n.reduce((e,n)=>Math.abs(g(c.neutral[n],C)-t)<Math.abs(g(c.neutral[e],C)-t)?n:e)])}}E=r??E,y(e,r,`surface-default`,b,C,`keeps its contrast on the page (light ${a(t)}:1)`,n)}{let e=`--color-text-disabled`,t=g(x[e],b);y(e,_(`neutral`,C,t,{lighterThan:C}),`surface-default`,b,C,`STATE, exempt from the minimum: keeps its light ratio (${a(t)}:1)`)}let D=u([`neutral`,50]);for(let e of[`--color-text-inverse`,`--color-text-muted-inverse`]){let t=g(x[e],x[`--color-surface-inverse`]);y(e,_(`neutral`,D,t,{floor:4.5}),`surface-inverse`,x[`--color-surface-inverse`],D,`keeps its contrast on the inverse ground (light ${a(t)}:1)`,4.5)}for(let[e,t]of[[`success`,`green`],[`warning`,`yellow`],[`error`,`red`],[`info`,`blue`]]){let n=`--color-surface-${e}`,r=g(x[n],x[`--color-surface-default`]),i=_(t,C,r,{lighterThan:C});y(n,i,`surface-default`,x[`--color-surface-default`],C,`a tint one step off the page, like light (${o(r)})`);let s=`--color-text-${e}`;if(x[s]){let r=g(x[s],x[n]),o=d(i);y(s,o?_(t,o,r,{floor:4.5}):null,`surface-${e}`,x[n],o,`keeps its contrast on its paired tint (light ${a(r)}:1)`,4.5)}}for(let e of[`--color-border-subtle`,`--color-border-default`,`--color-border-strong`,`--color-border-disabled`,`--color-border-container`]){let t=g(x[e],b),n=t>=3?3:null;y(e,_(`neutral`,C,t,{floor:n,lighterThan:C}),`surface-default`,b,C,`keeps its ratio class on the page (light ${a(t)}:1)`,n)}{let e=`--color-border-brand`,t=g(x[e],b);y(e,_(`blue`,C,t,{floor:3}),`surface-default`,b,C,`keeps its boundary contrast (light ${a(t)}:1)`,3)}let O=[`--color-action-primary`,`--color-action-primary-hover`,`--color-action-primary-active`,`--color-action-accent`,`--color-action-accent-hover`,`--color-action-accent-active`],k=e=>/-(hover|active)$/.test(e),A=(e,t,n,r,i,o)=>{let s=k(e);v.push({token:e,light:t,lightRatio:t&&g(b,u(t)),dark:n,darkRatio:r,against:`white label`,rule:`${o}: the white label keeps ${a(r)}:1; against the dark page it measures ${a(i)}:1${s?`, a state, so supplemental`:`, a resting fill, kept at 3:1`}`,need:4.5,ok:r>=4.5&&(s||i>=3),groundRatio:i,state:s})};for(let e of O){let t=p(e);t?A(e,t,t,g(b,u(t)),g(u(t),C),`self-contained fill`):y(e,null,`white label`,null,null,`self-contained fill, but its light value is not a palette step, so there is nothing to keep`,4.5)}if(s.has(`--color-action-secondary`)){let e=f(`neutral`).filter(e=>g(b,c.neutral[e])>=4.5),t=e.filter(e=>g(c.neutral[e],C)>=3).reduce((e,t)=>g(c.neutral[t],C)>g(c.neutral[e],C)?t:e,e[0]),n=e.filter(e=>e>t),r={"--color-action-secondary":t,"--color-action-secondary-hover":n[0],"--color-action-secondary-active":n[1]};for(let[e,t]of Object.entries(r)){if(!s.has(e)||t==null)continue;let n=c.neutral[t];A(e,p(e),[`neutral`,t],g(b,n),g(n,C),`the neutral fill moves off the dark page`)}}let j={};for(let[e,t]of Object.entries({neutral:`neutral`,brand:`blue`,info:`blue`,success:`green`,warning:`yellow`,error:`red`})){let n=`--status-${e}-`,r=s.has(`${n}surface-strong`),i=g(x[`${n}surface`],b),l=_(t,C,i,{lighterThan:C});if(y(`${n}surface`,l,`surface-default`,b,C,l?`the light tint: one step off the page, like light (${o(i)})`:`no step of the ${t} ramp is lighter than the page, so the tone has no tint, and nothing measured on one is derived`),!l)continue;let m=null;if(r){let e=g(x[`${n}surface-strong`],b);m=_(t,C,e,{lighterThan:u(l),exclude:[l]}),y(`${n}surface-strong`,m,`surface-default`,b,C,`the heavier tint: further from the page than -surface, like light (${o(e)})`)}let h=u(m||l),v=r?`surface-strong`:`surface`,S=g(x[`${n}text`],x[n+v]);y(`${n}text`,_(t,h,S,{floor:4.5}),v,x[n+v],h,`ink on the heavier tint a badge uses, keeping light (${a(S)}:1)`,4.5);let w=g(x[`${n}border`],x[`${n}surface`]);y(`${n}border`,_(t,u(l),w,{lighterThan:u(l)}),`surface`,x[`${n}surface`],u(l),`the tag hairline on its own tint, keeping light (${a(w)}:1)`),j[e]=u(l);let T=g(x[`${n}accent`],b),E=_(t,C,T,{floor:3,also:[u(l)]});y(`${n}accent`,E,`surface-default`,b,C,`the badge dot on the page AND the alert icon on its own tint: clears 3:1 on both (${E?a(g(u(E),u(l))):`—`}:1 on the tint; light ${a(T)}:1 on the page)`,3,[u(l)]);let D=p(`${n}fill`),O=p(`${n}on-fill`),k=`self-contained chip: unchanged`;if(D&&g(u(D),C)<3){let e=_(t,C,g(x[`${n}fill`],b),{floor:3});D=e,O=e?[`neutral`,f(`neutral`).reduce((t,n)=>g(c.neutral[n],u(e))>g(c.neutral[t],u(e))?n:t)]:null,k=`the light fill vanishes into the dark page, so the chip inverts`}y(`${n}fill`,D,`surface-default`,b,C,k,3),y(`${n}on-fill`,O,`fill`,x[`${n}fill`],d(D),`ink on the fill`,4.5)}let M=Object.values(j),N=g(x[`--color-text-brand`],b),P=_(`blue`,C,N,{floor:4.5,also:M}),F=P&&Math.min(...M.map(e=>g(u(P),e)));if(y(`--color-text-brand`,P,`surface-default`,b,C,`keeps its contrast on the page (light ${a(N)}:1) AND clears 4.5:1 on every status tint, where an alert sets its action link (${F===null?`—`:a(F)}:1 on the weakest)`,4.5,M),s.has(`--color-text-brand-hover`)){let e=g(x[`--color-text-brand-hover`],x[`--color-text-brand`]),t=d(P),n=t?f(`blue`).filter(e=>h(c.blue[e])>h(t)&&[C,...M].every(t=>g(c.blue[e],t)>=4.5)):[],r=t&&n.length?[`blue`,n.reduce((n,r)=>Math.abs(g(c.blue[r],t)-e)<Math.abs(g(c.blue[n],t)-e)?r:n)]:null;y(`--color-text-brand-hover`,r,`surface-default`,b,C,`one step past the rest colour, away from the page as in light (${r&&t?a(g(u(r),t)):`—`}:1 from it; light ${a(e)})`,4.5)}if(s.has(`--color-action-on-fill`)){let e=O.map(e=>p(e)).filter(e=>e!==null),t=e.length===O.length?Math.min(...e.map(e=>g(b,u(e)))):null;v.push({token:`--color-action-on-fill`,light:p(`--color-action-on-fill`),lightRatio:t,dark:p(`--color-action-on-fill`),darkRatio:t,against:`action fills`,rule:`white in both themes: the fills do not change, so neither does their ink (weakest ${t===null?`—`:a(t)}:1)`,need:4.5,ok:t!==null&&t>=4.5})}if(s.has(`--color-surface-media`)){let e=d(p(`--color-surface-media`));y(`--color-surface-media`,p(`--color-surface-media`),`surface-default`,x[`--color-surface-default`],C,`fixed: the frame around media is dark in every theme, so it keeps its light value`);for(let t of[`--color-text-on-media`,`--color-text-on-media-muted`])s.has(t)&&y(t,p(t),`surface-media`,e,e,`fixed with its ground: ${e&&x[t]?a(g(x[t],e)):`—`}:1 on the frame in either theme`,4.5)}let I=e=>e?`${e[0]}/${e[1]}`:null;return{page:u(S),ramps:c,rows:v.map(e=>({...e,light:I(e.light),dark:I(e.dark),lightHex:e.light?u(e.light):null,darkHex:e.dark?u(e.dark):null}))}}export{t as blank,i as contrast,n as declarations,s as derive,r as luminance};
|
|
2
|
-
//# sourceMappingURL=dark-derivation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dark-derivation.js","names":["RAMP","blank","text","declarations","out","m","cssText","luminance","c","hex","i","x","contrast","y","a","b","q","p","f2","n","f3","derive","decl","RAMPS","k","v","prim","r","ref","hexof","hexOrNull","steps","ramp","lightOf","t","same","lum","ratio","nearest","best","below","s","exclude","e","h","lighterThan","ground","d","target","floor","also","g","rows","row","lp","token","lightRatio","againstLight","darkRatio","dark","againstDark","ok","need","WHITE","L","PAGE","page","groundOf","prevGround","twin","prev","above","cands","darker","invDark","tone","st","step","tint","tt","tintHex","FILLS","isState","fillRow","state","dk","label","lead","usable","rest","after","pick","TINTS","hasStrong","sTarget","surf","strong","ssTarget","inkGround","inkOn","tTarget","bTarget","aTarget","accent","fill","onfill","why","inverted","tints","brandTarget","brand","brandWorst","sep","hover","fills","worst","frame","name"],"sources":["../../../src/tokens/dark-derivation.ts"],"sourcesContent":["/**\n * A dark value for every semantic colour role, derived from the light theme's\n * own measurements. This is the method behind the 🔬 Dark mode study page in\n * the Figma foundation file, and the data behind Foundations/Theming/Dark mode.\n *\n * Code has no dark theme. These are proposals, computed from tokens.css each\n * time they are read, so they follow the palette instead of describing it.\n *\n * The method is the point: a dark value is chosen to KEEP what the light value\n * measures, not to look like a dark theme.\n *\n * text keeps its contrast against the ground it is read on: the step\n * whose ratio is nearest the light ratio, never below 4.5 where\n * light clears 4.5, with the hierarchy order kept.\n * grounds keep their tonal step from the page, matched by a step LIGHTER\n * than the dark page (on dark, a container is one step lighter).\n * edges keep their ratio class against the page: under 3:1 stays\n * decorative, 3:1 and over stays a boundary.\n * status tints sit at the dark end of the tone's ramp; ink is the\n * nearest-to-light step that clears 4.5 on the tint; accent clears\n * 3:1 on the page AND on its own tint; a fill keeps its light pair\n * unless it would vanish into the dark page, then the chip inverts.\n * action fills are self-contained, so they keep their light value, and\n * their ink (--color-action-on-fill) stays white. The label\n * clears 4.5:1 in every state; a RESTING fill also clears 3:1 on\n * the page, kept by choice. Hover and press are exempt from the\n * page bar: WCAG 1.4.11 treats a hover treatment as supplemental,\n * and a button with a text label needs no boundary at all. On the\n * dark page no ramp could keep it anyway -- label-on-fill times\n * fill-on-page is 19.45 for every fill, so both bars leave a band\n * only 1.44:1 wide (decision 4, decided 2026-10-02).\n *\n * A role is measured on every ground code draws it on, not only the page --\n * the first version measured accent and brand text on the page alone, and the\n * Alert atom is what showed it. Only existing primitives are used: where no\n * step meets a rule, the nearest is returned and the row fails, because adding\n * a primitive is its own decision.\n *\n * Not a story file: Storybook only globs *.stories.js. Pure, so it runs under\n * Node too -- the parity check against the original script did.\n */\n\nconst RAMP = /^--color-(blue|red|green|yellow|neutral)-(\\d+)$/;\n\ntype Step = [ramp: string, step: number];\n\ninterface Row<S = Step> {\n token : string;\n light : S | null;\n lightRatio : number | null;\n dark : S | null;\n darkRatio : number | null;\n against : string;\n rule : string;\n need : number | null;\n ok : boolean | null;\n groundRatio?: number;\n state? : boolean;\n}\n\nexport interface DarkRow extends Row<string> {\n lightHex: string | null;\n darkHex : string | null;\n}\n\ninterface NearestOptions {\n floor? : number | null;\n lighterThan?: string | null;\n exclude? : (Step | null)[];\n also? : string[];\n}\n\nexport const blank = (text: string) => text.replace(/\\/\\*[\\s\\S]*?\\*\\//g, '');\n\n/** name -> declared value, first declaration wins. */\nexport function declarations(cssText: string) {\n const out = new Map<string, string>();\n for (const m of blank(cssText).matchAll(/(?:^|[\\s;{])(--[A-Za-z0-9-]+)\\s*:\\s*([^;]*);/g)) {\n if (!out.has(m[1])) out.set(m[1], m[2]);\n }\n return out;\n}\n\nexport function luminance(hex: string) {\n const c = [1, 3, 5].map(i => parseInt(hex.slice(i, i + 2), 16) / 255)\n .map(x => (x <= 0.03928 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4));\n return 0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2];\n}\n\nexport function contrast(a: string, b: string) {\n const [x, y] = [luminance(a), luminance(b)].sort((p, q) => q - p);\n return (x + 0.05) / (y + 0.05);\n}\n\nconst f2 = (n: number) => n.toFixed(2);\nconst f3 = (n: number) => n.toFixed(3);\n\nexport function derive(cssText: string) {\n const decl = declarations(cssText);\n const RAMPS: Record<string, Record<number, string>> = {};\n for (const [k, v] of decl) {\n const m = k.match(RAMP);\n if (m) (RAMPS[m[1]] ??= {})[Number(m[2])] = v.trim().toLowerCase();\n }\n /* The brand's contract colour tokens are aliases a theme restates, not roles\n with a job of their own: --color-brand-N aliases a palette step (today\n --color-blue-N, step for step) and --color-brand-on-fill aliases\n --color-neutral-0. Each is seen through to its step. Only these -- a role\n that aliases another role is still not a primitive, and treating it as one\n would change what this derives. */\n const prim = (ref: string): Step | null => {\n let r = ref.trim();\n const b = r.match(/^var\\(\\s*(--color-brand-(?:\\d+|on-fill))\\s*\\)$/);\n if (b && decl.has(b[1])) r = decl.get(b[1])!.trim();\n const m = r.match(/^var\\(\\s*--color-(blue|red|green|yellow|neutral)-(\\d+)\\s*\\)$/);\n return m ? [m[1], Number(m[2])] : null;\n };\n const hexof = (p: Step) => RAMPS[p[0]][p[1]];\n // a step that may not be there: a light value that is not a palette step,\n // or a ramp with no step lighter than the ground asked for\n const hexOrNull = (p: Step | null) => (p ? hexof(p) : null);\n const steps = (ramp: string) => Object.keys(RAMPS[ramp]).map(Number)\n .sort((a, b) => a - b);\n const lightOf = (t: string) => (decl.has(t) ? prim(decl.get(t)!) : null);\n const same = (a: Step | null, b: Step | null) => a && b && a[0] === b[0] && a[1] === b[1];\n const lum = luminance, ratio = contrast;\n\n /* The step whose ratio on `ground` is nearest `target`. Where no step\n clears the floor, the nearest of the rest is returned all the same and\n the row that asked fails on it, as the header says. It used to return\n null there, which callers handed straight to hexof(), so one failing row\n threw and blanked the page. null now means only that `lighterThan` and\n `exclude` left no step at all. */\n function nearest(ramp: string, ground: string, target: number, { floor = null, lighterThan = null, exclude = [], also = [] }: NearestOptions = {}): Step | null {\n let best: [number, Step] | null = null;\n let below: [number, Step] | null = null;\n for (const s of steps(ramp)) {\n if (exclude.some(e => same(e, [ramp, s]))) continue;\n const h = RAMPS[ramp][s];\n if (lighterThan && lum(h) <= lum(lighterThan)) continue;\n const r = ratio(h, ground);\n const d = Math.abs(r - target);\n if (floor && (r < floor || also.some(g => ratio(h, g) < floor))) {\n if (below === null || d < below[0]) below = [d, [ramp, s]];\n } else if (best === null || d < best[0]) best = [d, [ramp, s]];\n }\n return (best ?? below)?.[1] ?? null;\n }\n\n const rows: Row[] = [];\n // `also`: the further grounds a rule is measured on, as nearest() takes them.\n // The row passes only if it clears every one, not only the ground it shows.\n const row = (token: string, dark: Step | null, against: string, againstLight: string | null, againstDark: string | null, rule: string, need: number | null = null, also: string[] = []) => {\n const lp = lightOf(token);\n const lightRatio = lp && againstLight ? ratio(hexof(lp), againstLight) : null;\n const darkRatio = dark && againstDark ? ratio(hexof(dark), againstDark) : null;\n const ok = need === null ? null : dark !== null && darkRatio !== null && darkRatio >= need && also.every(g => ratio(hexof(dark), g) >= need);\n rows.push({ token, light: lp, lightRatio, dark, darkRatio, against, rule, need, ok });\n return dark;\n };\n\n const WHITE = RAMPS.neutral[0];\n const L: Record<string, string> = {};\n for (const t of decl.keys()) { const p = lightOf(t); if (p) L[t] = hexof(p); }\n\n // ---------------------------------------------------------------- grounds --\n const PAGE: Step = ['neutral', 950]; // near-black, so a lighter container step exists\n const page = hexof(PAGE);\n row('--color-surface-default', PAGE, 'itself', L['--color-surface-default'], page,\n 'the dark page: near-black rather than pure black, so a lighter container step exists above it');\n // in light order, each further from the page than the last: a ground that\n // lands on its neighbour's step has lost the step it exists for. Two grounds\n // that share a value in light (muted and disabled) share it in dark.\n const groundOf: Record<string, Step | null> = {};\n let prevGround: Step = PAGE;\n for (const t of ['--color-surface-container', '--color-surface-subtle', '--color-surface-muted', '--color-surface-disabled', '--color-surface-pressed']) {\n if (!L[t]) continue;\n const twin = Object.keys(groundOf).find(k => L[k] === L[t]);\n const target = ratio(L[t], L['--color-surface-default']);\n const d: Step | null = twin ? groundOf[twin] : nearest('neutral', page, target, { lighterThan: hexof(prevGround) });\n groundOf[t] = d;\n if (d) prevGround = d;\n row(t, d, 'surface-default', L['--color-surface-default'], page,\n twin ? `shares ${twin.slice(16)}'s value in light, so shares it in dark` : `keeps its tonal step from the page (light ${f3(target)}), further out than the ground before it`);\n }\n row('--color-surface-inverse', ['neutral', 50], 'surface-default', L['--color-surface-default'], page,\n 'flips: on a dark theme the inverse ground is the light one (Foundations/Surfaces)');\n row('--color-surface-brand', lightOf('--color-surface-brand'), 'surface-default', L['--color-surface-default'], page,\n 'follows the brand, not the neutral ramp: unchanged');\n\n // ------------------------------------------------------------------- text --\n let prev: Step | null = null;\n for (const t of ['--color-text-primary', '--color-text-secondary', '--color-text-muted', '--color-text-subtle']) {\n const target = ratio(L[t], WHITE);\n const floor = target >= 4.5 ? 4.5 : null;\n let d = nearest('neutral', page, target, { floor, lighterThan: page });\n if (d && prev && lum(hexof(d)) >= lum(hexof(prev))) { // keep the hierarchy strictly ordered\n const above = lum(hexof(prev));\n const cands = steps('neutral').filter(s => lum(RAMPS.neutral[s]) < above && (!floor || ratio(RAMPS.neutral[s], page) >= floor));\n if (cands.length) d = ['neutral', Math.min(...cands)];\n else { // nothing clears the floor: the nearest, and the row fails\n const darker = steps('neutral').filter(s => lum(RAMPS.neutral[s]) < above && lum(RAMPS.neutral[s]) > lum(page));\n if (darker.length) d = ['neutral', darker.reduce((a, s) => (Math.abs(ratio(RAMPS.neutral[s], page) - target) < Math.abs(ratio(RAMPS.neutral[a], page) - target) ? s : a))];\n }\n }\n prev = d ?? prev;\n row(t, d, 'surface-default', WHITE, page, `keeps its contrast on the page (light ${f2(target)}:1)`, floor);\n }\n {\n const t = '--color-text-disabled';\n const target = ratio(L[t], WHITE);\n row(t, nearest('neutral', page, target, { lighterThan: page }), 'surface-default', WHITE, page,\n `STATE, exempt from the minimum: keeps its light ratio (${f2(target)}:1)`);\n }\n const invDark = hexof(['neutral', 50]);\n for (const t of ['--color-text-inverse', '--color-text-muted-inverse']) {\n const target = ratio(L[t], L['--color-surface-inverse']);\n row(t, nearest('neutral', invDark, target, { floor: 4.5 }), 'surface-inverse', L['--color-surface-inverse'], invDark,\n `keeps its contrast on the inverse ground (light ${f2(target)}:1)`, 4.5);\n }\n // feedback pairs: tint first, then the ink measured on it\n for (const [tone, ramp] of [['success', 'green'], ['warning', 'yellow'], ['error', 'red'], ['info', 'blue']]) {\n const st = `--color-surface-${tone}`;\n const step = ratio(L[st], L['--color-surface-default']);\n const tint = nearest(ramp, page, step, { lighterThan: page });\n row(st, tint, 'surface-default', L['--color-surface-default'], page, `a tint one step off the page, like light (${f3(step)})`);\n const tt = `--color-text-${tone}`;\n if (L[tt]) {\n const target = ratio(L[tt], L[st]);\n const tintHex = hexOrNull(tint);\n row(tt, tintHex ? nearest(ramp, tintHex, target, { floor: 4.5 }) : null, `surface-${tone}`, L[st], tintHex,\n `keeps its contrast on its paired tint (light ${f2(target)}:1)`, 4.5);\n }\n }\n\n // ------------------------------------------------------------------ edges --\n for (const t of ['--color-border-subtle', '--color-border-default', '--color-border-strong', '--color-border-disabled', '--color-border-container']) {\n const target = ratio(L[t], WHITE);\n const floor = target >= 3 ? 3 : null;\n row(t, nearest('neutral', page, target, { floor, lighterThan: page }), 'surface-default', WHITE, page,\n `keeps its ratio class on the page (light ${f2(target)}:1)`, floor);\n }\n {\n const t = '--color-border-brand';\n const target = ratio(L[t], WHITE);\n row(t, nearest('blue', page, target, { floor: 3 }), 'surface-default', WHITE, page, `keeps its boundary contrast (light ${f2(target)}:1)`, 3);\n }\n\n // ----------------------------------------------------------------- action --\n const FILLS = ['--color-action-primary', '--color-action-primary-hover', '--color-action-primary-active',\n '--color-action-accent', '--color-action-accent-hover', '--color-action-accent-active'];\n const isState = (t: string) => /-(hover|active)$/.test(t);\n const fillRow = (t: string, lp: Step | null, dk: Step, label: number, ground: number, lead: string) => {\n const state = isState(t);\n rows.push({ token : t, light : lp, lightRatio : lp && ratio(WHITE, hexof(lp)), dark : dk, darkRatio : label, against : 'white label',\n rule : `${lead}: the white label keeps ${f2(label)}:1; against the dark page it measures ${f2(ground)}:1${state ? ', a state, so supplemental' : ', a resting fill, kept at 3:1'}`,\n need : 4.5, ok : label >= 4.5 && (state || ground >= 3), groundRatio: ground, state });\n };\n for (const t of FILLS) {\n const lp = lightOf(t);\n if (lp) fillRow(t, lp, lp, ratio(WHITE, hexof(lp)), ratio(hexof(lp), page), 'self-contained fill');\n else row(t, null, 'white label', null, null, 'self-contained fill, but its light value is not a palette step, so there is nothing to keep', 4.5);\n }\n\n // the neutral fill cannot keep its light value: neutral-950 IS the dark page.\n // Rest takes the step that clears 3:1 on the page and keeps the white label\n // at 4.5; hover and press step away from the label's side of the ramp, the\n // direction light's primary and accent ramps already go (decision 4).\n if (decl.has('--color-action-secondary')) {\n const usable = steps('neutral').filter(s => ratio(WHITE, RAMPS.neutral[s]) >= 4.5);\n const rest = usable.filter(s => ratio(RAMPS.neutral[s], page) >= 3).reduce((a, s) => (ratio(RAMPS.neutral[s], page) > ratio(RAMPS.neutral[a], page) ? s : a), usable[0]);\n const after = usable.filter(s => s > rest);\n const pick = { '--color-action-secondary': rest, '--color-action-secondary-hover': after[0], '--color-action-secondary-active': after[1] };\n for (const [t, step] of Object.entries(pick)) {\n if (!decl.has(t) || step == null) continue;\n const hex = RAMPS.neutral[step];\n fillRow(t, lightOf(t), ['neutral', step], ratio(WHITE, hex), ratio(hex, page), 'the neutral fill moves off the dark page');\n }\n }\n\n // ----------------------------------------------------------------- status --\n const TINTS: Record<string, string> = {};\n const TONES = { neutral: 'neutral', brand: 'blue', info: 'blue', success: 'green', warning: 'yellow', error: 'red' };\n for (const [tone, ramp] of Object.entries(TONES)) {\n const p = `--status-${tone}-`;\n const hasStrong = decl.has(`${p}surface-strong`);\n const sTarget = ratio(L[`${p}surface`], WHITE);\n const surf = nearest(ramp, page, sTarget, { lighterThan: page });\n row(`${p}surface`, surf, 'surface-default', WHITE, page, surf\n ? `the light tint: one step off the page, like light (${f3(sTarget)})`\n : `no step of the ${ramp} ramp is lighter than the page, so the tone has no tint, and nothing measured on one is derived`);\n if (!surf) continue;\n let strong: Step | null = null;\n if (hasStrong) {\n const ssTarget = ratio(L[`${p}surface-strong`], WHITE);\n strong = nearest(ramp, page, ssTarget, { lighterThan: hexof(surf), exclude: [surf] });\n row(`${p}surface-strong`, strong, 'surface-default', WHITE, page,\n `the heavier tint: further from the page than -surface, like light (${f3(ssTarget)})`);\n }\n const inkGround = hexof(strong || surf);\n const inkOn = hasStrong ? 'surface-strong' : 'surface';\n const tTarget = ratio(L[`${p}text`], L[p + inkOn]);\n row(`${p}text`, nearest(ramp, inkGround, tTarget, { floor: 4.5 }), inkOn, L[p + inkOn], inkGround,\n `ink on the heavier tint a badge uses, keeping light (${f2(tTarget)}:1)`, 4.5);\n const bTarget = ratio(L[`${p}border`], L[`${p}surface`]);\n row(`${p}border`, nearest(ramp, hexof(surf), bTarget, { lighterThan: hexof(surf) }), 'surface', L[`${p}surface`], hexof(surf),\n `the tag hairline on its own tint, keeping light (${f2(bTarget)}:1)`);\n TINTS[tone] = hexof(surf);\n const aTarget = ratio(L[`${p}accent`], WHITE);\n const accent = nearest(ramp, page, aTarget, { floor: 3, also: [hexof(surf)] });\n row(`${p}accent`, accent, 'surface-default', WHITE, page,\n `the badge dot on the page AND the alert icon on its own tint: clears 3:1 on both (${accent ? f2(ratio(hexof(accent), hexof(surf))) : '—'}:1 on the tint; light ${f2(aTarget)}:1 on the page)`, 3, [hexof(surf)]);\n let fill = lightOf(`${p}fill`), onfill = lightOf(`${p}on-fill`), why = 'self-contained chip: unchanged';\n if (fill && ratio(hexof(fill), page) < 3) { // would vanish into the page: invert the chip\n const inverted = nearest(ramp, page, ratio(L[`${p}fill`], WHITE), { floor: 3 });\n fill = inverted;\n onfill = inverted ? ['neutral', steps('neutral').reduce((a, s) => (ratio(RAMPS.neutral[s], hexof(inverted)) > ratio(RAMPS.neutral[a], hexof(inverted)) ? s : a))] : null;\n why = 'the light fill vanishes into the dark page, so the chip inverts';\n }\n row(`${p}fill`, fill, 'surface-default', WHITE, page, why, 3);\n row(`${p}on-fill`, onfill, 'fill', L[`${p}fill`], hexOrNull(fill), 'ink on the fill', 4.5);\n }\n\n // ------------------------------------------------- brand text, every ground --\n const tints = Object.values(TINTS);\n const brandTarget = ratio(L['--color-text-brand'], WHITE);\n const brand = nearest('blue', page, brandTarget, { floor: 4.5, also: tints });\n const brandWorst = brand && Math.min(...tints.map(g => ratio(hexof(brand), g)));\n row('--color-text-brand', brand, 'surface-default', WHITE, page,\n `keeps its contrast on the page (light ${f2(brandTarget)}:1) AND clears 4.5:1 on every status tint, where an alert sets its action link (${brandWorst === null ? '—' : f2(brandWorst)}:1 on the weakest)`, 4.5, tints);\n\n // ------------------------------------------- roles added by 591c695a --\n if (decl.has('--color-text-brand-hover')) {\n const sep = ratio(L['--color-text-brand-hover'], L['--color-text-brand']);\n const rest = hexOrNull(brand);\n const cands = rest ? steps('blue').filter(s => lum(RAMPS.blue[s]) > lum(rest) && [page, ...tints].every(g => ratio(RAMPS.blue[s], g) >= 4.5)) : [];\n const hover: Step | null = rest && cands.length ? ['blue', cands.reduce((a, s) => (Math.abs(ratio(RAMPS.blue[s], rest) - sep) < Math.abs(ratio(RAMPS.blue[a], rest) - sep) ? s : a))] : null;\n row('--color-text-brand-hover', hover, 'surface-default', WHITE, page,\n `one step past the rest colour, away from the page as in light (${hover && rest ? f2(ratio(hexof(hover), rest)) : '—'}:1 from it; light ${f2(sep)})`, 4.5);\n }\n if (decl.has('--color-action-on-fill')) {\n const fills = FILLS.map(t => lightOf(t)).filter((p): p is Step => p !== null);\n const worst = fills.length === FILLS.length ? Math.min(...fills.map(p => ratio(WHITE, hexof(p)))) : null;\n rows.push({ token : '--color-action-on-fill', light : lightOf('--color-action-on-fill'), lightRatio: worst, dark : lightOf('--color-action-on-fill'), darkRatio : worst,\n against : 'action fills', rule : `white in both themes: the fills do not change, so neither does their ink (weakest ${worst === null ? '—' : f2(worst)}:1)`, need : 4.5, ok : worst !== null && worst >= 4.5 });\n }\n\n // ------------------------------------------ the media frame, decision 15 --\n // fixed in every theme: a letterbox and a terminal are dark whatever the page\n // is, and their ink is fixed with them. Measured on the frame, not the page.\n if (decl.has('--color-surface-media')) {\n const frame = hexOrNull(lightOf('--color-surface-media'));\n row('--color-surface-media', lightOf('--color-surface-media'), 'surface-default', L['--color-surface-default'], page,\n 'fixed: the frame around media is dark in every theme, so it keeps its light value');\n for (const t of ['--color-text-on-media', '--color-text-on-media-muted']) {\n if (!decl.has(t)) continue;\n row(t, lightOf(t), 'surface-media', frame, frame,\n `fixed with its ground: ${frame && L[t] ? f2(ratio(L[t], frame)) : '—'}:1 on the frame in either theme`, 4.5);\n }\n }\n\n const name = (p: Step | null) => (p ? `${p[0]}/${p[1]}` : null);\n return {\n page : hexof(PAGE),\n ramps: RAMPS,\n rows : rows.map((r): DarkRow => ({ ...r, light: name(r.light), dark: name(r.dark), lightHex: r.light ? hexof(r.light) : null, darkHex: r.dark ? hexof(r.dark) : null }))\n };\n}\n"],"mappings":"AA0CA,IAAMA,EAAO,kDA8BAC,EAAS,GAAiBC,EAAK,QAAQ,oBAAqB,EAAE,EAG3E,SAAgBC,EAAa,EAAiB,CAC5C,IAAMC,kBAAM,IAAI,IAChB,IAAK,IAAMC,KAAKJ,EAAMK,CAAO,CAAC,CAAC,SAAS,+CAA+C,EAChFF,EAAI,IAAIC,EAAE,EAAE,GAAGD,EAAI,IAAIC,EAAE,GAAIA,EAAE,EAAE,EAExC,OAAOD,CACT,CAEA,SAAgBG,EAAU,EAAa,CACrC,IAAMC,EAAI,CAAC,E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pD,EAAE,GAAK9C,EAAGmB,EAAM2B,EAAE,GAAIoD,CAAK,CAAC,EAAI,IAAI,iCAAkC,GAAG,CAElH,CAEA,IAAMC,EAAQ,GAAoBpG,EAAI,GAAGA,EAAE,GAAG,GAAGA,EAAE,KAAO,KAC1D,MAAO,CACL,KAAOY,EAAMoC,CAAI,EACjB,MAAO1C,EACP,KAAO6B,EAAK,IAAK,IAAgB,CAAE,GAAGzB,EAAG,MAAO0F,EAAK1F,EAAE,KAAK,EAAG,KAAM0F,EAAK1F,EAAE,IAAI,EAAG,SAAUA,EAAE,MAAQE,EAAMF,EAAE,KAAK,EAAI,KAAM,QAASA,EAAE,KAAOE,EAAMF,EAAE,IAAI,EAAI,IAAK,EAAE,CACzK,CACF,C"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The findings of the 🔬 Dark mode study, as data, each with a check that runs
|
|
3
|
-
* against the code. The numbers are the Figma page's, so the two can be read
|
|
4
|
-
* side by side; 6 and 7 are observations rather than findings, below.
|
|
5
|
-
*
|
|
6
|
-
* What a finding SAYS -- its status, its wording, which commit fixed it -- is a
|
|
7
|
-
* record of a decision, and is written here by hand. What it CLAIMS about the
|
|
8
|
-
* code is checked: a fixed finding verifies the fix is still in place, an open
|
|
9
|
-
* one verifies it still fails. When a check disagrees with the status, the page
|
|
10
|
-
* says so, which is how a reverted fix or a quietly-resolved finding shows up
|
|
11
|
-
* instead of lying in prose.
|
|
12
|
-
*
|
|
13
|
-
* A check receives { decl, src, row }: the token declarations, the raw source
|
|
14
|
-
* of the component stylesheets it names, and a lookup into the derived dark
|
|
15
|
-
* values. It returns { holds, detail } -- holds is whether the status is still
|
|
16
|
-
* true. Not a story file. Pure, so it runs under Node.
|
|
17
|
-
*/
|
|
18
|
-
import type { DarkRow } from "./dark-derivation.js";
|
|
19
|
-
export interface CheckInput {
|
|
20
|
-
decl: Map<string, string>;
|
|
21
|
-
src: Record<string, string>;
|
|
22
|
-
row: (token: string) => Partial<DarkRow>;
|
|
23
|
-
}
|
|
24
|
-
export interface CheckResult {
|
|
25
|
-
holds: boolean;
|
|
26
|
-
detail: string;
|
|
27
|
-
}
|
|
28
|
-
export interface Finding {
|
|
29
|
-
n: number;
|
|
30
|
-
status: 'fixed' | 'partly fixed' | 'open' | 'decision' | 'decided';
|
|
31
|
-
commit?: string;
|
|
32
|
-
kind: 'role' | 'palette' | 'design' | 'primitive' | 'light-bug';
|
|
33
|
-
title: string;
|
|
34
|
-
summary: string;
|
|
35
|
-
files?: string[];
|
|
36
|
-
check: (input: CheckInput) => CheckResult;
|
|
37
|
-
}
|
|
38
|
-
export declare const FINDINGS: Finding[];
|
|
39
|
-
/** Observations from the study that are not defects. Shown, not checked. */
|
|
40
|
-
export declare const OBSERVATIONS: {
|
|
41
|
-
n: number;
|
|
42
|
-
title: string;
|
|
43
|
-
summary: string;
|
|
44
|
-
}[];
|
|
45
|
-
/** Every check, run. */
|
|
46
|
-
export declare function runChecks({ decl, src, rows }: Omit<CheckInput, 'row'> & {
|
|
47
|
-
rows: DarkRow[];
|
|
48
|
-
}): {
|
|
49
|
-
holds: boolean;
|
|
50
|
-
detail: string;
|
|
51
|
-
n: number;
|
|
52
|
-
status: "fixed" | "partly fixed" | "open" | "decision" | "decided";
|
|
53
|
-
commit?: string;
|
|
54
|
-
kind: "role" | "palette" | "design" | "primitive" | "light-bug";
|
|
55
|
-
title: string;
|
|
56
|
-
summary: string;
|
|
57
|
-
files?: string[];
|
|
58
|
-
check: (input: CheckInput) => CheckResult;
|
|
59
|
-
}[];
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{contrast as e}from"./dark-derivation.js";var t=(e,t)=>(e||``).includes(t),n=(e,t,n)=>(e.get(t)||``).trim()===`var(${n})`,r=e=>e==null?`—`:e.toFixed(2),i=[{n:1,status:`fixed`,commit:`591c695a`,kind:`role`,title:`Button labels borrowed text-inverse`,summary:`Six filled-button labels read --color-text-inverse, which a dark theme flips to near-black on the fill. They read an on-fill ink now -- --color-action-on-fill, or --color-brand-on-fill where the fill is the brand's -- white in both themes, 4.53 to 10.51:1.`,files:[],check:({decl:e})=>{let t=[`primary-text-default`,`accent-text-default`,`secondary-text-default`,`tertiary-text-active`,`ghost-text-active`,`outline-white-text-default`].map(e=>`--button-${e}`).filter(t=>!n(e,t,`--color-action-on-fill`)&&!n(e,t,`--color-brand-on-fill`));return{holds:!t.length,detail:t.length?`still borrowing: ${t.join(`, `)}`:`all six label tokens read an on-fill ink`}}},{n:2,status:`fixed`,kind:`palette`,title:`The dark end of the neutral ramp was too coarse`,summary:`Light has four grounds within 1.29:1 of the page; dark had neutral-950, then 900, then 800, so container and subtle landed on one step. neutral-925 and 850 sit at the light steps, 1.04 and 1.12 off the dark page.`,check:({row:e})=>{let t=[`--color-surface-container`,`--color-surface-subtle`,`--color-surface-muted`].map(e),n=new Set(t.map(e=>e.dark)).size===t.length;return{holds:n,detail:t.map(e=>`${e.token.slice(16)} ${e.dark}`).join(`, `)+(n?``:`: two share a step again`)}}},{n:3,status:`fixed`,kind:`palette`,title:`text-subtle had no dark step that kept both its jobs`,summary:`It must stay quieter than text-muted and clear 4.5:1, and no neutral step did both. neutral-450 does: 4.93:1 on the dark page and 4.75 on a dark card, 1.22:1 from muted.`,check:({row:e})=>{let t=e(`--color-text-subtle`),n=e(`--color-text-muted`);return{holds:t.ok===!0&&t.dark!==n.dark,detail:`derives to ${t.dark}, ${r(t.darkRatio)}:1 on the dark page; muted is ${n.dark}`}}},{n:4,status:`decided`,kind:`design`,title:`The action ramp darkens in dark too, and the page bar is for the resting fill`,summary:`On the dark page, label-on-fill times fill-on-page is 19.45 for every fill, so a white label at 4.5:1 and a fill at 3:1 leave a band 1.44:1 wide -- accent and secondary have one step in it, so no ramp keeps both bars in three states. Decided: hover and press darken as in light; every state keeps its white label at 4.5:1; a resting fill keeps 3:1 on the page by choice; hover and press are supplemental, as WCAG 1.4.11 says, and a text button needs no boundary at all.`,check:({row:e})=>{let t=[`primary`,`accent`,`secondary`].flatMap(e=>[``,`-hover`,`-active`].map(t=>`--color-action-${e}${t}`)).map(e).filter(e=>e.token),n=t.filter(e=>e.darkRatio<4.5),i=t.filter(e=>!e.state&&e.groundRatio<3),a=t.length===9&&!n.length&&!i.length;return{holds:a,detail:a?`every label clears 4.5 (weakest ${r(Math.min(...t.map(e=>e.darkRatio)))}:1); resting fills ${t.filter(e=>!e.state).map(e=>r(e.groundRatio)).join(`, `)}:1 on the page`:[n.length&&`label under 4.5: ${n.map(e=>e.token.slice(15)).join(`, `)}`,i.length&&`resting fill under 3: ${i.map(e=>e.token.slice(15)).join(`, `)}`,t.length!==9&&`${t.length} of 9 fill rows`].filter(Boolean).join(` · `)}}},{n:5,status:`fixed`,kind:`palette`,title:`Success and warning tints ran three times heavier than in light`,summary:`green-950 and yellow-950 are not near-black, so those tints sat about 1.55:1 off the dark page against 1.05 in light, and read as coloured bands on an alert. green-975 and yellow-975 sit at 1.04 and 1.03.`,check:({row:e})=>{let t=e(`--status-success-surface`),n=e(`--status-warning-surface`);return{holds:t.darkRatio/t.lightRatio<=1.3&&n.darkRatio/n.lightRatio<=1.3,detail:`success ${r(t.lightRatio)} → ${r(t.darkRatio)}, warning ${r(n.lightRatio)} → ${r(n.darkRatio)} off the page`}}},{n:8,status:`fixed`,kind:`primitive`,title:`Secondary and pressed ghost buttons read primitives, and vanished on a dark page`,summary:`Their fills were neutral-950/800/1000 from the palette, which has no dark value, and the dark page is neutral-950 too. They read --color-action-secondary now. The white preset mixed a fixed fill with a switching label; its label is a fixed ramp step now (--color-brand-600), like its fill.`,check:({decl:e})=>{let t=[`--button-secondary-background-default`,`--button-secondary-background-hover`,`--button-secondary-background-active`,`--button-ghost-background-active`].filter(t=>!/var\(--color-action-secondary(-hover|-active)?\)/.test(e.get(t)||``)),r=n(e,`--button-white-text-default`,`--color-brand-600`)||n(e,`--button-white-text-default`,`--color-blue-600`),i=!t.length&&r;return{holds:i,detail:i?`four fills read --color-action-secondary; the white preset label is fixed`:[t.length&&`not on the role: ${t.join(`, `)}`,!r&&`the white preset label switches again`].filter(Boolean).join(` · `)}}},{n:9,status:`fixed`,commit:`415fc57c`,kind:`light-bug`,title:`outline-white lost AA on hover and press, in light`,summary:`Its white wash lightened the blue under a white label (3.91 and 3.38:1). It darkens now, and the label passes on every ground the preset sits on.`,check:({decl:e})=>{let n=[`--button-outline-white-background-hover`,`--button-outline-white-background-active`].every(n=>t(e.get(n),`--color-neutral-1000`));return{holds:n,detail:n?`hover and press wash with neutral-1000`:`a white wash is back`}}},{n:10,status:`fixed`,commit:`591c695a`,kind:`primitive`,title:`The required mark read a primitive`,summary:`It was red-600 from the palette, 3.57:1 in dark. It reads --status-error-accent now, like the error help text.`,check:({decl:e})=>{let t=n(e,`--form-label-required-color`,`--status-error-accent`);return{holds:t,detail:t?`--form-label-required-color reads --status-error-accent`:`reads ${e.get(`--form-label-required-color`)}`}}},{n:11,status:`fixed`,commit:`415fc57c`,kind:`light-bug`,title:`Placeholders failed on the error and success tints, in light`,summary:`Every placeholder was text-subtle, 4.22 and 4.43:1 on the tints. Error and success fields take text-muted now. The plain field's dark placeholder is finding 3.`,files:[`form-field`],check:({src:e})=>{let n=t(e[`form-field`],`.form-input--error::placeholder`);return{holds:n,detail:n?`form-field.css.ts sets tinted placeholders to text-muted`:`the tinted-placeholder rule is gone`}}},{n:12,status:`fixed`,commit:`591c695a`,kind:`role`,title:`The checkmark, radio dot and switch thumb read the page colour`,summary:`They were --color-surface-default, which is "the page", not "white", and turns near-black on blue in dark. They read an on-fill ink now -- the brand's, on the brand fill.`,files:[`checkbox`,`radio`,`switch`],check:({src:e})=>{let n=[`checkbox`,`radio`,`switch`].filter(n=>!t(e[n],`var(--color-action-on-fill)`)&&!t(e[n],`var(--color-brand-on-fill)`));return{holds:!n.length,detail:n.length?`not on action-on-fill: ${n.join(`, `)}`:`all three read an on-fill ink`}}},{n:13,status:`fixed`,commit:`591c695a`,kind:`role`,title:`A link's hover borrowed a button fill as text`,summary:`Primary and bold hovers read --color-action-primary-active; they read --color-text-brand-hover now. The subtle link at rest failed in dark too, until finding 3 gave text-subtle a dark step.`,files:[`link`],check:({src:e})=>{let n=!t(e.link,`action-primary-active`)&&t(e.link,`var(--color-text-brand-hover)`);return{holds:n,detail:n?`link hovers read --color-text-brand-hover`:`a hover reads an action fill again`}}},{n:14,status:`decided`,kind:`primitive`,title:`Back and Avatar read primitives, and failed in dark`,summary:`Back's pressed ground was neutral-200 under a label that switches, 1.48:1 in dark; it reads --color-surface-pressed now. Avatar's disc was blue-100 from the palette, 2.68:1 in dark under its initials. Decided: the disc reads --status-brand-surface, chosen for meaning (brand identity), not for value -- the only blue-100 role is info's, and an avatar is not info. The initials read 5.72:1 in light and 5.10 in dark; the disc is fainter on the page (1.08:1), and the initials, not the edge, identify it.`,files:[`back`,`avatar`],check:({src:e})=>{let n=t(e.back,`var(--color-surface-pressed)`),r=t(e.avatar,`var(--status-brand-surface)`)&&!t(e.avatar,`var(--color-blue-100)`);return{holds:n&&r,detail:[n?`Back reads --color-surface-pressed`:`Back reads a primitive again`,r?`Avatar reads --status-brand-surface`:`Avatar reads a primitive again`].join(` · `)}}},{n:15,status:`decided`,kind:`design`,title:`Video and terminal frames used surface-inverse to mean "dark"`,summary:`Inverse means the other polarity, so in dark the frame turned light and its ink dark: a play icon at 3.13:1, and a terminal palette (blue-400, the traffic-light green) that only works on a dark ground. Decided: --color-surface-media, dark in every theme, with --color-text-on-media and -muted fixed alongside it. The tooltip stays on surface-inverse: a bubble that flips is what inverse means.`,files:[`video-player`,`video`,`terminal-message`,`tooltip`],check:({src:e})=>{let n=[`video-player`,`video`,`terminal-message`].filter(n=>!t(e[n],`var(--color-surface-media)`)||t(e[n],`var(--color-surface-inverse)`)||t(e[n],`var(--color-text-inverse)`)),r=t(e.tooltip,`var(--color-surface-inverse)`),i=!n.length&&r;return{holds:i,detail:i?`video, bd-video and the terminal read surface-media and its ink; the tooltip stays inverse`:[n.length&&`still on inverse: ${n.join(`, `)}`,!r&&`the tooltip left surface-inverse`].filter(Boolean).join(` · `)}}},{n:16,status:`fixed`,commit:`591c695a`,kind:`primitive`,title:`The citation reference read the palette`,summary:`blue-600 and blue-700 from the ramp, 3.15 and 2.27:1 in dark. It reads --color-text-brand and --color-text-brand-hover now.`,check:({decl:e})=>{let t=n(e,`--citation-reference-color`,`--color-text-brand`)&&n(e,`--citation-reference-hover-color`,`--color-text-brand-hover`);return{holds:t,detail:t?`both citation tokens read brand text roles`:`a citation token reads a primitive again`}}},{n:17,status:`decided`,commit:`415fc57c`,kind:`light-bug`,title:`text-subtle failed on a card, in light, and on bands and tints in both themes`,summary:`neutral-500 moved one step for the card (415fc57c, 4.61:1). On surface-subtle and the status tints it was still 4.29 to 4.46, and no value can be quieter than muted and clear 4.5 on every ground -- on surface-muted it would have to be muted. Decided: subtle text sits on the page or a card; on a band or a tint it steps up to text-muted. neutral-450 is measured on the dark card (4.75), and the compatibility table's blue band moved its labels to muted (6.10).`,files:[`compatibility-table`],check:({decl:n,src:r})=>{let i=e=>(n.get(e)||``).trim(),a=e(i(`--color-neutral-500`),i(`--color-neutral-25`)),o=e(i(`--color-neutral-450`),i(`--color-neutral-925`)),s=t(r[`compatibility-table`],`:host([background="blue"]) .bd-compattable-lightlabel`);return{holds:a>=4.5&&o>=4.5&&s,detail:`subtle on a card ${a.toFixed(2)}:1 in light, ${o.toFixed(2)} in dark${s?`; the blue-band label reads muted`:`; the blue-band label is subtle again`}`}}},{n:18,status:`fixed`,commit:`591c695a`,kind:`role`,title:`The list check borrowed its pair`,summary:`Disc and tick read the status accent and text-inverse; they read the badge's own fill and on-fill now.`,files:[`list-item`],check:({src:e})=>{let n=t(e[`list-item`],`var(--status-success-fill)`)&&t(e[`list-item`],`var(--status-success-on-fill)`);return{holds:n,detail:n?`the check reads --status-success-fill and -on-fill`:`the check borrows again`}}}],a=[{n:6,title:`What carries over unchanged`,summary:`muted and disabled share a value in both themes. In light, border-container is surface-muted's step, so a card edge disappears on a muted band; in dark it lands on surface-subtle's step instead (neutral-850), so the band it disappears on moves from muted to subtle.`},{n:7,title:`Badges and tags hold in dark`,summary:`Every part passes in both modes, on the page and on a card. A badge and a tag of one tone read further apart in dark than in light, except brand, which is the same ground in both by design.`}];function o({decl:e,src:t,rows:n}){let r=new Map(n.map(e=>[e.token,e])),a=e=>r.get(e)||{};return i.map(n=>{let r;try{r=n.check({decl:e,src:t,row:a})}catch(e){r={holds:!1,detail:`check failed to run: ${e.message}`}}return{...n,...r}})}export{i as FINDINGS,a as OBSERVATIONS,o as runChecks};
|
|
2
|
-
//# sourceMappingURL=dark-findings.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dark-findings.js","names":["has","s","needle","reads","decl","token","role","r2","n","FINDINGS","off","x","g","row","apart","r","m","k","label","rest","ok","y","prim","white","t","src","b","a","tip","c","light","contrast","dark","band","OBSERVATIONS","runChecks","byToken","rows","res","f"],"sources":["../../../src/tokens/dark-findings.ts"],"sourcesContent":["/**\n * The findings of the 🔬 Dark mode study, as data, each with a check that runs\n * against the code. The numbers are the Figma page's, so the two can be read\n * side by side; 6 and 7 are observations rather than findings, below.\n *\n * What a finding SAYS -- its status, its wording, which commit fixed it -- is a\n * record of a decision, and is written here by hand. What it CLAIMS about the\n * code is checked: a fixed finding verifies the fix is still in place, an open\n * one verifies it still fails. When a check disagrees with the status, the page\n * says so, which is how a reverted fix or a quietly-resolved finding shows up\n * instead of lying in prose.\n *\n * A check receives { decl, src, row }: the token declarations, the raw source\n * of the component stylesheets it names, and a lookup into the derived dark\n * values. It returns { holds, detail } -- holds is whether the status is still\n * true. Not a story file. Pure, so it runs under Node.\n */\n\nimport { contrast } from './dark-derivation.ts';\nimport type { DarkRow } from './dark-derivation.ts';\n\nexport interface CheckInput {\n decl: Map<string, string>;\n src : Record<string, string>;\n row : (token: string) => Partial<DarkRow>;\n}\n\nexport interface CheckResult {\n holds : boolean;\n detail: string;\n}\n\nexport interface Finding {\n n : number;\n status : 'fixed' | 'partly fixed' | 'open' | 'decision' | 'decided';\n commit?: string;\n kind : 'role' | 'palette' | 'design' | 'primitive' | 'light-bug';\n title : string;\n summary: string;\n files? : string[];\n check : (input: CheckInput) => CheckResult;\n}\n\nconst has = (s: string | undefined, needle: string) => (s || '').includes(needle);\nconst reads = (decl: Map<string, string>, token: string, role: string) => (decl.get(token) || '').trim() === `var(${role})`;\nconst r2 = (n: number | null | undefined) => (n == null ? '—' : n.toFixed(2));\n\nexport const FINDINGS: Finding[] = [\n {\n n : 1, status : 'fixed', commit : '591c695a', kind : 'role',\n title : 'Button labels borrowed text-inverse',\n summary: 'Six filled-button labels read --color-text-inverse, which a dark theme flips to near-black on the fill. They read an on-fill ink now -- --color-action-on-fill, or --color-brand-on-fill where the fill is the brand\\'s -- white in both themes, 4.53 to 10.51:1.',\n files : [],\n check : ({ decl }) => {\n const t = ['primary-text-default', 'accent-text-default', 'secondary-text-default', 'tertiary-text-active', 'ghost-text-active', 'outline-white-text-default'].map(x => `--button-${x}`);\n /* either on-fill ink keeps the point of this finding: neither flips with\n a dark theme. --color-brand-on-fill is the brand's own, which a light\n partner brand sets dark. */\n const off = t.filter(x => !reads(decl, x, '--color-action-on-fill') && !reads(decl, x, '--color-brand-on-fill'));\n return { holds: !off.length, detail: off.length ? `still borrowing: ${off.join(', ')}` : 'all six label tokens read an on-fill ink' };\n }\n },\n {\n n : 2, status : 'fixed', kind : 'palette',\n title : 'The dark end of the neutral ramp was too coarse',\n summary: 'Light has four grounds within 1.29:1 of the page; dark had neutral-950, then 900, then 800, so container and subtle landed on one step. neutral-925 and 850 sit at the light steps, 1.04 and 1.12 off the dark page.',\n check : ({ row }) => {\n const g = ['--color-surface-container', '--color-surface-subtle', '--color-surface-muted'].map(row);\n const apart = new Set(g.map(r => r.dark)).size === g.length;\n return { holds: apart, detail: g.map(r => `${r.token!.slice(16)} ${r.dark}`).join(', ') + (apart ? '' : ': two share a step again') };\n }\n },\n {\n n : 3, status : 'fixed', kind : 'palette',\n title : 'text-subtle had no dark step that kept both its jobs',\n summary: 'It must stay quieter than text-muted and clear 4.5:1, and no neutral step did both. neutral-450 does: 4.93:1 on the dark page and 4.75 on a dark card, 1.22:1 from muted.',\n check : ({ row }) => {\n const r = row('--color-text-subtle'), m = row('--color-text-muted');\n const ok = r.ok === true && r.dark !== m.dark;\n return { holds: ok, detail: `derives to ${r.dark}, ${r2(r.darkRatio)}:1 on the dark page; muted is ${m.dark}` };\n }\n },\n {\n n : 4, status : 'decided', kind : 'design',\n title : 'The action ramp darkens in dark too, and the page bar is for the resting fill',\n summary: 'On the dark page, label-on-fill times fill-on-page is 19.45 for every fill, so a white label at 4.5:1 and a fill at 3:1 leave a band 1.44:1 wide -- accent and secondary have one step in it, so no ramp keeps both bars in three states. Decided: hover and press darken as in light; every state keeps its white label at 4.5:1; a resting fill keeps 3:1 on the page by choice; hover and press are supplemental, as WCAG 1.4.11 says, and a text button needs no boundary at all.',\n check : ({ row }) => {\n const t = ['primary', 'accent', 'secondary'].flatMap(k => ['', '-hover', '-active'].map(s => `--color-action-${k}${s}`)).map(row)\n .filter(r => r.token);\n const label = t.filter(r => r.darkRatio! < 4.5), rest = t.filter(r => !r.state && r.groundRatio! < 3);\n const ok = t.length === 9 && !label.length && !rest.length;\n return { holds : ok, detail: ok\n ? `every label clears 4.5 (weakest ${r2(Math.min(...t.map(r => r.darkRatio!)))}:1); resting fills ${t.filter(r => !r.state).map(r => r2(r.groundRatio))\n .join(', ')}:1 on the page`\n : [label.length && `label under 4.5: ${label.map(r => r.token!.slice(15)).join(', ')}`, rest.length && `resting fill under 3: ${rest.map(r => r.token!.slice(15)).join(', ')}`, t.length !== 9 && `${t.length} of 9 fill rows`].filter(Boolean).join(' · ') };\n }\n },\n {\n n : 5, status : 'fixed', kind : 'palette',\n title : 'Success and warning tints ran three times heavier than in light',\n summary: 'green-950 and yellow-950 are not near-black, so those tints sat about 1.55:1 off the dark page against 1.05 in light, and read as coloured bands on an alert. green-975 and yellow-975 sit at 1.04 and 1.03.',\n check : ({ row }) => {\n const g = row('--status-success-surface'), y = row('--status-warning-surface');\n const light = g.darkRatio! / g.lightRatio! <= 1.3 && y.darkRatio! / y.lightRatio! <= 1.3;\n return { holds: light, detail: `success ${r2(g.lightRatio)} → ${r2(g.darkRatio)}, warning ${r2(y.lightRatio)} → ${r2(y.darkRatio)} off the page` };\n }\n },\n {\n n : 8, status : 'fixed', kind : 'primitive',\n title : 'Secondary and pressed ghost buttons read primitives, and vanished on a dark page',\n summary: 'Their fills were neutral-950/800/1000 from the palette, which has no dark value, and the dark page is neutral-950 too. They read --color-action-secondary now. The white preset mixed a fixed fill with a switching label; its label is a fixed ramp step now (--color-brand-600), like its fill.',\n check : ({ decl }) => {\n const t = ['--button-secondary-background-default', '--button-secondary-background-hover', '--button-secondary-background-active', '--button-ghost-background-active'];\n const prim = t.filter(x => !/var\\(--color-action-secondary(-hover|-active)?\\)/.test(decl.get(x) || ''));\n /* fixed means a ramp step, not a role that switches. It was blue-600 by\n name; it is the brand ramp's 600 now, which is just as fixed and also\n follows the business line. */\n const white = reads(decl, '--button-white-text-default', '--color-brand-600')\n || reads(decl, '--button-white-text-default', '--color-blue-600');\n const ok = !prim.length && white;\n return { holds: ok, detail: ok ? 'four fills read --color-action-secondary; the white preset label is fixed' : [prim.length && `not on the role: ${prim.join(', ')}`, !white && 'the white preset label switches again'].filter(Boolean).join(' · ') };\n }\n },\n {\n n : 9, status : 'fixed', commit : '415fc57c', kind : 'light-bug',\n title : 'outline-white lost AA on hover and press, in light',\n summary: 'Its white wash lightened the blue under a white label (3.91 and 3.38:1). It darkens now, and the label passes on every ground the preset sits on.',\n check : ({ decl }) => {\n const ok = ['--button-outline-white-background-hover', '--button-outline-white-background-active'].every(t => has(decl.get(t), '--color-neutral-1000'));\n return { holds: ok, detail: ok ? 'hover and press wash with neutral-1000' : 'a white wash is back' };\n }\n },\n {\n n : 10, status : 'fixed', commit : '591c695a', kind : 'primitive',\n title : 'The required mark read a primitive',\n summary: 'It was red-600 from the palette, 3.57:1 in dark. It reads --status-error-accent now, like the error help text.',\n check : ({ decl }) => { const ok = reads(decl, '--form-label-required-color', '--status-error-accent'); return { holds: ok, detail: ok ? '--form-label-required-color reads --status-error-accent' : `reads ${decl.get('--form-label-required-color')}` }; }\n },\n {\n n : 11, status : 'fixed', commit : '415fc57c', kind : 'light-bug',\n title : 'Placeholders failed on the error and success tints, in light',\n summary: 'Every placeholder was text-subtle, 4.22 and 4.43:1 on the tints. Error and success fields take text-muted now. The plain field\\'s dark placeholder is finding 3.',\n files : ['form-field'],\n check : ({ src }) => { const ok = has(src['form-field'], '.form-input--error::placeholder'); return { holds: ok, detail: ok ? 'form-field.css.ts sets tinted placeholders to text-muted' : 'the tinted-placeholder rule is gone' }; }\n },\n {\n n : 12, status : 'fixed', commit : '591c695a', kind : 'role',\n title : 'The checkmark, radio dot and switch thumb read the page colour',\n summary: 'They were --color-surface-default, which is \"the page\", not \"white\", and turns near-black on blue in dark. They read an on-fill ink now -- the brand\\'s, on the brand fill.',\n files : ['checkbox', 'radio', 'switch'],\n check : ({ src }) => { const off = ['checkbox', 'radio', 'switch'].filter(k => !has(src[k], 'var(--color-action-on-fill)') && !has(src[k], 'var(--color-brand-on-fill)')); return { holds: !off.length, detail: off.length ? `not on action-on-fill: ${off.join(', ')}` : 'all three read an on-fill ink' }; }\n },\n {\n n : 13, status : 'fixed', commit : '591c695a', kind : 'role',\n title : 'A link\\'s hover borrowed a button fill as text',\n summary: 'Primary and bold hovers read --color-action-primary-active; they read --color-text-brand-hover now. The subtle link at rest failed in dark too, until finding 3 gave text-subtle a dark step.',\n files : ['link'],\n check : ({ src }) => { const ok = !has(src.link, 'action-primary-active') && has(src.link, 'var(--color-text-brand-hover)'); return { holds: ok, detail: ok ? 'link hovers read --color-text-brand-hover' : 'a hover reads an action fill again' }; }\n },\n {\n n : 14, status : 'decided', kind : 'primitive',\n title : 'Back and Avatar read primitives, and failed in dark',\n summary: 'Back\\'s pressed ground was neutral-200 under a label that switches, 1.48:1 in dark; it reads --color-surface-pressed now. Avatar\\'s disc was blue-100 from the palette, 2.68:1 in dark under its initials. Decided: the disc reads --status-brand-surface, chosen for meaning (brand identity), not for value -- the only blue-100 role is info\\'s, and an avatar is not info. The initials read 5.72:1 in light and 5.10 in dark; the disc is fainter on the page (1.08:1), and the initials, not the edge, identify it.',\n files : ['back', 'avatar'],\n check : ({ src }) => {\n const b = has(src.back, 'var(--color-surface-pressed)'), a = has(src.avatar, 'var(--status-brand-surface)') && !has(src.avatar, 'var(--color-blue-100)');\n return { holds: b && a, detail: [b ? 'Back reads --color-surface-pressed' : 'Back reads a primitive again', a ? 'Avatar reads --status-brand-surface' : 'Avatar reads a primitive again'].join(' · ') };\n }\n },\n {\n n : 15, status : 'decided', kind : 'design',\n title : 'Video and terminal frames used surface-inverse to mean \"dark\"',\n summary: 'Inverse means the other polarity, so in dark the frame turned light and its ink dark: a play icon at 3.13:1, and a terminal palette (blue-400, the traffic-light green) that only works on a dark ground. Decided: --color-surface-media, dark in every theme, with --color-text-on-media and -muted fixed alongside it. The tooltip stays on surface-inverse: a bubble that flips is what inverse means.',\n files : ['video-player', 'video', 'terminal-message', 'tooltip'],\n check : ({ src }) => {\n const frames = ['video-player', 'video', 'terminal-message'];\n const off = frames.filter(k => !has(src[k], 'var(--color-surface-media)') || has(src[k], 'var(--color-surface-inverse)') || has(src[k], 'var(--color-text-inverse)'));\n const tip = has(src.tooltip, 'var(--color-surface-inverse)');\n const ok = !off.length && tip;\n return { holds: ok, detail: ok ? 'video, bd-video and the terminal read surface-media and its ink; the tooltip stays inverse' : [off.length && `still on inverse: ${off.join(', ')}`, !tip && 'the tooltip left surface-inverse'].filter(Boolean).join(' · ') };\n }\n },\n {\n n : 16, status : 'fixed', commit : '591c695a', kind : 'primitive',\n title : 'The citation reference read the palette',\n summary: 'blue-600 and blue-700 from the ramp, 3.15 and 2.27:1 in dark. It reads --color-text-brand and --color-text-brand-hover now.',\n check : ({ decl }) => { const ok = reads(decl, '--citation-reference-color', '--color-text-brand') && reads(decl, '--citation-reference-hover-color', '--color-text-brand-hover'); return { holds: ok, detail: ok ? 'both citation tokens read brand text roles' : 'a citation token reads a primitive again' }; }\n },\n {\n n : 17, status : 'decided', commit : '415fc57c', kind : 'light-bug',\n title : 'text-subtle failed on a card, in light, and on bands and tints in both themes',\n summary: 'neutral-500 moved one step for the card (415fc57c, 4.61:1). On surface-subtle and the status tints it was still 4.29 to 4.46, and no value can be quieter than muted and clear 4.5 on every ground -- on surface-muted it would have to be muted. Decided: subtle text sits on the page or a card; on a band or a tint it steps up to text-muted. neutral-450 is measured on the dark card (4.75), and the compatibility table\\'s blue band moved its labels to muted (6.10).',\n files : ['compatibility-table'],\n check : ({ decl, src }) => {\n // what the rule is FOR: subtle clears 4.5 on a card in both themes, and the band that broke it no longer carries it\n const c = (t: string) => (decl.get(t) || '').trim();\n const light = contrast(c('--color-neutral-500'), c('--color-neutral-25')), dark = contrast(c('--color-neutral-450'), c('--color-neutral-925'));\n const band = has(src['compatibility-table'], ':host([background=\"blue\"]) .bd-compattable-lightlabel');\n const ok = light >= 4.5 && dark >= 4.5 && band;\n return { holds: ok, detail: `subtle on a card ${light.toFixed(2)}:1 in light, ${dark.toFixed(2)} in dark${band ? '; the blue-band label reads muted' : '; the blue-band label is subtle again'}` };\n }\n },\n {\n n : 18, status : 'fixed', commit : '591c695a', kind : 'role',\n title : 'The list check borrowed its pair',\n summary: 'Disc and tick read the status accent and text-inverse; they read the badge\\'s own fill and on-fill now.',\n files : ['list-item'],\n check : ({ src }) => { const ok = has(src['list-item'], 'var(--status-success-fill)') && has(src['list-item'], 'var(--status-success-on-fill)'); return { holds: ok, detail: ok ? 'the check reads --status-success-fill and -on-fill' : 'the check borrows again' }; }\n }\n];\n\n/** Observations from the study that are not defects. Shown, not checked. */\nexport const OBSERVATIONS = [\n { n: 6, title: 'What carries over unchanged', summary: 'muted and disabled share a value in both themes. In light, border-container is surface-muted\\'s step, so a card edge disappears on a muted band; in dark it lands on surface-subtle\\'s step instead (neutral-850), so the band it disappears on moves from muted to subtle.' },\n { n: 7, title: 'Badges and tags hold in dark', summary: 'Every part passes in both modes, on the page and on a card. A badge and a tag of one tone read further apart in dark than in light, except brand, which is the same ground in both by design.' }\n];\n\n/** Every check, run. */\nexport function runChecks({ decl, src, rows }: Omit<CheckInput, 'row'> & { rows: DarkRow[] }) {\n const byToken = new Map(rows.map(r => [r.token, r]));\n const row = (t: string): Partial<DarkRow> => byToken.get(t) || {};\n return FINDINGS.map(f => {\n let res;\n try { res = f.check({ decl, src, row }); } catch (e) { res = { holds: false, detail: `check failed to run: ${(e as Error).message}` }; }\n return { ...f, ...res };\n });\n}\n"],"mappings":"A,gDA2CA,IAAMA,GAAO,EAAuB,KAAoBC,GAAK,GAAA,CAAI,SAASC,CAAM,EAC1EC,GAAS,EAA2B,EAAe,KAAkBC,EAAK,IAAIC,CAAK,GAAK,GAAA,CAAI,KAAK,IAAM,OAAOC,EAAK,GACnHC,EAAM,GAAkCC,GAAK,KAAO,IAAMA,EAAE,QAAQ,CAAC,EAE9DC,EAAsB,CACjC,CACE,EAAS,EAAG,OAAS,QAAS,OAAS,WAAY,KAAS,OAC5D,MAAS,sCACT,QAAS,mQACT,MAAS,CAAC,EACV,OAAU,CAAE,UAAW,CAKrB,IAAMC,EAJI,CAAC,uBAAwB,sBAAuB,yBAA0B,uBAAwB,oBAAqB,4BAA4B,CAAC,CAAC,IAAI,GAAK,YAAYC,GAIxK,CAAA,CAAE,OAAO,GAAK,CAACR,EAAMC,EAAMO,EAAG,wBAAwB,GAAK,CAACR,EAAMC,EAAMO,EAAG,uBAAuB,CAAC,EAC/G,MAAO,CAAE,MAAO,CAACD,EAAI,OAAQ,OAAQA,EAAI,OAAS,oBAAoBA,EAAI,KAAK,IAAI,IAAM,0CAA2C,CACtI,CACF,EACA,CACE,EAAS,EAAG,OAAS,QAAS,KAAS,UACvC,MAAS,kDACT,QAAS,uNACT,OAAU,CAAE,SAAU,CACpB,IAAME,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c,+BAA+B,EAAG,MAAO,CAAE,MAAOL,EAAI,OAAQA,EAAK,qDAAuD,yBAA0B,CAAG,CACzQ,CACF,EAGac,EAAe,CAC1B,CAAE,EAAG,EAAG,MAAO,8BAA+B,QAAS,2QAA8Q,EACrU,CAAE,EAAG,EAAG,MAAO,+BAAgC,QAAS,+LAAgM,CAC1P,EAGA,SAAgBC,EAAU,CAAE,OAAM,MAAK,QAAuD,CAC5F,IAAMC,EAAU,IAAI,IAAIC,EAAK,IAAI,GAAK,CAACtB,EAAE,MAAOA,CAAC,CAAC,CAAC,EAC7CF,EAAO,GAAgCuB,EAAQ,IAAIZ,CAAC,GAAK,CAAC,EAChE,OAAOf,EAAS,IAAI,GAAK,CACvB,IAAI6B,EACJ,GAAI,CAAE,EAAMC,EAAE,MAAM,CAAE,OAAM,MAAK,KAAI,CAAC,CAAG,OAAS,EAAG,CAAE,EAAM,CAAE,MAAO,GAAO,OAAQ,wBAAyB,EAAY,SAAU,CAAG,CACvI,MAAO,CAAE,GAAGA,EAAG,GAAGD,CAAI,CACxB,CAAC,CACH,C"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/** Concatenated text of every readable stylesheet in the document. */
|
|
2
|
-
export declare function readAllCssText(): string;
|
|
3
|
-
/** Resolves a custom property to its computed value on :root. */
|
|
4
|
-
export declare function resolve(token: string): string;
|
|
5
|
-
/**
|
|
6
|
-
* Finds every custom property whose name matches `pattern`, in declaration
|
|
7
|
-
* order, de-duplicated. `pattern` must have the token name as group 1.
|
|
8
|
-
*/
|
|
9
|
-
export declare function discoverTokens(cssText: string, pattern: RegExp): RegExpExecArray[];
|
|
10
|
-
/** Maps each palette/primitive token to the tokens that reference it. */
|
|
11
|
-
export declare function discoverConsumers(cssText: string): Map<string, Set<string>>;
|
|
12
|
-
export declare const INK = "#151719";
|
|
13
|
-
export declare const PAPER = "#ffffff";
|
|
14
|
-
/** Resolves any CSS colour notation to [r, g, b] via the browser. */
|
|
15
|
-
export declare function toRgb(value: string): number[];
|
|
16
|
-
export declare function contrast(a: string, b: string): number;
|
|
17
|
-
export declare function toHex(value: string): string;
|
|
18
|
-
/** WCAG level reached by a contrast ratio for normal-size body text. */
|
|
19
|
-
export declare function wcagLevel(ratio: number): {
|
|
20
|
-
label: string;
|
|
21
|
-
pass: boolean;
|
|
22
|
-
};
|
|
23
|
-
export declare function levelBadge(ratio: number): import("lit-html").TemplateResult<1>;
|
|
24
|
-
export declare const chromeStyles: import("lit-html").TemplateResult<1>;
|
|
25
|
-
export declare function docsPage({ title, lede, note, children }: {
|
|
26
|
-
title: string;
|
|
27
|
-
lede?: unknown;
|
|
28
|
-
note?: unknown;
|
|
29
|
-
children?: unknown;
|
|
30
|
-
}): import("lit-html").TemplateResult<1>;
|
|
31
|
-
export declare function refSection({ name, meta, children }: {
|
|
32
|
-
name: string;
|
|
33
|
-
meta?: string;
|
|
34
|
-
children?: unknown;
|
|
35
|
-
}): import("lit-html").TemplateResult<1>;
|
|
36
|
-
/** A token name that copies its var() reference when clicked. */
|
|
37
|
-
export declare function copyToken(token: string): import("lit-html").TemplateResult<1>;
|
|
38
|
-
/** Lists the tokens that consume a given token, behind a disclosure. */
|
|
39
|
-
export declare function usageCell(consumerSet: ReadonlySet<string> | undefined): import("lit-html").TemplateResult<1>;
|
|
40
|
-
/**
|
|
41
|
-
* Standard caveat for the "Referenced by" column.
|
|
42
|
-
*
|
|
43
|
-
* This page can only see stylesheets in the document. Component CSS lives
|
|
44
|
-
* inside shadow roots and is unreachable, so the column counts token-to-token
|
|
45
|
-
* references only — a primitive with no listed references may still be used
|
|
46
|
-
* directly by components.
|
|
47
|
-
*/
|
|
48
|
-
export declare const referenceNote: import("lit-html").TemplateResult<1>;
|
|
49
|
-
/**
|
|
50
|
-
* Token / value / optional visual / references table, shared by the primitive
|
|
51
|
-
* pages. `visual` receives (token, value) and returns the cell contents.
|
|
52
|
-
*/
|
|
53
|
-
export declare function primitiveTable({ caption, tokens, consumers, visual, visualHeader, valueClass }: {
|
|
54
|
-
caption: string;
|
|
55
|
-
tokens: readonly string[];
|
|
56
|
-
consumers: ReadonlyMap<string, ReadonlySet<string>>;
|
|
57
|
-
visual?: (token: string, value: string) => unknown;
|
|
58
|
-
visualHeader?: string;
|
|
59
|
-
valueClass?: string;
|
|
60
|
-
}): import("lit-html").TemplateResult<1>;
|
|
61
|
-
/**
|
|
62
|
-
* The rendered pixel value of a rem length, measured rather than assumed, so a
|
|
63
|
-
* browser at a non-default root font size reports its own truth.
|
|
64
|
-
*
|
|
65
|
-
* rem only. An em value is relative to the element's own font size, so there
|
|
66
|
-
* is no single pixel equivalent to state — quoting one would be wrong rather
|
|
67
|
-
* than merely imprecise. px values, 0, unitless numbers, keywords and colours
|
|
68
|
-
* are left alone too.
|
|
69
|
-
*/
|
|
70
|
-
export declare function toPx(value: string | null | undefined): string;
|
|
71
|
-
/** Tokens matching a prefix, in declaration order, read from the loaded CSS. */
|
|
72
|
-
export declare function tokensFor(cssText: string, prefix: string): string[];
|