@valancex/style 0.0.0-stage → 0.14.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 (64) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +33 -2
  3. package/contract/style-contract-v1.json +207 -0
  4. package/dist/check.d.ts +31 -0
  5. package/dist/check.js +250 -0
  6. package/dist/color.d.ts +17 -0
  7. package/dist/color.js +82 -0
  8. package/dist/contrast.d.ts +5 -0
  9. package/dist/contrast.js +13 -0
  10. package/dist/coverage.d.ts +21 -0
  11. package/dist/coverage.js +60 -0
  12. package/dist/css.d.ts +9 -0
  13. package/dist/css.js +201 -0
  14. package/dist/desktop.d.ts +33 -0
  15. package/dist/desktop.js +112 -0
  16. package/dist/index.d.ts +17 -0
  17. package/dist/index.js +11 -0
  18. package/dist/load.d.ts +5 -0
  19. package/dist/load.js +8 -0
  20. package/dist/primitives.d.ts +2 -0
  21. package/dist/primitives.js +364 -0
  22. package/dist/suggest.d.ts +2 -0
  23. package/dist/suggest.js +22 -0
  24. package/dist/theme.d.ts +5 -0
  25. package/dist/theme.js +129 -0
  26. package/dist/tokens.d.ts +21 -0
  27. package/dist/tokens.js +257 -0
  28. package/dist/types.d.ts +114 -0
  29. package/dist/types.js +3 -0
  30. package/package.json +64 -3
  31. package/schema/dtcg-2025.10/NOTICE.md +6 -0
  32. package/schema/dtcg-2025.10/format/group.json +54 -0
  33. package/schema/dtcg-2025.10/format/groupOrToken.json +14 -0
  34. package/schema/dtcg-2025.10/format/token.json +450 -0
  35. package/schema/dtcg-2025.10/format/tokenType.json +22 -0
  36. package/schema/dtcg-2025.10/format/values/border.json +44 -0
  37. package/schema/dtcg-2025.10/format/values/color.json +570 -0
  38. package/schema/dtcg-2025.10/format/values/cubicBezier.json +56 -0
  39. package/schema/dtcg-2025.10/format/values/dimension.json +34 -0
  40. package/schema/dtcg-2025.10/format/values/duration.json +34 -0
  41. package/schema/dtcg-2025.10/format/values/fontFamily.json +33 -0
  42. package/schema/dtcg-2025.10/format/values/fontWeight.json +38 -0
  43. package/schema/dtcg-2025.10/format/values/gradient.json +52 -0
  44. package/schema/dtcg-2025.10/format/values/number.json +7 -0
  45. package/schema/dtcg-2025.10/format/values/shadow.json +102 -0
  46. package/schema/dtcg-2025.10/format/values/strokeStyle.json +63 -0
  47. package/schema/dtcg-2025.10/format/values/transition.json +44 -0
  48. package/schema/dtcg-2025.10/format/values/typography.json +72 -0
  49. package/schema/dtcg-2025.10/format.json +105 -0
  50. package/schema/recipe-v1.schema.json +43 -0
  51. package/schema/style-contract-v1.schema.json +171 -0
  52. package/schema/theme-v1.schema.json +78 -0
  53. package/themes/default/recipes/button.json +87 -0
  54. package/themes/default/recipes/checkbox.json +26 -0
  55. package/themes/default/recipes/column.json +10 -0
  56. package/themes/default/recipes/heading.json +11 -0
  57. package/themes/default/recipes/row.json +10 -0
  58. package/themes/default/recipes/text.json +12 -0
  59. package/themes/default/recipes/textfield.json +37 -0
  60. package/themes/default/theme.json +61 -0
  61. package/themes/default/tokens/base.tokens.json +193 -0
  62. package/themes/default/tokens/contrast.tokens.json +127 -0
  63. package/themes/default/tokens/dark.tokens.json +127 -0
  64. package/themes/default/tokens/light.tokens.json +127 -0
