@nadicodeai/ui 0.19.2 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -29,5 +29,5 @@ The `@nadicodeai/ui` npm workspace: the shared NadicodeAI React UI package on br
29
29
  | Website page assembly | `../../website/AGENTS.md` |
30
30
  | Portal screens | `../../portal/AGENTS.md` |
31
31
  | User-visible UI work | `../../skills/nadicodeai-product-design/SKILL.md`, loaded after this rulebook |
32
- | Product-component consumption order and TUI semantics | `docs/migration/nadia-consumer-readiness.md`, `docs/terminal-tui-semantics.md` |
32
+ | TUI semantics | `docs/terminal-tui-semantics.md` |
33
33
  | Docs shipped to package consumers | `docs/contract.md` owns invariants, `docs/consuming-cross-repo.md` owns setup, and `llms.txt`, `docs/agents/nadicodeai-ui.md`, `docs/migration/`, and `skills/nadicodeai-ui/SKILL.md` map to those owners while documenting their own component or workflow surface |
package/README.md CHANGED
@@ -177,8 +177,6 @@ The npm package includes agent-facing files on purpose. Agents should read:
177
177
  - `docs/contract.md` for the package contract
178
178
  - `llms.txt` for a concise import/setup index
179
179
  - `docs/agents/nadicodeai-ui.md` for detailed usage and maintenance guidance
180
- - `docs/migration/nadia-consumer-readiness.md` for consumer migration order
181
- and readiness gates
182
180
  - `skills/nadicodeai-ui/SKILL.md` when the agent runtime supports skills
183
181
 
184
182
  These files are packaged through npm `files`; they are not runtime module
@@ -24,8 +24,6 @@ in agent prose. Follow the owning source or document above.
24
24
  - Product compositions and sections:
25
25
  [`../product-compositions.md`](../product-compositions.md) and
26
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
27
  - Terminal and TUI semantics:
30
28
  [`../terminal-tui-semantics.md`](../terminal-tui-semantics.md).
31
29
 
@@ -42,9 +42,14 @@ partials beside it. The package declares its own built component sources; Tailwi
42
42
  normal automatic detection covers the consumer application. The app still owns
43
43
  its PostCSS configuration, theme provider, and persisted mode preference.
44
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.
45
+ That stylesheet also delivers the brand typeface. The design-system CSS module
46
+ declares the `@font-face` rules for Geist and Geist Mono and loads the packaged
47
+ woff2 files, so a consuming app must not add its own font loader for those two
48
+ families. A framework loader on top registers a second, differently sourced face
49
+ for the same family names, which downloads the fonts twice and leaves no defined
50
+ winner. Import files under `@nadicodeai/design-system/assets/fonts/*` only when
51
+ the consumer wants the faces without the CSS module; that is one of the
52
+ intentional direct-API cases described above.
48
53
 
49
54
  ## NadicodeAI logo
50
55
 
package/docs/contract.md CHANGED
@@ -38,7 +38,7 @@ The source tree, barrels, and package exports own the current reusable section v
38
38
 
39
39
  ## Consumer Boundary
40
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.
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. [`terminal-tui-semantics.md`](terminal-tui-semantics.md) owns TUI semantics.
42
42
 
43
43
  App source composes layout, data, behavior, and semantic content around package components. It does not restyle an imported component root: appearance changes enter through the component's typed variant or are added to the owning package component. App `className` values on package components are limited to structural layout and sizing. App source uses semantic roles such as `bg-background` and `text-foreground`; raw Tailwind palette colors and canonical `nc-*` color utilities stay behind package-owned primitives such as `BrandField`. Visible controls come from `@nadicodeai/ui`, while hidden inputs remain valid form transport. The root ESLint rules `nadicodeai/no-shadcn-appearance-override`, `nadicodeai/no-raw-color-utility`, and `nadicodeai/no-native-visible-control` enforce this boundary.
44
44
 
package/llms.txt CHANGED
@@ -15,7 +15,6 @@ Use this file as a map; read the owning document before changing behavior.
15
15
  - Agent work surfaces: `docs/agent-work-surfaces.md`.
16
16
  - Product compositions and sections: `docs/product-compositions.md` and
17
17
  `docs/product-sections.md`.
18
- - Consumer migration: `docs/migration/nadia-consumer-readiness.md`.
19
18
  - Terminal and TUI semantics: `docs/terminal-tui-semantics.md`.
20
19
  - Maintenance workflow and live shadcn or AI Elements discovery:
21
20
  `docs/agents/nadicodeai-ui.md`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nadicodeai/ui",
3
- "version": "0.19.2",
3
+ "version": "0.20.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -63,7 +63,7 @@
63
63
  },
