@vectoriox/iox-ui 5.197.0 → 5.199.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/actions-core/index.d.ts +7 -1
- package/composite-core/index.d.ts +16 -2
- package/data-core/index.d.ts +11 -3
- package/design-core/index.d.ts +185 -28
- package/fesm2022/vectoriox-iox-ui-actions-core.mjs +6 -1
- package/fesm2022/vectoriox-iox-ui-actions-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs +34 -2
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-data-core.mjs +30 -4
- package/fesm2022/vectoriox-iox-ui-data-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +323 -72
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +17351 -15175
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs +243 -38
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui.mjs +2 -2
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/generation-core/index.d.ts +1703 -264
- package/harness-core/index.d.ts +93 -6
- package/package.json +1 -1
- package/src/actions-core/element-actions.ts +6 -0
- package/src/composite-core/header.ts +34 -1
- package/src/data-core/placeholder-rows.ts +29 -4
- package/src/design-core/brand.ts +58 -5
- package/src/design-core/contrast-audit.ts +49 -22
- package/src/design-core/design-apply.ts +34 -3
- package/src/design-core/flavor-fixtures.generated.ts +123 -123
- package/src/design-core/flavor-spec.generated.ts +44 -4
- package/src/design-core/flavor-tokens.ts +1 -1
- package/src/design-core/header-behaviour.ts +72 -13
- package/src/design-core/menu-look.ts +23 -0
- package/src/design-core/motion-language.ts +5 -14
- package/src/design-core/node-classes.ts +39 -0
- package/src/design-core/preloader.ts +4 -5
- package/src/generation-core/body-mix.ts +40 -102
- package/src/generation-core/check-free.ts +22 -11
- package/src/generation-core/check-layout.ts +10 -4
- package/src/generation-core/check-list.ts +3 -25
- package/src/generation-core/colour-mix.ts +296 -0
- package/src/generation-core/compose-free.ts +47 -20
- package/src/generation-core/compose-site.ts +259 -59
- package/src/generation-core/footer-mix.ts +258 -64
- package/src/generation-core/free-fallback.ts +6 -4
- package/src/generation-core/free-opening.ts +13 -2
- package/src/generation-core/free-parts.ts +87 -0
- package/src/generation-core/free-slot-words.ts +30 -0
- package/src/generation-core/free-wire.ts +8 -0
- package/src/generation-core/generation-tier.ts +6 -17
- package/src/generation-core/header-mix.ts +73 -3
- package/src/generation-core/layout-drawers.ts +3 -2
- package/src/generation-core/layout-wire.ts +10 -16
- package/src/generation-core/legal.ts +24 -0
- package/src/generation-core/list-panel.ts +3 -3
- package/src/generation-core/list-table.ts +5 -14
- package/src/generation-core/list-words.ts +2 -1
- package/src/generation-core/menu-shelves.ts +138 -0
- package/src/generation-core/nav-shape.ts +138 -15
- package/src/generation-core/node-baselines.generated.ts +1 -0
- package/src/generation-core/opening-mix.ts +7 -34
- package/src/generation-core/part-tier.ts +14 -0
- package/src/generation-core/patterns.ts +7 -0
- package/src/generation-core/plan-wire.ts +32 -43
- package/src/generation-core/public-api.ts +3 -0
- package/src/generation-core/site-build-run.ts +8 -0
- package/src/generation-core/site-plan.model.ts +3 -0
- package/src/generation-core/site-spec.generated.ts +1383 -189
- package/src/generation-core/validate-site-plan.ts +6 -5
- package/src/harness-core/business-types.ts +4 -0
- package/src/harness-core/harness-spec.generated.ts +189 -30
- package/src/harness-core/popup-stance.ts +56 -3
- package/src/harness-core/run-compose-context.ts +25 -5
- package/styles/iox-design.css +162 -3
|
@@ -384,37 +384,64 @@ export function colourTabChecks(rows: ReadonlyArray<DesignTokenLike>, mode: Reso
|
|
|
384
384
|
|
|
385
385
|
// ── Floating grounds (HI3 slice 1, R-H16, vectoriox/iox-ui#173) ──────────────────────────────────────────────────────
|
|
386
386
|
|
|
387
|
-
|
|
387
|
+
/** Where a floating ground's ink is read: `header` = inside the header's ink scope (vectoriox/iox-ui#173 a). */
|
|
388
|
+
export enum FloatingInkScope { Header = 'header' }
|
|
389
|
+
export interface FloatingGround { readonly ground: string; readonly ink: string; readonly scope?: FloatingInkScope | string; }
|
|
390
|
+
/** What the header re-declares for its words (the contract's `contrastAudit.headerInkScope`; iox-design.css, verbatim). */
|
|
391
|
+
export interface HeaderInkScope { readonly selectors: ReadonlyArray<string>; readonly set: Readonly<Record<string, string>>; }
|
|
392
|
+
const AUDIT_TABLES = SPEC_CONTRAST_AUDIT as unknown as { floatingGrounds?: ReadonlyArray<FloatingGround>; headerInkScope?: HeaderInkScope };
|
|
388
393
|
/** The translucent grounds that carry words over ANYTHING (the header's bar and glass while the page moves under them, the
|
|
389
394
|
* bottom bar, a dialog, a popover, the strong glass) — the contract's table (`contrastAudit.floatingGrounds`). */
|
|
390
|
-
const FLOATING_GROUNDS: ReadonlyArray<FloatingGround> =
|
|
391
|
-
|
|
395
|
+
const FLOATING_GROUNDS: ReadonlyArray<FloatingGround> = AUDIT_TABLES.floatingGrounds ?? [];
|
|
396
|
+
/** The contract's header ink scope — null on a contract generated before vectoriox/iox-ui#173 (a). */
|
|
397
|
+
export const HEADER_INK_SCOPE: HeaderInkScope | null = AUDIT_TABLES.headerInkScope ?? null;
|
|
398
|
+
const CURRENT_COLOR = 'currentcolor';
|
|
399
|
+
const INHERITED_INK = 'text';
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* An ink's value as the words on a floating ground wear it — the contract's `floatingInk`, 1:1. A header ground's ink is
|
|
403
|
+
* read INSIDE the header's ink scope: `currentColor` is the bar's own ink (`text` — the bar is `color: inherit`), a token
|
|
404
|
+
* reference reads that token, anything else is the value itself. Outside a scope the ink is the token's own value.
|
|
405
|
+
*/
|
|
406
|
+
export function floatingInkValue(values: Readonly<Record<string, string>>, ink: string, scope?: string, header: HeaderInkScope | null = HEADER_INK_SCOPE): string | undefined {
|
|
407
|
+
const set = scope === FloatingInkScope.Header ? header?.set[ink] : undefined;
|
|
408
|
+
if (set === undefined) return values[ink];
|
|
409
|
+
if (set.trim().toLowerCase() === CURRENT_COLOR) return values[INHERITED_INK];
|
|
410
|
+
const ref = /^var\(--iox-([\w-]+)\)$/.exec(set.trim());
|
|
411
|
+
return ref ? values[ref[1]] : set;
|
|
412
|
+
}
|
|
392
413
|
const BLACK: Rgba = { r: 0, g: 0, b: 0, a: 1 };
|
|
393
414
|
/** The two backdrops that bound every picture: each channel of a blend is monotone in its backdrop's. */
|
|
394
415
|
export const FLOATING_BACKDROPS: Readonly<Record<string, Rgba>> = Object.freeze({ black: BLACK, white: WHITE });
|
|
395
416
|
|
|
396
417
|
/**
|
|
397
|
-
* HI3 slice 1 (R-H16): each translucent ground's words over pure black AND pure white, in
|
|
398
|
-
* header
|
|
399
|
-
* lighter, so a ground that holds AA over both holds it over any picture (iox-ui#173: the Glass
|
|
400
|
-
* 3.55:1 over a light picture in dark mode). An opaque ground is not judged here (the DS9 audit
|
|
401
|
-
* The contract's gate, 1:1 (build-spec `floatingGroundFailures`).
|
|
418
|
+
* HI3 slice 1 (R-H16): each translucent ground's words over pure black AND pure white, in EVERY section scheme (the page's
|
|
419
|
+
* own, and any an author dresses the header or a dialog in — vectoriox/iox-ui#174), in one mode — nothing a blur can lay
|
|
420
|
+
* under the bar is darker or lighter, so a ground that holds AA over both holds it over any picture (iox-ui#173: the Glass
|
|
421
|
+
* look's bar dropped to 3.55:1 over a light picture in dark mode). An opaque ground is not judged here (the DS9 audit
|
|
422
|
+
* judges it where it stands). The contract's gate, 1:1 (build-spec `floatingGroundFailures`).
|
|
402
423
|
*/
|
|
403
|
-
export function floatingGroundFindings(
|
|
404
|
-
|
|
424
|
+
export function floatingGroundFindings(
|
|
425
|
+
rows: ReadonlyArray<DesignTokenLike>, mode: ResolvedMode,
|
|
426
|
+
table: ReadonlyArray<FloatingGround> = FLOATING_GROUNDS, header: HeaderInkScope | null = HEADER_INK_SCOPE,
|
|
427
|
+
): ContrastFinding[] {
|
|
428
|
+
const valuesIn = schemeTokenResolver(rows, mode);
|
|
405
429
|
const out: ContrastFinding[] = [];
|
|
406
|
-
for (const
|
|
407
|
-
const
|
|
408
|
-
const
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
const
|
|
413
|
-
const
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
430
|
+
for (const scheme of SCHEME_IDS) {
|
|
431
|
+
const values = valuesIn(scheme);
|
|
432
|
+
for (const { ground, ink, scope } of table) {
|
|
433
|
+
const fg = parseCssColour(floatingInkValue(values, ink, scope, header));
|
|
434
|
+
const bg = parseCssColour(values[ground], fg);
|
|
435
|
+
if (!fg || !bg || bg.a >= 1) continue;
|
|
436
|
+
const fgHex = toHexColor(quantizeRgb(fg));
|
|
437
|
+
for (const [name, under] of Object.entries(FLOATING_BACKDROPS)) {
|
|
438
|
+
const shown = quantizeRgb(compositeOver(bg, under));
|
|
439
|
+
const ratio = wcagContrastRatio(fgHex, shown);
|
|
440
|
+
out.push({
|
|
441
|
+
scheme, container: `over ${name}`, element: ground, part: ink, fg: fgHex, bg: toHexColor(shown),
|
|
442
|
+
ratio: Math.round(ratio * 100) / 100, min: WCAG_AA_TEXT, pass: ratio >= WCAG_AA_TEXT - 1e-9,
|
|
443
|
+
});
|
|
444
|
+
}
|
|
418
445
|
}
|
|
419
446
|
}
|
|
420
447
|
return out;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { deriveBrandTokens } from './brand';
|
|
1
|
+
import { deriveAccentTokens, deriveBrandTokens } from './brand';
|
|
2
2
|
import { FLAVOR_SPEC_VERSION, SPEC_LEGACY_ALIASES } from './flavor-spec.generated';
|
|
3
3
|
import { SWISS_FLAVOR } from './flavor';
|
|
4
4
|
import { buildFlavorTokens, legacyFlavorTokens } from './flavor-tokens';
|
|
@@ -36,6 +36,29 @@ export function legacyDesignTokenRows(choices: DesignChoices): DesignTokenRow[]
|
|
|
36
36
|
return pack ? legacyFlavorTokens(pack, { ...choices, flavorId: pack.id }) : [];
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
/** The accent rows colour v2 CV1 (CV-D1) changed: in light mode the accent is the seed itself now. */
|
|
40
|
+
const KEPT_SEED_ROWS: ReadonlyArray<string> = ['accent', 'accent-ink', 'accent-hover'];
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* What a design wrote BEFORE colour v2 CV1 (guidance 8f61581, CV-D1): today's rows, but a seed ≠ the pack's own wore
|
|
44
|
+
* brand-500 (L 0.62, a pastel with a black label) as its light accent, ink and hover. Those three do not depend on the
|
|
45
|
+
* grounds, so only their light values differ; the dark values and every other row are today's. A studio whose rows a
|
|
46
|
+
* machine wrote then is healed to the kept seed on the builder's load (`designTokenRepairs`) and by its next Apply
|
|
47
|
+
* (`designBaseline`); a row the author edited is kept. Empty for an unknown pack.
|
|
48
|
+
*/
|
|
49
|
+
export function preKeptSeedDesignTokenRows(choices: DesignChoices): DesignTokenRow[] {
|
|
50
|
+
const rows = designTokenRows(choices);
|
|
51
|
+
const pack = flavorPackById(choices.flavorId);
|
|
52
|
+
if (!pack || !choices.seed || choices.seed.toLowerCase() === pack.seed.toLowerCase()) return rows;
|
|
53
|
+
let old: ReadonlyArray<{ name: string; value: string }>;
|
|
54
|
+
try { old = deriveAccentTokens(choices.seed, { bg: [] }, {}, { keepSeed: false }); } catch { return rows; }
|
|
55
|
+
for (const row of rows) {
|
|
56
|
+
const was = KEPT_SEED_ROWS.includes(row.name) ? old.find(t => t.name === row.name) : undefined;
|
|
57
|
+
if (was) row.value = was.value.toUpperCase();
|
|
58
|
+
}
|
|
59
|
+
return rows;
|
|
60
|
+
}
|
|
61
|
+
|
|
39
62
|
/** What the F1/F2 Swiss seeding wrote: the four Swiss rows + the brand set derived from its seed. */
|
|
40
63
|
function swissExpectations(seed: string | null): Map<string, SeedExpectation> {
|
|
41
64
|
const rows: Array<Pick<DesignTokenRow, 'name' | 'value' | 'values'>> =
|
|
@@ -69,6 +92,10 @@ function packDefaultsLookup(): (packId: string) => ReadonlyArray<Map<string, See
|
|
|
69
92
|
* - guidance `39135c7` (no underlines, Doron 2026-11-22): a link and a ghost (text) button draw no line — Linen's ghost
|
|
70
93
|
* button and every look's link were seeded `underline`, the current page's link a 2px accent line (vectoriox/iox-ui#118:
|
|
71
94
|
* idos and the store kept underlined text buttons from the stored row).
|
|
95
|
+
* - vectoriox/iox-ui#173 (b), decided 2026-11-28 — no migration: the Glass bar stood on `surface-glass` (3.55:1 over a
|
|
96
|
+
* light picture in dark mode; HI3 slice 1 moved it to `surface-glass-strong`), and the Glass tab bar on
|
|
97
|
+
* `surface-glass-strong` (3.74–4.19:1; #174 gave it its own 92% ground). A Glass studio applied before either kept the
|
|
98
|
+
* old ground (iox-test-fresh's J10 sites, 2026-11-28); the next Apply or builder load heals it.
|
|
72
99
|
* A spec pins every entry as no flavor's current value. Add one with every contract change of a seeded token's value.
|
|
73
100
|
*/
|
|
74
101
|
export const SUPERSEDED_TOKEN_VALUES: Readonly<Record<string, ReadonlyArray<string>>> = {
|
|
@@ -77,6 +104,8 @@ export const SUPERSEDED_TOKEN_VALUES: Readonly<Record<string, ReadonlyArray<stri
|
|
|
77
104
|
'button-ghost-decoration': ['underline'],
|
|
78
105
|
'link-decoration': ['underline'],
|
|
79
106
|
'link-current-decoration': ['underline 2px var(--iox-accent-text)'],
|
|
107
|
+
'nav-bg': ['var(--iox-surface-glass)'],
|
|
108
|
+
'tabbar-bg': ['var(--iox-surface-glass-strong)'],
|
|
80
109
|
};
|
|
81
110
|
|
|
82
111
|
const supersededOf = (name: string): SeedExpectation[] => (SUPERSEDED_TOKEN_VALUES[name] ?? []).map(value => ({ value }));
|
|
@@ -110,13 +139,14 @@ export function designBaseline(previous: StoredDesign): SeedBaseline {
|
|
|
110
139
|
const wrote = retired ? packDesignChoices(previous.choices.flavorId) : previous.choices;
|
|
111
140
|
const current = expectations(designTokenRows(wrote));
|
|
112
141
|
const beforeTint = expectations(legacyDesignTokenRows(wrote));
|
|
142
|
+
const beforeKeptSeed = expectations(preKeptSeedDesignTokenRows(wrote));
|
|
113
143
|
const swiss = swissExpectations(retired ? previous.storedSeed : null);
|
|
114
144
|
const packDefaults = packDefaultsLookup();
|
|
115
145
|
return (row: StoredDesignTokenRow) => {
|
|
116
146
|
const stampedBy = SEED_STAMP.exec(row.source ?? '')?.[1];
|
|
117
147
|
if (stampedBy === SWISS_FLAVOR.id) return swiss.get(row.name);
|
|
118
148
|
const ownDefaults = stampedBy ? packDefaults(stampedBy).map(m => m.get(row.name)) : [];
|
|
119
|
-
const expected = [current.get(row.name), beforeTint.get(row.name), ...ownDefaults];
|
|
149
|
+
const expected = [current.get(row.name), beforeTint.get(row.name), beforeKeptSeed.get(row.name), ...ownDefaults];
|
|
120
150
|
return present([...expected, ...expected.map(e => beforeScriptPartners(row.name, e)), ...(stampedBy ? supersededOf(row.name) : [])]);
|
|
121
151
|
};
|
|
122
152
|
}
|
|
@@ -246,6 +276,7 @@ export function designTokenRepairs(existing: ReadonlyArray<StoredDesignTokenRow>
|
|
|
246
276
|
const stamp = flavorSourceStamp(pack.id);
|
|
247
277
|
const desired = new Map(designTokenRows(choices).map(r => [r.name, r]));
|
|
248
278
|
const beforeTint = expectations(legacyDesignTokenRows(choices));
|
|
279
|
+
const beforeKeptSeed = expectations(preKeptSeedDesignTokenRows(choices));
|
|
249
280
|
const packDefaults = packDefaultsLookup();
|
|
250
281
|
const out: FlavorSeedPlan['update'] = [];
|
|
251
282
|
for (const row of existing ?? []) {
|
|
@@ -256,7 +287,7 @@ export function designTokenRepairs(existing: ReadonlyArray<StoredDesignTokenRow>
|
|
|
256
287
|
const darkOnly = row.source === stamp && row.value === want.value;
|
|
257
288
|
const machineWrote = present([
|
|
258
289
|
...(stampedBy ? packDefaults(stampedBy).map(m => m.get(row.name)) : []),
|
|
259
|
-
...(stampedBy === pack.id ? [beforeTint.get(row.name), beforeScriptPartners(row.name, want), beforeScriptPartners(row.name, beforeTint.get(row.name))] : []),
|
|
290
|
+
...(stampedBy === pack.id ? [beforeTint.get(row.name), beforeKeptSeed.get(row.name), beforeScriptPartners(row.name, want), beforeScriptPartners(row.name, beforeTint.get(row.name))] : []),
|
|
260
291
|
...(stampedBy ? supersededOf(row.name) : []),
|
|
261
292
|
]);
|
|
262
293
|
if (!darkOnly && !untouchedSeedRow(row, machineWrote)) continue;
|