@vectoriox/iox-ui 5.37.0 → 5.39.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 (45) hide show
  1. package/actions-core/index.d.ts +6 -1
  2. package/composite-core/index.d.ts +684 -28
  3. package/design-core/index.d.ts +452 -6
  4. package/fesm2022/vectoriox-iox-ui-actions-core.mjs +12 -4
  5. package/fesm2022/vectoriox-iox-ui-actions-core.mjs.map +1 -1
  6. package/fesm2022/vectoriox-iox-ui-composite-core.mjs +1761 -143
  7. package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
  8. package/fesm2022/vectoriox-iox-ui-design-core.mjs +555 -6
  9. package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
  10. package/fesm2022/vectoriox-iox-ui-generation-core.mjs +534 -12
  11. package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
  12. package/fesm2022/vectoriox-iox-ui-media-core.mjs +571 -0
  13. package/fesm2022/vectoriox-iox-ui-media-core.mjs.map +1 -0
  14. package/fesm2022/vectoriox-iox-ui.mjs +494 -127
  15. package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
  16. package/generation-core/index.d.ts +210 -4
  17. package/index.d.ts +217 -30
  18. package/media-core/index.d.ts +277 -0
  19. package/media-core/package.json +3 -0
  20. package/package.json +5 -1
  21. package/src/actions-core/element-actions.ts +12 -3
  22. package/src/composite-core/accordion-runtime.ts +3 -15
  23. package/src/composite-core/accordion.ts +4 -2
  24. package/src/composite-core/composite-kinds.ts +121 -7
  25. package/src/composite-core/composite-node.ts +4 -0
  26. package/src/composite-core/composite-runtime.ts +68 -0
  27. package/src/composite-core/exclusive-runtime.ts +358 -0
  28. package/src/composite-core/lightbox.ts +192 -0
  29. package/src/composite-core/public-api.ts +8 -2
  30. package/src/composite-core/slider-runtime.ts +180 -0
  31. package/src/composite-core/slider.ts +378 -0
  32. package/src/composite-core/structure.ts +38 -5
  33. package/src/composite-core/tabs.ts +628 -0
  34. package/src/design-core/contrast-audit.ts +5 -0
  35. package/src/design-core/element-styles.ts +34 -3
  36. package/src/design-core/flavor-spec.generated.ts +517 -2
  37. package/src/generation-core/baseline-roles.ts +2 -0
  38. package/src/generation-core/compose-site.ts +147 -4
  39. package/src/generation-core/node-baselines.generated.ts +156 -6
  40. package/src/generation-core/patterns.ts +20 -0
  41. package/src/generation-core/site-spec.generated.ts +210 -0
  42. package/src/media-core/public-api.ts +9 -0
  43. package/src/media-core/video-runtime.ts +239 -0
  44. package/src/media-core/video.ts +443 -0
  45. package/styles/iox-design.css +112 -0
@@ -19,10 +19,13 @@ export enum ElementStyleState {
19
19
  Focus = 'focus',
20
20
  /** The page you're on (CC1 N2): compiles to `[aria-current="page"]`, never a pseudo-class. */
21
21
  Current = 'current',
22
+ /** A composite part that is ON — the active tab (CC4a "Active"): compiles to `[data-iox-on]`, the attribute every
23
+ * composite runtime writes. */
24
+ On = 'on',
22
25
  }
23
26
 
24
27
  export const ELEMENT_STYLE_STATES: ReadonlyArray<ElementStyleState> =
25
- [ElementStyleState.Hover, ElementStyleState.Active, ElementStyleState.Focus, ElementStyleState.Current];
28
+ [ElementStyleState.Hover, ElementStyleState.Active, ElementStyleState.Focus, ElementStyleState.Current, ElementStyleState.On];
26
29
 
27
30
  export interface ElementStyle {
28
31
  readonly id: string;
@@ -34,6 +37,7 @@ export interface ElementStyle {
34
37
  readonly active?: Readonly<Record<string, string>>;
35
38
  readonly focus?: Readonly<Record<string, string>>;
36
39
  readonly current?: Readonly<Record<string, string>>;
40
+ readonly on?: Readonly<Record<string, string>>;
37
41
  }
38
42
 
39
43
  export const ELEMENT_STYLES: ReadonlyArray<ElementStyle> = SPEC_ELEMENT_STYLES;
@@ -166,7 +170,7 @@ function ownedEntries(style: ElementStyle): Array<OwnedTrait & { value: string }
166
170
  return out;
167
171
  }
168
172
 
169
- /** Every trait the style owns with the value it writes — base first, then hover/active/focus/current. */
173
+ /** Every trait the style owns with the value it writes — base first, then hover/active/focus/current/on. */
170
174
  export function ownedTraitsOf(style: ElementStyle): Array<OwnedTrait & { value: string }> {
171
175
  return ownedEntries(style);
172
176
  }
@@ -196,7 +200,7 @@ function writeEntries(target: ElementStyleTarget, style: ElementStyle, skip: Own
196
200
  return unknown;
197
201
  }
198
202
 
199
- /** Write the style's exact base map and its hover/active/focus/current maps into the target. */
203
+ /** Write the style's exact base map and its hover/active/focus/current/on maps into the target. */
200
204
  export function applyElementStyle(target: ElementStyleTarget, id: string): ApplyElementStyleResult {
201
205
  const style = elementStyleById(id);
202
206
  if (!style) return { applied: false, unknownTraits: [] };
@@ -290,6 +294,33 @@ export function switchElementStyle(
290
294
  return { applied: true, kept };
291
295
  }
292
296
 
297
+ /**
298
+ * Take a node OUT of its element style (a part a recipe wants unstyled — a migrated slider's bare chevrons, CC3):
299
+ * every owned trait still holding the style's value goes back to `baseline` (a state trait is removed); a trait the
300
+ * author changed is kept. The node then wears no style (no `iox-es` marker). Returns the kept traits.
301
+ */
302
+ export function releaseElementStyle(
303
+ target: ElementStyleTarget,
304
+ fromId: string | null | undefined,
305
+ baseline: Readonly<Record<string, unknown>> = {},
306
+ ): OwnedTrait[] {
307
+ const kept: OwnedTrait[] = [];
308
+ const from = elementStyleById(fromId);
309
+ if (from) {
310
+ for (const status of ownedTraitStatus(target, from.id)) {
311
+ const ref: OwnedTrait = status.state ? { trait: status.trait, state: status.state } : { trait: status.trait };
312
+ if (status.status === OwnedTraitLink.Changed) {
313
+ if (status.actual !== undefined) kept.push(ref);
314
+ continue;
315
+ }
316
+ if (ref.state) deleteState(target, ref.state, ref.trait);
317
+ else writeBase(target, ref.trait, baseline[ref.trait]);
318
+ }
319
+ }
320
+ delete (target as { elementStyle?: string | null }).elementStyle;
321
+ return kept;
322
+ }
323
+
293
324
  /**
294
325
  * The element-style MARKER (design-system §3b-bis, spec `elementStyleMarker`). A node that wears an
295
326
  * element style renders `iox-es iox-es-<id>` in BOTH renderers, through the one node-class helper