@cascivo/react 0.6.2 → 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.
@@ -1,17 +1,18 @@
1
1
  "use client";
2
2
 
3
- import { useSignal as e, useSignalEffect as t } from "@cascivo/core";
3
+ import { useSignal as e, useSignalEffect as t, useSignals as n } from "@cascivo/core";
4
4
  //#region ../components/src/toc/use-toc-from-region.ts
5
- function n(n, r = {}) {
6
- let i = r.selector ?? "h2, h3, h4", a = e([]);
5
+ function r(r, i = {}) {
6
+ n();
7
+ let a = i.selector ?? "h2, h3, h4", o = e([]);
7
8
  return t(() => {
8
- let e = n.current;
9
- e && (a.value = Array.from(e.querySelectorAll(i)).filter((e) => e.id !== "").map((e) => ({
9
+ let e = r.current;
10
+ e && (o.value = Array.from(e.querySelectorAll(a)).filter((e) => e.id !== "").map((e) => ({
10
11
  id: e.id,
11
12
  label: e.textContent?.trim() ?? "",
12
13
  level: Number(e.tagName.slice(1)) || 2
13
14
  })));
14
- }), a;
15
+ }), o;
15
16
  }
16
17
  //#endregion
17
- export { n as useTocFromRegion };
18
+ export { r as useTocFromRegion };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cascivo/react",
3
- "version": "0.6.2",
3
+ "version": "0.7.0",
4
4
  "private": false,
5
5
  "description": "Prebuilt cascivo design system components — use without copying source",
6
6
  "keywords": [
@@ -44,8 +44,8 @@
44
44
  "provenance": true
45
45
  },
46
46
  "dependencies": {
47
- "@cascivo/core": "^0.3.1",
48
- "@cascivo/i18n": "^0.2.6"
47
+ "@cascivo/core": "^0.4.0",
48
+ "@cascivo/i18n": "^0.2.7"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@testing-library/jest-dom": "^6.9.1",
package/readme.body.md CHANGED
@@ -35,9 +35,18 @@ Components ship with `'use client'` preserved in the bundle, so they work inside
35
35
  RSC without any extra wrapper.
36
36
 
37
37
  > **No bundler? (CDN, import maps, plain `<link>`)** Import the aggregate sheet
38
- > `@cascivo/react/styles.css` — it contains every component's CSS in one file.
39
- > With a bundler you don't need it; import it only if you prefer one explicit
40
- > stylesheet over per-component tree-shaking.
38
+ > `@cascivo/react/styles.css` — every component's CSS in one file (~273 KB /
39
+ > ~37 KB gzip, not tree-shaken). With a bundler (CSR) you don't need it; import it
40
+ > only if you prefer one explicit stylesheet over per-component tree-shaking, or
41
+ > for Vite SSR (below), where it is required.
42
+
43
+ > **Vite SSR / TanStack Start / Remix / workerd?** Those per-component `.css`
44
+ > imports need a bundler to resolve them; a bare server-side ESM loader throws
45
+ > `Unknown file extension ".css"`. Add `ssr: { noExternal: [/^@cascivo\//] }` (or
46
+ > the `cascivoSsr()` plugin from `@cascivo/vite-plugin`) and import
47
+ > `@cascivo/react/styles.css` once in your root entry. Full recipe:
48
+ > [USING-WITH-VITE-SSR.md](https://github.com/cascivo/cascivo/blob/main/docs/USING-WITH-VITE-SSR.md).
49
+ > Next.js App Router needs none of this.
41
50
 
42
51
  ## Use
43
52
 
@@ -98,6 +107,48 @@ aliases are documented in
98
107
  All components are client components (`'use client'` is preserved in the
99
108
  bundle), so the package works in Next.js App Router projects out of the box.
100
109
 
110
+ ## Using with AI tools (v0, Cursor, Claude Code, Gemini)
111
+
112
+ cascivo is AI-first, but a model can only build with it if the knowledge reaches
113
+ the tool. cascivo has no training-data footprint yet, so **don't rely on a tool
114
+ fetching cascivo.com** — that channel is the least reliable one. Use the channels
115
+ that travel with the package instead:
116
+
117
+ - **One file, one fetch — paste or link this into any chat/agent:**
118
+ [`https://cascivo.com/llms-full.txt`](https://cascivo.com/llms-full.txt). It is
119
+ the entire library — setup, the signals/CSS-layer rules, and every component's
120
+ props/examples/a11y — inlined, so a single successful fetch is enough. The
121
+ shorter index is [`llms.txt`](https://cascivo.com/llms.txt).
122
+ - **v0 / shadcn CLI** — components install straight from the
123
+ [shadcn-compatible registry](https://cascivo.com/r/shadcn/registry.json):
124
+
125
+ ```sh
126
+ npx shadcn@latest add https://cascivo.com/r/shadcn/button.json
127
+ ```
128
+
129
+ Each item inlines its own source and points its dependencies at absolute
130
+ `https://cascivo.com/r/shadcn/<name>.json` URLs, so the CLI resolves them
131
+ transitively. Register the whole namespace in `components.json` to use short
132
+ names (`npx shadcn add @cascivo/button`):
133
+
134
+ ```json
135
+ { "registries": { "@cascivo": "https://cascivo.com/r/shadcn/{name}.json" } }
136
+ ```
137
+
138
+ - **MCP-capable agents** (Claude Code, Cursor, Gemini CLI, Windsurf) — point the
139
+ client at the [`@cascivo/mcp`](https://www.npmjs.com/package/@cascivo/mcp)
140
+ server so it can query components with no web fetch at all:
141
+
142
+ ```json
143
+ { "mcpServers": { "cascivo": { "command": "npx", "args": ["-y", "@cascivo/mcp"] } } }
144
+ ```
145
+
146
+ **One rule to give the model:** cascivo is signal-driven — use `useSignal` /
147
+ `useComputed` / `useSignalEffect` from `@cascivo/core`, never `useState` /
148
+ `useEffect`, and in any app without the Babel signals transform a component that
149
+ reads `signal.value` in render must call `useSignals()` first or it won't
150
+ re-render. `llms-full.txt` carries the full contract.
151
+
101
152
  ## Guides
102
153
 
103
154
  - [Theming & branding](https://github.com/cascivo/cascivo/blob/main/docs/THEMING.md) — match a brand by overriding tokens (layer cascade, the `data-theme` specificity footgun, per-role radius/control-height tokens, a starter theme).
@@ -293,7 +344,7 @@ routing break after adding one of these, check that the import resolves to
293
344
  - **DashboardLayout** — Dashboard page layout with stats strip, main content area, and optional aside.
294
345
  - **FeatureGrid** — Feature section — AutoGrid of items with optional title, description, and icon slots. Icons are optional; the grid works text-only. Replace demo content before shipping.
295
346
  - **Flex** — Flex layout primitive for vertical or horizontal stacking with gap control.
296
- - **Grid** — CSS grid layout primitive with responsive column collapsing.
347
+ - **Grid** — CSS grid layout primitive with responsive column collapsing. Establishes its own containment, so responsive `cols` adapt to the grid’s own slot width with no wrapper or container ancestor required.
297
348
  - **Hero** — Page hero section — centered or split layout with eyebrow, title, description, actions and media slots. Replace demo content before shipping.
298
349
  - **Indicator** — Positions an overlay element (badge, dot, count) at a corner of its child
299
350
  - **Join** — Groups adjacent children into a seamless joined element by removing interior borders and radii