@neetechs/ui 0.0.4 → 0.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.
Files changed (311) hide show
  1. package/CHANGELOG.md +138 -0
  2. package/CONTRIBUTING.md +60 -0
  3. package/LICENSE +21 -21
  4. package/README.md +861 -752
  5. package/dist/ai/ai-action-button/ai-action-button.css +271 -271
  6. package/dist/ai/ai-approval-card/ai-approval-card.css +323 -323
  7. package/dist/ai/ai-conversation-panel/ai-conversation-panel.css +447 -447
  8. package/dist/ai/ai-prompt-input/ai-prompt-input.css +380 -380
  9. package/dist/ai/ai-proposal-card/ai-proposal-card.css +358 -358
  10. package/dist/ai/ai-suggestion-card/ai-suggestion-card.css +295 -295
  11. package/dist/ai/ai-tool-call/ai-tool-call.css +256 -256
  12. package/dist/ai/index.css +7 -7
  13. package/dist/appearance/index.d.ts +2 -0
  14. package/dist/appearance/index.d.ts.map +1 -1
  15. package/dist/appearance/index.js +1 -0
  16. package/dist/appearance/index.js.map +1 -1
  17. package/dist/appearance/inline-bootstrap.d.ts +29 -0
  18. package/dist/appearance/inline-bootstrap.d.ts.map +1 -0
  19. package/dist/appearance/inline-bootstrap.js +154 -0
  20. package/dist/appearance/inline-bootstrap.js.map +1 -0
  21. package/dist/appearance/preference.js +1 -1
  22. package/dist/appearance/preference.js.map +1 -1
  23. package/dist/appearance/theme-controller.d.ts +6 -0
  24. package/dist/appearance/theme-controller.d.ts.map +1 -1
  25. package/dist/appearance/theme-controller.js +5 -0
  26. package/dist/appearance/theme-controller.js.map +1 -1
  27. package/dist/behaviors/index.d.ts +3 -0
  28. package/dist/behaviors/index.d.ts.map +1 -1
  29. package/dist/behaviors/index.js +3 -0
  30. package/dist/behaviors/index.js.map +1 -1
  31. package/dist/behaviors/navigation.d.ts +98 -0
  32. package/dist/behaviors/navigation.d.ts.map +1 -0
  33. package/dist/behaviors/navigation.js +295 -0
  34. package/dist/behaviors/navigation.js.map +1 -0
  35. package/dist/behaviors/popover.d.ts +22 -0
  36. package/dist/behaviors/popover.d.ts.map +1 -0
  37. package/dist/behaviors/popover.js +126 -0
  38. package/dist/behaviors/popover.js.map +1 -0
  39. package/dist/behaviors/sidebar.d.ts +78 -0
  40. package/dist/behaviors/sidebar.d.ts.map +1 -0
  41. package/dist/behaviors/sidebar.js +263 -0
  42. package/dist/behaviors/sidebar.js.map +1 -0
  43. package/dist/components/alert/alert.css +226 -220
  44. package/dist/components/avatar/avatar.css +298 -220
  45. package/dist/components/badge/badge.css +180 -174
  46. package/dist/components/breadcrumb/breadcrumb.css +207 -207
  47. package/dist/components/button/button.css +278 -195
  48. package/dist/components/button-group/button-group.css +111 -0
  49. package/dist/components/card/card.css +284 -221
  50. package/dist/components/checkbox/checkbox.css +189 -189
  51. package/dist/components/chip/chip.css +269 -269
  52. package/dist/components/choice-card/choice-card.css +244 -0
  53. package/dist/components/data-grid/data-grid.css +520 -520
  54. package/dist/components/description-list/description-list.css +187 -0
  55. package/dist/components/dialog/dialog.css +339 -339
  56. package/dist/components/disclosure/disclosure.css +154 -0
  57. package/dist/components/drawer/drawer.css +484 -484
  58. package/dist/components/dropdown/dropdown.css +316 -316
  59. package/dist/components/icon-button/icon-button.css +162 -162
  60. package/dist/components/index.css +6 -0
  61. package/dist/components/input/input.css +163 -163
  62. package/dist/components/menu/menu.css +315 -315
  63. package/dist/components/pagination/pagination.css +250 -250
  64. package/dist/components/panel/panel.css +284 -284
  65. package/dist/components/popover/popover.css +153 -0
  66. package/dist/components/progress/progress.css +268 -256
  67. package/dist/components/radio/radio.css +166 -166
  68. package/dist/components/segmented-control/segmented-control.css +205 -205
  69. package/dist/components/select/select.css +117 -117
  70. package/dist/components/skeleton/skeleton.css +267 -262
  71. package/dist/components/split-button/split-button.css +292 -292
  72. package/dist/components/stat/stat.css +433 -0
  73. package/dist/components/switch/switch.css +195 -195
  74. package/dist/components/table/table.css +220 -220
  75. package/dist/components/tabs/tabs.css +293 -293
  76. package/dist/components/textarea/textarea.css +86 -86
  77. package/dist/components/toast/toast.css +345 -345
  78. package/dist/components/tooltip/tooltip.css +258 -258
  79. package/dist/domain/billing/index.css +629 -498
  80. package/dist/domain/calendar/agenda-list/agenda-list.css +224 -224
  81. package/dist/domain/calendar/day-slice/day-slice.css +384 -384
  82. package/dist/domain/calendar/day-timeline/day-timeline.css +332 -332
  83. package/dist/domain/calendar/event-card/event-card.css +338 -338
  84. package/dist/domain/calendar/index.css +5 -5
  85. package/dist/domain/calendar/month-grid/month-grid.css +426 -426
  86. package/dist/domain/calendar/week-grid/week-grid.css +480 -480
  87. package/dist/domain/companies/index.css +526 -526
  88. package/dist/domain/index.css +3 -3
  89. package/dist/index.css +5 -5
  90. package/dist/index.d.ts +1 -1
  91. package/dist/index.d.ts.map +1 -1
  92. package/dist/index.js +1 -1
  93. package/dist/index.js.map +1 -1
  94. package/dist/patterns/command-palette/command-palette.css +447 -447
  95. package/dist/patterns/company-switcher/company-switcher.css +390 -390
  96. package/dist/patterns/content-state/content-state.css +236 -236
  97. package/dist/patterns/document-preview/document-preview.css +169 -0
  98. package/dist/patterns/editor-workspace/editor-workspace.css +276 -0
  99. package/dist/patterns/empty-state/empty-state.css +260 -260
  100. package/dist/patterns/error-state/error-state.css +272 -272
  101. package/dist/patterns/form-layout/form-layout.css +106 -106
  102. package/dist/patterns/index.css +5 -0
  103. package/dist/patterns/loading-state/loading-state.css +287 -287
  104. package/dist/patterns/master-detail/master-detail.css +103 -103
  105. package/dist/patterns/notification-center/notification-center.css +443 -443
  106. package/dist/patterns/page/page.css +303 -219
  107. package/dist/patterns/profile-header/profile-header.css +205 -0
  108. package/dist/patterns/profile-menu/profile-menu.css +298 -298
  109. package/dist/patterns/record-list/record-list.css +302 -0
  110. package/dist/patterns/resource-card/resource-card.css +258 -0
  111. package/dist/patterns/search-bar/search-bar.css +457 -457
  112. package/dist/patterns/settings-layout/settings-layout.css +283 -150
  113. package/dist/patterns/workflow/workflow.css +168 -168
  114. package/dist/shell/app-shell/app-shell.css +211 -75
  115. package/dist/shell/content-frame/content-frame.css +93 -93
  116. package/dist/shell/footer/footer.css +256 -0
  117. package/dist/shell/header/header.css +328 -180
  118. package/dist/shell/index.css +8 -6
  119. package/dist/shell/mobile-nav/mobile-nav.css +254 -173
  120. package/dist/shell/navbar/navbar.css +282 -0
  121. package/dist/shell/sidebar/sidebar.css +314 -146
  122. package/dist/styles/accessibility.css +150 -116
  123. package/dist/styles/animations/motion.css +162 -162
  124. package/dist/styles/appearance/accent.css +215 -173
  125. package/dist/styles/appearance/density.css +61 -61
  126. package/dist/styles/appearance/motion.css +40 -40
  127. package/dist/styles/base.css +83 -83
  128. package/dist/styles/index.css +28 -28
  129. package/dist/styles/localization.css +56 -56
  130. package/dist/styles/reset.css +51 -51
  131. package/dist/styles/responsive.css +101 -101
  132. package/dist/styles/themes/dark.css +210 -202
  133. package/dist/styles/themes/high-contrast.css +298 -290
  134. package/dist/styles/themes/light.css +209 -201
  135. package/dist/styles/tokens/breakpoints.css +37 -37
  136. package/dist/styles/tokens/color.css +102 -96
  137. package/dist/styles/tokens/compatibility.css +33 -33
  138. package/dist/styles/tokens/elevation.css +26 -26
  139. package/dist/styles/tokens/index.css +9 -9
  140. package/dist/styles/tokens/motion.css +35 -35
  141. package/dist/styles/tokens/radius.css +26 -26
  142. package/dist/styles/tokens/spacing.css +56 -56
  143. package/dist/styles/tokens/typography.css +85 -85
  144. package/dist/styles/tokens/z-index.css +14 -14
  145. package/dist/styles/utilities/layout.css +153 -153
  146. package/dist/styles/utilities/text.css +152 -152
  147. package/dist/styles/utilities/visibility.css +47 -47
  148. package/dist/version.d.ts +2 -0
  149. package/dist/version.d.ts.map +1 -0
  150. package/dist/version.js +3 -0
  151. package/dist/version.js.map +1 -0
  152. package/docs/NEETECHS_UI_UPGRADE_PLAN.md +312 -0
  153. package/docs/accessibility.md +218 -218
  154. package/docs/appearance-and-theming.md +150 -118
  155. package/docs/brand-palette.md +36 -0
  156. package/docs/component-architecture.md +137 -137
  157. package/docs/component-guidelines.md +64 -64
  158. package/docs/components.md +321 -0
  159. package/docs/content-and-terminology.md +207 -207
  160. package/docs/design-system-audit.md +120 -0
  161. package/docs/design-system-baseline-audit.md +226 -226
  162. package/docs/design-token-contract.md +279 -279
  163. package/docs/layering.md +53 -0
  164. package/docs/localization-and-rtl.md +147 -147
  165. package/docs/migration.md +193 -142
  166. package/docs/page-patterns-and-workflows.md +301 -260
  167. package/docs/responsive-and-adaptive-design.md +351 -351
  168. package/docs/semantic-role-migration-audit.md +77 -77
  169. package/docs/site-chrome.md +317 -0
  170. package/docs/states-feedback-and-recovery.md +206 -206
  171. package/docs/theming.md +5 -5
  172. package/package.json +19 -6
  173. package/src/ai/ai-action-button/ai-action-button.css +271 -271
  174. package/src/ai/ai-approval-card/ai-approval-card.css +323 -323
  175. package/src/ai/ai-conversation-panel/ai-conversation-panel.css +447 -447
  176. package/src/ai/ai-prompt-input/ai-prompt-input.css +380 -380
  177. package/src/ai/ai-proposal-card/ai-proposal-card.css +358 -358
  178. package/src/ai/ai-suggestion-card/ai-suggestion-card.css +295 -295
  179. package/src/ai/ai-tool-call/ai-tool-call.css +256 -256
  180. package/src/ai/index.css +7 -7
  181. package/src/appearance/cache.ts +236 -236
  182. package/src/appearance/cookie.ts +184 -184
  183. package/src/appearance/index.ts +86 -80
  184. package/src/appearance/inline-bootstrap.ts +163 -0
  185. package/src/appearance/preference.ts +121 -121
  186. package/src/appearance/theme-controller.ts +384 -371
  187. package/src/appearance/types.ts +61 -61
  188. package/src/behaviors/announcer.ts +222 -222
  189. package/src/behaviors/calendar.ts +92 -92
  190. package/src/behaviors/data-grid.ts +133 -133
  191. package/src/behaviors/dialog.ts +203 -203
  192. package/src/behaviors/direction.ts +34 -34
  193. package/src/behaviors/drawer.ts +210 -210
  194. package/src/behaviors/dropdown.ts +344 -344
  195. package/src/behaviors/focus-trap.ts +304 -304
  196. package/src/behaviors/forms.ts +205 -205
  197. package/src/behaviors/ids.ts +47 -47
  198. package/src/behaviors/index.ts +3 -0
  199. package/src/behaviors/keyboard.ts +305 -305
  200. package/src/behaviors/navigation.ts +417 -0
  201. package/src/behaviors/overlay.ts +344 -344
  202. package/src/behaviors/popover.ts +157 -0
  203. package/src/behaviors/sidebar.ts +342 -0
  204. package/src/behaviors/state.ts +282 -282
  205. package/src/behaviors/tabs.ts +137 -137
  206. package/src/behaviors/viewport.ts +61 -61
  207. package/src/components/alert/alert.css +226 -220
  208. package/src/components/avatar/avatar.css +298 -220
  209. package/src/components/badge/badge.css +180 -174
  210. package/src/components/breadcrumb/breadcrumb.css +207 -207
  211. package/src/components/button/button.css +278 -195
  212. package/src/components/button-group/button-group.css +111 -0
  213. package/src/components/card/card.css +284 -221
  214. package/src/components/checkbox/checkbox.css +189 -189
  215. package/src/components/chip/chip.css +269 -269
  216. package/src/components/choice-card/choice-card.css +244 -0
  217. package/src/components/data-grid/data-grid.css +520 -520
  218. package/src/components/description-list/description-list.css +187 -0
  219. package/src/components/dialog/dialog.css +339 -339
  220. package/src/components/disclosure/disclosure.css +154 -0
  221. package/src/components/drawer/drawer.css +484 -484
  222. package/src/components/dropdown/dropdown.css +316 -316
  223. package/src/components/icon-button/icon-button.css +162 -162
  224. package/src/components/index.css +6 -0
  225. package/src/components/input/input.css +163 -163
  226. package/src/components/menu/menu.css +315 -315
  227. package/src/components/pagination/pagination.css +250 -250
  228. package/src/components/panel/panel.css +284 -284
  229. package/src/components/popover/popover.css +153 -0
  230. package/src/components/progress/progress.css +268 -256
  231. package/src/components/radio/radio.css +166 -166
  232. package/src/components/segmented-control/segmented-control.css +205 -205
  233. package/src/components/select/select.css +117 -117
  234. package/src/components/skeleton/skeleton.css +267 -262
  235. package/src/components/split-button/split-button.css +292 -292
  236. package/src/components/stat/stat.css +433 -0
  237. package/src/components/switch/switch.css +195 -195
  238. package/src/components/table/table.css +220 -220
  239. package/src/components/tabs/tabs.css +293 -293
  240. package/src/components/textarea/textarea.css +86 -86
  241. package/src/components/toast/toast.css +345 -345
  242. package/src/components/tooltip/tooltip.css +258 -258
  243. package/src/domain/billing/index.css +629 -498
  244. package/src/domain/calendar/agenda-list/agenda-list.css +224 -224
  245. package/src/domain/calendar/day-slice/day-slice.css +384 -384
  246. package/src/domain/calendar/day-timeline/day-timeline.css +332 -332
  247. package/src/domain/calendar/event-card/event-card.css +338 -338
  248. package/src/domain/calendar/index.css +5 -5
  249. package/src/domain/calendar/month-grid/month-grid.css +426 -426
  250. package/src/domain/calendar/week-grid/week-grid.css +480 -480
  251. package/src/domain/companies/index.css +526 -526
  252. package/src/domain/index.css +3 -3
  253. package/src/index.css +5 -5
  254. package/src/index.ts +7 -7
  255. package/src/localization/index.ts +56 -56
  256. package/src/patterns/command-palette/command-palette.css +447 -447
  257. package/src/patterns/company-switcher/company-switcher.css +390 -390
  258. package/src/patterns/content-state/content-state.css +236 -236
  259. package/src/patterns/document-preview/document-preview.css +169 -0
  260. package/src/patterns/editor-workspace/editor-workspace.css +276 -0
  261. package/src/patterns/empty-state/empty-state.css +260 -260
  262. package/src/patterns/error-state/error-state.css +272 -272
  263. package/src/patterns/form-layout/form-layout.css +106 -106
  264. package/src/patterns/index.css +5 -0
  265. package/src/patterns/loading-state/loading-state.css +287 -287
  266. package/src/patterns/master-detail/master-detail.css +103 -103
  267. package/src/patterns/notification-center/notification-center.css +443 -443
  268. package/src/patterns/page/page.css +303 -219
  269. package/src/patterns/profile-header/profile-header.css +205 -0
  270. package/src/patterns/profile-menu/profile-menu.css +298 -298
  271. package/src/patterns/record-list/record-list.css +302 -0
  272. package/src/patterns/resource-card/resource-card.css +258 -0
  273. package/src/patterns/search-bar/search-bar.css +457 -457
  274. package/src/patterns/settings-layout/settings-layout.css +283 -150
  275. package/src/patterns/workflow/workflow.css +168 -168
  276. package/src/shell/app-shell/app-shell.css +211 -75
  277. package/src/shell/content-frame/content-frame.css +93 -93
  278. package/src/shell/footer/footer.css +256 -0
  279. package/src/shell/header/header.css +328 -180
  280. package/src/shell/index.css +8 -6
  281. package/src/shell/mobile-nav/mobile-nav.css +254 -173
  282. package/src/shell/navbar/navbar.css +282 -0
  283. package/src/shell/sidebar/sidebar.css +314 -146
  284. package/src/styles/accessibility.css +150 -116
  285. package/src/styles/animations/motion.css +162 -162
  286. package/src/styles/appearance/accent.css +215 -173
  287. package/src/styles/appearance/density.css +61 -61
  288. package/src/styles/appearance/motion.css +40 -40
  289. package/src/styles/base.css +83 -83
  290. package/src/styles/index.css +28 -28
  291. package/src/styles/localization.css +56 -56
  292. package/src/styles/reset.css +51 -51
  293. package/src/styles/responsive.css +101 -101
  294. package/src/styles/themes/dark.css +210 -202
  295. package/src/styles/themes/high-contrast.css +298 -290
  296. package/src/styles/themes/light.css +209 -201
  297. package/src/styles/tokens/breakpoints.css +37 -37
  298. package/src/styles/tokens/color.css +102 -96
  299. package/src/styles/tokens/compatibility.css +33 -33
  300. package/src/styles/tokens/elevation.css +26 -26
  301. package/src/styles/tokens/index.css +9 -9
  302. package/src/styles/tokens/motion.css +35 -35
  303. package/src/styles/tokens/radius.css +26 -26
  304. package/src/styles/tokens/spacing.css +56 -56
  305. package/src/styles/tokens/typography.css +85 -85
  306. package/src/styles/tokens/z-index.css +14 -14
  307. package/src/styles/utilities/layout.css +153 -153
  308. package/src/styles/utilities/text.css +152 -152
  309. package/src/styles/utilities/visibility.css +47 -47
  310. package/src/types/index.ts +126 -126
  311. package/src/version.ts +2 -0
