@design-token-kit/core 0.1.2 → 0.2.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.
@@ -1,425 +1,425 @@
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": "tokenType.json"
13
- },
14
- "$ref": {
15
- "$ref": "../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": { "const": "color" }
68
- }
69
- },
70
- "then": {
71
- "properties": {
72
- "$value": {
73
- "oneOf": [
74
- {
75
- "$ref": "values/color.json"
76
- },
77
- {
78
- "$ref": "../format.json#/definitions/tokenValueReference"
79
- }
80
- ]
81
- }
82
- }
83
- }
84
- },
85
- {
86
- "if": {
87
- "required": ["$type"],
88
- "properties": {
89
- "$type": { "const": "dimension" }
90
- }
91
- },
92
- "then": {
93
- "properties": {
94
- "$value": {
95
- "oneOf": [
96
- {
97
- "$ref": "values/dimension.json"
98
- },
99
- {
100
- "$ref": "../format.json#/definitions/tokenValueReference"
101
- }
102
- ]
103
- }
104
- }
105
- }
106
- },
107
- {
108
- "if": {
109
- "required": ["$type"],
110
- "properties": {
111
- "$type": { "const": "fontFamily" }
112
- }
113
- },
114
- "then": {
115
- "properties": {
116
- "$value": {
117
- "oneOf": [
118
- {
119
- "$ref": "values/fontFamily.json"
120
- },
121
- {
122
- "$ref": "../format.json#/definitions/tokenValueReference"
123
- }
124
- ]
125
- }
126
- }
127
- }
128
- },
129
- {
130
- "if": {
131
- "required": ["$type"],
132
- "properties": {
133
- "$type": { "const": "fontWeight" }
134
- }
135
- },
136
- "then": {
137
- "properties": {
138
- "$value": {
139
- "oneOf": [
140
- {
141
- "$ref": "values/fontWeight.json"
142
- },
143
- {
144
- "$ref": "../format.json#/definitions/tokenValueReference"
145
- }
146
- ]
147
- }
148
- }
149
- }
150
- },
151
- {
152
- "if": {
153
- "required": ["$type"],
154
- "properties": {
155
- "$type": { "const": "duration" }
156
- }
157
- },
158
- "then": {
159
- "properties": {
160
- "$value": {
161
- "oneOf": [
162
- {
163
- "$ref": "values/duration.json"
164
- },
165
- {
166
- "$ref": "../format.json#/definitions/tokenValueReference"
167
- }
168
- ]
169
- }
170
- }
171
- }
172
- },
173
- {
174
- "if": {
175
- "required": ["$type"],
176
- "properties": {
177
- "$type": { "const": "cubicBezier" }
178
- }
179
- },
180
- "then": {
181
- "properties": {
182
- "$value": {
183
- "oneOf": [
184
- {
185
- "$ref": "values/cubicBezier.json"
186
- },
187
- {
188
- "$ref": "../format.json#/definitions/tokenValueReference"
189
- }
190
- ]
191
- }
192
- }
193
- }
194
- },
195
- {
196
- "if": {
197
- "required": ["$type"],
198
- "properties": {
199
- "$type": { "const": "number" }
200
- }
201
- },
202
- "then": {
203
- "properties": {
204
- "$value": {
205
- "oneOf": [
206
- {
207
- "$ref": "values/number.json"
208
- },
209
- {
210
- "$ref": "../format.json#/definitions/tokenValueReference"
211
- }
212
- ]
213
- }
214
- }
215
- }
216
- },
217
- {
218
- "if": {
219
- "required": ["$type"],
220
- "properties": {
221
- "$type": { "const": "strokeStyle" }
222
- }
223
- },
224
- "then": {
225
- "properties": {
226
- "$value": {
227
- "oneOf": [
228
- {
229
- "$ref": "values/strokeStyle.json"
230
- },
231
- {
232
- "$ref": "../format.json#/definitions/tokenValueReference"
233
- }
234
- ]
235
- }
236
- }
237
- }
238
- },
239
- {
240
- "if": {
241
- "required": ["$type"],
242
- "properties": {
243
- "$type": { "const": "border" }
244
- }
245
- },
246
- "then": {
247
- "properties": {
248
- "$value": {
249
- "oneOf": [
250
- {
251
- "$ref": "values/border.json"
252
- },
253
- {
254
- "$ref": "../format.json#/definitions/tokenValueReference"
255
- }
256
- ]
257
- }
258
- }
259
- }
260
- },
261
- {
262
- "if": {
263
- "required": ["$type"],
264
- "properties": {
265
- "$type": { "const": "transition" }
266
- }
267
- },
268
- "then": {
269
- "properties": {
270
- "$value": {
271
- "oneOf": [
272
- {
273
- "$ref": "values/transition.json"
274
- },
275
- {
276
- "$ref": "../format.json#/definitions/tokenValueReference"
277
- }
278
- ]
279
- }
280
- }
281
- }
282
- },
283
- {
284
- "if": {
285
- "required": ["$type"],
286
- "properties": {
287
- "$type": { "const": "shadow" }
288
- }
289
- },
290
- "then": {
291
- "properties": {
292
- "$value": {
293
- "oneOf": [
294
- {
295
- "$ref": "values/shadow.json"
296
- },
297
- {
298
- "$ref": "../format.json#/definitions/tokenValueReference"
299
- }
300
- ]
301
- }
302
- }
303
- }
304
- },
305
- {
306
- "if": {
307
- "required": ["$type"],
308
- "properties": {
309
- "$type": { "const": "gradient" }
310
- }
311
- },
312
- "then": {
313
- "properties": {
314
- "$value": {
315
- "oneOf": [
316
- {
317
- "$ref": "values/gradient.json"
318
- },
319
- {
320
- "$ref": "../format.json#/definitions/tokenValueReference"
321
- }
322
- ]
323
- }
324
- }
325
- }
326
- },
327
- {
328
- "if": {
329
- "required": ["$type"],
330
- "properties": {
331
- "$type": { "const": "typography" }
332
- }
333
- },
334
- "then": {
335
- "properties": {
336
- "$value": {
337
- "oneOf": [
338
- {
339
- "$ref": "values/typography.json"
340
- },
341
- {
342
- "$ref": "../format.json#/definitions/tokenValueReference"
343
- }
344
- ]
345
- }
346
- }
347
- }
348
- },
349
- {
350
- "if": {
351
- "allOf": [
352
- {
353
- "not": {
354
- "required": ["$type"]
355
- }
356
- },
357
- {
358
- "required": ["$value"]
359
- },
360
- {
361
- "properties": {
362
- "$value": {
363
- "not": {
364
- "$ref": "../format.json#/definitions/tokenValueReference"
365
- }
366
- }
367
- }
368
- }
369
- ]
370
- },
371
- "then": {
372
- "properties": {
373
- "$value": {
374
- "oneOf": [
375
- {
376
- "$ref": "values/color.json"
377
- },
378
- {
379
- "$ref": "values/dimension.json"
380
- },
381
- {
382
- "$ref": "values/fontFamily.json"
383
- },
384
- {
385
- "$ref": "values/duration.json"
386
- },
387
- {
388
- "$ref": "values/cubicBezier.json"
389
- },
390
- {
391
- "$ref": "values/strokeStyle.json"
392
- },
393
- {
394
- "$ref": "values/border.json"
395
- },
396
- {
397
- "$ref": "values/transition.json"
398
- },
399
- {
400
- "$ref": "values/shadow.json"
401
- },
402
- {
403
- "$ref": "values/gradient.json"
404
- },
405
- {
406
- "$ref": "values/typography.json"
407
- },
408
- {
409
- "anyOf": [
410
- {
411
- "$ref": "values/number.json"
412
- },
413
- {
414
- "$ref": "values/fontWeight.json"
415
- }
416
- ]
417
- }
418
- ]
419
- }
420
- }
421
- }
422
- }
423
- ]
424
- }
425
-
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": "tokenType.json"
13
+ },
14
+ "$ref": {
15
+ "$ref": "../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": { "const": "color" }
68
+ }
69
+ },
70
+ "then": {
71
+ "properties": {
72
+ "$value": {
73
+ "oneOf": [
74
+ {
75
+ "$ref": "values/color.json"
76
+ },
77
+ {
78
+ "$ref": "../format.json#/definitions/tokenValueReference"
79
+ }
80
+ ]
81
+ }
82
+ }
83
+ }
84
+ },
85
+ {
86
+ "if": {
87
+ "required": ["$type"],
88
+ "properties": {
89
+ "$type": { "const": "dimension" }
90
+ }
91
+ },
92
+ "then": {
93
+ "properties": {
94
+ "$value": {
95
+ "oneOf": [
96
+ {
97
+ "$ref": "values/dimension.json"
98
+ },
99
+ {
100
+ "$ref": "../format.json#/definitions/tokenValueReference"
101
+ }
102
+ ]
103
+ }
104
+ }
105
+ }
106
+ },
107
+ {
108
+ "if": {
109
+ "required": ["$type"],
110
+ "properties": {
111
+ "$type": { "const": "fontFamily" }
112
+ }
113
+ },
114
+ "then": {
115
+ "properties": {
116
+ "$value": {
117
+ "oneOf": [
118
+ {
119
+ "$ref": "values/fontFamily.json"
120
+ },
121
+ {
122
+ "$ref": "../format.json#/definitions/tokenValueReference"
123
+ }
124
+ ]
125
+ }
126
+ }
127
+ }
128
+ },
129
+ {
130
+ "if": {
131
+ "required": ["$type"],
132
+ "properties": {
133
+ "$type": { "const": "fontWeight" }
134
+ }
135
+ },
136
+ "then": {
137
+ "properties": {
138
+ "$value": {
139
+ "oneOf": [
140
+ {
141
+ "$ref": "values/fontWeight.json"
142
+ },
143
+ {
144
+ "$ref": "../format.json#/definitions/tokenValueReference"
145
+ }
146
+ ]
147
+ }
148
+ }
149
+ }
150
+ },
151
+ {
152
+ "if": {
153
+ "required": ["$type"],
154
+ "properties": {
155
+ "$type": { "const": "duration" }
156
+ }
157
+ },
158
+ "then": {
159
+ "properties": {
160
+ "$value": {
161
+ "oneOf": [
162
+ {
163
+ "$ref": "values/duration.json"
164
+ },
165
+ {
166
+ "$ref": "../format.json#/definitions/tokenValueReference"
167
+ }
168
+ ]
169
+ }
170
+ }
171
+ }
172
+ },
173
+ {
174
+ "if": {
175
+ "required": ["$type"],
176
+ "properties": {
177
+ "$type": { "const": "cubicBezier" }
178
+ }
179
+ },
180
+ "then": {
181
+ "properties": {
182
+ "$value": {
183
+ "oneOf": [
184
+ {
185
+ "$ref": "values/cubicBezier.json"
186
+ },
187
+ {
188
+ "$ref": "../format.json#/definitions/tokenValueReference"
189
+ }
190
+ ]
191
+ }
192
+ }
193
+ }
194
+ },
195
+ {
196
+ "if": {
197
+ "required": ["$type"],
198
+ "properties": {
199
+ "$type": { "const": "number" }
200
+ }
201
+ },
202
+ "then": {
203
+ "properties": {
204
+ "$value": {
205
+ "oneOf": [
206
+ {
207
+ "$ref": "values/number.json"
208
+ },
209
+ {
210
+ "$ref": "../format.json#/definitions/tokenValueReference"
211
+ }
212
+ ]
213
+ }
214
+ }
215
+ }
216
+ },
217
+ {
218
+ "if": {
219
+ "required": ["$type"],
220
+ "properties": {
221
+ "$type": { "const": "strokeStyle" }
222
+ }
223
+ },
224
+ "then": {
225
+ "properties": {
226
+ "$value": {
227
+ "oneOf": [
228
+ {
229
+ "$ref": "values/strokeStyle.json"
230
+ },
231
+ {
232
+ "$ref": "../format.json#/definitions/tokenValueReference"
233
+ }
234
+ ]
235
+ }
236
+ }
237
+ }
238
+ },
239
+ {
240
+ "if": {
241
+ "required": ["$type"],
242
+ "properties": {
243
+ "$type": { "const": "border" }
244
+ }
245
+ },
246
+ "then": {
247
+ "properties": {
248
+ "$value": {
249
+ "oneOf": [
250
+ {
251
+ "$ref": "values/border.json"
252
+ },
253
+ {
254
+ "$ref": "../format.json#/definitions/tokenValueReference"
255
+ }
256
+ ]
257
+ }
258
+ }
259
+ }
260
+ },
261
+ {
262
+ "if": {
263
+ "required": ["$type"],
264
+ "properties": {
265
+ "$type": { "const": "transition" }
266
+ }
267
+ },
268
+ "then": {
269
+ "properties": {
270
+ "$value": {
271
+ "oneOf": [
272
+ {
273
+ "$ref": "values/transition.json"
274
+ },
275
+ {
276
+ "$ref": "../format.json#/definitions/tokenValueReference"
277
+ }
278
+ ]
279
+ }
280
+ }
281
+ }
282
+ },
283
+ {
284
+ "if": {
285
+ "required": ["$type"],
286
+ "properties": {
287
+ "$type": { "const": "shadow" }
288
+ }
289
+ },
290
+ "then": {
291
+ "properties": {
292
+ "$value": {
293
+ "oneOf": [
294
+ {
295
+ "$ref": "values/shadow.json"
296
+ },
297
+ {
298
+ "$ref": "../format.json#/definitions/tokenValueReference"
299
+ }
300
+ ]
301
+ }
302
+ }
303
+ }
304
+ },
305
+ {
306
+ "if": {
307
+ "required": ["$type"],
308
+ "properties": {
309
+ "$type": { "const": "gradient" }
310
+ }
311
+ },
312
+ "then": {
313
+ "properties": {
314
+ "$value": {
315
+ "oneOf": [
316
+ {
317
+ "$ref": "values/gradient.json"
318
+ },
319
+ {
320
+ "$ref": "../format.json#/definitions/tokenValueReference"
321
+ }
322
+ ]
323
+ }
324
+ }
325
+ }
326
+ },
327
+ {
328
+ "if": {
329
+ "required": ["$type"],
330
+ "properties": {
331
+ "$type": { "const": "typography" }
332
+ }
333
+ },
334
+ "then": {
335
+ "properties": {
336
+ "$value": {
337
+ "oneOf": [
338
+ {
339
+ "$ref": "values/typography.json"
340
+ },
341
+ {
342
+ "$ref": "../format.json#/definitions/tokenValueReference"
343
+ }
344
+ ]
345
+ }
346
+ }
347
+ }
348
+ },
349
+ {
350
+ "if": {
351
+ "allOf": [
352
+ {
353
+ "not": {
354
+ "required": ["$type"]
355
+ }
356
+ },
357
+ {
358
+ "required": ["$value"]
359
+ },
360
+ {
361
+ "properties": {
362
+ "$value": {
363
+ "not": {
364
+ "$ref": "../format.json#/definitions/tokenValueReference"
365
+ }
366
+ }
367
+ }
368
+ }
369
+ ]
370
+ },
371
+ "then": {
372
+ "properties": {
373
+ "$value": {
374
+ "oneOf": [
375
+ {
376
+ "$ref": "values/color.json"
377
+ },
378
+ {
379
+ "$ref": "values/dimension.json"
380
+ },
381
+ {
382
+ "$ref": "values/fontFamily.json"
383
+ },
384
+ {
385
+ "$ref": "values/duration.json"
386
+ },
387
+ {
388
+ "$ref": "values/cubicBezier.json"
389
+ },
390
+ {
391
+ "$ref": "values/strokeStyle.json"
392
+ },
393
+ {
394
+ "$ref": "values/border.json"
395
+ },
396
+ {
397
+ "$ref": "values/transition.json"
398
+ },
399
+ {
400
+ "$ref": "values/shadow.json"
401
+ },
402
+ {
403
+ "$ref": "values/gradient.json"
404
+ },
405
+ {
406
+ "$ref": "values/typography.json"
407
+ },
408
+ {
409
+ "anyOf": [
410
+ {
411
+ "$ref": "values/number.json"
412
+ },
413
+ {
414
+ "$ref": "values/fontWeight.json"
415
+ }
416
+ ]
417
+ }
418
+ ]
419
+ }
420
+ }
421
+ }
422
+ }
423
+ ]
424
+ }
425
+