@tokis/tokens 1.0.0 → 1.1.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.
Files changed (55) hide show
  1. package/README.md +5 -5
  2. package/dist/cjs/css/generate-css-vars.js +242 -39
  3. package/dist/cjs/primitives/breakpoints.js +10 -0
  4. package/dist/cjs/primitives/colors.js +64 -16
  5. package/dist/cjs/primitives/motion.js +16 -3
  6. package/dist/cjs/primitives/radius.js +9 -2
  7. package/dist/cjs/primitives/shadows.js +12 -3
  8. package/dist/cjs/primitives/spacing.js +28 -0
  9. package/dist/cjs/primitives/typography.js +35 -7
  10. package/dist/cjs/primitives/zIndex.js +15 -2
  11. package/dist/css/generate-css-vars.d.ts +46 -1
  12. package/dist/css/generate-css-vars.d.ts.map +1 -1
  13. package/dist/css/generate-css-vars.js +239 -39
  14. package/dist/css/generate-css-vars.js.map +1 -1
  15. package/dist/primitives/breakpoints.d.ts +10 -0
  16. package/dist/primitives/breakpoints.d.ts.map +1 -1
  17. package/dist/primitives/breakpoints.js +10 -0
  18. package/dist/primitives/breakpoints.js.map +1 -1
  19. package/dist/primitives/colors.d.ts +52 -16
  20. package/dist/primitives/colors.d.ts.map +1 -1
  21. package/dist/primitives/colors.js +64 -16
  22. package/dist/primitives/colors.js.map +1 -1
  23. package/dist/primitives/motion.d.ts +14 -3
  24. package/dist/primitives/motion.d.ts.map +1 -1
  25. package/dist/primitives/motion.js +16 -3
  26. package/dist/primitives/motion.js.map +1 -1
  27. package/dist/primitives/radius.d.ts +9 -2
  28. package/dist/primitives/radius.d.ts.map +1 -1
  29. package/dist/primitives/radius.js +9 -2
  30. package/dist/primitives/radius.js.map +1 -1
  31. package/dist/primitives/shadows.d.ts +12 -3
  32. package/dist/primitives/shadows.d.ts.map +1 -1
  33. package/dist/primitives/shadows.js +12 -3
  34. package/dist/primitives/shadows.js.map +1 -1
  35. package/dist/primitives/spacing.d.ts +26 -0
  36. package/dist/primitives/spacing.d.ts.map +1 -1
  37. package/dist/primitives/spacing.js +28 -0
  38. package/dist/primitives/spacing.js.map +1 -1
  39. package/dist/primitives/typography.d.ts +25 -2
  40. package/dist/primitives/typography.d.ts.map +1 -1
  41. package/dist/primitives/typography.js +35 -7
  42. package/dist/primitives/typography.js.map +1 -1
  43. package/dist/primitives/zIndex.d.ts +15 -2
  44. package/dist/primitives/zIndex.d.ts.map +1 -1
  45. package/dist/primitives/zIndex.js +15 -2
  46. package/dist/primitives/zIndex.js.map +1 -1
  47. package/dist/semantic/border.d.ts +1 -1
  48. package/dist/semantic/color.d.ts +5 -5
  49. package/dist/semantic/surface.d.ts +1 -1
  50. package/dist/semantic/text.d.ts +4 -4
  51. package/dist/themes/dark.d.ts +44 -15
  52. package/dist/themes/dark.d.ts.map +1 -1
  53. package/dist/themes/light.d.ts +50 -21
  54. package/dist/themes/light.d.ts.map +1 -1
  55. package/package.json +4 -4
package/README.md CHANGED
@@ -1,14 +1,14 @@
1
- # /tokens
1
+ # @tokis/tokens
2
2
 
3
3
  Design token engine for the Tokis design system — color primitives, semantic scales, spacing, typography, shadows, motion, and CSS variable generation.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install /tokens
