@openwarelabs/ui 0.6.0 → 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/README.md +30 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -69,6 +69,23 @@ 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
|
+
## Blocks as components
|
|
73
|
+
|
|
74
|
+
Blocks are becoming components in their own package, `@openwarelabs/blocks`, that take their content as props, so you don't copy their code. The heroes are first, `Hero01` to `Hero06`:
|
|
75
|
+
|
|
76
|
+
```sh
|
|
77
|
+
npm install @openwarelabs/blocks
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
import "@openwarelabs/blocks/styles.css"; // after @openwarelabs/ui/styles.css
|
|
82
|
+
import { Hero01 } from "@openwarelabs/blocks";
|
|
83
|
+
|
|
84
|
+
<Hero01 title="The workspace for shipping software" description="…" primaryAction={{ label: "Start for free", href: "/signup" }} />;
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Each block's page in the docs shows its props under the preview. The source is `blocks/src/<category>/<Name>/` (the component, its `.types.ts` and its `.css`); `npm run blocks:build` builds the package, and `npm run release` publishes it with the library at the same version.
|
|
88
|
+
|
|
72
89
|
## Use with AI
|
|
73
90
|
|
|
74
91
|
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:
|
|
@@ -104,6 +121,18 @@ The docs' header has a colour picker that does this live, and the Theming page s
|
|
|
104
121
|
|
|
105
122
|
**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.
|
|
106
123
|
|
|
124
|
+
## Contributing
|
|
125
|
+
|
|
126
|
+
`main` takes changes only through pull requests, squash-merged, so each one lands as a single commit named after the PR. The PR title follows [Conventional Commits](https://www.conventionalcommits.org) because `npm run release` reads it: `feat: add a date range picker`, `fix(Menu): close on Escape`, `feat!: rename Stack's gap sizes`. Put `BREAKING CHANGE: …` in the PR description for a breaking change.
|
|
127
|
+
|
|
128
|
+
Three checks have to pass to merge:
|
|
129
|
+
|
|
130
|
+
- **Checks**: types, contrast, blocks, the library, the MCP server and the docs.
|
|
131
|
+
- **PR title**: the title follows the convention (`npm run commits:check -- --title "feat: …"` locally).
|
|
132
|
+
- **Cleaner**: [openwarelabs/cleaner](https://github.com/openwarelabs/cleaner) on the `.ts` and `.tsx` files the PR changes. Types go in a `<name>.types.ts` beside the component, and imports from another folder use the aliases instead of `../`: `@/…` for `src/` (in the library and the docs), `@docs/…` for `docs/` (`?highlight` imports too) and `@build/…` in `mcp/`. Files that haven't been touched yet don't follow it; they catch up as they change.
|
|
133
|
+
|
|
134
|
+
`scripts/setup-github.sh` sets this up on GitHub (squash merges only, the PR title as the commit, the ruleset for `main`). Repository admins can bypass the ruleset, which `npm run release` uses to push its version commit and tag.
|
|
135
|
+
|
|
107
136
|
## Releasing
|
|
108
137
|
|
|
109
138
|
```sh
|
|
@@ -114,7 +143,7 @@ npm run release -- minor # forces patch, minor, major or an exact version
|
|
|
114
143
|
|
|
115
144
|
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
145
|
|
|
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.
|
|
146
|
+
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. Pull requests are squash-merged with their title as the commit, so the titles are what it reads.
|
|
118
147
|
|
|
119
148
|
## Rules worth keeping
|
|
120
149
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openwarelabs/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.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",
|
|
@@ -43,9 +43,10 @@
|
|
|
43
43
|
"scripts": {
|
|
44
44
|
"dev": "node scripts/docs.mjs dev",
|
|
45
45
|
"build": "node scripts/build-tokens.mjs && node scripts/build.mjs && tsc -p tsconfig.build.json && node scripts/build-types.mjs",
|
|
46
|
+
"blocks:build": "node scripts/build-blocks.mjs",
|
|
46
47
|
"docs:build": "node scripts/docs.mjs build",
|
|
47
48
|
"tokens": "node scripts/build-tokens.mjs",
|
|
48
|
-
"typecheck": "tsc --noEmit && tsc -p docs/tsconfig.json",
|
|
49
|
+
"typecheck": "tsc --noEmit && tsc -p docs/tsconfig.json && tsc -p blocks/tsconfig.json",
|
|
49
50
|
"contrast": "node scripts/check-contrast.mjs",
|
|
50
51
|
"blocks:check": "node scripts/check-blocks.mjs",
|
|
51
52
|
"prepare": "npm run build",
|
|
@@ -80,7 +81,7 @@
|
|
|
80
81
|
},
|
|
81
82
|
"repository": {
|
|
82
83
|
"type": "git",
|
|
83
|
-
"url": "https://github.com/openwarelabs/ui"
|
|
84
|
+
"url": "git+https://github.com/openwarelabs/ui.git"
|
|
84
85
|
},
|
|
85
86
|
"keywords": [
|
|
86
87
|
"react",
|