@loidolt/theme-tokens 0.2.0 → 0.4.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 ADDED
@@ -0,0 +1,16 @@
1
+ # @loidolt/theme-tokens
2
+
3
+ Typed design tokens and generated CSS custom properties for the Loidolt design system.
4
+
5
+ ```sh
6
+ npm install @loidolt/theme-tokens
7
+ ```
8
+
9
+ ```ts
10
+ import { colors, semantic, spacing, tokens } from '@loidolt/theme-tokens';
11
+ ```
12
+
13
+ ```css
14
+ @import '@loidolt/theme-tokens/css';
15
+ @import '@loidolt/theme-tokens/css/dark';
16
+ ```
@@ -5,6 +5,7 @@
5
5
  --loidolt-surface: #1e211c;
6
6
  --loidolt-surface-alt: #24271f;
7
7
  --loidolt-surface-sunken: #101210;
8
+ --loidolt-surface-paper: #ffffff;
8
9
  --loidolt-surface-inverse: #ebe7dc;
9
10
  --loidolt-surface-input: #24271f;
10
11
  --loidolt-text: #ebe7dc;
@@ -15,10 +16,12 @@
15
16
  --loidolt-border-soft: #2b2e26;
16
17
  --loidolt-border-strong: #6a6e5f;
17
18
  --loidolt-border-control: #787c6b;
19
+ --loidolt-border-sunken: #262922;
18
20
  --loidolt-accent: #e0672f;
19
21
  --loidolt-accent-hover: #f0895c;
20
22
  --loidolt-on-accent: #161814;
21
23
  --loidolt-danger: #d75f55;
24
+ --loidolt-danger-hover: #e07a70;
22
25
  --loidolt-on-danger: #161814;
23
26
  --loidolt-text-danger: #e88b81;
24
27
  --loidolt-success: #7fa074;
@@ -42,6 +45,7 @@
42
45
  --loidolt-surface: #1e211c;
43
46
  --loidolt-surface-alt: #24271f;
44
47
  --loidolt-surface-sunken: #101210;
48
+ --loidolt-surface-paper: #ffffff;
45
49
  --loidolt-surface-inverse: #ebe7dc;
46
50
  --loidolt-surface-input: #24271f;
47
51
  --loidolt-text: #ebe7dc;
@@ -52,10 +56,12 @@
52
56
  --loidolt-border-soft: #2b2e26;
53
57
  --loidolt-border-strong: #6a6e5f;
54
58
  --loidolt-border-control: #787c6b;
59
+ --loidolt-border-sunken: #262922;
55
60
  --loidolt-accent: #e0672f;
56
61
  --loidolt-accent-hover: #f0895c;
57
62
  --loidolt-on-accent: #161814;
58
63
  --loidolt-danger: #d75f55;
64
+ --loidolt-danger-hover: #e07a70;
59
65
  --loidolt-on-danger: #161814;
60
66
  --loidolt-text-danger: #e88b81;
61
67
  --loidolt-success: #7fa074;
package/dist/dark.css CHANGED
@@ -5,6 +5,7 @@
5
5
  --loidolt-surface: #1e211c;
6
6
  --loidolt-surface-alt: #24271f;
7
7
  --loidolt-surface-sunken: #101210;
8
+ --loidolt-surface-paper: #ffffff;
8
9
  --loidolt-surface-inverse: #ebe7dc;
9
10
  --loidolt-surface-input: #24271f;
10
11
  --loidolt-text: #ebe7dc;
@@ -15,10 +16,12 @@
15
16
  --loidolt-border-soft: #2b2e26;
16
17
  --loidolt-border-strong: #6a6e5f;
17
18
  --loidolt-border-control: #787c6b;
19
+ --loidolt-border-sunken: #262922;
18
20
  --loidolt-accent: #e0672f;
19
21
  --loidolt-accent-hover: #f0895c;
20
22
  --loidolt-on-accent: #161814;