@@ -1,218 +1,218 @@
1
- # Accessibility contract
2
-
3
- Localization does not weaken this contract. Set correct `lang`/`dir`, provide complete accessible names in the active language, isolate technical values without changing their spoken label, and test visual keyboard order in RTL. Native Arabic screen-reader QA remains an application responsibility; see [localization-and-rtl.md](./localization-and-rtl.md).
4
-
5
- `@neetechs/ui` targets WCAG 2.2 Level AA as its engineering baseline. This is not a certification: applications must still test their content, routing, framework integration, localization, screen-reader experience, and complete user journeys.
6
-
7
- The package is CSS-first. CSS classes provide appearance; they cannot repair incorrect HTML. The behavior exports under `@neetechs/ui/behaviors` add only relationships and interactions that require JavaScript. Consumers remain responsible for meaningful labels and product-specific descriptions.
8
-
9
- ## 1. Baseline requirements
10
-
11
- - Normal text is at least 4.5:1; large text and meaningful non-text boundaries are at least 3:1.
12
- - Keyboard focus uses `:focus-visible`, a 2px semantic ring, and a 2px offset. Never remove an outline without a replacement in the same rule.
13
- - Primary and icon-only controls expose a 44×44px target. Dense contextual controls expose at least 40×40px. Inline text links, browser-native controls, tightly packed data points, and controls whose spacing provides an equivalent compound target are documented exceptions.
14
- - Native HTML is preferred. Do not replace a `button`, `a`, `input`, `select`, `textarea`, `table`, `fieldset`, or heading with a generic element plus ARIA.
15
- - Light/dark × orange/blue/green/purple/neutral semantic contrast is enforced by `npm run check:a11y`.
16
- - High contrast and forced colors layer over light or dark. Reduced motion removes decorative travel/lift and preserves state feedback.
17
-
18
- ## 2. Native HTML and accessible names
19
-
20
- Use visible text as the accessible name whenever possible. Icon-only controls require a concise `aria-label` or associated visible label. `title` is supplementary, not the only naming strategy. Images use meaningful `alt`, empty `alt` when decorative, or a nearby text alternative for complex graphics. Decorative SVGs are `aria-hidden="true"`; meaningful SVGs inherit `currentColor` and are named by surrounding content.
21
-
22
- Labels describe the control, while `aria-describedby` connects helper, constraint, consequence, and error copy. Placeholder text is never the only label. Do not repeat visible text in `aria-label`; that can override better content.
23
-
24
- ## 3. Component accessibility inventory
25
-
26
- Prompt 7 consolidation note: modal CSS and `ntCreateModal` now delegate to the canonical dialog implementation; the right-drawer path/classes delegate to canonical logical drawer CSS; company/workspace switchers share one visual source and the menu-popover behavior. These compatibility names do not define separate accessibility contracts. The table export is now a styled native-table contract and remains intentionally separate from the interactive data grid. See [component-architecture.md](./component-architecture.md).
27
-
28
- Prompt 8 state note: operation state now uses native semantics plus `data-nt-state` where needed; content-region state uses `data-nt-content-state`; legacy `--loading`, `--error`, and `--success` modifiers are styling compatibility hooks. See [states-feedback-and-recovery.md](./states-feedback-and-recovery.md).
29
-
30
- The inventory covers all 59 shipped UI/domain CSS modules. “Gallery” means the representative Playwright/axe contract gallery; “manual” identifies an application-level check still required.
31
-
32
- | Component and source | Semantic/name contract | Keyboard and focus | State/feedback contract | Target, modes, coverage and residual risk |
33
- |---|---|---|---|---|
34
- | Alert — `src/components/alert/alert.css` | Static notice: section/region; urgent dynamic error: `role=alert`; routine update: `role=status`; heading names region | Actions are native controls; no container tab stop | Severity is text/icon plus color; recovery action is named | Actions 40/44; forced-color border; gallery. Urgency choice remains manual |
35
- | Avatar — `src/components/avatar/avatar.css` | Decorative avatar has empty alt/hidden initials; informative image has person/org name | Not focusable unless a native link/button wrapper | Presence/status needs text alternative | CurrentColor boundary; manual image-alt review |
36
- | Badge — `src/components/badge/badge.css` | Text span; status role only for a dynamic update | Not focusable unless interactive variant is a button | Status wording must not rely on hue | Forced-color boundary; semantic contrast; manual copy review |
37
- | Breadcrumb — `src/components/breadcrumb/breadcrumb.css` | `nav aria-label="Breadcrumb"`, ordered list, current item `aria-current=page` | Native links; visible focus | Current page is not a dead unlabeled link | Inline-link target exception; structure manual |
38
- | Button — `src/components/button/button.css` | Native `button`; visible text is name; busy keeps original name and uses `aria-busy` | Native Enter/Space; no redundant handlers | Native `disabled`; `aria-disabled` requires activation guard; loading prevents repeat | Primary 44; focus/contrast/motion/forced colors tested |
39
- | Card — `src/components/card/card.css` | Article/section only with a heading; clickable card uses one real link/button, not nested controls | Only actual actions focus | Selected cards use `aria-selected` only in a selection widget | Reduced lift; selected outline in forced colors; structure manual |
40
- | Checkbox — `src/components/checkbox/checkbox.css` | Native checkbox inside label; groups use fieldset/legend | Native Space | `checked`, `indeterminate`, `disabled`, required/error on input | 40px row; system-color forced mode; gallery/axe |
41
- | Chip — `src/components/chip/chip.css` | Static tag is text; removable/choice chip uses native button and named remove action | Native activation; composite owner manages arrows | `aria-pressed`/`aria-selected`; disabled guard | 40px interactive target; composite behavior app-owned |
42
- | Data grid — `src/components/data-grid/data-grid.css`, `src/behaviors/data-grid.ts` | Prefer semantic table. Opt-in `role=grid` only for 2-D interaction; headers name columns; help describes keys | Roving arrows, Home/End, Ctrl+Home/End, activation callback | `aria-sort`, `aria-selected`, disabled; polite sort live region | Visible focus/selection; browser tested. Editing/resize policy app-specific |
43
- | Dialog — `src/components/dialog/dialog.css`, `src/behaviors/dialog.ts` | Dialog role/modal state/title and optional description references | Intentional initial focus, Tab trap, Escape if dismissible, restore invoker | Background inert, scroll locked, hidden closed, nested-stack aware | Boundary/focus forced colors; nested browser test; SR manual |
44
- | Drawer — `src/components/drawer/drawer.css`, `src/behaviors/drawer.ts` | Explicit modal dialog or nonmodal region/navigation | Modal traps/restores; nonmodal follows page order; top overlay owns Escape | Modal background inert; role/modal match declared modality | Reduced travel/forced boundary; nested browser test |
45
- | Dropdown — `src/components/dropdown/dropdown.css`, `src/behaviors/dropdown.ts` | Trigger button with popup/expanded/controls; content is menu or listbox, not both | Arrow open/navigation, Home/End, typeahead, activation, Escape returns trigger; no Tab trap | Disabled items skipped/blocked; closed content hidden | Items 40px; browser tested. Listbox value sync consumer-owned |
46
- | Icon button — `src/components/icon-button/icon-button.css` | Native button with required accessible name | Native activation; visible focus | Disabled/loading as button | 44px default, 40px compact; browser measured |
47
- | Input — `src/components/input/input.css`, `src/behaviors/forms.ts` | Visible label; stable help/error IDs | Native editing and focus | required, invalid, disabled, readonly, busy distinct | 40px minimum; contrast/focus/axe |
48
- | Menu — `src/components/menu/menu.css`, dropdown behavior | Menu only for application commands; navigation remains nav/links | Up/Down, Home/End, typeahead, activation, Escape; no Tab trap | Disabled items skipped/blocked; checked command roles where needed | 40px; browser tested through dropdown |
49
- | Modal compatibility - `@neetechs/ui/components/modal.css`, `ntCreateModal` | Deprecated aliases to canonical dialog CSS/behavior; identical naming requirement | Same canonical trap/restore contract | Adapter forces `modal: true`; no second focus manager | Architecture-tested; migrate to dialog before 1.0 |
50
- | Pagination — `src/components/pagination/pagination.css` | Labelled nav; native links/buttons; current page `aria-current=page` | Native activation/sequence | Disabled previous/next native or non-link text | 40×40; forced selected outline; structure manual |
51
- | Panel — `src/components/panel/panel.css` | Section/aside only when landmark/heading is useful | Actions only | Loading may set `aria-busy` on panel | Semantic boundary; structure manual |
52
- | Progress — `src/components/progress/progress.css` | Native progress or named progressbar with value/min/max; indeterminate has status text | Not focusable | Announce milestones, not every frame | Motion reduced without losing state; cadence manual |
53
- | Radio — `src/components/radio/radio.css` | Native radios in fieldset/legend | Native arrows/Space | checked/disabled/required/error on input | 40px row; forced colors; gallery/axe |
54
- | Segmented control — `src/components/segmented-control/segmented-control.css` | Radio group for exclusive value or toolbar of buttons for commands; label group | Native radios or documented roving behavior | checked/pressed/disabled explicit | Focus/selected distinct; role choice manual |
55
- | Select — `src/components/select/select.css` | Native label + select unless complete combobox implemented | Native browser behavior | disabled/required/invalid; native select has no readonly | 40px; contrast/focus/axe |
56
- | Skeleton — `src/components/skeleton/skeleton.css` | Decorative skeleton hidden; containing region busy with readable status | Not focusable | Real content replaces skeleton; no repeated announcements | Animation suppressed; gallery loading pattern |
57
- | Split button — `src/components/split-button/split-button.css` | Two named native buttons: action and disclosure | Native action; disclosure follows menu contract | Disabled/loading coherent across both | 40/44 by action; composition manual |
58
- | Switch — `src/components/switch/switch.css` | Prefer native checkbox; custom switch requires checked state and label | Native Space | checked/disabled; no mixed state | 40px row; forced colors; gallery/axe |
59
- | Table — `src/components/table/table.css` | Native table/caption/scope headers; no grid role for display-only data | Standard AT table navigation | Sort buttons inside headers and announce state | Overflow response deferred; markup manual |
60
- | Tabs — `src/components/tabs/tabs.css`, `src/behaviors/tabs.ts` | tablist/tab/tabpanel with generated controls/labelledby IDs | Orientation arrows, Home/End, one tab stop; automatic/manual declared | selected/disabled/hidden panel synchronized | 40px; focus/forced selection; browser tested |
61
- | Textarea — `src/components/textarea/textarea.css` | Visible label and descriptions | Native editing | readonly readable/focusable; disabled/invalid distinct | 40px; contrast/focus/axe |
62
- | Toast — `src/components/toast/toast.css`, `src/behaviors/announcer.ts` | Routine status; urgent error alert; named close | No automatic focus; close keyboard accessible; timed toast pauses hover/focus | Critical content persists; status wording explicit | Gallery semantics; `ntCreateToastController` covers timers, dedupe, stack limit, pause, and cleanup |
63
- | Tooltip — `src/components/tooltip/tooltip.css` | Tooltip role/stable describedby; never sole essential content | Opens focus/hover; Escape dismissal when behavior exists; no interactive children | Hidden tooltip not exposed | Reduced motion/forced text; lifecycle consumer-owned |
64
- | AI action button — `src/ai/ai-action-button/ai-action-button.css` | Named native button; name states action, not only “AI” | Native activation | Busy preserves name, blocks repeat, exposes status | 44px; independent AI contrast; reduced motion |
65
- | AI approval card — `src/ai/ai-approval-card/ai-approval-card.css` | Heading names card; description states intent, target, consequence, reversibility | Native reject/approve; safe action first | Pending/status polite; confirmation/success/failure explicit | Gallery/axe/actions; product copy/workflow manual |
66
- | AI conversation panel — `src/ai/ai-conversation-panel/ai-conversation-panel.css` | Named region/log; messages identify speaker; streaming status separate | Normal document/controls order | New content polite/batched; do not reread transcript | Streaming behavior app-owned |
67
- | AI prompt input — `src/ai/ai-prompt-input/ai-prompt-input.css` | Labelled textarea/input; named send/attachment | Native editing; multiline Enter preserved unless policy declared | Busy/error/counter associated without chatter | Controls 40/44; policy manual |
68
- | AI proposal card — `src/ai/ai-proposal-card/ai-proposal-card.css` | Heading + proposal description; buttons name consequences | Native actions | Approval not inferred from purple; explicit status | Focus/contrast; workflow manual |
69
- | AI suggestion card — `src/ai/ai-suggestion-card/ai-suggestion-card.css` | List/article with descriptive suggestion action | Native action; owning widget handles arrows if selection composite | Accepted/rejected text plus status | Focus/selection/contrast; list behavior manual |
70
- | AI tool call — `src/ai/ai-tool-call/ai-tool-call.css` | Human-readable operation/target/status; raw JSON optional detail | Disclosure button for collapsed detail | Running/success/failure at meaningful transitions | Status contrast; descriptions manual |
71
- | Billing — `src/domain/billing/index.css` | Semantic tables/lists/forms; amounts include currency/sign in text | Native actions/table navigation | Financial sign never color-only; errors use form contract | Financial tokens; localization audit deferred |
72
- | Companies — `src/domain/companies/index.css` | Named company list/region; logos follow avatar rules; actions are native | Native list actions; switcher menu uses shared behavior | Active company, role, permission, and availability use text/ARIA plus visual state | Focus/target/forced colors; product permissions and names manual |
73
- | Calendar day slice — `src/domain/calendar/day-slice/day-slice.css` | Named time-grid; events named with title/time | Application declares arrows or normal Tab, not both | Current/selected time text/ARIA, not color only | Focus/forced/reduced; core grid browser tested |
74
- | Calendar timeline — `src/domain/calendar/day-timeline/day-timeline.css` | Time labels/events expose start/end | Event keyboard path documented by app | Current time/category needs non-color text | Drag/resize keyboard alternative app-specific |
75
- | Calendar event card — `src/domain/calendar/event-card/event-card.css` | Native link/button with event name/time/category | Native activation; menu uses shared behavior | selected/current/cancelled text/ARIA plus visual | 44 primary; compact context exception; copy manual |
76
- | Calendar month grid — `src/domain/calendar/month-grid/month-grid.css`, calendar behavior | Grid rows/cells; full date spoken label; today current date | ±1/±7 arrows, Home/End, one tab stop | selection state; range polite live region | 44px behavior hook; browser tested |
77
- | Calendar week grid — `src/domain/calendar/week-grid/week-grid.css`, calendar behavior | Named grid/time-grid and full event names | Declared grid or event Tab model | current/selected not color-only | Focus/forced; complex navigation manual |
78
- | Command palette — `src/patterns/command-palette/command-palette.css` | Modal dialog with labelled combobox/listbox | Input arrows/Home/End/Enter/Escape; modal trap/restore | Loading/empty readable; active descendant when input retains focus | Complete combobox controller is a known limitation |
79
- | Company switcher — `src/patterns/company-switcher/company-switcher.css` | Disclosure + menu/listbox chosen by command vs value | Shared dropdown keyboard | Selected company/unavailable explicit | 40px/shared browser behavior; content manual |
80
- | Content state — `src/patterns/content-state/content-state.css` | Heading/description/native recovery; urgency chosen by context | Native action; no automatic focus unless recovering from failed submission | `data-nt-content-state` differentiates loading, empty, error, offline, permission, not-found, maintenance, success | Target/focus/contrast/RTL; manual content |
81
- | Empty state — `src/patterns/empty-state/empty-state.css` | Legacy pattern over content-state guidance; heading/description/native recovery; no alert | Native action | Static absence is not urgent | Compatible; prefer `.nt-content-state` for new work |
82
- | Error state — `src/patterns/error-state/error-state.css` | Legacy pattern over content-state guidance; heading/recovery/action; alert only dynamically urgent | Native action | Reason/recovery not icon/color only | Compatible; prefer `.nt-content-state` for new work |
83
- | Loading state — `src/patterns/loading-state/loading-state.css` | Legacy pattern over content-state guidance; named status; affected region busy; skeleton hidden | Do not move/strand focus | Announce start/end or milestones only | Compatible; prefer `.nt-content-state` for new work |
84
- | Notification center — `src/patterns/notification-center/notification-center.css` | Named region/list; item heading/time/read state | Native actions; optional menu shared | Unread text/ARIA plus color; updates polite | Focus/forced color; update behavior manual |
85
- | Profile menu — `src/patterns/profile-menu/profile-menu.css` | Trigger + command menu | Shared dropdown menu | Disabled/current account explicit | Shared browser menu; names manual |
86
- | Search bar — `src/patterns/search-bar/search-bar.css` | Search landmark/form, labelled input, named clear/submit | Native editing/submission; Escape clear only if declared | Loading/results count polite; clear updates value | Focus/targets; results combobox not provided |
87
- | Workspace switcher - `@neetechs/ui/patterns/workspace-switcher.css` | Disclosure + menu/listbox chosen by purpose; shared entity-switcher CSS | Shared menu-popover behavior | Selected workspace explicit | Shared browser behavior; rich content semantics remain consumer-owned |
88
- | App shell — `src/shell/app-shell/app-shell.css` | Header/nav/main/aside landmarks, one main, app supplies skip link | Logical DOM order; no positive tabindex | Busy main does not indefinitely inert nav | Global focus/motion; landmarks manual |
89
- | Content frame — `src/shell/content-frame/content-frame.css` | Main/section with heading hierarchy | Normal order | Loading/error use pattern contracts | Noninteractive; heading audit manual |
90
- | Header — `src/shell/header/header.css` | Header landmark; labelled nav | Native controls and skip target | Expanded menus reflect state | Focus/target/forced; composition manual |
91
- | Mobile nav — `src/shell/mobile-nav/mobile-nav.css` | Labelled nav; current link; overlay version uses drawer contract | Native links; modal traps/restores | open/closed and isolation explicit | 40px/reduced motion; responsive redesign deferred |
92
- | Right-drawer compatibility - `@neetechs/ui/shell/right-drawer.css` | Deprecated classes/path map to canonical logical drawer; declare modal/nonmodal role | Shared drawer contract | Same modality/state rules | Migrate to inline-end drawer; nested overlay test covers canonical behavior |
93
- | Sidebar — `src/shell/sidebar/sidebar.css` | Labelled nav/aside; current link | Native links/disclosures | Collapsed items remain named | 40px/focus/forced; responsive deferred |
94
-
95
- ## 4. Keyboard interaction table
96
-
97
- | Pattern | Required keys |
98
- |---|---|
99
- | Button | Enter and Space through native behavior |
100
- | Link | Enter through native behavior |
101
- | Menu | Up/Down, Home/End, typeahead, Enter/Space, Escape; Tab exits rather than traps |
102
- | Tabs | Left/Right or Up/Down by orientation, Home/End; activation mode declared |
103
- | Modal dialog | Tab and Shift+Tab stay inside; Escape closes only when dismissal is allowed and only the top overlay |
104
- | Grid | Arrows; Home/End row bounds; Ctrl+Home/End grid bounds; consumer activation |
105
- | Calendar | Left/Right one day, Up/Down one week, Home/End week bounds |
106
- | Native form controls | Browser-native behavior; no duplicate activation handlers |
107
-
108
- ## 5. Focus management and overlays
109
-
110
- `ntCreateDialog` and modal `ntCreateDrawer` set role/name/description relationships, unhide before focus, isolate background branches with `inert`, lock scroll with reference counting, trap focus, and restore the connected invoker after inert state is removed. Overlay and focus stacks ensure Escape and Tab affect only the top nested overlay. `destroy()` removes listeners and locks.
111
-
112
- Initial focus should be the least destructive useful control, a heading/container for long content, or the first invalid field. Destructive confirmation is not the default. Nonmodal drawers use `modal: false` and `role: 'region'` or `'navigation'`; they do not trap or inert. Portaled overlays must keep the active modal/backdrop outside inert branches.
113
-
114
- ## 6. Forms, validation, and error summaries
115
-
116
- ```html
117
- <label id="email-label" for="email">Email <span aria-hidden="true">*</span></label>
118
- <input id="email" required aria-describedby="email-help email-error" aria-invalid="true">
119
- <p id="email-help">Use your work address.</p>
120
- <p id="email-error">Enter a valid email address.</p>
121
- ```
122
-
123
- `ntConnectField()` establishes stable IDs and relationships but cannot invent labels or recovery copy. Native `required`, `disabled`, and `readonly` remain authoritative where supported. Read-only fields remain readable/selectable and may stay focusable; disabled controls do not activate and ordinarily leave the Tab sequence.
124
-
125
- An error summary is a named region with heading and links to invalid fields. Reveal it, then call `ntFocusErrorSummary()`. Avoid combining focus movement with assertive announcement unless interruption is required. Password reveal controls name the action and state; clear buttons name the field; counters announce thresholds, not every keystroke.
126
-
127
- ## 7. Feedback, loading, and live regions
128
-
129
- - Routine success/update: `role=status`, `aria-live=polite`.
130
- - Immediate actionable failure: `role=alert`; not for static empty states.
131
- - Long operation: `aria-busy=true` on the affected region plus concise status text; batch progress.
132
- - Toasts never take focus automatically. Timed toasts pause while hovered/focused; critical content persists elsewhere.
133
- - Skeleton geometry is hidden from AT; a readable sibling communicates loading.
134
-
135
- Use `ntCreateAnnouncer()` for application messages and destroy it at teardown. `ntConfigureToastSemantics()` selects polite or assertive semantics intentionally. Use `ntCreateToastController()` when the package-owned DOM controls toast timers, dedupe, stack limits, pause-on-hover/focus, and cleanup.
136
-
137
- ## 8. Disabled, read-only, selected, and loading
138
-
139
- Disabled means unavailable/noninteractive; prefer native disabled. `aria-disabled=true` does not block events, so behavior must guard activation. Read-only means readable but not editable and must not look identical to disabled. Selected uses the owning pattern's selected/checked/pressed/current state and a boundary that survives forced colors. Focus remains distinct. Loading/pending is not disabled: it preserves the name, exposes busy, prevents repeat activation, and keeps focus stable. `ntCreateAsyncAction()` implements that contract for action controls.
140
-
141
- ## 9. Contrast and focus tokens
142
-
143
- Components consume `--nt-focus-ring-width`, `--nt-focus-ring-offset`, `--nt-focus-ring-color`, `--nt-focus-ring-danger`, and `--nt-focus-ring-inverse`. Target roles are `--nt-target-size-primary`, `--nt-target-size-default`, and `--nt-target-size-compact`.
144
-
145
- `scripts/check-accessibility.mjs` resolves 14 semantic pairs across light/dark and five accents (140 measurements). It enforces 4.5:1 text, 3:1 focus/control boundaries, rejects unsafe outline removal, and requires forced-colors/reduced-motion layers. It tests semantic contracts instead of brittle full CSS snapshots.
146
-
147
- ## 10. High contrast and forced colors
148
-
149
- Manual high contrast strengthens boundaries and disables shadow-only elevation. In forced colors, controls retain system boundaries, links use `LinkText`, selection/current state gains a `Highlight` outline, and icons inherit `currentColor`. `forced-color-adjust: none` is not used. Custom checkbox/radio/switch visuals preserve the native input and system state.
150
-
151
- ## 11. Reduced motion
152
-
153
- The central layer and component rules remove decorative lift, scale, spinner, long drawer/dialog travel, and smooth scrolling under system or manual reduced motion. Short color/state changes may remain. Loading retains text/busy feedback when animation stops.
154
-
155
- ## 12. Data-grid guidance
156
-
157
- Use a semantic table for read-only data. Use `ntCreateDataGrid()` only for spreadsheet-like 2-D navigation. It supplies roving focus, bounds navigation, selection callbacks, and sort announcements; applications define editing, selection model, virtualization, resize increments, and undo. Resize handles are named focusable controls with arrow increments and final announcements.
158
-
159
- ## 13. Calendar guidance
160
-
161
- `ntCreateCalendarGrid()` supplies one-tab-stop date navigation and range announcements. Dates/events need full spoken labels including date and time. Today is `aria-current=date`; selection is `aria-selected`; they are visually distinct. Category/availability/conflict needs non-color alternatives. Drag/drop and resize need host keyboard alternatives.
162
-
163
- ## 14. AI approval guidance
164
-
165
- Approval states what Neenee will do, which record/system changes, reversibility, confirmation requirement, and pending/success/failure result. Actions name consequences, such as “Approve and create event”. Safe/reject/review precedes destructive approval absent a documented reason. Purple identifies AI origin; status semantics describe consequences.
166
-
167
- ## 15. Correct and incorrect patterns
168
-
169
- Correct:
170
-
171
- ```html
172
- <button class="nt-icon-button" aria-label="Close invoice details">…</button>
173
- <button aria-expanded="false" aria-controls="account-menu">Account menu</button>
174
- ```
175
-
176
- Incorrect:
177
-
178
- ```html
179
- <div class="nt-button" onclick="save()">Save</div>
180
- <button class="nt-icon-button" title="Close">…</button>
181
- <input placeholder="Email">
182
- ```
183
-
184
- Do not add conflicting ARIA, positive tabindex, native-activation duplicates, alert roles on every error-looking block, or raw tool JSON as the only AI description.
185
-
186
- ## 16. Testing commands
187
-
188
- ```bash
189
- npm run check:tokens
190
- npm run check:a11y
191
- npm test
192
- npm run test:browser
193
- npm run build
194
- npm pack --dry-run
195
- ```
196
-
197
- Browser tests use Chromium, Playwright and `@axe-core/playwright`. Automation does not replace keyboard, zoom/reflow, forced-colors, speech input, switch control, or screen-reader tests.
198
-
199
- ## 17. Manual test checklist
200
-
201
- - Traverse journeys with Tab/Shift+Tab and pattern keys; verify focus/order.
202
- - Test modal nesting, containment, Escape ownership, restoration and isolation.
203
- - Test NVDA + Firefox/Chrome and VoiceOver + Safari for name/role/value/description/live timing.
204
- - Test 200% zoom and 400% reflow, text spacing, long Swedish labels, Arabic/mixed direction (RTL fixes deferred).
205
- - Test Windows High Contrast/forced colors; verify selection, error, icons and focus without background hue.
206
- - Test reduced motion, grid/calendar operations, form recovery, offline/error/loading and AI consequences.
207
- - Verify every image/icon, dynamic ID reference and composed application example.
208
-
209
- ## 18. Known limitations
210
-
211
- - Formal screen-reader interoperability and mobile gestures require manual application testing.
212
- - No complete combobox/command-palette controller is shipped; use a conforming implementation or native select.
213
- - Data-grid editing/resizing/virtualization remain application-specific; shared behavior covers navigation/selection/sort.
214
- - Calendar drag/resize/collision/time-grid navigation require host keyboard alternatives.
215
- - Tooltip lifecycle remains consumer-owned; toast timeout pause has a shared controller.
216
- - Responsive adaptation preserves accessibility invariants: content hidden by adaptive modes uses `display: none` (never focusable-but-invisible), table/record-list alternatives render one at a time, scrollable table regions carry `tabindex="0"` and an accessible name, coarse pointers expand compact controls to the documented target sizes, and hover-revealed actions stay visible on touch and keyboard (`.nt-hover-reveal` contract). See [responsive-and-adaptive-design.md](./responsive-and-adaptive-design.md).
217
- - State recovery still requires application-owned backend/router behavior; final product copy follows [content-and-terminology.md](./content-and-terminology.md).
218
- - Axe and semantic checks cover representative contracts, not every consumer content/color/image combination.
1
+ # Accessibility contract
2
+
3
+ Localization does not weaken this contract. Set correct `lang`/`dir`, provide complete accessible names in the active language, isolate technical values without changing their spoken label, and test visual keyboard order in RTL. Native Arabic screen-reader QA remains an application responsibility; see [localization-and-rtl.md](./localization-and-rtl.md).
4
+
5
+ `@neetechs/ui` targets WCAG 2.2 Level AA as its engineering baseline. This is not a certification: applications must still test their content, routing, framework integration, localization, screen-reader experience, and complete user journeys.
6
+
7
+ The package is CSS-first. CSS classes provide appearance; they cannot repair incorrect HTML. The behavior exports under `@neetechs/ui/behaviors` add only relationships and interactions that require JavaScript. Consumers remain responsible for meaningful labels and product-specific descriptions.
8
+
9
+ ## 1. Baseline requirements
10
+
11
+ - Normal text is at least 4.5:1; large text and meaningful non-text boundaries are at least 3:1.
12
+ - Keyboard focus uses `:focus-visible`, a 2px semantic ring, and a 2px offset. Never remove an outline without a replacement in the same rule.
13
+ - Primary and icon-only controls expose a 44×44px target. Dense contextual controls expose at least 40×40px. Inline text links, browser-native controls, tightly packed data points, and controls whose spacing provides an equivalent compound target are documented exceptions.
14
+ - Native HTML is preferred. Do not replace a `button`, `a`, `input`, `select`, `textarea`, `table`, `fieldset`, or heading with a generic element plus ARIA.
15
+ - Light/dark × orange/blue/green/purple/neutral semantic contrast is enforced by `npm run check:a11y`.
16
+ - High contrast and forced colors layer over light or dark. Reduced motion removes decorative travel/lift and preserves state feedback.
17
+
18
+ ## 2. Native HTML and accessible names
19
+
20
+ Use visible text as the accessible name whenever possible. Icon-only controls require a concise `aria-label` or associated visible label. `title` is supplementary, not the only naming strategy. Images use meaningful `alt`, empty `alt` when decorative, or a nearby text alternative for complex graphics. Decorative SVGs are `aria-hidden="true"`; meaningful SVGs inherit `currentColor` and are named by surrounding content.
21
+
22
+ Labels describe the control, while `aria-describedby` connects helper, constraint, consequence, and error copy. Placeholder text is never the only label. Do not repeat visible text in `aria-label`; that can override better content.
23
+
24
+ ## 3. Component accessibility inventory
25
+
26
+ Prompt 7 consolidation note: modal CSS and `ntCreateModal` now delegate to the canonical dialog implementation; the right-drawer path/classes delegate to canonical logical drawer CSS; company/workspace switchers share one visual source and the menu-popover behavior. These compatibility names do not define separate accessibility contracts. The table export is now a styled native-table contract and remains intentionally separate from the interactive data grid. See [component-architecture.md](./component-architecture.md).
27
+
28
+ Prompt 8 state note: operation state now uses native semantics plus `data-nt-state` where needed; content-region state uses `data-nt-content-state`; legacy `--loading`, `--error`, and `--success` modifiers are styling compatibility hooks. See [states-feedback-and-recovery.md](./states-feedback-and-recovery.md).
29
+
30
+ The inventory covers all 59 shipped UI/domain CSS modules. “Gallery” means the representative Playwright/axe contract gallery; “manual” identifies an application-level check still required.
31
+
32
+ | Component and source | Semantic/name contract | Keyboard and focus | State/feedback contract | Target, modes, coverage and residual risk |
33
+ |---|---|---|---|---|
34
+ | Alert — `src/components/alert/alert.css` | Static notice: section/region; urgent dynamic error: `role=alert`; routine update: `role=status`; heading names region | Actions are native controls; no container tab stop | Severity is text/icon plus color; recovery action is named | Actions 40/44; forced-color border; gallery. Urgency choice remains manual |
35
+ | Avatar — `src/components/avatar/avatar.css` | Decorative avatar has empty alt/hidden initials; informative image has person/org name | Not focusable unless a native link/button wrapper | Presence/status needs text alternative | CurrentColor boundary; manual image-alt review |
36
+ | Badge — `src/components/badge/badge.css` | Text span; status role only for a dynamic update | Not focusable unless interactive variant is a button | Status wording must not rely on hue | Forced-color boundary; semantic contrast; manual copy review |
37
+ | Breadcrumb — `src/components/breadcrumb/breadcrumb.css` | `nav aria-label="Breadcrumb"`, ordered list, current item `aria-current=page` | Native links; visible focus | Current page is not a dead unlabeled link | Inline-link target exception; structure manual |
38
+ | Button — `src/components/button/button.css` | Native `button`; visible text is name; busy keeps original name and uses `aria-busy` | Native Enter/Space; no redundant handlers | Native `disabled`; `aria-disabled` requires activation guard; loading prevents repeat | Primary 44; focus/contrast/motion/forced colors tested |
39
+ | Card — `src/components/card/card.css` | Article/section only with a heading; clickable card uses one real link/button, not nested controls | Only actual actions focus | Selected cards use `aria-selected` only in a selection widget | Reduced lift; selected outline in forced colors; structure manual |
40
+ | Checkbox — `src/components/checkbox/checkbox.css` | Native checkbox inside label; groups use fieldset/legend | Native Space | `checked`, `indeterminate`, `disabled`, required/error on input | 40px row; system-color forced mode; gallery/axe |
41
+ | Chip — `src/components/chip/chip.css` | Static tag is text; removable/choice chip uses native button and named remove action | Native activation; composite owner manages arrows | `aria-pressed`/`aria-selected`; disabled guard | 40px interactive target; composite behavior app-owned |
42
+ | Data grid — `src/components/data-grid/data-grid.css`, `src/behaviors/data-grid.ts` | Prefer semantic table. Opt-in `role=grid` only for 2-D interaction; headers name columns; help describes keys | Roving arrows, Home/End, Ctrl+Home/End, activation callback | `aria-sort`, `aria-selected`, disabled; polite sort live region | Visible focus/selection; browser tested. Editing/resize policy app-specific |
43
+ | Dialog — `src/components/dialog/dialog.css`, `src/behaviors/dialog.ts` | Dialog role/modal state/title and optional description references | Intentional initial focus, Tab trap, Escape if dismissible, restore invoker | Background inert, scroll locked, hidden closed, nested-stack aware | Boundary/focus forced colors; nested browser test; SR manual |
44
+ | Drawer — `src/components/drawer/drawer.css`, `src/behaviors/drawer.ts` | Explicit modal dialog or nonmodal region/navigation | Modal traps/restores; nonmodal follows page order; top overlay owns Escape | Modal background inert; role/modal match declared modality | Reduced travel/forced boundary; nested browser test |
45
+ | Dropdown — `src/components/dropdown/dropdown.css`, `src/behaviors/dropdown.ts` | Trigger button with popup/expanded/controls; content is menu or listbox, not both | Arrow open/navigation, Home/End, typeahead, activation, Escape returns trigger; no Tab trap | Disabled items skipped/blocked; closed content hidden | Items 40px; browser tested. Listbox value sync consumer-owned |
46
+ | Icon button — `src/components/icon-button/icon-button.css` | Native button with required accessible name | Native activation; visible focus | Disabled/loading as button | 44px default, 40px compact; browser measured |
47
+ | Input — `src/components/input/input.css`, `src/behaviors/forms.ts` | Visible label; stable help/error IDs | Native editing and focus | required, invalid, disabled, readonly, busy distinct | 40px minimum; contrast/focus/axe |
48
+ | Menu — `src/components/menu/menu.css`, dropdown behavior | Menu only for application commands; navigation remains nav/links | Up/Down, Home/End, typeahead, activation, Escape; no Tab trap | Disabled items skipped/blocked; checked command roles where needed | 40px; browser tested through dropdown |
49
+ | Modal compatibility - `@neetechs/ui/components/modal.css`, `ntCreateModal` | Deprecated aliases to canonical dialog CSS/behavior; identical naming requirement | Same canonical trap/restore contract | Adapter forces `modal: true`; no second focus manager | Architecture-tested; migrate to dialog before 1.0 |
50
+ | Pagination — `src/components/pagination/pagination.css` | Labelled nav; native links/buttons; current page `aria-current=page` | Native activation/sequence | Disabled previous/next native or non-link text | 40×40; forced selected outline; structure manual |
51
+ | Panel — `src/components/panel/panel.css` | Section/aside only when landmark/heading is useful | Actions only | Loading may set `aria-busy` on panel | Semantic boundary; structure manual |
52
+ | Progress — `src/components/progress/progress.css` | Native progress or named progressbar with value/min/max; indeterminate has status text | Not focusable | Announce milestones, not every frame | Motion reduced without losing state; cadence manual |
53
+ | Radio — `src/components/radio/radio.css` | Native radios in fieldset/legend | Native arrows/Space | checked/disabled/required/error on input | 40px row; forced colors; gallery/axe |
54
+ | Segmented control — `src/components/segmented-control/segmented-control.css` | Radio group for exclusive value or toolbar of buttons for commands; label group | Native radios or documented roving behavior | checked/pressed/disabled explicit | Focus/selected distinct; role choice manual |
55
+ | Select — `src/components/select/select.css` | Native label + select unless complete combobox implemented | Native browser behavior | disabled/required/invalid; native select has no readonly | 40px; contrast/focus/axe |
56
+ | Skeleton — `src/components/skeleton/skeleton.css` | Decorative skeleton hidden; containing region busy with readable status | Not focusable | Real content replaces skeleton; no repeated announcements | Animation suppressed; gallery loading pattern |
57
+ | Split button — `src/components/split-button/split-button.css` | Two named native buttons: action and disclosure | Native action; disclosure follows menu contract | Disabled/loading coherent across both | 40/44 by action; composition manual |
58
+ | Switch — `src/components/switch/switch.css` | Prefer native checkbox; custom switch requires checked state and label | Native Space | checked/disabled; no mixed state | 40px row; forced colors; gallery/axe |
59
+ | Table — `src/components/table/table.css` | Native table/caption/scope headers; no grid role for display-only data | Standard AT table navigation | Sort buttons inside headers and announce state | Overflow response deferred; markup manual |
60
+ | Tabs — `src/components/tabs/tabs.css`, `src/behaviors/tabs.ts` | tablist/tab/tabpanel with generated controls/labelledby IDs | Orientation arrows, Home/End, one tab stop; automatic/manual declared | selected/disabled/hidden panel synchronized | 40px; focus/forced selection; browser tested |
61
+ | Textarea — `src/components/textarea/textarea.css` | Visible label and descriptions | Native editing | readonly readable/focusable; disabled/invalid distinct | 40px; contrast/focus/axe |
62
+ | Toast — `src/components/toast/toast.css`, `src/behaviors/announcer.ts` | Routine status; urgent error alert; named close | No automatic focus; close keyboard accessible; timed toast pauses hover/focus | Critical content persists; status wording explicit | Gallery semantics; `ntCreateToastController` covers timers, dedupe, stack limit, pause, and cleanup |
63
+ | Tooltip — `src/components/tooltip/tooltip.css` | Tooltip role/stable describedby; never sole essential content | Opens focus/hover; Escape dismissal when behavior exists; no interactive children | Hidden tooltip not exposed | Reduced motion/forced text; lifecycle consumer-owned |
64
+ | AI action button — `src/ai/ai-action-button/ai-action-button.css` | Named native button; name states action, not only “AI” | Native activation | Busy preserves name, blocks repeat, exposes status | 44px; independent AI contrast; reduced motion |
65
+ | AI approval card — `src/ai/ai-approval-card/ai-approval-card.css` | Heading names card; description states intent, target, consequence, reversibility | Native reject/approve; safe action first | Pending/status polite; confirmation/success/failure explicit | Gallery/axe/actions; product copy/workflow manual |
66
+ | AI conversation panel — `src/ai/ai-conversation-panel/ai-conversation-panel.css` | Named region/log; messages identify speaker; streaming status separate | Normal document/controls order | New content polite/batched; do not reread transcript | Streaming behavior app-owned |
67
+ | AI prompt input — `src/ai/ai-prompt-input/ai-prompt-input.css` | Labelled textarea/input; named send/attachment | Native editing; multiline Enter preserved unless policy declared | Busy/error/counter associated without chatter | Controls 40/44; policy manual |
68
+ | AI proposal card — `src/ai/ai-proposal-card/ai-proposal-card.css` | Heading + proposal description; buttons name consequences | Native actions | Approval not inferred from purple; explicit status | Focus/contrast; workflow manual |
69
+ | AI suggestion card — `src/ai/ai-suggestion-card/ai-suggestion-card.css` | List/article with descriptive suggestion action | Native action; owning widget handles arrows if selection composite | Accepted/rejected text plus status | Focus/selection/contrast; list behavior manual |
70
+ | AI tool call — `src/ai/ai-tool-call/ai-tool-call.css` | Human-readable operation/target/status; raw JSON optional detail | Disclosure button for collapsed detail | Running/success/failure at meaningful transitions | Status contrast; descriptions manual |
71
+ | Billing — `src/domain/billing/index.css` | Semantic tables/lists/forms; amounts include currency/sign in text | Native actions/table navigation | Financial sign never color-only; errors use form contract | Financial tokens; localization audit deferred |
72
+ | Companies — `src/domain/companies/index.css` | Named company list/region; logos follow avatar rules; actions are native | Native list actions; switcher menu uses shared behavior | Active company, role, permission, and availability use text/ARIA plus visual state | Focus/target/forced colors; product permissions and names manual |
73
+ | Calendar day slice — `src/domain/calendar/day-slice/day-slice.css` | Named time-grid; events named with title/time | Application declares arrows or normal Tab, not both | Current/selected time text/ARIA, not color only | Focus/forced/reduced; core grid browser tested |
74
+ | Calendar timeline — `src/domain/calendar/day-timeline/day-timeline.css` | Time labels/events expose start/end | Event keyboard path documented by app | Current time/category needs non-color text | Drag/resize keyboard alternative app-specific |
75
+ | Calendar event card — `src/domain/calendar/event-card/event-card.css` | Native link/button with event name/time/category | Native activation; menu uses shared behavior | selected/current/cancelled text/ARIA plus visual | 44 primary; compact context exception; copy manual |
76
+ | Calendar month grid — `src/domain/calendar/month-grid/month-grid.css`, calendar behavior | Grid rows/cells; full date spoken label; today current date | ±1/±7 arrows, Home/End, one tab stop | selection state; range polite live region | 44px behavior hook; browser tested |
77
+ | Calendar week grid — `src/domain/calendar/week-grid/week-grid.css`, calendar behavior | Named grid/time-grid and full event names | Declared grid or event Tab model | current/selected not color-only | Focus/forced; complex navigation manual |
78
+ | Command palette — `src/patterns/command-palette/command-palette.css` | Modal dialog with labelled combobox/listbox | Input arrows/Home/End/Enter/Escape; modal trap/restore | Loading/empty readable; active descendant when input retains focus | Complete combobox controller is a known limitation |
79
+ | Company switcher — `src/patterns/company-switcher/company-switcher.css` | Disclosure + menu/listbox chosen by command vs value | Shared dropdown keyboard | Selected company/unavailable explicit | 40px/shared browser behavior; content manual |
80
+ | Content state — `src/patterns/content-state/content-state.css` | Heading/description/native recovery; urgency chosen by context | Native action; no automatic focus unless recovering from failed submission | `data-nt-content-state` differentiates loading, empty, error, offline, permission, not-found, maintenance, success | Target/focus/contrast/RTL; manual content |
81
+ | Empty state — `src/patterns/empty-state/empty-state.css` | Legacy pattern over content-state guidance; heading/description/native recovery; no alert | Native action | Static absence is not urgent | Compatible; prefer `.nt-content-state` for new work |
82
+ | Error state — `src/patterns/error-state/error-state.css` | Legacy pattern over content-state guidance; heading/recovery/action; alert only dynamically urgent | Native action | Reason/recovery not icon/color only | Compatible; prefer `.nt-content-state` for new work |
83
+ | Loading state — `src/patterns/loading-state/loading-state.css` | Legacy pattern over content-state guidance; named status; affected region busy; skeleton hidden | Do not move/strand focus | Announce start/end or milestones only | Compatible; prefer `.nt-content-state` for new work |
84
+ | Notification center — `src/patterns/notification-center/notification-center.css` | Named region/list; item heading/time/read state | Native actions; optional menu shared | Unread text/ARIA plus color; updates polite | Focus/forced color; update behavior manual |
85
+ | Profile menu — `src/patterns/profile-menu/profile-menu.css` | Trigger + command menu | Shared dropdown menu | Disabled/current account explicit | Shared browser menu; names manual |
86
+ | Search bar — `src/patterns/search-bar/search-bar.css` | Search landmark/form, labelled input, named clear/submit | Native editing/submission; Escape clear only if declared | Loading/results count polite; clear updates value | Focus/targets; results combobox not provided |
87
+ | Workspace switcher - `@neetechs/ui/patterns/workspace-switcher.css` | Disclosure + menu/listbox chosen by purpose; shared entity-switcher CSS | Shared menu-popover behavior | Selected workspace explicit | Shared browser behavior; rich content semantics remain consumer-owned |
88
+ | App shell — `src/shell/app-shell/app-shell.css` | Header/nav/main/aside landmarks, one main, app supplies skip link | Logical DOM order; no positive tabindex | Busy main does not indefinitely inert nav | Global focus/motion; landmarks manual |
89
+ | Content frame — `src/shell/content-frame/content-frame.css` | Main/section with heading hierarchy | Normal order | Loading/error use pattern contracts | Noninteractive; heading audit manual |
90
+ | Header — `src/shell/header/header.css` | Header landmark; labelled nav | Native controls and skip target | Expanded menus reflect state | Focus/target/forced; composition manual |
91
+ | Mobile nav — `src/shell/mobile-nav/mobile-nav.css` | Labelled nav; current link; overlay version uses drawer contract | Native links; modal traps/restores | open/closed and isolation explicit | 40px/reduced motion; responsive redesign deferred |
92
+ | Right-drawer compatibility - `@neetechs/ui/shell/right-drawer.css` | Deprecated classes/path map to canonical logical drawer; declare modal/nonmodal role | Shared drawer contract | Same modality/state rules | Migrate to inline-end drawer; nested overlay test covers canonical behavior |
93
+ | Sidebar — `src/shell/sidebar/sidebar.css` | Labelled nav/aside; current link | Native links/disclosures | Collapsed items remain named | 40px/focus/forced; responsive deferred |
94
+
95
+ ## 4. Keyboard interaction table
96
+
97
+ | Pattern | Required keys |
98
+ |---|---|
99
+ | Button | Enter and Space through native behavior |
100
+ | Link | Enter through native behavior |
101
+ | Menu | Up/Down, Home/End, typeahead, Enter/Space, Escape; Tab exits rather than traps |
102
+ | Tabs | Left/Right or Up/Down by orientation, Home/End; activation mode declared |
103
+ | Modal dialog | Tab and Shift+Tab stay inside; Escape closes only when dismissal is allowed and only the top overlay |
104
+ | Grid | Arrows; Home/End row bounds; Ctrl+Home/End grid bounds; consumer activation |
105
+ | Calendar | Left/Right one day, Up/Down one week, Home/End week bounds |
106
+ | Native form controls | Browser-native behavior; no duplicate activation handlers |
107
+
108
+ ## 5. Focus management and overlays
109
+
110
+ `ntCreateDialog` and modal `ntCreateDrawer` set role/name/description relationships, unhide before focus, isolate background branches with `inert`, lock scroll with reference counting, trap focus, and restore the connected invoker after inert state is removed. Overlay and focus stacks ensure Escape and Tab affect only the top nested overlay. `destroy()` removes listeners and locks.
111
+
112
+ Initial focus should be the least destructive useful control, a heading/container for long content, or the first invalid field. Destructive confirmation is not the default. Nonmodal drawers use `modal: false` and `role: 'region'` or `'navigation'`; they do not trap or inert. Portaled overlays must keep the active modal/backdrop outside inert branches.
113
+
114
+ ## 6. Forms, validation, and error summaries
115
+
116
+ ```html
117
+ <label id="email-label" for="email">Email <span aria-hidden="true">*</span></label>
118
+ <input id="email" required aria-describedby="email-help email-error" aria-invalid="true">
119
+ <p id="email-help">Use your work address.</p>
120
+ <p id="email-error">Enter a valid email address.</p>
121
+ ```
122
+
123
+ `ntConnectField()` establishes stable IDs and relationships but cannot invent labels or recovery copy. Native `required`, `disabled`, and `readonly` remain authoritative where supported. Read-only fields remain readable/selectable and may stay focusable; disabled controls do not activate and ordinarily leave the Tab sequence.
124
+
125
+ An error summary is a named region with heading and links to invalid fields. Reveal it, then call `ntFocusErrorSummary()`. Avoid combining focus movement with assertive announcement unless interruption is required. Password reveal controls name the action and state; clear buttons name the field; counters announce thresholds, not every keystroke.
126
+
127
+ ## 7. Feedback, loading, and live regions
128
+
129
+ - Routine success/update: `role=status`, `aria-live=polite`.
130
+ - Immediate actionable failure: `role=alert`; not for static empty states.
131
+ - Long operation: `aria-busy=true` on the affected region plus concise status text; batch progress.
132
+ - Toasts never take focus automatically. Timed toasts pause while hovered/focused; critical content persists elsewhere.
133
+ - Skeleton geometry is hidden from AT; a readable sibling communicates loading.
134
+
135
+ Use `ntCreateAnnouncer()` for application messages and destroy it at teardown. `ntConfigureToastSemantics()` selects polite or assertive semantics intentionally. Use `ntCreateToastController()` when the package-owned DOM controls toast timers, dedupe, stack limits, pause-on-hover/focus, and cleanup.
136
+
137
+ ## 8. Disabled, read-only, selected, and loading
138
+
139
+ Disabled means unavailable/noninteractive; prefer native disabled. `aria-disabled=true` does not block events, so behavior must guard activation. Read-only means readable but not editable and must not look identical to disabled. Selected uses the owning pattern's selected/checked/pressed/current state and a boundary that survives forced colors. Focus remains distinct. Loading/pending is not disabled: it preserves the name, exposes busy, prevents repeat activation, and keeps focus stable. `ntCreateAsyncAction()` implements that contract for action controls.
140
+
141
+ ## 9. Contrast and focus tokens
142
+
143
+ Components consume `--nt-focus-ring-width`, `--nt-focus-ring-offset`, `--nt-focus-ring-color`, `--nt-focus-ring-danger`, and `--nt-focus-ring-inverse`. Target roles are `--nt-target-size-primary`, `--nt-target-size-default`, and `--nt-target-size-compact`.
144
+
145
+ `scripts/check-accessibility.mjs` resolves 14 semantic pairs across light/dark and five accents (140 measurements). It enforces 4.5:1 text, 3:1 focus/control boundaries, rejects unsafe outline removal, and requires forced-colors/reduced-motion layers. It tests semantic contracts instead of brittle full CSS snapshots.
146
+
147
+ ## 10. High contrast and forced colors
148
+
149
+ Manual high contrast strengthens boundaries and disables shadow-only elevation. In forced colors, controls retain system boundaries, links use `LinkText`, selection/current state gains a `Highlight` outline, and icons inherit `currentColor`. `forced-color-adjust: none` is not used. Custom checkbox/radio/switch visuals preserve the native input and system state.
150
+
151
+ ## 11. Reduced motion
152
+
153
+ The central layer and component rules remove decorative lift, scale, spinner, long drawer/dialog travel, and smooth scrolling under system or manual reduced motion. Short color/state changes may remain. Loading retains text/busy feedback when animation stops.
154
+
155
+ ## 12. Data-grid guidance
156
+
157
+ Use a semantic table for read-only data. Use `ntCreateDataGrid()` only for spreadsheet-like 2-D navigation. It supplies roving focus, bounds navigation, selection callbacks, and sort announcements; applications define editing, selection model, virtualization, resize increments, and undo. Resize handles are named focusable controls with arrow increments and final announcements.
158
+
159
+ ## 13. Calendar guidance
160
+
161
+ `ntCreateCalendarGrid()` supplies one-tab-stop date navigation and range announcements. Dates/events need full spoken labels including date and time. Today is `aria-current=date`; selection is `aria-selected`; they are visually distinct. Category/availability/conflict needs non-color alternatives. Drag/drop and resize need host keyboard alternatives.
162
+
163
+ ## 14. AI approval guidance
164
+
165
+ Approval states what Neenee will do, which record/system changes, reversibility, confirmation requirement, and pending/success/failure result. Actions name consequences, such as “Approve and create event”. Safe/reject/review precedes destructive approval absent a documented reason. Purple identifies AI origin; status semantics describe consequences.
166
+
167
+ ## 15. Correct and incorrect patterns
168
+
169
+ Correct:
170
+
171
+ ```html
172
+ <button class="nt-icon-button" aria-label="Close invoice details">…</button>
173
+ <button aria-expanded="false" aria-controls="account-menu">Account menu</button>
174
+ ```
175
+
176
+ Incorrect:
177
+
178
+ ```html
179
+ <div class="nt-button" onclick="save()">Save</div>
180
+ <button class="nt-icon-button" title="Close">…</button>
181
+ <input placeholder="Email">
182
+ ```
183
+
184
+ Do not add conflicting ARIA, positive tabindex, native-activation duplicates, alert roles on every error-looking block, or raw tool JSON as the only AI description.
185
+
186
+ ## 16. Testing commands
187
+
188
+ ```bash
189
+ npm run check:tokens
190
+ npm run check:a11y
191
+ npm test
192
+ npm run test:browser
193
+ npm run build
194
+ npm pack --dry-run
195
+ ```
196
+
197
+ Browser tests use Chromium, Playwright and `@axe-core/playwright`. Automation does not replace keyboard, zoom/reflow, forced-colors, speech input, switch control, or screen-reader tests.
198
+
199
+ ## 17. Manual test checklist
200
+
201
+ - Traverse journeys with Tab/Shift+Tab and pattern keys; verify focus/order.
202
+ - Test modal nesting, containment, Escape ownership, restoration and isolation.
203
+ - Test NVDA + Firefox/Chrome and VoiceOver + Safari for name/role/value/description/live timing.
204
+ - Test 200% zoom and 400% reflow, text spacing, long Swedish labels, Arabic/mixed direction (RTL fixes deferred).
205
+ - Test Windows High Contrast/forced colors; verify selection, error, icons and focus without background hue.
206
+ - Test reduced motion, grid/calendar operations, form recovery, offline/error/loading and AI consequences.
207
+ - Verify every image/icon, dynamic ID reference and composed application example.
208
+
209
+ ## 18. Known limitations
210
+
211
+ - Formal screen-reader interoperability and mobile gestures require manual application testing.
212
+ - No complete combobox/command-palette controller is shipped; use a conforming implementation or native select.
213
+ - Data-grid editing/resizing/virtualization remain application-specific; shared behavior covers navigation/selection/sort.
214
+ - Calendar drag/resize/collision/time-grid navigation require host keyboard alternatives.
215
+ - Tooltip lifecycle remains consumer-owned; toast timeout pause has a shared controller.
216
+ - Responsive adaptation preserves accessibility invariants: content hidden by adaptive modes uses `display: none` (never focusable-but-invisible), table/record-list alternatives render one at a time, scrollable table regions carry `tabindex="0"` and an accessible name, coarse pointers expand compact controls to the documented target sizes, and hover-revealed actions stay visible on touch and keyboard (`.nt-hover-reveal` contract). See [responsive-and-adaptive-design.md](./responsive-and-adaptive-design.md).
217
+ - State recovery still requires application-owned backend/router behavior; final product copy follows [content-and-terminology.md](./content-and-terminology.md).
218
+ - Axe and semantic checks cover representative contracts, not every consumer content/color/image combination.