@cascivo/react 0.16.1 → 0.17.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 +14 -13
- package/dist/accordion/accordion.js +5 -4
- package/dist/app-shell/app-shell.css +1 -1
- package/dist/app-shell/app-shell.js +28 -26
- package/dist/app-shell/app-shell.module.js +8 -8
- package/dist/breadcrumb/breadcrumb.js +1 -1
- package/dist/button/button.css +1 -1
- package/dist/button/button.js +4 -1
- package/dist/button/button.module.js +4 -1
- package/dist/calendar/calendar.js +67 -63
- package/dist/card/card.css +1 -1
- package/dist/card/card.module.js +8 -8
- package/dist/checkbox/checkbox.css +1 -1
- package/dist/checkbox/checkbox.module.js +4 -4
- package/dist/code-snippet/code-snippet.js +31 -26
- package/dist/combobox/combobox.js +55 -54
- package/dist/data-table/data-table.css +1 -1
- package/dist/data-table/data-table.js +155 -160
- package/dist/data-table/data-table.module.js +29 -29
- package/dist/date-picker/date-picker.js +90 -89
- package/dist/dock/dock.js +1 -1
- package/dist/field/field.css +1 -1
- package/dist/field/field.module.js +3 -3
- package/dist/index.d.ts +157 -10
- package/dist/large-title-header/large-title-header.js +1 -1
- package/dist/layouts/src/grid/grid.css +1 -1
- package/dist/layouts/src/grid/grid.module.js +3 -3
- package/dist/node/accordion/accordion.js +5 -4
- package/dist/node/app-shell/app-shell.js +28 -26
- package/dist/node/app-shell/app-shell.module.js +8 -8
- package/dist/node/breadcrumb/breadcrumb.js +1 -1
- package/dist/node/button/button.js +4 -1
- package/dist/node/button/button.module.js +4 -1
- package/dist/node/calendar/calendar.js +67 -63
- package/dist/node/card/card.module.js +8 -8
- package/dist/node/checkbox/checkbox.module.js +4 -4
- package/dist/node/code-snippet/code-snippet.js +31 -26
- package/dist/node/combobox/combobox.js +55 -54
- package/dist/node/data-table/data-table.js +155 -160
- package/dist/node/data-table/data-table.module.js +29 -29
- package/dist/node/date-picker/date-picker.js +90 -89
- package/dist/node/dock/dock.js +1 -1
- package/dist/node/field/field.module.js +3 -3
- package/dist/node/large-title-header/large-title-header.js +1 -1
- package/dist/node/layouts/src/grid/grid.module.js +3 -3
- package/dist/node/search/search.js +5 -4
- package/dist/node/side-nav/side-nav.js +90 -89
- package/dist/node/swap/swap.js +4 -3
- package/dist/node/switcher/switcher.js +1 -1
- package/dist/node/tabs/tabs.js +5 -4
- package/dist/node/toc/toc.js +5 -4
- package/dist/search/search.js +5 -4
- package/dist/side-nav/side-nav.js +90 -89
- package/dist/styles.css +7 -7
- package/dist/swap/swap.js +4 -3
- package/dist/switcher/switcher.js +1 -1
- package/dist/tabs/tabs.js +5 -4
- package/dist/toc/toc.js +5 -4
- package/dist/types.d.ts +21 -0
- package/dist/types.js +1 -0
- package/package.json +11 -4
- package/readme.body.md +14 -13
package/dist/tabs/tabs.js
CHANGED
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./tabs.module.js";
|
|
4
4
|
import { createContext as t, forwardRef as n, useId as r, useRef as i } from "react";
|
|
5
|
-
import { Slot as a, cn as o,
|
|
5
|
+
import { Slot as a, cn as o, useControllableSignal as s, useSignals as c } from "@cascivo/core";
|
|
6
6
|
import { jsx as l } from "react/jsx-runtime";
|
|
7
7
|
//#region ../components/src/tabs/tabs.tsx
|
|
8
8
|
var u = t(null);
|
|
9
9
|
function d({ defaultValue: t, value: n, onValueChange: i, className: a, children: c }) {
|
|
10
|
-
let d = r(), f = s(
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
let d = r(), [f] = s({
|
|
11
|
+
value: n,
|
|
12
|
+
defaultValue: t ?? ""
|
|
13
|
+
}), p = {
|
|
13
14
|
active: f,
|
|
14
15
|
baseId: d,
|
|
15
16
|
setValue: (e) => {
|
package/dist/toc/toc.js
CHANGED
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./toc.module.js";
|
|
4
4
|
import { useRef as t } from "react";
|
|
5
|
-
import { cn as n,
|
|
5
|
+
import { cn as n, useControllableSignal as r, useSignalEffect as i, useSignals as a } from "@cascivo/core";
|
|
6
6
|
import { builtin as o, t as s } from "@cascivo/i18n";
|
|
7
7
|
import { jsx as c } from "react/jsx-runtime";
|
|
8
8
|
//#region ../components/src/toc/toc.tsx
|
|
9
9
|
function l({ items: l, activeId: u, onActiveChange: d, labels: f, className: p }) {
|
|
10
10
|
a();
|
|
11
|
-
let m = u !== void 0, h = r(
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
let m = u !== void 0, [h] = r({
|
|
12
|
+
value: u,
|
|
13
|
+
defaultValue: l[0]?.id ?? ""
|
|
14
|
+
}), g = t(d);
|
|
14
15
|
return g.current = d, i(() => {
|
|
15
16
|
if (m || typeof document > "u" || typeof IntersectionObserver > "u") return;
|
|
16
17
|
let e = l.map((e) => document.getElementById(e.id)).filter((e) => e !== null);
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The catalog-wide vocabulary types, importable on the prebuilt path.
|
|
3
|
+
*
|
|
4
|
+
* `Status.status` and `Badge.variant` are `ToneInput`; every layout `gap` is a
|
|
5
|
+
* `SpaceStep`. These declarations are the same ones the main entry's props reference, so
|
|
6
|
+
* a value typed here is assignable there.
|
|
7
|
+
*
|
|
8
|
+
* import type { Tone } from '@cascivo/react/types'
|
|
9
|
+
* const TONE: Record<DeployState, Tone> = { ready: 'success', error: 'danger' }
|
|
10
|
+
* <Status status={TONE[deployment.state]} />
|
|
11
|
+
*/
|
|
12
|
+
export type {
|
|
13
|
+
Tone,
|
|
14
|
+
ToneAlias,
|
|
15
|
+
ToneInput,
|
|
16
|
+
Progress,
|
|
17
|
+
ProgressAlias,
|
|
18
|
+
ProgressInput,
|
|
19
|
+
SpaceStep,
|
|
20
|
+
RovingOrientation,
|
|
21
|
+
} from '@cascivo/core'
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cascivo/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.1",
|
|
4
4
|
"private": false,
|
|
5
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": [
|
|
@@ -33,10 +33,16 @@
|
|
|
33
33
|
"exports": {
|
|
34
34
|
".": {
|
|
35
35
|
"types": "./dist/index.d.ts",
|
|
36
|
+
"react-server": "./dist/index.js",
|
|
36
37
|
"node": "./dist/node/index.js",
|
|
37
38
|
"import": "./dist/index.js",
|
|
38
39
|
"default": "./dist/index.js"
|
|
39
40
|
},
|
|
41
|
+
"./types": {
|
|
42
|
+
"types": "./dist/types.d.ts",
|
|
43
|
+
"import": "./dist/types.js",
|
|
44
|
+
"default": "./dist/types.js"
|
|
45
|
+
},
|
|
40
46
|
"./styles.css": "./dist/styles.css",
|
|
41
47
|
"./package.json": "./package.json"
|
|
42
48
|
},
|
|
@@ -45,13 +51,14 @@
|
|
|
45
51
|
"provenance": true
|
|
46
52
|
},
|
|
47
53
|
"dependencies": {
|
|
48
|
-
"@cascivo/core": "^0.
|
|
49
|
-
"@cascivo/i18n": "^0.
|
|
50
|
-
"@cascivo/themes": "^0.4.
|
|
54
|
+
"@cascivo/core": "^0.17.1",
|
|
55
|
+
"@cascivo/i18n": "^0.17.1",
|
|
56
|
+
"@cascivo/themes": "^0.4.12"
|
|
51
57
|
},
|
|
52
58
|
"devDependencies": {
|
|
53
59
|
"@testing-library/jest-dom": "^6.9.1",
|
|
54
60
|
"@testing-library/react": "^16.3.2",
|
|
61
|
+
"@types/node": "^25",
|
|
55
62
|
"@types/react": "^19.2.17",
|
|
56
63
|
"@types/react-dom": "^19.2.3",
|
|
57
64
|
"jsdom": "^29",
|
package/readme.body.md
CHANGED
|
@@ -55,26 +55,27 @@ RSC without any extra wrapper.
|
|
|
55
55
|
|
|
56
56
|
> **No bundler? (CDN, import maps, plain `<link>`)** Import the aggregate sheet
|
|
57
57
|
> `@cascivo/react/styles.css` — every component's CSS **plus the tokens and the
|
|
58
|
-
> light & dark themes** in one file (~
|
|
58
|
+
> light & dark themes** in one file (~328 KB / ~47 KB gzip, not tree-shaken). It is
|
|
59
59
|
> self-contained: this single import gives you a fully-colored app with no separate
|
|
60
|
-
> `@cascivo/themes` import.
|
|
61
|
-
>
|
|
62
|
-
>
|
|
60
|
+
> `@cascivo/themes` import. On **any** bundler — CSR, SSR or RSC alike — you don't
|
|
61
|
+
> need it, and importing it costs you the per-component tree-shaking; reach for it
|
|
62
|
+
> only when nothing walks the module graph.
|
|
63
63
|
|
|
64
64
|
> **Vite SSR / TanStack Start / Remix / workerd?** The 4-line SSR checklist (full
|
|
65
65
|
> recipe: [USING-WITH-VITE-SSR.md](https://github.com/cascivo/cascivo/blob/main/docs/USING-WITH-VITE-SSR.md)):
|
|
66
66
|
>
|
|
67
|
-
> 1.
|
|
68
|
-
>
|
|
69
|
-
>
|
|
70
|
-
>
|
|
67
|
+
> 1. **No Vite config needed** on 0.10+ — the `node` export condition ships a
|
|
68
|
+
> CSS-free server build a bare ESM loader can import. Pinned below 0.10? Add
|
|
69
|
+
> `ssr: { noExternal: [/^@cascivo\//] }` (or the `cascivoSsr()` plugin from
|
|
70
|
+
> `@cascivo/vite-plugin`), else the loader throws `Unknown file extension ".css"`.
|
|
71
71
|
> 2. **`@preact/signals-react` 3.x** — on React 19 the 2.x line fails to load. The
|
|
72
72
|
> peer range enforces `>=3`.
|
|
73
|
-
> 3. **Import
|
|
74
|
-
>
|
|
75
|
-
> typecheck (`tsc --noEmit`), these
|
|
76
|
-
> `src/vite-env.d.ts` with
|
|
77
|
-
> `declare module '*.css'`, else
|
|
73
|
+
> 3. **Import a theme once** in your root entry: `@cascivo/themes/light-dark.css`
|
|
74
|
+
> (+ `@cascivo/charts/styles.css` if you use charts). Component CSS is automatic
|
|
75
|
+
> here too — don't add the aggregate. If you typecheck (`tsc --noEmit`), these
|
|
76
|
+
> bare `.css` imports need ambient types — add `src/vite-env.d.ts` with
|
|
77
|
+
> `/// <reference types="vite/client" />` or `declare module '*.css'`, else
|
|
78
|
+
> TS2307/TS2882.
|
|
78
79
|
> 4. **Theme without a mismatch:** inline `themePreloadScript()` in `<head>` and add
|
|
79
80
|
> `suppressHydrationWarning` to `<html>`, or hard-code `data-theme` for a fixed theme.
|
|
80
81
|
>
|