@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.
Files changed (62) hide show
  1. package/README.md +14 -13
  2. package/dist/accordion/accordion.js +5 -4
  3. package/dist/app-shell/app-shell.css +1 -1
  4. package/dist/app-shell/app-shell.js +28 -26
  5. package/dist/app-shell/app-shell.module.js +8 -8
  6. package/dist/breadcrumb/breadcrumb.js +1 -1
  7. package/dist/button/button.css +1 -1
  8. package/dist/button/button.js +4 -1
  9. package/dist/button/button.module.js +4 -1
  10. package/dist/calendar/calendar.js +67 -63
  11. package/dist/card/card.css +1 -1
  12. package/dist/card/card.module.js +8 -8
  13. package/dist/checkbox/checkbox.css +1 -1
  14. package/dist/checkbox/checkbox.module.js +4 -4
  15. package/dist/code-snippet/code-snippet.js +31 -26
  16. package/dist/combobox/combobox.js +55 -54
  17. package/dist/data-table/data-table.css +1 -1
  18. package/dist/data-table/data-table.js +155 -160
  19. package/dist/data-table/data-table.module.js +29 -29
  20. package/dist/date-picker/date-picker.js +90 -89
  21. package/dist/dock/dock.js +1 -1
  22. package/dist/field/field.css +1 -1
  23. package/dist/field/field.module.js +3 -3
  24. package/dist/index.d.ts +157 -10
  25. package/dist/large-title-header/large-title-header.js +1 -1
  26. package/dist/layouts/src/grid/grid.css +1 -1
  27. package/dist/layouts/src/grid/grid.module.js +3 -3
  28. package/dist/node/accordion/accordion.js +5 -4
  29. package/dist/node/app-shell/app-shell.js +28 -26
  30. package/dist/node/app-shell/app-shell.module.js +8 -8
  31. package/dist/node/breadcrumb/breadcrumb.js +1 -1
  32. package/dist/node/button/button.js +4 -1
  33. package/dist/node/button/button.module.js +4 -1
  34. package/dist/node/calendar/calendar.js +67 -63
  35. package/dist/node/card/card.module.js +8 -8
  36. package/dist/node/checkbox/checkbox.module.js +4 -4
  37. package/dist/node/code-snippet/code-snippet.js +31 -26
  38. package/dist/node/combobox/combobox.js +55 -54
  39. package/dist/node/data-table/data-table.js +155 -160
  40. package/dist/node/data-table/data-table.module.js +29 -29
  41. package/dist/node/date-picker/date-picker.js +90 -89
  42. package/dist/node/dock/dock.js +1 -1
  43. package/dist/node/field/field.module.js +3 -3
  44. package/dist/node/large-title-header/large-title-header.js +1 -1
  45. package/dist/node/layouts/src/grid/grid.module.js +3 -3
  46. package/dist/node/search/search.js +5 -4
  47. package/dist/node/side-nav/side-nav.js +90 -89
  48. package/dist/node/swap/swap.js +4 -3
  49. package/dist/node/switcher/switcher.js +1 -1
  50. package/dist/node/tabs/tabs.js +5 -4
  51. package/dist/node/toc/toc.js +5 -4
  52. package/dist/search/search.js +5 -4
  53. package/dist/side-nav/side-nav.js +90 -89
  54. package/dist/styles.css +7 -7
  55. package/dist/swap/swap.js +4 -3
  56. package/dist/switcher/switcher.js +1 -1
  57. package/dist/tabs/tabs.js +5 -4
  58. package/dist/toc/toc.js +5 -4
  59. package/dist/types.d.ts +21 -0
  60. package/dist/types.js +1 -0
  61. package/package.json +11 -4
  62. 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, useSignal as s, useSignals as c } from "@cascivo/core";
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(n ?? t ?? "");
11
- n !== void 0 && (f.value = n);
12
- let p = {
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, useSignal as r, useSignalEffect as i, useSignals as a } from "@cascivo/core";
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(u ?? l[0]?.id ?? "");
12
- m && (h.value = u);
13
- let g = t(d);
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);
@@ -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.16.1",
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.16.1",
49
- "@cascivo/i18n": "^0.16.1",
50
- "@cascivo/themes": "^0.4.11"
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 (~305 KB / ~40 KB gzip, not tree-shaken). It is
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. With a bundler (CSR) you don't need it; import it only if
61
- > you prefer one explicit stylesheet over per-component tree-shaking, or for Vite SSR
62
- > (below), where it is required.
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. **`ssr: { noExternal: [/^@cascivo\//] }`** in `vite.config` (or the
68
- > `cascivoSsr()` plugin from `@cascivo/vite-plugin`). Without it a bare
69
- > server-side ESM loader can't resolve the per-component `.css` side-effect
70
- > imports and throws `Unknown file extension ".css"`.
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 the CSS once** in your root entry: `@cascivo/react/styles.css` +
74
- > `@cascivo/themes/all` (+ `@cascivo/charts/styles.css` if you use charts). If you
75
- > typecheck (`tsc --noEmit`), these bare `.css` imports need ambient types — add
76
- > `src/vite-env.d.ts` with `/// <reference types="vite/client" />` or
77
- > `declare module '*.css'`, else TS2307/TS2882.
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
  >