@cascivo/react 0.2.0 → 0.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cascivo/react",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
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.0",
47
- "@cascivo/i18n": "^0.1.0"
47
+ "@cascivo/core": "^0.1.2",
48
+ "@cascivo/i18n": "^0.1.2"
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,17 +93,43 @@ 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
75
131
 
76
- 158 components, exported from `@cascivo/react`. Full props, examples, and live demos at [docs.cascivo.com](https://docs.cascivo.com).
132
+ 165 components, exported from `@cascivo/react`. Full props, examples, and live demos at [docs.cascivo.com](https://docs.cascivo.com).
77
133
 
78
134
  ### Inputs
79
135
 
@@ -120,6 +176,7 @@ there is no `outline`) and the CSS-setup delta vs Tailwind.
120
176
 
121
177
  - **Alert** — Highlights a short, important message inline
122
178
  - **Avatar** — Displays a user image with initials fallback
179
+ - **AvatarGroup** — Overlapping stack of avatars with a max cap and an i18n-labelled +N overflow chip
123
180
  - **Badge** — Small status label or category indicator
124
181
  - **Blockquote** — Quoted passage with optional attribution footer
125
182
  - **Card** — Container for grouping related content
@@ -128,6 +185,7 @@ there is no `outline`) and the CSS-setup delta vs Tailwind.
128
185
  - **Code** — Inline code span for identifiers, commands, and short snippets
129
186
  - **CodeSnippet** — Displays code (inline, single-line, or multi-line) with an optional copy button, lightweight built-in syntax highlighting for bash/css/js/ts, and an optional terminal-window look
130
187
  - **Collapsible** — A single disclosure region toggled open and closed by its trigger
188
+ - **Comparison** — Reveals the difference between two layers with a draggable divider
131
189
  - **ConsoleApp** — Carbon-parity console shell: ShellHeader + icon-rail SideNav + HeaderPanel notifications/switcher + collapsible aside + main content.
132
190
  - **ContainedList** — Labelled list of rows inside a bordered container
133
191
  - **DashboardCharts** — Dashboard layout with KPI tiles, line chart, bar chart, and pie chart.
@@ -136,6 +194,7 @@ there is no `outline`) and the CSS-setup delta vs Tailwind.
136
194
  - **EmptyDashboard** — Dashboard page showing an empty state with a call-to-action button.
137
195
  - **EmptyState** — Placeholder for views that have no data to display
138
196
  - **Heading** — Section heading with semantic level decoupled from visual size
197
+ - **Image** — Image with load state, blur-up placeholder, graceful fallback, and optional zoom
139
198
  - **Item** — Generic content row primitive with media, content, and action regions
140
199
  - **Kbd** — Displays a keyboard key or shortcut
141
200
  - **List** — Styled unordered or ordered list with ListItem
@@ -143,6 +202,8 @@ there is no `outline`) and the CSS-setup delta vs Tailwind.
143
202
  - **NotificationCenter** — A list of notification alerts with a mark-all-read action.
144
203
  - **PageWithBreadcrumb** — A centered content page with a breadcrumb navigation and page header.
145
204
  - **Prose** — Wrapper that styles raw descendant HTML — headings, lists, code, quotes, tables
205
+ - **QrCode** — Encodes a URL or short text into a scannable SVG QR code
206
+ - **RelativeTime** — Displays a date as a localized phrase relative to now, auto-updating
146
207
  - **Separator** — Visual or semantic divider between content
147
208
  - **SettingsFormPage** — Settings page with profile form inside a two-column settings layout.
148
209
  - **SidebarApp** — Full app shell with collapsible side navigation and top header.
@@ -155,6 +216,7 @@ there is no `outline`) and the CSS-setup delta vs Tailwind.
155
216
  - **Text** — Body text with size, weight, and muted variants
156
217
  - **Timeline** — Ordered sequence of events with status markers and a connector line
157
218
  - **TreeView** — Hierarchical, expandable tree of nodes with keyboard navigation and selection
219
+ - **User** — Identity composite: an avatar with a name, description, and optional action slot
158
220
  - **UsersTablePage** — Full users management page with table, search, and invite action.
159
221
  - **VisuallyHidden** — Hides content visually while keeping it available to screen readers
160
222
 
@@ -194,6 +256,7 @@ there is no `outline`) and the CSS-setup delta vs Tailwind.
194
256
  - **Steps** — Visual progress indicator for multi-step flows with horizontal and vertical orientations
195
257
  - **Switcher** — App/product switcher list — lives inside HeaderPanel, renders links with active indicator and optional dividers
196
258
  - **Tabs** — Switch between related panels of content
259
+ - **Toc** — Table of contents with scroll-spy highlighting of the active section
197
260
 
198
261
  ### Layout
199
262