@nadicodeai/ui 0.10.2 → 0.11.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 (99) hide show
  1. package/AGENTS.md +23 -135
  2. package/README.md +39 -110
  3. package/dist/components/action-band.d.ts +5 -3
  4. package/dist/components/action-band.d.ts.map +1 -1
  5. package/dist/components/action-band.js +35 -21
  6. package/dist/components/agent-chat.d.ts.map +1 -1
  7. package/dist/components/agent-chat.js +1 -1
  8. package/dist/components/agent-composer.d.ts.map +1 -1
  9. package/dist/components/agent-composer.js +1 -1
  10. package/dist/components/ai-elements/terminal.d.ts.map +1 -1
  11. package/dist/components/ai-elements/terminal.js +8 -8
  12. package/dist/components/artifact-panel.d.ts.map +1 -1
  13. package/dist/components/artifact-panel.js +5 -5
  14. package/dist/components/bento.d.ts +14 -3
  15. package/dist/components/bento.d.ts.map +1 -1
  16. package/dist/components/bento.js +26 -5
  17. package/dist/components/brand.d.ts.map +1 -1
  18. package/dist/components/brand.js +29 -3
  19. package/dist/components/contact.d.ts +22 -10
  20. package/dist/components/contact.d.ts.map +1 -1
  21. package/dist/components/contact.js +34 -12
  22. package/dist/components/diff-count.js +1 -1
  23. package/dist/components/faq-item.js +2 -2
  24. package/dist/components/faq.d.ts +4 -1
  25. package/dist/components/faq.d.ts.map +1 -1
  26. package/dist/components/faq.js +5 -2
  27. package/dist/components/feature-grid.d.ts +23 -0
  28. package/dist/components/feature-grid.d.ts.map +1 -0
  29. package/dist/components/feature-grid.js +33 -0
  30. package/dist/components/feature-rows.d.ts +23 -0
  31. package/dist/components/feature-rows.d.ts.map +1 -0
  32. package/dist/components/feature-rows.js +27 -0
  33. package/dist/components/footer.d.ts +18 -12
  34. package/dist/components/footer.d.ts.map +1 -1
  35. package/dist/components/footer.js +32 -20
  36. package/dist/components/hero.d.ts +28 -0
  37. package/dist/components/hero.d.ts.map +1 -0
  38. package/dist/components/hero.js +45 -0
  39. package/dist/components/integration-flow.d.ts +36 -0
  40. package/dist/components/integration-flow.d.ts.map +1 -0
  41. package/dist/components/integration-flow.js +36 -0
  42. package/dist/components/live-demo.d.ts +31 -0
  43. package/dist/components/live-demo.d.ts.map +1 -0
  44. package/dist/components/live-demo.js +30 -0
  45. package/dist/components/logo-band.d.ts +12 -2
  46. package/dist/components/logo-band.d.ts.map +1 -1
  47. package/dist/components/logo-band.js +16 -1
  48. package/dist/components/logo-tile.d.ts.map +1 -1
  49. package/dist/components/logo-tile.js +5 -2
  50. package/dist/components/nav-bar.d.ts +14 -8
  51. package/dist/components/nav-bar.d.ts.map +1 -1
  52. package/dist/components/nav-bar.js +19 -13
  53. package/dist/components/pricing-card.d.ts +10 -15
  54. package/dist/components/pricing-card.d.ts.map +1 -1
  55. package/dist/components/pricing-card.js +18 -29
  56. package/dist/components/pricing.d.ts +11 -14
  57. package/dist/components/pricing.d.ts.map +1 -1
  58. package/dist/components/pricing.js +5 -15
  59. package/dist/components/quote-card.d.ts +10 -2
  60. package/dist/components/quote-card.d.ts.map +1 -1
  61. package/dist/components/quote-card.js +15 -3
  62. package/dist/components/security-grid.d.ts +25 -0
  63. package/dist/components/security-grid.d.ts.map +1 -0
  64. package/dist/components/security-grid.js +31 -0
  65. package/dist/components/stat-block.d.ts +9 -5
  66. package/dist/components/stat-block.d.ts.map +1 -1
  67. package/dist/components/stat-block.js +12 -6
  68. package/dist/components/statement.d.ts +32 -0
  69. package/dist/components/statement.d.ts.map +1 -0
  70. package/dist/components/statement.js +40 -0
  71. package/dist/components/stats-band.d.ts +6 -2
  72. package/dist/components/stats-band.d.ts.map +1 -1
  73. package/dist/components/stats-band.js +10 -3
  74. package/dist/components/status-dot.js +4 -4
  75. package/dist/components/steps.d.ts +34 -0
  76. package/dist/components/steps.d.ts.map +1 -0
  77. package/dist/components/steps.js +40 -0
  78. package/dist/components/team-grid.d.ts +27 -0
  79. package/dist/components/team-grid.d.ts.map +1 -0
  80. package/dist/components/team-grid.js +30 -0
  81. package/dist/components/testimonials.d.ts +39 -12
  82. package/dist/components/testimonials.d.ts.map +1 -1
  83. package/dist/components/testimonials.js +46 -13
  84. package/dist/components/texture-strip.d.ts +22 -0
  85. package/dist/components/texture-strip.d.ts.map +1 -0
  86. package/dist/components/texture-strip.js +29 -0
  87. package/dist/index.d.ts +10 -0
  88. package/dist/index.d.ts.map +1 -1
  89. package/dist/index.js +10 -0
  90. package/dist/styles/globals.css +174 -300
  91. package/docs/agent-work-surfaces.md +6 -5
  92. package/docs/agents/nadicodeai-ui.md +42 -273
  93. package/docs/consuming-cross-repo.md +26 -33
  94. package/docs/contract.md +43 -0
  95. package/docs/migration/nadia-consumer-readiness.md +5 -10
  96. package/docs/terminal-tui-semantics.md +142 -181
  97. package/llms.txt +49 -84
  98. package/package.json +2 -3
  99. package/skills/nadicodeai-ui/SKILL.md +6 -34
