@botiverse/raft-ui 0.0.0-stage → 0.7.1
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/CHANGELOG.md +576 -0
- package/LICENSE +21 -0
- package/README.md +103 -2
- package/codemods/package-name.mjs +168 -0
- package/codemods/token-names.mjs +150 -0
- package/dist/cn.d.mts +5 -0
- package/dist/cn.mjs +48 -0
- package/dist/components/combobox-select/combobox-select.css +286 -0
- package/dist/components/float-button/float-button.css +316 -0
- package/dist/components/steps/otter-indicator.css +141 -0
- package/dist/components/steps/steps.css +370 -0
- package/dist/components/timeline/timeline.css +255 -0
- package/dist/dialog-CY6S-Xqf.mjs +505 -0
- package/dist/fonts.css +13 -0
- package/dist/foundation.css +623 -0
- package/dist/index-B3_j9XYd.d.mts +329 -0
- package/dist/index.d.mts +5114 -0
- package/dist/index.mjs +16442 -0
- package/dist/style.css +1315 -0
- package/dist/styles.css +444 -0
- package/dist/tokens.json +3811 -0
- package/dist/wip.d.mts +92 -0
- package/dist/wip.mjs +517 -0
- package/package.json +92 -3
- package/skills/raft-ui-critique/SKILL.md +167 -0
- package/skills/raft-ui-critique/agents/openai.yaml +4 -0
- package/skills/raft-ui-critique/references/theme-lenses.md +69 -0
- package/skills/raft-ui-guide/SKILL.md +96 -0
- package/skills/raft-ui-guide/agents/openai.yaml +4 -0
- package/skills/raft-ui-guide/rules/adoption.md +55 -0
- package/skills/raft-ui-guide/rules/composition.md +14 -0
- package/skills/raft-ui-guide/rules/conversation.md +15 -0
- package/skills/raft-ui-guide/rules/display.md +14 -0
- package/skills/raft-ui-guide/rules/feedback.md +13 -0
- package/skills/raft-ui-guide/rules/forms.md +13 -0
- package/skills/raft-ui-guide/rules/layout.md +15 -0
- package/skills/raft-ui-guide/rules/lookup.md +78 -0
- package/skills/raft-ui-guide/rules/overlays.md +13 -0
- package/skills/raft-ui-guide/rules/overview.md +30 -0
- package/skills/raft-ui-guide/rules/styling.md +17 -0
- package/skills/raft-ui-guide/rules/technical-overview.md +80 -0
package/package.json
CHANGED
|
@@ -1,6 +1,95 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botiverse/raft-ui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.7.1",
|
|
4
|
+
"description": "React components and CSS foundations for the Raft Design System.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"agent-skills",
|
|
7
|
+
"base-ui",
|
|
8
|
+
"components",
|
|
9
|
+
"design-system",
|
|
10
|
+
"react",
|
|
11
|
+
"tailwindcss",
|
|
12
|
+
"tanstack-intent"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://raft-design.botiverse.build",
|
|
15
|
+
"bugs": "https://github.com/botiverse/raft-design/issues",
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/botiverse/raft-design.git",
|
|
20
|
+
"directory": "packages/ui"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"CHANGELOG.md",
|
|
24
|
+
"codemods",
|
|
25
|
+
"dist",
|
|
26
|
+
"skills"
|
|
27
|
+
],
|
|
28
|
+
"type": "module",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./dist/index.d.mts",
|
|
32
|
+
"default": "./dist/index.mjs"
|
|
33
|
+
},
|
|
34
|
+
"./cn": {
|
|
35
|
+
"types": "./dist/cn.d.mts",
|
|
36
|
+
"default": "./dist/cn.mjs"
|
|
37
|
+
},
|
|
38
|
+
"./wip": {
|
|
39
|
+
"types": "./dist/wip.d.mts",
|
|
40
|
+
"default": "./dist/wip.mjs"
|
|
41
|
+
},
|
|
42
|
+
"./fonts.css": "./dist/fonts.css",
|
|
43
|
+
"./styles.css": "./dist/styles.css",
|
|
44
|
+
"./package.json": "./package.json",
|
|
45
|
+
"./foundation.css": "./dist/foundation.css",
|
|
46
|
+
"./tokens.json": "./dist/tokens.json"
|
|
47
|
+
},
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@base-ui/react": "^1.8.0",
|
|
53
|
+
"@dnd-kit/core": "^6.3.1",
|
|
54
|
+
"@dnd-kit/sortable": "^10.0.0",
|
|
55
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
56
|
+
"@tanstack/react-hotkeys": "^0.11.0",
|
|
57
|
+
"cnfast": "^0.2.0",
|
|
58
|
+
"foxact": "^0.3.12",
|
|
59
|
+
"lucide-react": "^1.48.0",
|
|
60
|
+
"react-resizable-panels": "^4.13.2",
|
|
61
|
+
"tailwind-merge": "^3.7.0",
|
|
62
|
+
"tailwind-variants": "^3.3.1"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@tailwindcss/vite": "^4.3.3",
|
|
66
|
+
"@testing-library/dom": "^10.4.2",
|
|
67
|
+
"@testing-library/react": "^16.3.3",
|
|
68
|
+
"@types/node": "^26.6.2",
|
|
69
|
+
"@types/react": "^19.3.0",
|
|
70
|
+
"@types/react-dom": "^19.3.0",
|
|
71
|
+
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
72
|
+
"@vitejs/plugin-react": "^6.1.1",
|
|
73
|
+
"@vitest/browser-playwright": "5.0.1",
|
|
74
|
+
"jsdom": "^30.1.1",
|
|
75
|
+
"playwright": "^1.63.0",
|
|
76
|
+
"react": "^19.3.0",
|
|
77
|
+
"react-dom": "^19.3.0",
|
|
78
|
+
"tailwindcss": "^4.3.3",
|
|
79
|
+
"typescript": "^7.0.2",
|
|
80
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@1.0.0",
|
|
81
|
+
"vite-plus": "1.0.0",
|
|
82
|
+
"vitest": "5.0.1"
|
|
83
|
+
},
|
|
84
|
+
"peerDependencies": {
|
|
85
|
+
"react": "^19",
|
|
86
|
+
"react-dom": "^19"
|
|
87
|
+
},
|
|
88
|
+
"scripts": {
|
|
89
|
+
"build:tokens": "node scripts/build-tokens.mjs",
|
|
90
|
+
"build": "vp pack",
|
|
91
|
+
"check": "vp check",
|
|
92
|
+
"dev": "vp pack --watch",
|
|
93
|
+
"test": "vp test"
|
|
94
|
+
}
|
|
6
95
|
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: raft-ui-critique
|
|
3
|
+
description: "Critique raft-ui components and product surfaces from screenshots, live renders, or code evidence in Light and Dark modes. Use when reviewing, auditing, polishing, comparing, or validating visual hierarchy, Raft fidelity, interaction feedback, accessibility, consistency, and user experience in packages/ui, docs compositions, or Playground."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Raft UI Critique
|
|
7
|
+
|
|
8
|
+
Review the rendered experience, not only implementation compliance. Produce specific, evidence-based findings for each color mode and for the relationships between them.
|
|
9
|
+
|
|
10
|
+
Use [theme-lenses.md](./references/theme-lenses.md) for every review. Read active repository instructions when they are available, but keep this skill usable from the published `raft-ui` package without requiring sibling skills or repository-only files.
|
|
11
|
+
|
|
12
|
+
## Theme model
|
|
13
|
+
|
|
14
|
+
Raft is the only visual language. Treat its two color modes as independent critique presets:
|
|
15
|
+
|
|
16
|
+
| Critique preset | Runtime configuration |
|
|
17
|
+
| --------------- | --------------------- |
|
|
18
|
+
| Light | `mode="light"` |
|
|
19
|
+
| Dark | `mode="dark"` |
|
|
20
|
+
|
|
21
|
+
Do not invent a theme family or a `theme` prop; `mode="system"` resolves to one of these two. Dark still requires its own evidence and verdict because dark surfaces, contrast, elevation, and interaction states fail independently.
|
|
22
|
+
|
|
23
|
+
## Evidence boundary
|
|
24
|
+
|
|
25
|
+
Use the strongest evidence available for the claim being made:
|
|
26
|
+
|
|
27
|
+
1. For visual hierarchy and preset comparison, prefer matched screenshots or renders of both presets.
|
|
28
|
+
2. For interaction, focus, responsive behavior, overlays, or motion, prefer a live page when the user and host environment authorize interaction.
|
|
29
|
+
3. Use partial screenshots or renders for local observed findings only.
|
|
30
|
+
4. Use component code and recipes to trace likely causes, never to claim a rendered result.
|
|
31
|
+
|
|
32
|
+
Follow the host repository's tool and browser policy. Do not infer permission from this skill. When live interaction is unavailable, continue with supplied evidence and mark unexercised behavior as a coverage gap.
|
|
33
|
+
|
|
34
|
+
When evidence is incomplete:
|
|
35
|
+
|
|
36
|
+
- Critique what is visible without blocking useful work.
|
|
37
|
+
- Name every missing preset, state, or viewport in `Coverage gaps`.
|
|
38
|
+
- Do not issue a cross-mode pass verdict without matched evidence for both presets.
|
|
39
|
+
- Label code-only conclusions as inferred. Do not claim pixel accuracy, visual parity, contrast compliance, or interaction quality from static code alone.
|
|
40
|
+
|
|
41
|
+
## Package evidence lookup
|
|
42
|
+
|
|
43
|
+
Use the first available evidence source; do not require a source checkout:
|
|
44
|
+
|
|
45
|
+
1. In the raft-ui repository, inspect `packages/ui/src/foundation.css`, `packages/ui/src/fonts.css`, the component recipe, and its real consumers.
|
|
46
|
+
2. In an installed application, inspect `node_modules/@botiverse/raft-ui/dist/foundation.css`, `node_modules/@botiverse/raft-ui/dist/fonts.css`, `node_modules/@botiverse/raft-ui/dist/index.d.mts`, and the application's component usage.
|
|
47
|
+
3. If neither code surface is available, rely on supplied screenshots or renders and state that implementation ownership is unverified.
|
|
48
|
+
|
|
49
|
+
Treat declarations as API evidence and compiled CSS as token evidence.
|
|
50
|
+
|
|
51
|
+
## Review workflow
|
|
52
|
+
|
|
53
|
+
Follow this sequence without merging the lenses.
|
|
54
|
+
|
|
55
|
+
### 1. Establish context
|
|
56
|
+
|
|
57
|
+
State what the surface is, who uses it, its primary task, and the likely user state of mind. Distinguish an isolated primitive, a canonical composition, and a product workflow; each has a different appropriate density and level of context.
|
|
58
|
+
|
|
59
|
+
### 2. Normalize the evidence
|
|
60
|
+
|
|
61
|
+
Compare like for like:
|
|
62
|
+
|
|
63
|
+
- Use the same component, content, state, viewport dimensions, zoom, and motion frame.
|
|
64
|
+
- Keep surrounding context equivalent. A fragment without its normal shell cannot prove page hierarchy.
|
|
65
|
+
- Record which interaction states are shown: default, hover, pressed, focus-visible, disabled, selected, open, checked, invalid, loading, or empty, as applicable.
|
|
66
|
+
- Separate the live primitive, docs composition, and Playground wrapper. Never treat one as proof for another.
|
|
67
|
+
|
|
68
|
+
Record an evidence manifest with the route or artifact, preset, exact viewport, browser/platform when known, zoom, font-loading status, UI state, and reduced-motion setting when motion is relevant. For a full product-surface review, include a representative wide and narrow viewport when the layout is responsive; a single isolated primitive may need only its relevant size.
|
|
69
|
+
|
|
70
|
+
If mismatched evidence prevents a fair comparison, report that before critiquing the modes.
|
|
71
|
+
|
|
72
|
+
### 3. Exercise interaction when live evidence is available
|
|
73
|
+
|
|
74
|
+
Use both pointer and keyboard for applicable controls:
|
|
75
|
+
|
|
76
|
+
1. Observe the resting state and identify the expected action.
|
|
77
|
+
2. Exercise hover, pressed, and keyboard focus-visible independently.
|
|
78
|
+
3. Open, select, check, expand, drag, validate, load, or disable the control when those states belong to the surface.
|
|
79
|
+
4. Inspect overlay placement, clipping, focus return, and preset inheritance.
|
|
80
|
+
5. Repeat the material states in both presets; do not assume behavior verified in one preset survives the other.
|
|
81
|
+
|
|
82
|
+
Capture or record the exact state that supports each interaction finding. If a state cannot be reached safely, mark it `Not exercised`; do not issue a pass or failure verdict for that state.
|
|
83
|
+
|
|
84
|
+
### 4. Give a first impression
|
|
85
|
+
|
|
86
|
+
Write one direct paragraph about the overall hierarchy and emotional tone. Identify the visual entry point, the heaviest element, and the most obvious source of friction. Do not pad the critique with generic praise.
|
|
87
|
+
|
|
88
|
+
### 5. Review the shared interface
|
|
89
|
+
|
|
90
|
+
Audit the dimensions that should work in every preset:
|
|
91
|
+
|
|
92
|
+
- Visual hierarchy: color intentionality, typography, weight versus importance, spacing, alignment, density, icons, and media.
|
|
93
|
+
- Interface design: focusing mechanism, progressive disclosure, information load, expectation setting, feedback, redundancy, and platform conventions.
|
|
94
|
+
- Interaction: visible affordances and distinguishable hover, pressed, focus-visible, disabled, selected, open, checked, invalid, and loading states when relevant.
|
|
95
|
+
- User context: emotional burden, time pressure, recoverability, clarity of the next action, and moments where uncommon care is missing.
|
|
96
|
+
- Accessibility visible from the evidence: focus visibility, target clarity, state communication, text legibility, and reliance on color alone. Do not claim keyboard behavior without exercising it or a contrast ratio without measured colors.
|
|
97
|
+
|
|
98
|
+
Count and name what is visible. Prefer "four surfaces compete with equal weight" over "the hierarchy feels off."
|
|
99
|
+
|
|
100
|
+
### 6. Review each preset independently
|
|
101
|
+
|
|
102
|
+
Apply the lenses in [theme-lenses.md](./references/theme-lenses.md):
|
|
103
|
+
|
|
104
|
+
1. Raft, in Light and in Dark
|
|
105
|
+
2. Dark mode, in Dark
|
|
106
|
+
|
|
107
|
+
Dark is not an inverted Light screenshot. Judge whether each preset expresses the same semantic hierarchy through the Raft visual language.
|
|
108
|
+
|
|
109
|
+
### 7. Compare across presets
|
|
110
|
+
|
|
111
|
+
Check the cross-mode invariants in [theme-lenses.md](./references/theme-lenses.md).
|
|
112
|
+
|
|
113
|
+
A shared defect belongs under `Cross-mode`. A defect visible in only one preset belongs under that preset even when the root cause is shared code.
|
|
114
|
+
|
|
115
|
+
### 8. Trace likely ownership
|
|
116
|
+
|
|
117
|
+
When code is available, connect each visual issue to the most likely owner without turning the critique into an implementation plan:
|
|
118
|
+
|
|
119
|
+
- Reusable appearance or interaction styling: `packages/ui` component recipe or semantic tokens.
|
|
120
|
+
- Canonical example structure: docs module composition.
|
|
121
|
+
- Product state or workflow coordination: Playground or application consumer.
|
|
122
|
+
- Global token and font material: `foundation.css` / `fonts.css` (see Package evidence lookup).
|
|
123
|
+
|
|
124
|
+
State whether the cause is observed, code-verified, or inferred. Do not prescribe a new token for a one-off correction, and do not patch a consumer to compensate for a broken reusable component contract.
|
|
125
|
+
|
|
126
|
+
### 9. Prioritize findings
|
|
127
|
+
|
|
128
|
+
Use these severities:
|
|
129
|
+
|
|
130
|
+
- `P1` — Blocks understanding or task completion; hides focus/state; creates a serious accessibility problem; or breaks structure in a preset.
|
|
131
|
+
- `P2` — Material hierarchy, readability, interaction, consistency, or cross-mode defect that should be fixed.
|
|
132
|
+
- `P3` — Local polish issue with limited user impact.
|
|
133
|
+
|
|
134
|
+
Order structural and behavioral problems before visual polish. Do not invent a finding for every preset.
|
|
135
|
+
|
|
136
|
+
## Finding format
|
|
137
|
+
|
|
138
|
+
Write every finding as:
|
|
139
|
+
|
|
140
|
+
`[P2][Dark][Surface separation] — factual observation. User impact. Direction for improvement. Evidence: screenshot, state, or file.`
|
|
141
|
+
|
|
142
|
+
Keep observation, impact, and direction distinct. If the cause is inferred, say so explicitly.
|
|
143
|
+
|
|
144
|
+
## Output format
|
|
145
|
+
|
|
146
|
+
Always include:
|
|
147
|
+
|
|
148
|
+
```markdown
|
|
149
|
+
## Context and evidence
|
|
150
|
+
|
|
151
|
+
## Overall verdict
|
|
152
|
+
|
|
153
|
+
## Findings
|
|
154
|
+
|
|
155
|
+
## Top opportunities
|
|
156
|
+
|
|
157
|
+
## Coverage gaps
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Under `Findings`, add `Cross-mode`, `Light`, `Dark`, or `Interaction and user context` subsections only when evidence supports them. Do not create empty preset sections for a partial review. Under `Top opportunities`, rank one to five supported changes and name which presets they affect; there is no minimum finding count.
|
|
161
|
+
|
|
162
|
+
## Hard boundaries
|
|
163
|
+
|
|
164
|
+
- Keep review-only requests read-only.
|
|
165
|
+
- Do not conflate critique with functional validation, static checks, or test results.
|
|
166
|
+
- Do not recommend making Light and Dark visually identical; require equivalent usability and semantic hierarchy.
|
|
167
|
+
- Do not let mode-specific polish change component meaning, public API, or business structure.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Raft UI Critique"
|
|
3
|
+
short_description: "Review raft-ui in Light and Dark modes"
|
|
4
|
+
default_prompt: "Use $raft-ui-critique to review the supplied interface evidence in Light and Dark modes. State coverage, exercise interactions only when authorized, and do not infer unseen states."
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Theme Lenses
|
|
2
|
+
|
|
3
|
+
Use all three lenses for a full review: the cross-mode lens, the Raft lens in each preset, and the dark-mode lens for Dark. Verify token- or typography-specific claims against `foundation.css` and `fonts.css` (see Package evidence lookup in SKILL.md).
|
|
4
|
+
|
|
5
|
+
## Cross-mode lens
|
|
6
|
+
|
|
7
|
+
Check whether Light and Dark preserve:
|
|
8
|
+
|
|
9
|
+
- The same component identity, content, reading order, and interaction model.
|
|
10
|
+
- Equivalent importance for primary actions, destructive actions, status, metadata, and secondary controls.
|
|
11
|
+
- Usable geometry: no mode-only clipping, wrapping, crowding, overlay collision, or target shrinkage.
|
|
12
|
+
- Component ownership: a mode may restyle structure but must not add, remove, or replace business DOM.
|
|
13
|
+
- Semantic color roles: primary is interactive expression and hints; accent is core or important action; state colors communicate state rather than decoration.
|
|
14
|
+
- Contextual fit: the component still belongs in the surrounding shell instead of looking like a pasted demo.
|
|
15
|
+
|
|
16
|
+
Use a comparison matrix when several states are present:
|
|
17
|
+
|
|
18
|
+
| State or relationship | Light | Dark | Verdict |
|
|
19
|
+
| ----------------------- | -------- | -------- | ------------ |
|
|
20
|
+
| Resting hierarchy | observed | observed | pass/finding |
|
|
21
|
+
| Hover and pressed | observed | observed | pass/finding |
|
|
22
|
+
| Focus-visible | observed | observed | pass/finding |
|
|
23
|
+
| Disabled or unavailable | observed | observed | pass/finding |
|
|
24
|
+
| Selected/open/checked | observed | observed | pass/finding |
|
|
25
|
+
| Error/loading/empty | observed | observed | pass/finding |
|
|
26
|
+
|
|
27
|
+
Include only applicable rows. `Not shown` is evidence status, not a pass.
|
|
28
|
+
|
|
29
|
+
## Raft lens
|
|
30
|
+
|
|
31
|
+
Judge whether the surface speaks Raft's material language:
|
|
32
|
+
|
|
33
|
+
- Every color block is a sticker: an ink edge and ink type on the color. Flag colored fills without the edge, light type on a sticker, and edges that double up with an adjacent border.
|
|
34
|
+
- Lines carry roles: ink lines say "control", seams split regions, hairlines sit inside content. Flag a hairline used as a control edge or an ink line used as a region divider.
|
|
35
|
+
- Controls cast no shadow; only overlays float, and `--elevation-sticker` is a hard offset under a sticker. Flag soft shadows on controls, cards, or rows, and floating surfaces without the overlay shadow.
|
|
36
|
+
- Corners follow the shape scale in `styles.css`: sticker, chip, control, container, dialog; fully round only for switches and radios. Flag corners off the scale or mixed within one group.
|
|
37
|
+
- Space Grotesk is what people say; Space Mono is what machines write (ids, times, counts, events, code). Flag machine output set in sans and prose set in mono.
|
|
38
|
+
- Yellow and pink must carry semantic roles. Flag decorative yellow/pink fields that compete with primary actions or status.
|
|
39
|
+
- Hover and pressed keep a control's resting color under an ink wash; focus-visible is the ink ring. Flag a state that swaps a sticker's color or that is indistinguishable from rest.
|
|
40
|
+
- Stickers, ink edges, and bold type create high baseline intensity. Require a clear entry point and quieter secondary information so the surface does not shout uniformly.
|
|
41
|
+
|
|
42
|
+
Ask: does every sticker, line, and shadow carry a role, or is the surface merely loud?
|
|
43
|
+
|
|
44
|
+
## Dark-mode lens
|
|
45
|
+
|
|
46
|
+
Review this independently rather than treating it as color inversion:
|
|
47
|
+
|
|
48
|
+
- Content stays lighter than the frame and sidebar, and card, popover, and inset surfaces step lighter again. Flag panels, cards, fields, and popovers that collapse into one black plane.
|
|
49
|
+
- Preserve the neutral material and text hierarchy. Flag pure-black patches, mismatched neutrals, glowing white text, and muted text that becomes either dominant or unreadable.
|
|
50
|
+
- Stickers keep their colors and ink type and gain a die-cut edge. Flag stickers that lose the edge or switch to light type.
|
|
51
|
+
- Seams, hairlines, and the overlay shadow must separate adjacent dark surfaces without creating halos, dirty seams, or black fog.
|
|
52
|
+
- Semantic colors and translucent state washes must composite cleanly over page, panel, and popover surfaces. Flag oversaturation, muddy status colors, and color-only state communication.
|
|
53
|
+
- Hover, pressed, focus-visible, selected, checked, invalid, and disabled states need distinct luminance or structure; a slight color shift that disappears on dark is not enough.
|
|
54
|
+
- Overlays and portals must inherit Dark correctly. Check popovers, menus, dialogs, tooltips, native controls, and backdrops for light-mode leakage.
|
|
55
|
+
- Media, avatars, icons, and illustrations must retain intended contrast without accidental dimming, inversion, or bright edge artifacts.
|
|
56
|
+
|
|
57
|
+
Ask: does this feel dimensional and composed, or flat, glowing, and fatiguing?
|
|
58
|
+
|
|
59
|
+
## User-context lens
|
|
60
|
+
|
|
61
|
+
For every preset, ask:
|
|
62
|
+
|
|
63
|
+
- Where does the eye land first, and is that the right place for the task?
|
|
64
|
+
- What emotion does the visual language add: confidence, urgency, playfulness, calm, pressure, or confusion?
|
|
65
|
+
- Does the density suit the user's likely time pressure and expertise?
|
|
66
|
+
- Are loading, empty, error, success, and destructive moments handled with appropriate care?
|
|
67
|
+
- Does switching presets preserve confidence, or make the product appear to change behavior?
|
|
68
|
+
|
|
69
|
+
Tie every emotional judgment to visible evidence. Do not substitute taste words for observations.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: raft-ui-guide
|
|
3
|
+
description: "Build with raft-ui, the React implementation of the Raft Design System: where the guidelines and each component's API are, the API facts that differ from other libraries, and how to check props. Use when choosing, composing or styling raft-ui components."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# raft-ui
|
|
7
|
+
|
|
8
|
+
The package is `@botiverse/raft-ui`. Plain HTML can use `foundation.css` directly; the components are React, built on **Base UI** (`@base-ui/react`), **Tailwind CSS v4** and **tailwind-variants**.
|
|
9
|
+
|
|
10
|
+
The design guidance (which component to use, how components combine into screens, what each color and size means) lives in the Raft Design System docs, not in this skill. Every page is Markdown:
|
|
11
|
+
|
|
12
|
+
- **Index:** https://raft-design.botiverse.build/llms.txt lists every page with a one-line summary.
|
|
13
|
+
- **Components:** https://raft-design.botiverse.build/components.json lists every component with its status, other names and doc URLs. Each component page, `https://raft-design.botiverse.build/components/<component>.md`, has when to use it, its parts, rules and an API generated from the code.
|
|
14
|
+
- **Choosing a component:** https://raft-design.botiverse.build/components/overview.md#how-to-choose-a-component.
|
|
15
|
+
|
|
16
|
+
This skill keeps what is specific to the code: the [adoption](./rules/adoption.md) order, [looking up](./rules/lookup.md) props and tokens, and the [technical overview](./rules/technical-overview.md) (package contents, stylesheets, providers). Do not register or install skills in a consumer project unless requested.
|
|
17
|
+
|
|
18
|
+
## Working sequence
|
|
19
|
+
|
|
20
|
+
1. Find the component in `components.json` or on the choosing page; read only the pages the task needs.
|
|
21
|
+
2. Verify every prop, part, variant and token you use with [rules/lookup.md](./rules/lookup.md). The page's API section and `node_modules/@botiverse/raft-ui/dist/index.d.mts` agree; the declarations win for the installed version.
|
|
22
|
+
3. Implement the smallest composition that keeps native semantics and uses raft-ui where its behavior or look is needed.
|
|
23
|
+
4. Apply the review checklist below after implementation.
|
|
24
|
+
|
|
25
|
+
When this skill is loaded through TanStack Intent, run `intent load @botiverse/raft-ui#raft-ui-guide --path` before opening a linked rule file, then resolve the link relative to the returned `SKILL.md` directory.
|
|
26
|
+
|
|
27
|
+
## Override your priors first
|
|
28
|
+
|
|
29
|
+
raft-ui is not shadcn/ui, not Radix, not MUI. These defaults are wrong here:
|
|
30
|
+
|
|
31
|
+
| Your instinct | Reality in raft-ui |
|
|
32
|
+
| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
|
|
33
|
+
| `<Button variant="destructive">` | `variant="danger"`, and only on the confirm button of an `AlertDialog`. See the Button page for every variant |
|
|
34
|
+
| `<Button size="icon">` | `size="icon-md"` or `size="icon-lg"` |
|
|
35
|
+
| `className="text-gray-500 bg-slate-50"` | Don't use Tailwind's default palette. Use the semantic tokens: `text-foreground-muted`, `bg-fill-muted` |
|
|
36
|
+
| Flat props: `<Dialog title="x" description="y">` | Compound parts: `<Dialog><DialogContent><DialogHeader><DialogTitle>…`; `DialogContent` portals itself |
|
|
37
|
+
| Radix API (`asChild`) | Base UI API: the `render` prop |
|
|
38
|
+
| Add a `kind`/`state`/`emphasis` prop for a structural difference | Use the dedicated part or component instead |
|
|
39
|
+
| `<Button loading>` doesn't exist, roll a spinner | `loading` and `loadingLabel` are real props on `Button` |
|
|
40
|
+
|
|
41
|
+
**Never guess a prop or variant name.** See [rules/lookup.md](./rules/lookup.md).
|
|
42
|
+
|
|
43
|
+
Intent names are **not** consistent across components: negative is `danger` on `Button`, `Badge`, `Status` and `Progress`, `destructive` on `Banner`, and `error` on toast objects and `NotificationCenterItemIcon`. Never carry a variant value from one component to another.
|
|
44
|
+
|
|
45
|
+
## Principles
|
|
46
|
+
|
|
47
|
+
- Composition over configuration. Visible structure lives in `children` and named parts, never in a prop that switches layouts.
|
|
48
|
+
- Use semantic tokens, never raw color. Each color has one meaning (yellow is "you", pink is the one primary action); see https://raft-design.botiverse.build/foundations/color.md.
|
|
49
|
+
- Base UI owns headless behavior (open state, focus, keyboard, collections). Product state (upload lifecycle, permissions, workflow) belongs in your app, not in a component prop.
|
|
50
|
+
- Raft is the only visual language, in light and dark modes; `ThemeProvider` switches the mode globally. Components adapt themselves.
|
|
51
|
+
|
|
52
|
+
## Common mistakes
|
|
53
|
+
|
|
54
|
+
| Mistake | Fix |
|
|
55
|
+
| -------------------------------------------------- | ----------------------------------------------------------------------- |
|
|
56
|
+
| `asChild` on a trigger or close part | Base UI: `render={<Button … />}` |
|
|
57
|
+
| Actions menu built out of `Select` | `DropdownMenu` |
|
|
58
|
+
| Persistent condition announced with `toast.info()` | `Banner`: toasts expire, conditions don't |
|
|
59
|
+
| Buttons or links inside a `Tooltip` | `Popover`: tooltip content is unreachable |
|
|
60
|
+
| Destructive confirm as a styled `Dialog` | `AlertDialog` with `AlertDialogAction` / `AlertDialogCancel` |
|
|
61
|
+
| Validation copy disconnected from its control | `Field` + `FieldError` |
|
|
62
|
+
| `PanelHeader` where you meant the bare frame | `PanelHeaderRoot`: `PanelHeader` is the composed identity chrome |
|
|
63
|
+
| Re-created raft-ui divider, badge, or type styling | `Separator`, `Badge`, or `Text`; keep native semantics when intentional |
|
|
64
|
+
|
|
65
|
+
## Where the guidance moved
|
|
66
|
+
|
|
67
|
+
The guideline rules this skill used to carry are pages of the design system now. Each file in `rules/` that is not listed above points to them.
|
|
68
|
+
|
|
69
|
+
| For | Read |
|
|
70
|
+
| ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
71
|
+
| Which component, which feedback, which overlay | https://raft-design.botiverse.build/components/overview.md#how-to-choose-a-component |
|
|
72
|
+
| Combining parts, things built from existing parts | https://raft-design.botiverse.build/components/overview.md#built-from-existing-parts |
|
|
73
|
+
| Forms and settings | https://raft-design.botiverse.build/patterns/forms.md |
|
|
74
|
+
| Feedback, loading, empty and error states | https://raft-design.botiverse.build/patterns/feedback.md |
|
|
75
|
+
| Shell, panels, headers, navigation | https://raft-design.botiverse.build/patterns/page-structure.md, https://raft-design.botiverse.build/patterns/navigation.md |
|
|
76
|
+
| Chat, threads, composer, agents | https://raft-design.botiverse.build/patterns/conversation.md, https://raft-design.botiverse.build/patterns/agents.md |
|
|
77
|
+
| Color, type, spacing, shape, elevation | https://raft-design.botiverse.build/foundations/color.md and the other pages under `/foundations/` |
|
|
78
|
+
| One component's parts, rules and API | https://raft-design.botiverse.build/components/<component>.md |
|
|
79
|
+
|
|
80
|
+
## Review checklist
|
|
81
|
+
|
|
82
|
+
When reviewing or editing code that uses raft-ui, check:
|
|
83
|
+
|
|
84
|
+
- [ ] No variant value carried across components; verify against the declarations
|
|
85
|
+
- [ ] Controls with raft-ui label, description, or validation treatment use `Field`; simpler native associations remain explicit and accessible
|
|
86
|
+
- [ ] No Tailwind default palette (`gray-*`, `slate-*`, …), hex, `rgb()`, or `hsl()`: semantic tokens, raw `oklch()` only for one-offs
|
|
87
|
+
- [ ] No `asChild`: element substitution uses `render`
|
|
88
|
+
- [ ] Do not recreate a raft-ui component's visual or behavioral contract with ad hoc markup; native semantic elements remain valid when no library contract is needed
|
|
89
|
+
- [ ] Every `Avatar` with an `AvatarImage` also has an `AvatarFallback`; every blocking overlay has a `Title`
|
|
90
|
+
- [ ] Menu rows are `…Item` parts, not raw `<button>`s; raw buttons drop out of keyboard navigation
|
|
91
|
+
- [ ] Product state (upload, permissions, read/unread) lives in the app; the component renders parts, not a `state` prop
|
|
92
|
+
- [ ] No shadow written as `shadow-[var(--…)]`: named utility or fully literal
|
|
93
|
+
|
|
94
|
+
## Stability
|
|
95
|
+
|
|
96
|
+
`raft-ui` is the stable surface; `@botiverse/raft-ui/wip` is experimental. Import `cn` from `@botiverse/raft-ui/cn`.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: adoption
|
|
3
|
+
description: "Adopting raft-ui in an existing project: inventory before changing, the order that prevents locally-correct/globally-wrong results, and what acceptance means beyond 'it renders'."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Adopting raft-ui in an existing project
|
|
7
|
+
|
|
8
|
+
## Inventory before you change anything
|
|
9
|
+
|
|
10
|
+
Classify every hand-rolled control first. Do not read-and-replace file by file: you
|
|
11
|
+
will convert the easy ones, leave the hard ones, and end with a surface that is
|
|
12
|
+
half one system and half another.
|
|
13
|
+
|
|
14
|
+
| Bucket | Meaning | Action |
|
|
15
|
+
| ------ | ------------------------------------------------------- | ----------------------- |
|
|
16
|
+
| A | raft-ui has an equivalent | Replace |
|
|
17
|
+
| B1 | raft-ui has no such primitive | Out of scope; report it |
|
|
18
|
+
| B2 | raft-ui has it only bound to a domain, no generic layer | Out of scope; report it |
|
|
19
|
+
| C | Must stay hand-rolled (example code, product-specific) | Leave, and say why |
|
|
20
|
+
|
|
21
|
+
Report B1 (new primitive) and B2 (extract a generic layer from existing code, far
|
|
22
|
+
cheaper) separately.
|
|
23
|
+
|
|
24
|
+
Count what you are not converting. A migration that reports only its A bucket
|
|
25
|
+
reads as complete when it is not.
|
|
26
|
+
|
|
27
|
+
## Work in this order
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
tokens -> primitives -> composition -> layout
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Jumping levels is what produces a screen where every control is individually
|
|
34
|
+
correct and the screen is wrong. Finish one level across the whole surface before
|
|
35
|
+
starting the next.
|
|
36
|
+
|
|
37
|
+
## Acceptance is hierarchy, not rendering
|
|
38
|
+
|
|
39
|
+
Checking that a screen renders, fits, and does not overflow does not test the thing
|
|
40
|
+
most likely to be wrong. For each surface, read it and answer:
|
|
41
|
+
|
|
42
|
+
- Which control is the primary action? If more than one answer is defensible, the
|
|
43
|
+
hierarchy is wrong — see the action-group rule in [composition.md](./composition.md).
|
|
44
|
+
- Do controls at the same level look like the same kind of thing?
|
|
45
|
+
- Does any single element carry a treatment nothing else on the page shares?
|
|
46
|
+
- Do status colors track the value they report, or are they one color regardless?
|
|
47
|
+
|
|
48
|
+
Swapping a component is not finishing a design. The variant being individually
|
|
49
|
+
valid says nothing about whether the row it sits in is coherent.
|
|
50
|
+
|
|
51
|
+
## Report what you had to read the source for
|
|
52
|
+
|
|
53
|
+
If you had to open `dist/index.d.mts`, a recipe, or a comment to learn a rule, that
|
|
54
|
+
rule is not documented. Record it and report it with the migration so it can land
|
|
55
|
+
in these guides.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: composition
|
|
3
|
+
description: "Moved to the Raft Design System docs: combining compound parts, overlay containers, business actions and wrappers."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Composition
|
|
7
|
+
|
|
8
|
+
This guidance is part of the Raft Design System docs now, which are its single source. Each page is Markdown; read only the ones the task needs.
|
|
9
|
+
|
|
10
|
+
- Built from existing parts: https://raft-design.botiverse.build/components/overview.md#built-from-existing-parts
|
|
11
|
+
- Choosing a component: https://raft-design.botiverse.build/components/overview.md#how-to-choose-a-component
|
|
12
|
+
- The component's own page, for its parts: https://raft-design.botiverse.build/components/<component>.md
|
|
13
|
+
|
|
14
|
+
Check every prop, part and token you use against [lookup.md](./lookup.md).
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: conversation
|
|
3
|
+
description: "Moved to the Raft Design System docs: chat, threads, the composer, the sidebar, the activity inbox and workspace search."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Conversation surfaces
|
|
7
|
+
|
|
8
|
+
This guidance is part of the Raft Design System docs now, which are its single source. Each page is Markdown; read only the ones the task needs.
|
|
9
|
+
|
|
10
|
+
- Conversation: https://raft-design.botiverse.build/patterns/conversation.md
|
|
11
|
+
- Agents: https://raft-design.botiverse.build/patterns/agents.md
|
|
12
|
+
- Navigation: https://raft-design.botiverse.build/patterns/navigation.md
|
|
13
|
+
- Raft Chat: https://raft-design.botiverse.build/products/raft-chat.md
|
|
14
|
+
|
|
15
|
+
Check every prop, part and token you use against [lookup.md](./lookup.md).
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: display
|
|
3
|
+
description: "Moved to the Raft Design System docs: typography, code, avatars, files and keyboard hints."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Text and display
|
|
7
|
+
|
|
8
|
+
This guidance is part of the Raft Design System docs now, which are its single source. Each page is Markdown; read only the ones the task needs.
|
|
9
|
+
|
|
10
|
+
- Typography: https://raft-design.botiverse.build/foundations/typography.md
|
|
11
|
+
- Iconography: https://raft-design.botiverse.build/foundations/iconography.md
|
|
12
|
+
- Text, InlineCode, CodeBlock, Avatar, Kbd and the other content components: https://raft-design.botiverse.build/components.json
|
|
13
|
+
|
|
14
|
+
Check every prop, part and token you use against [lookup.md](./lookup.md).
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: feedback
|
|
3
|
+
description: "Moved to the Raft Design System docs: banners, toasts, loading, empty states and badges."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Feedback and status
|
|
7
|
+
|
|
8
|
+
This guidance is part of the Raft Design System docs now, which are its single source. Each page is Markdown; read only the ones the task needs.
|
|
9
|
+
|
|
10
|
+
- Feedback: https://raft-design.botiverse.build/patterns/feedback.md
|
|
11
|
+
- Choosing a component: telling people something, and waiting: https://raft-design.botiverse.build/components/overview.md#telling-people-something
|
|
12
|
+
|
|
13
|
+
Check every prop, part and token you use against [lookup.md](./lookup.md).
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forms
|
|
3
|
+
description: "Moved to the Raft Design System docs: choosing and composing form controls and wiring them with Field."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Form controls
|
|
7
|
+
|
|
8
|
+
This guidance is part of the Raft Design System docs now, which are its single source. Each page is Markdown; read only the ones the task needs.
|
|
9
|
+
|
|
10
|
+
- Forms and settings: https://raft-design.botiverse.build/patterns/forms.md
|
|
11
|
+
- Choosing a component: picking something: https://raft-design.botiverse.build/components/overview.md#picking-something
|
|
12
|
+
|
|
13
|
+
Check every prop, part and token you use against [lookup.md](./lookup.md).
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: layout
|
|
3
|
+
description: "Moved to the Raft Design System docs: the shell, panels, headers, navigation, resizing and task surfaces."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Layout and shell
|
|
7
|
+
|
|
8
|
+
This guidance is part of the Raft Design System docs now, which are its single source. Each page is Markdown; read only the ones the task needs.
|
|
9
|
+
|
|
10
|
+
- Page structure: https://raft-design.botiverse.build/patterns/page-structure.md
|
|
11
|
+
- Navigation: https://raft-design.botiverse.build/patterns/navigation.md
|
|
12
|
+
- Wide and narrow: https://raft-design.botiverse.build/patterns/responsive.md
|
|
13
|
+
- Tasks: https://raft-design.botiverse.build/patterns/tasks.md
|
|
14
|
+
|
|
15
|
+
Check every prop, part and token you use against [lookup.md](./lookup.md).
|