21
23
  --loidolt-danger: #d75f55;
24
+ --loidolt-danger-hover: #e07a70;
22
25
  --loidolt-on-danger: #161814;
23
26
  --loidolt-text-danger: #e88b81;
24
27
  --loidolt-success: #7fa074;
package/dist/index.d.ts CHANGED
@@ -28,6 +28,7 @@ declare const colors: {
28
28
  readonly orange: "#c65224";
29
29
  readonly orangeDark: "#a9441d";
30
30
  readonly error: "#9b2822";
31
+ readonly errorDark: "#7f1f1a";
31
32
  readonly success: "#3f5139";
32
33
  readonly warning: "#7c4d17";
33
34
  readonly info: "#265162";
@@ -80,8 +81,8 @@ declare const sizing: {
80
81
  };
81
82
  declare const borders: {
82
83
  readonly width: "1px";
83
- readonly color: "#c8c1b1";
84
84
  readonly radius: "0px";
85
+ readonly radiusPill: "999px";
85
86
  };
86
87
  declare const shadows: {
87
88
  readonly popover: "0 12px 30px color-mix(in srgb, var(--loidolt-shadow-color) 18%, transparent)";
@@ -105,9 +106,19 @@ declare const zIndex: {
105
106
  readonly tooltip: "90";
106
107
  readonly skipLink: "1000";
107
108
  };
108
- /** Breakpoints are not custom properties (`@media` cannot read `var()`), but stay tokenized here. */
109
+ /**
110
+ * Breakpoints are not custom properties (`@media` cannot read `var()`), but stay tokenized here
111
+ * so an app and the library agree on where the layout changes.
112
+ *
113
+ * - `compact` — the phone/narrow-tablet break. The only one the package's own CSS uses: below
114
+ * it the workspace grid collapses to a single column and the sidebar becomes a stacked block.
115
+ * - `expanded` — where a sidebar plus content plus inspector all fit at once.
116
+ * - `wide` — where content stops growing and gutters take the extra room.
117
+ */
109
118
  declare const breakpoints: {
110
119
  readonly compact: "760px";
120
+ readonly expanded: "1024px";
121
+ readonly wide: "1400px";
111
122
  };
112
123
  /**
113
124
  * The role layer. Every value links to a primitive, so overriding a primitive propagates and
@@ -118,6 +129,8 @@ declare const semanticDefs: {
118
129
  readonly surface: TokenRef;
119
130
  readonly surfaceAlt: TokenRef;
120
131
  readonly surfaceSunken: TokenRef;
132
+ /** Artwork-on-paper backing: stays white in every theme so previews read true. */
133
+ readonly surfacePaper: TokenRef;
121
134
  readonly surfaceInverse: TokenRef;
122
135
  readonly surfaceInput: TokenRef;
123
136
  readonly text: TokenRef;
@@ -129,10 +142,13 @@ declare const semanticDefs: {
129
142
  readonly borderStrong: TokenRef;
130
143
  /** Boundary of an input, select, textarea or switch — held to 3:1 against its surface. */
131
144
  readonly borderControl: TokenRef;
145
+ /** Decorative rule on the sunken surface (canvas grids, artboard guides). Not a boundary. */
146
+ readonly borderSunken: TokenRef;
132
147
  readonly accent: TokenRef;
133
148
  readonly accentHover: TokenRef;
134
149
  readonly onAccent: TokenRef;
135
150
  readonly danger: TokenRef;
151
+ readonly dangerHover: TokenRef;
136
152
  readonly onDanger: TokenRef;
137
153
  readonly textDanger: TokenRef;
138
154
  readonly success: TokenRef;
@@ -168,6 +184,7 @@ declare const darkSemantic: {
168
184
  readonly surface: "#1e211c";
169
185
  readonly surfaceAlt: "#24271f";
170
186
  readonly surfaceSunken: "#101210";
187
+ readonly surfacePaper: "#ffffff";
171
188
  readonly surfaceInverse: "#ebe7dc";
172
189
  readonly surfaceInput: "#24271f";
173
190
  readonly text: "#ebe7dc";
@@ -178,10 +195,12 @@ declare const darkSemantic: {
178
195
  readonly borderSoft: "#2b2e26";
179
196
  readonly borderStrong: "#6a6e5f";
180
197
  readonly borderControl: "#787c6b";
198
+ readonly borderSunken: "#262922";
181
199
  readonly accent: "#e0672f";
182
200
  readonly accentHover: "#f0895c";
183
201
  readonly onAccent: "#161814";
184
202
  readonly danger: "#d75f55";
203
+ readonly dangerHover: "#e07a70";
185
204
  readonly onDanger: "#161814";
186
205
  readonly textDanger: "#e88b81";
187
206
  readonly success: "#7fa074";
@@ -220,6 +239,7 @@ declare const tokens: {
220
239
  readonly orange: "#c65224";
221
240
  readonly orangeDark: "#a9441d";
222
241
  readonly error: "#9b2822";
242
+ readonly errorDark: "#7f1f1a";
223
243
  readonly success: "#3f5139";
224
244
  readonly warning: "#7c4d17";
225
245
  readonly info: "#265162";
@@ -272,8 +292,8 @@ declare const tokens: {
272
292
  };
273
293
  readonly borders: {
274
294
  readonly width: "1px";
275
- readonly color: "#c8c1b1";
276
295
  readonly radius: "0px";
296
+ readonly radiusPill: "999px";
277
297
  };
278
298
  readonly shadows: {
279
299
  readonly popover: "0 12px 30px color-mix(in srgb, var(--loidolt-shadow-color) 18%, transparent)";
@@ -299,12 +319,15 @@ declare const tokens: {
299
319
  };
300
320
  readonly breakpoints: {
301
321
  readonly compact: "760px";
322
+ readonly expanded: "1024px";
323
+ readonly wide: "1400px";
302
324
  };
303
325
  readonly semantic: {
304
326
  readonly background: string;
305
327
  readonly surface: string;
306
328
  readonly surfaceAlt: string;
307
329
  readonly surfaceSunken: string;
330
+ readonly surfacePaper: string;
308
331
  readonly surfaceInverse: string;
309
332
  readonly surfaceInput: string;
310
333
  readonly text: string;
@@ -315,10 +338,12 @@ declare const tokens: {
315
338
  readonly borderSoft: string;
316
339
  readonly borderStrong: string;
317
340
  readonly borderControl: string;
341
+ readonly borderSunken: string;
318
342
  readonly accent: string;
319
343
  readonly accentHover: string;
320
344
  readonly onAccent: string;
321
345
  readonly danger: string;
346
+ readonly dangerHover: string;
322
347
  readonly onDanger: string;
323
348
  readonly textDanger: string;
324
349
  readonly success: string;
@@ -339,6 +364,7 @@ declare const tokens: {
339
364
  readonly surface: "#1e211c";
340
365
  readonly surfaceAlt: "#24271f";
341
366
  readonly surfaceSunken: "#101210";
367
+ readonly surfacePaper: "#ffffff";
342
368
  readonly surfaceInverse: "#ebe7dc";
343
369
  readonly surfaceInput: "#24271f";
344
370
  readonly text: "#ebe7dc";
@@ -349,10 +375,12 @@ declare const tokens: {
349
375
  readonly borderSoft: "#2b2e26";
350
376
  readonly borderStrong: "#6a6e5f";
351
377
  readonly borderControl: "#787c6b";
378
+ readonly borderSunken: "#262922";
352
379
  readonly accent: "#e0672f";
353
380
  readonly accentHover: "#f0895c";
354
381
  readonly onAccent: "#161814";
355
382
  readonly danger: "#d75f55";
383
+ readonly dangerHover: "#e07a70";
356
384
  readonly onDanger: "#161814";
357
385
  readonly textDanger: "#e88b81";
358
386
  readonly success: "#7fa074";
package/dist/index.js CHANGED
@@ -20,6 +20,7 @@ var colors = {
20
20
  orange: "#c65224",
21
21
  orangeDark: "#a9441d",
22
22
  error: "#9b2822",
23
+ errorDark: "#7f1f1a",
23
24
  success: "#3f5139",
24
25
  warning: "#7c4d17",
25
26
  info: "#265162"
@@ -63,7 +64,7 @@ var sizing = {
63
64
  inspector: "18rem",
64
65
  content: "75rem"
65
66
  };
66
- var borders = { width: "1px", color: colors.line, radius: "0px" };
67
+ var borders = { width: "1px", radius: "0px", radiusPill: "999px" };
67
68
  var shadows = {
68
69
  popover: "0 12px 30px color-mix(in srgb, var(--loidolt-shadow-color) 18%, transparent)",
69
70
  modal: "0 24px 60px color-mix(in srgb, var(--loidolt-shadow-color) 24%, transparent)",
@@ -86,12 +87,14 @@ var zIndex = {
86
87
  tooltip: "90",
87
88
  skipLink: "1000"
88
89
  };
89
- var breakpoints = { compact: "760px" };
90
+ var breakpoints = { compact: "760px", expanded: "1024px", wide: "1400px" };
90
91
  var semanticDefs = {
91
92
  background: ref("color-paper"),
92
93
  surface: ref("color-panel"),
93
94
  surfaceAlt: ref("color-panel-alt"),
94
95
  surfaceSunken: ref("color-canvas"),
96
+ /** Artwork-on-paper backing: stays white in every theme so previews read true. */
97
+ surfacePaper: ref("color-white"),
95
98
  surfaceInverse: ref("color-deep"),
96
99
  surfaceInput: ref("color-white"),
97
100
  text: ref("color-deep"),
@@ -103,6 +106,8 @@ var semanticDefs = {
103
106
  borderStrong: ref("color-deep"),
104
107
  /** Boundary of an input, select, textarea or switch — held to 3:1 against its surface. */
105
108
  borderControl: ref("color-line-strong"),
109
+ /** Decorative rule on the sunken surface (canvas grids, artboard guides). Not a boundary. */
110
+ borderSunken: ref("color-canvas-line"),
106
111
  accent: ref("color-orange"),
107
112
  accentHover: ref("color-orange-dark"),
108
113
  onAccent: ref("color-white"),
@@ -112,6 +117,7 @@ var semanticDefs = {
112
117
  * value: a fill tuned for white ink is too light to read as text, and vice versa.
113
118
  */
114
119
  danger: ref("color-error"),
120
+ dangerHover: ref("color-error-dark"),
115
121
  onDanger: ref("color-white"),
116
122
  textDanger: ref("color-error"),
117
123
  success: ref("color-success"),
@@ -132,7 +138,7 @@ var PRIMITIVE_GROUPS = [
132
138
  ["font", typography],
133
139
  ["space", spacing],
134
140
  ["size", sizing],
135
- ["border", { width: borders.width, color: ref("color-line"), radius: borders.radius }],
141
+ ["border", borders],
136
142
  ["shadow", shadows],
137
143
  ["motion", motion],
138
144
  ["z", zIndex]
@@ -175,6 +181,7 @@ var darkSemantic = {
175
181
  surface: "#1e211c",
176
182
  surfaceAlt: "#24271f",
177
183
  surfaceSunken: "#101210",
184
+ surfacePaper: "#ffffff",
178
185
  surfaceInverse: "#ebe7dc",
179
186
  surfaceInput: "#24271f",
180
187
  text: "#ebe7dc",
@@ -185,10 +192,12 @@ var darkSemantic = {
185
192
  borderSoft: "#2b2e26",
186
193
  borderStrong: "#6a6e5f",
187
194
  borderControl: "#787c6b",
195
+ borderSunken: "#262922",
188
196
  accent: "#e0672f",
189
197
  accentHover: "#f0895c",
190
198
  onAccent: "#161814",
191
199
  danger: "#d75f55",
200
+ dangerHover: "#e07a70",
192
201
  onDanger: "#161814",
193
202
  textDanger: "#e88b81",
194
203
  success: "#7fa074",
package/dist/tokens.css CHANGED
@@ -14,6 +14,7 @@
14
14
  --loidolt-color-orange: #c65224;
15
15
  --loidolt-color-orange-dark: #a9441d;
16
16
  --loidolt-color-error: #9b2822;
17
+ --loidolt-color-error-dark: #7f1f1a;
17
18
  --loidolt-color-success: #3f5139;
18
19
  --loidolt-color-warning: #7c4d17;
19
20
  --loidolt-color-info: #265162;
@@ -52,8 +53,8 @@
52
53
  --loidolt-size-inspector: 18rem;
53
54
  --loidolt-size-content: 75rem;
54
55
  --loidolt-border-width: 1px;
55
- --loidolt-border-color: var(--loidolt-color-line);
56
56
  --loidolt-border-radius: 0px;
57
+ --loidolt-border-radius-pill: 999px;
57
58
  --loidolt-shadow-popover: 0 12px 30px color-mix(in srgb, var(--loidolt-shadow-color) 18%, transparent);
58
59
  --loidolt-shadow-modal: 0 24px 60px color-mix(in srgb, var(--loidolt-shadow-color) 24%, transparent);
59
60
  --loidolt-shadow-artwork: 0 18px 23px color-mix(in srgb, var(--loidolt-shadow-color) 14%, transparent);
@@ -74,6 +75,7 @@
74
75
  --loidolt-surface: var(--loidolt-color-panel);
75
76
  --loidolt-surface-alt: var(--loidolt-color-panel-alt);
76
77
  --loidolt-surface-sunken: var(--loidolt-color-canvas);
78
+ --loidolt-surface-paper: var(--loidolt-color-white);
77
79
  --loidolt-surface-inverse: var(--loidolt-color-deep);
78
80
  --loidolt-surface-input: var(--loidolt-color-white);
79
81
  --loidolt-text: var(--loidolt-color-deep);
@@ -84,10 +86,12 @@
84
86
  --loidolt-border-soft: var(--loidolt-color-line-soft);
85
87
  --loidolt-border-strong: var(--loidolt-color-deep);
86
88
  --loidolt-border-control: var(--loidolt-color-line-strong);
89
+ --loidolt-border-sunken: var(--loidolt-color-canvas-line);
87
90
  --loidolt-accent: var(--loidolt-color-orange);
88
91
  --loidolt-accent-hover: var(--loidolt-color-orange-dark);
89
92
  --loidolt-on-accent: var(--loidolt-color-white);
90
93
  --loidolt-danger: var(--loidolt-color-error);
94
+ --loidolt-danger-hover: var(--loidolt-color-error-dark);
91
95
  --loidolt-on-danger: var(--loidolt-color-white);
92
96
  --loidolt-text-danger: var(--loidolt-color-error);
93
97
  --loidolt-success: var(--loidolt-color-success);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loidolt/theme-tokens",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Typed design tokens for Loidolt applications",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -23,11 +23,9 @@
23
23
  "sideEffects": [
24
24
  "**/*.css"
25
25
  ],
26
- "engines": {
27
- "node": ">=22"
28
- },
29
26
  "scripts": {
30
27
  "build": "tsup src/index.ts --format esm --dts --clean && node scripts/generate-css.mjs",
28
+ "prepack": "npm run build",
31
29
  "typecheck": "tsc --noEmit",
32
30
  "test": "vitest run",
33
31
  "clean": "rimraf dist"