@@ -1,275 +1,44 @@
1
1
  # NadicodeAI UI Agent Guide
2
2
 
3
- This file is shipped with `@nadicodeai/ui` so coding agents can use the package correctly after installation.
4
-
5
- ## What This Package Provides
6
-
7
- `@nadicodeai/ui` is the shared NadicodeAI React UI surface:
8
-
9
- - shadcn source components compiled into package exports
10
- - Vercel AI Elements source components compiled into package exports
11
- - React adapters over the design-system grammar and assets
12
- - reusable NadicodeAI marketing/section compositions
13
- - presentational Nadia product components for settings, dashboard shells,
14
- installer states, plugin boundaries, agent chat, artifacts,
15
- files, diffs, and redacted terminal summaries
16
- - Tailwind v4 global CSS that bridges shadcn roles to NadicodeAI design tokens
17
- - package-local agent instructions in `AGENTS.md`, `llms.txt`,
18
- `docs/migration/nadia-consumer-readiness.md`, and
19
- `skills/nadicodeai-ui/SKILL.md`
20
-
21
- The package surface is source-backed. `src/components/` is flat shadcn-style
22
- source; do not infer or create folders or package namespaces that do not exist.
23
- Do not add top-level exports for recipes, blocks, agent, or terminal groupings
24
- until a concrete package API decision adds source, built files, docs, and tests
25
- together. Product components ship only when the source, public subpath export,
26
- tests, and docs exist together.
27
-
28
- Consuming apps own routes, persistence, auth behavior, server state, runtime
29
- adapters, app-specific copy, and app-owned product features/use cases. Names
30
- such as `operator-login`, portal activation, and customer credential control are
31
- consumer-owned product flows, not package component names. Reusable UI structure
32
- belongs in this package only after a second concrete consumer, a plan-approved
33
- shared component, or a named validation slice proves the package boundary.
34
-
35
- ## Required App Setup
36
-
37
- Import the package CSS once at the app root:
38
-
39
- ```tsx
40
- import "@nadicodeai/ui/globals.css";
41
- import "@nadicodeai/design-system/css";
42
- ```
43
-
44
- For Next.js App Router apps, put those imports in the root layout.
45
-
46
- The consuming app still owns Tailwind/PostCSS configuration. This package does not install a PostCSS config.
47
-
48
- ## Imports
49
-
50
- Prefer explicit component subpaths in app code:
51
-
52
- ```tsx
53
- import { Button } from "@nadicodeai/ui/components/button";
54
- import { PageFrame } from "@nadicodeai/ui/components/page-frame";
55
- import { Message } from "@nadicodeai/ui/components/ai-elements/message";
56
- ```
57
-
58
- Use barrels when they are more ergonomic:
59
-
60
- ```tsx
61
- import { Button, PageFrame } from "@nadicodeai/ui";
62
- import { Message, PromptInput } from "@nadicodeai/ui/ai-elements";
63
- ```
64
-
65
- Product UI uses the same public component subpaths:
66
-
67
- ```tsx
68
- import { SettingsSection } from "@nadicodeai/ui/components/settings-section";
69
- import { DashboardShell } from "@nadicodeai/ui/components/dashboard-shell";
70
- import { AgentChat } from "@nadicodeai/ui/components/agent-chat";
71
- ```
72
-
73
- Current shipped product subpaths:
74
-
75
- - `@nadicodeai/ui/components/agent-chat`
76
- - `@nadicodeai/ui/components/agent-composer`
77
- - `@nadicodeai/ui/components/agent-message`
78
- - `@nadicodeai/ui/components/agent-thread`
79
- - `@nadicodeai/ui/components/agent-tool-approval`
80
- - `@nadicodeai/ui/components/artifact-panel`
81
- - `@nadicodeai/ui/components/automation-section`
82
- - `@nadicodeai/ui/components/chart-breakdown-table`
83
- - `@nadicodeai/ui/components/chart-bullet-bar`
84
- - `@nadicodeai/ui/components/chart-date-range`
85
- - `@nadicodeai/ui/components/chart-date-range-control`
86
- - `@nadicodeai/ui/components/chart-delta`
87
- - `@nadicodeai/ui/components/chart-entity-colors`
88
- - `@nadicodeai/ui/components/chart-kpi-stat`
89
- - `@nadicodeai/ui/components/chart-sparkline`
90
- - `@nadicodeai/ui/components/chart-time-series`
91
- - `@nadicodeai/ui/components/confirm-dialog`
92
- - `@nadicodeai/ui/components/dashboard-shell`
93
- - `@nadicodeai/ui/components/desktop-shell`
94
- - `@nadicodeai/ui/components/feedback-state`
95
- - `@nadicodeai/ui/components/files-preview`
96
- - `@nadicodeai/ui/components/installer-shell`
97
- - `@nadicodeai/ui/components/plugin-slot-boundary`
98
- - `@nadicodeai/ui/components/settings-section`
99
-
100
- `StateNotice` (`@nadicodeai/ui/components/state-notice`) is the supported
101
- low-level state-banner primitive behind `AgentMessageStateNotice` and
102
- `AgentThreadStateBanner`; it requires a `title` and owns the shared
103
- `role="status"`/`role="alert"` skeleton.
104
-
105
- ## Product Components And Migration
106
-
107
- Product components are presentational. Use them for shared settings, shell,
108
- installer, plugin-boundary, agent chat, artifact, file, diff, and redacted
109
- terminal summary UI. Keep route state, server state, auth,
110
- persistence, runtime adapters, permission decisions, analytics, and
111
- product-specific copy in the consuming app.
112
-
113
- Generic data tables, command palettes, and chart cards are app-owned shadcn
114
- registry adaptations. Start from `@shadcn/data-table-demo`,
115
- `@shadcn/command-dialog`, `@shadcn/chart`, or the relevant `@shadcn/chart-*`
116
- block/example instead of importing a NadicodeAI product abstraction. The
117
- console chart kit subpaths (`chart-*`) are the plan-approved exception
118
- (issue #166, ADR 0010): use them for KPI stats, sparklines, stacked
119
- time-series, cap meters, breakdown tables, entity-color assignment, and the
120
- date-range control; the chart cards that arrange those widgets stay app-owned.
121
- The URL codec in `chart-date-range` is server-safe; import it (not
122
- `chart-date-range-control`) from Server Components.
123
-
124
- Every data-shaped chart names a data alternative so its data is reachable
125
- without vision: the time-series charts ship a visually hidden `<table>` twin,
126
- `BreakdownTable` is itself a real `<table>`, and a standalone `Sparkline`
127
- renders an sr-only ordered list of its point values beside the `role="img"`
128
- svg. `BulletBar` (data fully in `aria-valuetext` plus the visible value) and
129
- `KpiStat` (data fully in visible text) carry no separate table twin by design;
130
- this narrowing is deliberate, not a gap.
131
-
132
- Recommended migration order:
133
-
134
- 1. Web admin or portal validation slice.
135
- 2. Installer and bootstrap flows.
136
- 3. Desktop shell and plugin boundary surfaces.
137
- 4. Desktop chat and runtime work surfaces.
138
- 5. TUI consumers through `docs/terminal-tui-semantics.md`.
139
-
140
- Read `docs/migration/nadia-consumer-readiness.md` before migrating a consumer.
141
- It lists the CSS imports, public subpaths, fixture redaction rules, and readiness
142
- gates.
143
-
144
- ## Layout Primitives
145
-
146
- `SeamGrid` (`@nadicodeai/ui/components/seam-grid`) is a supported low-level layout
147
- primitive: the single owner of the "gap-as-seam" grid that backs the bordered
148
- section grids (stats band, testimonials, logo band, and siblings). It renders a
149
- `div` with the invariant `grid gap-px` base, so borderless, square-cornered cells
150
- paint one shared hairline seam at every boundary instead of doubling lines.
151
-
152
- Its only seam-specific prop is `surface`: `"canvas"` (default) paints the brand
153
- `line` via `bg-border`, and `"ink"` mixes the line toward the ink role for darker
154
- panels; the value is also mirrored on a `data-surface` attribute. Pass
155
- `className`, `children`, and any `div` props to keep a bespoke column map,
156
- heights, and `data-*` attributes. Reach for `SeamGrid` and its `surface` prop
157
- when building a new bordered grid rather than hand-copying the seam colour: the
158
- seam class helper is an internal `src/lib/seam` detail with no public subpath
159
- export, so nothing should couple to the raw arbitrary Tailwind class string.
160
-
161
- ## Forms
162
-
163
- Use the package's shadcn form stack as one model:
164
-
165
- - Controls: `Input`, `Textarea`, `Select`, `Checkbox`, and similar primitives.
166
- - Layout and accessible field structure: `FieldGroup`, `Field`, `FieldLabel`,
167
- `FieldDescription`, and `FieldError`.
168
- - React Hook Form integration: `Form`, `FormField`, `FormItem`, `FormControl`,
169
- `FormLabel`, `FormDescription`, and `FormMessage`.
170
-
171
- Do not introduce `FormInput`, `FormTextarea`, or other parallel form-control
172
- families. Extend the canonical control or field primitive when a new size or
173
- behavior is truly needed.
174
-
175
- ## Styling Rules
176
-
177
- This package is token-only and dark-ready through semantic globals. The package
178
- CSS owns `:root` and `.dark` remaps for shadcn roles plus UI-local product
179
- aliases such as `--nc-app-surface`, `--nc-chat-tool-surface`, and
180
- `--nc-terminal-bg`. Components consume those roles/aliases; they do not add
181
- one-off dark styling locally.
182
-
183
- Use semantic utilities:
184
-
185
- ```tsx
186
- className="border border-border bg-background text-foreground"
187
- ```
188
-
189
- Use UI-local aliases when a product role is needed:
190
-
191
- ```tsx
192
- className="bg-[var(--nc-app-surface)] text-[var(--nc-app-text-primary)]"
193
- ```
194
-
195
- Use brand tokens through Tailwind arbitrary values only when a semantic role or
196
- UI alias is not precise enough:
197
-
198
- ```tsx
199
- className="text-[var(--nc-link-deep)]"
200
- ```
201
-
202
- Do not add:
203
-
204
- - Tailwind `dark:` utilities
205
- - `.dark` blocks outside package globals/theme files
206
- - OS dark-mode branching
207
- - raw `#hex`, `rgb()`, or `hsl()` values
208
- - raw palette utilities like `text-blue-600`, `bg-zinc-950`, `text-white`, or `bg-black/50`
209
-
210
- ## shadcn And AI Elements
211
-
212
- The package consumes shadcn and AI Elements as source components in this
213
- repository, then publishes built JavaScript/declarations. Consumers should
214
- normally install `@nadicodeai/ui` and import package exports.
215
-
216
- Use shadcn MCP or the CLI for live discovery and install guidance during
217
- maintenance. Do not maintain committed upstream registry inventories, generated
218
- registry snapshots, or inventory update scripts in this package. The committed
219
- truth is the source that has been reviewed, exported, documented, and tested.
220
-
221
- For Codex-capable local runtimes, initialize shadcn MCP from `@nadicodeai/ui`
222
- when MCP is available:
223
-
224
- ```bash
225
- npx shadcn@latest mcp init --client codex
226
- ```
227
-
228
- Use CLI fallbacks when MCP is unavailable or when you need copyable command
229
- output:
230
-
231
- ```bash
232
- npx shadcn@latest info --json
233
- npx shadcn@latest search @shadcn -q "select" --json
234
- npx shadcn@latest search @ai-elements -q "message" --json
235
- npx shadcn@latest docs button select dialog --json
236
- npx shadcn@latest view @shadcn/button
237
- npx shadcn@latest add @shadcn/button --dry-run
238
- npx shadcn@latest add @shadcn/button --diff src/components/button.tsx
239
- npx shadcn@latest add @ai-elements/message --dry-run
240
- ```
241
-
242
- `info --json` is the project-aware source for `tailwindVersion`, `base`,
243
- `iconLibrary`, aliases, `resolvedPaths`, and configured registries. Current
244
- package context should report Tailwind v4, Base UI primitives, lucide icons,
245
- source paths under `src/*`, and configured `@shadcn`/`@ai-elements` registry
246
- access. Use `search` to find current registry items, `docs` to fetch component
247
- documentation and example/API links, `view` to inspect item contents, and
248
- `add --dry-run` or `add --diff` to preview source changes before editing.
249
-
250
- When maintaining installed source:
251
-
252
- ```bash
253
- npx shadcn@latest info --json
254
- npx shadcn@latest add <component> --dry-run
255
- npx shadcn@latest add @ai-elements/all --dry-run
256
- ```
257
-
258
- The package `components.json` must resolve aliases to `src/*`, not `dist/*`. Build output rewrites `@/` aliases to relative package imports.
259
-
260
- Do not run shadcn `--overwrite` unless the maintainer explicitly asks for an upstream primitive refresh and the diff is reviewed.
261
-
262
- ## Verification
263
-
264
- Before considering package work complete:
265
-
266
- ```bash
267
- npm run build -w @nadicodeai/ui
268
- npm run test -w @nadicodeai/ui
269
- ```
270
-
271
- For repo completion, run the root gate:
272
-
273
- ```bash
274
- npm run quality
275
- ```
3
+ This map ships with `@nadicodeai/ui` so coding agents can find the package's
4
+ authoritative interfaces without carrying a second copy of them.
5
+
6
+ ## Start here
7
+
8
+ - Consumer installation and stylesheet setup:
9
+ [`../consuming-cross-repo.md`](../consuming-cross-repo.md).
10
+ - Package/consumer boundary, styling invariants, admission rules, and
11
+ accessibility: [`../contract.md`](../contract.md).
12
+ - Current component modules and named exports: `src/components/`,
13
+ `src/index.ts`, `src/ai-elements.ts`, and `package.json` in a source checkout;
14
+ package exports and declarations in an installed package.
15
+ - Import examples, form-stack guidance, `SeamGrid` usage, and live shadcn/AI
16
+ Elements discovery commands: [`../../README.md`](../../README.md).
17
+
18
+ Do not maintain component, chart, form, section, export, or registry inventories
19
+ in agent prose. Follow the owning source or document above.
20
+
21
+ ## Product work
22
+
23
+ - Agent work surfaces: [`../agent-work-surfaces.md`](../agent-work-surfaces.md).
24
+ - Product compositions and sections:
25
+ [`../product-compositions.md`](../product-compositions.md) and
26
+ [`../product-sections.md`](../product-sections.md).
27
+ - Consumer order, fixture redaction, and readiness gates:
28
+ [`../migration/nadia-consumer-readiness.md`](../migration/nadia-consumer-readiness.md).
29
+ - Terminal and TUI semantics:
30
+ [`../terminal-tui-semantics.md`](../terminal-tui-semantics.md).
31
+
32
+ Routes, persistence, authentication, server state, runtime adapters,
33
+ permissions, analytics, and product-specific copy stay in the consuming app.
34
+ The package admits presentational structure according to its contract.
35
+
36
+ ## Maintenance
37
+
38
+ Use shadcn MCP or the CLI live; never commit an upstream registry inventory.
39
+ `components.json` is the project configuration authority, and reviewed source is
40
+ the committed package surface. Preview upstream changes before applying them;
41
+ do not overwrite maintained source without explicit maintainer direction.
42
+
43
+ The package [`AGENTS.md`](../../AGENTS.md) maps scoped commands. Repository
44
+ completion is the root `npm run quality` gate.
@@ -6,52 +6,45 @@ from published npm rather than the workspace source.
6
6
 
7
7
  ## Version pinning
8
8
 
9
- Pin both packages to an exact version, never `latest` or a caret/tilde range:
9
+ Pin the UI package to an exact version, never `latest` or a caret/tilde range:
10
10
 
11
11
  ```bash
12
12
  npm view @nadicodeai/ui version
13
- npm view @nadicodeai/design-system version
14
- npm install @nadicodeai/design-system@<exact-version> @nadicodeai/ui@<exact-version> react@^19 react-dom@^19 tailwindcss@^4 @tailwindcss/postcss@^4
13
+ npm install @nadicodeai/ui@<exact-version> react@^19 react-dom@^19 tailwindcss@^4 @tailwindcss/postcss@^4
15
14
  ```
16
15
 
17
- `@nadicodeai/ui` pins its `@nadicodeai/design-system` dependency exactly; the
18
- consumer's own `package.json` must match that same version for both packages.
19
- A version bump in either package requires re-pinning both together.
16
+ `@nadicodeai/ui` pins and installs its `@nadicodeai/design-system` runtime
17
+ dependency exactly. A React consumer does not declare that dependency directly
18
+ just to use UI components or the UI stylesheet.
20
19
 
21
- ## CSS import order
20
+ Declare `@nadicodeai/design-system` directly only when the app intentionally
21
+ uses a separate public design-system API, such as a font/logo asset, the static
22
+ CSS interface for a separate non-React surface, or the optional agent-chat
23
+ enhancer. Pin that direct dependency to the version required by the installed
24
+ UI release:
22
25
 
23
- Import order is load-bearing. Import both `@nadicodeai/design-system` CSS
24
- entrypoints before `@nadicodeai/ui/globals.css`: the fonts, so the
25
- `Geist`/`Geist Mono` `@font-face` declarations that the generated theme's
26
- `--font-*` roles reference are already registered, and `@nadicodeai/design-system/css`
27
- itself, which owns the kept `nc-*` geometry, type scale, chat CSS components,
28
- motion, and display components that `@nadicodeai/ui` components render
29
- against. `@nadicodeai/ui/globals.css` pulls in the generated theme and
30
- tokens but not this `nc-*` layer, so skipping it leaves package components
31
- unstyled:
32
-
33
- ```ts
34
- import "@nadicodeai/design-system/assets/fonts/geist.css";
35
- import "@nadicodeai/design-system/css";
36
- import "@nadicodeai/ui/globals.css";
26
+ ```bash
27
+ npm view @nadicodeai/ui@<exact-version> dependencies.@nadicodeai/design-system
37
28
  ```
38
29
 
39
- Both `@nadicodeai/design-system` and `@nadicodeai/ui` are required
40
- dependencies of every consumer, not just `@nadicodeai/ui` — see the version
41
- pinning section above.
30
+ ## CSS interface
42
31
 
43
- ## Tailwind v4 source scanning
32
+ Import one stylesheet once at the React app root:
44
33
 
45
- Tailwind v4's automatic content detection does not scan `node_modules`. Add an
46
- explicit `@source` directive in the consumer's Tailwind entry CSS (wherever
47
- `@import "tailwindcss"` lives) pointing at the package's built `dist`:
48
-
49
- ```css
50
- @source "../node_modules/@nadicodeai/ui/dist";
34
+ ```ts
35
+ import "@nadicodeai/ui/globals.css";
51
36
  ```
52
37
 
53
- Adjust the relative path to match the consumer's directory depth from its
54
- Tailwind entry file to `node_modules`.
38
+ `@nadicodeai/ui/globals.css` is the complete React style interface. It composes
39
+ Tailwind v4, shadcn, and the complete design-system CSS module.
40
+ Do not import `@nadicodeai/design-system/css`, generated theme files, or CSS
41
+ partials beside it. The package declares its own built component sources; Tailwind's
42
+ normal automatic detection covers the consumer application. The app still owns
43
+ its PostCSS configuration, theme provider, and persisted mode preference.
44
+
45
+ If the app needs bundled Geist files rather than its framework's font loader,
46
+ that asset import is one of the intentional direct-API cases described above.
47
+ Font loading is an asset decision, not a second design stylesheet.
55
48
 
56
49
  ## Base UI API breaks (migrating from Radix-era components)
57
50
 
@@ -0,0 +1,43 @@
1
+ # @nadicodeai/ui Package Contract
2
+
3
+ The normative invariants for the `@nadicodeai/ui` package: what may live here, how it is styled, and what consumers own. `../AGENTS.md` is the map; this file is the contract it routes to.
4
+
5
+ ## Styling Invariants
6
+
7
+ - **Token-only, no raw literals or shadow aliases.** Components style through semantic shadcn utilities (`bg-background`, `text-foreground`, `border-input`, and the rest), or a canonical generated design-system token when no standard role is precise enough. The UI package does not mint screen-, component-, or product-specific color aliases. No raw `#hex` / `rgb()` / `hsl()` may appear in `.tsx`; a new source value goes to `design-system/DESIGN.md` first and flows through generated output. A narrow protocol adapter may translate third-party classes directly to canonical tokens in `globals.css`, but it must not create another token vocabulary. Enforced by `@nadicodeai/ui/tests/guards/no-raw-literal.test.ts`, `@nadicodeai/ui/tests/guards/dark-semantic-roles.test.ts`, and `@nadicodeai/ui/tests/guards/token-reference-integrity.test.ts`.
8
+ - **Dark-ready semantics, no component dark implementation.** Components use the same semantic role or canonical mode-aware token in every mode. They must not ship Tailwind `dark:` color utilities, component-local `.dark` blocks, OS dark-mode branching, or raw dark palette utilities such as `dark:bg-slate-950` and `dark:text-white`. An intentionally fixed-presentation technology surface, such as the dark terminal console, selects canonical fixed-mode tokens as one coherent component treatment rather than branching by app theme. Enforced by `@nadicodeai/ui/tests/guards/no-dark.test.ts`, `@nadicodeai/ui/tests/guards/dark-semantic-roles.test.ts`, and `@nadicodeai/ui/tests/guards/token-reference-integrity.test.ts`. The generated mode and theme architecture lives only in [`design-system/DESIGN.md`](../../../design-system/DESIGN.md#css-architecture--token-pipeline).
9
+ - **Components inherit one complete React style interface.** `@nadicodeai/ui/globals.css` composes every style dependency owned by this package, including the complete design-system CSS module. Components carry no theme of their own, and React callers do not compose design-system stylesheets or partials beside it. Installation and source-scanning setup live in the [consumer setup guide](consuming-cross-repo.md).
10
+ - **Design-system geometry remains the foundation.** React components compose the kept `nc-*` page grammar and display CSS components; they do not redefine frame math, marker placement, token values, or raw CSS geometry. Use parent-paints-plus-gap for bordered cell grids and keep every visible seam single-owner (doctrine home: `design-system/DESIGN.md` "## Layout").
11
+
12
+ ## Package Shape Invariants
13
+
14
+ - **Source-authored, built package.** Components are authored as shadcn-style source in `src/`, then emitted to `dist/` for consumption by other apps. Package exports must point at built JS, declarations, and CSS, never raw `src/*.tsx`, and `npm pack --dry-run` must include only intentional consumer artifacts.
15
+ - **Package surface is source-backed.** `src/components/` is intentionally flat shadcn-style source. Do not document folders or package namespaces that do not exist, and do not add top-level exports for recipes, blocks, agent, or terminal groupings unless a later package API decision adds concrete source, built files, docs, and tests in the same change.
16
+ - **shadcn and AI Elements are package surface.** Installed shadcn and AI Elements modules under `src/components/` are intentional ready-to-use exports. The source tree owns the component inventory; `src/index.ts` and `src/ai-elements.ts` own the barrels, and `package.json` owns the public export shape. Guards derive the consumer surface from those owners. Prose routes to them instead of maintaining another component list.
17
+ - **Base UI is the active primitive base.** `components.json` must resolve through a Base style, currently `base-nova`, and `npx shadcn@latest info --json` must report `base: "base"`. Do not reintroduce `radix-ui`, `@radix-ui/*`, or `vaul` to package source, dependencies, or app optimizer configuration. Registry-owned shadcn primitives stay aligned with current `shadcn@latest` Base UI output; use Base UI `render` composition instead of Radix `asChild`. `cmdk` is allowed only for the stock shadcn Command component while the current `base-nova` registry declares that dependency; do not use it elsewhere or replace it without a shadcn/compatibility decision and tests.
18
+ - **Named shadcn blocks stay named.** When a user, plan, or issue selects a shadcn block/example such as `login-02`, `signup-02`, `dashboard-01`, or `sidebar-*`, use that registry item as the source of truth through shadcn CLI/MCP. Do not replace it with a package-authored abstraction unless the plan explicitly records the substitution, the reason, and the true consumer route that proves it.
19
+ - **Public surface changes require a release decision.** Any change to exported components, `src/index.ts`, `src/ai-elements.ts`, package `exports`, `globals.css`, theme behavior, package docs, package skills, or design-system token/CSS/theme output consumed by this package must end with an explicit npm release decision before handoff: bump the relevant version(s) and run `npm pack --dry-run -w @nadicodeai/ui` per `../../../docs/internal/npm-publishing.md`, or include a `[no-publish]` commit marker with the reason in the commit body. The pre-push gate requires one of the two. When the UI change depends on modified `@nadicodeai/design-system` output, bump and publish `@nadicodeai/design-system` first, then update this package's dependency and publish UI. Never claim a UI package change is shipped until `npm view @nadicodeai/ui version` reports the intended version.
20
+
21
+ ## Admission Rules
22
+
23
+ Agent work surfaces (chat, composer, tool approval, artifacts, threads, diffs, terminal/file preview, and the underlying agent state models) are NadicodeAI core domain. They belong in this package outright, not behind a named consumer. Any other new product composition (a shell, a settings surface, a generic section) is admitted only with a named consuming surface landing in the same change. Genuinely app-bespoke UI (window chrome, boot/install overlays, mascots, PTY/xterm embeds) stays in the consuming app; it never becomes a package abstraction. A component left unconsumed after its target migration ships gets removed.
24
+
25
+ - **Standard components, not app-owned product features.** This package ships primitives, standard UI components, AI Elements, brand adapters, React adapters, reusable sections, and presentational product components. It must not ship app-specific feature/use-case screens or names such as operator-login, portal activation, customer credential control, or customer management. Generic data tables, command palettes, and chart cards are app-owned shadcn registry adaptations. The source-backed `chart-*` package surface is the plan-approved exception per issue #166 and ADR 0010; chart cards remain app-owned. Every data-shaped chart exposes an equivalent non-visual data alternative. A component whose complete value is already available in visible text or `aria-valuetext` does not add a redundant table.
26
+ - **Auth routes are consumer-owned shadcn block work.** Login, signup, OTP, two-factor, magic-link, and provider-button flows start from the selected shadcn block/example in the consuming app, with app-owned Better Auth behavior. Do not ship generic auth, signup, OTP, federated-login, or provider abstractions from this package unless a later explicit boundary decision replaces the selected shadcn block.
27
+ - **Reusable sections and compositions live here after proof.** Bento grids, media mounts, demo surfaces, page frames, section intros, CTA bands, proof slots, benefits grids, generic shells, and homepage/use-case sections belong in `@nadicodeai/ui` when a second concrete consumer, a plan-approved shared component, or a named validation slice proves the package boundary. Website, portal, and sibling Nadia routes pass data and media children into existing compositions instead of rebuilding layout locally.
28
+ - **Brand renderers live here for React consumers.** Logo geometry, asset generation, and usage semantics are owned by [`design-system/DESIGN.md`, "Brand media authority"](../../../design-system/DESIGN.md#brand-media-authority). `BrandMark` and `BrandWordmark` render that package's public neutral geometry seam with React-scoped SVG ids, dynamic theme paint, and accessible names. Consuming routes use these adapters; they never import raw logo assets, draw brand SVG inline, mask or recolor assets, or create another lockup rule.
29
+ - **No fake proof APIs.** Components may support future testimonials, logos, stats, and proof slots, but they must render nothing public when the proof is absent. Do not ship placeholder customer names, metrics, or logos.
30
+
31
+ ## Accessibility Invariant
32
+
33
+ **Tier-1 accessibility is tested, browser-free.** Every rendering component test uses the package `expectAccessible` helper; the coverage guard derives the applicable test set and fails omissions. The jsdom tier is structural: rendered contrast, landmark context, focus, and keyboard behavior belong to real-browser Playwright coverage. The shared library ESLint configuration is the executable authority for static JSX accessibility rules, and the repository quality doctrine owns their policy; this contract does not copy the rule inventory.
34
+
35
+ ## Reusable Sections
36
+
37
+ The source tree, barrels, and package exports own the current reusable section vocabulary. When a page needs a variation, extend the owning source component with a small typed prop or slot; do not fork the layout in a consumer or document a second component inventory here.
38
+
39
+ ## Consumer Boundary
40
+
41
+ Consumers own routing, auth, app data, server actions, runtime adapters, permission decisions, analytics, and app-specific copy. The package owns the presentational structure and state vocabulary only. [`migration/nadia-consumer-readiness.md`](migration/nadia-consumer-readiness.md) owns migration order and readiness; [`terminal-tui-semantics.md`](terminal-tui-semantics.md) owns TUI semantics.
42
+
43
+ When this package is read from an installed npm package, follow the [consumer setup guide](consuming-cross-repo.md) for setup and public import paths. The styling invariant above remains the authority for component implementation.
@@ -7,15 +7,10 @@ decisions, analytics, and product-specific copy.
7
7
 
8
8
  ## Required Setup
9
9
 
10
- Import both stylesheets once at the app root:
10
+ Complete [`../consuming-cross-repo.md`](../consuming-cross-repo.md) before
11
+ starting a migration; it owns consumer setup. Component styling must satisfy
12
+ [`../contract.md`](../contract.md).
11
13
 
12
- ```tsx
13
- import "@nadicodeai/ui/globals.css";
14
- import "@nadicodeai/design-system/css";
15
- ```
16
-
17
- Do not add local token overrides, component-level `dark:` utilities, raw colors,
18
- raw Tailwind palette utilities, or app-local copies of package shell/product UI.
19
14
  Use public package subpaths:
20
15
 
21
16
  ```tsx
@@ -141,8 +136,8 @@ mirror `docs/terminal-tui-semantics.md` instead of importing a DOM runtime.
141
136
 
142
137
  ## Readiness Gates
143
138
 
144
- - The consumer imports `@nadicodeai/ui/globals.css` and
145
- `@nadicodeai/design-system/css` at the root.
139
+ - The consumer satisfies the canonical setup in
140
+ [`../consuming-cross-repo.md`](../consuming-cross-repo.md).
146
141
  - Product components are imported from `@nadicodeai/ui/components/*` public
147
142
  subpaths, not `src/*`.
148
143
  - At least one local shell, bento, settings, installer, plugin, or chat