@vectoriox/iox-ui 5.174.0 → 5.175.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectoriox/iox-ui",
3
- "version": "5.174.0",
3
+ "version": "5.175.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=20.0.0",
6
6
  "@angular/core": ">=20.0.0",
@@ -189,8 +189,9 @@ export const BAR_CROWDED_AT = 3;
189
189
  export const PHONE_BAR_CONTROL_ROLES: ReadonlyArray<string> = ['nav.menu-button', 'shop.cart-button', 'account', 'nav.pinned', 'nav.actions'];
190
190
  /** What never counts: the drawer (a Dialog) and everything in it. */
191
191
  const BAR_SKIPPED_TYPES: ReadonlyArray<string> = ['Dialog'];
192
- /** The phone layers that may hide a part (responsive-breakpoints plan: `mobile` ≤ 767, `small` ≤ 479). */
193
- const PHONE_LAYERS: ReadonlyArray<string> = ['mobile', 'small'];
192
+ /** The layers that reach a phone held upright, widest → narrowest — the cascade order (iox-ui `BREAKPOINTS`: `laptop`
193
+ * ≤ 1200, `tablet` ≤ 991, `mobile` ≤ 767, `small` ≤ 479). Spelled here: design-core reads no Angular entry. */
194
+ const PHONE_CASCADE: ReadonlyArray<string> = ['laptop', 'tablet', 'mobile', 'small'];
194
195
 
195
196
  export interface BarNode {
196
197
  role?: string | null;
@@ -200,8 +201,17 @@ export interface BarNode {
200
201
  children?: ReadonlyArray<unknown> | null;
201
202
  }
202
203
 
203
- const hiddenOnPhone = (node: BarNode): boolean =>
204
- node.styleProps?.['display'] === 'none' || PHONE_LAYERS.some(bp => node.responsive?.[bp]?.styleProps?.['display'] === 'none');
204
+ /** Hidden on a phone: its display where a phone held upright lands, the last layer that says one (base → `small`).
205
+ * vectoriox/iox-ui#143: a menu button is `none` at base and shown from its breakpoint down — read by its base alone it
206
+ * was "hidden", the store bar (account · bag · menu) counted two and was never crowded, and its name broke at 390. */
207
+ const hiddenOnPhone = (node: BarNode): boolean => {
208
+ let display = node.styleProps?.['display'];
209
+ for (const bp of PHONE_CASCADE) {
210
+ const layer = node.responsive?.[bp]?.styleProps?.['display'];
211
+ if (layer !== undefined && layer !== null && layer !== '') display = layer;
212
+ }
213
+ return display === 'none';
214
+ };
205
215
 
206
216
  /** How many controls sit beside the name in the navigation's phone bar. */
207
217
  export function phoneBarControls(nav: BarNode | null | undefined): number {
@@ -577,10 +577,12 @@ dialog[data-iox-dialog]:has(> .iox-dialog-close),
577
577
  menu). The name's own step (`data-iox-name`) counts its characters and cannot see its neighbours: on a 390 store header
578
578
  "Homeware shop in Tel Aviv" kept 77px at `size-lead` and broke inside "Homeware". The navigation root says the bar is
579
579
  crowded (design-core `navBarAttributes`): an empty side cell gives back its gap, the controls sit at a quarter of the
580
- look's gap, a worded menu button keeps half the gap on each side (still well over a 44px target), and the name takes the
580
+ look's gap — in a cell and, where they are the bar's own children (a store's account · bag · menu), in the bar itself:
581
+ at 320 the bar's half-gaps took 48px of the name's 66 (iox-ui#143 at 320) — a worded menu button keeps half the gap on each side (still well over a 44px target), and the name takes the
581
582
  crowded step (`data-iox-bar-name`) — never larger type than its own step (equal specificity, written after it).
582
583
  Both carriers, as for the brand (#135): the attribute on the role's element or on its direct child. */
583
584
  @media (max-width: 767px) {
585
+ :is(.iox-role-nav[data-iox-bar='crowded'], .iox-role-nav > [data-iox-bar='crowded']) { column-gap: calc(var(--iox-space-gap) / 4); }
584
586
  :is(.iox-role-nav[data-iox-bar='crowded'], .iox-role-nav > [data-iox-bar='crowded']) .iox-role-nav-cell:empty { display: none; }
585
587
  :is(.iox-role-nav[data-iox-bar='crowded'], .iox-role-nav > [data-iox-bar='crowded']) .iox-role-nav-cell { column-gap: calc(var(--iox-space-gap) / 4); }
586
588
  :is(.iox-role-nav[data-iox-bar='crowded'], .iox-role-nav > [data-iox-bar='crowded']) .iox-role-nav-menu-button[data-iox-menu-button='word'] { padding-inline: calc(var(--iox-space-gap) / 2); }
@@ -589,6 +591,7 @@ dialog[data-iox-dialog]:has(> .iox-dialog-close),
589
591
  :is(.iox-role-nav[data-iox-bar-name='longest'], .iox-role-nav > [data-iox-bar-name='longest']) .iox-role-nav-brand :is(h1, h2, h3, h4, h5, h6, p) { font-size: var(--iox-size-small); }
590
592
  }
591
593
  @container iox-canvas (max-width: 767px) {
594
+ :is(.iox-role-nav[data-iox-bar='crowded'], .iox-role-nav > [data-iox-bar='crowded']) { column-gap: calc(var(--iox-space-gap) / 4); }
592
595
  :is(.iox-role-nav[data-iox-bar='crowded'], .iox-role-nav > [data-iox-bar='crowded']) .iox-role-nav-cell:empty { display: none; }
593
596
  :is(.iox-role-nav[data-iox-bar='crowded'], .iox-role-nav > [data-iox-bar='crowded']) .iox-role-nav-cell { column-gap: calc(var(--iox-space-gap) / 4); }
594
597
  :is(.iox-role-nav[data-iox-bar='crowded'], .iox-role-nav > [data-iox-bar='crowded']) .iox-role-nav-menu-button[data-iox-menu-button='word'] { padding-inline: calc(var(--iox-space-gap) / 2); }