ng-hub-ui-nav 21.1.1 → 22.2.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/README.md +28 -5
- package/fesm2022/ng-hub-ui-nav.mjs +593 -190
- package/fesm2022/ng-hub-ui-nav.mjs.map +1 -1
- package/ng-hub-ui-nav-22.2.0.tgz +0 -0
- package/package.json +6 -5
- package/types/ng-hub-ui-nav.d.ts +185 -10
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
A flexible, accessible, and highly customizable navigation component for Angular 21+. It supports horizontal menus, vertical sidebars, mobile collapse modes, stacked drill-down panels, projected start/end slots, and scroll-spy integration.
|
|
9
9
|
|
|
10
10
|
> [!IMPORTANT]
|
|
11
|
-
> Version `21.1.
|
|
11
|
+
> Version `21.1.1` targets Angular 21 and follows the signal-first architecture used across `ng-hub-ui`.
|
|
12
12
|
|
|
13
13
|
## Documentation and Live Examples
|
|
14
14
|
|
|
@@ -22,18 +22,23 @@ This package is part of [Hub UI](https://hubui.dev/), a collection of Angular co
|
|
|
22
22
|
|
|
23
23
|
This library is part of the **ng-hub-ui** ecosystem:
|
|
24
24
|
|
|
25
|
-
- [**ng-hub-ui-accordion**](https://www.npmjs.com/package/ng-hub-ui-accordion)
|
|
25
|
+
- [**ng-hub-ui-accordion**](https://www.npmjs.com/package/ng-hub-ui-accordion) (deprecated — use ng-hub-ui-panels)
|
|
26
26
|
- [**ng-hub-ui-action-sheet**](https://www.npmjs.com/package/ng-hub-ui-action-sheet)
|
|
27
27
|
- [**ng-hub-ui-avatar**](https://www.npmjs.com/package/ng-hub-ui-avatar)
|
|
28
28
|
- [**ng-hub-ui-board**](https://www.npmjs.com/package/ng-hub-ui-board)
|
|
29
29
|
- [**ng-hub-ui-breadcrumbs**](https://www.npmjs.com/package/ng-hub-ui-breadcrumbs)
|
|
30
30
|
- [**ng-hub-ui-calendar**](https://www.npmjs.com/package/ng-hub-ui-calendar)
|
|
31
31
|
- [**ng-hub-ui-dropdown**](https://www.npmjs.com/package/ng-hub-ui-dropdown)
|
|
32
|
+
- [**ng-hub-ui-ds**](https://www.npmjs.com/package/ng-hub-ui-ds)
|
|
33
|
+
- [**ng-hub-ui-forms**](https://www.npmjs.com/package/ng-hub-ui-forms)
|
|
32
34
|
- [**ng-hub-ui-history**](https://www.npmjs.com/package/ng-hub-ui-history)
|
|
35
|
+
- [**ng-hub-ui-milestones**](https://www.npmjs.com/package/ng-hub-ui-milestones)
|
|
33
36
|
- [**ng-hub-ui-modal**](https://www.npmjs.com/package/ng-hub-ui-modal)
|
|
34
37
|
- [**ng-hub-ui-nav**](https://www.npmjs.com/package/ng-hub-ui-nav) ← You are here
|
|
35
38
|
- [**ng-hub-ui-paginable**](https://www.npmjs.com/package/ng-hub-ui-paginable)
|
|
39
|
+
- [**ng-hub-ui-panels**](https://www.npmjs.com/package/ng-hub-ui-panels)
|
|
36
40
|
- [**ng-hub-ui-portal**](https://www.npmjs.com/package/ng-hub-ui-portal)
|
|
41
|
+
- [**ng-hub-ui-skeleton**](https://www.npmjs.com/package/ng-hub-ui-skeleton)
|
|
37
42
|
- [**ng-hub-ui-sortable**](https://www.npmjs.com/package/ng-hub-ui-sortable)
|
|
38
43
|
- [**ng-hub-ui-stepper**](https://www.npmjs.com/package/ng-hub-ui-stepper)
|
|
39
44
|
- [**ng-hub-ui-utils**](https://www.npmjs.com/package/ng-hub-ui-utils)
|
|
@@ -63,6 +68,7 @@ This library is part of the **ng-hub-ui** ecosystem:
|
|
|
63
68
|
- Router-aware active states with fragment and query param support.
|
|
64
69
|
- Scroll-spy helpers for documentation pages and one-page layouts.
|
|
65
70
|
- Sticky vertical navigation support.
|
|
71
|
+
- Semantic `variant` accent system (`primary` / `success` / `danger` / `warning` / `info`, plus any custom accent) recolouring the hover/active affordances — mirrors `<hub-panels>`.
|
|
66
72
|
- Full CSS variable theming via `--hub-nav-*` tokens.
|
|
67
73
|
|
|
68
74
|
## Installation
|
|
@@ -163,6 +169,7 @@ export class ExampleComponent {
|
|
|
163
169
|
| `navClass` | `string` | `''` | Additional class applied to the internal `<nav>`. |
|
|
164
170
|
| `itemTemplate` | `TemplateRef<unknown> \| null` | `null` | Optional custom item template. |
|
|
165
171
|
| `autoOpenFromRoute` | `boolean` | `false` | Opens matching dropdowns/panels from the current route. |
|
|
172
|
+
| `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>`. |
|
|
166
173
|
|
|
167
174
|
#### Outputs
|
|
168
175
|
|
|
@@ -229,14 +236,30 @@ The component exposes a complete set of `--hub-nav-*` tokens. See the full refer
|
|
|
229
236
|
|
|
230
237
|
- [CSS Variables Reference](docs/css-variables-reference.md)
|
|
231
238
|
|
|
232
|
-
|
|
239
|
+
### Recolour the whole nav from a single accent
|
|
240
|
+
|
|
241
|
+
The hover/active affordances and the nav surface all derive from one accent hook. Set it (or use the `variant` input) to re-theme the entire nav:
|
|
233
242
|
|
|
234
243
|
```css
|
|
235
244
|
.my-sidebar {
|
|
236
245
|
--hub-nav-panel-width: 18rem;
|
|
246
|
+
/* Single recolour hook — the tinted active background, accent text, hover
|
|
247
|
+
tint, indicator bar, and surface wash all follow this one accent. */
|
|
248
|
+
--hub-nav-accent: var(--hub-sys-color-success);
|
|
249
|
+
--hub-nav-dropdown-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.16);
|
|
250
|
+
}
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Restore the legacy solid-fill look
|
|
254
|
+
|
|
255
|
+
The default active item is now a soft accent tint + accent text. To restore the previous solid accent fill + white text (the pre-`22.1.0` look), override these tokens explicitly:
|
|
256
|
+
|
|
257
|
+
```css
|
|
258
|
+
.my-sidebar {
|
|
237
259
|
--hub-nav-item-active-bg: #0d6efd;
|
|
238
260
|
--hub-nav-item-active-color: #ffffff;
|
|
239
|
-
--hub-nav-
|
|
261
|
+
--hub-nav-item-hover-bg: rgba(0, 0, 0, 0.04);
|
|
262
|
+
--hub-nav-bg: #ffffff;
|
|
240
263
|
}
|
|
241
264
|
```
|
|
242
265
|
|
|
@@ -265,7 +288,7 @@ If this library helps your projects, you can support its maintenance here:
|
|
|
265
288
|
|
|
266
289
|
## Contributors
|
|
267
290
|
|
|
268
|
-
Created and maintained by [Carlos Morcillo](https://
|
|
291
|
+
Created and maintained by [Carlos Morcillo](https://www.carlosmorcillo.com).
|
|
269
292
|
|
|
270
293
|
## License
|
|
271
294
|
|