@cascivo/tokens 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 CHANGED
@@ -1,12 +1,56 @@
1
1
  <!-- generated by scripts/readme/generate.ts — edit readme.body.md, not this file -->
2
2
 
3
- # @cascivo/tokens
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/tokens</h1>
6
+ <p><strong>Three-level CSS design tokens (primitive → semantic → component)</strong></p>
4
7
 
5
- > Three-level CSS design tokens (primitive → semantic → component)
8
+ [![npm](https://img.shields.io/npm/v/%40cascivo%2Ftokens?style=flat-square&color=0079bf)](https://www.npmjs.com/package/@cascivo/tokens)
9
+ [![downloads](https://img.shields.io/npm/dm/%40cascivo%2Ftokens?style=flat-square&color=0079bf)](https://www.npmjs.com/package/@cascivo/tokens)
10
+ [![license](https://img.shields.io/npm/l/%40cascivo%2Ftokens?style=flat-square&color=0079bf)](https://github.com/cascivo/cascivo/blob/main/LICENSE)
11
+ ![types](https://img.shields.io/badge/types-included-0079bf?style=flat-square&logo=typescript&logoColor=white)
6
12
 
7
- [cascivo.com](https://cascivo.com) · [Docs](https://docs.cascivo.com) · [Storybook](https://storybook.cascivo.com) · [GitHub](https://github.com/urbanisierung/cascivo)
13
+ [npm](https://www.npmjs.com/package/@cascivo/tokens) · [cascivo.com](https://cascivo.com) · [Docs](https://docs.cascivo.com) · [Storybook](https://storybook.cascivo.com) · [GitHub](https://github.com/cascivo/cascivo)
8
14
 
9
- CSS design tokens for cascade — primitive, semantic, and component-level custom properties in a three-level system. Primitive tokens define the raw scale; semantic tokens map intent (`--cascivo-color-accent`); component tokens map usage (`--cascivo-button-bg`).
15
+ </div>
16
+
17
+ ---
18
+
19
+ A three-level system of CSS custom properties that every cascivo component, theme, and chart reads from.
20
+
21
+ ```
22
+ Primitive --cascivo-color-blue-500: #3b82f6 the raw scale
23
+
24
+ Semantic --cascivo-color-accent: var(--…-blue-500) intent (themes remap this layer)
25
+
26
+ Component --cascivo-button-bg: var(--…-accent) usage (override per-brand)
27
+ ```
28
+
29
+ ## Usage
30
+
31
+ Import once at your app entry — or get tokens for free via `@cascivo/themes`, which self-imports this package:
32
+
33
+ ```ts
34
+ import '@cascivo/tokens'
35
+ ```
36
+
37
+ Then reference tokens anywhere in your CSS:
38
+
39
+ ```css
40
+ .cta {
41
+ background: var(--cascivo-color-accent);
42
+ padding-block: var(--cascivo-space-3);
43
+ border-radius: var(--cascivo-radius-md);
44
+ }
45
+ ```
46
+
47
+ ## How the layers compose
48
+
49
+ - **Primitive** tokens define the raw palette, spacing, radius, and type scales. They never change between themes.
50
+ - **Semantic** tokens map intent (`--cascivo-color-accent`, `--cascivo-color-surface`). [`@cascivo/themes`](https://github.com/cascivo/cascivo/tree/main/packages/themes) overrides **only** this layer via `data-theme`.
51
+ - **Component** tokens map usage (`--cascivo-button-bg`). Override these to adapt a single component to your brand — no rebuild, no theme fork.
52
+
53
+ A machine-readable catalog of every token, its layer, and its resolved default ships as `tokens.catalog.json`, so AI agents select from a closed set rather than inventing values.
10
54
 
11
55
  ## Install
12
56
 
@@ -16,4 +60,6 @@ pnpm add @cascivo/tokens
16
60
 
17
61
  ---
18
62
 
19
- [cascivo.com](https://cascivo.com) · [Docs](https://docs.cascivo.com) · [Storybook](https://storybook.cascivo.com) · [GitHub](https://github.com/urbanisierung/cascivo) · AI agents: use [`@cascivo/mcp`](https://github.com/urbanisierung/cascivo/tree/main/packages/mcp) and [`registry.json`](https://github.com/urbanisierung/cascivo/blob/main/registry.json) · MIT
63
+ [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
64
+
65
+ <div align="center"><a href="https://cascivo.com"><img src="https://cascivo.com/favicon.svg" width="28" height="28" alt="cascivo"></a></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cascivo/tokens",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "private": false,
5
5
  "description": "Three-level CSS design tokens (primitive → semantic → component)",
6
6
  "keywords": [
@@ -13,13 +13,13 @@
13
13
  "react",
14
14
  "signals"
15
15
  ],
16
- "homepage": "https://github.com/urbanisierung/cascivo/tree/main/packages/tokens#readme",
17
- "bugs": "https://github.com/urbanisierung/cascivo/issues",
16
+ "homepage": "https://github.com/cascivo/cascivo/tree/main/packages/tokens#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/tokens"
24
24
  },
25
25
  "files": [
@@ -30,6 +30,8 @@
30
30
  ],
31
31
  "exports": {
32
32
  ".": "./src/index.css",
33
+ "./functions": "./src/functions.css",
34
+ "./functions.css": "./src/functions.css",
33
35
  "./screens": "./src/screens.ts",
34
36
  "./tokens.json": "./tokens.json",
35
37
  "./tokens": {
package/readme.body.md CHANGED
@@ -1 +1,35 @@
1
- CSS design tokens for cascade — primitive, semantic, and component-level custom properties in a three-level system. Primitive tokens define the raw scale; semantic tokens map intent (`--cascivo-color-accent`); component tokens map usage (`--cascivo-button-bg`).
1
+ A three-level system of CSS custom properties that every cascivo component, theme, and chart reads from.
2
+
3
+ ```
4
+ Primitive --cascivo-color-blue-500: #3b82f6 the raw scale
5
+
6
+ Semantic --cascivo-color-accent: var(--…-blue-500) intent (themes remap this layer)
7
+
8
+ Component --cascivo-button-bg: var(--…-accent) usage (override per-brand)
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ Import once at your app entry — or get tokens for free via `@cascivo/themes`, which self-imports this package:
14
+
15
+ ```ts
16
+ import '@cascivo/tokens'
17
+ ```
18
+
19
+ Then reference tokens anywhere in your CSS:
20
+
21
+ ```css
22
+ .cta {
23
+ background: var(--cascivo-color-accent);
24
+ padding-block: var(--cascivo-space-3);
25
+ border-radius: var(--cascivo-radius-md);
26
+ }
27
+ ```
28
+
29
+ ## How the layers compose
30
+
31
+ - **Primitive** tokens define the raw palette, spacing, radius, and type scales. They never change between themes.
32
+ - **Semantic** tokens map intent (`--cascivo-color-accent`, `--cascivo-color-surface`). [`@cascivo/themes`](https://github.com/cascivo/cascivo/tree/main/packages/themes) overrides **only** this layer via `data-theme`.
33
+ - **Component** tokens map usage (`--cascivo-button-bg`). Override these to adapt a single component to your brand — no rebuild, no theme fork.
34
+
35
+ A machine-readable catalog of every token, its layer, and its resolved default ships as `tokens.catalog.json`, so AI agents select from a closed set rather than inventing values.
package/src/index.css CHANGED
@@ -97,6 +97,11 @@
97
97
  --cascivo-font-sans:
98
98
  ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
99
99
  --cascivo-font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
100
+ /* Display = the headline/brand face a theme may override (terminal, brutalist,
101
+ arcade …). Defaults to the sans stack, so themes that do not override it look
102
+ unchanged. sans/mono remain the body/code defaults. Per-theme overrides live in
103
+ each theme file (declared in all themes to satisfy token parity). */
104
+ --cascivo-font-display: var(--cascivo-font-sans);
100
105
 
101
106
  --cascivo-text-xs: 0.75rem; /* 12px */
102
107
  --cascivo-text-sm: 0.875rem; /* 14px */
@@ -105,6 +110,7 @@
105
110
  --cascivo-text-xl: 1.25rem; /* 20px */
106
111
  --cascivo-text-2xl: 1.5rem; /* 24px */
107
112
  --cascivo-text-3xl: 1.875rem; /* 30px */
113
+ --cascivo-text-4xl: 2.25rem; /* 36px */
108
114
 
109
115
  --cascivo-font-normal: 400;
110
116
  --cascivo-font-medium: 500;
@@ -139,6 +145,10 @@
139
145
  --cascivo-radius-overlay: calc(var(--cascivo-radius-base) * 2); /* ~12px modals/popovers */
140
146
  --cascivo-radius-indicator: calc(var(--cascivo-radius-base) / 2);
141
147
 
148
+ /* ── Interaction state opacity (HeroUI layout-token parity; themes may retune) ── */
149
+ --cascivo-disabled-opacity: 0.5;
150
+ --cascivo-hover-opacity: 0.8;
151
+
142
152
  /* ── Shadows — rationed: surfaces flat/xs, floating layers get ONE soft shadow ── */
143
153
  --cascivo-shadow-xs: 0 1px 2px oklch(0 0 0 / 0.05);
144
154
  --cascivo-shadow-sm: 0 1px 3px oklch(0 0 0 / 0.07), 0 1px 2px oklch(0 0 0 / 0.04);
@@ -245,6 +255,7 @@
245
255
  /* clamp(min, vw-slope, max) where max = current fixed value so desktop ceiling is frozen. */
246
256
  --cascivo-text-2xl-fluid: clamp(1.25rem, 1rem + 1.25vw, 1.5rem); /* 20→24px */
247
257
  --cascivo-text-3xl-fluid: clamp(1.5rem, 1.125rem + 1.875vw, 1.875rem); /* 24→30px */
258
+ --cascivo-text-4xl-fluid: clamp(1.875rem, 1.5rem + 1.875vw, 2.25rem); /* 30→36px */
248
259
 
249
260
  /* ── Coarse-pointer touch target ─────────────────── */
250
261
  /* Controls should reach this minimum under @media (pointer: coarse) — added in v20-t3. */
@@ -266,4 +277,11 @@
266
277
  }
267
278
  }
268
279
 
269
- @import './functions.css';
280
+ /*
281
+ * CSS @function helpers (--cascivo-step / --cascivo-scale) are NOT imported here.
282
+ * They are a Chrome-133+ progressive-enhancement pilot and are unparseable by
283
+ * current CSS minifiers (lightningcss / Tailwind v4), which choke on `@function`
284
+ * and drop the rule. Every call site ships a static fallback, so omitting them is
285
+ * always correct. Opt in explicitly if your build pipeline supports @function:
286
+ * import '@cascivo/tokens/functions.css'
287
+ */
package/src/tokens.d.ts CHANGED
@@ -88,6 +88,7 @@ export type CascivoToken =
88
88
  | '--cascivo-control-height-lg'
89
89
  | '--cascivo-control-height-md'
90
90
  | '--cascivo-control-height-sm'
91
+ | '--cascivo-disabled-opacity'
91
92
  | '--cascivo-duration-100'
92
93
  | '--cascivo-duration-150'
93
94
  | '--cascivo-duration-200'
@@ -99,6 +100,7 @@ export type CascivoToken =
99
100
  | '--cascivo-ease-out'
100
101
  | '--cascivo-focus-ring'
101
102
  | '--cascivo-font-bold'
103
+ | '--cascivo-font-display'
102
104
  | '--cascivo-font-medium'
103
105
  | '--cascivo-font-mono'
104
106
  | '--cascivo-font-normal'
@@ -124,6 +126,7 @@ export type CascivoToken =
124
126
  | '--cascivo-green-600'
125
127
  | '--cascivo-green-700'
126
128
  | '--cascivo-green-900'
129
+ | '--cascivo-hover-opacity'
127
130
  | '--cascivo-leading-none'
128
131
  | '--cascivo-leading-normal'
129
132
  | '--cascivo-leading-relaxed'
@@ -199,6 +202,8 @@ export type CascivoToken =
199
202
  | '--cascivo-text-2xl-fluid'
200
203
  | '--cascivo-text-3xl'
201
204
  | '--cascivo-text-3xl-fluid'
205
+ | '--cascivo-text-4xl'
206
+ | '--cascivo-text-4xl-fluid'
202
207
  | '--cascivo-text-base'
203
208
  | '--cascivo-text-lg'
204
209
  | '--cascivo-text-sm'
package/tokens.json CHANGED
@@ -1072,6 +1072,20 @@
1072
1072
  "value": "var(--cascivo-duration-150) var(--cascivo-ease-in)",
1073
1073
  "canonical": true
1074
1074
  },
1075
+ {
1076
+ "name": "--cascivo-disabled-opacity",
1077
+ "category": "other",
1078
+ "role": "disabled-opacity",
1079
+ "value": "0.5",
1080
+ "canonical": true
1081
+ },
1082
+ {
1083
+ "name": "--cascivo-hover-opacity",
1084
+ "category": "other",
1085
+ "role": "hover-opacity",
1086
+ "value": "0.8",
1087
+ "canonical": true
1088
+ },
1075
1089
  {
1076
1090
  "name": "--cascivo-radius-2xl",
1077
1091
  "category": "radius",
@@ -1380,6 +1394,13 @@
1380
1394
  "value": "700",
1381
1395
  "canonical": true
1382
1396
  },
1397
+ {
1398
+ "name": "--cascivo-font-display",
1399
+ "category": "typography",
1400
+ "role": "font-display",
1401
+ "value": "var(--cascivo-font-sans)",
1402
+ "canonical": true
1403
+ },
1383
1404
  {
1384
1405
  "name": "--cascivo-font-medium",
1385
1406
  "category": "typography",
@@ -1478,6 +1499,20 @@
1478
1499
  "value": "clamp(1.5rem, 1.125rem + 1.875vw, 1.875rem)",
1479
1500
  "canonical": true
1480
1501
  },
1502
+ {
1503
+ "name": "--cascivo-text-4xl",
1504
+ "category": "typography",
1505
+ "role": "text-4xl",
1506
+ "value": "2.25rem",
1507
+ "canonical": true
1508
+ },
1509
+ {
1510
+ "name": "--cascivo-text-4xl-fluid",
1511
+ "category": "typography",
1512
+ "role": "text-4xl-fluid",
1513
+ "value": "clamp(1.875rem, 1.5rem + 1.875vw, 2.25rem)",
1514
+ "canonical": true
1515
+ },
1481
1516
  {
1482
1517
  "name": "--cascivo-text-base",
1483
1518
  "category": "typography",