@sakaniui/react 0.8.8 → 0.8.10
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 +8 -2
- package/CHANGELOG.md +64 -0
- package/README.md +36 -9
- package/bin/sakaniui-mcp.mjs +399 -27
- package/dist/icon-index.json +1 -0
- package/dist/lib/ChartTooltip.d.ts +20 -0
- package/dist/lib/LiquidGlass.d.ts +93 -0
- package/dist/lib/SakaniLogo.d.ts +3 -0
- package/dist/lib/chartPalette.d.ts +12 -0
- package/dist/lib/getContrastColor.d.ts +23 -0
- package/dist/lib/iconStrokeWidth.d.ts +13 -0
- package/dist/lib/useChartTokens.d.ts +31 -0
- package/dist/lib/useHoverHighlight.d.ts +17 -0
- package/dist/lib/usePortalThemeClass.d.ts +31 -0
- package/dist/lib/useThemeTick.d.ts +10 -0
- package/dist/manifest.json +542 -193
- package/package.json +6 -5
package/AGENTS.md
CHANGED
|
@@ -16,8 +16,14 @@ import manifest from '@sakaniui/react/manifest.json';
|
|
|
16
16
|
const button = manifest.components.find((c) => c.name === 'Button'); // props[], contract.requiredProps
|
|
17
17
|
```
|
|
18
18
|
Editors can query the same data through the bundled MCP server
|
|
19
|
-
(`npx -y
|
|
20
|
-
`
|
|
19
|
+
(`npx -y @sakaniui/mcp`): `search_components`, `get_component`, `search_icons`,
|
|
20
|
+
`check_code`, `check_usage`, `get_tokens`, `get_guide`, `check_compatibility`, `get_changelog`.
|
|
21
|
+
|
|
22
|
+
**Start from the example, check before you answer.** Every component has `example`: its imports and the
|
|
23
|
+
element with each required prop filled in, type-checked against the release. Start from it instead of
|
|
24
|
+
writing the element from memory. Never guess an icon name: find it with `search_icons` (icons are
|
|
25
|
+
`IconTrash`, `IconSettings`, ... from `@sakaniui/react/icons`, passed as `icon={IconTrash}`, not
|
|
26
|
+
`icon={<IconTrash />}`). If the server is connected, run `check_code` on every snippet you write.
|
|
21
27
|
|
|
22
28
|
**Versions.** Every component has `since`, the first release that contained it. The project may have an
|
|
23
29
|
older `@sakaniui/react` installed than the one the manifest describes: if an entry is marked
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,70 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@sakaniui/react` are documented here.
|
|
4
4
|
|
|
5
|
+
## 0.8.10
|
|
6
|
+
|
|
7
|
+
Readiness release: everything below was found by testing the package the way a new user, an editor
|
|
8
|
+
and an AI agent would, and every fix is now covered by a check that fails the build.
|
|
9
|
+
|
|
10
|
+
**Installing the library**
|
|
11
|
+
- **Fixed: installing `@sakaniui/react` installed Next.js.** The `geist` and `@fontsource-variable/geist`
|
|
12
|
+
font packages were runtime dependencies, though the library never loads them, and `geist` requires
|
|
13
|
+
Next.js as a peer, so every app (Vite included) got Next.js 16. Both are now dev-only; the only runtime
|
|
14
|
+
dependency is `recharts`. Load Geist yourself if you want it (`@fontsource-variable/geist`); otherwise
|
|
15
|
+
the system font is used, as before.
|
|
16
|
+
- **Fixed: missing type definitions.** `dist/lib/` was left out of the generated `.d.ts` files, so
|
|
17
|
+
`LiquidGlass`, `LiquidBackdrop`, `HoverGroup`, `useHoverHighlight`, `useLiquidGlass`, `getContrastColor`
|
|
18
|
+
and `iconStrokeWidth` had no types: `<LiquidBackdrop />` compiled without its required `src`. The build
|
|
19
|
+
now fails if any relative import in a shipped `.d.ts` does not resolve.
|
|
20
|
+
- **Fixed docs: `style.css` is required.** The README and the website's Installation page only imported
|
|
21
|
+
`tokens.css`, which leaves components unstyled. Both now import both stylesheets.
|
|
22
|
+
|
|
23
|
+
**The MCP server**
|
|
24
|
+
- **New package `@sakaniui/mcp`** (about 190 kB, no dependencies): `npx -y @sakaniui/mcp` starts in
|
|
25
|
+
about 2 s on a first run. Through `@sakaniui/react` it took ~30 s and ~675 MB, long enough for an editor
|
|
26
|
+
to give up. The copy in `@sakaniui/react` still works.
|
|
27
|
+
- **`check_code`: no false positives** on 685 real elements across three apps (it reported 77). Aliased
|
|
28
|
+
and default imports, code inside template strings, native attributes and the non-icon exports of
|
|
29
|
+
`@sakaniui/react/icons` are handled; it still catches every deliberate mistake in the test set.
|
|
30
|
+
- **Versions per prop and per value.** Each prop added after its component has its own `since` (for
|
|
31
|
+
example `Switch.variant`, 0.8.4), and values added later are listed in `valuesSince`. `since` now means
|
|
32
|
+
"first release you could import it", taken from the package's public exports at every release (the
|
|
33
|
+
social icons are 0.8.6, not 0.3.0). `check_code`, `check_usage` and `get_component` flag props and
|
|
34
|
+
values the project's installed version does not have.
|
|
35
|
+
- **Invented props are errors.** A prop that is neither the component's own nor an HTML attribute (React's
|
|
36
|
+
own attribute list now ships in `manifest.json` as `nativeAttributes`) fails `check_code` and
|
|
37
|
+
`check_usage`, with the real prop list and a suggestion (`leftIcon` -> "did you mean leadingIcon?").
|
|
38
|
+
Real HTML attributes (`placeholder`, `href`, `name`...) pass silently; `color` gets a note that it does
|
|
39
|
+
not style the component.
|
|
40
|
+
- **Protocol:** negotiates a supported protocol version, answers `resources/list`, `prompts/list` and
|
|
41
|
+
batches, exits when the editor disconnects (flushing replies first), and survives a closed pipe.
|
|
42
|
+
`get_guide` accepts `query`. Tested on Node 18, 20, 22 and 26, with the official MCP SDK client and the
|
|
43
|
+
MCP Inspector, and documented for Windows (`cmd /c npx ...`).
|
|
44
|
+
- Removed an unresolvable `$schema` link from `manifest.json`.
|
|
45
|
+
|
|
46
|
+
## 0.8.9
|
|
47
|
+
|
|
48
|
+
Stops assistants from inventing code. Found by testing the MCP server in Claude Code: it validated a
|
|
49
|
+
snippet correctly, then wrote its own example as `icon={<TrashIcon />}` -- an icon that does not exist,
|
|
50
|
+
passed as an element instead of a component.
|
|
51
|
+
|
|
52
|
+
- **Examples.** Every component and block in `manifest.json` has `example`: the import lines and the
|
|
53
|
+
element with each required prop filled in with a value of the right shape (an array of `BreadcrumbItem`
|
|
54
|
+
gets one real item). Prop types are read from the shipped `.d.ts`, and every example is type-checked
|
|
55
|
+
against the built package; the build fails if one does not compile.
|
|
56
|
+
- **Icon index.** `@sakaniui/react/icon-index.json` lists all 5,184 icons (and their 1,054 filled
|
|
57
|
+
variants) with Tabler's category and search tags. The build fails if it differs from the exports.
|
|
58
|
+
- **MCP: `search_icons`.** Finds real icon names by meaning ("delete" -> `IconTrash`); common UI intents
|
|
59
|
+
rank the conventional icon first.
|
|
60
|
+
- **MCP: `check_code`.** Checks a whole snippet as text (it is never run): imports must exist and come
|
|
61
|
+
from the right entry point, every SakaniUI element needs its required props, values must be allowed,
|
|
62
|
+
and icon props must be real icon components passed as `icon={IconTrash}`. Errors carry line numbers
|
|
63
|
+
and suggestions ("TrashIcon is not exported... Did you mean: IconTrash?").
|
|
64
|
+
- **MCP: `check_usage`** now validates icon props too, and `get_component` points at the example and
|
|
65
|
+
at `search_icons`.
|
|
66
|
+
- Fixed a type error in `KanbanBoardBlock` (drag attributes when dragging is disabled) that was printed
|
|
67
|
+
during every build.
|
|
68
|
+
|
|
5
69
|
## 0.8.8
|
|
6
70
|
|
|
7
71
|
Audit of the agent contract and MCP server (accuracy, security, versioning).
|
package/README.md
CHANGED
|
@@ -43,12 +43,33 @@ accepts Lucide or Tabler React icons. See `THIRD_PARTY_NOTICES.md` for the MIT l
|
|
|
43
43
|
npm install @sakaniui/react
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
Then import the
|
|
46
|
+
Then import the two stylesheets once, at your app's entry point (both are required: `tokens.css` defines
|
|
47
|
+
the design tokens, `style.css` styles the components), and use any component from the package root:
|
|
47
48
|
|
|
48
49
|
```tsx
|
|
49
50
|
import '@sakaniui/react/tokens.css';
|
|
51
|
+
import '@sakaniui/react/style.css';
|
|
52
|
+
|
|
53
|
+
import { Button } from '@sakaniui/react';
|
|
54
|
+
|
|
55
|
+
export function Example() {
|
|
56
|
+
return <Button variant="primary">Get started</Button>;
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Requires React 19. Typography is set in **Geist**; load the font yourself if you want it (otherwise the
|
|
61
|
+
system font is used):
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm install @fontsource-variable/geist
|
|
50
65
|
```
|
|
51
66
|
|
|
67
|
+
```tsx
|
|
68
|
+
import '@fontsource-variable/geist';
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Charts (`AreaChart`, `BarChart`, ...) use `recharts`, which is installed with the package.
|
|
72
|
+
|
|
52
73
|
> **Building with AI?** `AGENTS.md` (shipped in this package) explains *why* components behave as they do and what to do when nothing fits. Index for agents: https://www.sakaniui.com/llms.txt
|
|
53
74
|
|
|
54
75
|
## Quick start (contributing / browsing the source)
|
|
@@ -108,25 +129,31 @@ up instead of guessing prop names.
|
|
|
108
129
|
```json
|
|
109
130
|
{
|
|
110
131
|
"mcpServers": {
|
|
111
|
-
"sakaniui": { "command": "npx", "args": ["-y", "
|
|
132
|
+
"sakaniui": { "command": "npx", "args": ["-y", "@sakaniui/mcp"] }
|
|
112
133
|
}
|
|
113
134
|
}
|
|
114
135
|
```
|
|
115
136
|
|
|
116
|
-
Claude Code: `claude mcp add sakaniui -- npx -y
|
|
137
|
+
Claude Code: `claude mcp add sakaniui -- npx -y @sakaniui/mcp`
|
|
138
|
+
|
|
139
|
+
On Windows, launch `npx` through `cmd /c` (`"command": "cmd", "args": ["/c", "npx", "-y", "@sakaniui/mcp"]`,
|
|
140
|
+
or `claude mcp add sakaniui -- cmd /c npx -y @sakaniui/mcp`). Needs Node.js 18 or later.
|
|
141
|
+
|
|
142
|
+
The server is its own tiny package, [`@sakaniui/mcp`](https://www.npmjs.com/package/@sakaniui/mcp) (about 1 MB, starts in a couple of seconds; it does not install the component library). The copy bundled in `@sakaniui/react` (`npx -y -p @sakaniui/react sakaniui-mcp`) still works but downloads far more.
|
|
117
143
|
|
|
118
|
-
Tools: `search_components`, `get_component
|
|
119
|
-
(
|
|
144
|
+
Tools: `search_components`, `get_component` (with a type-checked `example`), `search_icons`,
|
|
145
|
+
`check_code` (checks a whole snippet: imports, required props, values, icon names), `check_usage`,
|
|
146
|
+
`list_components`, `get_tokens`, `get_guide`, `check_compatibility` and `get_changelog`.
|
|
120
147
|
|
|
121
|
-
- **Read-only.** It reads
|
|
122
|
-
manifest, AGENTS.md, CHANGELOG.md). It writes nothing, runs nothing, opens no network connection and
|
|
148
|
+
- **Read-only.** It reads five fixed files from a `@sakaniui/react` install (package.json, the
|
|
149
|
+
manifest, the icon index, AGENTS.md, CHANGELOG.md). Code given to `check_code` is read as text, never run. It writes nothing, runs nothing, opens no network connection and
|
|
123
150
|
takes no file paths. Every tool is marked read-only.
|
|
124
151
|
- **Matches your version.** It finds the `@sakaniui/react` installed in your project (working directory,
|
|
125
152
|
or `--project <dir>`) and flags components your version does not have yet, with the release notes for
|
|
126
153
|
the versions in between (`get_changelog`).
|
|
127
154
|
- **Accurate by construction.** `npm run build:lib` fails if the manifest disagrees with the real build:
|
|
128
|
-
an export that is not described, a prop that is not declared,
|
|
129
|
-
that looks like a private reference.
|
|
155
|
+
an export that is not described, a prop that is not declared, an example that does not type-check, an
|
|
156
|
+
icon name that does not exist, a token that is not defined, or anything that looks like a private reference.
|
|
130
157
|
|
|
131
158
|
## Glass & liquid glass
|
|
132
159
|
|