@neetechs/ui 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/LICENSE +21 -21
  3. package/README.md +862 -861
  4. package/dist/ai/ai-action-button/ai-action-button.css +271 -271
  5. package/dist/ai/ai-approval-card/ai-approval-card.css +323 -323
  6. package/dist/ai/ai-conversation-panel/ai-conversation-panel.css +447 -447
  7. package/dist/ai/ai-prompt-input/ai-prompt-input.css +380 -380
  8. package/dist/ai/ai-proposal-card/ai-proposal-card.css +358 -358
  9. package/dist/ai/ai-suggestion-card/ai-suggestion-card.css +295 -295
  10. package/dist/ai/ai-tool-call/ai-tool-call.css +256 -256
  11. package/dist/ai/index.css +7 -7
  12. package/dist/behaviors/index.d.ts +1 -0
  13. package/dist/behaviors/index.d.ts.map +1 -1
  14. package/dist/behaviors/index.js +1 -0
  15. package/dist/behaviors/index.js.map +1 -1
  16. package/dist/behaviors/selection-indicator.d.ts +35 -0
  17. package/dist/behaviors/selection-indicator.d.ts.map +1 -0
  18. package/dist/behaviors/selection-indicator.js +133 -0
  19. package/dist/behaviors/selection-indicator.js.map +1 -0
  20. package/dist/behaviors/sidebar.d.ts +3 -1
  21. package/dist/behaviors/sidebar.d.ts.map +1 -1
  22. package/dist/behaviors/sidebar.js +10 -3
  23. package/dist/behaviors/sidebar.js.map +1 -1
  24. package/dist/components/alert/alert.css +226 -226
  25. package/dist/components/avatar/avatar.css +298 -298
  26. package/dist/components/badge/badge.css +180 -180
  27. package/dist/components/breadcrumb/breadcrumb.css +207 -207
  28. package/dist/components/button/button.css +278 -278
  29. package/dist/components/card/card.css +336 -284
  30. package/dist/components/checkbox/checkbox.css +189 -189
  31. package/dist/components/chip/chip.css +269 -269
  32. package/dist/components/data-grid/data-grid.css +520 -520
  33. package/dist/components/description-list/description-list.css +187 -187
  34. package/dist/components/dialog/dialog.css +348 -339
  35. package/dist/components/dock/dock.css +319 -0
  36. package/dist/components/drawer/drawer.css +493 -484
  37. package/dist/components/dropdown/dropdown.css +325 -316
  38. package/dist/components/fab/fab.css +281 -0
  39. package/dist/components/icon-button/icon-button.css +162 -162
  40. package/dist/components/index.css +2 -0
  41. package/dist/components/input/input.css +163 -163
  42. package/dist/components/menu/menu.css +315 -315
  43. package/dist/components/pagination/pagination.css +250 -250
  44. package/dist/components/panel/panel.css +316 -284
  45. package/dist/components/popover/popover.css +22 -0
  46. package/dist/components/progress/progress.css +268 -268
  47. package/dist/components/radio/radio.css +166 -166
  48. package/dist/components/segmented-control/segmented-control.css +264 -205
  49. package/dist/components/select/select.css +117 -117
  50. package/dist/components/skeleton/skeleton.css +267 -267
  51. package/dist/components/split-button/split-button.css +292 -292
  52. package/dist/components/stat/stat.css +433 -433
  53. package/dist/components/switch/switch.css +195 -195
  54. package/dist/components/table/table.css +220 -220
  55. package/dist/components/tabs/tabs.css +393 -293
  56. package/dist/components/textarea/textarea.css +86 -86
  57. package/dist/components/toast/toast.css +345 -345
  58. package/dist/components/tooltip/tooltip.css +267 -258
  59. package/dist/domain/billing/index.css +629 -629
  60. package/dist/domain/calendar/agenda-list/agenda-list.css +224 -224
  61. package/dist/domain/calendar/day-slice/day-slice.css +384 -384
  62. package/dist/domain/calendar/day-timeline/day-timeline.css +332 -332
  63. package/dist/domain/calendar/event-card/event-card.css +338 -338
  64. package/dist/domain/calendar/index.css +5 -5
  65. package/dist/domain/calendar/month-grid/month-grid.css +426 -426
  66. package/dist/domain/calendar/week-grid/week-grid.css +487 -480
  67. package/dist/domain/companies/index.css +526 -526
  68. package/dist/domain/index.css +3 -3
  69. package/dist/index.css +5 -5
  70. package/dist/patterns/command-palette/command-palette.css +488 -447
  71. package/dist/patterns/company-switcher/company-switcher.css +390 -390
  72. package/dist/patterns/content-state/content-state.css +236 -236
  73. package/dist/patterns/empty-state/empty-state.css +260 -260
  74. package/dist/patterns/error-state/error-state.css +272 -272
  75. package/dist/patterns/form-layout/form-layout.css +106 -106
  76. package/dist/patterns/loading-state/loading-state.css +287 -287
  77. package/dist/patterns/master-detail/master-detail.css +103 -103
  78. package/dist/patterns/notification-center/notification-center.css +443 -443
  79. package/dist/patterns/page/page.css +303 -303
  80. package/dist/patterns/profile-menu/profile-menu.css +298 -298
  81. package/dist/patterns/record-list/record-list.css +302 -302
  82. package/dist/patterns/search-bar/search-bar.css +457 -457
  83. package/dist/patterns/settings-layout/settings-layout.css +283 -283
  84. package/dist/patterns/workflow/workflow.css +168 -168
  85. package/dist/shell/app-shell/app-shell.css +429 -211
  86. package/dist/shell/content-frame/content-frame.css +93 -93
  87. package/dist/shell/header/header.css +328 -328
  88. package/dist/shell/index.css +8 -8
  89. package/dist/shell/mobile-nav/mobile-nav.css +254 -254
  90. package/dist/shell/sidebar/sidebar.css +923 -314
  91. package/dist/styles/accessibility.css +150 -150
  92. package/dist/styles/animations/motion.css +162 -162
  93. package/dist/styles/appearance/accent.css +215 -215
  94. package/dist/styles/appearance/density.css +61 -61
  95. package/dist/styles/appearance/motion.css +48 -40
  96. package/dist/styles/base.css +83 -83
  97. package/dist/styles/index.css +29 -28
  98. package/dist/styles/localization.css +56 -56
  99. package/dist/styles/reset.css +51 -51
  100. package/dist/styles/responsive.css +101 -101
  101. package/dist/styles/themes/dark.css +225 -210
  102. package/dist/styles/themes/high-contrast.css +378 -298
  103. package/dist/styles/themes/light.css +224 -209
  104. package/dist/styles/tokens/breakpoints.css +37 -37
  105. package/dist/styles/tokens/color.css +102 -102
  106. package/dist/styles/tokens/compatibility.css +33 -33
  107. package/dist/styles/tokens/elevation.css +33 -26
  108. package/dist/styles/tokens/index.css +9 -9
  109. package/dist/styles/tokens/motion.css +55 -36
  110. package/dist/styles/tokens/radius.css +26 -26
  111. package/dist/styles/tokens/spacing.css +56 -56
  112. package/dist/styles/tokens/typography.css +85 -85
  113. package/dist/styles/tokens/z-index.css +14 -14
  114. package/dist/styles/utilities/glass.css +97 -0
  115. package/dist/styles/utilities/layout.css +153 -153
  116. package/dist/styles/utilities/text.css +152 -152
  117. package/dist/styles/utilities/visibility.css +47 -47
  118. package/dist/version.d.ts +1 -1
  119. package/dist/version.js +1 -1
  120. package/docs/NEETECHS_UI_UPGRADE_PLAN.md +312 -312
  121. package/docs/accessibility.md +218 -218
  122. package/docs/appearance-and-theming.md +150 -150
  123. package/docs/brand-palette.md +36 -36
  124. package/docs/component-architecture.md +137 -137
  125. package/docs/component-guidelines.md +64 -64
  126. package/docs/components.md +326 -321
  127. package/docs/content-and-terminology.md +207 -207
  128. package/docs/design-system-baseline-audit.md +226 -226
  129. package/docs/design-token-contract.md +279 -279
  130. package/docs/glass-and-motion.md +310 -0
  131. package/docs/localization-and-rtl.md +147 -147
  132. package/docs/migration.md +193 -193
  133. package/docs/page-patterns-and-workflows.md +301 -301
  134. package/docs/responsive-and-adaptive-design.md +351 -351
  135. package/docs/semantic-role-migration-audit.md +77 -77
  136. package/docs/site-chrome.md +320 -317
  137. package/docs/states-feedback-and-recovery.md +206 -206
  138. package/docs/theming.md +5 -5
  139. package/package.json +2 -1
  140. package/src/ai/ai-action-button/ai-action-button.css +271 -271
  141. package/src/ai/ai-approval-card/ai-approval-card.css +323 -323
  142. package/src/ai/ai-conversation-panel/ai-conversation-panel.css +447 -447
  143. package/src/ai/ai-prompt-input/ai-prompt-input.css +380 -380
  144. package/src/ai/ai-proposal-card/ai-proposal-card.css +358 -358
  145. package/src/ai/ai-suggestion-card/ai-suggestion-card.css +295 -295
  146. package/src/ai/ai-tool-call/ai-tool-call.css +256 -256
  147. package/src/ai/index.css +7 -7
  148. package/src/appearance/cache.ts +236 -236
  149. package/src/appearance/cookie.ts +184 -184
  150. package/src/appearance/index.ts +86 -86
  151. package/src/appearance/preference.ts +121 -121
  152. package/src/appearance/theme-controller.ts +384 -384
  153. package/src/appearance/types.ts +61 -61
  154. package/src/behaviors/announcer.ts +222 -222
  155. package/src/behaviors/calendar.ts +92 -92
  156. package/src/behaviors/data-grid.ts +133 -133
  157. package/src/behaviors/dialog.ts +203 -203
  158. package/src/behaviors/direction.ts +34 -34
  159. package/src/behaviors/drawer.ts +210 -210
  160. package/src/behaviors/dropdown.ts +344 -344
  161. package/src/behaviors/focus-trap.ts +304 -304
  162. package/src/behaviors/forms.ts +205 -205
  163. package/src/behaviors/ids.ts +47 -47
  164. package/src/behaviors/index.ts +1 -0
  165. package/src/behaviors/keyboard.ts +305 -305
  166. package/src/behaviors/overlay.ts +344 -344
  167. package/src/behaviors/selection-indicator.ts +162 -0
  168. package/src/behaviors/sidebar.ts +14 -4
  169. package/src/behaviors/state.ts +282 -282
  170. package/src/behaviors/tabs.ts +137 -137
  171. package/src/behaviors/viewport.ts +61 -61
  172. package/src/components/alert/alert.css +226 -226
  173. package/src/components/avatar/avatar.css +298 -298
  174. package/src/components/badge/badge.css +180 -180
  175. package/src/components/breadcrumb/breadcrumb.css +207 -207
  176. package/src/components/button/button.css +278 -278
  177. package/src/components/card/card.css +336 -284
  178. package/src/components/checkbox/checkbox.css +189 -189
  179. package/src/components/chip/chip.css +269 -269
  180. package/src/components/data-grid/data-grid.css +520 -520
  181. package/src/components/description-list/description-list.css +187 -187
  182. package/src/components/dialog/dialog.css +348 -339
  183. package/src/components/dock/dock.css +319 -0
  184. package/src/components/drawer/drawer.css +493 -484
  185. package/src/components/dropdown/dropdown.css +325 -316
  186. package/src/components/fab/fab.css +281 -0
  187. package/src/components/icon-button/icon-button.css +162 -162
  188. package/src/components/index.css +2 -0
  189. package/src/components/input/input.css +163 -163
  190. package/src/components/menu/menu.css +315 -315
  191. package/src/components/pagination/pagination.css +250 -250
  192. package/src/components/panel/panel.css +316 -284
  193. package/src/components/popover/popover.css +22 -0
  194. package/src/components/progress/progress.css +268 -268
  195. package/src/components/radio/radio.css +166 -166
  196. package/src/components/segmented-control/segmented-control.css +264 -205
  197. package/src/components/select/select.css +117 -117
  198. package/src/components/skeleton/skeleton.css +267 -267
  199. package/src/components/split-button/split-button.css +292 -292
  200. package/src/components/stat/stat.css +433 -433
  201. package/src/components/switch/switch.css +195 -195
  202. package/src/components/table/table.css +220 -220
  203. package/src/components/tabs/tabs.css +393 -293
  204. package/src/components/textarea/textarea.css +86 -86
  205. package/src/components/toast/toast.css +345 -345
  206. package/src/components/tooltip/tooltip.css +267 -258
  207. package/src/domain/billing/index.css +629 -629
  208. package/src/domain/calendar/agenda-list/agenda-list.css +224 -224
  209. package/src/domain/calendar/day-slice/day-slice.css +384 -384
  210. package/src/domain/calendar/day-timeline/day-timeline.css +332 -332
  211. package/src/domain/calendar/event-card/event-card.css +338 -338
  212. package/src/domain/calendar/index.css +5 -5
  213. package/src/domain/calendar/month-grid/month-grid.css +426 -426
  214. package/src/domain/calendar/week-grid/week-grid.css +487 -480
  215. package/src/domain/companies/index.css +526 -526
  216. package/src/domain/index.css +3 -3
  217. package/src/index.css +5 -5
  218. package/src/index.ts +7 -7
  219. package/src/localization/index.ts +56 -56
  220. package/src/patterns/command-palette/command-palette.css +488 -447
  221. package/src/patterns/company-switcher/company-switcher.css +390 -390
  222. package/src/patterns/content-state/content-state.css +236 -236
  223. package/src/patterns/empty-state/empty-state.css +260 -260
  224. package/src/patterns/error-state/error-state.css +272 -272
  225. package/src/patterns/form-layout/form-layout.css +106 -106
  226. package/src/patterns/loading-state/loading-state.css +287 -287
  227. package/src/patterns/master-detail/master-detail.css +103 -103
  228. package/src/patterns/notification-center/notification-center.css +443 -443
  229. package/src/patterns/page/page.css +303 -303
  230. package/src/patterns/profile-menu/profile-menu.css +298 -298
  231. package/src/patterns/record-list/record-list.css +302 -302
  232. package/src/patterns/search-bar/search-bar.css +457 -457
  233. package/src/patterns/settings-layout/settings-layout.css +283 -283
  234. package/src/patterns/workflow/workflow.css +168 -168
  235. package/src/shell/app-shell/app-shell.css +429 -211
  236. package/src/shell/content-frame/content-frame.css +93 -93
  237. package/src/shell/header/header.css +328 -328
  238. package/src/shell/index.css +8 -8
  239. package/src/shell/mobile-nav/mobile-nav.css +254 -254
  240. package/src/shell/sidebar/sidebar.css +923 -314
  241. package/src/styles/accessibility.css +150 -150
  242. package/src/styles/animations/motion.css +162 -162
  243. package/src/styles/appearance/accent.css +215 -215
  244. package/src/styles/appearance/density.css +61 -61
  245. package/src/styles/appearance/motion.css +48 -40
  246. package/src/styles/base.css +83 -83
  247. package/src/styles/index.css +29 -28
  248. package/src/styles/localization.css +56 -56
  249. package/src/styles/reset.css +51 -51
  250. package/src/styles/responsive.css +101 -101
  251. package/src/styles/themes/dark.css +225 -210
  252. package/src/styles/themes/high-contrast.css +378 -298
  253. package/src/styles/themes/light.css +224 -209
  254. package/src/styles/tokens/breakpoints.css +37 -37
  255. package/src/styles/tokens/color.css +102 -102
  256. package/src/styles/tokens/compatibility.css +33 -33
  257. package/src/styles/tokens/elevation.css +33 -26
  258. package/src/styles/tokens/index.css +9 -9
  259. package/src/styles/tokens/motion.css +55 -36
  260. package/src/styles/tokens/radius.css +26 -26
  261. package/src/styles/tokens/spacing.css +56 -56
  262. package/src/styles/tokens/typography.css +85 -85
  263. package/src/styles/tokens/z-index.css +14 -14
  264. package/src/styles/utilities/glass.css +97 -0
  265. package/src/styles/utilities/layout.css +153 -153
  266. package/src/styles/utilities/text.css +152 -152
  267. package/src/styles/utilities/visibility.css +47 -47
  268. package/src/types/index.ts +126 -126
  269. package/src/version.ts +1 -1
