@vectoriox/iox-ui 5.31.2 → 5.32.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.
@@ -17,10 +17,12 @@ export enum ElementStyleState {
17
17
  Hover = 'hover',
18
18
  Active = 'active',
19
19
  Focus = 'focus',
20
+ /** The page you're on (CC1 N2): compiles to `[aria-current="page"]`, never a pseudo-class. */
21
+ Current = 'current',
20
22
  }
21
23
 
22
24
  export const ELEMENT_STYLE_STATES: ReadonlyArray<ElementStyleState> =
23
- [ElementStyleState.Hover, ElementStyleState.Active, ElementStyleState.Focus];
25
+ [ElementStyleState.Hover, ElementStyleState.Active, ElementStyleState.Focus, ElementStyleState.Current];
24
26
 
25
27
  export interface ElementStyle {
26
28
  readonly id: string;
@@ -31,6 +33,7 @@ export interface ElementStyle {
31
33
  readonly hover?: Readonly<Record<string, string>>;
32
34
  readonly active?: Readonly<Record<string, string>>;
33
35
  readonly focus?: Readonly<Record<string, string>>;
36
+ readonly current?: Readonly<Record<string, string>>;
34
37
  }
35
38
 
36
39
  export const ELEMENT_STYLES: ReadonlyArray<ElementStyle> = SPEC_ELEMENT_STYLES;
@@ -163,7 +166,7 @@ function ownedEntries(style: ElementStyle): Array<OwnedTrait & { value: string }
163
166
  return out;
164
167
  }
165
168
 
166
- /** Every trait the style owns with the value it writes — base first, then hover/active/focus. */
169
+ /** Every trait the style owns with the value it writes — base first, then hover/active/focus/current. */
167
170
  export function ownedTraitsOf(style: ElementStyle): Array<OwnedTrait & { value: string }> {
168
171
  return ownedEntries(style);
169
172
  }
@@ -193,7 +196,7 @@ function writeEntries(target: ElementStyleTarget, style: ElementStyle, skip: Own
193
196
  return unknown;
194
197
  }
195
198
 
196
- /** Write the style's exact base map and its hover/active/focus maps into the target. */
199
+ /** Write the style's exact base map and its hover/active/focus/current maps into the target. */
197
200
  export function applyElementStyle(target: ElementStyleTarget, id: string): ApplyElementStyleResult {
198
201
  const style = elementStyleById(id);
199
202
  if (!style) return { applied: false, unknownTraits: [] };