@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.
Files changed (73) hide show
  1. package/actions-core/index.d.ts +7 -1
  2. package/composite-core/index.d.ts +16 -2
  3. package/data-core/index.d.ts +11 -3
  4. package/design-core/index.d.ts +185 -28
  5. package/fesm2022/vectoriox-iox-ui-actions-core.mjs +6 -1
  6. package/fesm2022/vectoriox-iox-ui-actions-core.mjs.map +1 -1
  7. package/fesm2022/vectoriox-iox-ui-composite-core.mjs +34 -2
  8. package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
  9. package/fesm2022/vectoriox-iox-ui-data-core.mjs +30 -4
  10. package/fesm2022/vectoriox-iox-ui-data-core.mjs.map +1 -1
  11. package/fesm2022/vectoriox-iox-ui-design-core.mjs +323 -72
  12. package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
  13. package/fesm2022/vectoriox-iox-ui-generation-core.mjs +17351 -15175
  14. package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
  15. package/fesm2022/vectoriox-iox-ui-harness-core.mjs +243 -38
  16. package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
  17. package/fesm2022/vectoriox-iox-ui.mjs +2 -2
  18. package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
  19. package/generation-core/index.d.ts +1703 -264
  20. package/harness-core/index.d.ts +93 -6
  21. package/package.json +1 -1
  22. package/src/actions-core/element-actions.ts +6 -0
  23. package/src/composite-core/header.ts +34 -1
  24. package/src/data-core/placeholder-rows.ts +29 -4
  25. package/src/design-core/brand.ts +58 -5
  26. package/src/design-core/contrast-audit.ts +49 -22
  27. package/src/design-core/design-apply.ts +34 -3
  28. package/src/design-core/flavor-fixtures.generated.ts +123 -123
  29. package/src/design-core/flavor-spec.generated.ts +44 -4
  30. package/src/design-core/flavor-tokens.ts +1 -1
  31. package/src/design-core/header-behaviour.ts +72 -13
  32. package/src/design-core/menu-look.ts +23 -0
  33. package/src/design-core/motion-language.ts +5 -14
  34. package/src/design-core/node-classes.ts +39 -0
  35. package/src/design-core/preloader.ts +4 -5
  36. package/src/generation-core/body-mix.ts +40 -102
  37. package/src/generation-core/check-free.ts +22 -11
  38. package/src/generation-core/check-layout.ts +10 -4
  39. package/src/generation-core/check-list.ts +3 -25
  40. package/src/generation-core/colour-mix.ts +296 -0
  41. package/src/generation-core/compose-free.ts +47 -20
  42. package/src/generation-core/compose-site.ts +259 -59
  43. package/src/generation-core/footer-mix.ts +258 -64
  44. package/src/generation-core/free-fallback.ts +6 -4
  45. package/src/generation-core/free-opening.ts +13 -2
  46. package/src/generation-core/free-parts.ts +87 -0
  47. package/src/generation-core/free-slot-words.ts +30 -0
  48. package/src/generation-core/free-wire.ts +8 -0
  49. package/src/generation-core/generation-tier.ts +6 -17
  50. package/src/generation-core/header-mix.ts +73 -3
  51. package/src/generation-core/layout-drawers.ts +3 -2
  52. package/src/generation-core/layout-wire.ts +10 -16
  53. package/src/generation-core/legal.ts +24 -0
  54. package/src/generation-core/list-panel.ts +3 -3
  55. package/src/generation-core/list-table.ts +5 -14
  56. package/src/generation-core/list-words.ts +2 -1
  57. package/src/generation-core/menu-shelves.ts +138 -0
  58. package/src/generation-core/nav-shape.ts +138 -15
  59. package/src/generation-core/node-baselines.generated.ts +1 -0
  60. package/src/generation-core/opening-mix.ts +7 -34
  61. package/src/generation-core/part-tier.ts +14 -0
  62. package/src/generation-core/patterns.ts +7 -0
  63. package/src/generation-core/plan-wire.ts +32 -43
  64. package/src/generation-core/public-api.ts +3 -0
  65. package/src/generation-core/site-build-run.ts +8 -0
  66. package/src/generation-core/site-plan.model.ts +3 -0
  67. package/src/generation-core/site-spec.generated.ts +1383 -189
  68. package/src/generation-core/validate-site-plan.ts +6 -5
  69. package/src/harness-core/business-types.ts +4 -0
  70. package/src/harness-core/harness-spec.generated.ts +189 -30
  71. package/src/harness-core/popup-stance.ts +56 -3
  72. package/src/harness-core/run-compose-context.ts +25 -5
  73. 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
- interface FloatingGround { readonly ground: string; readonly ink: string; }
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
- (SPEC_CONTRAST_AUDIT as unknown as { floatingGrounds?: ReadonlyArray<FloatingGround> }).floatingGrounds ?? [];
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 the page's own scheme (the one a
398
- * header on a ground and a top-layer dialog wear), in one mode — nothing a blur can lay under the bar is darker or
399
- * lighter, so a ground that holds AA over both holds it over any picture (iox-ui#173: the Glass look's bar dropped to
400
- * 3.55:1 over a light picture in dark mode). An opaque ground is not judged here (the DS9 audit judges it where it stands).
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(rows: ReadonlyArray<DesignTokenLike>, mode: ResolvedMode): ContrastFinding[] {
404
- const values = schemeTokenResolver(rows, mode)(DEFAULT_SCHEME);
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 { ground, ink } of FLOATING_GROUNDS) {
407
- const fg = parseCssColour(values[ink]);
408
- const bg = parseCssColour(values[ground], fg);
409
- if (!fg || !bg || bg.a >= 1) continue;
410
- const fgHex = toHexColor(quantizeRgb(fg));
411
- for (const [name, under] of Object.entries(FLOATING_BACKDROPS)) {
412
- const shown = quantizeRgb(compositeOver(bg, under));
413
- const ratio = wcagContrastRatio(fgHex, shown);
414
- out.push({
415
- scheme: DEFAULT_SCHEME, container: `over ${name}`, element: ground, part: ink, fg: fgHex, bg: toHexColor(shown),
416
- ratio: Math.round(ratio * 100) / 100, min: WCAG_AA_TEXT, pass: ratio >= WCAG_AA_TEXT - 1e-9,
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;