8
+ npm install @tokis/tokens
9
9
  ```
10
10
 
11
- > Or install everything at once: `npm install tokis`
11
+ > Or install everything at once: `npm install @tokis/tokis`
12
12
 
13
13
  ## Usage
14
14
 
@@ -25,7 +25,7 @@ import {
25
25
  lightTheme,
26
26
  darkTheme,
27
27
  generateCSSVars,
28
- } from '/tokens';
28
+ } from '@tokis/tokens';
29
29
 
30
30
  // Generate CSS custom properties from a theme
31
31
  const css = generateCSSVars(lightTheme);
@@ -34,7 +34,7 @@ const css = generateCSSVars(lightTheme);
34
34
  ### CSS
35
35
 
36
36
  ```css
37
- @import '/tokens/css';
37
+ @import '@tokis/tokens/css';
38
38
  ```
39
39
 
40
40
  ## What's Included
@@ -1,50 +1,253 @@
1
1
  "use strict";
2
+ /**
3
+ * Tokis CSS variable generator.
4
+ *
5
+ * Converts TypeScript primitive token objects into valid CSS custom property
6
+ * declarations. This module serves two purposes:
7
+ *
8
+ * 1. **Build time** — `scripts/generate-tokens-css.ts` calls
9
+ * `generateAllCssVars()` and writes the output to
10
+ * `packages/theme/src/base/variables.css`, keeping CSS and TypeScript
11
+ * in perfect sync. Run with: `pnpm tokens:generate`.
12
+ *
13
+ * 2. **Runtime injection** (escape hatch for CSS-in-JS contexts) — call
14
+ * `generateAllCssVars()` and inject via a `<style>` tag. Not recommended
15
+ * for production; prefer the precompiled static CSS.
16
+ *
17
+ * Generated variable names exactly match those referenced in
18
+ * `packages/theme/src/base/variables.css` and all component CSS files.
19
+ *
20
+ * Zero dependencies — plain TypeScript, no React, no DOM.
21
+ */
2
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
+ exports.generateLightCssVars = generateLightCssVars;
24
+ exports.generateDarkCssVars = generateDarkCssVars;
25
+ exports.generateAllCssVars = generateAllCssVars;
3
26
  exports.generateCssVariables = generateCssVariables;
4
27
  const colors_js_1 = require("../primitives/colors");
5
28
  const spacing_js_1 = require("../primitives/spacing");
6
- const radius_js_1 = require("../primitives/radius");
7
29
  const typography_js_1 = require("../primitives/typography");
30
+ const radius_js_1 = require("../primitives/radius");
8
31
  const shadows_js_1 = require("../primitives/shadows");
9
32
  const motion_js_1 = require("../primitives/motion");
10
33
  const zIndex_js_1 = require("../primitives/zIndex");
11
34
  const breakpoints_js_1 = require("../primitives/breakpoints");
12
- const color_js_1 = require("../semantic/color");
13
- const surface_js_1 = require("../semantic/surface");
14
- const text_js_1 = require("../semantic/text");
15
- const border_js_1 = require("../semantic/border");
16
- function generateCssVariables(scope = ':root') {
17
- const vars = [];
18
- const prefix = '--tokis-';
19
- const add = (name, value) => {
20
- vars.push(` ${prefix}${name}: ${String(value)};`);
21
- };
22
- // Primitive: Colors
23
- Object.entries(colors_js_1.colors).forEach(([key, value]) => add(`color-${key}`, value));
24
- // Primitive: Spacing
25
- Object.entries(spacing_js_1.spacing).forEach(([key, value]) => add(`spacing-${key}`, value));
26
- // Primitive: Radius
27
- Object.entries(radius_js_1.radius).forEach(([key, value]) => add(`radius-${key}`, value));
28
- // Primitive: Typography
29
- Object.entries(typography_js_1.typography.fontSize).forEach(([key, value]) => add(`font-size-${key}`, value));
30
- Object.entries(typography_js_1.typography.fontWeight).forEach(([key, value]) => add(`font-weight-${key}`, String(value)));
31
- add('font-family', typography_js_1.typography.fontFamily);
32
- // Primitive: Shadows
33
- Object.entries(shadows_js_1.shadows).forEach(([key, value]) => add(`shadow-${key}`, value));
34
- // Primitive: Motion
35
- Object.entries(motion_js_1.motion.duration).forEach(([key, value]) => add(`motion-duration-${key}`, value));
36
- Object.entries(motion_js_1.motion.easing).forEach(([key, value]) => add(`motion-easing-${key}`, value));
37
- // Primitive: Z-Index
38
- Object.entries(zIndex_js_1.zIndex).forEach(([key, value]) => add(`z-index-${key}`, String(value)));
39
- // Primitive: Breakpoints
40
- Object.entries(breakpoints_js_1.breakpoints).forEach(([key, value]) => add(`breakpoint-${key}`, value));
41
- // Semantic: Colors
42
- Object.entries(color_js_1.semanticColors).forEach(([key, value]) => add(`semantic-color-${key}`, value));
43
- // Semantic: Surface
44
- Object.entries(surface_js_1.surface).forEach(([key, value]) => add(`surface-${key}`, value));
45
- // Semantic: Text
46
- Object.entries(text_js_1.text).forEach(([key, value]) => add(`text-${key}`, value));
47
- // Semantic: Border
48
- Object.entries(border_js_1.border).forEach(([key, value]) => add(`border-${key}`, value));
49
- return `${scope} {\n${vars.join('\n')}\n}`;
35
+ // ─── Helpers ─────────────────────────────────────────────────────────────────
36
+ /** camelCase kebab-case: `primaryHover` → `primary-hover` */
37
+ function kebab(str) {
38
+ return str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
39
+ }
40
+ /** Indent every line of a multi-line string. */
41
+ function indent(str, spaces = 2) {
42
+ const pad = ' '.repeat(spaces);
43
+ return str
44
+ .split('\n')
45
+ .map((l) => (l.trim() ? `${pad}${l}` : ''))
46
+ .join('\n');
47
+ }
48
+ // ─── Light / :root block ─────────────────────────────────────────────────────
49
+ function generateLightCssVars() {
50
+ const lines = [];
51
+ const v = (name, value) => `--tokis-${name}: ${String(value)};`;
52
+ // ── Primitive colors ──────────────────────────────────────────────────
53
+ lines.push('/* Primitive Colors */');
54
+ for (const [key, value] of Object.entries(colors_js_1.colors)) {
55
+ lines.push(v(`color-${kebab(key)}`, value));
56
+ }
57
+ // Legacy flat text-* aliases that component CSS files reference directly
58
+ // (e.g. `--tokis-text-primary`) kept for backward compat with theme CSS.
59
+ lines.push('');
60
+ lines.push('/* Text — legacy flat aliases */');
61
+ lines.push(v('text-primary', colors_js_1.colors.textPrimary));
62
+ lines.push(v('text-secondary', colors_js_1.colors.textSecondary));
63
+ lines.push(v('text-tertiary', colors_js_1.colors.textTertiary));
64
+ lines.push(v('text-disabled', colors_js_1.colors.textDisabled));
65
+ lines.push(v('text-inverse', colors_js_1.colors.textInverse));
66
+ lines.push(v('text-on-primary', colors_js_1.colors.textOnPrimary));
67
+ lines.push(v('text-link', colors_js_1.colors.textLink));
68
+ lines.push(v('text-error', colors_js_1.colors.textError));
69
+ lines.push(v('text-success', colors_js_1.colors.textSuccess));
70
+ lines.push(v('text-warning', colors_js_1.colors.textWarning));
71
+ // ── Spacing ───────────────────────────────────────────────────────────
72
+ lines.push('');
73
+ lines.push('/* Spacing */');
74
+ for (const [key, value] of Object.entries(spacing_js_1.spacing)) {
75
+ if (!isNaN(Number(key))) {
76
+ lines.push(v(`spacing-${key}`, value));
77
+ }
78
+ }
79
+ // ── Typography ────────────────────────────────────────────────────────
80
+ lines.push('');
81
+ lines.push('/* Typography */');
82
+ lines.push(v('font-family', typography_js_1.typography.fontFamily.sans));
83
+ lines.push(v('font-family-mono', typography_js_1.typography.fontFamily.mono));
84
+ for (const [key, value] of Object.entries(typography_js_1.typography.fontSize)) {
85
+ lines.push(v(`font-size-${key}`, value));
86
+ }
87
+ for (const [key, value] of Object.entries(typography_js_1.typography.fontWeight)) {
88
+ if (key !== 'normal')
89
+ lines.push(v(`font-weight-${key}`, value));
90
+ }
91
+ for (const [key, value] of Object.entries(typography_js_1.typography.lineHeight)) {
92
+ lines.push(v(`line-height-${key}`, value));
93
+ }
94
+ for (const [key, value] of Object.entries(typography_js_1.typography.letterSpacing)) {
95
+ lines.push(v(`letter-spacing-${kebab(key)}`, value));
96
+ }
97
+ // ── Border Radius ─────────────────────────────────────────────────────
98
+ lines.push('');
99
+ lines.push('/* Border Radius */');
100
+ for (const [key, value] of Object.entries(radius_js_1.radius)) {
101
+ lines.push(v(`radius-${key}`, value));
102
+ }
103
+ // ── Shadows ───────────────────────────────────────────────────────────
104
+ lines.push('');
105
+ lines.push('/* Shadows */');
106
+ for (const [key, value] of Object.entries(shadows_js_1.shadows)) {
107
+ lines.push(v(`shadow-${key}`, value));
108
+ }
109
+ // ── Focus ─────────────────────────────────────────────────────────────
110
+ lines.push('');
111
+ lines.push('/* Focus */');
112
+ lines.push(v('color-focus-ring', colors_js_1.colors.focusRing));
113
+ lines.push(v('color-focus-ring-error', colors_js_1.colors.focusRingError));
114
+ // ── Surface interaction states ────────────────────────────────────────
115
+ lines.push('');
116
+ lines.push('/* Surface interaction states */');
117
+ lines.push(v('color-surface-hover', colors_js_1.colors.surfaceHover));
118
+ lines.push(v('color-surface-active', colors_js_1.colors.surfaceActive));
119
+ // ── Motion ────────────────────────────────────────────────────────────
120
+ lines.push('');
121
+ lines.push('/* Motion */');
122
+ for (const [key, value] of Object.entries(motion_js_1.motion.duration)) {
123
+ lines.push(v(`duration-${key}`, value));
124
+ }
125
+ for (const [key, value] of Object.entries(motion_js_1.motion.easing)) {
126
+ lines.push(v(`ease-${kebab(key)}`, value));
127
+ }
128
+ // ── Z-index ───────────────────────────────────────────────────────────
129
+ lines.push('');
130
+ lines.push('/* Z-index */');
131
+ for (const [key, value] of Object.entries(zIndex_js_1.zIndex)) {
132
+ lines.push(v(`z-${key}`, value));
133
+ }
134
+ // ── Breakpoints ───────────────────────────────────────────────────────
135
+ lines.push('');
136
+ lines.push('/* Breakpoints (JS reference — not usable in @media queries) */');
137
+ for (const [key, value] of Object.entries(breakpoints_js_1.breakpoints)) {
138
+ lines.push(v(`breakpoint-${key}`, value));
139
+ }
140
+ return `:root {\n${indent(lines.join('\n'))}\n}`;
141
+ }
142
+ // ─── Dark theme overrides ────────────────────────────────────────────────────
143
+ /**
144
+ * Returns only the CSS custom properties that change in dark mode.
145
+ * Spacing, typography, radius, motion, and z-index are theme-invariant.
146
+ */
147
+ function generateDarkCssVars() {
148
+ const dark = `\
149
+ /* Brand */
150
+ --tokis-color-primary: #3b82f6;
151
+ --tokis-color-primary-hover: #60a5fa;
152
+ --tokis-color-primary-active: #93c5fd;
153
+ --tokis-color-primary-subtle: #1e3a5f;
154
+ --tokis-color-secondary: #a78bfa;
155
+ --tokis-color-secondary-hover: #c4b5fd;
156
+ --tokis-color-secondary-subtle: #2e1065;
157
+
158
+ /* Backgrounds & Surfaces */
159
+ --tokis-color-background: #0f172a;
160
+ --tokis-color-surface: #1e293b;
161
+ --tokis-color-surface-raised: #293548;
162
+ --tokis-color-surface-overlay: #1e293b;
163
+ --tokis-color-surface-hover: #334155;
164
+ --tokis-color-surface-active: #475569;
165
+
166
+ /* Borders */
167
+ --tokis-color-border: #334155;
168
+ --tokis-color-border-strong: #475569;
169
+
170
+ /* Status */
171
+ --tokis-color-error: #f87171;
172
+ --tokis-color-error-subtle: #450a0a;
173
+ --tokis-color-warning: #fbbf24;
174
+ --tokis-color-warning-subtle: #451a03;
175
+ --tokis-color-success: #4ade80;
176
+ --tokis-color-success-subtle: #052e16;
177
+ --tokis-color-info: #38bdf8;
178
+ --tokis-color-info-subtle: #082f49;
179
+
180
+ /* Text */
181
+ --tokis-text-primary: #f1f5f9;
182
+ --tokis-text-secondary: #94a3b8;
183
+ --tokis-text-tertiary: #64748b;
184
+ --tokis-text-disabled: #475569;
185
+ --tokis-text-inverse: #0f172a;
186
+ --tokis-text-on-primary: #ffffff;
187
+ --tokis-text-link: #60a5fa;
188
+ --tokis-text-error: #f87171;
189
+ --tokis-text-success: #4ade80;
190
+ --tokis-text-warning: #fbbf24;
191
+
192
+ /* Neutral scale (inverted for dark) */
193
+ --tokis-color-neutral-50: #0f172a;
194
+ --tokis-color-neutral-100: #1e293b;
195
+ --tokis-color-neutral-200: #334155;
196
+ --tokis-color-neutral-300: #475569;
197
+ --tokis-color-neutral-400: #64748b;
198
+ --tokis-color-neutral-500: #94a3b8;
199
+ --tokis-color-neutral-600: #cbd5e1;
200
+ --tokis-color-neutral-700: #e2e8f0;
201
+ --tokis-color-neutral-800: #f1f5f9;
202
+ --tokis-color-neutral-900: #f8fafc;
203
+
204
+ /* Shadows (higher opacity for dark backgrounds) */
205
+ --tokis-shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.30);
206
+ --tokis-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.40), 0 1px 2px -1px rgb(0 0 0 / 0.40);
207
+ --tokis-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.40), 0 2px 4px -2px rgb(0 0 0 / 0.40);
208
+ --tokis-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.40), 0 4px 6px -4px rgb(0 0 0 / 0.40);
209
+ --tokis-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.40), 0 8px 10px -6px rgb(0 0 0 / 0.40);
210
+
211
+ /* Focus rings */
212
+ --tokis-color-focus-ring: rgb(59 130 246 / 0.20);
213
+ --tokis-color-focus-ring-error: rgb(248 113 113 / 0.20);`;
214
+ return `[data-theme="dark"] {\n${indent(dark)}\n}`;
215
+ }
216
+ // ─── Full stylesheet ──────────────────────────────────────────────────────────
217
+ /**
218
+ * Returns the complete CSS variable stylesheet:
219
+ * the light `:root` block followed by dark `[data-theme="dark"]` overrides.
220
+ *
221
+ * **Build-time usage** (`scripts/generate-tokens-css.ts`):
222
+ * ```ts
223
+ * import { generateAllCssVars } from '@tokis/tokens';
224
+ * import { writeFileSync } from 'node:fs';
225
+ * writeFileSync(
226
+ * 'packages/theme/src/base/variables.css',
227
+ * generateAllCssVars(),
228
+ * );
229
+ * ```
230
+ */
231
+ function generateAllCssVars() {
232
+ return [
233
+ '/* ============================================================',
234
+ ' Tokis — Design Token CSS Variables',
235
+ ' Auto-generated by @tokis/tokens — generate-css-vars.ts',
236
+ ' Run `pnpm tokens:generate` to regenerate after editing tokens.',
237
+ ' ============================================================ */',
238
+ '',
239
+ generateLightCssVars(),
240
+ '',
241
+ '/* ── Dark Theme ──────────────────────────────────────────── */',
242
+ generateDarkCssVars(),
243
+ '',
244
+ ].join('\n');
245
+ }
246
+ // ─── Backward-compat export ───────────────────────────────────────────────────
247
+ /**
248
+ * @deprecated Use `generateLightCssVars()` or `generateAllCssVars()` instead.
249
+ * The `scope` parameter is ignored; the selector is always `:root`.
250
+ */
251
+ function generateCssVariables(_scope = ':root') {
252
+ return generateLightCssVars();
50
253
  }
@@ -1,9 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.breakpoints = void 0;
4
+ /**
5
+ * Tokis responsive breakpoints.
6
+ * These map to `--tokis-breakpoint-{key}` CSS custom properties (for JS reference)
7
+ * and should be used with `@media (min-width: ...)` in CSS files.
8
+ *
9
+ * Note: CSS custom properties cannot be used inside media query conditions,
10
+ * so the values here serve as the canonical reference — CSS files hardcode
11
+ * the same pixel values directly in `@media` rules.
12
+ */
4
13
  exports.breakpoints = {
5
14
  sm: '640px',
6
15
  md: '768px',
7
16
  lg: '1024px',
8
17
  xl: '1280px',
18
+ '2xl': '1536px',
9
19
  };
@@ -1,26 +1,74 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.colors = void 0;
4
+ /**
5
+ * Tokis primitive color tokens — canonical source of truth.
6
+ * The CSS variable file `theme/src/base/variables.css` is generated from
7
+ * these definitions via `scripts/generate-tokens-css.ts`.
8
+ *
9
+ * All values are plain strings so the object is JSON-serializable.
10
+ */
4
11
  exports.colors = {
12
+ // ── Brand: Primary ────────────────────────────────────────────────────
5
13
  primary: '#0066ff',
6
- secondary: '#ff6600',
14
+ primaryHover: '#0052cc',
15
+ primaryActive: '#003d99',
16
+ primarySubtle: '#e6f0ff',
17
+ // ── Brand: Secondary ──────────────────────────────────────────────────
18
+ secondary: '#7c3aed',
19
+ secondaryHover: '#6d28d9',
20
+ secondarySubtle: '#ede9fe',
21
+ // ── Backgrounds & Surfaces ────────────────────────────────────────────
7
22
  background: '#ffffff',
8
- surface: '#f5f5f5',
9
- error: '#d32f2f',
10
- warning: '#f57c00',
11
- success: '#388e3c',
12
- neutral100: '#f5f5f5',
13
- neutral200: '#eeeeee',
14
- neutral300: '#e0e0e0',
15
- neutral400: '#bdbdbd',
16
- neutral500: '#9e9e9e',
17
- neutral600: '#757575',
18
- neutral700: '#616161',
19
- neutral800: '#424242',
20
- neutral900: '#212121',
23
+ surface: '#f8f9fa',
24
+ surfaceRaised: '#ffffff',
25
+ surfaceOverlay: '#ffffff',
26
+ surfaceHover: '#f1f5f9',
27
+ surfaceActive: '#e2e8f0',
28
+ // ── Borders ───────────────────────────────────────────────────────────
29
+ border: '#e2e8f0',
30
+ borderStrong: '#cbd5e1',
31
+ // ── Status: Error ─────────────────────────────────────────────────────
32
+ error: '#dc2626',
33
+ errorSubtle: '#fef2f2',
34
+ // ── Status: Warning ───────────────────────────────────────────────────
35
+ warning: '#d97706',
36
+ warningSubtle: '#fffbeb',
37
+ // ── Status: Success ───────────────────────────────────────────────────
38
+ success: '#16a34a',
39
+ successSubtle: '#f0fdf4',
40
+ // ── Status: Info ──────────────────────────────────────────────────────
41
+ info: '#0284c7',
42
+ infoSubtle: '#f0f9ff',
43
+ // ── Text ──────────────────────────────────────────────────────────────
44
+ textPrimary: '#0f172a',
45
+ textSecondary: '#475569',
46
+ textTertiary: '#94a3b8',
47
+ textDisabled: '#cbd5e1',
48
+ textInverse: '#ffffff',
49
+ textOnPrimary: '#ffffff',
50
+ textLink: '#0066ff',
51
+ textError: '#dc2626',
52
+ textSuccess: '#16a34a',
53
+ textWarning: '#d97706',
54
+ // ── Neutral scale (Slate) ─────────────────────────────────────────────
55
+ neutral50: '#f8fafc',
56
+ neutral100: '#f1f5f9',
57
+ neutral200: '#e2e8f0',
58
+ neutral300: '#cbd5e1',
59
+ neutral400: '#94a3b8',
60
+ neutral500: '#64748b',
61
+ neutral600: '#475569',
62
+ neutral700: '#334155',
63
+ neutral800: '#1e293b',
64
+ neutral900: '#0f172a',
65
+ // ── On-color ──────────────────────────────────────────────────────────
21
66
  onPrimary: '#ffffff',
22
67
  onSecondary: '#ffffff',
23
- onBackground: '#212121',
24
- onSurface: '#424242',
68
+ onBackground: '#0f172a',
69
+ onSurface: '#475569',
25
70
  onError: '#ffffff',
71
+ // ── Focus ─────────────────────────────────────────────────────────────
72
+ focusRing: 'rgb(0 102 255 / 0.15)',
73
+ focusRingError: 'rgb(220 38 38 / 0.15)',
26
74
  };
@@ -1,13 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.motion = void 0;
4
+ /**
5
+ * Tokis motion tokens — durations and easing functions.
6
+ * These map to `--tokis-duration-{key}` and `--tokis-ease-{key}` CSS variables.
7
+ *
8
+ * Always reference via CSS variables rather than importing at runtime to
9
+ * preserve zero-runtime guarantee.
10
+ */
4
11
  exports.motion = {
12
+ // ── Durations ─────────────────────────────────────────────────────────
5
13
  duration: {
6
- fast: '150ms',
7
- normal: '300ms',
8
- slow: '500ms',
14
+ fast: '100ms', // micro-interactions (hover, focus ring)
15
+ normal: '200ms', // most transitions (color, opacity)
16
+ slow: '300ms', // larger state changes (dropdown, tooltip)
17
+ slower: '500ms', // complex animations (page-level, charts)
9
18
  },
19
+ // ── Easing curves ─────────────────────────────────────────────────────
10
20
  easing: {
21
+ easeIn: 'cubic-bezier(0.4, 0, 1, 1)',
22
+ easeOut: 'cubic-bezier(0, 0, 0.2, 1)',
11
23
  easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)',
24
+ spring: 'cubic-bezier(0.175, 0.885, 0.32, 1.275)',
12
25
  },
13
26
  };
@@ -1,10 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.radius = void 0;
4
+ /**
5
+ * Tokis border-radius tokens.
6
+ * These map to `--tokis-radius-{key}` CSS variables.
7
+ */
4
8
  exports.radius = {
5
9
  none: '0px',
6
- sm: '2px',
7
- md: '4px',
10
+ xs: '2px',
11
+ sm: '4px',
12
+ md: '6px',
8
13
  lg: '8px',
14
+ xl: '12px',
15
+ '2xl': '16px',
9
16
  full: '9999px',
10
17
  };
@@ -1,8 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.shadows = void 0;
4
+ /**
5
+ * Tokis box-shadow tokens.
6
+ * These map to `--tokis-shadow-{key}` CSS variables.
7
+ * All shadows use modern `rgb()` with `/` alpha syntax for correct rendering.
8
+ */
4
9
  exports.shadows = {
5
- sm: '0 1px 2px rgba(0,0,0,0.05)',
6
- md: '0 4px 6px rgba(0,0,0,0.1)',
7
- lg: '0 10px 15px rgba(0,0,0,0.15)',
10
+ xs: '0 1px 2px 0 rgb(0 0 0 / 0.05)',
11
+ sm: '0 1px 3px 0 rgb(0 0 0 / 0.10), 0 1px 2px -1px rgb(0 0 0 / 0.10)',
12
+ md: '0 4px 6px -1px rgb(0 0 0 / 0.10), 0 2px 4px -2px rgb(0 0 0 / 0.10)',
13
+ lg: '0 10px 15px -3px rgb(0 0 0 / 0.10), 0 4px 6px -4px rgb(0 0 0 / 0.10)',
14
+ xl: '0 20px 25px -5px rgb(0 0 0 / 0.10), 0 8px 10px -6px rgb(0 0 0 / 0.10)',
15
+ '2xl': '0 25px 50px -12px rgb(0 0 0 / 0.25)',
16
+ inner: 'inset 0 2px 4px 0 rgb(0 0 0 / 0.05)',
8
17
  };
@@ -1,10 +1,38 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.spacing = void 0;
4
+ /**
5
+ * Tokis spacing tokens.
6
+ * Uses a 4px base unit with numeric keys that map directly to
7
+ * `--tokis-spacing-{key}` CSS variables (e.g. `spacing[4]` → `--tokis-spacing-4`).
8
+ *
9
+ * Named aliases (xs/sm/md/lg/xl) are preserved for backward compatibility
10
+ * but numeric keys are the preferred form in component code.
11
+ */
4
12
  exports.spacing = {
13
+ // ── Numeric scale (4 px base) ─────────────────────────────────────────
14
+ 0: '0px',
15
+ 1: '4px',
16
+ 2: '8px',
17
+ 3: '12px',
18
+ 4: '16px',
19
+ 5: '20px',
20
+ 6: '24px',
21
+ 8: '32px',
22
+ 10: '40px',
23
+ 12: '48px',
24
+ 16: '64px',
25
+ 20: '80px',
26
+ 24: '96px',
27
+ // ── Named aliases (legacy / semantic) ────────────────────────────────
28
+ /** @deprecated Use numeric key `1` → 4px */
5
29
  xs: '4px',
30
+ /** @deprecated Use numeric key `2` → 8px */
6
31
  sm: '8px',
32
+ /** @deprecated Use numeric key `4` → 16px */
7
33
  md: '16px',
34
+ /** @deprecated Use numeric key `6` → 24px */
8
35
  lg: '24px',
36
+ /** @deprecated Use numeric key `8` → 32px */
9
37
  xl: '32px',
10
38
  };
@@ -1,18 +1,46 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.typography = void 0;
4
+ /**
5
+ * Tokis typography tokens.
6
+ * These map to `--tokis-font-*` CSS variables.
7
+ */
4
8
  exports.typography = {
5
- fontFamily: 'system-ui, sans-serif',
9
+ // ── Font families ─────────────────────────────────────────────────────
10
+ fontFamily: {
11
+ sans: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', Helvetica, Arial, sans-serif",
12
+ mono: "'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace",
13
+ },
14
+ // ── Font sizes ────────────────────────────────────────────────────────
6
15
  fontSize: {
7
- xs: '0.75rem',
8
- sm: '0.875rem',
9
- md: '1rem',
10
- lg: '1.125rem',
11
- xl: '1.25rem',
16
+ xs: '0.75rem', // 12px
17
+ sm: '0.875rem', // 14px
18
+ md: '1rem', // 16px
19
+ lg: '1.125rem', // 18px
20
+ xl: '1.25rem', // 20px
21
+ '2xl': '1.5rem', // 24px
22
+ '3xl': '1.875rem', // 30px
23
+ '4xl': '2.25rem', // 36px
12
24
  },
25
+ // ── Font weights ──────────────────────────────────────────────────────
13
26
  fontWeight: {
14
- normal: 400,
27
+ regular: 400,
15
28
  medium: 500,
29
+ semibold: 600,
16
30
  bold: 700,
31
+ /** @deprecated Use `semibold` (600) or `bold` (700) */
32
+ normal: 400,
33
+ },
34
+ // ── Line heights ──────────────────────────────────────────────────────
35
+ lineHeight: {
36
+ tight: 1.25,
37
+ normal: 1.5,
38
+ relaxed: 1.75,
39
+ },
40
+ // ── Letter spacing ────────────────────────────────────────────────────
41
+ letterSpacing: {
42
+ tight: '-0.025em',
43
+ normal: '0em',
44
+ wide: '0.025em',
17
45
  },
18
46
  };
@@ -1,8 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.zIndex = void 0;
4
+ /**
5
+ * Tokis z-index tokens — layering scale.
6
+ * These map to `--tokis-z-{key}` CSS variables.
7
+ *
8
+ * Layers are ordered by increasing elevation. Each layer is intentionally
9
+ * spaced to allow insertion of custom layers without breaking the scale.
10
+ */
4
11
  exports.zIndex = {
12
+ base: 0,
13
+ raised: 1,
5
14
  dropdown: 1000,
6
- modal: 2000,
7
- tooltip: 3000,
15
+ sticky: 1100,
16
+ overlay: 1200,
17
+ modal: 1300,
18
+ popover: 1400,
19
+ tooltip: 1500,
20
+ toast: 1600,
8
21
  };