@nextop-os/ui-system 0.0.16 → 0.0.18
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 +106 -0
- package/README.md +15 -10
- package/agent/install-skill.mjs +65 -5
- package/agent/nextop-ui-system/SKILL.md +145 -69
- package/agent/nextop-ui-system/references/extract-base-component.md +87 -0
- package/agent/nextop-ui-system/references/maintain-inventory.md +45 -0
- package/agent/nextop-ui-system/references/promote-business-component.md +238 -0
- package/agent/nextop-ui-system/references/use-existing-component.md +37 -0
- package/agent/nextop-ui-system/scripts/create-business-preview.mjs +658 -0
- package/dist/chunk-GE5YVRTV.js +859 -0
- package/dist/chunk-GE5YVRTV.js.map +1 -0
- package/dist/chunk-KJQ366TA.js +70 -0
- package/dist/chunk-KJQ366TA.js.map +1 -0
- package/dist/chunk-LVHEV755.js +2553 -0
- package/dist/chunk-LVHEV755.js.map +1 -0
- package/dist/components/index.d.ts +162 -11
- package/dist/components/index.js +62 -2
- package/dist/date-format.d.ts +6 -0
- package/dist/date-format.js +11 -0
- package/dist/date-format.js.map +1 -0
- package/dist/dev-vite.js +12 -5
- package/dist/dev-vite.js.map +1 -1
- package/dist/icons/index.d.ts +90 -46
- package/dist/icons/index.js +93 -11
- package/dist/index.d.ts +3 -2
- package/dist/index.js +161 -11
- package/dist/metadata/components.json +1331 -263
- package/dist/metadata/components.schema.json +4 -0
- package/dist/metadata/index.d.ts +3 -1
- package/dist/metadata/index.js +1331 -263
- package/dist/metadata/index.js.map +1 -1
- package/dist/styles/base.css +85 -0
- package/dist/styles/index.css +1 -0
- package/dist/styles/semantic.css +8 -0
- package/dist/styles/theme.css +94 -1
- package/package.json +11 -2
- package/ui-system.md +640 -0
- package/dist/chunk-5COFORA5.js +0 -1159
- package/dist/chunk-5COFORA5.js.map +0 -1
- package/dist/chunk-TT7B6HKG.js +0 -205
- package/dist/chunk-TT7B6HKG.js.map +0 -1
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
# Promote Business Component
|
|
2
|
+
|
|
3
|
+
Use this reference when business-side UI should become a reusable
|
|
4
|
+
host-agnostic display component.
|
|
5
|
+
|
|
6
|
+
## Business Criteria
|
|
7
|
+
|
|
8
|
+
Proceed only if the component can render from props with no host side effects.
|
|
9
|
+
Business components may expose domain display props such as workspace, file,
|
|
10
|
+
task, agent, run, project, account, status, permission, labels, and callbacks.
|
|
11
|
+
|
|
12
|
+
Do not promote UI that owns daemon, Electron, router, store, query, persistence,
|
|
13
|
+
polling, filesystem access, or workflow orchestration.
|
|
14
|
+
|
|
15
|
+
## Agent-Owned Analysis
|
|
16
|
+
|
|
17
|
+
The agent must automatically analyze the candidate from code evidence. Do not
|
|
18
|
+
ask the user to provide the state matrix or props boundary unless the code has
|
|
19
|
+
conflicting evidence or an unclear business meaning.
|
|
20
|
+
|
|
21
|
+
Scan:
|
|
22
|
+
|
|
23
|
+
- source component and nearby helpers
|
|
24
|
+
- call sites and conditional rendering branches
|
|
25
|
+
- props, types, tests, mocks, fixtures, and sample data
|
|
26
|
+
- relevant i18n keys and resolved labels
|
|
27
|
+
- existing UI-system metadata and components
|
|
28
|
+
|
|
29
|
+
Build a state matrix from that evidence. For each candidate state, record:
|
|
30
|
+
|
|
31
|
+
- state name
|
|
32
|
+
- source file or branch proving the state
|
|
33
|
+
- props or data needed to render it
|
|
34
|
+
- variation axes and whether each axis is visual, structural, behavioral, or
|
|
35
|
+
host-owned
|
|
36
|
+
- host-owned behavior that must stay outside the shared component
|
|
37
|
+
- whether the state belongs in the shared component contract
|
|
38
|
+
|
|
39
|
+
## Agent-Owned Boundary Decision
|
|
40
|
+
|
|
41
|
+
The agent decides the proposed component boundary before implementation:
|
|
42
|
+
|
|
43
|
+
- component `id` and `layer: "business"`
|
|
44
|
+
- source usage being replaced
|
|
45
|
+
- intended reuse surfaces
|
|
46
|
+
- public props and callbacks
|
|
47
|
+
- API shape decision: variants, discriminated unions, slots, children, explicit
|
|
48
|
+
component variants, compound subcomponents, provider state, and host-owned
|
|
49
|
+
caller logic
|
|
50
|
+
- host-owned state and side effects that remain outside
|
|
51
|
+
- states that will appear in storyboard
|
|
52
|
+
- stable export path and metadata entry
|
|
53
|
+
|
|
54
|
+
If the candidate is not reusable or cannot stay host-agnostic, do not promote
|
|
55
|
+
it. Prefer using existing components or keeping the UI local.
|
|
56
|
+
|
|
57
|
+
## API Composition Gate
|
|
58
|
+
|
|
59
|
+
Before writing the promoted component, convert the state matrix into a public
|
|
60
|
+
API deliberately:
|
|
61
|
+
|
|
62
|
+
1. List every visual, structural, and behavioral variation found in source
|
|
63
|
+
evidence.
|
|
64
|
+
2. Keep only standard state booleans such as `disabled`, `loading`, `selected`,
|
|
65
|
+
`open`, `required`, or `invalid` when they represent real states and do not
|
|
66
|
+
create impossible combinations.
|
|
67
|
+
3. Replace mode booleans such as `isFoo`, `showBar`, and `withBaz` with a
|
|
68
|
+
finite variant, discriminated union, explicit component variant, slot, or
|
|
69
|
+
composed child.
|
|
70
|
+
4. Prefer `children` or named slots for caller-owned visual regions. Use render
|
|
71
|
+
props only when the shared component needs to pass data back to the caller.
|
|
72
|
+
5. Use compound components and context only when consumers need to assemble
|
|
73
|
+
subparts while sharing state. A simple row, card, badge, toolbar, or display
|
|
74
|
+
panel should stay as a direct props-driven component.
|
|
75
|
+
6. If shared state is necessary, define a narrow injectable context contract as
|
|
76
|
+
`state`, `actions`, and `meta`. Providers may adapt caller state, but daemon,
|
|
77
|
+
Electron, router, store, query, persistence, filesystem, i18n lookup, and
|
|
78
|
+
workflow orchestration remain outside `@nextop-os/ui-system`.
|
|
79
|
+
7. For new React components, use the repository's React 19 baseline, including
|
|
80
|
+
`ref` as a prop when needed. Do not rewrite shadcn or Radix-acquired
|
|
81
|
+
internals solely to normalize API style.
|
|
82
|
+
|
|
83
|
+
Stop promotion if the only way to represent the source states is a broad bag of
|
|
84
|
+
unrelated boolean props or leaked host state. Narrow the boundary, create
|
|
85
|
+
explicit variants, or keep the UI local.
|
|
86
|
+
|
|
87
|
+
## Implementation Blueprint
|
|
88
|
+
|
|
89
|
+
Implement the promoted component directly from three inputs:
|
|
90
|
+
|
|
91
|
+
- the code-evidence state matrix
|
|
92
|
+
- the proposed public props and callback boundary
|
|
93
|
+
- the existing candidate source UI or visual surface being extracted
|
|
94
|
+
|
|
95
|
+
The promoted component should be a props-driven version of the candidate source
|
|
96
|
+
with host-owned behavior removed. Preserve the real visual structure, component
|
|
97
|
+
composition, class names, spacing, icons, and state-specific branches unless
|
|
98
|
+
they depend on host-owned behavior. Replace host-owned behavior with public
|
|
99
|
+
props, callbacks, caller-owned slots, or explicit variants. Add storyboard
|
|
100
|
+
examples for every accepted public state in the same change so the review can
|
|
101
|
+
inspect the finished implementation instead of a preflight draft.
|
|
102
|
+
|
|
103
|
+
If the draft still needs app state, navigation, fetching, persistence, i18n key
|
|
104
|
+
lookup, or host adapters to render, stop and revise the component boundary
|
|
105
|
+
instead of promoting it.
|
|
106
|
+
|
|
107
|
+
## Promotion Chain Demo
|
|
108
|
+
|
|
109
|
+
Example request:
|
|
110
|
+
|
|
111
|
+
```text
|
|
112
|
+
Promote the managed agent settings table into @nextop-os/ui-system.
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Expected chain:
|
|
116
|
+
|
|
117
|
+
1. **Analyze source evidence**
|
|
118
|
+
- Read the source table, settings panel call sites, tests, mocks, and i18n
|
|
119
|
+
labels.
|
|
120
|
+
- Check existing metadata for reusable table, badge, button, dialog, and
|
|
121
|
+
icon primitives.
|
|
122
|
+
2. **Build the state matrix**
|
|
123
|
+
|
|
124
|
+
```text
|
|
125
|
+
normal
|
|
126
|
+
- Evidence: settings table renders installed agents with status and actions.
|
|
127
|
+
- Props/data: rows, status labels, action labels, icon slots, callbacks.
|
|
128
|
+
- Host-owned: install/uninstall orchestration, queue state derivation, i18n.
|
|
129
|
+
- Contract: yes.
|
|
130
|
+
|
|
131
|
+
empty
|
|
132
|
+
- Evidence: settings surface renders no configured agents.
|
|
133
|
+
- Props/data: empty title/body.
|
|
134
|
+
- Host-owned: deciding whether inventory is empty.
|
|
135
|
+
- Contract: yes.
|
|
136
|
+
|
|
137
|
+
disabled
|
|
138
|
+
- Evidence: actions disabled while an operation is pending.
|
|
139
|
+
- Props/data: disabled rows or disabled actions.
|
|
140
|
+
- Host-owned: permission and pending-operation calculation.
|
|
141
|
+
- Contract: yes.
|
|
142
|
+
|
|
143
|
+
error-like
|
|
144
|
+
- Evidence: row can show install failure or unavailable status.
|
|
145
|
+
- Props/data: tone, status label, supporting text.
|
|
146
|
+
- Host-owned: failure classification and retry behavior.
|
|
147
|
+
- Contract: yes.
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
3. **Decide the boundary before implementation**
|
|
151
|
+
- `id`: a stable kebab-case business component id, for example
|
|
152
|
+
`example-business-component`
|
|
153
|
+
- `layer`: `business`
|
|
154
|
+
- Export: a matching PascalCase component name, for example
|
|
155
|
+
`ExampleBusinessComponent`
|
|
156
|
+
- Public props: rows, labels, icon render slots, action callbacks, disabled
|
|
157
|
+
flags, status/tone fields, empty-state copy.
|
|
158
|
+
- API shape: row status as finite tone values, callbacks as host-provided
|
|
159
|
+
actions, empty state copy as labels, and no install/uninstall mode
|
|
160
|
+
booleans. If the table later needs caller-owned row adornments, prefer a
|
|
161
|
+
named slot or composed child over a broad render prop.
|
|
162
|
+
- Host-owned behavior: i18n lookup, daemon calls, install queue,
|
|
163
|
+
confirmation dialogs, persistence, routing, and state derivation.
|
|
164
|
+
4. **Implement the promoted component**
|
|
165
|
+
- Adapt the current candidate source into the final
|
|
166
|
+
`packages/ui/system/src/components/<component-file>.tsx` component.
|
|
167
|
+
- Keep the real table layout, status cells, action affordances, icon
|
|
168
|
+
placement, empty state, and disabled/error branches.
|
|
169
|
+
- Replace host behavior with props and local callback stubs: i18n-resolved
|
|
170
|
+
labels, queue state, confirmation dialog decisions, daemon calls, and
|
|
171
|
+
install orchestration stay outside the component.
|
|
172
|
+
- Make only package integration edits: final exported prop types, imports,
|
|
173
|
+
class cleanup, and package-local helpers.
|
|
174
|
+
- Export it from stable barrels.
|
|
175
|
+
- Add metadata with `layer: "business"` and storyboard coverage for the
|
|
176
|
+
accepted states.
|
|
177
|
+
- Replace the original app UI with `@nextop-os/ui-system` imports while
|
|
178
|
+
leaving host-owned behavior in the caller.
|
|
179
|
+
5. **Validate and report**
|
|
180
|
+
- Review the finished implementation through the storyboard states and the
|
|
181
|
+
migrated consumer surface.
|
|
182
|
+
- Start an independent design-foundation review subagent. Give it the
|
|
183
|
+
promoted files, original source usage, selected state matrix, storyboard
|
|
184
|
+
entry, metadata entry, and `ui-system.md`.
|
|
185
|
+
- Include the API shape review in the handoff: accepted booleans, variants,
|
|
186
|
+
slots or children, explicit variants, provider state if any, and
|
|
187
|
+
host-owned behavior kept in the caller.
|
|
188
|
+
- Resolve any subagent-reported design drift before reporting completion.
|
|
189
|
+
- Run the promotion review gate: Frictionless task path and action hierarchy,
|
|
190
|
+
Quality Craft visual parity and token/state coverage, and Trustworthy
|
|
191
|
+
labels, recovery, policy, and provenance behavior.
|
|
192
|
+
- Run metadata, boundary, storyboard, and relevant package checks.
|
|
193
|
+
- Report the state matrix summary, final boundary, promotion review result,
|
|
194
|
+
subagent design-foundation result, validation results, and uncovered
|
|
195
|
+
risks.
|
|
196
|
+
|
|
197
|
+
## Implementation
|
|
198
|
+
|
|
199
|
+
1. Implement the business component by composing `base` primitives.
|
|
200
|
+
2. Keep all host-owned behavior in the caller.
|
|
201
|
+
3. Preserve the API composition decision. Do not add new mode booleans or
|
|
202
|
+
host-owned state while moving the candidate UI into the shared package.
|
|
203
|
+
4. Add stable exports and metadata with `layer: "business"`.
|
|
204
|
+
5. Add storyboard examples for normal, empty, disabled, loading, and error-like
|
|
205
|
+
states when those states exist in the public contract.
|
|
206
|
+
6. Migrate callers by replacing only the visual surface.
|
|
207
|
+
7. Run the promotion review gate from
|
|
208
|
+
`ui-system.md` against the promoted component
|
|
209
|
+
and migrated consumer.
|
|
210
|
+
8. Start the design-foundation review subagent and resolve any reported drift.
|
|
211
|
+
|
|
212
|
+
## Validation
|
|
213
|
+
|
|
214
|
+
Run the relevant checks:
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
node tools/scripts/check-ui-metadata.mjs
|
|
218
|
+
pnpm check:ui-boundaries
|
|
219
|
+
pnpm --filter @nextop-os/ui-storyboard typecheck
|
|
220
|
+
pnpm --filter @nextop-os/ui-system typecheck
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
If a consumer was migrated, also run that consumer's typecheck or build.
|
|
224
|
+
|
|
225
|
+
Report:
|
|
226
|
+
|
|
227
|
+
- state matrix summary
|
|
228
|
+
- component boundary decision
|
|
229
|
+
- API composition decision and any rejected boolean or state combinations
|
|
230
|
+
- promotion review result with Frictionless / Quality Craft / Trustworthy
|
|
231
|
+
pillar status and blocking/major/minor issues
|
|
232
|
+
- design-foundation subagent result
|
|
233
|
+
- validation commands and results
|
|
234
|
+
- remaining risks or uncovered states
|
|
235
|
+
|
|
236
|
+
Do not report full design-foundation compliance unless the subagent review ran
|
|
237
|
+
and found no unresolved drift. If subagents are unavailable, report the
|
|
238
|
+
verification as blocked.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Use Existing Component
|
|
2
|
+
|
|
3
|
+
Use this reference when replacing local UI with `@nextop-os/ui-system` or when
|
|
4
|
+
answering what shared components exist.
|
|
5
|
+
|
|
6
|
+
## Workflow
|
|
7
|
+
|
|
8
|
+
1. Read component metadata first by `id`, `name`, `export`, `layer`, and
|
|
9
|
+
`useCases`.
|
|
10
|
+
2. Prefer an existing component before creating, extracting, or promoting a new
|
|
11
|
+
one.
|
|
12
|
+
3. Read the selected component source and props type before using it.
|
|
13
|
+
4. Import through stable public entrypoints only.
|
|
14
|
+
5. Replace only the visual surface.
|
|
15
|
+
|
|
16
|
+
## Caller-Owned Work
|
|
17
|
+
|
|
18
|
+
Keep these in the caller:
|
|
19
|
+
|
|
20
|
+
- host state and derived business state
|
|
21
|
+
- data loading, cache mutation, and persistence
|
|
22
|
+
- routing, daemon calls, Electron calls, and filesystem access
|
|
23
|
+
- i18n key lookup and user-visible product copy selection
|
|
24
|
+
- confirmation dialogs, queueing, install or uninstall flows, and navigation
|
|
25
|
+
|
|
26
|
+
The UI-system component should receive resolved props, labels, callbacks,
|
|
27
|
+
status values, icons, and children.
|
|
28
|
+
|
|
29
|
+
## Validation
|
|
30
|
+
|
|
31
|
+
Run the smallest relevant checks:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pnpm check:ui-boundaries
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
If the consumer code changed, also run the relevant consumer typecheck or build.
|