@egose/shadcn-theme-ng 0.1.0 → 0.3.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 +2 -2
- package/accordion/README.md +405 -2
- package/alert/README.md +372 -2
- package/alert-dialog/README.md +471 -5
- package/aspect-ratio/README.md +272 -5
- package/autocomplete/README.md +502 -2
- package/autocomplete/fesm2022/autocomplete.mjs +1 -1
- package/avatar/README.md +357 -5
- package/badge/README.md +318 -2
- package/basic-alert/README.md +353 -2
- package/breadcrumb/README.md +406 -5
- package/button/README.md +482 -2
- package/button/fesm2022/button.mjs +85 -107
- package/button/types/button.d.ts +5 -8
- package/button-group/README.md +318 -5
- package/calendar/README.md +357 -2
- package/card/README.md +331 -5
- package/carousel/README.md +333 -5
- package/carousel/fesm2022/carousel.mjs +4 -1
- package/checkbox/README.md +320 -2
- package/checkbox/fesm2022/checkbox.mjs +6 -7
- package/checkbox/types/checkbox.d.ts +1 -1
- package/collapsible/README.md +332 -5
- package/combobox/README.md +507 -5
- package/combobox/fesm2022/combobox.mjs +5 -2
- package/command/README.md +435 -5
- package/confirmation-dialog/README.md +301 -2
- package/context-menu/README.md +366 -5
- package/date-picker/README.md +469 -2
- package/date-picker/fesm2022/date-picker.mjs +150 -32
- package/date-picker/types/date-picker.d.ts +102 -9
- package/dialog/README.md +448 -2
- package/drawer/README.md +395 -5
- package/dropdown-menu/README.md +417 -5
- package/empty/README.md +329 -5
- package/field/README.md +385 -5
- package/form-autocomplete/README.md +177 -0
- package/form-autocomplete/fesm2022/form-autocomplete.mjs +125 -0
- package/form-autocomplete/package.json +24 -0
- package/form-autocomplete/types/form-autocomplete.d.ts +61 -0
- package/form-checkbox/README.md +322 -2
- package/form-checkbox/fesm2022/form-checkbox.mjs +22 -9
- package/form-checkbox/types/form-checkbox.d.ts +23 -4
- package/form-combobox/README.md +202 -0
- package/form-combobox/fesm2022/form-combobox.mjs +147 -0
- package/form-combobox/package.json +24 -0
- package/form-combobox/types/form-combobox.d.ts +73 -0
- package/form-date-picker/README.md +348 -2
- package/form-date-picker/fesm2022/form-date-picker.mjs +38 -12
- package/form-date-picker/types/form-date-picker.d.ts +17 -1
- package/form-date-picker-multi/README.md +191 -0
- package/form-date-picker-multi/fesm2022/form-date-picker-multi.mjs +129 -0
- package/form-date-picker-multi/package.json +24 -0
- package/form-date-picker-multi/types/form-date-picker-multi.d.ts +58 -0
- package/form-date-range-picker/README.md +253 -0
- package/form-date-range-picker/fesm2022/form-date-range-picker.mjs +130 -0
- package/form-date-range-picker/package.json +24 -0
- package/form-date-range-picker/types/form-date-range-picker.d.ts +55 -0
- package/form-field/README.md +356 -2
- package/form-field-simple/README.md +340 -2
- package/form-input-otp/README.md +194 -0
- package/form-input-otp/fesm2022/form-input-otp.mjs +106 -0
- package/form-input-otp/package.json +24 -0
- package/form-input-otp/types/form-input-otp.d.ts +58 -0
- package/form-month-year-picker/README.md +188 -0
- package/form-month-year-picker/fesm2022/form-month-year-picker.mjs +125 -0
- package/form-month-year-picker/package.json +24 -0
- package/form-month-year-picker/types/form-month-year-picker.d.ts +53 -0
- package/form-native-select/README.md +205 -0
- package/form-native-select/fesm2022/form-native-select.mjs +103 -0
- package/form-native-select/package.json +24 -0
- package/form-native-select/types/form-native-select.d.ts +57 -0
- package/form-phone-input/README.md +188 -0
- package/form-phone-input/fesm2022/form-phone-input.mjs +113 -0
- package/form-phone-input/package.json +24 -0
- package/form-phone-input/types/form-phone-input.d.ts +58 -0
- package/form-radio-group/README.md +198 -0
- package/form-radio-group/fesm2022/form-radio-group.mjs +111 -0
- package/form-radio-group/package.json +24 -0
- package/form-radio-group/types/form-radio-group.d.ts +63 -0
- package/form-searchable-multiselect/README.md +371 -2
- package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs +19 -10
- package/form-searchable-multiselect/types/form-searchable-multiselect.d.ts +18 -1
- package/form-select/README.md +360 -2
- package/form-select/fesm2022/form-select.mjs +20 -11
- package/form-select/types/form-select.d.ts +18 -1
- package/form-slider/README.md +182 -0
- package/form-slider/fesm2022/form-slider.mjs +106 -0
- package/form-slider/package.json +24 -0
- package/form-slider/types/form-slider.d.ts +60 -0
- package/form-switch/README.md +173 -0
- package/form-switch/fesm2022/form-switch.mjs +100 -0
- package/form-switch/package.json +24 -0
- package/form-switch/types/form-switch.d.ts +50 -0
- package/form-text-input/README.md +381 -2
- package/form-text-input/fesm2022/form-text-input.mjs +19 -10
- package/form-text-input/types/form-text-input.d.ts +18 -1
- package/form-textarea/README.md +357 -2
- package/form-textarea/fesm2022/form-textarea.mjs +19 -10
- package/form-textarea/types/form-textarea.d.ts +18 -1
- package/form-toggle/README.md +186 -0
- package/form-toggle/fesm2022/form-toggle.mjs +159 -0
- package/form-toggle/package.json +24 -0
- package/form-toggle/types/form-toggle.d.ts +82 -0
- package/form-toggle-group/README.md +176 -0
- package/form-toggle-group/fesm2022/form-toggle-group.mjs +116 -0
- package/form-toggle-group/package.json +24 -0
- package/form-toggle-group/types/form-toggle-group.d.ts +65 -0
- package/hover-card/README.md +256 -5
- package/icon/README.md +239 -2
- package/input/README.md +269 -2
- package/input-group/README.md +335 -5
- package/input-group/fesm2022/input-group.mjs +22 -12
- package/input-group/types/input-group.d.ts +4 -1
- package/input-otp/README.md +375 -5
- package/item/README.md +385 -5
- package/item/fesm2022/item.mjs +3 -3
- package/kbd/README.md +291 -5
- package/label/README.md +272 -2
- package/layout-simple/README.md +193 -2
- package/layout-simple/fesm2022/layout-simple.mjs +472 -236
- package/layout-simple/types/layout-simple.d.ts +174 -137
- package/menu/README.md +417 -2
- package/menubar/README.md +343 -5
- package/native-select/README.md +323 -5
- package/native-select/fesm2022/native-select.mjs +18 -6
- package/native-select/types/native-select.d.ts +7 -2
- package/navigation-menu/README.md +369 -5
- package/package.json +57 -1
- package/pagination/README.md +388 -5
- package/phone-input/README.md +114 -0
- package/phone-input/fesm2022/phone-input.mjs +191 -0
- package/phone-input/package.json +24 -0
- package/phone-input/types/phone-input.d.ts +67 -0
- package/popover/README.md +331 -2
- package/progress/README.md +311 -5
- package/radio-group/README.md +364 -2
- package/radio-group/fesm2022/radio-group.mjs +5 -1
- package/resizable/README.md +269 -5
- package/scroll-area/README.md +233 -5
- package/searchable-multiselect/README.md +323 -2
- package/select/README.md +437 -2
- package/separator/README.md +222 -2
- package/sheet/README.md +311 -2
- package/sidebar/README.md +457 -5
- package/skeleton/README.md +217 -5
- package/slider/README.md +273 -5
- package/slider/fesm2022/slider.mjs +3 -3
- package/sonner/README.md +346 -2
- package/spinner/README.md +284 -2
- package/switch/README.md +310 -2
- package/switch/fesm2022/switch.mjs +7 -5
- package/switch/types/switch.d.ts +2 -1
- package/table/README.md +423 -5
- package/tabs/README.md +411 -2
- package/tabs/fesm2022/tabs.mjs +2 -2
- package/textarea/README.md +282 -5
- package/toggle/README.md +270 -5
- package/toggle-group/README.md +340 -5
- package/tooltip/README.md +269 -2
- package/typography/README.md +271 -5
- package/utils/README.md +303 -2
|
@@ -1,11 +1,375 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Navigation Menu (`@egose/shadcn-theme-ng/navigation-menu`)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Site-navigation bar with dropdown content panels (shadcn/ui `navigation-menu` equivalent). Thin shadcn styling directives/components over the spartan-ng `BrnNavigationMenu` brain family: the bar itself plus list/item/trigger/link/content/portal pieces. Use it for marketing/docs headers where top-level entries either link somewhere or open a rich panel — as opposed to `menubar` (action menus) or `dropdown-menu` (single-button menus).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Ships as `@egose/shadcn-theme-ng/navigation-menu` and `@egose/shadcn-theme-ng-tw/navigation-menu` (tw: variant). See the [package README](../../README.md) for installation, peer dependencies, Tailwind setup, and testing. Do not publish this project directory independently.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Installation
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
|
|
10
|
+
# Plain Tailwind (no prefix):
|
|
11
|
+
npm install @egose/shadcn-theme-ng
|
|
12
|
+
|
|
13
|
+
# Or the tw:-prefixed variant:
|
|
14
|
+
npm install @egose/shadcn-theme-ng-tw
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Peer dependencies are inherited from the package root (see [package README](../../README.md)). This subpath itself declares `@angular/common`, `@angular/core`, `@spartan-ng/brain` as peers plus a `tslib` runtime dependency; at runtime it also uses `@ng-icons/lucide` (`lucideChevronDown`). No extra install step is needed beyond the package install above.
|
|
18
|
+
|
|
19
|
+
## Imports
|
|
20
|
+
|
|
21
|
+
Real exported symbols (from `src/public-api.ts`):
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import {
|
|
25
|
+
HlmNavigationMenu, // directive: nav[hlmNavigationMenu]
|
|
26
|
+
HlmNavigationMenuList, // directive: ul[hlmNavigationMenuList]
|
|
27
|
+
HlmNavigationMenuItem, // directive: li[hlmNavigationMenuItem]
|
|
28
|
+
HlmNavigationMenuTrigger, // component: button[hlmNavigationMenuTrigger]
|
|
29
|
+
HlmNavigationMenuContent, // directive: [hlmNavigationMenuContent],hlm-navigation-menu-content
|
|
30
|
+
HlmNavigationMenuPortal, // directive: [hlmNavigationMenuPortal]
|
|
31
|
+
HlmNavigationMenuLink, // directive: a[hlmNavigationMenuLink]
|
|
32
|
+
HlmNavigationMenuImports, // all seven above
|
|
33
|
+
HlmNavigationMenuModule, // NgModule wrapping HlmNavigationMenuImports
|
|
34
|
+
} from '@egose/shadcn-theme-ng/navigation-menu';
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Standalone usage:
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
import { Component } from '@angular/core';
|
|
41
|
+
import { HlmNavigationMenuImports } from '@egose/shadcn-theme-ng/navigation-menu';
|
|
42
|
+
|
|
43
|
+
@Component({
|
|
44
|
+
selector: 'app-demo',
|
|
45
|
+
standalone: true,
|
|
46
|
+
imports: [...HlmNavigationMenuImports],
|
|
47
|
+
template: `
|
|
48
|
+
<nav hlmNavigationMenu>
|
|
49
|
+
<ul hlmNavigationMenuList>
|
|
50
|
+
<li hlmNavigationMenuItem>
|
|
51
|
+
<a hlmNavigationMenuLink routerLink="/">Home</a>
|
|
52
|
+
</li>
|
|
53
|
+
</ul>
|
|
54
|
+
</nav>
|
|
55
|
+
`,
|
|
56
|
+
})
|
|
57
|
+
export class DemoComponent {}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
NgModule usage:
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
import { NgModule } from '@angular/core';
|
|
64
|
+
import { HlmNavigationMenuModule } from '@egose/shadcn-theme-ng/navigation-menu';
|
|
65
|
+
|
|
66
|
+
@NgModule({ imports: [HlmNavigationMenuModule] })
|
|
67
|
+
export class DemoModule {}
|
|
11
68
|
```
|
|
69
|
+
|
|
70
|
+
For the `tw:` build, swap the specifier to `@egose/shadcn-theme-ng-tw/navigation-menu`. Symbol names are identical.
|
|
71
|
+
|
|
72
|
+
## Anatomy / Structure
|
|
73
|
+
|
|
74
|
+
```html
|
|
75
|
+
<nav hlmNavigationMenu>
|
|
76
|
+
<ul hlmNavigationMenuList>
|
|
77
|
+
<!-- plain link -->
|
|
78
|
+
<li hlmNavigationMenuItem>
|
|
79
|
+
<a hlmNavigationMenuLink routerLink="/docs">Docs</a>
|
|
80
|
+
</li>
|
|
81
|
+
|
|
82
|
+
<!-- trigger + dropdown panel -->
|
|
83
|
+
<li hlmNavigationMenuItem>
|
|
84
|
+
<button hlmNavigationMenuTrigger>Products</button>
|
|
85
|
+
<!-- panel content: style with the content directive … -->
|
|
86
|
+
<div hlmNavigationMenuContent>
|
|
87
|
+
<a hlmNavigationMenuLink routerLink="/products/a">Product A</a>
|
|
88
|
+
<a hlmNavigationMenuLink routerLink="/products/b">Product B</a>
|
|
89
|
+
</div>
|
|
90
|
+
<!-- … and project it through the brain portal -->
|
|
91
|
+
<ng-container *hlmNavigationMenuPortal />
|
|
92
|
+
</li>
|
|
93
|
+
</ul>
|
|
94
|
+
</nav>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
> Check the spartan-ng `BrnNavigationMenu` docs for the exact content/portal wiring in your installed version; the selectors above are the shadcn styling layer. The common shape is: trigger toggles state, `hlmNavigationMenuContent` styles the floating panel, and `*hlmNavigationMenuPortal` outlets the brain content.
|
|
98
|
+
|
|
99
|
+
| Class | Selector | Element | Role |
|
|
100
|
+
| -------------------------- | -------------------------------------------------------- | ----------------- | ---------------------------------------------------------- |
|
|
101
|
+
| `HlmNavigationMenu` | `nav[hlmNavigationMenu]` | `<nav>` only | Root; `BrnNavigationMenu` host |
|
|
102
|
+
| `HlmNavigationMenuList` | `ul[hlmNavigationMenuList]` | `<ul>` only | Horizontal list (`BrnNavigationMenuList`) |
|
|
103
|
+
| `HlmNavigationMenuItem` | `li[hlmNavigationMenuItem]` | `<li>` only | Item wrapper (`BrnNavigationMenuItem`) |
|
|
104
|
+
| `HlmNavigationMenuTrigger` | `button[hlmNavigationMenuTrigger]` | `<button>` only | Dropdown trigger with chevron (`BrnNavigationMenuTrigger`) |
|
|
105
|
+
| `HlmNavigationMenuLink` | `a[hlmNavigationMenuLink]` | `<a>` only | Styled nav link (`BrnNavigationMenuLink`) |
|
|
106
|
+
| `HlmNavigationMenuContent` | `[hlmNavigationMenuContent],hlm-navigation-menu-content` | any / element | Panel styling + `--nav-offset` |
|
|
107
|
+
| `HlmNavigationMenuPortal` | `[hlmNavigationMenuPortal]` | structural anchor | Projects `BrnNavigationMenuContent` |
|
|
108
|
+
|
|
109
|
+
## API reference
|
|
110
|
+
|
|
111
|
+
| Selector | Inputs (incl. host-directive passthroughs) | Outputs | Notes |
|
|
112
|
+
| ---------------------------------- | ---------------------------------------------------------------------------------------------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
113
|
+
| `nav[hlmNavigationMenu]` | `value`, `delayDuration`, `skipDelayDuration`, `orientation`, `openOn` (all via `BrnNavigationMenu`) | `valueChange` (via `BrnNavigationMenu`) | No shadcn inputs of its own |
|
|
114
|
+
| `ul[hlmNavigationMenuList]` | — | — | `gap-0 flex flex-1 list-none items-center justify-center`; stacks when `data-[orientation=vertical]` |
|
|
115
|
+
| `li[hlmNavigationMenuItem]` | `id` (via `BrnNavigationMenuItem`) | — | `relative has-[:focus]:z-10 data-active:z-10` |
|
|
116
|
+
| `button[hlmNavigationMenuTrigger]` | `align` (via `BrnNavigationMenuTrigger`) | — | Renders `<ng-content>` + `lucideChevronDown` that rotates when the trigger/item is open (`group-data-open` / `group-data-popup-open`) |
|
|
117
|
+
| `a[hlmNavigationMenuLink]` | `active` (via `BrnNavigationMenuLink`) | — | `data-[active=true]` active treatment |
|
|
118
|
+
| `[hlmNavigationMenuContent]` | `navOffset: number` (default `1.5`, number coercion) → `[style.--nav-offset]` | — | Animation/motion classes keyed off `data-[motion]` + `data-[orientation]`; panel chrome (`bg-popover rounded-lg shadow ring-1`) |
|
|
119
|
+
| `[hlmNavigationMenuPortal]` | `context`, `class` (via `BrnPopoverContent`-style `BrnNavigationMenuContent` host) | — | No shadcn inputs; pure projection directive |
|
|
120
|
+
|
|
121
|
+
No methods or signals are declared on any of these classes; behavior lives in the brain directives.
|
|
122
|
+
|
|
123
|
+
## Examples
|
|
124
|
+
|
|
125
|
+
### 1. Basic bar with links + one dropdown
|
|
126
|
+
|
|
127
|
+
```ts
|
|
128
|
+
import { Component } from '@angular/core';
|
|
129
|
+
import { RouterLink } from '@angular/router';
|
|
130
|
+
import { HlmNavigationMenuImports } from '@egose/shadcn-theme-ng/navigation-menu';
|
|
131
|
+
|
|
132
|
+
@Component({
|
|
133
|
+
selector: 'app-nav-basic',
|
|
134
|
+
standalone: true,
|
|
135
|
+
imports: [RouterLink, ...HlmNavigationMenuImports],
|
|
136
|
+
template: `
|
|
137
|
+
<nav hlmNavigationMenu>
|
|
138
|
+
<ul hlmNavigationMenuList>
|
|
139
|
+
<li hlmNavigationMenuItem>
|
|
140
|
+
<a hlmNavigationMenuLink routerLink="/">Home</a>
|
|
141
|
+
</li>
|
|
142
|
+
<li hlmNavigationMenuItem>
|
|
143
|
+
<button hlmNavigationMenuTrigger>Products</button>
|
|
144
|
+
<div hlmNavigationMenuContent>
|
|
145
|
+
<a hlmNavigationMenuLink routerLink="/products/a">Product A</a>
|
|
146
|
+
<a hlmNavigationMenuLink routerLink="/products/b">Product B</a>
|
|
147
|
+
</div>
|
|
148
|
+
</li>
|
|
149
|
+
<li hlmNavigationMenuItem>
|
|
150
|
+
<a hlmNavigationMenuLink routerLink="/pricing">Pricing</a>
|
|
151
|
+
</li>
|
|
152
|
+
</ul>
|
|
153
|
+
</nav>
|
|
154
|
+
`,
|
|
155
|
+
})
|
|
156
|
+
export class NavBasicComponent {}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### 2. Active link state
|
|
160
|
+
|
|
161
|
+
```ts
|
|
162
|
+
import { Component } from '@angular/core';
|
|
163
|
+
import { RouterLink, RouterLinkActive } from '@angular/router';
|
|
164
|
+
import { HlmNavigationMenuImports } from '@egose/shadcn-theme-ng/navigation-menu';
|
|
165
|
+
|
|
166
|
+
@Component({
|
|
167
|
+
selector: 'app-nav-active',
|
|
168
|
+
standalone: true,
|
|
169
|
+
imports: [RouterLink, RouterLinkActive, ...HlmNavigationMenuImports],
|
|
170
|
+
template: `
|
|
171
|
+
<nav hlmNavigationMenu>
|
|
172
|
+
<ul hlmNavigationMenuList>
|
|
173
|
+
<li hlmNavigationMenuItem>
|
|
174
|
+
<a
|
|
175
|
+
hlmNavigationMenuLink
|
|
176
|
+
routerLink="/docs"
|
|
177
|
+
routerLinkActive="active"
|
|
178
|
+
#rla="routerLinkActive"
|
|
179
|
+
[active]="rla.isActive"
|
|
180
|
+
>
|
|
181
|
+
Docs
|
|
182
|
+
</a>
|
|
183
|
+
</li>
|
|
184
|
+
<li hlmNavigationMenuItem>
|
|
185
|
+
<a
|
|
186
|
+
hlmNavigationMenuLink
|
|
187
|
+
routerLink="/blog"
|
|
188
|
+
routerLinkActive="active"
|
|
189
|
+
#rlb="routerLinkActive"
|
|
190
|
+
[active]="rlb.isActive"
|
|
191
|
+
>
|
|
192
|
+
Blog
|
|
193
|
+
</a>
|
|
194
|
+
</li>
|
|
195
|
+
</ul>
|
|
196
|
+
</nav>
|
|
197
|
+
`,
|
|
198
|
+
})
|
|
199
|
+
export class NavActiveComponent {}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
> `[active]` is the brain input forwarded by `HlmNavigationMenuLink`; it drives the `data-[active=true]` treatment. `routerLinkActive` alone only adds a class — bind both.
|
|
203
|
+
|
|
204
|
+
### 3. Controlled value + orientation
|
|
205
|
+
|
|
206
|
+
```ts
|
|
207
|
+
import { Component, signal } from '@angular/core';
|
|
208
|
+
import { HlmNavigationMenuImports } from '@egose/shadcn-theme-ng/navigation-menu';
|
|
209
|
+
|
|
210
|
+
@Component({
|
|
211
|
+
selector: 'app-nav-controlled',
|
|
212
|
+
standalone: true,
|
|
213
|
+
imports: [...HlmNavigationMenuImports],
|
|
214
|
+
template: `
|
|
215
|
+
<nav hlmNavigationMenu [value]="value()" orientation="horizontal" (valueChange)="value.set($event)">
|
|
216
|
+
<ul hlmNavigationMenuList>
|
|
217
|
+
<li hlmNavigationMenuItem id="item-docs">
|
|
218
|
+
<button hlmNavigationMenuTrigger>Docs</button>
|
|
219
|
+
<div hlmNavigationMenuContent>Docs panel</div>
|
|
220
|
+
</li>
|
|
221
|
+
<li hlmNavigationMenuItem id="item-api">
|
|
222
|
+
<button hlmNavigationMenuTrigger>API</button>
|
|
223
|
+
<div hlmNavigationMenuContent>API panel</div>
|
|
224
|
+
</li>
|
|
225
|
+
</ul>
|
|
226
|
+
</nav>
|
|
227
|
+
<p class="tw:text-sm tw:text-muted-foreground">Open: {{ value() ?? 'none' }}</p>
|
|
228
|
+
`,
|
|
229
|
+
})
|
|
230
|
+
export class NavControlledComponent {
|
|
231
|
+
readonly value = signal<string | undefined>(undefined);
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
`value`/`valueChange` and `orientation` are brain inputs/outputs exposed through `HlmNavigationMenu`; `id` is the brain input on each item used as the value key.
|
|
236
|
+
|
|
237
|
+
### 4. Rich mega-panel with offset tuning
|
|
238
|
+
|
|
239
|
+
```ts
|
|
240
|
+
import { Component } from '@angular/core';
|
|
241
|
+
import { RouterLink } from '@angular/router';
|
|
242
|
+
import { HlmNavigationMenuImports } from '@egose/shadcn-theme-ng/navigation-menu';
|
|
243
|
+
|
|
244
|
+
@Component({
|
|
245
|
+
selector: 'app-nav-mega',
|
|
246
|
+
standalone: true,
|
|
247
|
+
imports: [RouterLink, ...HlmNavigationMenuImports],
|
|
248
|
+
template: `
|
|
249
|
+
<nav hlmNavigationMenu>
|
|
250
|
+
<ul hlmNavigationMenuList>
|
|
251
|
+
<li hlmNavigationMenuItem>
|
|
252
|
+
<button hlmNavigationMenuTrigger>Solutions</button>
|
|
253
|
+
<div hlmNavigationMenuContent [navOffset]="2">
|
|
254
|
+
<div class="tw:grid tw:grid-cols-2 tw:gap-2 tw:p-2 tw:min-w-[28rem]">
|
|
255
|
+
<a hlmNavigationMenuLink routerLink="/solutions/startups">
|
|
256
|
+
<div>
|
|
257
|
+
<div class="tw:font-medium">Startups</div>
|
|
258
|
+
<p class="tw:text-xs tw:text-muted-foreground">Launch fast.</p>
|
|
259
|
+
</div>
|
|
260
|
+
</a>
|
|
261
|
+
<a hlmNavigationMenuLink routerLink="/solutions/enterprise">
|
|
262
|
+
<div>
|
|
263
|
+
<div class="tw:font-medium">Enterprise</div>
|
|
264
|
+
<p class="tw:text-xs tw:text-muted-foreground">Scale safely.</p>
|
|
265
|
+
</div>
|
|
266
|
+
</a>
|
|
267
|
+
</div>
|
|
268
|
+
</div>
|
|
269
|
+
</li>
|
|
270
|
+
</ul>
|
|
271
|
+
</nav>
|
|
272
|
+
`,
|
|
273
|
+
})
|
|
274
|
+
export class NavMegaComponent {}
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
`navOffset` sets `--nav-offset` (spacing units of gap between trigger and panel); the default `1.5` suits single-column panels, `2+` suits mega-panels.
|
|
278
|
+
|
|
279
|
+
### 5. Hover vs click + delays (brain behavior)
|
|
280
|
+
|
|
281
|
+
```ts
|
|
282
|
+
import { Component } from '@angular/core';
|
|
283
|
+
import { HlmNavigationMenuImports } from '@egose/shadcn-theme-ng/navigation-menu';
|
|
284
|
+
|
|
285
|
+
@Component({
|
|
286
|
+
selector: 'app-nav-delays',
|
|
287
|
+
standalone: true,
|
|
288
|
+
imports: [...HlmNavigationMenuImports],
|
|
289
|
+
template: `
|
|
290
|
+
<nav hlmNavigationMenu openOn="hover" [delayDuration]="200" [skipDelayDuration]="300">
|
|
291
|
+
<ul hlmNavigationMenuList>
|
|
292
|
+
<li hlmNavigationMenuItem>
|
|
293
|
+
<button hlmNavigationMenuTrigger>Features</button>
|
|
294
|
+
<div hlmNavigationMenuContent>Feature panel (hover, 200ms delay)</div>
|
|
295
|
+
</li>
|
|
296
|
+
</ul>
|
|
297
|
+
</nav>
|
|
298
|
+
`,
|
|
299
|
+
})
|
|
300
|
+
export class NavDelaysComponent {}
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
`openOn`, `delayDuration`, `skipDelayDuration` are brain inputs — no shadcn wrapper logic involved.
|
|
304
|
+
|
|
305
|
+
### 6. Data-driven bar + NgModule consumer
|
|
306
|
+
|
|
307
|
+
```ts
|
|
308
|
+
import { NgModule, Component, signal } from '@angular/core';
|
|
309
|
+
import { RouterLink } from '@angular/router';
|
|
310
|
+
import { HlmNavigationMenuModule, HlmNavigationMenuImports } from '@egose/shadcn-theme-ng/navigation-menu';
|
|
311
|
+
|
|
312
|
+
interface NavEntry {
|
|
313
|
+
label: string;
|
|
314
|
+
link?: string;
|
|
315
|
+
children?: { label: string; link: string }[];
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
@Component({
|
|
319
|
+
selector: 'app-nav-data',
|
|
320
|
+
standalone: true,
|
|
321
|
+
imports: [RouterLink, ...HlmNavigationMenuImports],
|
|
322
|
+
template: `
|
|
323
|
+
<nav hlmNavigationMenu>
|
|
324
|
+
<ul hlmNavigationMenuList>
|
|
325
|
+
@for (entry of entries(); track entry.label) {
|
|
326
|
+
<li hlmNavigationMenuItem>
|
|
327
|
+
@if (entry.children) {
|
|
328
|
+
<button hlmNavigationMenuTrigger>{{ entry.label }}</button>
|
|
329
|
+
<div hlmNavigationMenuContent>
|
|
330
|
+
@for (child of entry.children; track child.label) {
|
|
331
|
+
<a hlmNavigationMenuLink [routerLink]="child.link">{{ child.label }}</a>
|
|
332
|
+
}
|
|
333
|
+
</div>
|
|
334
|
+
} @else {
|
|
335
|
+
<a hlmNavigationMenuLink [routerLink]="entry.link">{{ entry.label }}</a>
|
|
336
|
+
}
|
|
337
|
+
</li>
|
|
338
|
+
}
|
|
339
|
+
</ul>
|
|
340
|
+
</nav>
|
|
341
|
+
`,
|
|
342
|
+
})
|
|
343
|
+
export class NavDataComponent {
|
|
344
|
+
readonly entries = signal<NavEntry[]>([
|
|
345
|
+
{ label: 'Home', link: '/' },
|
|
346
|
+
{
|
|
347
|
+
label: 'Docs',
|
|
348
|
+
children: [
|
|
349
|
+
{ label: 'Quickstart', link: '/docs/quickstart' },
|
|
350
|
+
{ label: 'API', link: '/docs/api' },
|
|
351
|
+
],
|
|
352
|
+
},
|
|
353
|
+
]);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
@NgModule({ imports: [HlmNavigationMenuModule, RouterLink] })
|
|
357
|
+
export class NavLegacyModule {}
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
## Accessibility notes
|
|
361
|
+
|
|
362
|
+
- The brain layer owns menubar/tree semantics, focus management, `Escape` handling, and arrow-key traversal — preserve the `nav > ul > li > trigger/link` nesting so roles hold.
|
|
363
|
+
- Triggers must stay `<button>` and links `<a>`; swapping elements breaks both selectors and semantics.
|
|
364
|
+
- The trigger chevron rotates on open via `group-data-*` — decorative (`ng-icon` is aria-hidden by the icon layer); the open state itself is announced by the brain directive.
|
|
365
|
+
- For the active page, bind `[active]` (example 2) so the current link exposes `data-[active=true]` styling in addition to `aria-current` handling by the router.
|
|
366
|
+
|
|
367
|
+
## Theming / CSS variables
|
|
368
|
+
|
|
369
|
+
No theming inputs. Panel offset is tunable per instance via `navOffset`; everything else flows from tokens (`bg-background`, `bg-muted` hover, `bg-popover` panel, `ring-foreground/10`). Motion/placement classes respond to brain `data-[motion]` / `data-[orientation]` attributes.
|
|
370
|
+
|
|
371
|
+
## Related subpaths
|
|
372
|
+
|
|
373
|
+
- `@egose/shadcn-theme-ng/menubar` — action-menu bar (File/Edit) vs this component's site-navigation bar.
|
|
374
|
+
- `@egose/shadcn-theme-ng/dropdown-menu` — single-trigger menu when you don't need a full nav strip.
|
|
375
|
+
- `@egose/shadcn-theme-ng/navigation-menu` pairs well with `@egose/shadcn-theme-ng/layout-simple` top rows for docs/marketing shells.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@egose/shadcn-theme-ng",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Angular shadcn UI theme",
|
|
5
5
|
"author": "Junmin Ahn",
|
|
6
6
|
"bundles": [
|
|
@@ -150,14 +150,30 @@
|
|
|
150
150
|
"types": "./field/types/field.d.ts",
|
|
151
151
|
"default": "./field/fesm2022/field.mjs"
|
|
152
152
|
},
|
|
153
|
+
"./form-autocomplete": {
|
|
154
|
+
"types": "./form-autocomplete/types/form-autocomplete.d.ts",
|
|
155
|
+
"default": "./form-autocomplete/fesm2022/form-autocomplete.mjs"
|
|
156
|
+
},
|
|
153
157
|
"./form-checkbox": {
|
|
154
158
|
"types": "./form-checkbox/types/form-checkbox.d.ts",
|
|
155
159
|
"default": "./form-checkbox/fesm2022/form-checkbox.mjs"
|
|
156
160
|
},
|
|
161
|
+
"./form-combobox": {
|
|
162
|
+
"types": "./form-combobox/types/form-combobox.d.ts",
|
|
163
|
+
"default": "./form-combobox/fesm2022/form-combobox.mjs"
|
|
164
|
+
},
|
|
157
165
|
"./form-date-picker": {
|
|
158
166
|
"types": "./form-date-picker/types/form-date-picker.d.ts",
|
|
159
167
|
"default": "./form-date-picker/fesm2022/form-date-picker.mjs"
|
|
160
168
|
},
|
|
169
|
+
"./form-date-picker-multi": {
|
|
170
|
+
"types": "./form-date-picker-multi/types/form-date-picker-multi.d.ts",
|
|
171
|
+
"default": "./form-date-picker-multi/fesm2022/form-date-picker-multi.mjs"
|
|
172
|
+
},
|
|
173
|
+
"./form-date-range-picker": {
|
|
174
|
+
"types": "./form-date-range-picker/types/form-date-range-picker.d.ts",
|
|
175
|
+
"default": "./form-date-range-picker/fesm2022/form-date-range-picker.mjs"
|
|
176
|
+
},
|
|
161
177
|
"./form-field": {
|
|
162
178
|
"types": "./form-field/types/form-field.d.ts",
|
|
163
179
|
"default": "./form-field/fesm2022/form-field.mjs"
|
|
@@ -166,6 +182,26 @@
|
|
|
166
182
|
"types": "./form-field-simple/types/form-field-simple.d.ts",
|
|
167
183
|
"default": "./form-field-simple/fesm2022/form-field-simple.mjs"
|
|
168
184
|
},
|
|
185
|
+
"./form-input-otp": {
|
|
186
|
+
"types": "./form-input-otp/types/form-input-otp.d.ts",
|
|
187
|
+
"default": "./form-input-otp/fesm2022/form-input-otp.mjs"
|
|
188
|
+
},
|
|
189
|
+
"./form-month-year-picker": {
|
|
190
|
+
"types": "./form-month-year-picker/types/form-month-year-picker.d.ts",
|
|
191
|
+
"default": "./form-month-year-picker/fesm2022/form-month-year-picker.mjs"
|
|
192
|
+
},
|
|
193
|
+
"./form-native-select": {
|
|
194
|
+
"types": "./form-native-select/types/form-native-select.d.ts",
|
|
195
|
+
"default": "./form-native-select/fesm2022/form-native-select.mjs"
|
|
196
|
+
},
|
|
197
|
+
"./form-phone-input": {
|
|
198
|
+
"types": "./form-phone-input/types/form-phone-input.d.ts",
|
|
199
|
+
"default": "./form-phone-input/fesm2022/form-phone-input.mjs"
|
|
200
|
+
},
|
|
201
|
+
"./form-radio-group": {
|
|
202
|
+
"types": "./form-radio-group/types/form-radio-group.d.ts",
|
|
203
|
+
"default": "./form-radio-group/fesm2022/form-radio-group.mjs"
|
|
204
|
+
},
|
|
169
205
|
"./form-searchable-multiselect": {
|
|
170
206
|
"types": "./form-searchable-multiselect/types/form-searchable-multiselect.d.ts",
|
|
171
207
|
"default": "./form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs"
|
|
@@ -174,6 +210,14 @@
|
|
|
174
210
|
"types": "./form-select/types/form-select.d.ts",
|
|
175
211
|
"default": "./form-select/fesm2022/form-select.mjs"
|
|
176
212
|
},
|
|
213
|
+
"./form-slider": {
|
|
214
|
+
"types": "./form-slider/types/form-slider.d.ts",
|
|
215
|
+
"default": "./form-slider/fesm2022/form-slider.mjs"
|
|
216
|
+
},
|
|
217
|
+
"./form-switch": {
|
|
218
|
+
"types": "./form-switch/types/form-switch.d.ts",
|
|
219
|
+
"default": "./form-switch/fesm2022/form-switch.mjs"
|
|
220
|
+
},
|
|
177
221
|
"./form-text-input": {
|
|
178
222
|
"types": "./form-text-input/types/form-text-input.d.ts",
|
|
179
223
|
"default": "./form-text-input/fesm2022/form-text-input.mjs"
|
|
@@ -182,6 +226,14 @@
|
|
|
182
226
|
"types": "./form-textarea/types/form-textarea.d.ts",
|
|
183
227
|
"default": "./form-textarea/fesm2022/form-textarea.mjs"
|
|
184
228
|
},
|
|
229
|
+
"./form-toggle": {
|
|
230
|
+
"types": "./form-toggle/types/form-toggle.d.ts",
|
|
231
|
+
"default": "./form-toggle/fesm2022/form-toggle.mjs"
|
|
232
|
+
},
|
|
233
|
+
"./form-toggle-group": {
|
|
234
|
+
"types": "./form-toggle-group/types/form-toggle-group.d.ts",
|
|
235
|
+
"default": "./form-toggle-group/fesm2022/form-toggle-group.mjs"
|
|
236
|
+
},
|
|
185
237
|
"./hover-card": {
|
|
186
238
|
"types": "./hover-card/types/hover-card.d.ts",
|
|
187
239
|
"default": "./hover-card/fesm2022/hover-card.mjs"
|
|
@@ -238,6 +290,10 @@
|
|
|
238
290
|
"types": "./pagination/types/pagination.d.ts",
|
|
239
291
|
"default": "./pagination/fesm2022/pagination.mjs"
|
|
240
292
|
},
|
|
293
|
+
"./phone-input": {
|
|
294
|
+
"types": "./phone-input/types/phone-input.d.ts",
|
|
295
|
+
"default": "./phone-input/fesm2022/phone-input.mjs"
|
|
296
|
+
},
|
|
241
297
|
"./popover": {
|
|
242
298
|
"types": "./popover/types/popover.d.ts",
|
|
243
299
|
"default": "./popover/fesm2022/popover.mjs"
|