@botiverse/raft-ui 0.0.0-stage → 0.7.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/CHANGELOG.md +561 -0
- package/LICENSE +21 -0
- package/README.md +103 -2
- package/codemods/package-name.mjs +166 -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 +391 -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
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lookup
|
|
3
|
+
description: "Where to find props, variant values, and tokens for the installed raft-ui version — declarations, stylesheet, and monorepo source. Read before guessing any name."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Looking things up
|
|
7
|
+
|
|
8
|
+
## Order to try
|
|
9
|
+
|
|
10
|
+
1. **Editor types** — if you are editing TypeScript in a typed project, hover or autocomplete on the component. Fastest and always matches the installed version.
|
|
11
|
+
The component's docs page, `https://raft-design.botiverse.build/components/<component>.md`, has the same props in its API section, generated from the latest release.
|
|
12
|
+
2. **The bundled declarations** — `node_modules/@botiverse/raft-ui/dist/index.d.mts`. Authoritative for the version actually installed.
|
|
13
|
+
3. **The token stylesheet** — `node_modules/@botiverse/raft-ui/dist/foundation.css` for colors, shadows, and the light and dark scopes; `styles.css` for Tailwind mappings.
|
|
14
|
+
4. **The recipe source** — only available when working inside the raft-ui monorepo, see below.
|
|
15
|
+
|
|
16
|
+
## What ships in the package
|
|
17
|
+
|
|
18
|
+
The published package contains **no `src/`**. Do not look for `.tsx` files in a consumer's `node_modules`.
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
node_modules/@botiverse/raft-ui/
|
|
22
|
+
├── CHANGELOG.md
|
|
23
|
+
├── package.json
|
|
24
|
+
├── README.md
|
|
25
|
+
├── dist/
|
|
26
|
+
│ ├── index.d.mts every stable component, part, and prop type
|
|
27
|
+
│ ├── index.mjs stable runtime
|
|
28
|
+
│ ├── cn.d.mts the cn helper
|
|
29
|
+
│ ├── cn.mjs
|
|
30
|
+
│ ├── wip.d.mts unstable surface
|
|
31
|
+
│ ├── wip.mjs
|
|
32
|
+
│ ├── foundation.css native CSS token contract
|
|
33
|
+
│ ├── styles.css Tailwind mappings
|
|
34
|
+
│ └── fonts.css
|
|
35
|
+
└── skills/ bundled raft-ui agent skills
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Finding a prop type
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
rg -n -A6 "^type ButtonProps =" node_modules/@botiverse/raft-ui/dist/index.d.mts
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Adapt the pattern to how the declarations actually read. The last line of `index.d.mts` is one `export { … }` statement that lists the whole stable surface:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
tail -n 1 node_modules/@botiverse/raft-ui/dist/index.d.mts | tr ',' '\n'
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
If a name is absent from `index.d.mts`, treat it as unavailable on the stable surface. Check `wip.d.mts` only when the user explicitly asks to consider unstable APIs.
|
|
51
|
+
|
|
52
|
+
## Finding a variant's allowed values
|
|
53
|
+
|
|
54
|
+
Variant unions come through `VariantProps<typeof <recipe>>`. Read the variant keys in the declared `TVReturnType` above the component props; the bundled declarations preserve those keys.
|
|
55
|
+
|
|
56
|
+
Do not infer a variant value from another component — the names are not consistent. See the note on intent names in [SKILL.md](../SKILL.md#override-your-priors-first).
|
|
57
|
+
|
|
58
|
+
## Finding a token
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
rg -o -- "--color-[a-z0-9-]+" node_modules/@botiverse/raft-ui/dist/styles.css | sort -u
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Use this before writing any color class. If a token is not in that list, it does not exist. What each token is for is on https://raft-design.botiverse.build/foundations/color.md.
|
|
65
|
+
|
|
66
|
+
## Inside the raft-ui monorepo
|
|
67
|
+
|
|
68
|
+
When `packages/ui/src/` is present you are working on the library itself, not consuming it. There the `tv()` recipe is the source of truth:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
packages/ui/src/components/<component>/<component>.recipe.ts (or <component>.tsx when there is no recipe file)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Read the `variants` block for the exact option names and the `compoundVariants` block for behavior that depends on a combination of variants. The docs compositions under `apps/doc/src/modules/<component>/compositions/` show canonical usage.
|
|
75
|
+
|
|
76
|
+
## When the answer is not there
|
|
77
|
+
|
|
78
|
+
Say so and ask, or read the declarations again. Do not invent a prop name that "should" exist because another library has it. A guessed prop is silently dropped onto the DOM or ignored, and the bug surfaces much later as a styling problem.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: overlays
|
|
3
|
+
description: "Moved to the Raft Design System docs: dialogs, drawers, popovers, menus and tooltips."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Overlays
|
|
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
|
+
- Choosing a component: overlays: https://raft-design.botiverse.build/patterns/choosing-components.md#overlays
|
|
11
|
+
- Elevation: which things float, and how popups are positioned: https://raft-design.botiverse.build/foundations/elevation.md
|
|
12
|
+
|
|
13
|
+
Check every prop, part and token you use against [lookup.md](./lookup.md).
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: overview
|
|
3
|
+
description: "What raft-ui is and where to start."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Overview
|
|
7
|
+
|
|
8
|
+
raft-ui is the React implementation of the Raft Design System, the design system used to build Raft. The `raft-ui` package includes CSS foundations, composable React components, and light and dark modes.
|
|
9
|
+
|
|
10
|
+
## Start with your agent
|
|
11
|
+
|
|
12
|
+
Copy this prompt and add your task:
|
|
13
|
+
|
|
14
|
+
```text
|
|
15
|
+
Use raft-ui, the React implementation of the Raft Design System, for this project. Use its shared tokens and components where they fit the project. Plain HTML can use foundation.css without React or Tailwind.
|
|
16
|
+
|
|
17
|
+
Read https://raft-design.botiverse.build/llms.txt and the pages relevant to the task; every page is Markdown. https://raft-design.botiverse.build/components.json lists every component. Match the existing project setup. For version-specific APIs, use node_modules/@botiverse/raft-ui/dist/index.d.mts.
|
|
18
|
+
|
|
19
|
+
Skills are optional. Only install them when requested.
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Rules in this skill
|
|
23
|
+
|
|
24
|
+
| Task | Read |
|
|
25
|
+
| --------------------------------------- | --------------------------------------------- |
|
|
26
|
+
| Adopting raft-ui in an existing project | [Adoption](./adoption.md) |
|
|
27
|
+
| Package contents, styles and providers | [Technical overview](./technical-overview.md) |
|
|
28
|
+
| Exact component APIs and tokens | [API lookup](./lookup.md) |
|
|
29
|
+
|
|
30
|
+
Everything else (which component, how to compose, styling) is in the design system docs; see [SKILL.md](../SKILL.md#where-the-guidance-moved).
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: styling
|
|
3
|
+
description: "Moved to the Raft Design System docs: tokens, classes and recipes."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Styling
|
|
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
|
+
- Color: https://raft-design.botiverse.build/foundations/color.md
|
|
11
|
+
- Typography: https://raft-design.botiverse.build/foundations/typography.md
|
|
12
|
+
- Spacing and sizing: https://raft-design.botiverse.build/foundations/spacing.md
|
|
13
|
+
- Shape: https://raft-design.botiverse.build/foundations/shape.md
|
|
14
|
+
- Elevation: https://raft-design.botiverse.build/foundations/elevation.md
|
|
15
|
+
- States: https://raft-design.botiverse.build/foundations/states.md
|
|
16
|
+
|
|
17
|
+
Check every prop, part and token you use against [lookup.md](./lookup.md).
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: technical-overview
|
|
3
|
+
description: "raft-ui's technical foundations, package contents, and integration contracts."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Technical overview
|
|
7
|
+
|
|
8
|
+
## Foundations
|
|
9
|
+
|
|
10
|
+
`raft-ui` provides shared CSS foundations and a React 19 component library built on Base UI, Tailwind CSS v4, and tailwind-variants; the foundation also works with plain HTML and CSS. It has one visual language, Raft, with light, dark, and system modes.
|
|
11
|
+
|
|
12
|
+
## Package contents
|
|
13
|
+
|
|
14
|
+
| Entry | Contents |
|
|
15
|
+
| ----------------------------------- | --------------------------------------- |
|
|
16
|
+
| `raft-ui` | Stable components, providers, and hooks |
|
|
17
|
+
| `@botiverse/raft-ui/cn` | Class merger |
|
|
18
|
+
| `@botiverse/raft-ui/wip` | Experimental exports |
|
|
19
|
+
| `@botiverse/raft-ui/foundation.css` | Native CSS theme variables |
|
|
20
|
+
| `@botiverse/raft-ui/styles.css` | Tailwind integration |
|
|
21
|
+
| `@botiverse/raft-ui/fonts.css` | Optional web fonts |
|
|
22
|
+
|
|
23
|
+
Component declarations live in `dist/index.d.mts` (see [API lookup](./lookup.md)). Version-matched Markdown guides and optional `raft-ui-guide` / `raft-ui-critique` skills ship in `skills/`.
|
|
24
|
+
|
|
25
|
+
## Plain HTML
|
|
26
|
+
|
|
27
|
+
Link or inline `dist/foundation.css`; no build is required. Optional `fonts.css` supplies web fonts.
|
|
28
|
+
|
|
29
|
+
```html
|
|
30
|
+
<link rel="stylesheet" href="./foundation.css" />
|
|
31
|
+
<style>
|
|
32
|
+
body {
|
|
33
|
+
background: var(--layer-canvas);
|
|
34
|
+
color: var(--foreground);
|
|
35
|
+
}
|
|
36
|
+
article {
|
|
37
|
+
border: 2px solid var(--line-seam);
|
|
38
|
+
}
|
|
39
|
+
</style>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`.light` / `.dark` set the mode; otherwise the document follows the system. The foundation defines variables, not component markup or interactions.
|
|
43
|
+
|
|
44
|
+
## React stylesheet contract
|
|
45
|
+
|
|
46
|
+
```css
|
|
47
|
+
@import "tailwindcss";
|
|
48
|
+
@import "@botiverse/raft-ui/styles.css";
|
|
49
|
+
@source "../node_modules/@botiverse/raft-ui/dist/**/*.{js,mjs}";
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
`@source` is relative to this CSS file and must resolve to the installed package for Tailwind to generate its utilities.
|
|
53
|
+
|
|
54
|
+
Import optional fonts from the app entry, not inside global CSS (`fonts.css` contains a web-font `@import`):
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
import "@botiverse/raft-ui/fonts.css";
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Custom fonts use `--heading-font`, `--sans-font`, and `--mono-font`.
|
|
61
|
+
|
|
62
|
+
## Providers
|
|
63
|
+
|
|
64
|
+
| Provider | Responsibility |
|
|
65
|
+
| ----------------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
66
|
+
| `ThemeProvider` | Color mode, persistence, and document mode synchronization |
|
|
67
|
+
| `TooltipProvider` | Shared tooltip behavior when using Tooltip |
|
|
68
|
+
| `ToastProvider` | Toast manager when using the toast API; see the [Toast](https://raft-design.botiverse.build/components/toast.md) page |
|
|
69
|
+
|
|
70
|
+
`ThemeProvider` defaults to light mode. `mode` / `defaultMode` select `light`, `dark`, or `system`; `onModeChange` reports changes. `storageKey` persists an uncontrolled mode.
|
|
71
|
+
|
|
72
|
+
`useTheme()` exposes `mode`, `resolvedMode` (`light` or `dark`, with `system` resolved), and `setMode`.
|
|
73
|
+
|
|
74
|
+
## Mode and portal boundaries
|
|
75
|
+
|
|
76
|
+
- `ThemeProvider` synchronizes `document.documentElement` by default. Nested scopes need `syncDom={false}` and the matching `light`/`dark` class on their root.
|
|
77
|
+
- Base UI overlays portal to `document.body`. An app root with `isolation: isolate` keeps its stacking contexts below those surfaces. Embedded previews can use `portalProps.container` (toasts: `ToastProvider portalContainer`) to keep overlays inside their scope.
|
|
78
|
+
- SSR apps with persisted mode need to restore it before first paint to avoid a theme flash.
|
|
79
|
+
|
|
80
|
+
What floats and how popups are positioned is in [Elevation](https://raft-design.botiverse.build/foundations/elevation.md); which overlay to use is in [Choosing a component](https://raft-design.botiverse.build/patterns/choosing-components.md#overlays).
|