@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/README.md +81 -6
- package/dist/cascivo.css +1 -1
- package/dist/index.d.ts +220 -5
- package/dist/index.js +3170 -2239
- package/package.json +8 -7
- package/readme.body.md +65 -2
package/README.md
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
<!-- generated by scripts/readme/generate.ts — edit readme.body.md, not this file -->
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<div align="center">
|
|
4
|
+
<a href="https://cascivo.com"><img src="https://cascivo.com/favicon.svg" width="72" height="72" alt="cascivo logo"></a>
|
|
5
|
+
<h1>@cascivo/react</h1>
|
|
6
|
+
<p><strong>Prebuilt cascivo design system components — use without copying source</strong></p>
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
[](https://www.npmjs.com/package/@cascivo/react)
|
|
9
|
+
[](https://www.npmjs.com/package/@cascivo/react)
|
|
10
|
+
[](https://github.com/cascivo/cascivo/blob/main/LICENSE)
|
|
11
|
+

|
|
6
12
|
|
|
7
|
-
[cascivo.com](https://cascivo.com) · [Docs](https://docs.cascivo.com) · [Storybook](https://storybook.cascivo.com) · [GitHub](https://github.com/
|
|
13
|
+
[npm](https://www.npmjs.com/package/@cascivo/react) · [cascivo.com](https://cascivo.com) · [Docs](https://docs.cascivo.com) · [Storybook](https://storybook.cascivo.com) · [GitHub](https://github.com/cascivo/cascivo)
|
|
14
|
+
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
---
|
|
8
18
|
|
|
9
19
|
Every cascivo component, prebuilt as a normal installable library — for users
|
|
10
20
|
who just want to **use** the design system without owning the source. If you
|
|
@@ -12,6 +22,36 @@ want to customize component internals, use the copy-paste flow instead
|
|
|
12
22
|
(`npx cascivo add <component>`); both consume the same tokens and themes, and
|
|
13
23
|
can coexist in one project.
|
|
14
24
|
|
|
25
|
+
## Install
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
pnpm add @cascivo/react @cascivo/themes @preact/signals-react
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Peer dependencies** (install them in your app): `react >=18`, `react-dom >=18`,
|
|
32
|
+
and `@preact/signals-react` — cascivo components are signal-driven, so the
|
|
33
|
+
signals runtime is required. `@cascivo/themes` is optional but recommended; it
|
|
34
|
+
supplies the tokens and themes the components read.
|
|
35
|
+
|
|
36
|
+
Charts live in a separate package — add [`@cascivo/charts`](https://github.com/cascivo/cascivo/tree/main/packages/charts)
|
|
37
|
+
for `LineChart`, `AreaChart`, `BarChart`, `Sparkline`, and more.
|
|
38
|
+
|
|
39
|
+
### Framework setup (Next.js App Router)
|
|
40
|
+
|
|
41
|
+
In a Server Component file (e.g. `app/layout.tsx`), import the CSS once:
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
import '@cascivo/react/styles.css'
|
|
45
|
+
import '@cascivo/themes/all'
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Components ship with `'use client'` preserved in the bundle, so they work inside
|
|
49
|
+
RSC without any extra wrapper.
|
|
50
|
+
|
|
51
|
+
> **Note on the styles path:** the import specifier is `@cascivo/react/styles.css`,
|
|
52
|
+
> which the package's export map points at the dist file `cascivo.css`. Always
|
|
53
|
+
> import the `styles.css` specifier — never reference `cascivo.css` directly.
|
|
54
|
+
|
|
15
55
|
## Use
|
|
16
56
|
|
|
17
57
|
```tsx
|
|
@@ -71,17 +111,43 @@ declaration. Token names and aliases are documented in `TOKENS.md`.
|
|
|
71
111
|
All components are client components (`'use client'` is preserved in the
|
|
72
112
|
bundle), so the package works in Next.js App Router projects out of the box.
|
|
73
113
|
|
|
114
|
+
## Guides
|
|
115
|
+
|
|
116
|
+
- [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).
|
|
117
|
+
- [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.
|
|
118
|
+
- [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.
|
|
119
|
+
- [Token reference](https://github.com/cascivo/cascivo/blob/main/docs/TOKENS.md) — every CSS custom property, canonical names, and aliases.
|
|
120
|
+
|
|
74
121
|
## Migrating from shadcn/ui?
|
|
75
122
|
|
|
76
|
-
See [`MIGRATING-FROM-SHADCN.md`](https://github.com/
|
|
123
|
+
See [`MIGRATING-FROM-SHADCN.md`](https://github.com/cascivo/cascivo/blob/main/docs/MIGRATING-FROM-SHADCN.md)
|
|
77
124
|
for the variant/prop mapping (e.g. Button `default/outline` → `primary/secondary`,
|
|
78
125
|
there is no `outline`) and the CSS-setup delta vs Tailwind.
|
|
79
126
|
|
|
127
|
+
## Gotchas — naming collisions
|
|
128
|
+
|
|
129
|
+
A handful of exported component names shadow common DOM, browser, or Next.js
|
|
130
|
+
globals. When you import them, alias the import (or import the cascivo name
|
|
131
|
+
explicitly) to avoid clashing with the platform identifier:
|
|
132
|
+
|
|
133
|
+
| cascivo export | Collides with | Suggested alias |
|
|
134
|
+
| ---------------- | ----------------------------------------- | ---------------------------------------------------------- |
|
|
135
|
+
| `Image` | `next/image`, the DOM `Image` constructor | `import { Image as CascivoImage } from '@cascivo/react'` |
|
|
136
|
+
| `Link` | `next/link` | `import { Link as CascivoLink } from '@cascivo/react'` |
|
|
137
|
+
| `Header` | the `<header>` element / app headers | `import { Header as CascivoHeader } from '@cascivo/react'` |
|
|
138
|
+
| `Search` | various router/search helpers | `import { Search as CascivoSearch } from '@cascivo/react'` |
|
|
139
|
+
| `User`, `Status` | domain models in many apps | alias as needed |
|
|
140
|
+
| `Tag` | exported as the cascivo `Tag` chip | already namespaced — import directly |
|
|
141
|
+
|
|
142
|
+
Editor auto-import will sometimes pick the wrong `Image`/`Link`; if styles or
|
|
143
|
+
routing break after adding one of these, check that the import resolves to
|
|
144
|
+
`@cascivo/react`.
|
|
145
|
+
|
|
80
146
|
<!-- COMPONENT_INDEX:START -->
|
|
81
147
|
|
|
82
148
|
## Component index
|
|
83
149
|
|
|
84
|
-
|
|
150
|
+
165 components, exported from `@cascivo/react`. Full props, examples, and live demos at [docs.cascivo.com](https://docs.cascivo.com).
|
|
85
151
|
|
|
86
152
|
### Inputs
|
|
87
153
|
|
|
@@ -128,6 +194,7 @@ there is no `outline`) and the CSS-setup delta vs Tailwind.
|
|
|
128
194
|
|
|
129
195
|
- **Alert** — Highlights a short, important message inline
|
|
130
196
|
- **Avatar** — Displays a user image with initials fallback
|
|
197
|
+
- **AvatarGroup** — Overlapping stack of avatars with a max cap and an i18n-labelled +N overflow chip
|
|
131
198
|
- **Badge** — Small status label or category indicator
|
|
132
199
|
- **Blockquote** — Quoted passage with optional attribution footer
|
|
133
200
|
- **Card** — Container for grouping related content
|
|
@@ -136,6 +203,7 @@ there is no `outline`) and the CSS-setup delta vs Tailwind.
|
|
|
136
203
|
- **Code** — Inline code span for identifiers, commands, and short snippets
|
|
137
204
|
- **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
|
|
138
205
|
- **Collapsible** — A single disclosure region toggled open and closed by its trigger
|
|
206
|
+
- **Comparison** — Reveals the difference between two layers with a draggable divider
|
|
139
207
|
- **ConsoleApp** — Carbon-parity console shell: ShellHeader + icon-rail SideNav + HeaderPanel notifications/switcher + collapsible aside + main content.
|
|
140
208
|
- **ContainedList** — Labelled list of rows inside a bordered container
|
|
141
209
|
- **DashboardCharts** — Dashboard layout with KPI tiles, line chart, bar chart, and pie chart.
|
|
@@ -144,6 +212,7 @@ there is no `outline`) and the CSS-setup delta vs Tailwind.
|
|
|
144
212
|
- **EmptyDashboard** — Dashboard page showing an empty state with a call-to-action button.
|
|
145
213
|
- **EmptyState** — Placeholder for views that have no data to display
|
|
146
214
|
- **Heading** — Section heading with semantic level decoupled from visual size
|
|
215
|
+
- **Image** — Image with load state, blur-up placeholder, graceful fallback, and optional zoom
|
|
147
216
|
- **Item** — Generic content row primitive with media, content, and action regions
|
|
148
217
|
- **Kbd** — Displays a keyboard key or shortcut
|
|
149
218
|
- **List** — Styled unordered or ordered list with ListItem
|
|
@@ -151,6 +220,8 @@ there is no `outline`) and the CSS-setup delta vs Tailwind.
|
|
|
151
220
|
- **NotificationCenter** — A list of notification alerts with a mark-all-read action.
|
|
152
221
|
- **PageWithBreadcrumb** — A centered content page with a breadcrumb navigation and page header.
|
|
153
222
|
- **Prose** — Wrapper that styles raw descendant HTML — headings, lists, code, quotes, tables
|
|
223
|
+
- **QrCode** — Encodes a URL or short text into a scannable SVG QR code
|
|
224
|
+
- **RelativeTime** — Displays a date as a localized phrase relative to now, auto-updating
|
|
154
225
|
- **Separator** — Visual or semantic divider between content
|
|
155
226
|
- **SettingsFormPage** — Settings page with profile form inside a two-column settings layout.
|
|
156
227
|
- **SidebarApp** — Full app shell with collapsible side navigation and top header.
|
|
@@ -163,6 +234,7 @@ there is no `outline`) and the CSS-setup delta vs Tailwind.
|
|
|
163
234
|
- **Text** — Body text with size, weight, and muted variants
|
|
164
235
|
- **Timeline** — Ordered sequence of events with status markers and a connector line
|
|
165
236
|
- **TreeView** — Hierarchical, expandable tree of nodes with keyboard navigation and selection
|
|
237
|
+
- **User** — Identity composite: an avatar with a name, description, and optional action slot
|
|
166
238
|
- **UsersTablePage** — Full users management page with table, search, and invite action.
|
|
167
239
|
- **VisuallyHidden** — Hides content visually while keeping it available to screen readers
|
|
168
240
|
|
|
@@ -202,6 +274,7 @@ there is no `outline`) and the CSS-setup delta vs Tailwind.
|
|
|
202
274
|
- **Steps** — Visual progress indicator for multi-step flows with horizontal and vertical orientations
|
|
203
275
|
- **Switcher** — App/product switcher list — lives inside HeaderPanel, renders links with active indicator and optional dividers
|
|
204
276
|
- **Tabs** — Switch between related panels of content
|
|
277
|
+
- **Toc** — Table of contents with scroll-spy highlighting of the active section
|
|
205
278
|
|
|
206
279
|
### Layout
|
|
207
280
|
|
|
@@ -272,4 +345,6 @@ pnpm add @cascivo/react
|
|
|
272
345
|
|
|
273
346
|
---
|
|
274
347
|
|
|
275
|
-
[cascivo.com](https://cascivo.com) · [Docs](https://docs.cascivo.com) · [Storybook](https://storybook.cascivo.com) · [GitHub](https://github.com/
|
|
348
|
+
[cascivo.com](https://cascivo.com) · [Docs](https://docs.cascivo.com) · [Storybook](https://storybook.cascivo.com) · [GitHub](https://github.com/cascivo/cascivo) · AI agents: use [`@cascivo/mcp`](https://github.com/cascivo/cascivo/tree/main/packages/mcp) and [`registry.json`](https://github.com/cascivo/cascivo/blob/main/registry.json) · MIT
|
|
349
|
+
|
|
350
|
+
<div align="center"><a href="https://cascivo.com"><img src="https://cascivo.com/favicon.svg" width="28" height="28" alt="cascivo"></a></div>
|