64
64
  "dependencies": {
65
65
  "@base-ui/react": "^1.6.0",
66
- "@nadicodeai/design-system": "0.19.2",
66
+ "@nadicodeai/design-system": "0.20.0",
67
67
  "@rive-app/react-webgl2": "^4.29.1",
68
68
  "@streamdown/cjk": "^1.0.3",
69
69
  "@streamdown/code": "^1.1.1",
@@ -49,7 +49,7 @@ import { AgentChat } from "@nadicodeai/ui/components/agent-chat";
49
49
  - Use package product components for shared settings, shell, installer, plugin-boundary, agent chat, artifact, file, diff, and redacted terminal summary UI.
50
50
  - Use first-party shadcn registry source in the consuming app for generic data tables, command palettes, and chart cards; do not import a NadicodeAI package abstraction for those patterns.
51
51
  - Keep routes, data, auth, server actions, persistence, permission decisions, runtime adapters, analytics, and product-specific copy in the consuming app.
52
- - Follow `docs/migration/nadia-consumer-readiness.md`: web admin or portal first, installer second, desktop shell third, desktop chat last, TUI through `docs/terminal-tui-semantics.md`.
52
+ - Render TUI surfaces through `docs/terminal-tui-semantics.md`.
53
53
  - Fixtures must be synthetic or redacted and cover provider, model, plugin, approval, diff, terminal, installer recovery, queued, streaming, and interrupted states. Do not use generic SaaS/card-grid filler, secrets, environment values, raw terminal output, hidden reasoning, user memory, fake customers, or fake proof metrics.
54
54
 
55
55
  ## Forms
@@ -1,180 +0,0 @@
1
- # Nadia Consumer Readiness
2
-
3
- This guide records the first consumer-readiness path for shared Nadia product UI.
4
- The components are presentational package surface. Consuming apps still own
5
- routes, auth, data loading, mutations, persistence, runtime adapters, permission
6
- decisions, analytics, and product-specific copy.
7
-
8
- ## Required Setup
9
-
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).
13
-
14
- Use public package subpaths:
15
-
16
- ```tsx
17
- import { DashboardShell } from "@nadicodeai/ui/components/dashboard-shell";
18
- import { AgentChat } from "@nadicodeai/ui/components/agent-chat";
19
- ```
20
-
21
- Use first-party shadcn registry source directly in the consuming app for generic
22
- data tables, command palettes, and chart cards. Do not migrate those patterns
23
- through a NadicodeAI package wrapper.
24
-
25
- ## Consumer Mapping
26
-
27
- ### Toast
28
-
29
- The imperative toast API is package-owned. Import it from the
30
- `@nadicodeai/ui/components/toast` subpath, and mount `<Toaster />` from
31
- `@nadicodeai/ui/components/sonner` once at the app root.
32
-
33
- ```tsx
34
- import { toast } from "@nadicodeai/ui/components/toast";
35
-
36
- showToast(message, "success"); // → toast.success(message)
37
- showToast(message, "error"); // → toast.error(message)
38
- ```
39
-
40
- Per-toast duration is a sonner option passed as the second argument.
41
- Consumers must not depend on `sonner` directly.
42
-
43
- ### Confirm flows
44
-
45
- `ConfirmDialog` from `@nadicodeai/ui/components/confirm-dialog` takes `open`,
46
- `onConfirm`, `onCancel`, `title`, and optional `description`, `confirmLabel`,
47
- `cancelLabel`, `destructive`, `loading`. `useConfirmAction` from
48
- `@nadicodeai/ui/hooks` replaces bespoke delete-confirm hooks:
49
-
50
- ```tsx
51
- useConfirmAction({ onConfirm }); // (value) => Promise<void> | void
52
- // → { request, cancel, confirm, isBusy, isOpen, pending }
53
- ```
54
-
55
- | Old (`useConfirmDelete`) | New (`useConfirmAction`) |
56
- | --- | --- |
57
- | `onDelete` | `onConfirm` |
58
- | `requestDelete` | `request` |
59
- | `isDeleting` | `isBusy` |
60
- | `pendingId` | `pending` |
61
-
62
- A throw inside `onConfirm` keeps the dialog open and the hook swallows it —
63
- surface errors from inside `onConfirm` yourself, with a toast or an inline
64
- alert. Non-delete confirms (restart, reset, reload) use the same component
65
- with either plain boolean state or the same hook.
66
-
67
- ### Typography
68
-
69
- The package ships no `Text`/`Heading` component — the same boundary that
70
- keeps `DataTable` and `CommandPalette` out. The type scale is design-system
71
- CSS consumed as classes on raw elements: `nc-type-display-xl/lg/md/sm`,
72
- `nc-type-title-lg/md/sm`, `nc-type-body-lg/md/sm` (plus `-strong` variants
73
- for `body-md`/`body-sm`), `nc-type-caption` (plus `-strong` and `-mono`),
74
- `nc-type-code`, and `nc-type-button-md/lg`.
75
-
76
- | Old usage | New usage |
77
- | --- | --- |
78
- | Page-level heading | `<h1 className="nc-type-title-lg">` (or a `display-*` class at hero scale) |
79
- | Section header (the dominant H2 `variant="sm"` pattern) | `<h2 className="nc-type-title-sm">` |
80
- | Body copy | `<p className="nc-type-body-md">` |
81
- | Fine print / labels | `nc-type-caption` |
82
- | Code | `nc-type-code` |
83
-
84
- ### Segmented control
85
-
86
- Single-select segmented UI is the existing `ToggleGroup`:
87
-
88
- ```tsx
89
- <ToggleGroup spacing={0} variant="outline">
90
- <ToggleGroupItem value="day">Day</ToggleGroupItem>
91
- <ToggleGroupItem value="week">Week</ToggleGroupItem>
92
- </ToggleGroup>
93
- ```
94
-
95
- Base UI's `ToggleGroup` is single-select by default (`toggleMultiple`
96
- defaults to `false`), and its value is an array. Controlled usage is
97
- `value={[current]}` with:
98
-
99
- ```tsx
100
- onValueChange={(next) => {
101
- if (next.length) setCurrent(next[0]);
102
- }}
103
- ```
104
-
105
- The length guard preserves radio semantics by ignoring deselection of the
106
- active item. A label-plus-group row ("FilterGroup") is an app-level flex
107
- composition, not package surface.
108
-
109
- ### Copy affordances
110
-
111
- Copy-to-clipboard UI is the AI Elements surface — a sanctioned public path.
112
- Use `Snippet`/`SnippetCopyButton` and `CodeBlockCopyButton` from
113
- `@nadicodeai/ui/ai-elements`.
114
-
115
- | Old | New |
116
- | --- | --- |
117
- | `CommandBlock(label, code)` | `Snippet` with `SnippetCopyButton` |
118
- | Bare `CopyButton(text)` | `SnippetCopyButton` inside a `Snippet`, or an app-local `Button` when no snippet chrome is wanted |
119
-
120
- ### Breakpoints
121
-
122
- `useIsMobile()` (fixed 768) and `useBelowBreakpoint(px)` (true strictly below
123
- `px`) both ship from `@nadicodeai/ui/hooks`.
124
-
125
- ## Migration Order
126
-
127
- 1. Web admin or portal validation slice.
128
- 2. Installer and bootstrap flows.
129
- 3. Desktop shell and plugin boundary surfaces.
130
- 4. Desktop chat and runtime work surfaces.
131
- 5. TUI consumers through the terminal semantic mapping document.
132
-
133
- Desktop chat is last because it carries runtime-sensitive approval, streaming,
134
- queue, attachment, file, diff, and terminal states. Terminal consumers should
135
- mirror `docs/terminal-tui-semantics.md` instead of importing a DOM runtime.
136
-
137
- ## Readiness Gates
138
-
139
- - The consumer satisfies the canonical setup in
140
- [`../consuming-cross-repo.md`](../consuming-cross-repo.md).
141
- - Product components are imported from `@nadicodeai/ui/components/*` public
142
- subpaths, not `src/*`.
143
- - At least one local shell, bento, settings, installer, plugin, or chat
144
- layout responsibility is removed from the consumer.
145
- - Routes, data, auth, copy, persistence, and runtime behavior remain app-owned.
146
- - Fixtures use synthetic or redacted provider, model, plugin, approval, diff,
147
- terminal, installer, and agent-work scenarios.
148
- - No fixture contains secrets, environment values, raw terminal output, hidden
149
- reasoning, user memory, fake customers, fake proof metrics, or generic SaaS
150
- filler.
151
-
152
- ## First Validation Slice
153
-
154
- The in-repo portal is the first real consumer slice. It already imports package
155
- CSS at `portal/src/app/layout.tsx`. Its shell now consumes
156
- `@nadicodeai/ui/components/dashboard-shell` and keeps portal-owned route
157
- definitions, access checks, data, and Italian copy in `portal/`.
158
-
159
- This validates the package boundary because the shared component owns responsive
160
- dashboard chrome, mobile navigation trigger, content containment, and sidebar
161
- structure while the portal keeps the Nadia Agents activation domain.
162
-
163
- ## Fixture Expectations
164
-
165
- Use NadicodeAI-relevant synthetic/redacted fixtures:
166
-
167
- - Data and settings: provider rows, model choices, plugin status, session state,
168
- loading, permission, error, empty, and recovery copy.
169
- - Auth and installer: activation-shaped states, expired or invalid pairing,
170
- retry and recovery actions, no live OTPs or secrets.
171
- - Shell and plugin: realistic navigation hierarchy, permission badges, disabled,
172
- warning, error, unsafe, and contained-overflow states.
173
- - Agent, file, diff, and terminal: approval choices, tool failure, redacted
174
- terminal summaries, changed-file hierarchy, interrupted, queued, and streaming
175
- states.
176
-
177
- Brand and marketing components remain part of the same package surface. Consumer
178
- migrations should not hide or replace `PageFrame`, `SectionIntro`, `Bento`,
179
- `MediaMount`, `DemoSurface`, `HeroSplit`, `NavBar`, `Footer`, `BrandWordmark`,
180
- or the existing marketing sections.