@@ -0,0 +1,450 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://www.designtokens.org/schemas/2025.10/format/token.json",
4
+ "title": "Token",
5
+ "description": "A token in the DTCG specification",
6
+ "type": "object",
7
+ "properties": {
8
+ "$value": {
9
+ "description": "The token's value - can be a direct value or a reference to another token using curly brace syntax (e.g., '{token.name}'). Mutually exclusive with $ref."
10
+ },
11
+ "$type": {
12
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/tokenType.json"
13
+ },
14
+ "$ref": {
15
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format.json#/definitions/jsonPointerReference",
16
+ "description": "JSON Pointer reference (RFC 6901) for advanced referencing. Use this instead of $value for property-level references. Examples: '#/colors/blue/$value' or '#/colors/blue/$value/components/0'. Mutually exclusive with $value."
17
+ },
18
+ "$description": {
19
+ "type": "string",
20
+ "description": "A plain text description of the token"
21
+ },
22
+ "$extensions": {
23
+ "type": "object",
24
+ "description": "Vendor-specific extensions"
25
+ },
26
+ "$deprecated": {
27
+ "oneOf": [
28
+ {
29
+ "type": "boolean"
30
+ },
31
+ {
32
+ "type": "string"
33
+ }
34
+ ],
35
+ "description": "Whether this token is deprecated"
36
+ }
37
+ },
38
+ "additionalProperties": false,
39
+ "allOf": [
40
+ {
41
+ "description": "Tokens cannot define both $value and $ref; they must choose exactly one form of reference or direct value.",
42
+ "if": {
43
+ "required": ["$value"],
44
+ "properties": {
45
+ "$value": true
46
+ }
47
+ },
48
+ "then": {
49
+ "not": {
50
+ "required": ["$ref"],
51
+ "properties": {
52
+ "$ref": true
53
+ }
54
+ }
55
+ },
56
+ "else": {
57
+ "required": ["$ref"],
58
+ "properties": {
59
+ "$ref": true
60
+ }
61
+ }
62
+ },
63
+ {
64
+ "if": {
65
+ "required": ["$type"],
66
+ "properties": {
67
+ "$type": {
68
+ "const": "color"
69
+ }
70
+ }
71
+ },
72
+ "then": {
73
+ "properties": {
74
+ "$value": {
75
+ "oneOf": [
76
+ {
77
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/color.json"
78
+ },
79
+ {
80
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format.json#/definitions/tokenValueReference"
81
+ }
82
+ ]
83
+ }
84
+ }
85
+ }
86
+ },
87
+ {
88
+ "if": {
89
+ "required": ["$type"],
90
+ "properties": {
91
+ "$type": {
92
+ "const": "dimension"
93
+ }
94
+ }
95
+ },
96
+ "then": {
97
+ "properties": {
98
+ "$value": {
99
+ "oneOf": [
100
+ {
101
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/dimension.json"
102
+ },
103
+ {
104
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format.json#/definitions/tokenValueReference"
105
+ }
106
+ ]
107
+ }
108
+ }
109
+ }
110
+ },
111
+ {
112
+ "if": {
113
+ "required": ["$type"],
114
+ "properties": {
115
+ "$type": {
116
+ "const": "fontFamily"
117
+ }
118
+ }
119
+ },
120
+ "then": {
121
+ "properties": {
122
+ "$value": {
123
+ "oneOf": [
124
+ {
125
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/fontFamily.json"
126
+ },
127
+ {
128
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format.json#/definitions/tokenValueReference"
129
+ }
130
+ ]
131
+ }
132
+ }
133
+ }
134
+ },
135
+ {
136
+ "if": {
137
+ "required": ["$type"],
138
+ "properties": {
139
+ "$type": {
140
+ "const": "fontWeight"
141
+ }
142
+ }
143
+ },
144
+ "then": {
145
+ "properties": {
146
+ "$value": {
147
+ "oneOf": [
148
+ {
149
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/fontWeight.json"
150
+ },
151
+ {
152
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format.json#/definitions/tokenValueReference"
153
+ }
154
+ ]
155
+ }
156
+ }
157
+ }
158
+ },
159
+ {
160
+ "if": {
161
+ "required": ["$type"],
162
+ "properties": {
163
+ "$type": {
164
+ "const": "duration"
165
+ }
166
+ }
167
+ },
168
+ "then": {
169
+ "properties": {
170
+ "$value": {
171
+ "oneOf": [
172
+ {
173
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/duration.json"
174
+ },
175
+ {
176
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format.json#/definitions/tokenValueReference"
177
+ }
178
+ ]
179
+ }
180
+ }
181
+ }
182
+ },
183
+ {
184
+ "if": {
185
+ "required": ["$type"],
186
+ "properties": {
187
+ "$type": {
188
+ "const": "cubicBezier"
189
+ }
190
+ }
191
+ },
192
+ "then": {
193
+ "properties": {
194
+ "$value": {
195
+ "oneOf": [
196
+ {
197
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/cubicBezier.json"
198
+ },
199
+ {
200
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format.json#/definitions/tokenValueReference"
201
+ }
202
+ ]
203
+ }
204
+ }
205
+ }
206
+ },
207
+ {
208
+ "if": {
209
+ "required": ["$type"],
210
+ "properties": {
211
+ "$type": {
212
+ "const": "number"
213
+ }
214
+ }
215
+ },
216
+ "then": {
217
+ "properties": {
218
+ "$value": {
219
+ "oneOf": [
220
+ {
221
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/number.json"
222
+ },
223
+ {
224
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format.json#/definitions/tokenValueReference"
225
+ }
226
+ ]
227
+ }
228
+ }
229
+ }
230
+ },
231
+ {
232
+ "if": {
233
+ "required": ["$type"],
234
+ "properties": {
235
+ "$type": {
236
+ "const": "strokeStyle"
237
+ }
238
+ }
239
+ },
240
+ "then": {
241
+ "properties": {
242
+ "$value": {
243
+ "oneOf": [
244
+ {
245
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/strokeStyle.json"
246
+ },
247
+ {
248
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format.json#/definitions/tokenValueReference"
249
+ }
250
+ ]
251
+ }
252
+ }
253
+ }
254
+ },
255
+ {
256
+ "if": {
257
+ "required": ["$type"],
258
+ "properties": {
259
+ "$type": {
260
+ "const": "border"
261
+ }
262
+ }
263
+ },
264
+ "then": {
265
+ "properties": {
266
+ "$value": {
267
+ "oneOf": [
268
+ {
269
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/border.json"
270
+ },
271
+ {
272
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format.json#/definitions/tokenValueReference"
273
+ }
274
+ ]
275
+ }
276
+ }
277
+ }
278
+ },
279
+ {
280
+ "if": {
281
+ "required": ["$type"],
282
+ "properties": {
283
+ "$type": {
284
+ "const": "transition"
285
+ }
286
+ }
287
+ },
288
+ "then": {
289
+ "properties": {
290
+ "$value": {
291
+ "oneOf": [
292
+ {
293
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/transition.json"
294
+ },
295
+ {
296
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format.json#/definitions/tokenValueReference"
297
+ }
298
+ ]
299
+ }
300
+ }
301
+ }
302
+ },
303
+ {
304
+ "if": {
305
+ "required": ["$type"],
306
+ "properties": {
307
+ "$type": {
308
+ "const": "shadow"
309
+ }
310
+ }
311
+ },
312
+ "then": {
313
+ "properties": {
314
+ "$value": {
315
+ "oneOf": [
316
+ {
317
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/shadow.json"
318
+ },
319
+ {
320
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format.json#/definitions/tokenValueReference"
321
+ }
322
+ ]
323
+ }
324
+ }
325
+ }
326
+ },
327
+ {
328
+ "if": {
329
+ "required": ["$type"],
330
+ "properties": {
331
+ "$type": {
332
+ "const": "gradient"
333
+ }
334
+ }
335
+ },
336
+ "then": {
337
+ "properties": {
338
+ "$value": {
339
+ "oneOf": [
340
+ {
341
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/gradient.json"
342
+ },
343
+ {
344
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format.json#/definitions/tokenValueReference"
345
+ }
346
+ ]
347
+ }
348
+ }
349
+ }
350
+ },
351
+ {
352
+ "if": {
353
+ "required": ["$type"],
354
+ "properties": {
355
+ "$type": {
356
+ "const": "typography"
357
+ }
358
+ }
359
+ },
360
+ "then": {
361
+ "properties": {
362
+ "$value": {
363
+ "oneOf": [
364
+ {
365
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/typography.json"
366
+ },
367
+ {
368
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format.json#/definitions/tokenValueReference"
369
+ }
370
+ ]
371
+ }
372
+ }
373
+ }
374
+ },
375
+ {
376
+ "if": {
377
+ "allOf": [
378
+ {
379
+ "not": {
380
+ "required": ["$type"]
381
+ }
382
+ },
383
+ {
384
+ "required": ["$value"]
385
+ },
386
+ {
387
+ "properties": {
388
+ "$value": {
389
+ "not": {
390
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format.json#/definitions/tokenValueReference"
391
+ }
392
+ }
393
+ }
394
+ }
395
+ ]
396
+ },
397
+ "then": {
398
+ "properties": {
399
+ "$value": {
400
+ "oneOf": [
401
+ {
402
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/color.json"
403
+ },
404
+ {
405
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/dimension.json"
406
+ },
407
+ {
408
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/fontFamily.json"
409
+ },
410
+ {
411
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/duration.json"
412
+ },
413
+ {
414
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/cubicBezier.json"
415
+ },
416
+ {
417
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/strokeStyle.json"
418
+ },
419
+ {
420
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/border.json"
421
+ },
422
+ {
423
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/transition.json"
424
+ },
425
+ {
426
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/shadow.json"
427
+ },
428
+ {
429
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/gradient.json"
430
+ },
431
+ {
432
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/typography.json"
433
+ },
434
+ {
435
+ "anyOf": [
436
+ {
437
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/number.json"
438
+ },
439
+ {
440
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/fontWeight.json"
441
+ }
442
+ ]
443
+ }
444
+ ]
445
+ }
446
+ }
447
+ }
448
+ }
449
+ ]
450
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://www.designtokens.org/schemas/2025.10/format/tokenType.json",
4
+ "title": "TokenType",
5
+ "description": "A token type in the DTCG specification",
6
+ "type": "string",
7
+ "enum": [
8
+ "color",
9
+ "dimension",
10
+ "fontFamily",
11
+ "fontWeight",
12
+ "duration",
13
+ "cubicBezier",
14
+ "number",
15
+ "strokeStyle",
16
+ "border",
17
+ "transition",
18
+ "shadow",
19
+ "gradient",
20
+ "typography"
21
+ ]
22
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://www.designtokens.org/schemas/2025.10/format/values/border.json",
4
+ "title": "Border Value",
5
+ "description": "Value schema for border type tokens. Represents a border style.",
6
+ "type": "object",
7
+ "properties": {
8
+ "color": {
9
+ "description": "The color of the border",
10
+ "oneOf": [
11
+ {
12
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/color.json"
13
+ },
14
+ {
15
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format.json#/definitions/tokenValueReference"
16
+ }
17
+ ]
18
+ },
19
+ "width": {
20
+ "description": "The width or thickness of the border",
21
+ "oneOf": [
22
+ {
23
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/dimension.json"
24
+ },
25
+ {
26
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format.json#/definitions/tokenValueReference"
27
+ }
28
+ ]
29
+ },
30
+ "style": {
31
+ "description": "The border's style",
32
+ "oneOf": [
33
+ {
34
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format/values/strokeStyle.json"
35
+ },
36
+ {
37
+ "$ref": "https://www.designtokens.org/schemas/2025.10/format.json#/definitions/tokenValueReference"
38
+ }
39
+ ]
40
+ }
41
+ },
42
+ "required": ["color", "width", "style"],
43
+ "additionalProperties": false
44
+ }