@@ -1,226 +1,226 @@
1
- # Design-system baseline audit
2
-
3
- Audit date: 2026-07-13. Scope: the complete tracked repository plus the root `src.zip` archive manifest (which duplicates source content). This is an observation-only baseline. No source, CSS, export, test, workflow, or package change was made.
4
-
5
- ## 1. Executive summary
6
-
7
- `@neetechs/ui` 0.0.2 is a CSS-first ESM package containing 59 CSS UI modules, seven DOM-behavior helpers, and one tested appearance controller. Its declared package surface is broad (89 concrete current import paths when export globs are expanded), but the styling contract is not internally coherent: 27 `--nt-*` names are referenced without a repository-wide declaration, including all six suspected tokens. `src/components/table/table.css` is empty yet published and included by `components.css`.
8
-
9
- The only automated tests are 37 Node tests for appearance. The build passes, but it only type-checks TypeScript and copies assets; it does not parse CSS, validate tokens, test a component, exercise RTL, test accessibility, or verify browser rendering. Accent and density are documented and typed but have no CSS selectors or controller implementation. High contrast CSS exists but is outside the persisted appearance API. No `forced-colors`, `prefers-contrast`, container-query, or RTL CSS is present.
10
-
11
- The immediate refactor rule is therefore: preserve import paths, CSS class names, data/ARIA hooks, and the appearance/behavior public APIs until a versioned migration has been implemented. Repairing undefined tokens and duplicated overlay/surface patterns is a high-risk compatibility change because consumers may currently supply missing custom properties themselves.
12
-
13
- ## 2. Repository and package overview
14
-
15
- | Item | Current contract / finding |
16
- | --- | --- |
17
- | Package | `@neetechs/ui`, version `0.0.2` in `package.json`; runtime `NEETECHS_UI_VERSION` is **`0.0.1`** in `src/index.ts:2`. |
18
- | Runtime format | ESM only (`"type": "module"`); `main` and `module` are `./dist/index.js`; declarations `./dist/index.d.ts`. TypeScript target is ES2022 with DOM/DOM.Iterable libs (`tsconfig.json`). |
19
- | CSS delivery | Package `style` and all CSS export targets point at **`src`**, not `dist`; `src` is intentionally in `files`. The build also copies CSS to `dist`, creating duplicate package contents. CSS entry files are `@import` chains, not flattened. |
20
- | Published files | `files`: `dist`, `src`, `docs`, `README.md`; `npm pack --dry-run` reports 257 files, 99.4 kB tarball / 1.0 MB unpacked. It includes empty docs and `src/components/table/table.css` (0 B). |
21
- | Side effects / tree shaking | `sideEffects: ["**/*.css"]`; JavaScript modules are not explicitly marked side-effect-free. CSS is side-effectful by intent. Export globs make individual CSS imports tree-shakable only when a consumer/bundler honors package exports and CSS imports. |
22
- | Build/test/release | `build`: `tsc` then `scripts/copy-assets.mjs`; `test`: build then `node --test tests/**/*.test.mjs`; `release`: Semantic Release. No lint, CSS parse/lint, package-size, visual, browser, accessibility, RTL, or localization script. |
23
- | Publishing | `.github/workflows/publish-npm.yml` publishes on every push to `main` and manual dispatch, after `npm ci`, test, build, and `npm pack --dry-run`; `.releaserc.json` uses semantic-release npm/GitHub plugins and `main`. Workflow uses Node 24 and `actions/*@v6`. |
24
- | Compatibility | Code assumes ES2022 and browsers with DOM APIs, `queueMicrotask`, `PointerEvent`, `Event.composedPath`, `classList`, `dataset`, `matchMedia`, and `MediaQueryList` (legacy listener fallback exists only for the latter). Node is not declared in `engines`; appearance supports SSR only when globals are avoided/injected. |
25
- | Repository state observed | Pre-existing user worktree changes: tracked `.zip` deleted and untracked `src.zip` present. This audit did not alter either. |
26
-
27
- ## 3. Current public import paths
28
-
29
- The following are public according to `package.json#exports`; wildcard entries expand to every matching current file. Preserve all temporarily. Concrete count: **89** (12 JavaScript/TypeScript paths and 77 CSS paths).
30
-
31
- | Group | Public paths |
32
- | --- | --- |
33
- | JS/types | `@neetechs/ui`; `@neetechs/ui/appearance`; `@neetechs/ui/behaviors`; `@neetechs/ui/behaviors/{dialog,drawer,dropdown,focus-trap,ids,index,keyboard,overlay}`; `@neetechs/ui/types` |
34
- | global CSS | `@neetechs/ui/styles`, `@neetechs/ui/styles.css`, `@neetechs/ui/base.css`, `@neetechs/ui/tokens.css`, `@neetechs/ui/reset.css`, `@neetechs/ui/themes/{dark,light,high-contrast}.css`, `@neetechs/ui/utilities/{layout,text,visibility}.css`, `@neetechs/ui/animations/motion.css` |
35
- | shell CSS | `@neetechs/ui/shell.css`, `@neetechs/ui/shell/{app-shell,content-frame,header,mobile-nav,right-drawer,sidebar}.css` |
36
- | component CSS | `@neetechs/ui/components.css`, plus `@neetechs/ui/components/{alert,avatar,badge,breadcrumb,button,card,checkbox,chip,data-grid,dialog,drawer,dropdown,icon-button,input,menu,modal,pagination,panel,progress,radio,segmented-control,select,skeleton,split-button,switch,table,tabs,textarea,toast,tooltip}.css` |
37
- | pattern CSS | `@neetechs/ui/patterns.css`, plus `@neetechs/ui/patterns/{command-palette,company-switcher,empty-state,error-state,loading-state,notification-center,profile-menu,search-bar,workspace-switcher}.css` |
38
- | AI CSS | `@neetechs/ui/ai.css`, plus `@neetechs/ui/ai/{ai-action-button,ai-approval-card,ai-conversation-panel,ai-prompt-input,ai-proposal-card,ai-suggestion-card,ai-tool-call}.css` |
39
- | domain CSS | `@neetechs/ui/domain.css`, `@neetechs/ui/domain/{calendar,billing,companies}.css`, plus `@neetechs/ui/domain/calendar/{day-slice,day-timeline,event-card,month-grid,week-grid}.css` |
40
-
41
- `README.md:568` and `:584` additionally tell consumers to load `node_modules/@neetechs/ui/src/index.css` directly. `src` is published, but that path is not an export and is unsafe with export-enforcing resolvers; treat it as documented-but-risky, not a stable recommended import.
42
-
43
- ## 4. Component inventory
44
-
45
- All listed CSS modules are in their category index and therefore in `styles.css`; a module-specific export exists at the matching path in section 3. “Docs” means substantive component documentation, not merely an export list. No CSS module has a component-specific test. Variants and states below are CSS modifiers/attribute selectors—not behavior guarantees.
46
-
47
- | Category / item | File and root class(es) | Variants, sizes, states, responsive/a11y baseline | Docs / completeness / overlap |
48
- | --- | --- | --- | --- |
49
- | Primitives: alert, avatar, badge, breadcrumb | `src/components/{alert,avatar,badge,breadcrumb}/*.css`; `.nt-alert`, `.nt-avatar`, `.nt-badge`, `.nt-breadcrumb` | Alert tones/layouts; avatar xs–xl/shapes; badge sm–lg/tones; breadcrumb compact/mobile/truncate. Most have `:focus-visible` where interactive and reduced-motion; breadcrumb has 640px rule. | No dedicated docs/tests. Complete-looking CSS only. |
50
- | Primitives: button, icon-button, split-button | corresponding component files; `.nt-button`, `.nt-icon-button`, `.nt-split-button` | Button/icon primary/secondary/ghost/danger/AI, sm–lg, disabled/loading; split primary/ghost/danger, sm/lg, open menu. Native/ARIA disabled styling; focus rings; reduced-motion. | README documents button; no behavior initializer for split button. |
51
- | Form controls | `input`, `textarea`, `select`, `checkbox`, `radio`, `switch` files; `.nt-field`, `.nt-input`, `.nt-textarea`, `.nt-select`, `.nt-checkbox`, `.nt-radio`, `.nt-switch` | sm–lg; error/readonly/disabled as applicable. Native `:disabled`, `aria-disabled`, `aria-invalid`; checkbox/radio/switch have visually-hidden inputs. No generated `id`, label, described-by, required, or live-error behavior. | README documents input only; no tests. |
52
- | Surface/data primitives | `card`, `panel`, `table`, `data-grid`, `progress`, `skeleton` files | Card/panel surface/tone/density modifiers; data grid striped/sticky; progress sizes/tones/ring/indeterminate; skeleton shapes/sizes. `table.css` is **0 bytes**. 640px adaptations for card/panel/data-grid/skeleton; grid remains CSS-only. | README documents card; table is publicly exported but empty. Card/panel overlap; table/data-grid overlap. |
53
- | Selection/navigation primitives | `chip`, `tabs`, `segmented-control`, `pagination`, `menu`, `dropdown` files | Chips tones/sizes/selected; tabs boxed/pills/vertical/scrollable; segmented accent/ghost/vertical; pagination simple/mobile; menus layouts; dropdown sm/lg. Use `aria-selected`, `aria-current`, `aria-disabled`, `aria-expanded`, `data-state`; only dropdown has supplied behavior. | No dedicated docs/tests. Menu/dropdown overlap. |
54
- | Overlay primitives | `dialog`, `modal`, `drawer`, `toast`, `tooltip` files | Dialog/modal sm–xl/fullscreen and tone modifiers; drawer four sides/sm–xl/fullscreen; toast placements/states; tooltip side/align/tone. CSS uses `[data-state]`; dialog/drawer have helpers, modal/tooltip/toast do not. 640px overlay rules except tooltip. | README documents dialog/drawer behavior. Dialog/modal and drawer/right-drawer overlap. |
55
- | Shell | `src/shell/{app-shell,sidebar,header,content-frame,right-drawer,mobile-nav}/*.css` | App shell collapse; content widths; right drawer narrow/wide; header/app shell use 40/48/64rem breakpoints. Sidebar/mobile nav use `aria-current`. No behavior. | README documents app-shell structure only. |
56
- | Patterns | `src/patterns/{command-palette,company-switcher,workspace-switcher,profile-menu,notification-center,search-bar,empty-state,error-state,loading-state}/*.css` | Switchers/profile menu compact/wide and ARIA selected/current; command palette compact/wide; search bar sizes/states; state patterns density/tone/layout. All mostly 640px CSS; many duplicate menu/list/overlay affordances. | README gives company/profile examples only; no behavior/test. |
57
- | AI | `src/ai/{ai-action-button,ai-approval-card,ai-conversation-panel,ai-prompt-input,ai-proposal-card,ai-suggestion-card,ai-tool-call}/*.css` | Dedicated AI color treatment; action button sizes/tones/loading; cards compact/status/tone; prompt compact/large/loading/error; tool-call running/open. All but approval/proposal have reduced-motion blocks; most 640px rules. | README gives prompt/proposal markup only; no behavior/test. |
58
- | Calendar domain | `src/domain/calendar/{day-slice,day-timeline,event-card,month-grid,week-grid}/*.css` | Compact/flat/ghost; event tone modifiers; 480/760px layout rules for grids/slice and 640px for timeline/event card. CSS custom placement variables (`--nt-calendar-*`) are consumer inputs. | README documents month-grid only; no tests/behavior or date/locale logic. |
59
- | Billing / companies domain | `src/domain/{billing,companies}/index.css` | Billing status/metric/row modifiers; company card/profile/member/info structures. 640px layout rules (billing has no reduced-motion block). | README documents billing markup; no tests/behavior. |
60
- | Appearance module | `src/appearance/*.ts`; `@neetechs/ui/appearance` | System/light/dark preference resolution, cookie/cache/SSR support, listener cleanup. No accent/density/reduced-motion API. | Fully documented in `docs/theming.md`, with 37 tests; high contrast must be manually assigned. |
61
- | Behavior module | `src/behaviors/{dialog,drawer,dropdown,focus-trap,overlay,keyboard,ids}.ts`; `@neetechs/ui/behaviors` and direct behavior paths | Controllers expose `open`, `close`, `toggle`, `destroy`; dropdown has roving focus. Dialog/drawer apply role, modal ARIA, IDs, focus trap, Escape/outside/scroll behavior. | README documents three factory examples; no direct behavior tests. |
62
-
63
- The component count is **59 CSS UI modules** (30 core, 6 shell, 9 patterns, 7 AI, 7 domain); table is counted because it is publicly exported despite being empty. `src/styles/*` supplies tokens/base/utilities/animation primitives rather than UI components.
64
-
65
- ## 5. Public CSS and DOM contract
66
-
67
- ### Classification
68
-
69
- | Classification | Contract |
70
- | --- | --- |
71
- | Clearly public | Every `.nt-*` selector in shipped CSS (all are directly consumer-authored markup), all exported CSS paths, `data-nt-theme`, `data-nt-theme-preference`, appearance constants/functions, behavior factory APIs, and documented `aria-*` state selectors. |
72
- | Probably public | Component BEM elements/modifiers, `[data-state]`, `[data-side]`, `[data-align]`, `data-disabled`, placement variables (`--nt-tooltip-x/y`, `--nt-toast-swipe-x`, `--nt-calendar-*`, `--nt-search-results-*`, `--nt-progress-*`), and style tokens. They are shipped, externally usable, and have no private namespace. |
73
- | Internal implementation detail | Generated IDs such as `nt-dialog-1`, the module-global incremental ID counter, overlay scroll-lock implementation, and direct `body.style.overflow/paddingRight` manipulation. Keep behavior, not exact IDs/implementation. |
74
- | Undocumented but externally usable | All component-specific CSS exports via glob, all behavior subpaths, `data-state`, `data-side`, `data-align`, `data-disabled`, and the custom placement/progress/calendar variables. |
75
- | Documented but not implemented | `data-nt-accent` values (`orange|blue|green|purple|neutral`) and `data-nt-density` (`compact|comfortable|spacious`): only README/type declarations exist; no CSS selector or controller logic. README's direct `src/index.css` usage is not an export. |
76
-
77
- Behavior helper DOM mutations are a freeze item: dialog/drawer set `role="dialog"`, `aria-modal="true"`, `aria-expanded`, `aria-controls`, optional `aria-labelledby`, `hidden`, `data-state=open|closed`, and drawer `data-side`; dropdown sets `aria-haspopup="menu"`, `aria-expanded`, `aria-controls`, content `hidden`, `data-state`, `data-side`, and `data-align`. The dropdown default item selector is `[role="menuitem"],[role="option"],.nt-dropdown__item,.nt-menu__item` (`src/behaviors/dropdown.ts:36-41`).
78
-
79
- Storage/cookie contracts: `NT_THEME_COOKIE_NAME = "nt_theme"` (`cookie.ts:10`); cache key `nt_theme_preference` and legacy keys `themeMode`, `selectedTheme`, `aiTheme`, `billingTheme` (`cache.ts:9-21`). The package reads but never writes the cookie; it reads/writes the cache and migration deletes legacy keys.
80
-
81
- ## 6. Token declaration and usage findings
82
-
83
- Static comparison covered every CSS declaration matching `--nt-*:` and every `var(--nt-*)` use. A reference can deliberately be a consumer-set positional value, but all names below are undeclared by package CSS and resolve invalid without a consumer value/fallback.
84
-
85
- | Finding | Tokens / evidence |
86
- | --- | --- |
87
- | Referenced but undefined (27) | `--nt-accent-bg`, `--nt-accent-border`, `--nt-bg-elevated`, `--nt-bg-muted`, `--nt-bg-overlay-subtle`, `--nt-danger-bg-hover`, `--nt-line-height-relaxed`, `--nt-line-height-snug`, `--nt-shadow-2xl`, `--nt-text-code-sm`, `--nt-text-label-xs`, `--nt-z-overlay`; and consumer-input names `--nt-calendar-day-slice-used`, `--nt-calendar-event-top`, `--nt-calendar-hour-height`, `--nt-calendar-now-offset`, `--nt-progress-ring-{circumference,offset,value}`, `--nt-search-results-{top,right,bottom,left,width}`, `--nt-toast-swipe-x`, `--nt-tooltip-{x,y}`. The last group should be formally documented as inputs or supplied with fallbacks. |
88
- | Suspected tokens | All are missing: `--nt-bg-muted`, `--nt-bg-elevated`, `--nt-accent-bg`, `--nt-accent-border`, `--nt-text-label-xs`, `--nt-shadow-2xl`. High-impact references include AI modules, card/panel-like components, calendar, switchers, dialog, command palette, and tooltip. |
89
- | Defined but unused | Primitive color scale is almost wholly unused directly; unused semantic examples include `--nt-bg-shell`, `--nt-bg-inverse`, `--nt-border-muted`, `--nt-control-bg-active`, `--nt-accent-muted`, AI bubble tokens, status tokens, many breakpoint/container tokens, motion aliases, radius aliases, and z-index aliases. These are candidates for validation before removal, not safe deletion yet because consumers may read them. |
90
- | Duplicate/conflicting declarations | The expected 84 semantic theme declarations repeat in dark/light/high-contrast with different values. No accidental same-file duplicate was identified in token files; however themes contain raw color values and theme semantics are incomplete because referenced semantic names are absent from all three. |
91
- | Legacy/incompatible naming | Both semantic surface names (`--nt-bg-surface-muted`) and legacy-like aliases (`--nt-bg-muted`, `--nt-bg-elevated`) are used, but only the former are defined. Typography is mixed between composite `--nt-text-*` and missing `--nt-text-label-xs` / `--nt-text-code-sm`; line-height aliases are missing. |
92
- | Primitive bypass / hardcoding | Theme files intentionally use primitive vars and raw hex/RGBA. Component CSS uses many raw layout/radius/typography/timing values (`1px`, `3px`, `0.5rem`, fixed `640px`, `1.15s`, etc.) and `progress.css` uses hardcoded `rgba(255,255,255,.18)` stripes. This bypasses the stated semantic-only rule for non-color dimensions. |
93
- | Fallbacks | Most semantic `var()` calls have no fallback. Components therefore fail properties when an undefined token is not supplied by the application. Placement variables are the only common intentional exceptions with local fallbacks (for example tooltip x/y). |
94
-
95
- Token source files: primitive color/spacing/radius/type/elevation/motion/z-index/breakpoint declarations are in `src/styles/tokens/*.css`; 84 theme semantic declarations are in each of `src/styles/themes/{dark,light,high-contrast}.css`. No automated token validation exists.
96
-
97
- ### Prompt 2 repair status (2026-07-13)
98
-
99
- The findings above remain the historical baseline. Prompt 2 repaired all 27 undefined names: internal CSS now uses canonical tokens, 10 deprecated names are retained only in `src/styles/tokens/compatibility.css`, 17 intended canonical/component-input tokens now have declarations, and `scripts/check-design-tokens.mjs` enforces zero undefined references, valid alias graphs, and no deprecated internal usage. See `docs/design-token-contract.md` for the current contract and mapping.
100
-
101
- ### Prompt 3 semantic architecture status (2026-07-13)
102
-
103
- The historical visual-consistency findings above are now partially repaired. Dark, light, and high-contrast themes expose the same 104-role semantic color/elevation contract; 57 production CSS files use the new action, selection, AI, financial, surface, elevation, or radius roles. Component-layer counts are now zero for primitive palette references, hardcoded colors, raw shadow-scale references, and raw radius-scale references. Twenty-five legacy names remain as one-hop compatibility aliases. Semantic enforcement and focused tests are part of `npm run check:tokens` / `npm test`; runtime contrast and screenshot approval remain unresolved.
104
-
105
- ## 7. Theme and appearance findings
106
-
107
- > Prompt 4 remediation (2026-07-13): the historical findings in this section remain the frozen baseline, but the package now implements typed theme/accent/density/motion/contrast preferences, full root attributes, versioned cookie/cache bootstrap, backend application, system listeners and cleanup, forced-colors/prefers-contrast layers, and SSR injection. High contrast is now layered over light/dark; the old `data-nt-theme='high-contrast'` stylesheet selector is compatibility-only. Focused appearance coverage increased the suite from 59 to 72 tests before final verification. Browser screenshot and component-level contrast review remain unresolved.
108
-
109
- | Feature | Implemented baseline | Gap / status |
110
- | --- | --- | --- |
111
- | Dark/light/system | CSS selectors in themes; controller resolves `system` via `(prefers-color-scheme: dark)` and writes root attributes. | Works in tested fake DOM/media environment. No browser integration test. |
112
- | High contrast | `data-nt-theme='high-contrast'` CSS has its own 84 declarations. | Controller types reject `high-contrast`; cookie/cache/backend preference cannot carry it. No `forced-colors` or `prefers-contrast` bridge. |
113
- | Accent / density | README and `NtAccentName`/`NtDensityName` types advertise values. | **Nonfunctional:** no `[data-nt-accent]` or `[data-nt-density]` CSS anywhere, no controller state, persistence, listener, or tests. |
114
- | Reduced motion | Base stylesheet and many component files have `prefers-reduced-motion: reduce` rules. | Uneven: AI approval/proposal, billing, empty/error patterns and several others lack module-local reduced-motion rules; no test validates computed animation. |
115
- | Persistence / migration | Cookie → cache → system → fallback, cache failure guards, explicit SSR cookie, legacy-cache migration, system listener and `destroy()` cleanup. | Backend persistence is deliberately external. Cookie attributes/domain are documentation only; package cannot set/verify them. |
116
- | SSR / hydration | Globals are avoided at import, options inject document/media/storage/cookie, SSR fallback is dark. | Server must call API with the request cookie and render matching root attribute; no framework/hydration test proves integration. |
117
-
118
- `docs/theming.md` accurately documents the controller’s stored values and source ordering. README contradicts it by presenting high-contrast alongside “supported themes” in the general setup while the controller can only persist dark/light/system.
119
-
120
- ## 8. Accessibility baseline
121
-
122
- > Prompt 5 remediation (2026-07-13): the historical findings below remain the frozen baseline. The package now has semantic contrast/focus/target checks, forced-colors and reduced-motion coverage, nested overlay/focus management, additive tabs/grid/calendar/forms/announcer helpers, a 59-module accessibility inventory in `docs/accessibility.md`, 76 unit checks, and 10 passing Chromium keyboard/axe contracts. Formal certification, manual screen-reader interoperability, advanced combobox/grid/calendar behavior, responsive reflow, RTL, and localization remain unresolved.
123
-
124
- > Prompt 6 remediation (2026-07-13): the frozen RTL findings below are now addressed by native inherited direction, logical CSS migrations, reviewed physical-coordinate exceptions, Arabic typography hooks, bidi utilities, explicit-locale `Intl` helpers, direction-aware keyboard behavior, `check:rtl`, and representative Chromium LTR/RTL/zoom tests. Full responsive calendar/data-grid redesign, application font loading/translations, and native Arabic screen-reader QA remain unresolved.
125
-
126
- Implemented evidence: most interactive CSS modules use `:focus-visible` with a focus token; form styles recognize native disabled and `aria-invalid`; dialog/drawer create focus traps, restore focus by default, close on Escape/outside by default, lock scroll, set dialog roles/labels when title is passed; dropdown provides keyboard activation, up/down/home/end roving focus, Escape and outside closing. `src/behaviors/focus-trap.ts` excludes disabled/`aria-disabled` elements.
127
-
128
- Limits: CSS alone supplies no roles, labels, required indicators, error `aria-describedby` association, read-only semantics, live regions, toast announcements, loading announcements, dialog title requirement, or target-size validation. Modal, tooltip, toast, menu, tabs, segmented control, command palette, search bar, notification center, switchers, data grid, and calendar have no dedicated behavior/controller. `aria-*` attributes are frequently styling selectors and are consumer obligations. No contrast calculations, accessibility tests, screen-reader tests, or browser keyboard tests exist; do **not** claim WCAG compliance.
129
-
130
- ## 9. Responsive behavior baseline
131
-
132
- The responsive implementation is viewport-only: dominant breakpoint `max-width: 640px`, calendar `480px/760px`, shell `40rem/48rem/64rem`. Breakpoint tokens are declared but CSS media queries mostly hardcode values. There are zero `@container` queries. Shell/header/content frame have explicit narrow rules; dialogs, drawers, modal, data grid, card/panel, most patterns and AI cards have 640px rules. Calendar grids switch/reduce at 480/760px.
133
-
134
- Risk areas needing runtime verification: tables/data grids retain wide tabular DOM and rely on overflow/sticky styles rather than an alternate compact representation; calendar timeline/week layouts use absolute placement variables; switchers/menus/search results use fixed min/max widths; mobile nav is CSS only; no test covers long text, narrow containers, touch targets, or overflow. A breakpoint rule is not proof of usable adaptation.
135
-
136
- ## 10. RTL and localization baseline
137
-
138
- No `[dir]`, `:dir()`, or `direction` selector was found. There are many physical direction properties: tooltip side/arrow placement, split-button borders/menu origin, toast positions/origins, tabs vertical borders, select chevrons, timeline grid borders/offsets, progress transform origin, and calendar placement use `left`/`right`. Some properties use logical `text-align: start`, but the system is not RTL-safe.
139
-
140
- There is no locale, date, number, currency, financial, Swedish-expansion, Arabic, bidi, or mixed-direction formatting API. Billing/calendar markup only displays consumer-provided strings; it supplies no `Intl` behavior. Long text is handled selectively by truncation/overflow CSS, not a localization contract.
141
-
142
- ## 11. Duplicate and overlapping components
143
-
144
- > Prompt 7 remediation (2026-07-14): modal now delegates to canonical dialog CSS/behavior, workspace switcher uses shared entity-switcher CSS, and the legacy right-drawer path/classes are owned by canonical drawer CSS. Exact package exports preserve all three old paths. Card/panel, table/data-grid, and badge/chip remain intentionally separate because their semantics differ. The empty table stylesheet is now a functional native-table contract. See `docs/component-architecture.md`.
145
-
146
- | Likely group | Evidence / freeze classification |
147
- | --- | --- |
148
- | dialog vs modal | Both ship full backdrop, header/body/footer, size, state, focus styling and 640px rules (`dialog.css`, `modal.css`). Only dialog has `ntCreateDialog`; do not merge/remove before consumers are mapped. |
149
- | drawer vs right-drawer | Drawer is a behavioral four-side overlay; shell right drawer is CSS-only right-side layout. Both expose right-side panels; preserve both pending semantic decision. |
150
- | card vs panel | Both are configurable bordered surfaces with header/body/footer, compact/spacious, flat/ghost/raised/elevated, interactive and tone modifiers. Strong duplication. |
151
- | company-switcher vs workspace-switcher | Near-parallel selectable list/popover structures, compact/wide modifiers, active/current/selected/disabled hooks, headers/search/items/footer. Strong duplication. |
152
- | menu/dropdown/profile-menu/switchers | Menu and dropdown share item/list/selection patterns; profile/company/workspace are domain-shaped menus. Dropdown is the only generic behavior controller. Do not collapse without preserving markup/class contracts. |
153
- | table vs data-grid | `table.css` is empty, while data-grid provides all apparent table styles, sticky/selection/sorting hooks. Table is a broken/empty public export and should be classified as non-preservable implementation surface after a deprecation plan. |
154
- | state patterns | Empty/error/loading states repeat card-like layouts, fixed icons/sizes and 640px rules. Candidate consolidation, but public markup differs. |
155
-
156
- At least **seven** likely duplicate/overlap groups exist (the six requested groups plus state-pattern duplication).
157
-
158
- ## 12. Visual consistency problems
159
-
160
- Visual language is not verifiably consistent. Core, AI, domain and patterns independently restate border widths, focus shadow spreads, fixed sizing, media queries, surface treatments and transitions. Key examples: dialog/command palette use missing `--nt-shadow-2xl`; tooltip uses missing elevated/muted surfaces; AI/calendar/switcher modules use missing accent/background aliases; progress hardcodes white stripe color; shell uses rem breakpoints whereas most modules use 640px. Card/panel/state patterns duplicate elevation and nesting logic. AI has a separate purple token family but lack of a defined accent-background semantic means its treatment can fail. Billing and some state modules lack the reduced-motion coverage common in core.
161
-
162
- No visual-regression or screenshot test exists, so this is static evidence, not a visual approval.
163
-
164
- ## 13. Testing and CI coverage
165
-
166
- `tests/appearance.test.mjs` is the sole test file. Its 37 tests validate preference normalization/resolution, root attributes, SSR fake DOM behavior, cookie parsing, source order, cache failure/invalid values/migration, media listener lifecycle, subscriptions, and absence of network API calls in appearance source. It does not run in a browser and does not test CSS.
167
-
168
- The CI workflow runs install/test/build/package dry-run then semantic release. There are no unit/integration tests for behavior helpers; no CSS lint/type check beyond TS; no token validator; no a11y, browser, RTL/localization, visual/screenshot, package-size, or package-content assertion (the dry-run is informational only).
169
-
170
- ## 14. Documented features that do not work
171
-
172
- 1. README’s `data-nt-accent` and `data-nt-density` setup has no implementation.
173
- 2. ~~The exported `table.css` and its inclusion in `components.css` yielded no table CSS.~~ Prompt 7 implemented a native read-only table contract while preserving the path; interactive data-grid behavior remains separate.
174
- 3. README direct paths to `node_modules/@neetechs/ui/src/index.css` bypass `exports` and are unsuitable for export-enforcing tooling.
175
- 4. The public runtime version (`0.0.1`) disagrees with package version (`0.0.2`).
176
- 5. Documentation describes generic theme setup including high contrast, but stored appearance values and controller resolution do not support high contrast.
177
- 6. `docs/accessibility.md`, `docs/component-guidelines.md`, and `docs/migration.md` are published zero-byte files.
178
-
179
- ## 15. Potential breaking-change risks
180
-
181
- - Changing/renaming any `@neetechs/ui/*` export, including glob-derived component CSS, breaks direct imports.
182
- - Renaming `.nt-*` BEM classes/modifiers or `[data-state|side|align]` values breaks consumer HTML and CSS overrides.
183
- - Defining currently undefined tokens changes currently-invalid declarations and may override consumer-provided values; use an alias/deprecation layer first.
184
- - Changing cookie/cache names or source ordering changes anti-flash/SSR behavior across applications.
185
- - Altering dialog/drawer/dropdown defaults, ARIA mutations, focus restoration, `hidden`, scroll locking or event behavior breaks integrations.
186
- - Replacing physical placement or responsive behavior may alter absolute-positioned calendars/tooltips/toasts.
187
- - Removing duplicate modules, even table, requires an export deprecation because all are public/published.
188
-
189
- ## 16. Safe-to-change internal implementation details
190
-
191
- Subject to behavior-preserving tests: TypeScript private closure layout; generated numeric ID format; focus/overlay listener bookkeeping; build asset-copy implementation; comments; duplicate `dist` CSS copies; internal theme raw-value organization; CSS declaration ordering that does not affect cascade; and unpublished archive/root artifact handling. The zero-byte table implementation itself is not a useful contract, but its import path must remain temporarily (for example via a compatibility file).
192
-
193
- ## 17. Public API freeze for the upcoming refactor
194
-
195
- Preserve temporarily: all 89 paths in section 3; all `.nt-*` selectors and current modifiers; `data-nt-theme`, `data-nt-theme-preference`, `data-state`, `data-side`, `data-align`, `data-disabled`; CSS custom properties used as consumer inputs; appearance exports/options/types; `nt_theme`, `nt_theme_preference`, and four legacy cache keys; and all behavior factory/controller methods and DOM effects.
196
-
197
- Historical Prompt 1 classification was: the empty table implementation, direct `src/index.css` documentation path, undocumented generated IDs, nonfunctional accent/density, missing-token aliases, and duplicate components. Prompts 2-7 have implemented the token/appearance/table contracts and placed duplicates behind tested compatibility layers; removal still requires the documented migration window.
198
-
199
- ## 18. Recommended migration order
200
-
201
- 1. Add automated contract snapshots for exports, selectors, tokens and package contents—without changing production CSS.
202
- 2. Decide and publish the compatibility policy for table, direct-source imports, duplicate overlay/surface modules and accent/density.
203
- 3. Create a token manifest; define every missing semantic token across all themes or introduce explicit compatibility aliases, then add token validation.
204
- 4. Make appearance API/CSS coherent (high contrast, accents, density, forced colors/contrast) with SSR/browser tests.
205
- 5. Add behavior, accessibility and browser tests before altering interactive components.
206
- 6. Repair responsive/RTL/localization foundations using logical properties and component runtime fixtures.
207
- 7. Consolidate duplicate implementations behind preserved public classes/exports, then deprecate in a major-version migration.
208
- 8. Add visual regression and package-content gates before release.
209
-
210
- ## 19. Commands executed and results
211
-
212
- | Command | Result |
213
- | --- | --- |
214
- | repository instruction reads; tracked-file/source/doc/workflow searches; static token/selector/media/RTL scans | Completed read-only. No nested instruction file beyond `CLAUDE.local.md`; root `CLAUDE.md`, `AGENTS.md`, and `CONTRIBUTING.md` absent. |
215
- | `npm ci` | Passed: 303 packages added, 447 audited, 0 vulnerabilities. |
216
- | `npm test` | Initial sandbox attempt failed `spawn EPERM`; rerun outside sandbox passed: build plus **37/37** appearance tests. |
217
- | `npm run build` | Passed (`tsc` plus asset copy). |
218
- | `npm pack --dry-run` | Initial sandbox attempt failed cache `EPERM`; rerun outside sandbox passed: 257 files, 99.4 kB package, 1.0 MB unpacked. |
219
-
220
- ## 20. Uncertainties and items requiring runtime verification
221
-
222
- - No real browser, assistive technology, visual, touch, narrow-width, forced-colors, RTL, Arabic, Swedish, or long-content execution was performed; static CSS cannot establish usability or contrast.
223
- - Consumer applications may rely on undocumented selectors, missing custom properties, direct `src` paths, and duplicate components; repository-only audit cannot enumerate them.
224
- - CSS `@import` resolution and tree-shaking behavior vary by consumer bundler and must be tested from a packed tarball in representative Angular/React/plain-CSS fixtures.
225
- - Theme cookie domain/security attributes are backend-owned and cannot be verified here.
226
- - The root archive/worktree `.zip` → `src.zip` state appears pre-existing and was not opened beyond manifest listing; confirm whether it belongs in the repository before changing artifact policy.
1
+ # Design-system baseline audit
2
+
3
+ Audit date: 2026-07-13. Scope: the complete tracked repository plus the root `src.zip` archive manifest (which duplicates source content). This is an observation-only baseline. No source, CSS, export, test, workflow, or package change was made.
4
+
5
+ ## 1. Executive summary
6
+
7
+ `@neetechs/ui` 0.0.2 is a CSS-first ESM package containing 59 CSS UI modules, seven DOM-behavior helpers, and one tested appearance controller. Its declared package surface is broad (89 concrete current import paths when export globs are expanded), but the styling contract is not internally coherent: 27 `--nt-*` names are referenced without a repository-wide declaration, including all six suspected tokens. `src/components/table/table.css` is empty yet published and included by `components.css`.
8
+
9
+ The only automated tests are 37 Node tests for appearance. The build passes, but it only type-checks TypeScript and copies assets; it does not parse CSS, validate tokens, test a component, exercise RTL, test accessibility, or verify browser rendering. Accent and density are documented and typed but have no CSS selectors or controller implementation. High contrast CSS exists but is outside the persisted appearance API. No `forced-colors`, `prefers-contrast`, container-query, or RTL CSS is present.
10
+
11
+ The immediate refactor rule is therefore: preserve import paths, CSS class names, data/ARIA hooks, and the appearance/behavior public APIs until a versioned migration has been implemented. Repairing undefined tokens and duplicated overlay/surface patterns is a high-risk compatibility change because consumers may currently supply missing custom properties themselves.
12
+
13
+ ## 2. Repository and package overview
14
+
15
+ | Item | Current contract / finding |
16
+ | --- | --- |
17
+ | Package | `@neetechs/ui`, version `0.0.2` in `package.json`; runtime `NEETECHS_UI_VERSION` is **`0.0.1`** in `src/index.ts:2`. |
18
+ | Runtime format | ESM only (`"type": "module"`); `main` and `module` are `./dist/index.js`; declarations `./dist/index.d.ts`. TypeScript target is ES2022 with DOM/DOM.Iterable libs (`tsconfig.json`). |
19
+ | CSS delivery | Package `style` and all CSS export targets point at **`src`**, not `dist`; `src` is intentionally in `files`. The build also copies CSS to `dist`, creating duplicate package contents. CSS entry files are `@import` chains, not flattened. |
20
+ | Published files | `files`: `dist`, `src`, `docs`, `README.md`; `npm pack --dry-run` reports 257 files, 99.4 kB tarball / 1.0 MB unpacked. It includes empty docs and `src/components/table/table.css` (0 B). |
21
+ | Side effects / tree shaking | `sideEffects: ["**/*.css"]`; JavaScript modules are not explicitly marked side-effect-free. CSS is side-effectful by intent. Export globs make individual CSS imports tree-shakable only when a consumer/bundler honors package exports and CSS imports. |
22
+ | Build/test/release | `build`: `tsc` then `scripts/copy-assets.mjs`; `test`: build then `node --test tests/**/*.test.mjs`; `release`: Semantic Release. No lint, CSS parse/lint, package-size, visual, browser, accessibility, RTL, or localization script. |
23
+ | Publishing | `.github/workflows/publish-npm.yml` publishes on every push to `main` and manual dispatch, after `npm ci`, test, build, and `npm pack --dry-run`; `.releaserc.json` uses semantic-release npm/GitHub plugins and `main`. Workflow uses Node 24 and `actions/*@v6`. |
24
+ | Compatibility | Code assumes ES2022 and browsers with DOM APIs, `queueMicrotask`, `PointerEvent`, `Event.composedPath`, `classList`, `dataset`, `matchMedia`, and `MediaQueryList` (legacy listener fallback exists only for the latter). Node is not declared in `engines`; appearance supports SSR only when globals are avoided/injected. |
25
+ | Repository state observed | Pre-existing user worktree changes: tracked `.zip` deleted and untracked `src.zip` present. This audit did not alter either. |
26
+
27
+ ## 3. Current public import paths
28
+
29
+ The following are public according to `package.json#exports`; wildcard entries expand to every matching current file. Preserve all temporarily. Concrete count: **89** (12 JavaScript/TypeScript paths and 77 CSS paths).
30
+
31
+ | Group | Public paths |
32
+ | --- | --- |
33
+ | JS/types | `@neetechs/ui`; `@neetechs/ui/appearance`; `@neetechs/ui/behaviors`; `@neetechs/ui/behaviors/{dialog,drawer,dropdown,focus-trap,ids,index,keyboard,overlay}`; `@neetechs/ui/types` |
34
+ | global CSS | `@neetechs/ui/styles`, `@neetechs/ui/styles.css`, `@neetechs/ui/base.css`, `@neetechs/ui/tokens.css`, `@neetechs/ui/reset.css`, `@neetechs/ui/themes/{dark,light,high-contrast}.css`, `@neetechs/ui/utilities/{layout,text,visibility}.css`, `@neetechs/ui/animations/motion.css` |
35
+ | shell CSS | `@neetechs/ui/shell.css`, `@neetechs/ui/shell/{app-shell,content-frame,header,mobile-nav,right-drawer,sidebar}.css` |
36
+ | component CSS | `@neetechs/ui/components.css`, plus `@neetechs/ui/components/{alert,avatar,badge,breadcrumb,button,card,checkbox,chip,data-grid,dialog,drawer,dropdown,icon-button,input,menu,modal,pagination,panel,progress,radio,segmented-control,select,skeleton,split-button,switch,table,tabs,textarea,toast,tooltip}.css` |
37
+ | pattern CSS | `@neetechs/ui/patterns.css`, plus `@neetechs/ui/patterns/{command-palette,company-switcher,empty-state,error-state,loading-state,notification-center,profile-menu,search-bar,workspace-switcher}.css` |
38
+ | AI CSS | `@neetechs/ui/ai.css`, plus `@neetechs/ui/ai/{ai-action-button,ai-approval-card,ai-conversation-panel,ai-prompt-input,ai-proposal-card,ai-suggestion-card,ai-tool-call}.css` |
39
+ | domain CSS | `@neetechs/ui/domain.css`, `@neetechs/ui/domain/{calendar,billing,companies}.css`, plus `@neetechs/ui/domain/calendar/{day-slice,day-timeline,event-card,month-grid,week-grid}.css` |
40
+
41
+ `README.md:568` and `:584` additionally tell consumers to load `node_modules/@neetechs/ui/src/index.css` directly. `src` is published, but that path is not an export and is unsafe with export-enforcing resolvers; treat it as documented-but-risky, not a stable recommended import.
42
+
43
+ ## 4. Component inventory
44
+
45
+ All listed CSS modules are in their category index and therefore in `styles.css`; a module-specific export exists at the matching path in section 3. “Docs” means substantive component documentation, not merely an export list. No CSS module has a component-specific test. Variants and states below are CSS modifiers/attribute selectors—not behavior guarantees.
46
+
47
+ | Category / item | File and root class(es) | Variants, sizes, states, responsive/a11y baseline | Docs / completeness / overlap |
48
+ | --- | --- | --- | --- |
49
+ | Primitives: alert, avatar, badge, breadcrumb | `src/components/{alert,avatar,badge,breadcrumb}/*.css`; `.nt-alert`, `.nt-avatar`, `.nt-badge`, `.nt-breadcrumb` | Alert tones/layouts; avatar xs–xl/shapes; badge sm–lg/tones; breadcrumb compact/mobile/truncate. Most have `:focus-visible` where interactive and reduced-motion; breadcrumb has 640px rule. | No dedicated docs/tests. Complete-looking CSS only. |
50
+ | Primitives: button, icon-button, split-button | corresponding component files; `.nt-button`, `.nt-icon-button`, `.nt-split-button` | Button/icon primary/secondary/ghost/danger/AI, sm–lg, disabled/loading; split primary/ghost/danger, sm/lg, open menu. Native/ARIA disabled styling; focus rings; reduced-motion. | README documents button; no behavior initializer for split button. |
51
+ | Form controls | `input`, `textarea`, `select`, `checkbox`, `radio`, `switch` files; `.nt-field`, `.nt-input`, `.nt-textarea`, `.nt-select`, `.nt-checkbox`, `.nt-radio`, `.nt-switch` | sm–lg; error/readonly/disabled as applicable. Native `:disabled`, `aria-disabled`, `aria-invalid`; checkbox/radio/switch have visually-hidden inputs. No generated `id`, label, described-by, required, or live-error behavior. | README documents input only; no tests. |
52
+ | Surface/data primitives | `card`, `panel`, `table`, `data-grid`, `progress`, `skeleton` files | Card/panel surface/tone/density modifiers; data grid striped/sticky; progress sizes/tones/ring/indeterminate; skeleton shapes/sizes. `table.css` is **0 bytes**. 640px adaptations for card/panel/data-grid/skeleton; grid remains CSS-only. | README documents card; table is publicly exported but empty. Card/panel overlap; table/data-grid overlap. |
53
+ | Selection/navigation primitives | `chip`, `tabs`, `segmented-control`, `pagination`, `menu`, `dropdown` files | Chips tones/sizes/selected; tabs boxed/pills/vertical/scrollable; segmented accent/ghost/vertical; pagination simple/mobile; menus layouts; dropdown sm/lg. Use `aria-selected`, `aria-current`, `aria-disabled`, `aria-expanded`, `data-state`; only dropdown has supplied behavior. | No dedicated docs/tests. Menu/dropdown overlap. |
54
+ | Overlay primitives | `dialog`, `modal`, `drawer`, `toast`, `tooltip` files | Dialog/modal sm–xl/fullscreen and tone modifiers; drawer four sides/sm–xl/fullscreen; toast placements/states; tooltip side/align/tone. CSS uses `[data-state]`; dialog/drawer have helpers, modal/tooltip/toast do not. 640px overlay rules except tooltip. | README documents dialog/drawer behavior. Dialog/modal and drawer/right-drawer overlap. |
55
+ | Shell | `src/shell/{app-shell,sidebar,header,content-frame,right-drawer,mobile-nav}/*.css` | App shell collapse; content widths; right drawer narrow/wide; header/app shell use 40/48/64rem breakpoints. Sidebar/mobile nav use `aria-current`. No behavior. | README documents app-shell structure only. |
56
+ | Patterns | `src/patterns/{command-palette,company-switcher,workspace-switcher,profile-menu,notification-center,search-bar,empty-state,error-state,loading-state}/*.css` | Switchers/profile menu compact/wide and ARIA selected/current; command palette compact/wide; search bar sizes/states; state patterns density/tone/layout. All mostly 640px CSS; many duplicate menu/list/overlay affordances. | README gives company/profile examples only; no behavior/test. |
57
+ | AI | `src/ai/{ai-action-button,ai-approval-card,ai-conversation-panel,ai-prompt-input,ai-proposal-card,ai-suggestion-card,ai-tool-call}/*.css` | Dedicated AI color treatment; action button sizes/tones/loading; cards compact/status/tone; prompt compact/large/loading/error; tool-call running/open. All but approval/proposal have reduced-motion blocks; most 640px rules. | README gives prompt/proposal markup only; no behavior/test. |
58
+ | Calendar domain | `src/domain/calendar/{day-slice,day-timeline,event-card,month-grid,week-grid}/*.css` | Compact/flat/ghost; event tone modifiers; 480/760px layout rules for grids/slice and 640px for timeline/event card. CSS custom placement variables (`--nt-calendar-*`) are consumer inputs. | README documents month-grid only; no tests/behavior or date/locale logic. |
59
+ | Billing / companies domain | `src/domain/{billing,companies}/index.css` | Billing status/metric/row modifiers; company card/profile/member/info structures. 640px layout rules (billing has no reduced-motion block). | README documents billing markup; no tests/behavior. |
60
+ | Appearance module | `src/appearance/*.ts`; `@neetechs/ui/appearance` | System/light/dark preference resolution, cookie/cache/SSR support, listener cleanup. No accent/density/reduced-motion API. | Fully documented in `docs/theming.md`, with 37 tests; high contrast must be manually assigned. |
61
+ | Behavior module | `src/behaviors/{dialog,drawer,dropdown,focus-trap,overlay,keyboard,ids}.ts`; `@neetechs/ui/behaviors` and direct behavior paths | Controllers expose `open`, `close`, `toggle`, `destroy`; dropdown has roving focus. Dialog/drawer apply role, modal ARIA, IDs, focus trap, Escape/outside/scroll behavior. | README documents three factory examples; no direct behavior tests. |
62
+
63
+ The component count is **59 CSS UI modules** (30 core, 6 shell, 9 patterns, 7 AI, 7 domain); table is counted because it is publicly exported despite being empty. `src/styles/*` supplies tokens/base/utilities/animation primitives rather than UI components.
64
+
65
+ ## 5. Public CSS and DOM contract
66
+
67
+ ### Classification
68
+
69
+ | Classification | Contract |
70
+ | --- | --- |
71
+ | Clearly public | Every `.nt-*` selector in shipped CSS (all are directly consumer-authored markup), all exported CSS paths, `data-nt-theme`, `data-nt-theme-preference`, appearance constants/functions, behavior factory APIs, and documented `aria-*` state selectors. |
72
+ | Probably public | Component BEM elements/modifiers, `[data-state]`, `[data-side]`, `[data-align]`, `data-disabled`, placement variables (`--nt-tooltip-x/y`, `--nt-toast-swipe-x`, `--nt-calendar-*`, `--nt-search-results-*`, `--nt-progress-*`), and style tokens. They are shipped, externally usable, and have no private namespace. |
73
+ | Internal implementation detail | Generated IDs such as `nt-dialog-1`, the module-global incremental ID counter, overlay scroll-lock implementation, and direct `body.style.overflow/paddingRight` manipulation. Keep behavior, not exact IDs/implementation. |
74
+ | Undocumented but externally usable | All component-specific CSS exports via glob, all behavior subpaths, `data-state`, `data-side`, `data-align`, `data-disabled`, and the custom placement/progress/calendar variables. |
75
+ | Documented but not implemented | `data-nt-accent` values (`orange|blue|green|purple|neutral`) and `data-nt-density` (`compact|comfortable|spacious`): only README/type declarations exist; no CSS selector or controller logic. README's direct `src/index.css` usage is not an export. |
76
+
77
+ Behavior helper DOM mutations are a freeze item: dialog/drawer set `role="dialog"`, `aria-modal="true"`, `aria-expanded`, `aria-controls`, optional `aria-labelledby`, `hidden`, `data-state=open|closed`, and drawer `data-side`; dropdown sets `aria-haspopup="menu"`, `aria-expanded`, `aria-controls`, content `hidden`, `data-state`, `data-side`, and `data-align`. The dropdown default item selector is `[role="menuitem"],[role="option"],.nt-dropdown__item,.nt-menu__item` (`src/behaviors/dropdown.ts:36-41`).
78
+
79
+ Storage/cookie contracts: `NT_THEME_COOKIE_NAME = "nt_theme"` (`cookie.ts:10`); cache key `nt_theme_preference` and legacy keys `themeMode`, `selectedTheme`, `aiTheme`, `billingTheme` (`cache.ts:9-21`). The package reads but never writes the cookie; it reads/writes the cache and migration deletes legacy keys.
80
+
81
+ ## 6. Token declaration and usage findings
82
+
83
+ Static comparison covered every CSS declaration matching `--nt-*:` and every `var(--nt-*)` use. A reference can deliberately be a consumer-set positional value, but all names below are undeclared by package CSS and resolve invalid without a consumer value/fallback.
84
+
85
+ | Finding | Tokens / evidence |
86
+ | --- | --- |
87
+ | Referenced but undefined (27) | `--nt-accent-bg`, `--nt-accent-border`, `--nt-bg-elevated`, `--nt-bg-muted`, `--nt-bg-overlay-subtle`, `--nt-danger-bg-hover`, `--nt-line-height-relaxed`, `--nt-line-height-snug`, `--nt-shadow-2xl`, `--nt-text-code-sm`, `--nt-text-label-xs`, `--nt-z-overlay`; and consumer-input names `--nt-calendar-day-slice-used`, `--nt-calendar-event-top`, `--nt-calendar-hour-height`, `--nt-calendar-now-offset`, `--nt-progress-ring-{circumference,offset,value}`, `--nt-search-results-{top,right,bottom,left,width}`, `--nt-toast-swipe-x`, `--nt-tooltip-{x,y}`. The last group should be formally documented as inputs or supplied with fallbacks. |
88
+ | Suspected tokens | All are missing: `--nt-bg-muted`, `--nt-bg-elevated`, `--nt-accent-bg`, `--nt-accent-border`, `--nt-text-label-xs`, `--nt-shadow-2xl`. High-impact references include AI modules, card/panel-like components, calendar, switchers, dialog, command palette, and tooltip. |
89
+ | Defined but unused | Primitive color scale is almost wholly unused directly; unused semantic examples include `--nt-bg-shell`, `--nt-bg-inverse`, `--nt-border-muted`, `--nt-control-bg-active`, `--nt-accent-muted`, AI bubble tokens, status tokens, many breakpoint/container tokens, motion aliases, radius aliases, and z-index aliases. These are candidates for validation before removal, not safe deletion yet because consumers may read them. |
90
+ | Duplicate/conflicting declarations | The expected 84 semantic theme declarations repeat in dark/light/high-contrast with different values. No accidental same-file duplicate was identified in token files; however themes contain raw color values and theme semantics are incomplete because referenced semantic names are absent from all three. |
91
+ | Legacy/incompatible naming | Both semantic surface names (`--nt-bg-surface-muted`) and legacy-like aliases (`--nt-bg-muted`, `--nt-bg-elevated`) are used, but only the former are defined. Typography is mixed between composite `--nt-text-*` and missing `--nt-text-label-xs` / `--nt-text-code-sm`; line-height aliases are missing. |
92
+ | Primitive bypass / hardcoding | Theme files intentionally use primitive vars and raw hex/RGBA. Component CSS uses many raw layout/radius/typography/timing values (`1px`, `3px`, `0.5rem`, fixed `640px`, `1.15s`, etc.) and `progress.css` uses hardcoded `rgba(255,255,255,.18)` stripes. This bypasses the stated semantic-only rule for non-color dimensions. |
93
+ | Fallbacks | Most semantic `var()` calls have no fallback. Components therefore fail properties when an undefined token is not supplied by the application. Placement variables are the only common intentional exceptions with local fallbacks (for example tooltip x/y). |
94
+
95
+ Token source files: primitive color/spacing/radius/type/elevation/motion/z-index/breakpoint declarations are in `src/styles/tokens/*.css`; 84 theme semantic declarations are in each of `src/styles/themes/{dark,light,high-contrast}.css`. No automated token validation exists.
96
+
97
+ ### Prompt 2 repair status (2026-07-13)
98
+
99
+ The findings above remain the historical baseline. Prompt 2 repaired all 27 undefined names: internal CSS now uses canonical tokens, 10 deprecated names are retained only in `src/styles/tokens/compatibility.css`, 17 intended canonical/component-input tokens now have declarations, and `scripts/check-design-tokens.mjs` enforces zero undefined references, valid alias graphs, and no deprecated internal usage. See `docs/design-token-contract.md` for the current contract and mapping.
100
+
101
+ ### Prompt 3 semantic architecture status (2026-07-13)
102
+
103
+ The historical visual-consistency findings above are now partially repaired. Dark, light, and high-contrast themes expose the same 104-role semantic color/elevation contract; 57 production CSS files use the new action, selection, AI, financial, surface, elevation, or radius roles. Component-layer counts are now zero for primitive palette references, hardcoded colors, raw shadow-scale references, and raw radius-scale references. Twenty-five legacy names remain as one-hop compatibility aliases. Semantic enforcement and focused tests are part of `npm run check:tokens` / `npm test`; runtime contrast and screenshot approval remain unresolved.
104
+
105
+ ## 7. Theme and appearance findings
106
+
107
+ > Prompt 4 remediation (2026-07-13): the historical findings in this section remain the frozen baseline, but the package now implements typed theme/accent/density/motion/contrast preferences, full root attributes, versioned cookie/cache bootstrap, backend application, system listeners and cleanup, forced-colors/prefers-contrast layers, and SSR injection. High contrast is now layered over light/dark; the old `data-nt-theme='high-contrast'` stylesheet selector is compatibility-only. Focused appearance coverage increased the suite from 59 to 72 tests before final verification. Browser screenshot and component-level contrast review remain unresolved.
108
+
109
+ | Feature | Implemented baseline | Gap / status |
110
+ | --- | --- | --- |
111
+ | Dark/light/system | CSS selectors in themes; controller resolves `system` via `(prefers-color-scheme: dark)` and writes root attributes. | Works in tested fake DOM/media environment. No browser integration test. |
112
+ | High contrast | `data-nt-theme='high-contrast'` CSS has its own 84 declarations. | Controller types reject `high-contrast`; cookie/cache/backend preference cannot carry it. No `forced-colors` or `prefers-contrast` bridge. |
113
+ | Accent / density | README and `NtAccentName`/`NtDensityName` types advertise values. | **Nonfunctional:** no `[data-nt-accent]` or `[data-nt-density]` CSS anywhere, no controller state, persistence, listener, or tests. |
114
+ | Reduced motion | Base stylesheet and many component files have `prefers-reduced-motion: reduce` rules. | Uneven: AI approval/proposal, billing, empty/error patterns and several others lack module-local reduced-motion rules; no test validates computed animation. |
115
+ | Persistence / migration | Cookie → cache → system → fallback, cache failure guards, explicit SSR cookie, legacy-cache migration, system listener and `destroy()` cleanup. | Backend persistence is deliberately external. Cookie attributes/domain are documentation only; package cannot set/verify them. |
116
+ | SSR / hydration | Globals are avoided at import, options inject document/media/storage/cookie, SSR fallback is dark. | Server must call API with the request cookie and render matching root attribute; no framework/hydration test proves integration. |
117
+
118
+ `docs/theming.md` accurately documents the controller’s stored values and source ordering. README contradicts it by presenting high-contrast alongside “supported themes” in the general setup while the controller can only persist dark/light/system.
119
+
120
+ ## 8. Accessibility baseline
121
+
122
+ > Prompt 5 remediation (2026-07-13): the historical findings below remain the frozen baseline. The package now has semantic contrast/focus/target checks, forced-colors and reduced-motion coverage, nested overlay/focus management, additive tabs/grid/calendar/forms/announcer helpers, a 59-module accessibility inventory in `docs/accessibility.md`, 76 unit checks, and 10 passing Chromium keyboard/axe contracts. Formal certification, manual screen-reader interoperability, advanced combobox/grid/calendar behavior, responsive reflow, RTL, and localization remain unresolved.
123
+
124
+ > Prompt 6 remediation (2026-07-13): the frozen RTL findings below are now addressed by native inherited direction, logical CSS migrations, reviewed physical-coordinate exceptions, Arabic typography hooks, bidi utilities, explicit-locale `Intl` helpers, direction-aware keyboard behavior, `check:rtl`, and representative Chromium LTR/RTL/zoom tests. Full responsive calendar/data-grid redesign, application font loading/translations, and native Arabic screen-reader QA remain unresolved.
125
+
126
+ Implemented evidence: most interactive CSS modules use `:focus-visible` with a focus token; form styles recognize native disabled and `aria-invalid`; dialog/drawer create focus traps, restore focus by default, close on Escape/outside by default, lock scroll, set dialog roles/labels when title is passed; dropdown provides keyboard activation, up/down/home/end roving focus, Escape and outside closing. `src/behaviors/focus-trap.ts` excludes disabled/`aria-disabled` elements.
127
+
128
+ Limits: CSS alone supplies no roles, labels, required indicators, error `aria-describedby` association, read-only semantics, live regions, toast announcements, loading announcements, dialog title requirement, or target-size validation. Modal, tooltip, toast, menu, tabs, segmented control, command palette, search bar, notification center, switchers, data grid, and calendar have no dedicated behavior/controller. `aria-*` attributes are frequently styling selectors and are consumer obligations. No contrast calculations, accessibility tests, screen-reader tests, or browser keyboard tests exist; do **not** claim WCAG compliance.
129
+
130
+ ## 9. Responsive behavior baseline
131
+
132
+ The responsive implementation is viewport-only: dominant breakpoint `max-width: 640px`, calendar `480px/760px`, shell `40rem/48rem/64rem`. Breakpoint tokens are declared but CSS media queries mostly hardcode values. There are zero `@container` queries. Shell/header/content frame have explicit narrow rules; dialogs, drawers, modal, data grid, card/panel, most patterns and AI cards have 640px rules. Calendar grids switch/reduce at 480/760px.
133
+
134
+ Risk areas needing runtime verification: tables/data grids retain wide tabular DOM and rely on overflow/sticky styles rather than an alternate compact representation; calendar timeline/week layouts use absolute placement variables; switchers/menus/search results use fixed min/max widths; mobile nav is CSS only; no test covers long text, narrow containers, touch targets, or overflow. A breakpoint rule is not proof of usable adaptation.
135
+
136
+ ## 10. RTL and localization baseline
137
+
138
+ No `[dir]`, `:dir()`, or `direction` selector was found. There are many physical direction properties: tooltip side/arrow placement, split-button borders/menu origin, toast positions/origins, tabs vertical borders, select chevrons, timeline grid borders/offsets, progress transform origin, and calendar placement use `left`/`right`. Some properties use logical `text-align: start`, but the system is not RTL-safe.
139
+
140
+ There is no locale, date, number, currency, financial, Swedish-expansion, Arabic, bidi, or mixed-direction formatting API. Billing/calendar markup only displays consumer-provided strings; it supplies no `Intl` behavior. Long text is handled selectively by truncation/overflow CSS, not a localization contract.
141
+
142
+ ## 11. Duplicate and overlapping components
143
+
144
+ > Prompt 7 remediation (2026-07-14): modal now delegates to canonical dialog CSS/behavior, workspace switcher uses shared entity-switcher CSS, and the legacy right-drawer path/classes are owned by canonical drawer CSS. Exact package exports preserve all three old paths. Card/panel, table/data-grid, and badge/chip remain intentionally separate because their semantics differ. The empty table stylesheet is now a functional native-table contract. See `docs/component-architecture.md`.
145
+
146
+ | Likely group | Evidence / freeze classification |
147
+ | --- | --- |
148
+ | dialog vs modal | Both ship full backdrop, header/body/footer, size, state, focus styling and 640px rules (`dialog.css`, `modal.css`). Only dialog has `ntCreateDialog`; do not merge/remove before consumers are mapped. |
149
+ | drawer vs right-drawer | Drawer is a behavioral four-side overlay; shell right drawer is CSS-only right-side layout. Both expose right-side panels; preserve both pending semantic decision. |
150
+ | card vs panel | Both are configurable bordered surfaces with header/body/footer, compact/spacious, flat/ghost/raised/elevated, interactive and tone modifiers. Strong duplication. |
151
+ | company-switcher vs workspace-switcher | Near-parallel selectable list/popover structures, compact/wide modifiers, active/current/selected/disabled hooks, headers/search/items/footer. Strong duplication. |
152
+ | menu/dropdown/profile-menu/switchers | Menu and dropdown share item/list/selection patterns; profile/company/workspace are domain-shaped menus. Dropdown is the only generic behavior controller. Do not collapse without preserving markup/class contracts. |
153
+ | table vs data-grid | `table.css` is empty, while data-grid provides all apparent table styles, sticky/selection/sorting hooks. Table is a broken/empty public export and should be classified as non-preservable implementation surface after a deprecation plan. |
154
+ | state patterns | Empty/error/loading states repeat card-like layouts, fixed icons/sizes and 640px rules. Candidate consolidation, but public markup differs. |
155
+
156
+ At least **seven** likely duplicate/overlap groups exist (the six requested groups plus state-pattern duplication).
157
+
158
+ ## 12. Visual consistency problems
159
+
160
+ Visual language is not verifiably consistent. Core, AI, domain and patterns independently restate border widths, focus shadow spreads, fixed sizing, media queries, surface treatments and transitions. Key examples: dialog/command palette use missing `--nt-shadow-2xl`; tooltip uses missing elevated/muted surfaces; AI/calendar/switcher modules use missing accent/background aliases; progress hardcodes white stripe color; shell uses rem breakpoints whereas most modules use 640px. Card/panel/state patterns duplicate elevation and nesting logic. AI has a separate purple token family but lack of a defined accent-background semantic means its treatment can fail. Billing and some state modules lack the reduced-motion coverage common in core.
161
+
162
+ No visual-regression or screenshot test exists, so this is static evidence, not a visual approval.
163
+
164
+ ## 13. Testing and CI coverage
165
+
166
+ `tests/appearance.test.mjs` is the sole test file. Its 37 tests validate preference normalization/resolution, root attributes, SSR fake DOM behavior, cookie parsing, source order, cache failure/invalid values/migration, media listener lifecycle, subscriptions, and absence of network API calls in appearance source. It does not run in a browser and does not test CSS.
167
+
168
+ The CI workflow runs install/test/build/package dry-run then semantic release. There are no unit/integration tests for behavior helpers; no CSS lint/type check beyond TS; no token validator; no a11y, browser, RTL/localization, visual/screenshot, package-size, or package-content assertion (the dry-run is informational only).
169
+
170
+ ## 14. Documented features that do not work
171
+
172
+ 1. README’s `data-nt-accent` and `data-nt-density` setup has no implementation.
173
+ 2. ~~The exported `table.css` and its inclusion in `components.css` yielded no table CSS.~~ Prompt 7 implemented a native read-only table contract while preserving the path; interactive data-grid behavior remains separate.
174
+ 3. README direct paths to `node_modules/@neetechs/ui/src/index.css` bypass `exports` and are unsuitable for export-enforcing tooling.
175
+ 4. The public runtime version (`0.0.1`) disagrees with package version (`0.0.2`).
176
+ 5. Documentation describes generic theme setup including high contrast, but stored appearance values and controller resolution do not support high contrast.
177
+ 6. `docs/accessibility.md`, `docs/component-guidelines.md`, and `docs/migration.md` are published zero-byte files.
178
+
179
+ ## 15. Potential breaking-change risks
180
+
181
+ - Changing/renaming any `@neetechs/ui/*` export, including glob-derived component CSS, breaks direct imports.
182
+ - Renaming `.nt-*` BEM classes/modifiers or `[data-state|side|align]` values breaks consumer HTML and CSS overrides.
183
+ - Defining currently undefined tokens changes currently-invalid declarations and may override consumer-provided values; use an alias/deprecation layer first.
184
+ - Changing cookie/cache names or source ordering changes anti-flash/SSR behavior across applications.
185
+ - Altering dialog/drawer/dropdown defaults, ARIA mutations, focus restoration, `hidden`, scroll locking or event behavior breaks integrations.
186
+ - Replacing physical placement or responsive behavior may alter absolute-positioned calendars/tooltips/toasts.
187
+ - Removing duplicate modules, even table, requires an export deprecation because all are public/published.
188
+
189
+ ## 16. Safe-to-change internal implementation details
190
+
191
+ Subject to behavior-preserving tests: TypeScript private closure layout; generated numeric ID format; focus/overlay listener bookkeeping; build asset-copy implementation; comments; duplicate `dist` CSS copies; internal theme raw-value organization; CSS declaration ordering that does not affect cascade; and unpublished archive/root artifact handling. The zero-byte table implementation itself is not a useful contract, but its import path must remain temporarily (for example via a compatibility file).
192
+
193
+ ## 17. Public API freeze for the upcoming refactor
194
+
195
+ Preserve temporarily: all 89 paths in section 3; all `.nt-*` selectors and current modifiers; `data-nt-theme`, `data-nt-theme-preference`, `data-state`, `data-side`, `data-align`, `data-disabled`; CSS custom properties used as consumer inputs; appearance exports/options/types; `nt_theme`, `nt_theme_preference`, and four legacy cache keys; and all behavior factory/controller methods and DOM effects.
196
+
197
+ Historical Prompt 1 classification was: the empty table implementation, direct `src/index.css` documentation path, undocumented generated IDs, nonfunctional accent/density, missing-token aliases, and duplicate components. Prompts 2-7 have implemented the token/appearance/table contracts and placed duplicates behind tested compatibility layers; removal still requires the documented migration window.
198
+
199
+ ## 18. Recommended migration order
200
+
201
+ 1. Add automated contract snapshots for exports, selectors, tokens and package contents—without changing production CSS.
202
+ 2. Decide and publish the compatibility policy for table, direct-source imports, duplicate overlay/surface modules and accent/density.
203
+ 3. Create a token manifest; define every missing semantic token across all themes or introduce explicit compatibility aliases, then add token validation.
204
+ 4. Make appearance API/CSS coherent (high contrast, accents, density, forced colors/contrast) with SSR/browser tests.
205
+ 5. Add behavior, accessibility and browser tests before altering interactive components.
206
+ 6. Repair responsive/RTL/localization foundations using logical properties and component runtime fixtures.
207
+ 7. Consolidate duplicate implementations behind preserved public classes/exports, then deprecate in a major-version migration.
208
+ 8. Add visual regression and package-content gates before release.
209
+
210
+ ## 19. Commands executed and results
211
+
212
+ | Command | Result |
213
+ | --- | --- |
214
+ | repository instruction reads; tracked-file/source/doc/workflow searches; static token/selector/media/RTL scans | Completed read-only. No nested instruction file beyond `CLAUDE.local.md`; root `CLAUDE.md`, `AGENTS.md`, and `CONTRIBUTING.md` absent. |
215
+ | `npm ci` | Passed: 303 packages added, 447 audited, 0 vulnerabilities. |
216
+ | `npm test` | Initial sandbox attempt failed `spawn EPERM`; rerun outside sandbox passed: build plus **37/37** appearance tests. |
217
+ | `npm run build` | Passed (`tsc` plus asset copy). |
218
+ | `npm pack --dry-run` | Initial sandbox attempt failed cache `EPERM`; rerun outside sandbox passed: 257 files, 99.4 kB package, 1.0 MB unpacked. |
219
+
220
+ ## 20. Uncertainties and items requiring runtime verification
221
+
222
+ - No real browser, assistive technology, visual, touch, narrow-width, forced-colors, RTL, Arabic, Swedish, or long-content execution was performed; static CSS cannot establish usability or contrast.
223
+ - Consumer applications may rely on undocumented selectors, missing custom properties, direct `src` paths, and duplicate components; repository-only audit cannot enumerate them.
224
+ - CSS `@import` resolution and tree-shaking behavior vary by consumer bundler and must be tested from a packed tarball in representative Angular/React/plain-CSS fixtures.
225
+ - Theme cookie domain/security attributes are backend-owned and cannot be verified here.
226
+ - The root archive/worktree `.zip` → `src.zip` state appears pre-existing and was not opened beyond manifest listing; confirm whether it belongs in the repository before changing artifact policy.