@cascivo/react 0.10.1 → 0.11.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/README.md +44 -11
- package/dist/index.d.ts +53 -22
- package/dist/node/react/src/index.js +3 -3
- package/dist/node/react/src/theme.js +37 -24
- package/dist/react/src/index.js +3 -3
- package/dist/react/src/theme.js +37 -24
- package/dist/styles.css +766 -0
- package/package.json +6 -5
- package/readme.body.md +43 -10
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cascivo/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"private": false,
|
|
5
|
-
"description": "Prebuilt cascivo design system components — use without copying source",
|
|
5
|
+
"description": "Prebuilt cascivo design system components — use without copying source. @cascivo/themes installs with it; pair with @cascivo/charts (data-viz) and @cascivo/icons. Docs offline: npx @cascivo/docs",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"cascivo",
|
|
8
8
|
"components",
|
|
@@ -45,8 +45,9 @@
|
|
|
45
45
|
"provenance": true
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@cascivo/
|
|
49
|
-
"@cascivo/
|
|
48
|
+
"@cascivo/i18n": "^0.2.11",
|
|
49
|
+
"@cascivo/core": "^0.5.3",
|
|
50
|
+
"@cascivo/themes": "^0.4.6"
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
53
|
"@testing-library/jest-dom": "^6.9.1",
|
|
@@ -67,7 +68,7 @@
|
|
|
67
68
|
"react-dom": ">=18.0.0"
|
|
68
69
|
},
|
|
69
70
|
"scripts": {
|
|
70
|
-
"build": "vp build && node scripts/flatten-types.mjs && node scripts/check-types-flat.mjs",
|
|
71
|
+
"build": "vp build && node scripts/flatten-types.mjs && node scripts/check-types-flat.mjs && node scripts/check-styles-complete.mjs",
|
|
71
72
|
"check": "tsc --noEmit",
|
|
72
73
|
"test": "vp test"
|
|
73
74
|
}
|
package/readme.body.md
CHANGED
|
@@ -7,16 +7,30 @@ can coexist in one project.
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
|
-
pnpm add @cascivo/react @
|
|
10
|
+
pnpm add @cascivo/react @preact/signals-react
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
**Peer dependencies** (install them in your app): `react >=18`, `react-dom >=18`,
|
|
14
14
|
and `@preact/signals-react` — cascivo components are signal-driven, so the
|
|
15
|
-
signals runtime is required.
|
|
16
|
-
supplies the tokens and themes the components read.
|
|
15
|
+
signals runtime is required.
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
[`@cascivo/themes`](https://github.com/cascivo/cascivo/tree/main/packages/themes)
|
|
18
|
+
is a **dependency** of `@cascivo/react`, so it installs automatically — you don't
|
|
19
|
+
add it yourself. It supplies the tokens and semantic color values the components
|
|
20
|
+
read; **you must import its CSS once** (see below), or components render
|
|
21
|
+
grayscale (`ThemeProvider` warns in dev when that happens).
|
|
22
|
+
|
|
23
|
+
**The wider family** (separate installs, only if you use them):
|
|
24
|
+
|
|
25
|
+
- Charts — [`@cascivo/charts`](https://github.com/cascivo/cascivo/tree/main/packages/charts):
|
|
26
|
+
`LineChart`, `AreaChart`, `BarChart`, `Sparkline`, and 20+ more.
|
|
27
|
+
- Icons — [`@cascivo/icons`](https://github.com/cascivo/cascivo/tree/main/packages/icons):
|
|
28
|
+
~440 tree-shakeable SVG icon components for `SideNav` items, `IconButton`, and
|
|
29
|
+
`Button` icons (sized by the token system) — so you don't hand-roll SVGs.
|
|
30
|
+
|
|
31
|
+
> **Can't reach npmjs.com or cascivo.com?** The complete docs also ship as an npm
|
|
32
|
+
> package: `npx -y @cascivo/docs` prints the index; `npx @cascivo/docs <component>`
|
|
33
|
+
> prints one component's reference — no website needed. See [Using with AI tools](#using-with-ai-tools-v0-cursor-claude-code-gemini).
|
|
20
34
|
|
|
21
35
|
> **Types are the reference.** The shipped `dist/index.d.ts` is a self-contained, flat
|
|
22
36
|
> rollup — every component's `…Props` interface is real, documentation-grade API. Reading
|
|
@@ -40,10 +54,12 @@ Components ship with `'use client'` preserved in the bundle, so they work inside
|
|
|
40
54
|
RSC without any extra wrapper.
|
|
41
55
|
|
|
42
56
|
> **No bundler? (CDN, import maps, plain `<link>`)** Import the aggregate sheet
|
|
43
|
-
> `@cascivo/react/styles.css` — every component's CSS
|
|
44
|
-
> ~
|
|
45
|
-
>
|
|
46
|
-
>
|
|
57
|
+
> `@cascivo/react/styles.css` — every component's CSS **plus the tokens and the
|
|
58
|
+
> light & dark themes** in one file (~305 KB / ~40 KB gzip, not tree-shaken). It is
|
|
59
|
+
> self-contained: this single import gives you a fully-colored app with no separate
|
|
60
|
+
> `@cascivo/themes` import. With a bundler (CSR) you don't need it; import it only if
|
|
61
|
+
> you prefer one explicit stylesheet over per-component tree-shaking, or for Vite SSR
|
|
62
|
+
> (below), where it is required.
|
|
47
63
|
|
|
48
64
|
> **Vite SSR / TanStack Start / Remix / workerd?** The 4-line SSR checklist (full
|
|
49
65
|
> recipe: [USING-WITH-VITE-SSR.md](https://github.com/cascivo/cascivo/blob/main/docs/USING-WITH-VITE-SSR.md)):
|
|
@@ -55,7 +71,10 @@ RSC without any extra wrapper.
|
|
|
55
71
|
> 2. **`@preact/signals-react` 3.x** — on React 19 the 2.x line fails to load. The
|
|
56
72
|
> peer range enforces `>=3`.
|
|
57
73
|
> 3. **Import the CSS once** in your root entry: `@cascivo/react/styles.css` +
|
|
58
|
-
> `@cascivo/themes/all` (+ `@cascivo/charts/styles.css` if you use charts).
|
|
74
|
+
> `@cascivo/themes/all` (+ `@cascivo/charts/styles.css` if you use charts). If you
|
|
75
|
+
> typecheck (`tsc --noEmit`), these bare `.css` imports need ambient types — add
|
|
76
|
+
> `src/vite-env.d.ts` with `/// <reference types="vite/client" />` or
|
|
77
|
+
> `declare module '*.css'`, else TS2307/TS2882.
|
|
59
78
|
> 4. **Theme without a mismatch:** inline `themePreloadScript()` in `<head>` and add
|
|
60
79
|
> `suppressHydrationWarning` to `<html>`, or hard-code `data-theme` for a fixed theme.
|
|
61
80
|
>
|
|
@@ -127,6 +146,20 @@ the tool. cascivo has no training-data footprint yet, so **don't rely on a tool
|
|
|
127
146
|
fetching cascivo.com** — that channel is the least reliable one. Use the channels
|
|
128
147
|
that travel with the package instead:
|
|
129
148
|
|
|
149
|
+
- **Zero web access needed — the whole docs surface as an npm package
|
|
150
|
+
([`@cascivo/docs`](https://www.npmjs.com/package/@cascivo/docs)):**
|
|
151
|
+
|
|
152
|
+
```sh
|
|
153
|
+
npx -y @cascivo/docs # prints llms.txt (the index)
|
|
154
|
+
npx -y @cascivo/docs button # prints one component's full reference
|
|
155
|
+
npx -y @cascivo/docs --full # prints llms-full.txt (the entire library)
|
|
156
|
+
npx -y @cascivo/docs guide theming
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
It reaches an agent through the same npm registry that installed your packages
|
|
160
|
+
— the one channel proven to work when `npmjs.com` and `cascivo.com` are blocked,
|
|
161
|
+
proxied, or offline. No install, no config; `npx` runs it from cache.
|
|
162
|
+
|
|
130
163
|
- **One file, one fetch — paste or link this into any chat/agent:**
|
|
131
164
|
[`https://cascivo.com/llms-full.txt`](https://cascivo.com/llms-full.txt). It is
|
|
132
165
|
the entire library — setup, the signals/CSS-layer rules, and every component's
|