ng-hub-ui-nav 22.8.4 → 22.9.1

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/README.md CHANGED
@@ -68,7 +68,8 @@ This library is part of the **ng-hub-ui** ecosystem:
68
68
  - Router-aware active states with fragment and query param support.
69
69
  - Scroll-spy helpers for documentation pages and one-page layouts.
70
70
  - Sticky vertical navigation support.
71
- - **Tooltip on truncated labels** — long item labels are clipped with an ellipsis (the standard sidebar behaviour) and reveal their full text on hover, automatically and only when truncated (via `ng-hub-ui-utils`' `[hubOverflowTooltip]`). The tooltip is **agnostic** — it defaults to the hub-ui tooltip but is swappable with `provideHubTooltip(...)`. Requires `ng-hub-ui-utils >= 22.6.0` and the tooltip styles (`@use 'ng-hub-ui-utils/styles/tooltip';`). Tip: control the sidebar width with `--hub-nav-panel-width`.
71
+ - **Desktop icon rail** — the two-way `rail` input collapses a vertical nav to `--hub-nav-rail-width` (4rem) showing icons only: labels surface as tooltips, accordion groups open as click-triggered overlay flyouts, and the offcanvas behavior still wins below `collapseBreakpoint`. A built-in edge toggle ships by default (`config.railToggle: false` to bring your own) and is fully themeable through `--hub-nav-rail-toggle-*`, including a replaceable SVG arrow. The library persists nothing; `railChange` lets the app store the preference.
72
+ - **Tooltip on truncated labels** — long item labels are clipped with an ellipsis (the standard sidebar behaviour) and reveal their full text on hover, automatically and only when truncated (via `ng-hub-ui-utils`' `[hubOverflowTooltip]`). The tooltip is **agnostic** — it defaults to the hub-ui tooltip but is swappable with `provideHubTooltip(...)`. Requires `ng-hub-ui-utils >= 22.8.1` (the library's peer floor) and the tooltip styles (`@use 'ng-hub-ui-utils/styles/tooltip';`). Tip: control the sidebar width with `--hub-nav-panel-width`.
72
73
  - Semantic `variant` accent system (`primary` / `success` / `danger` / `warning` / `info`, plus any custom accent) recolouring the hover/active affordances — mirrors `<hub-panels>`.
73
74
  - Full CSS variable theming via `--hub-nav-*` tokens.
74
75
 
@@ -157,6 +158,23 @@ export class ExampleComponent {
157
158
  </section>
158
159
  ```
159
160
 
161
+ ### Collapsed Icon Rail
162
+
163
+ ```html
164
+ <hub-nav
165
+ [items]="items"
166
+ [(rail)]="rail"
167
+ [config]="{ orientation: 'vertical', verticalExpandMode: 'accordion' }"
168
+ >
169
+ <!-- The slot context exposes the rail state, e.g. to swap the logo for a mark -->
170
+ <ng-template hubNavStart let-rail="rail">
171
+ <span class="brand">{{ rail ? 'A' : 'Acme ERP' }}</span>
172
+ </ng-template>
173
+ </hub-nav>
174
+ ```
175
+
176
+ A toggle button ships on the outer edge of the primary column: an arrow inside a container, fully driven by the `--hub-nav-rail-toggle-*` tokens (size, padding, border, radius, colors, shadow, offsets and the arrow glyph itself via the `--hub-nav-rail-toggle-icon` SVG mask). Set `config.railToggle: false` to hide it and drive `[(rail)]` from your own control. While the rail is active the nav host width is `--hub-nav-rail-width` (4rem by default), labels keep their accessible name and appear as tooltips, and groups open as overlay flyouts on click. Below `collapseBreakpoint` the flag is ignored — mobile keeps the offcanvas. `railChange` reports every flip (built-in toggle included) so the app can persist the preference.
177
+
160
178
  ## API Reference
161
179
 
162
180
  ### `HubNavComponent`
@@ -170,6 +188,7 @@ export class ExampleComponent {
170
188
  | `navClass` | `string` | `''` | Additional class applied to the internal `<nav>`. |
171
189
  | `itemTemplate` | `TemplateRef<unknown> \| null` | `null` | Optional custom item template. |
172
190
  | `autoOpenFromRoute` | `boolean` | `false` | Opens matching dropdowns/panels from the current route. |
191
+ | `rail` | `boolean` (two-way `model`) | `false` | Desktop-only icon rail for vertical navs. Ignored below `collapseBreakpoint`. Bind with `[(rail)]`. |
173
192
  | `variant` | `'primary' \| 'success' \| 'danger' \| 'warning' \| 'info' \| string` | `'primary'` | Semantic accent for the hover/active affordances. Built-in values render with the design-system tints; any custom string resolves through `--hub-sys-color-<variant>`. |
174
193
 
175
194
  #### Outputs
@@ -181,6 +200,7 @@ export class ExampleComponent {
181
200
  | `dropdownClose` | `OutputEmitterRef<HubNavItem>` | Emitted when a dropdown closes. |
182
201
  | `mobileToggle` | `OutputEmitterRef<boolean>` | Emitted when the responsive mobile panel opens or closes. |
183
202
  | `panelChange` | `OutputEmitterRef<HubNavPanelEvent>` | Emitted when a panel opens, closes, drills down, or drills back. |
203
+ | `railChange` | `OutputEmitterRef<boolean>` | Emitted when the rail model flips — persist it app-side to restore the rail on boot. |
184
204
 
185
205
  ### `HubNavConfig`
186
206
 
@@ -198,9 +218,14 @@ interface HubNavConfig {
198
218
  panelMaxVisible: number;
199
219
  sidebarSide: 'left' | 'right';
200
220
  panelWidth: string;
221
+ dropdownRenderMode: 'inline' | 'overlay';
222
+ labels?: Partial<HubNavLabels>;
201
223
  }
202
224
  ```
203
225
 
226
+ `labels` overrides the built-in accessible strings (`toggleNavigation`, `closeNavigation`, `goBack`, `closePanel`, `toggleSection` — the latter supports a `{label}` placeholder) per instance. Without an override, each label resolves from the shared `HUBUI.NAV.*` dictionary keys (`provideHubTranslationAdapter()` in `ng-hub-ui-utils`) and finally falls back to English.
227
+
228
+
204
229
  ### `HubNavItem`
205
230
 
206
231
  ```typescript