@neetechs/ui 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/CHANGELOG.md +74 -0
- package/LICENSE +21 -21
- package/README.md +862 -861
- package/dist/ai/ai-action-button/ai-action-button.css +271 -271
- package/dist/ai/ai-approval-card/ai-approval-card.css +323 -323
- package/dist/ai/ai-conversation-panel/ai-conversation-panel.css +447 -447
- package/dist/ai/ai-prompt-input/ai-prompt-input.css +380 -380
- package/dist/ai/ai-proposal-card/ai-proposal-card.css +358 -358
- package/dist/ai/ai-suggestion-card/ai-suggestion-card.css +295 -295
- package/dist/ai/ai-tool-call/ai-tool-call.css +256 -256
- package/dist/ai/index.css +7 -7
- package/dist/behaviors/index.d.ts +1 -0
- package/dist/behaviors/index.d.ts.map +1 -1
- package/dist/behaviors/index.js +1 -0
- package/dist/behaviors/index.js.map +1 -1
- package/dist/behaviors/selection-indicator.d.ts +35 -0
- package/dist/behaviors/selection-indicator.d.ts.map +1 -0
- package/dist/behaviors/selection-indicator.js +133 -0
- package/dist/behaviors/selection-indicator.js.map +1 -0
- package/dist/behaviors/sidebar.d.ts +3 -1
- package/dist/behaviors/sidebar.d.ts.map +1 -1
- package/dist/behaviors/sidebar.js +10 -3
- package/dist/behaviors/sidebar.js.map +1 -1
- package/dist/components/alert/alert.css +226 -220
- package/dist/components/avatar/avatar.css +298 -220
- package/dist/components/badge/badge.css +180 -174
- package/dist/components/breadcrumb/breadcrumb.css +207 -207
- package/dist/components/button/button.css +278 -238
- package/dist/components/card/card.css +336 -265
- package/dist/components/checkbox/checkbox.css +189 -189
- package/dist/components/chip/chip.css +269 -269
- package/dist/components/choice-card/choice-card.css +244 -0
- package/dist/components/data-grid/data-grid.css +520 -520
- package/dist/components/description-list/description-list.css +187 -187
- package/dist/components/dialog/dialog.css +348 -339
- package/dist/components/disclosure/disclosure.css +154 -0
- package/dist/components/dock/dock.css +319 -0
- package/dist/components/drawer/drawer.css +493 -484
- package/dist/components/dropdown/dropdown.css +325 -316
- package/dist/components/fab/fab.css +281 -0
- package/dist/components/icon-button/icon-button.css +162 -162
- package/dist/components/index.css +4 -0
- package/dist/components/input/input.css +163 -163
- package/dist/components/menu/menu.css +315 -315
- package/dist/components/pagination/pagination.css +250 -250
- package/dist/components/panel/panel.css +316 -284
- package/dist/components/popover/popover.css +22 -0
- package/dist/components/progress/progress.css +268 -256
- package/dist/components/radio/radio.css +166 -166
- package/dist/components/segmented-control/segmented-control.css +264 -205
- package/dist/components/select/select.css +117 -117
- package/dist/components/skeleton/skeleton.css +267 -267
- package/dist/components/split-button/split-button.css +292 -292
- package/dist/components/stat/stat.css +433 -403
- package/dist/components/switch/switch.css +195 -195
- package/dist/components/table/table.css +220 -220
- package/dist/components/tabs/tabs.css +393 -293
- package/dist/components/textarea/textarea.css +86 -86
- package/dist/components/toast/toast.css +345 -345
- package/dist/components/tooltip/tooltip.css +267 -258
- package/dist/domain/billing/index.css +629 -629
- package/dist/domain/calendar/agenda-list/agenda-list.css +224 -224
- package/dist/domain/calendar/day-slice/day-slice.css +384 -384
- package/dist/domain/calendar/day-timeline/day-timeline.css +332 -332
- package/dist/domain/calendar/event-card/event-card.css +338 -338
- package/dist/domain/calendar/index.css +5 -5
- package/dist/domain/calendar/month-grid/month-grid.css +426 -426
- package/dist/domain/calendar/week-grid/week-grid.css +487 -480
- package/dist/domain/companies/index.css +526 -526
- package/dist/domain/index.css +3 -3
- package/dist/index.css +5 -5
- package/dist/patterns/command-palette/command-palette.css +488 -447
- package/dist/patterns/company-switcher/company-switcher.css +390 -390
- package/dist/patterns/content-state/content-state.css +236 -236
- package/dist/patterns/document-preview/document-preview.css +169 -0
- package/dist/patterns/editor-workspace/editor-workspace.css +276 -0
- package/dist/patterns/empty-state/empty-state.css +260 -260
- package/dist/patterns/error-state/error-state.css +272 -272
- package/dist/patterns/form-layout/form-layout.css +106 -106
- package/dist/patterns/index.css +4 -0
- package/dist/patterns/loading-state/loading-state.css +287 -287
- package/dist/patterns/master-detail/master-detail.css +103 -103
- package/dist/patterns/notification-center/notification-center.css +443 -443
- package/dist/patterns/page/page.css +303 -303
- package/dist/patterns/profile-header/profile-header.css +205 -0
- package/dist/patterns/profile-menu/profile-menu.css +298 -298
- package/dist/patterns/record-list/record-list.css +302 -302
- package/dist/patterns/resource-card/resource-card.css +258 -0
- package/dist/patterns/search-bar/search-bar.css +457 -457
- package/dist/patterns/settings-layout/settings-layout.css +283 -150
- package/dist/patterns/workflow/workflow.css +168 -168
- package/dist/shell/app-shell/app-shell.css +429 -211
- package/dist/shell/content-frame/content-frame.css +93 -93
- package/dist/shell/header/header.css +328 -328
- package/dist/shell/index.css +8 -8
- package/dist/shell/mobile-nav/mobile-nav.css +254 -254
- package/dist/shell/navbar/navbar.css +28 -1
- package/dist/shell/sidebar/sidebar.css +923 -314
- package/dist/styles/accessibility.css +150 -150
- package/dist/styles/animations/motion.css +162 -162
- package/dist/styles/appearance/accent.css +215 -215
- package/dist/styles/appearance/density.css +61 -61
- package/dist/styles/appearance/motion.css +48 -40
- package/dist/styles/base.css +83 -83
- package/dist/styles/index.css +29 -28
- package/dist/styles/localization.css +56 -56
- package/dist/styles/reset.css +51 -51
- package/dist/styles/responsive.css +101 -101
- package/dist/styles/themes/dark.css +225 -202
- package/dist/styles/themes/high-contrast.css +378 -290
- package/dist/styles/themes/light.css +224 -201
- package/dist/styles/tokens/breakpoints.css +37 -37
- package/dist/styles/tokens/color.css +102 -102
- package/dist/styles/tokens/compatibility.css +33 -33
- package/dist/styles/tokens/elevation.css +33 -26
- package/dist/styles/tokens/index.css +9 -9
- package/dist/styles/tokens/motion.css +55 -36
- package/dist/styles/tokens/radius.css +26 -26
- package/dist/styles/tokens/spacing.css +56 -56
- package/dist/styles/tokens/typography.css +85 -85
- package/dist/styles/tokens/z-index.css +14 -14
- package/dist/styles/utilities/glass.css +97 -0
- package/dist/styles/utilities/layout.css +153 -153
- package/dist/styles/utilities/text.css +152 -152
- package/dist/styles/utilities/visibility.css +47 -47
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/NEETECHS_UI_UPGRADE_PLAN.md +312 -192
- package/docs/accessibility.md +218 -218
- package/docs/appearance-and-theming.md +150 -150
- package/docs/brand-palette.md +36 -36
- package/docs/component-architecture.md +137 -137
- package/docs/component-guidelines.md +64 -64
- package/docs/components.md +326 -173
- package/docs/content-and-terminology.md +207 -207
- package/docs/design-system-baseline-audit.md +226 -226
- package/docs/design-token-contract.md +279 -279
- package/docs/glass-and-motion.md +310 -0
- package/docs/localization-and-rtl.md +147 -147
- package/docs/migration.md +193 -193
- package/docs/page-patterns-and-workflows.md +301 -275
- package/docs/responsive-and-adaptive-design.md +351 -351
- package/docs/semantic-role-migration-audit.md +77 -77
- package/docs/site-chrome.md +320 -313
- package/docs/states-feedback-and-recovery.md +206 -206
- package/docs/theming.md +5 -5
- package/package.json +2 -1
- package/src/ai/ai-action-button/ai-action-button.css +271 -271
- package/src/ai/ai-approval-card/ai-approval-card.css +323 -323
- package/src/ai/ai-conversation-panel/ai-conversation-panel.css +447 -447
- package/src/ai/ai-prompt-input/ai-prompt-input.css +380 -380
- package/src/ai/ai-proposal-card/ai-proposal-card.css +358 -358
- package/src/ai/ai-suggestion-card/ai-suggestion-card.css +295 -295
- package/src/ai/ai-tool-call/ai-tool-call.css +256 -256
- package/src/ai/index.css +7 -7
- package/src/appearance/cache.ts +236 -236
- package/src/appearance/cookie.ts +184 -184
- package/src/appearance/index.ts +86 -86
- package/src/appearance/preference.ts +121 -121
- package/src/appearance/theme-controller.ts +384 -384
- package/src/appearance/types.ts +61 -61
- package/src/behaviors/announcer.ts +222 -222
- package/src/behaviors/calendar.ts +92 -92
- package/src/behaviors/data-grid.ts +133 -133
- package/src/behaviors/dialog.ts +203 -203
- package/src/behaviors/direction.ts +34 -34
- package/src/behaviors/drawer.ts +210 -210
- package/src/behaviors/dropdown.ts +344 -344
- package/src/behaviors/focus-trap.ts +304 -304
- package/src/behaviors/forms.ts +205 -205
- package/src/behaviors/ids.ts +47 -47
- package/src/behaviors/index.ts +1 -0
- package/src/behaviors/keyboard.ts +305 -305
- package/src/behaviors/overlay.ts +344 -344
- package/src/behaviors/selection-indicator.ts +162 -0
- package/src/behaviors/sidebar.ts +14 -4
- package/src/behaviors/state.ts +282 -282
- package/src/behaviors/tabs.ts +137 -137
- package/src/behaviors/viewport.ts +61 -61
- package/src/components/alert/alert.css +226 -220
- package/src/components/avatar/avatar.css +298 -220
- package/src/components/badge/badge.css +180 -174
- package/src/components/breadcrumb/breadcrumb.css +207 -207
- package/src/components/button/button.css +278 -238
- package/src/components/card/card.css +336 -265
- package/src/components/checkbox/checkbox.css +189 -189
- package/src/components/chip/chip.css +269 -269
- package/src/components/choice-card/choice-card.css +244 -0
- package/src/components/data-grid/data-grid.css +520 -520
- package/src/components/description-list/description-list.css +187 -187
- package/src/components/dialog/dialog.css +348 -339
- package/src/components/disclosure/disclosure.css +154 -0
- package/src/components/dock/dock.css +319 -0
- package/src/components/drawer/drawer.css +493 -484
- package/src/components/dropdown/dropdown.css +325 -316
- package/src/components/fab/fab.css +281 -0
- package/src/components/icon-button/icon-button.css +162 -162
- package/src/components/index.css +4 -0
- package/src/components/input/input.css +163 -163
- package/src/components/menu/menu.css +315 -315
- package/src/components/pagination/pagination.css +250 -250
- package/src/components/panel/panel.css +316 -284
- package/src/components/popover/popover.css +22 -0
- package/src/components/progress/progress.css +268 -256
- package/src/components/radio/radio.css +166 -166
- package/src/components/segmented-control/segmented-control.css +264 -205
- package/src/components/select/select.css +117 -117
- package/src/components/skeleton/skeleton.css +267 -267
- package/src/components/split-button/split-button.css +292 -292
- package/src/components/stat/stat.css +433 -403
- package/src/components/switch/switch.css +195 -195
- package/src/components/table/table.css +220 -220
- package/src/components/tabs/tabs.css +393 -293
- package/src/components/textarea/textarea.css +86 -86
- package/src/components/toast/toast.css +345 -345
- package/src/components/tooltip/tooltip.css +267 -258
- package/src/domain/billing/index.css +629 -629
- package/src/domain/calendar/agenda-list/agenda-list.css +224 -224
- package/src/domain/calendar/day-slice/day-slice.css +384 -384
- package/src/domain/calendar/day-timeline/day-timeline.css +332 -332
- package/src/domain/calendar/event-card/event-card.css +338 -338
- package/src/domain/calendar/index.css +5 -5
- package/src/domain/calendar/month-grid/month-grid.css +426 -426
- package/src/domain/calendar/week-grid/week-grid.css +487 -480
- package/src/domain/companies/index.css +526 -526
- package/src/domain/index.css +3 -3
- package/src/index.css +5 -5
- package/src/index.ts +7 -7
- package/src/localization/index.ts +56 -56
- package/src/patterns/command-palette/command-palette.css +488 -447
- package/src/patterns/company-switcher/company-switcher.css +390 -390
- package/src/patterns/content-state/content-state.css +236 -236
- package/src/patterns/document-preview/document-preview.css +169 -0
- package/src/patterns/editor-workspace/editor-workspace.css +276 -0
- package/src/patterns/empty-state/empty-state.css +260 -260
- package/src/patterns/error-state/error-state.css +272 -272
- package/src/patterns/form-layout/form-layout.css +106 -106
- package/src/patterns/index.css +4 -0
- package/src/patterns/loading-state/loading-state.css +287 -287
- package/src/patterns/master-detail/master-detail.css +103 -103
- package/src/patterns/notification-center/notification-center.css +443 -443
- package/src/patterns/page/page.css +303 -303
- package/src/patterns/profile-header/profile-header.css +205 -0
- package/src/patterns/profile-menu/profile-menu.css +298 -298
- package/src/patterns/record-list/record-list.css +302 -302
- package/src/patterns/resource-card/resource-card.css +258 -0
- package/src/patterns/search-bar/search-bar.css +457 -457
- package/src/patterns/settings-layout/settings-layout.css +283 -150
- package/src/patterns/workflow/workflow.css +168 -168
- package/src/shell/app-shell/app-shell.css +429 -211
- package/src/shell/content-frame/content-frame.css +93 -93
- package/src/shell/header/header.css +328 -328
- package/src/shell/index.css +8 -8
- package/src/shell/mobile-nav/mobile-nav.css +254 -254
- package/src/shell/navbar/navbar.css +28 -1
- package/src/shell/sidebar/sidebar.css +923 -314
- package/src/styles/accessibility.css +150 -150
- package/src/styles/animations/motion.css +162 -162
- package/src/styles/appearance/accent.css +215 -215
- package/src/styles/appearance/density.css +61 -61
- package/src/styles/appearance/motion.css +48 -40
- package/src/styles/base.css +83 -83
- package/src/styles/index.css +29 -28
- package/src/styles/localization.css +56 -56
- package/src/styles/reset.css +51 -51
- package/src/styles/responsive.css +101 -101
- package/src/styles/themes/dark.css +225 -202
- package/src/styles/themes/high-contrast.css +378 -290
- package/src/styles/themes/light.css +224 -201
- package/src/styles/tokens/breakpoints.css +37 -37
- package/src/styles/tokens/color.css +102 -102
- package/src/styles/tokens/compatibility.css +33 -33
- package/src/styles/tokens/elevation.css +33 -26
- package/src/styles/tokens/index.css +9 -9
- package/src/styles/tokens/motion.css +55 -36
- package/src/styles/tokens/radius.css +26 -26
- package/src/styles/tokens/spacing.css +56 -56
- package/src/styles/tokens/typography.css +85 -85
- package/src/styles/tokens/z-index.css +14 -14
- package/src/styles/utilities/glass.css +97 -0
- package/src/styles/utilities/layout.css +153 -153
- package/src/styles/utilities/text.css +152 -152
- package/src/styles/utilities/visibility.css +47 -47
- package/src/types/index.ts +126 -126
- package/src/version.ts +1 -1
package/docs/site-chrome.md
CHANGED
|
@@ -1,313 +1,320 @@
|
|
|
1
|
-
# Site chrome: header, navbar, account dropdown, mobile navigation, footer
|
|
2
|
-
|
|
3
|
-
Reusable, framework-independent page chrome for Neetechs websites and apps.
|
|
4
|
-
Everything is configured by markup: logos, navigation items, account actions,
|
|
5
|
-
footer columns, social links, and legal links are plain HTML the application
|
|
6
|
-
renders. The package never hardcodes routes, URLs, authentication, or API calls.
|
|
7
|
-
|
|
8
|
-
A complete working example lives in the repository at
|
|
9
|
-
`tests/pages/site-chrome.html` (serve with `node scripts/serve-test-gallery.mjs`
|
|
10
|
-
and open `/tests/pages/site-chrome.html`). It is the fixture for
|
|
11
|
-
`tests/browser/site-chrome.spec.mjs`, so the example cannot drift from
|
|
12
|
-
tested behavior.
|
|
13
|
-
|
|
14
|
-
| Piece | CSS | Behavior (`@neetechs/ui/behaviors`) |
|
|
15
|
-
|---|---|---|
|
|
16
|
-
| Header | `@neetechs/ui/shell/header.css` (`.nt-header`) | — |
|
|
17
|
-
| Navbar | `@neetechs/ui/shell/navbar.css` (`.nt-navbar`) | `ntCreateNavbar` |
|
|
18
|
-
| Account dropdown | `.nt-header__account` + `@neetechs/ui/patterns/profile-menu.css` | `ntCreateAccountMenu` |
|
|
19
|
-
| Mobile navigation | `@neetechs/ui/shell/mobile-nav.css` (`.nt-mobile-nav--drawer`) | `ntCreateMobileNav` |
|
|
20
|
-
| Footer | `@neetechs/ui/shell/footer.css` (`.nt-footer`) | — (pure CSS) |
|
|
21
|
-
|
|
22
|
-
All of it is included in `@neetechs/ui/styles.css` and `@neetechs/ui/shell.css`.
|
|
23
|
-
|
|
24
|
-
## Header
|
|
25
|
-
|
|
26
|
-
```html
|
|
27
|
-
<header class="nt-header nt-header--sticky">
|
|
28
|
-
<div class="nt-header__left">
|
|
29
|
-
<button class="nt-header__mobile-trigger nt-header__action" type="button" aria-label="Open site menu">
|
|
30
|
-
<svg aria-hidden="true" focusable="false">…</svg>
|
|
31
|
-
</button>
|
|
32
|
-
<a class="nt-header__brand" href="/">
|
|
33
|
-
<img class="nt-header__logo" src="/logo.svg" alt="">
|
|
34
|
-
<span class="nt-header__brand-name">Neetechs</span>
|
|
35
|
-
</a>
|
|
36
|
-
</div>
|
|
37
|
-
<div class="nt-header__nav">
|
|
38
|
-
<nav class="nt-navbar" aria-label="Primary">…</nav>
|
|
39
|
-
</div>
|
|
40
|
-
<div class="nt-header__right">
|
|
41
|
-
<div class="nt-dropdown">…account dropdown…</div>
|
|
42
|
-
</div>
|
|
43
|
-
</header>
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
- `.nt-header--sticky` pins the header to the top of the scroll container.
|
|
47
|
-
Inside `.nt-app-shell`, keep using `.nt-app-shell__header`, which already sticks.
|
|
48
|
-
- `.nt-header__brand` is a link; give the logo `alt=""` when the brand name is
|
|
49
|
-
visible text, or a meaningful `alt` when the name is omitted.
|
|
50
|
-
- `.nt-header__mobile-trigger` appears below 64rem, where `.nt-navbar` hides.
|
|
51
|
-
- Existing app-shell header elements (`__title`, `__subtitle`, `__breadcrumb`,
|
|
52
|
-
`__search`, `__action`) are unchanged and can be combined with the new slots.
|
|
53
|
-
|
|
54
|
-
## Navbar
|
|
55
|
-
|
|
56
|
-
```html
|
|
57
|
-
<nav class="nt-navbar" aria-label="Primary">
|
|
58
|
-
<ul class="nt-navbar__list">
|
|
59
|
-
<li class="nt-navbar__item">
|
|
60
|
-
<a class="nt-navbar__link" href="/" aria-current="page">Home</a>
|
|
61
|
-
</li>
|
|
62
|
-
<li class="nt-navbar__item">
|
|
63
|
-
<button class="nt-navbar__trigger" type="button" aria-expanded="false" aria-controls="nav-products">
|
|
64
|
-
Products<span class="nt-navbar__chevron" aria-hidden="true"></span>
|
|
65
|
-
</button>
|
|
66
|
-
<div class="nt-navbar__panel" id="nav-products" hidden>
|
|
67
|
-
<ul class="nt-navbar__panel-list">
|
|
68
|
-
<li>
|
|
69
|
-
<a class="nt-navbar__panel-link" href="/billing">
|
|
70
|
-
Billing<span class="nt-navbar__panel-description">Invoices and payments.</span>
|
|
71
|
-
</a>
|
|
72
|
-
</li>
|
|
73
|
-
</ul>
|
|
74
|
-
</div>
|
|
75
|
-
</li>
|
|
76
|
-
</ul>
|
|
77
|
-
</nav>
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
```ts
|
|
81
|
-
import { ntCreateNavbar } from '@neetechs/ui/behaviors';
|
|
82
|
-
|
|
83
|
-
const navbar = ntCreateNavbar({ root: document.querySelector('.nt-navbar')! });
|
|
84
|
-
// After re-rendering items: navbar.refresh(); on teardown: navbar.destroy();
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
Pattern: WAI-ARIA *disclosure navigation*, not `role="menu"`. Links remain
|
|
88
|
-
links, so browser and router navigation behave normally.
|
|
89
|
-
|
|
90
|
-
| Input | Result |
|
|
91
|
-
|---|---|
|
|
92
|
-
| Click / Enter / Space on a trigger | Toggles its panel; opening one closes any other |
|
|
93
|
-
| ArrowDown on a trigger | Opens the panel and focuses its first link |
|
|
94
|
-
| ArrowUp / ArrowDown / Home / End in a panel | Moves between the panel's links (wraps) |
|
|
95
|
-
| ArrowLeft / ArrowRight on the top level | Moves between top-level entries; swapped under `dir="rtl"` |
|
|
96
|
-
| Escape | Closes the panel and returns focus to its trigger |
|
|
97
|
-
| Pointer down outside the navbar | Closes the panel |
|
|
98
|
-
| Focus leaves the navbar (Tab) | Closes the panel |
|
|
99
|
-
| Activating a panel link | Closes the panel (`closeOnNavigate`, default `true`) |
|
|
100
|
-
|
|
101
|
-
Modifiers: `.nt-navbar--compact` (smaller rows), `.nt-navbar__panel--end`
|
|
102
|
-
(align the panel to the item's inline end), `.nt-navbar__panel--wide`
|
|
103
|
-
(multi-column panel). Current page: `aria-current="page"` (draws an indicator
|
|
104
|
-
bar, so state never depends on color alone). Disabled entries: `aria-disabled="true"`.
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
<
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
</div>
|
|
126
|
-
|
|
127
|
-
</
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
<
|
|
155
|
-
<
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
<
|
|
190
|
-
|
|
191
|
-
<
|
|
192
|
-
</
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
</
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
sidebar.
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
|
283
|
-
|
|
284
|
-
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
1
|
+
# Site chrome: header, navbar, account dropdown, mobile navigation, footer
|
|
2
|
+
|
|
3
|
+
Reusable, framework-independent page chrome for Neetechs websites and apps.
|
|
4
|
+
Everything is configured by markup: logos, navigation items, account actions,
|
|
5
|
+
footer columns, social links, and legal links are plain HTML the application
|
|
6
|
+
renders. The package never hardcodes routes, URLs, authentication, or API calls.
|
|
7
|
+
|
|
8
|
+
A complete working example lives in the repository at
|
|
9
|
+
`tests/pages/site-chrome.html` (serve with `node scripts/serve-test-gallery.mjs`
|
|
10
|
+
and open `/tests/pages/site-chrome.html`). It is the fixture for
|
|
11
|
+
`tests/browser/site-chrome.spec.mjs`, so the example cannot drift from
|
|
12
|
+
tested behavior.
|
|
13
|
+
|
|
14
|
+
| Piece | CSS | Behavior (`@neetechs/ui/behaviors`) |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| Header | `@neetechs/ui/shell/header.css` (`.nt-header`) | — |
|
|
17
|
+
| Navbar | `@neetechs/ui/shell/navbar.css` (`.nt-navbar`) | `ntCreateNavbar` |
|
|
18
|
+
| Account dropdown | `.nt-header__account` + `@neetechs/ui/patterns/profile-menu.css` | `ntCreateAccountMenu` |
|
|
19
|
+
| Mobile navigation | `@neetechs/ui/shell/mobile-nav.css` (`.nt-mobile-nav--drawer`) | `ntCreateMobileNav` |
|
|
20
|
+
| Footer | `@neetechs/ui/shell/footer.css` (`.nt-footer`) | — (pure CSS) |
|
|
21
|
+
|
|
22
|
+
All of it is included in `@neetechs/ui/styles.css` and `@neetechs/ui/shell.css`.
|
|
23
|
+
|
|
24
|
+
## Header
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
<header class="nt-header nt-header--sticky">
|
|
28
|
+
<div class="nt-header__left">
|
|
29
|
+
<button class="nt-header__mobile-trigger nt-header__action" type="button" aria-label="Open site menu">
|
|
30
|
+
<svg aria-hidden="true" focusable="false">…</svg>
|
|
31
|
+
</button>
|
|
32
|
+
<a class="nt-header__brand" href="/">
|
|
33
|
+
<img class="nt-header__logo" src="/logo.svg" alt="">
|
|
34
|
+
<span class="nt-header__brand-name">Neetechs</span>
|
|
35
|
+
</a>
|
|
36
|
+
</div>
|
|
37
|
+
<div class="nt-header__nav">
|
|
38
|
+
<nav class="nt-navbar" aria-label="Primary">…</nav>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="nt-header__right">
|
|
41
|
+
<div class="nt-dropdown">…account dropdown…</div>
|
|
42
|
+
</div>
|
|
43
|
+
</header>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
- `.nt-header--sticky` pins the header to the top of the scroll container.
|
|
47
|
+
Inside `.nt-app-shell`, keep using `.nt-app-shell__header`, which already sticks.
|
|
48
|
+
- `.nt-header__brand` is a link; give the logo `alt=""` when the brand name is
|
|
49
|
+
visible text, or a meaningful `alt` when the name is omitted.
|
|
50
|
+
- `.nt-header__mobile-trigger` appears below 64rem, where `.nt-navbar` hides.
|
|
51
|
+
- Existing app-shell header elements (`__title`, `__subtitle`, `__breadcrumb`,
|
|
52
|
+
`__search`, `__action`) are unchanged and can be combined with the new slots.
|
|
53
|
+
|
|
54
|
+
## Navbar
|
|
55
|
+
|
|
56
|
+
```html
|
|
57
|
+
<nav class="nt-navbar" aria-label="Primary">
|
|
58
|
+
<ul class="nt-navbar__list">
|
|
59
|
+
<li class="nt-navbar__item">
|
|
60
|
+
<a class="nt-navbar__link" href="/" aria-current="page">Home</a>
|
|
61
|
+
</li>
|
|
62
|
+
<li class="nt-navbar__item">
|
|
63
|
+
<button class="nt-navbar__trigger" type="button" aria-expanded="false" aria-controls="nav-products">
|
|
64
|
+
Products<span class="nt-navbar__chevron" aria-hidden="true"></span>
|
|
65
|
+
</button>
|
|
66
|
+
<div class="nt-navbar__panel" id="nav-products" hidden>
|
|
67
|
+
<ul class="nt-navbar__panel-list">
|
|
68
|
+
<li>
|
|
69
|
+
<a class="nt-navbar__panel-link" href="/billing">
|
|
70
|
+
Billing<span class="nt-navbar__panel-description">Invoices and payments.</span>
|
|
71
|
+
</a>
|
|
72
|
+
</li>
|
|
73
|
+
</ul>
|
|
74
|
+
</div>
|
|
75
|
+
</li>
|
|
76
|
+
</ul>
|
|
77
|
+
</nav>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
```ts
|
|
81
|
+
import { ntCreateNavbar } from '@neetechs/ui/behaviors';
|
|
82
|
+
|
|
83
|
+
const navbar = ntCreateNavbar({ root: document.querySelector('.nt-navbar')! });
|
|
84
|
+
// After re-rendering items: navbar.refresh(); on teardown: navbar.destroy();
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Pattern: WAI-ARIA *disclosure navigation*, not `role="menu"`. Links remain
|
|
88
|
+
links, so browser and router navigation behave normally.
|
|
89
|
+
|
|
90
|
+
| Input | Result |
|
|
91
|
+
|---|---|
|
|
92
|
+
| Click / Enter / Space on a trigger | Toggles its panel; opening one closes any other |
|
|
93
|
+
| ArrowDown on a trigger | Opens the panel and focuses its first link |
|
|
94
|
+
| ArrowUp / ArrowDown / Home / End in a panel | Moves between the panel's links (wraps) |
|
|
95
|
+
| ArrowLeft / ArrowRight on the top level | Moves between top-level entries; swapped under `dir="rtl"` |
|
|
96
|
+
| Escape | Closes the panel and returns focus to its trigger |
|
|
97
|
+
| Pointer down outside the navbar | Closes the panel |
|
|
98
|
+
| Focus leaves the navbar (Tab) | Closes the panel |
|
|
99
|
+
| Activating a panel link | Closes the panel (`closeOnNavigate`, default `true`) |
|
|
100
|
+
|
|
101
|
+
Modifiers: `.nt-navbar--compact` (smaller rows), `.nt-navbar__panel--end`
|
|
102
|
+
(align the panel to the item's inline end), `.nt-navbar__panel--wide`
|
|
103
|
+
(multi-column panel). Current page: `aria-current="page"` (draws an indicator
|
|
104
|
+
bar, so state never depends on color alone). Disabled entries: `aria-disabled="true"`.
|
|
105
|
+
|
|
106
|
+
Current-page links show an accent underline that grows from the center; on
|
|
107
|
+
hover other links preview the underline in a neutral tone. The underline is
|
|
108
|
+
a shape cue, so the current page never relies on color alone.
|
|
109
|
+
|
|
110
|
+
## Account dropdown
|
|
111
|
+
|
|
112
|
+
```html
|
|
113
|
+
<div class="nt-dropdown">
|
|
114
|
+
<button class="nt-header__account" type="button" aria-expanded="false" aria-controls="account-panel" aria-label="Account: Sara Ali">
|
|
115
|
+
<span class="nt-avatar nt-avatar--sm" aria-hidden="true"><img class="nt-avatar__image" src="/avatar.jpg" alt=""></span>
|
|
116
|
+
<span class="nt-header__account-name">Sara Ali</span>
|
|
117
|
+
<span class="nt-header__account-chevron" aria-hidden="true"></span>
|
|
118
|
+
</button>
|
|
119
|
+
<div class="nt-dropdown__content nt-profile-menu" id="account-panel" data-align="end" hidden>
|
|
120
|
+
<div class="nt-profile-menu__header">
|
|
121
|
+
<div class="nt-profile-menu__identity">
|
|
122
|
+
<span class="nt-profile-menu__name">Sara Ali</span>
|
|
123
|
+
<span class="nt-profile-menu__email">sara@example.com</span>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
<div class="nt-profile-menu__section">
|
|
127
|
+
<a class="nt-profile-menu__item" href="/settings">Account settings</a>
|
|
128
|
+
<button class="nt-profile-menu__item nt-profile-menu__item--danger" type="button">Sign out</button>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
```ts
|
|
135
|
+
import { ntCreateAccountMenu } from '@neetechs/ui/behaviors';
|
|
136
|
+
|
|
137
|
+
const account = ntCreateAccountMenu({
|
|
138
|
+
trigger: document.querySelector<HTMLElement>('.nt-header__account')!,
|
|
139
|
+
panel: document.querySelector<HTMLElement>('#account-panel')!,
|
|
140
|
+
});
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
The account dropdown is a disclosure (button + panel), because the panel holds
|
|
144
|
+
identity text as well as actions, which `role="menu"` cannot contain. Escape
|
|
145
|
+
closes and restores focus, outside clicks and focus leaving close it, and
|
|
146
|
+
Arrow Up/Down/Home/End move between its actions. The application owns what
|
|
147
|
+
"Sign out" does. The account name hides below 40rem, leaving the avatar.
|
|
148
|
+
|
|
149
|
+
## Mobile navigation
|
|
150
|
+
|
|
151
|
+
```html
|
|
152
|
+
<div class="nt-mobile-nav__overlay" id="site-menu-backdrop" hidden></div>
|
|
153
|
+
<aside class="nt-mobile-nav nt-mobile-nav--drawer" id="site-menu" aria-labelledby="site-menu-title" hidden>
|
|
154
|
+
<div class="nt-mobile-nav__header">
|
|
155
|
+
<span class="nt-mobile-nav__title" id="site-menu-title">Neetechs</span>
|
|
156
|
+
<button class="nt-mobile-nav__close" type="button" aria-label="Close site menu">…</button>
|
|
157
|
+
</div>
|
|
158
|
+
<nav class="nt-mobile-nav__body" aria-label="Site">
|
|
159
|
+
<div class="nt-mobile-nav__section">
|
|
160
|
+
<a class="nt-mobile-nav__item" href="/" aria-current="page"><span class="nt-mobile-nav__item-label">Home</span></a>
|
|
161
|
+
</div>
|
|
162
|
+
</nav>
|
|
163
|
+
</aside>
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
```ts
|
|
167
|
+
import { ntCreateMobileNav } from '@neetechs/ui/behaviors';
|
|
168
|
+
|
|
169
|
+
const mobileNav = ntCreateMobileNav({
|
|
170
|
+
trigger: document.querySelector<HTMLElement>('.nt-header__mobile-trigger')!,
|
|
171
|
+
nav: document.querySelector<HTMLElement>('#site-menu')!,
|
|
172
|
+
backdrop: document.querySelector<HTMLElement>('#site-menu-backdrop'),
|
|
173
|
+
});
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Built on `ntCreateDrawer` (modal): `role="dialog"`, `aria-modal`, focus trap,
|
|
177
|
+
background `inert`, scroll lock, Escape, backdrop click, close button, and
|
|
178
|
+
focus restoration to the menu button. It also closes after a link is activated
|
|
179
|
+
and when the viewport grows past the mobile breakpoint, so no stale modal state
|
|
180
|
+
remains. The drawer enters from the inline-start edge (right edge in RTL) and
|
|
181
|
+
respects safe-area insets and reduced motion.
|
|
182
|
+
|
|
183
|
+
## Footer
|
|
184
|
+
|
|
185
|
+
```html
|
|
186
|
+
<footer class="nt-footer">
|
|
187
|
+
<div class="nt-footer__inner">
|
|
188
|
+
<div class="nt-footer__brand">
|
|
189
|
+
<a class="nt-footer__brand-link" href="/">
|
|
190
|
+
<img class="nt-footer__logo" src="/logo.svg" alt="">
|
|
191
|
+
<span class="nt-footer__brand-name">Neetechs</span>
|
|
192
|
+
</a>
|
|
193
|
+
<p class="nt-footer__tagline">Business software for teams.</p>
|
|
194
|
+
<ul class="nt-footer__social" aria-label="Social media">
|
|
195
|
+
<li><a class="nt-footer__social-link" href="https://www.linkedin.com/company/example" aria-label="Neetechs on LinkedIn"><svg class="nt-footer__social-icon" aria-hidden="true" focusable="false">…</svg></a></li>
|
|
196
|
+
</ul>
|
|
197
|
+
</div>
|
|
198
|
+
<nav class="nt-footer__nav" aria-label="Footer">
|
|
199
|
+
<div class="nt-footer__column">
|
|
200
|
+
<h2 class="nt-footer__heading" id="footer-products">Products</h2>
|
|
201
|
+
<ul class="nt-footer__list" aria-labelledby="footer-products">
|
|
202
|
+
<li><a class="nt-footer__link" href="/billing">Billing</a></li>
|
|
203
|
+
</ul>
|
|
204
|
+
</div>
|
|
205
|
+
</nav>
|
|
206
|
+
</div>
|
|
207
|
+
<div class="nt-footer__bottom">
|
|
208
|
+
<p class="nt-footer__copyright">© 2026 Neetechs</p>
|
|
209
|
+
<ul class="nt-footer__legal" aria-label="Legal">
|
|
210
|
+
<li><a class="nt-footer__link" href="/privacy">Privacy policy</a></li>
|
|
211
|
+
</ul>
|
|
212
|
+
</div>
|
|
213
|
+
</footer>
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
The footer is a query container: columns pair up from about 21rem, the brand
|
|
217
|
+
column moves beside the link columns from 48rem of footer width, and the bottom bar
|
|
218
|
+
becomes a single row. Variants: `.nt-footer--compact` (bottom bar only) and
|
|
219
|
+
`.nt-footer--raised` (surface background). Choose heading levels that fit the
|
|
220
|
+
page outline; the class carries the styling.
|
|
221
|
+
|
|
222
|
+
## Workspace sidebar
|
|
223
|
+
|
|
224
|
+
Application workspaces (Billing, Companies, MyAccount) use `.nt-app-shell`
|
|
225
|
+
with `.nt-sidebar`. `ntCreateSidebar` adds the interactions; routing stays
|
|
226
|
+
with the application.
|
|
227
|
+
|
|
228
|
+
For the opt-in glass sidebar, the curved active-item connection, and the
|
|
229
|
+
connected glass shell, see [Glass and motion](./glass-and-motion.md).
|
|
230
|
+
|
|
231
|
+
```html
|
|
232
|
+
<div class="nt-app-shell nt-app-shell--inset nt-app-shell--offcanvas" id="shell">
|
|
233
|
+
<aside class="nt-app-shell__sidebar" id="workspace-sidebar" aria-label="Workspace">
|
|
234
|
+
<nav class="nt-sidebar nt-sidebar--floating" aria-label="Billing navigation">
|
|
235
|
+
<div class="nt-sidebar__nav">
|
|
236
|
+
<div class="nt-sidebar__group">
|
|
237
|
+
<button class="nt-sidebar__group-trigger" type="button" aria-expanded="true">
|
|
238
|
+
<span class="nt-sidebar__group-label">Sales</span>
|
|
239
|
+
<svg class="nt-sidebar__group-chevron" aria-hidden="true"></svg>
|
|
240
|
+
</button>
|
|
241
|
+
<div class="nt-sidebar__group-items">
|
|
242
|
+
<div class="nt-sidebar__group-inner">
|
|
243
|
+
<a class="nt-sidebar__item" href="/invoices" aria-current="page">
|
|
244
|
+
<svg class="nt-sidebar__item-icon" aria-hidden="true"></svg>
|
|
245
|
+
<span class="nt-sidebar__item-label">Invoices</span>
|
|
246
|
+
</a>
|
|
247
|
+
</div>
|
|
248
|
+
</div>
|
|
249
|
+
</div>
|
|
250
|
+
</div>
|
|
251
|
+
<div class="nt-sidebar__footer">
|
|
252
|
+
<button class="nt-button nt-button--ghost nt-button--sm" type="button" data-nt-sidebar-close>Close menu</button>
|
|
253
|
+
</div>
|
|
254
|
+
</nav>
|
|
255
|
+
</aside>
|
|
256
|
+
<div class="nt-app-shell__overlay" hidden></div>
|
|
257
|
+
<div class="nt-app-shell__main">
|
|
258
|
+
<header class="nt-app-shell__header">
|
|
259
|
+
<button class="nt-icon-button nt-icon-button--ghost nt-app-shell__menu-toggle" type="button" aria-label="Open navigation"></button>
|
|
260
|
+
<button class="nt-icon-button nt-icon-button--ghost nt-app-shell__collapse-toggle" type="button" aria-label="Collapse sidebar"></button>
|
|
261
|
+
</header>
|
|
262
|
+
<main class="nt-app-shell__content">…</main>
|
|
263
|
+
</div>
|
|
264
|
+
</div>
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
```ts
|
|
268
|
+
import { ntCreateSidebar } from '@neetechs/ui/behaviors';
|
|
269
|
+
|
|
270
|
+
const sidebar = ntCreateSidebar({
|
|
271
|
+
shell: document.querySelector('#shell'),
|
|
272
|
+
sidebar: document.querySelector('#workspace-sidebar'),
|
|
273
|
+
collapseToggle: document.querySelector('.nt-app-shell__collapse-toggle'),
|
|
274
|
+
menuToggle: document.querySelector('.nt-app-shell__menu-toggle'),
|
|
275
|
+
backdrop: document.querySelector('.nt-app-shell__overlay'),
|
|
276
|
+
storageKey: 'billing.sidebar.collapsed',
|
|
277
|
+
});
|
|
278
|
+
// After the app re-renders navigation or changes the current route:
|
|
279
|
+
sidebar.refresh();
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
| Feature | Contract |
|
|
283
|
+
|---|---|
|
|
284
|
+
| Active item | `aria-current="page"` (or `--active`): selection fill plus an inline-start indicator bar that grows in (a shape cue, not color only) |
|
|
285
|
+
| Collapsible groups | Disclosure buttons (`aria-expanded` + `aria-controls`); height animates through grid rows; closed items leave the tab order; a group containing the current page opens on init and on `refresh()` |
|
|
286
|
+
| Icon rail | `setCollapsed(true)` or the collapse toggle sets `.nt-app-shell--collapsed` (standalone: `.nt-sidebar--collapsed`); the grid column animates; labels are visually hidden but keep accessible names; icon-only items get a `title`; groups show all items separated by dividers |
|
|
287
|
+
| Persistence | Optional `storageKey` in `localStorage`; storage failures are ignored |
|
|
288
|
+
| Off-canvas (`.nt-app-shell--offcanvas`) | Below 64rem the same sidebar slides in from the inline-start edge as a modal panel: focus trap, Escape, backdrop and outside click, scroll lock, inert background, focus returns to the menu toggle, closes on navigation and when the viewport grows to desktop. A desktop rail preference never applies inside the panel |
|
|
289
|
+
| Inset layout (`.nt-app-shell--inset` + `.nt-sidebar--floating`) | Sidebar and content float as separate rounded panels on the app background |
|
|
290
|
+
| Toggles | `.nt-app-shell__collapse-toggle` shows only while docked; `.nt-app-shell__menu-toggle` and `[data-nt-sidebar-close]` only below the shell breakpoint |
|
|
291
|
+
| SSR | Server markup renders the expanded desktop sidebar; the controller reads storage and media queries only in the browser |
|
|
292
|
+
|
|
293
|
+
Without `.nt-app-shell--offcanvas` the sidebar keeps its existing behavior
|
|
294
|
+
(hidden below 64rem; use the mobile navigation drawer).
|
|
295
|
+
|
|
296
|
+
## Responsive, touch, RTL, themes
|
|
297
|
+
|
|
298
|
+
- Desktop (≥ 64rem): navbar + account dropdown. Tablet/phone: menu button +
|
|
299
|
+
mobile drawer; the account trigger collapses to the avatar below 40rem.
|
|
300
|
+
- Coarse pointers get 44px (`--nt-target-size-primary`) targets for header
|
|
301
|
+
actions, the account button, drawer rows and close button, navbar panel links,
|
|
302
|
+
and footer links. Fine pointers keep at least 24px (WCAG 2.2 AA).
|
|
303
|
+
- Only logical properties are used; the drawer, panels, and indicator bars
|
|
304
|
+
mirror under `dir="rtl"`.
|
|
305
|
+
- Colors come from semantic tokens only, so dark, light, high contrast, and all
|
|
306
|
+
accents work without extra CSS. Forced-colors mode keeps current/expanded
|
|
307
|
+
states visible with a system-color outline.
|
|
308
|
+
|
|
309
|
+
## Layering
|
|
310
|
+
|
|
311
|
+
See [layering.md](./layering.md). Header dropdowns render inside the header's
|
|
312
|
+
stacking context at `--nt-z-header`, so positioned or hovered page cards can
|
|
313
|
+
never cover them, while drawers, modals, and toasts still stack above.
|
|
314
|
+
|
|
315
|
+
## Framework integration
|
|
316
|
+
|
|
317
|
+
The controllers are plain DOM functions. In Angular, create them in
|
|
318
|
+
`afterNextRender` / `ngAfterViewInit` and call `destroy()` in `ngOnDestroy`;
|
|
319
|
+
let `routerLink` render the `href`s. In React, create them in `useEffect` and
|
|
320
|
+
return `destroy`. Call `navbar.refresh()` when navigation items re-render.
|