@cascivo/react 0.2.1 → 0.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cascivo/react",
3
- "version": "0.2.1",
3
+ "version": "0.3.1",
4
4
  "private": false,
5
5
  "description": "Prebuilt cascivo design system components — use without copying source",
6
6
  "keywords": [
@@ -13,13 +13,13 @@
13
13
  "signals",
14
14
  "ui"
15
15
  ],
16
- "homepage": "https://github.com/urbanisierung/cascivo/tree/main/packages/react#readme",
17
- "bugs": "https://github.com/urbanisierung/cascivo/issues",
16
+ "homepage": "https://github.com/cascivo/cascivo/tree/main/packages/react#readme",
17
+ "bugs": "https://github.com/cascivo/cascivo/issues",
18
18
  "license": "MIT",
19
19
  "author": "urbanisierung",
20
20
  "repository": {
21
21
  "type": "git",
22
- "url": "git+https://github.com/urbanisierung/cascivo.git",
22
+ "url": "git+https://github.com/cascivo/cascivo.git",
23
23
  "directory": "packages/react"
24
24
  },
25
25
  "files": [
@@ -36,15 +36,16 @@
36
36
  "import": "./dist/index.js",
37
37
  "default": "./dist/index.js"
38
38
  },
39
- "./styles.css": "./dist/cascivo.css"
39
+ "./styles.css": "./dist/cascivo.css",
40
+ "./package.json": "./package.json"
40
41
  },
41
42
  "publishConfig": {
42
43
  "access": "public",
43
44
  "provenance": true
44
45
  },
45
46
  "dependencies": {
46
- "@cascivo/core": "^0.1.1",
47
- "@cascivo/i18n": "^0.1.1"
47
+ "@cascivo/core": "^0.1.3",
48
+ "@cascivo/i18n": "^0.1.3"
48
49
  },
49
50
  "devDependencies": {
50
51
  "@testing-library/jest-dom": "^6.9.1",
package/readme.body.md CHANGED
@@ -4,6 +4,36 @@ want to customize component internals, use the copy-paste flow instead
4
4
  (`npx cascivo add <component>`); both consume the same tokens and themes, and
5
5
  can coexist in one project.
6
6
 
7
+ ## Install
8
+
9
+ ```sh
10
+ pnpm add @cascivo/react @cascivo/themes @preact/signals-react
11
+ ```
12
+
13
+ **Peer dependencies** (install them in your app): `react >=18`, `react-dom >=18`,
14
+ and `@preact/signals-react` — cascivo components are signal-driven, so the
15
+ signals runtime is required. `@cascivo/themes` is optional but recommended; it
16
+ supplies the tokens and themes the components read.
17
+
18
+ Charts live in a separate package — add [`@cascivo/charts`](https://github.com/cascivo/cascivo/tree/main/packages/charts)
19
+ for `LineChart`, `AreaChart`, `BarChart`, `Sparkline`, and more.
20
+
21
+ ### Framework setup (Next.js App Router)
22
+
23
+ In a Server Component file (e.g. `app/layout.tsx`), import the CSS once:
24
+
25
+ ```tsx
26
+ import '@cascivo/react/styles.css'
27
+ import '@cascivo/themes/all'
28
+ ```
29
+
30
+ Components ship with `'use client'` preserved in the bundle, so they work inside
31
+ RSC without any extra wrapper.
32
+
33
+ > **Note on the styles path:** the import specifier is `@cascivo/react/styles.css`,
34
+ > which the package's export map points at the dist file `cascivo.css`. Always
35
+ > import the `styles.css` specifier — never reference `cascivo.css` directly.
36
+
7
37
  ## Use
8
38
 
9
39
  ```tsx
@@ -63,12 +93,38 @@ declaration. Token names and aliases are documented in `TOKENS.md`.
63
93
  All components are client components (`'use client'` is preserved in the
64
94
  bundle), so the package works in Next.js App Router projects out of the box.
65
95
 
96
+ ## Guides
97
+
98
+ - [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).
99
+ - [Using cascivo with Preact](https://github.com/cascivo/cascivo/blob/main/docs/USING-WITH-PREACT.md) — `preact/compat` alias, tsconfig paths, peer deps, signals package. It works — this documents how.
100
+ - [Compatibility & support matrix](https://github.com/cascivo/cascivo/blob/main/docs/COMPATIBILITY.md) — frameworks, browsers, the build-tooling baseline, and which package versions go together.
101
+ - [Token reference](https://github.com/cascivo/cascivo/blob/main/docs/TOKENS.md) — every CSS custom property, canonical names, and aliases.
102
+
66
103
  ## Migrating from shadcn/ui?
67
104
 
68
- See [`MIGRATING-FROM-SHADCN.md`](https://github.com/urbanisierung/cascivo/blob/main/docs/MIGRATING-FROM-SHADCN.md)
105
+ See [`MIGRATING-FROM-SHADCN.md`](https://github.com/cascivo/cascivo/blob/main/docs/MIGRATING-FROM-SHADCN.md)
69
106
  for the variant/prop mapping (e.g. Button `default/outline` → `primary/secondary`,
70
107
  there is no `outline`) and the CSS-setup delta vs Tailwind.
71
108
 
109
+ ## Gotchas — naming collisions
110
+
111
+ A handful of exported component names shadow common DOM, browser, or Next.js
112
+ globals. When you import them, alias the import (or import the cascivo name
113
+ explicitly) to avoid clashing with the platform identifier:
114
+
115
+ | cascivo export | Collides with | Suggested alias |
116
+ | ---------------- | ----------------------------------------- | ---------------------------------------------------------- |
117
+ | `Image` | `next/image`, the DOM `Image` constructor | `import { Image as CascivoImage } from '@cascivo/react'` |
118
+ | `Link` | `next/link` | `import { Link as CascivoLink } from '@cascivo/react'` |
119
+ | `Header` | the `<header>` element / app headers | `import { Header as CascivoHeader } from '@cascivo/react'` |
120
+ | `Search` | various router/search helpers | `import { Search as CascivoSearch } from '@cascivo/react'` |
121
+ | `User`, `Status` | domain models in many apps | alias as needed |
122
+ | `Tag` | exported as the cascivo `Tag` chip | already namespaced — import directly |
123
+
124
+ Editor auto-import will sometimes pick the wrong `Image`/`Link`; if styles or
125
+ routing break after adding one of these, check that the import resolves to
126
+ `@cascivo/react`.
127
+
72
128
  <!-- COMPONENT_INDEX:START -->
73
129
 
74
130
  ## Component index