@neetechs/ui 0.0.2 → 0.0.4

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 (330) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +123 -11
  3. package/dist/ai/ai-action-button/ai-action-button.css +271 -270
  4. package/dist/ai/ai-approval-card/ai-approval-card.css +323 -320
  5. package/dist/ai/ai-conversation-panel/ai-conversation-panel.css +447 -403
  6. package/dist/ai/ai-prompt-input/ai-prompt-input.css +380 -377
  7. package/dist/ai/ai-proposal-card/ai-proposal-card.css +358 -358
  8. package/dist/ai/ai-suggestion-card/ai-suggestion-card.css +295 -293
  9. package/dist/ai/ai-tool-call/ai-tool-call.css +256 -255
  10. package/dist/ai/index.css +1 -1
  11. package/dist/appearance/cache.d.ts +55 -0
  12. package/dist/appearance/cache.d.ts.map +1 -0
  13. package/dist/appearance/cache.js +182 -0
  14. package/dist/appearance/cache.js.map +1 -0
  15. package/dist/appearance/cookie.d.ts +33 -0
  16. package/dist/appearance/cookie.d.ts.map +1 -0
  17. package/dist/appearance/cookie.js +125 -0
  18. package/dist/appearance/cookie.js.map +1 -0
  19. package/dist/appearance/index.d.ts +9 -0
  20. package/dist/appearance/index.d.ts.map +1 -0
  21. package/dist/appearance/index.js +5 -0
  22. package/dist/appearance/index.js.map +1 -0
  23. package/dist/appearance/preference.d.ts +21 -0
  24. package/dist/appearance/preference.d.ts.map +1 -0
  25. package/dist/appearance/preference.js +80 -0
  26. package/dist/appearance/preference.js.map +1 -0
  27. package/dist/appearance/theme-controller.d.ts +62 -0
  28. package/dist/appearance/theme-controller.d.ts.map +1 -0
  29. package/dist/appearance/theme-controller.js +240 -0
  30. package/dist/appearance/theme-controller.js.map +1 -0
  31. package/dist/appearance/types.d.ts +48 -0
  32. package/dist/appearance/types.d.ts.map +1 -0
  33. package/dist/appearance/types.js +2 -0
  34. package/dist/appearance/types.js.map +1 -0
  35. package/dist/behaviors/announcer.d.ts +34 -0
  36. package/dist/behaviors/announcer.d.ts.map +1 -0
  37. package/dist/behaviors/announcer.js +150 -0
  38. package/dist/behaviors/announcer.js.map +1 -0
  39. package/dist/behaviors/calendar.d.ts +15 -0
  40. package/dist/behaviors/calendar.d.ts.map +1 -0
  41. package/dist/behaviors/calendar.js +77 -0
  42. package/dist/behaviors/calendar.js.map +1 -0
  43. package/dist/behaviors/data-grid.d.ts +18 -0
  44. package/dist/behaviors/data-grid.d.ts.map +1 -0
  45. package/dist/behaviors/data-grid.js +114 -0
  46. package/dist/behaviors/data-grid.js.map +1 -0
  47. package/dist/behaviors/dialog.d.ts +14 -0
  48. package/dist/behaviors/dialog.d.ts.map +1 -1
  49. package/dist/behaviors/dialog.js +24 -6
  50. package/dist/behaviors/dialog.js.map +1 -1
  51. package/dist/behaviors/direction.d.ts +10 -0
  52. package/dist/behaviors/direction.d.ts.map +1 -0
  53. package/dist/behaviors/direction.js +24 -0
  54. package/dist/behaviors/direction.js.map +1 -0
  55. package/dist/behaviors/drawer.d.ts +15 -3
  56. package/dist/behaviors/drawer.d.ts.map +1 -1
  57. package/dist/behaviors/drawer.js +25 -10
  58. package/dist/behaviors/drawer.js.map +1 -1
  59. package/dist/behaviors/dropdown.d.ts +11 -0
  60. package/dist/behaviors/dropdown.d.ts.map +1 -1
  61. package/dist/behaviors/dropdown.js +53 -11
  62. package/dist/behaviors/dropdown.js.map +1 -1
  63. package/dist/behaviors/focus-trap.d.ts.map +1 -1
  64. package/dist/behaviors/focus-trap.js +45 -5
  65. package/dist/behaviors/focus-trap.js.map +1 -1
  66. package/dist/behaviors/forms.d.ts +32 -0
  67. package/dist/behaviors/forms.d.ts.map +1 -0
  68. package/dist/behaviors/forms.js +147 -0
  69. package/dist/behaviors/forms.js.map +1 -0
  70. package/dist/behaviors/index.d.ts +8 -0
  71. package/dist/behaviors/index.d.ts.map +1 -1
  72. package/dist/behaviors/index.js +8 -0
  73. package/dist/behaviors/index.js.map +1 -1
  74. package/dist/behaviors/keyboard.d.ts.map +1 -1
  75. package/dist/behaviors/keyboard.js +4 -2
  76. package/dist/behaviors/keyboard.js.map +1 -1
  77. package/dist/behaviors/overlay.d.ts +6 -0
  78. package/dist/behaviors/overlay.d.ts.map +1 -1
  79. package/dist/behaviors/overlay.js +93 -3
  80. package/dist/behaviors/overlay.js.map +1 -1
  81. package/dist/behaviors/state.d.ts +49 -0
  82. package/dist/behaviors/state.d.ts.map +1 -0
  83. package/dist/behaviors/state.js +220 -0
  84. package/dist/behaviors/state.js.map +1 -0
  85. package/dist/behaviors/tabs.d.ts +18 -0
  86. package/dist/behaviors/tabs.d.ts.map +1 -0
  87. package/dist/behaviors/tabs.js +103 -0
  88. package/dist/behaviors/tabs.js.map +1 -0
  89. package/dist/behaviors/viewport.d.ts +40 -0
  90. package/dist/behaviors/viewport.d.ts.map +1 -0
  91. package/dist/behaviors/viewport.js +47 -0
  92. package/dist/behaviors/viewport.js.map +1 -0
  93. package/dist/components/alert/alert.css +220 -217
  94. package/dist/components/avatar/avatar.css +220 -219
  95. package/dist/components/badge/badge.css +174 -174
  96. package/dist/components/breadcrumb/breadcrumb.css +207 -205
  97. package/dist/components/button/button.css +195 -167
  98. package/dist/components/card/card.css +221 -220
  99. package/dist/components/checkbox/checkbox.css +189 -187
  100. package/dist/components/chip/chip.css +269 -267
  101. package/dist/components/data-grid/data-grid.css +520 -369
  102. package/dist/components/dialog/dialog.css +339 -275
  103. package/dist/components/drawer/drawer.css +484 -403
  104. package/dist/components/dropdown/dropdown.css +316 -298
  105. package/dist/components/icon-button/icon-button.css +162 -158
  106. package/dist/components/index.css +1 -2
  107. package/dist/components/input/input.css +163 -163
  108. package/dist/components/menu/menu.css +315 -314
  109. package/dist/components/pagination/pagination.css +250 -249
  110. package/dist/components/panel/panel.css +284 -283
  111. package/dist/components/progress/progress.css +256 -248
  112. package/dist/components/radio/radio.css +166 -164
  113. package/dist/components/segmented-control/segmented-control.css +205 -205
  114. package/dist/components/select/select.css +117 -103
  115. package/dist/components/skeleton/skeleton.css +262 -262
  116. package/dist/components/split-button/split-button.css +292 -285
  117. package/dist/components/switch/switch.css +195 -181
  118. package/dist/components/table/table.css +220 -0
  119. package/dist/components/tabs/tabs.css +293 -289
  120. package/dist/components/textarea/textarea.css +86 -86
  121. package/dist/components/toast/toast.css +345 -323
  122. package/dist/components/tooltip/tooltip.css +258 -255
  123. package/dist/domain/billing/index.css +498 -498
  124. package/dist/domain/calendar/agenda-list/agenda-list.css +224 -0
  125. package/dist/domain/calendar/day-slice/day-slice.css +384 -383
  126. package/dist/domain/calendar/day-timeline/day-timeline.css +332 -324
  127. package/dist/domain/calendar/event-card/event-card.css +338 -336
  128. package/dist/domain/calendar/index.css +2 -1
  129. package/dist/domain/calendar/month-grid/month-grid.css +426 -420
  130. package/dist/domain/calendar/week-grid/week-grid.css +480 -470
  131. package/dist/domain/companies/index.css +526 -525
  132. package/dist/index.css +5 -5
  133. package/dist/index.d.ts +3 -1
  134. package/dist/index.d.ts.map +1 -1
  135. package/dist/index.js +3 -1
  136. package/dist/index.js.map +1 -1
  137. package/dist/localization/index.d.ts +8 -0
  138. package/dist/localization/index.d.ts.map +1 -0
  139. package/dist/localization/index.js +22 -0
  140. package/dist/localization/index.js.map +1 -0
  141. package/dist/patterns/command-palette/command-palette.css +447 -439
  142. package/dist/patterns/company-switcher/company-switcher.css +390 -363
  143. package/dist/patterns/content-state/content-state.css +236 -0
  144. package/dist/patterns/empty-state/empty-state.css +260 -259
  145. package/dist/patterns/error-state/error-state.css +272 -271
  146. package/dist/patterns/form-layout/form-layout.css +106 -0
  147. package/dist/patterns/index.css +8 -3
  148. package/dist/patterns/loading-state/loading-state.css +287 -287
  149. package/dist/patterns/master-detail/master-detail.css +103 -0
  150. package/dist/patterns/notification-center/notification-center.css +443 -438
  151. package/dist/patterns/page/page.css +219 -0
  152. package/dist/patterns/profile-menu/profile-menu.css +298 -297
  153. package/dist/patterns/search-bar/search-bar.css +457 -444
  154. package/dist/patterns/settings-layout/settings-layout.css +150 -0
  155. package/dist/patterns/workflow/workflow.css +168 -0
  156. package/dist/shell/app-shell/app-shell.css +74 -67
  157. package/dist/shell/content-frame/content-frame.css +93 -93
  158. package/dist/shell/header/header.css +180 -178
  159. package/dist/shell/index.css +6 -6
  160. package/dist/shell/mobile-nav/mobile-nav.css +173 -171
  161. package/dist/shell/sidebar/sidebar.css +146 -146
  162. package/dist/styles/accessibility.css +116 -0
  163. package/dist/styles/animations/motion.css +162 -162
  164. package/dist/styles/appearance/accent.css +173 -0
  165. package/dist/styles/appearance/density.css +61 -0
  166. package/dist/styles/appearance/motion.css +40 -0
  167. package/dist/styles/base.css +83 -82
  168. package/dist/styles/index.css +8 -1
  169. package/dist/styles/localization.css +56 -0
  170. package/dist/styles/reset.css +51 -50
  171. package/dist/styles/responsive.css +101 -0
  172. package/dist/styles/themes/dark.css +202 -120
  173. package/dist/styles/themes/high-contrast.css +290 -119
  174. package/dist/styles/themes/light.css +201 -119
  175. package/dist/styles/tokens/breakpoints.css +37 -15
  176. package/dist/styles/tokens/color.css +96 -96
  177. package/dist/styles/tokens/compatibility.css +33 -0
  178. package/dist/styles/tokens/elevation.css +26 -32
  179. package/dist/styles/tokens/index.css +2 -1
  180. package/dist/styles/tokens/motion.css +35 -35
  181. package/dist/styles/tokens/radius.css +26 -21
  182. package/dist/styles/tokens/spacing.css +56 -50
  183. package/dist/styles/tokens/typography.css +85 -84
  184. package/dist/styles/tokens/z-index.css +14 -14
  185. package/dist/styles/utilities/layout.css +153 -135
  186. package/dist/styles/utilities/text.css +152 -152
  187. package/dist/styles/utilities/visibility.css +47 -47
  188. package/dist/types/index.d.ts +1 -0
  189. package/dist/types/index.d.ts.map +1 -1
  190. package/docs/accessibility.md +218 -0
  191. package/docs/appearance-and-theming.md +118 -0
  192. package/docs/component-architecture.md +137 -0
  193. package/docs/component-guidelines.md +64 -0
  194. package/docs/content-and-terminology.md +207 -0
  195. package/docs/design-system-baseline-audit.md +226 -0
  196. package/docs/design-token-contract.md +279 -0
  197. package/docs/localization-and-rtl.md +147 -0
  198. package/docs/migration.md +142 -0
  199. package/docs/page-patterns-and-workflows.md +260 -0
  200. package/docs/responsive-and-adaptive-design.md +351 -0
  201. package/docs/semantic-role-migration-audit.md +77 -0
  202. package/docs/states-feedback-and-recovery.md +206 -0
  203. package/docs/theming.md +5 -0
  204. package/package.json +53 -17
  205. package/src/ai/ai-action-button/ai-action-button.css +271 -270
  206. package/src/ai/ai-approval-card/ai-approval-card.css +323 -320
  207. package/src/ai/ai-conversation-panel/ai-conversation-panel.css +447 -403
  208. package/src/ai/ai-prompt-input/ai-prompt-input.css +380 -377
  209. package/src/ai/ai-proposal-card/ai-proposal-card.css +358 -358
  210. package/src/ai/ai-suggestion-card/ai-suggestion-card.css +295 -293
  211. package/src/ai/ai-tool-call/ai-tool-call.css +256 -255
  212. package/src/ai/index.css +1 -1
  213. package/src/appearance/cache.ts +236 -0
  214. package/src/appearance/cookie.ts +184 -0
  215. package/src/appearance/index.ts +80 -0
  216. package/src/appearance/preference.ts +121 -0
  217. package/src/appearance/theme-controller.ts +371 -0
  218. package/src/appearance/types.ts +61 -0
  219. package/src/behaviors/announcer.ts +222 -0
  220. package/src/behaviors/calendar.ts +92 -0
  221. package/src/behaviors/data-grid.ts +133 -0
  222. package/src/behaviors/dialog.ts +203 -168
  223. package/src/behaviors/direction.ts +34 -0
  224. package/src/behaviors/drawer.ts +210 -177
  225. package/src/behaviors/dropdown.ts +344 -281
  226. package/src/behaviors/focus-trap.ts +304 -261
  227. package/src/behaviors/forms.ts +205 -0
  228. package/src/behaviors/ids.ts +47 -47
  229. package/src/behaviors/index.ts +15 -7
  230. package/src/behaviors/keyboard.ts +305 -303
  231. package/src/behaviors/overlay.ts +344 -231
  232. package/src/behaviors/state.ts +282 -0
  233. package/src/behaviors/tabs.ts +137 -0
  234. package/src/behaviors/viewport.ts +61 -0
  235. package/src/components/alert/alert.css +220 -217
  236. package/src/components/avatar/avatar.css +220 -219
  237. package/src/components/badge/badge.css +174 -174
  238. package/src/components/breadcrumb/breadcrumb.css +207 -205
  239. package/src/components/button/button.css +195 -167
  240. package/src/components/card/card.css +221 -220
  241. package/src/components/checkbox/checkbox.css +189 -187
  242. package/src/components/chip/chip.css +269 -267
  243. package/src/components/data-grid/data-grid.css +520 -369
  244. package/src/components/dialog/dialog.css +339 -275
  245. package/src/components/drawer/drawer.css +484 -403
  246. package/src/components/dropdown/dropdown.css +316 -298
  247. package/src/components/icon-button/icon-button.css +162 -158
  248. package/src/components/index.css +1 -2
  249. package/src/components/input/input.css +163 -163
  250. package/src/components/menu/menu.css +315 -314
  251. package/src/components/pagination/pagination.css +250 -249
  252. package/src/components/panel/panel.css +284 -283
  253. package/src/components/progress/progress.css +256 -248
  254. package/src/components/radio/radio.css +166 -164
  255. package/src/components/segmented-control/segmented-control.css +205 -205
  256. package/src/components/select/select.css +117 -103
  257. package/src/components/skeleton/skeleton.css +262 -262
  258. package/src/components/split-button/split-button.css +292 -285
  259. package/src/components/switch/switch.css +195 -181
  260. package/src/components/table/table.css +220 -0
  261. package/src/components/tabs/tabs.css +293 -289
  262. package/src/components/textarea/textarea.css +86 -86
  263. package/src/components/toast/toast.css +345 -323
  264. package/src/components/tooltip/tooltip.css +258 -255
  265. package/src/domain/billing/index.css +498 -498
  266. package/src/domain/calendar/agenda-list/agenda-list.css +224 -0
  267. package/src/domain/calendar/day-slice/day-slice.css +384 -383
  268. package/src/domain/calendar/day-timeline/day-timeline.css +332 -324
  269. package/src/domain/calendar/event-card/event-card.css +338 -336
  270. package/src/domain/calendar/index.css +2 -1
  271. package/src/domain/calendar/month-grid/month-grid.css +426 -420
  272. package/src/domain/calendar/week-grid/week-grid.css +480 -470
  273. package/src/domain/companies/index.css +526 -525
  274. package/src/index.css +5 -5
  275. package/src/index.ts +7 -5
  276. package/src/localization/index.ts +56 -0
  277. package/src/patterns/command-palette/command-palette.css +447 -439
  278. package/src/patterns/company-switcher/company-switcher.css +390 -363
  279. package/src/patterns/content-state/content-state.css +236 -0
  280. package/src/patterns/empty-state/empty-state.css +260 -259
  281. package/src/patterns/error-state/error-state.css +272 -271
  282. package/src/patterns/form-layout/form-layout.css +106 -0
  283. package/src/patterns/index.css +8 -3
  284. package/src/patterns/loading-state/loading-state.css +287 -287
  285. package/src/patterns/master-detail/master-detail.css +103 -0
  286. package/src/patterns/notification-center/notification-center.css +443 -438
  287. package/src/patterns/page/page.css +219 -0
  288. package/src/patterns/profile-menu/profile-menu.css +298 -297
  289. package/src/patterns/search-bar/search-bar.css +457 -444
  290. package/src/patterns/settings-layout/settings-layout.css +150 -0
  291. package/src/patterns/workflow/workflow.css +168 -0
  292. package/src/shell/app-shell/app-shell.css +74 -67
  293. package/src/shell/content-frame/content-frame.css +93 -93
  294. package/src/shell/header/header.css +180 -178
  295. package/src/shell/index.css +6 -6
  296. package/src/shell/mobile-nav/mobile-nav.css +173 -171
  297. package/src/shell/sidebar/sidebar.css +146 -146
  298. package/src/styles/accessibility.css +116 -0
  299. package/src/styles/animations/motion.css +162 -162
  300. package/src/styles/appearance/accent.css +173 -0
  301. package/src/styles/appearance/density.css +61 -0
  302. package/src/styles/appearance/motion.css +40 -0
  303. package/src/styles/base.css +83 -82
  304. package/src/styles/index.css +8 -1
  305. package/src/styles/localization.css +56 -0
  306. package/src/styles/reset.css +51 -50
  307. package/src/styles/responsive.css +101 -0
  308. package/src/styles/themes/dark.css +202 -120
  309. package/src/styles/themes/high-contrast.css +290 -119
  310. package/src/styles/themes/light.css +201 -119
  311. package/src/styles/tokens/breakpoints.css +37 -15
  312. package/src/styles/tokens/color.css +96 -96
  313. package/src/styles/tokens/compatibility.css +33 -0
  314. package/src/styles/tokens/elevation.css +26 -32
  315. package/src/styles/tokens/index.css +2 -1
  316. package/src/styles/tokens/motion.css +35 -35
  317. package/src/styles/tokens/radius.css +26 -21
  318. package/src/styles/tokens/spacing.css +56 -50
  319. package/src/styles/tokens/typography.css +85 -84
  320. package/src/styles/tokens/z-index.css +14 -14
  321. package/src/styles/utilities/layout.css +153 -135
  322. package/src/styles/utilities/text.css +152 -152
  323. package/src/styles/utilities/visibility.css +47 -47
  324. package/src/types/index.ts +2 -1
  325. package/dist/components/modal/modal.css +0 -318
  326. package/dist/patterns/workspace-switcher/workspace-switcher.css +0 -380
  327. package/dist/shell/right-drawer/right-drawer.css +0 -108
  328. package/src/components/modal/modal.css +0 -318
  329. package/src/patterns/workspace-switcher/workspace-switcher.css +0 -380
  330. package/src/shell/right-drawer/right-drawer.css +0 -108
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,eAAe,CAAC;AAE7D,MAAM,MAAM,YAAY,GACpB,QAAQ,GACR,MAAM,GACN,OAAO,GACP,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,aAAa,GAAG,UAAU,CAAC;AAEnE,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE1D,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,QAAQ,GACR,MAAM,GACN,SAAS,GACT,SAAS,GACT,QAAQ,CAAC;AAEb,MAAM,MAAM,WAAW,GACnB,KAAK,GACL,WAAW,GACX,SAAS,GACT,OAAO,GACP,aAAa,GACb,WAAW,GACX,QAAQ,GACR,cAAc,GACd,YAAY,GACZ,MAAM,GACN,YAAY,GACZ,UAAU,CAAC;AAEf,MAAM,MAAM,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEzD,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEjD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE5C,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,YAAY,GAAG,eAAe,CAAC;AAE3E,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEtE,MAAM,MAAM,mBAAmB,GAC3B,MAAM,GACN,MAAM,GACN,OAAO,GACP,SAAS,GACT,WAAW,GACX,SAAS,CAAC;AAEd,MAAM,MAAM,eAAe,GACvB,OAAO,GACP,MAAM,GACN,SAAS,GACT,UAAU,GACV,MAAM,GACN,QAAQ,GACR,SAAS,GACT,UAAU,GACV,WAAW,CAAC;AAEhB,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEpE,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,YAAa,SAAQ,YAAY;IAChD,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;CAC/B;AAED,MAAM,WAAW,cAAc;IAC7B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,WAAW,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,sBAAuB,SAAQ,YAAY;IAC1D,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,IAAI,IAAI,IAAI,CAAC;IACb,KAAK,IAAI,IAAI,CAAC;IACd,MAAM,IAAI,IAAI,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,WAAW,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,MAAM,CAAC;IACjD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,uBAAwB,SAAQ,YAAY;IAC3D,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,UAAU,IAAI,IAAI,CAAC;IACnB,SAAS,IAAI,IAAI,CAAC;IAClB,SAAS,IAAI,IAAI,CAAC;IAClB,aAAa,IAAI,IAAI,CAAC;CACvB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"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"}
@@ -0,0 +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.
@@ -0,0 +1,118 @@
1
+ # Appearance and theming
2
+
3
+ `@neetechs/ui/appearance` is the framework-neutral appearance authority for Neetechs applications. MyAccount/the shared backend owns permanent preferences. The package resolves, applies, observes, and caches those values; it does not call an API or make browser storage authoritative.
4
+
5
+ ## Preference and resolved contracts
6
+
7
+ ```ts
8
+ type NtThemePreference = 'system' | 'light' | 'dark';
9
+ type NtResolvedTheme = 'light' | 'dark';
10
+ type NtAccentPreference = 'orange' | 'blue' | 'green' | 'purple' | 'neutral';
11
+ type NtDensityPreference = 'compact' | 'comfortable' | 'spacious';
12
+
13
+ interface NtAppearancePreference {
14
+ theme: NtThemePreference;
15
+ accent: NtAccentPreference;
16
+ density: NtDensityPreference;
17
+ reduceMotion?: boolean | 'system';
18
+ highContrast?: boolean | 'system';
19
+ }
20
+ ```
21
+
22
+ `system` color theme resolves from `prefers-color-scheme`. High contrast is a separate accessibility dimension layered on the resolved light/dark theme. Motion and contrast resolve to `full|reduced` and `normal|high`. Forced colors always activates the high-contrast layer, even when the manual contrast preference is false.
23
+
24
+ Safe defaults are `system`, `orange`, `comfortable`, system motion, and system contrast. Without browser globals, system color falls back to dark (the package `:root` foundation), motion to full, and contrast to normal.
25
+
26
+ ## Public DOM contract
27
+
28
+ The controller owns these public attributes on `document.documentElement`:
29
+
30
+ ```html
31
+ <html
32
+ data-nt-theme="dark"
33
+ data-nt-theme-preference="system"
34
+ data-nt-accent="orange"
35
+ data-nt-density="comfortable"
36
+ data-nt-contrast="normal"
37
+ data-nt-motion="full"
38
+ >
39
+ ```
40
+
41
+ Applications must not set competing attributes on `body` or app roots. `data-nt-theme="high-contrast"` remains a deprecated CSS compatibility selector only; controllers never emit it.
42
+
43
+ ## Resolution and startup precedence
44
+
45
+ 1. `serverPreference`, when SSR/backend settings are already available.
46
+ 2. Valid `nt_theme` bootstrap cookie.
47
+ 3. Valid `nt_appearance_preference` local cache; legacy `nt_theme_preference` expands with safe defaults.
48
+ 4. Safe defaults plus operating-system media preferences.
49
+ 5. An authenticated backend result applied with `applyResolvedPreference`; this refreshes the startup cache.
50
+
51
+ Cookie and cache values prevent a flash and are never permanent truth. Applications must route permanent changes through MyAccount/the shared backend, then apply the returned preference.
52
+
53
+ ```ts
54
+ import {
55
+ bootstrapNeetechsAppearance,
56
+ createAppearanceController,
57
+ type NtAppearancePreference,
58
+ } from '@neetechs/ui/appearance';
59
+
60
+ bootstrapNeetechsAppearance();
61
+ const appearance = createAppearanceController();
62
+ appearance.initialize();
63
+
64
+ const backendPreference: NtAppearancePreference = await loadAccountPreference();
65
+ appearance.applyResolvedPreference(backendPreference, { source: 'backend' });
66
+
67
+ const unsubscribe = appearance.subscribe(state => {
68
+ console.log(state.resolved.theme, state.resolved.contrast);
69
+ });
70
+ unsubscribe();
71
+ appearance.destroy();
72
+ ```
73
+
74
+ Initialization is idempotent. `destroy()` removes color-scheme, motion, contrast, and forced-color listeners and subscribers. Invalid complete preferences are ignored. Storage, cookies, media queries, and DOM globals are injectable and guarded when unavailable.
75
+
76
+ ## Accent semantics
77
+
78
+ Orange is the Neetechs default. Blue, green, purple, and neutral remap primary action, selected surface, link, product focus, and interactive-border roles. Components consume semantic tokens and contain no accent-specific selectors. Status, AI, and financial roles do not follow the accent: green selection is not success, purple selection is not AI origin, and financial positive stays financial positive.
79
+
80
+ ## Density semantics
81
+
82
+ Density remaps semantic sizing roles for control heights/padding, rows, cards, panels, navigation, forms, toolbars, and list items. Comfortable preserves the pre-density baseline. Compact common controls remain at least `2rem`; medium controls/navigation rows are `2.25rem`. Spacious increases whitespace without changing typography hierarchy.
83
+
84
+ Local component size variants still describe the use case. Global density changes the measurements behind those roles; it does not remove local variants.
85
+
86
+ ## Contrast, forced colors, and motion
87
+
88
+ `data-nt-contrast="high"` strengthens boundaries and removes shadow-dependent hierarchy for either light or dark. `prefers-contrast: more` supplies system behavior. Forced-colors mode maps semantic roles to system colors; no `forced-color-adjust: none` exception exists.
89
+
90
+ `data-nt-motion="reduced"` shortens semantic durations, removes decorative transforms/travel, and disables decorative AI/slide animations. Essential state and progress feedback remain visible. `prefers-reduced-motion` supplies system behavior unless a manual boolean preference is applied. Component focus, forced-colors, target-size, and semantic contrast contracts are documented in [accessibility.md](./accessibility.md).
91
+
92
+ ## Cookie and cross-subdomain configuration
93
+
94
+ `nt_theme` is the frozen public cookie name. It accepts legacy raw `system|light|dark` values and a compact versioned appearance payload containing presentation data only.
95
+
96
+ ```ts
97
+ const setCookieValue = createAppearanceCookie(preference, {
98
+ domain: '.neetechs.com', // omit in local development
99
+ path: '/',
100
+ sameSite: 'Lax',
101
+ secure: true,
102
+ maxAge: 60 * 60 * 24 * 365,
103
+ });
104
+ ```
105
+
106
+ The package does not hardcode `.neetechs.com`, write authentication data, or depend on a backend route. Production infrastructure may use the result as `Set-Cookie`; local development omits `domain` and usually `secure`.
107
+
108
+ ## SSR and framework integration
109
+
110
+ On the server, pass a validated backend preference as `serverPreference` or a request cookie string and emit the resolved attributes on `<html>`. On the client, bootstrap before Angular startup or React `createRoot`, then initialize one shared controller. Hydration sees the same server hint/cookie and avoids an avoidable mismatch.
111
+
112
+ Angular should provide the controller through an application initializer/injection token; React should place one controller in context and subscribe through an external-store hook. The package intentionally ships no framework dependency.
113
+
114
+ ## Compatibility and unsupported patterns
115
+
116
+ `bootstrapNeetechsTheme`, `createThemeController`, `applyThemeToDocument`, `ThemePreference`, `ResolvedThemeState`, `nt_theme_preference`, and raw theme cookie values remain compatible. The theme controller is deprecated for new integrations because it exposes only the color-theme view while applying safe defaults for other dimensions.
117
+
118
+ Unsupported: per-app permanent stores, writing resolved light/dark over `system`, application-specific theme controllers, component accent selectors, high contrast as a fourth ordinary theme, sensitive cookie fields, and direct root-attribute mutation after the shared controller initializes.
@@ -0,0 +1,137 @@
1
+ # Component architecture and consolidation contract
2
+
3
+ This document defines the Prompt 7 ownership model. It preserves public package paths and class names while preventing deprecated implementations from becoming independent again.
4
+
5
+ ## Layer model
6
+
7
+ ```text
8
+ Tokens
9
+ -> visual primitives
10
+ -> accessible behavioral primitives
11
+ -> public components
12
+ -> product patterns
13
+ -> domain compositions
14
+ ```
15
+
16
+ - Tokens own appearance decisions. Components do not fork theme, accent, density, focus, motion, or direction logic.
17
+ - Behavioral primitives in `src/behaviors` own focus, overlay, keyboard, ID, and announcement mechanics.
18
+ - Components define one semantic interaction concept. Patterns compose components for a product purpose. Domain modules add business meaning without reimplementing component mechanics.
19
+ - Compatibility selectors and exports delegate to a canonical source. They are not extension points for new features.
20
+
21
+ ## Consolidation decision table
22
+
23
+ | Old family | Outcome | Canonical architecture | Compatibility and future plan |
24
+ | --- | --- | --- | --- |
25
+ | Dialog / modal | A: one canonical component | `src/components/dialog/dialog.css`; `ntCreateDialog` with `modal: true/false` | `@neetechs/ui/components/modal.css`, `.nt-modal*`, `NtModal*`, `ntCreateModal`, and `createModal` remain deprecated aliases. Earliest removal: 1.0 after a documented 0.x migration window. |
26
+ | Drawer / right drawer | C: canonical variant | `src/components/drawer/drawer.css`; `ntCreateDrawer`; logical `placement` | `@neetechs/ui/shell/right-drawer.css` and `.nt-right-drawer*` map to the canonical drawer source. Migrate markup to `.nt-drawer.nt-drawer--inline-end`; physical `side` is deprecated in favor of `placement`. Earliest removal: 1.0. |
27
+ | Card / panel | B: shared platform primitives, distinct components | Card is an entity/artifact surface; panel is a structural page region. Both consume the same surface, radius, elevation, spacing, density, and state tokens. | Both imports and class families stay supported. Do not add selection semantics to panel merely to match card. |
28
+ | Menu / dropdown / profile menu | B: shared behavior, distinct patterns | `ntCreateMenuPopover` owns overlay, roving focus, typeahead, Escape, outside click, focus return, and cleanup. `ntCreateMenu` fixes menu semantics; `ntCreateDropdown` delegates for compatibility. Profile menu remains a product pattern. | CSS classes/imports remain. New behavior belongs in the canonical controller, never a pattern-specific listener stack. |
29
+ | Company / workspace switcher | B: one visual foundation, distinct product patterns | `src/patterns/company-switcher/company-switcher.css` styles both public class families; both use the canonical menu/listbox controller according to purpose. | `@neetechs/ui/patterns/workspace-switcher.css` resolves to the canonical source. Both class families remain supported; no planned removal before 1.0 and consumer usage review. |
30
+ | Table / data grid | D: keep separate | `table.css` styles native read-only tables. `data-grid.css` plus `ntCreateDataGrid` is opt-in two-dimensional interaction. | The formerly empty table export is now implemented. Neither API is deprecated. Do not add `role=grid` to ordinary tables. |
31
+ | Badge / chip / tag / status | D with shared tokens | Badge is informational metadata/status. Chip may be interactive/removable/selected. “Pill” is a shape modifier, not a component. No standalone tag or status-indicator export exists. | Badge and chip remain. New aliases that differ only by radius are forbidden. Status must include text/icon meaning, not color alone. |
32
+ | Tabs / segmented control / navigation | D: keep separate | Tabs switch panels; segmented control chooses a value or command; sidebar/mobile nav perform navigation. | Visual selection tokens are shared, but semantics and keyboard contracts remain separate. |
33
+ | Empty / error / loading states | B: shared content-state primitive, distinct legacy patterns | `src/patterns/content-state/content-state.css` defines the canonical content-state architecture for loading, empty, error, offline, permission, not-found, maintenance, and success presentations. | Existing `empty-state`, `error-state`, and `loading-state` classes remain compatible public patterns. New work should compose `.nt-content-state` rather than creating another one-off state surface. |
34
+
35
+ No application source was available in this repository. External-usage evidence is therefore limited to public exports, README examples, docs, tests, and the previously published package shape. Lack of an in-repo reference is not proof that a public API is unused.
36
+
37
+ ## Canonical overlays
38
+
39
+ `ntCreateDialog` is the only dialog implementation. Modal dialogs trap focus, make background branches inert, lock scroll by default, and restore the invoker. Nonmodal dialogs retain dialog semantics but do not trap focus or apply `aria-modal`. `ntCreateModal` is a thin modal-mode adapter.
40
+
41
+ `ntCreateDrawer` shares the overlay and focus foundations while adding placement and modal/nonmodal region semantics. New code uses `placement: 'inline-start' | 'inline-end'`; `side` and physical left/right classes are compatibility inputs. Only implemented placements are accepted by the `NtDrawerSide` type.
42
+
43
+ Nested overlays continue to use the shared stack in `src/behaviors/overlay.ts`; component code must not register another document-wide Escape or outside-click implementation.
44
+
45
+ ## Menu and switcher rules
46
+
47
+ - Application commands use menu/menuitem semantics through `ntCreateMenu`.
48
+ - Value selection uses `ntCreateMenuPopover({ pattern: 'listbox' })` and application-owned value synchronization.
49
+ - Navigation links remain a labelled `nav`, not a menu.
50
+ - Rich switchers may contain search, previews, account metadata, and create actions. They retain pattern markup but use the shared overlay/list navigation mechanics.
51
+ - Company and workspace styles share one source. Workspace status dots are the only pattern-specific visual extension in that source.
52
+
53
+ ## Surface rules
54
+
55
+ A card is a bounded content object that can represent an entity/artifact and may be selected or interactive. A panel is a structural region that groups page content and usually is neither selected nor independently elevated. Domain and AI cards keep their business-specific public classes but must consume platform card/surface tokens and must not reimplement overlay or focus behavior.
56
+
57
+ ## Data display rules
58
+
59
+ Use `.nt-table` with native `table`, `caption`, `thead`, `th[scope]`, `tbody`, and `td` for read-only data. Sort controls are real buttons inside headers. Horizontal overflow is a presentation response, not permission to change the role.
60
+
61
+ Use data grid only when the product requires row/cell selection, two-dimensional keyboard navigation, editing, resize, reorder, or comparable grid interaction. The grid controller does not turn arbitrary markup into a fully editable spreadsheet; applications own editing and virtualization policies.
62
+
63
+ ## State and recovery ownership
64
+
65
+ Prompt 8 adds a layered state model on top of this component architecture. State is not a new component layer; it cuts across components and patterns:
66
+
67
+ - Native attributes own native semantics first: `disabled`, `readonly`, `aria-selected`, `aria-expanded`, `aria-current`, `aria-invalid`, and `aria-busy`.
68
+ - `data-nt-state` owns operation state where there is no native equivalent: `idle`, `pending`, `success`, `error`, and `canceled`.
69
+ - `data-nt-content-state` owns content-region state: `loading`, `refreshing`, `empty`, `partial`, `stale`, `error`, `offline`, `unauthenticated`, `forbidden`, `not-found`, `maintenance`, and `success`.
70
+ - Legacy modifier classes such as `--loading`, `--error`, and `--success` are compatibility styling hooks, not the source of behavior truth.
71
+ - `ntCreateAsyncAction`, `ntCreateFormController`, and `ntCreateToastController` are small framework-agnostic behavior primitives. They standardize duplicate prevention, busy exposure, validation summary focus, toast timing, and cleanup without becoming application state management.
72
+
73
+ See [states-feedback-and-recovery.md](./states-feedback-and-recovery.md) for state dimensions, precedence, feedback channel selection, confirmations, unsaved-change contracts, and recovery rules.
74
+
75
+ ## Compatibility matrix
76
+
77
+ | Public contract | Status | Canonical replacement |
78
+ | --- | --- | --- |
79
+ | `@neetechs/ui/components/modal.css` | Deprecated, resolvable | `@neetechs/ui/components/dialog.css` |
80
+ | `.nt-modal*` | Deprecated, styled by dialog CSS | `.nt-dialog*` |
81
+ | `NtModalOptions`, `NtModalController`, `ntCreateModal`, `createModal` | Deprecated adapters | `NtDialogOptions`, `NtDialogController`, `ntCreateDialog` |
82
+ | `@neetechs/ui/shell/right-drawer.css` | Deprecated, resolvable | `@neetechs/ui/components/drawer.css` |
83
+ | `.nt-right-drawer*` | Deprecated compatibility selectors | `.nt-drawer*` with `.nt-drawer--inline-end` |
84
+ | Drawer `side` option and physical sides | Deprecated input, still translated | `placement: 'inline-start' | 'inline-end'` |
85
+ | `@neetechs/ui/patterns/workspace-switcher.css` | Supported compatibility path to shared source | May remain; use `patterns.css` for aggregate import |
86
+ | `.nt-workspace-switcher*` | Supported pattern API | No class migration required |
87
+ | `ntCreateDropdown` | Supported compatibility name over canonical controller | `ntCreateMenu` for command menus or `ntCreateMenuPopover` for explicit menu/listbox use |
88
+ | `createDialog`, `createDrawer` | Supported unprefixed import compatibility | Neetechs-prefixed `ntCreateDialog`, `ntCreateDrawer` remain repository convention |
89
+ | `@neetechs/ui/components/table.css` | Supported and now functional | No replacement; use data grid only for genuine grid interaction |
90
+ | `.nt-empty-state`, `.nt-error-state`, `.nt-loading-state` | Supported legacy content-state patterns | `.nt-content-state` with `data-nt-content-state` |
91
+ | Modifier-only loading/error/success state | Compatible styling hook only | Native/ARIA state plus `data-nt-state` or `data-nt-content-state` |
92
+
93
+ No public export was removed. The three retired source files are intentionally absent; exact package-export entries route their former public paths to canonical files.
94
+
95
+ ## Deprecation policy for 0.x
96
+
97
+ The package is `0.x`, so SemVer permits breaking minor releases, but Neetechs applications still require a controlled window.
98
+
99
+ 1. Deprecate only duplicated, misleading, unsafe, accidental, or superseded contracts.
100
+ 2. Keep a working adapter for at least one documented 0.x minor migration window unless the API was never functional or is unsafe to execute.
101
+ 3. Mark TypeScript APIs with `@deprecated`; document CSS/path deprecations here and in `migration.md`.
102
+ 4. Adapters validate/translate old input and call canonical code. They do not acquire features independently and emit no production console noise.
103
+ 5. Tests must prove old imports resolve and old selectors are emitted from canonical CSS.
104
+ 6. Removal requires release notes, a replacement example, consumer search where repositories are available, and a planned version. Current duplicate compatibility APIs target no earlier than 1.0.
105
+ 7. Accidental unpublished internals may be removed immediately only with package-content evidence. Empty public exports are implemented or explicitly mapped; they are not silently deleted.
106
+
107
+ ## Architecture enforcement
108
+
109
+ `npm run check:architecture` verifies exact compatibility export routing, absence of the three retired copied CSS files, legacy selectors in canonical CSS, thin runtime adapters, and the nonempty table contract. It deliberately does not count ordinary repeated declarations as bugs; identical declarations can express legitimate independent semantics.
110
+
111
+ `npm run check:states` verifies the canonical state helper, content-state CSS import, button async selectors, toast/form behavior helpers, known state names, and state documentation anchors.
112
+
113
+ Run:
114
+
115
+ ```bash
116
+ npm run check:architecture
117
+ npm run check:states
118
+ npm test
119
+ npm run test:browser
120
+ npm run build
121
+ npm pack --dry-run
122
+ ```
123
+
124
+ Packed-tarball consumer verification must resolve the canonical and deprecated runtime/CSS imports. Browser and manual testing remain required for focus, placement, themes, density, forced colors, reduced motion, and visual compatibility.
125
+
126
+ ## Known remaining duplication
127
+
128
+ - Card/panel and product/domain cards repeat structural header/body/footer CSS. Their semantics differ, and deeper visual extraction is deferred until actual composition markup can be tested.
129
+ - Menu, dropdown, profile menu, and command palette retain pattern-specific CSS because popup geometry and rich content differ; behavioral listeners are canonical.
130
+ - Empty/error/loading legacy patterns remain for compatibility; new content-state variants should avoid rebuilding separate CSS unless they add a distinct product pattern.
131
+ - Calendar and data-grid mobile adaptations now exist (agenda list, constrained/record grid modes); remaining physical layout mathematics (event collision, virtualization) stays application-level.
132
+
133
+ ## Adaptive categories and page patterns
134
+
135
+ Every component declares an adaptive category — intrinsic, reflowing, adaptive, or alternative view — defined in [responsive-and-adaptive-design.md](./responsive-and-adaptive-design.md). Reusable components respond to query containers (`.nt-region`, shell content, dialog/drawer bodies), never to the viewport directly; only shell-level layout uses viewport queries from the documented rem scale.
136
+
137
+ Page composition uses the structural patterns in `src/patterns/` — `page.css` (header/toolbar/sections/footer actions), `form-layout.css`, `settings-layout.css`, `master-detail.css`, `workflow.css` — documented in [page-patterns-and-workflows.md](./page-patterns-and-workflows.md). These are layout contracts; they encode no product business logic.
@@ -0,0 +1,64 @@
1
+ # Component authoring guidelines
2
+
3
+ ## Localization and direction
4
+
5
+ Components inherit native `lang` and `dir`; do not add a parallel RTL flag. Use logical properties, pass complete translated strings, isolate unknown content with `<bdi>` or `dir="auto"`, and use `.nt-technical-value` for LTR code/URLs/identifiers inside RTL prose. `.nt-button--wrap` is the opt-in multi-line action contract. Only meaningfully directional arrows receive `.nt-icon--directional`; never mirror an icon subtree globally. See [localization-and-rtl.md](./localization-and-rtl.md).
6
+
7
+ ## Accessibility is part of the public contract
8
+
9
+ Use native HTML first, semantic platform tokens second, and shared behavior only for interaction HTML does not supply. CSS class names do not confer semantics. A `.nt-button` on a `div` is still not a button.
10
+
11
+ Every interactive component definition must state:
12
+
13
+ - native element or required role;
14
+ - accessible name and description source;
15
+ - keyboard keys and activation policy;
16
+ - initial focus, exit, and restoration behavior;
17
+ - disabled, read-only, selected, invalid, and loading behavior;
18
+ - live-region policy;
19
+ - minimum target and reduced-motion/forced-colors behavior;
20
+ - unit, browser, and manual coverage.
21
+
22
+ Use the complete contract in [accessibility.md](./accessibility.md).
23
+
24
+ ## Controls
25
+
26
+ - Buttons and links use native elements. Do not duplicate native Enter/Space handlers.
27
+ - Icon-only buttons require a contextual accessible name.
28
+ - Primary and icon-only controls target 44×44px; dense contextual controls remain at least 40×40px.
29
+ - Preserve the visible label while loading, add `aria-busy`, and prevent duplicate activation. New async behavior uses `data-nt-state="pending"` through `ntCreateAsyncAction()` rather than treating loading as disabled.
30
+ - Native disabled is preferred. When `aria-disabled` is required, guard click and keyboard behavior explicitly.
31
+
32
+ ## Composite widgets
33
+
34
+ Menus, tabs, modal overlays, interactive grids, and calendar grids use the exported framework-neutral helpers. Do not create a competing global Escape listener or focus trap. A semantic table remains a table unless it truly needs two-dimensional interactive navigation. A navigation list is not an application menu.
35
+
36
+ ## Component ownership and composition
37
+
38
+ Use the layer model and decision table in [component-architecture.md](./component-architecture.md). Modal is a dialog mode, not a second behavior. Drawers use logical placement. Menus, dropdowns, profile menus, and switchers share `ntCreateMenuPopover`; product patterns may add rich content but may not fork keyboard, overlay, or cleanup logic. Cards represent objects/artifacts, while panels organize page structure. Badges are informational; removable or selectable chips are interactive.
39
+
40
+ Compatibility selectors and exports are migration-only. Add new behavior and styling to the canonical source, never to a deprecated alias. New component proposals must show that their semantics or interaction differ from an existing component—not merely their radius, color, or product name.
41
+
42
+ ## Forms
43
+
44
+ Visible labels are the default. Stable IDs connect help and errors. Placeholder text, color, icons, and tooltips cannot be the sole instruction. Group related choices with fieldset/legend. Focus a named error-summary region after failed submission and link entries to fields. Use `ntCreateFormController()` for the shared submission lifecycle when a framework does not already provide an equivalent guard.
45
+
46
+ ## States, feedback, and recovery
47
+
48
+ Use the layered state model in [states-feedback-and-recovery.md](./states-feedback-and-recovery.md). Native attributes own availability and validation where they exist; `data-nt-state` owns async operation; `data-nt-content-state` owns loading/empty/error/offline/permission/maintenance content states. Existing modifier classes remain compatibility styling hooks, but new behavior should not invent product-specific loading, error, or pending vocabularies.
49
+
50
+ ## Styling
51
+
52
+ Use semantic foreground/background/border/focus tokens. Never remove outlines. Selection must survive forced colors and differ from focus. Long/decorative motion needs a reduced-motion alternative. Avoid clipping focus rings with overflow; use an inset ring only where geometry requires it.
53
+
54
+ ## Responsive behavior
55
+
56
+ Every component declares its adaptive category (intrinsic, reflowing, adaptive, alternative view) and meets the acceptance checklist in [responsive-and-adaptive-design.md](./responsive-and-adaptive-design.md): container-driven adaptation (viewport queries only at shell level, rem values from the documented scale), no fixed heights around translated text, `100vh` always paired with `100dvh`, no hover-only actions, safe coarse-pointer targets, and DOM order equal to visual order in every mode.
57
+
58
+ ## Page composition and content
59
+
60
+ Page-level structure uses the patterns in [page-patterns-and-workflows.md](./page-patterns-and-workflows.md) (one `<h1>`, one primary action per group, destructive separation). Labels and messages in examples and fixtures follow [content-and-terminology.md](./content-and-terminology.md) and are validated by `npm run check:content`.
61
+
62
+ ## Tests required for a new interactive component
63
+
64
+ Add a representative fixture and test accessible name/role/state, Tab order, pattern keys, focus visibility/restoration, disabled activation, forced colors, reduced motion, and axe. Add required semantic contrast pairs to the checker when introducing a reusable role. Manual screen-reader testing remains part of release review.