@openwarelabs/ui 0.5.0 → 0.6.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/README.md +25 -0
- package/package.json +9 -3
package/README.md
CHANGED
|
@@ -69,6 +69,19 @@ import { Button, Field, Input, Toaster, toast } from "@openwarelabs/ui";
|
|
|
69
69
|
|
|
70
70
|
Hooks for your own components: `useControllableState`, `useFloating` (top-layer positioning that flips), `usePresence` (keeps a layer mounted while it animates out), `useDismiss`, `useModalDialog`, `useMenuKeyboard`. Every prop is typed and described, so your editor explains it on hover.
|
|
71
71
|
|
|
72
|
+
## Use with AI
|
|
73
|
+
|
|
74
|
+
The MCP server, `@openwarelabs/ui-mcp`, gives Claude Code, Codex, Cursor and other AI tools the setup, every component's examples and props, every block's code and the tokens, so they build with the real components:
|
|
75
|
+
|
|
76
|
+
```sh
|
|
77
|
+
claude mcp add openware-ui -- npx -y @openwarelabs/ui-mcp # Claude Code
|
|
78
|
+
codex mcp add openware-ui -- npx -y @openwarelabs/ui-mcp # Codex
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Cursor and most other clients take `{ "mcpServers": { "openware-ui": { "command": "npx", "args": ["-y", "@openwarelabs/ui-mcp"] } } }`. [mcp/README.md](mcp/README.md) has every tool and client.
|
|
82
|
+
|
|
83
|
+
In the docs, every component and block has a **Copy for AI** button: a prompt with its whole reference (examples and props, or a block's two files) to paste into any AI tool. The built docs also have `llms.txt`, `llms-full.txt` and a Markdown copy of every page under `ai/`. `npm run mcp:build` rebuilds the server from the docs.
|
|
84
|
+
|
|
72
85
|
## Tokens
|
|
73
86
|
|
|
74
87
|
Every colour, space, radius, shadow and weight is a CSS variable named `--ow-…` (`var(--ow-surface)`, `var(--ow-radius-container)`), and every text style is a class (`ow-type-section-title`, `ow-type-lead`). `tokens/tokens.json` is the single source; `npm run tokens` regenerates the CSS and `npm run contrast` checks every text and focus pair in both themes.
|
|
@@ -91,6 +104,18 @@ The docs' header has a colour picker that does this live, and the Theming page s
|
|
|
91
104
|
|
|
92
105
|
**No bundler?** `dist/openware-ui.iife.js` sets `window.OpenwareUI`, reading React from `window.React`. A CDN serves it straight from npm: `https://cdn.jsdelivr.net/npm/@openwarelabs/ui/dist/openware-ui.iife.js`, with `dist/styles.css` beside it.
|
|
93
106
|
|
|
107
|
+
## Releasing
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
npm run release # works out the version, checks, tags and pushes
|
|
111
|
+
npm run release -- --dry-run # shows the version and the notes, changes nothing
|
|
112
|
+
npm run release -- minor # forces patch, minor, major or an exact version
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
The version comes from the commit subjects since the last release, written as [Conventional Commits](https://www.conventionalcommits.org): `feat:` makes a minor release, `fix:` and `perf:` a patch, and `feat!:` or a `BREAKING CHANGE:` line a major one (a minor one before 1.0). `chore:`, `docs:`, `refactor:`, `test:`, `ci:`, `build:` and `style:` don't release on their own. The command checks that `main` is clean and up to date, runs every check and build, bumps both packages, writes `CHANGELOG.md`, commits, tags `vX.Y.Z` and pushes.
|
|
116
|
+
|
|
117
|
+
The tag starts `.github/workflows/release.yml`, which runs the checks again, publishes `@openwarelabs/ui` and `@openwarelabs/ui-mcp` to npm with trusted publishing (no token, with provenance), and makes the GitHub release from the changelog. CI checks every pull request's commit subjects against the convention; `npm run commits:check` does the same locally.
|
|
118
|
+
|
|
94
119
|
## Rules worth keeping
|
|
95
120
|
|
|
96
121
|
- One primary button per view. Everything else is secondary or ghost.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openwarelabs/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Openware UI: React components and design tokens — midnight and brass, tactile buttons and Inter, in light and dark.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Alexander Silver",
|
|
@@ -49,7 +49,11 @@
|
|
|
49
49
|
"contrast": "node scripts/check-contrast.mjs",
|
|
50
50
|
"blocks:check": "node scripts/check-blocks.mjs",
|
|
51
51
|
"prepare": "npm run build",
|
|
52
|
-
"prepublishOnly": "npm run typecheck"
|
|
52
|
+
"prepublishOnly": "npm run typecheck",
|
|
53
|
+
"mcp:build": "node scripts/build-mcp.mjs && tsc -p mcp/tsconfig.json",
|
|
54
|
+
"mcp:inspect": "npx -y @modelcontextprotocol/inspector node mcp/dist/server.mjs",
|
|
55
|
+
"release": "node scripts/release.mjs",
|
|
56
|
+
"commits:check": "node scripts/check-commits.mjs"
|
|
53
57
|
},
|
|
54
58
|
"peerDependencies": {
|
|
55
59
|
"react": ">=18",
|
|
@@ -62,6 +66,7 @@
|
|
|
62
66
|
"sonner": "^2.0.8"
|
|
63
67
|
},
|
|
64
68
|
"devDependencies": {
|
|
69
|
+
"@modelcontextprotocol/sdk": "^1.32.1",
|
|
65
70
|
"@types/react": "^18.3.12",
|
|
66
71
|
"@types/react-dom": "^18.3.1",
|
|
67
72
|
"culori": "^4.0.1",
|
|
@@ -70,7 +75,8 @@
|
|
|
70
75
|
"react": "^18.3.1",
|
|
71
76
|
"react-dom": "^18.3.1",
|
|
72
77
|
"shiki": "^4.4.3",
|
|
73
|
-
"typescript": "^5.6.3"
|
|
78
|
+
"typescript": "^5.6.3",
|
|
79
|
+
"zod": "^4.6.7"
|
|
74
80
|
},
|
|
75
81
|
"repository": {
|
|
76
82
|
"type": "git",
|