@adobe/design-system-registry 1.1.0 → 1.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/CHANGELOG.md +26 -0
- package/LICENSE +201 -0
- package/index.js +28 -0
- package/package.json +17 -11
- package/registry/anatomy-terms.json +169 -55
- package/registry/densities.json +17 -0
- package/registry/orientations.json +17 -0
- package/registry/positions.json +32 -0
- package/registry/scale-values.json +35 -0
- package/registry/shapes.json +12 -0
- package/registry/sizes.json +27 -108
- package/registry/states.json +1 -1
- package/registry/structures.json +27 -0
- package/registry/substructures.json +12 -0
- package/registry/token-objects.json +32 -0
- package/registry/token-terminology.json +714 -0
- package/registry/variants.json +106 -0
- package/test/registry.test.js +100 -2
package/registry/variants.json
CHANGED
|
@@ -171,6 +171,112 @@
|
|
|
171
171
|
"description": "Designed to be used over backgrounds",
|
|
172
172
|
"category": "context",
|
|
173
173
|
"usedIn": ["component-schemas"]
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"id": "brown",
|
|
177
|
+
"label": "Brown",
|
|
178
|
+
"description": "Brown color variant",
|
|
179
|
+
"category": "color",
|
|
180
|
+
"usedIn": ["tokens"]
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"id": "cinnamon",
|
|
184
|
+
"label": "Cinnamon",
|
|
185
|
+
"description": "Cinnamon color variant",
|
|
186
|
+
"category": "color",
|
|
187
|
+
"usedIn": ["tokens"]
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"id": "silver",
|
|
191
|
+
"label": "Silver",
|
|
192
|
+
"description": "Silver color variant",
|
|
193
|
+
"category": "color",
|
|
194
|
+
"usedIn": ["tokens"]
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"id": "subtle",
|
|
198
|
+
"label": "Subtle",
|
|
199
|
+
"description": "Reduced emphasis variant for less prominent surfaces",
|
|
200
|
+
"category": "emphasis",
|
|
201
|
+
"usedIn": ["tokens"]
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"id": "subdued",
|
|
205
|
+
"label": "Subdued",
|
|
206
|
+
"description": "Lower emphasis variant for quieter backgrounds",
|
|
207
|
+
"category": "emphasis",
|
|
208
|
+
"usedIn": ["tokens"]
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"id": "static",
|
|
212
|
+
"label": "Static",
|
|
213
|
+
"description": "Context variant indicating the token does not change with theme",
|
|
214
|
+
"category": "context",
|
|
215
|
+
"usedIn": ["tokens"]
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"id": "inverse",
|
|
219
|
+
"label": "Inverse",
|
|
220
|
+
"description": "Inverted color context variant",
|
|
221
|
+
"category": "context",
|
|
222
|
+
"usedIn": ["tokens"]
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"id": "black",
|
|
226
|
+
"label": "Black",
|
|
227
|
+
"description": "Black color modifier, typically used with static context",
|
|
228
|
+
"category": "color",
|
|
229
|
+
"usedIn": ["tokens"]
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"id": "white",
|
|
233
|
+
"label": "White",
|
|
234
|
+
"description": "White color modifier, typically used with static context",
|
|
235
|
+
"category": "color",
|
|
236
|
+
"usedIn": ["tokens"]
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"id": "turquoise",
|
|
240
|
+
"label": "Turquoise",
|
|
241
|
+
"description": "Turquoise color variant",
|
|
242
|
+
"category": "color",
|
|
243
|
+
"usedIn": ["tokens"]
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"id": "confirmation",
|
|
247
|
+
"label": "Confirmation",
|
|
248
|
+
"description": "Confirmation dialog variant requiring user acknowledgement",
|
|
249
|
+
"category": "semantic",
|
|
250
|
+
"usedIn": ["component-schemas"]
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"id": "destructive",
|
|
254
|
+
"label": "Destructive",
|
|
255
|
+
"description": "Destructive action dialog variant (stronger than negative)",
|
|
256
|
+
"category": "semantic",
|
|
257
|
+
"usedIn": ["component-schemas"]
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"id": "warning",
|
|
261
|
+
"label": "Warning",
|
|
262
|
+
"description": "Warning dialog variant for cautionary alerts",
|
|
263
|
+
"category": "semantic",
|
|
264
|
+
"usedIn": ["component-schemas"]
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"id": "error",
|
|
268
|
+
"label": "Error",
|
|
269
|
+
"description": "Error state variant for failed operations",
|
|
270
|
+
"category": "semantic",
|
|
271
|
+
"usedIn": ["component-schemas"]
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"id": "information",
|
|
275
|
+
"label": "Information",
|
|
276
|
+
"aliases": ["info"],
|
|
277
|
+
"description": "Informational dialog variant (alias for informative in alert contexts)",
|
|
278
|
+
"category": "semantic",
|
|
279
|
+
"usedIn": ["component-schemas"]
|
|
174
280
|
}
|
|
175
281
|
]
|
|
176
282
|
}
|
package/test/registry.test.js
CHANGED
|
@@ -20,6 +20,13 @@ import {
|
|
|
20
20
|
scaleValues,
|
|
21
21
|
categories,
|
|
22
22
|
platforms,
|
|
23
|
+
tokenObjects,
|
|
24
|
+
structures,
|
|
25
|
+
substructures,
|
|
26
|
+
orientations,
|
|
27
|
+
positions,
|
|
28
|
+
densities,
|
|
29
|
+
shapes,
|
|
23
30
|
getValues,
|
|
24
31
|
findValue,
|
|
25
32
|
hasValue,
|
|
@@ -226,6 +233,13 @@ test("sizes includes common t-shirt sizes", (t) => {
|
|
|
226
233
|
t.true(ids.includes("xl"));
|
|
227
234
|
});
|
|
228
235
|
|
|
236
|
+
test("sizes does not contain numeric scale values", (t) => {
|
|
237
|
+
const ids = getValues(sizes);
|
|
238
|
+
t.false(ids.includes("50"));
|
|
239
|
+
t.false(ids.includes("100"));
|
|
240
|
+
t.false(ids.includes("200"));
|
|
241
|
+
});
|
|
242
|
+
|
|
229
243
|
test("states includes common interaction states", (t) => {
|
|
230
244
|
const ids = getValues(states);
|
|
231
245
|
t.true(ids.includes("default"));
|
|
@@ -243,10 +257,27 @@ test("variants includes semantic variants", (t) => {
|
|
|
243
257
|
|
|
244
258
|
test("anatomyTerms includes key anatomy parts", (t) => {
|
|
245
259
|
const ids = getValues(anatomyTerms);
|
|
246
|
-
t.true(ids.includes("edge"));
|
|
247
|
-
t.true(ids.includes("visual"));
|
|
248
260
|
t.true(ids.includes("text"));
|
|
249
261
|
t.true(ids.includes("icon"));
|
|
262
|
+
t.true(ids.includes("label"));
|
|
263
|
+
t.true(ids.includes("handle"));
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
test("anatomyTerms does not include styling surfaces", (t) => {
|
|
267
|
+
const ids = getValues(anatomyTerms);
|
|
268
|
+
t.false(ids.includes("background"));
|
|
269
|
+
t.false(ids.includes("border"));
|
|
270
|
+
t.false(ids.includes("edge"));
|
|
271
|
+
t.false(ids.includes("visual"));
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
test("tokenObjects includes styling surfaces", (t) => {
|
|
275
|
+
const ids = getValues(tokenObjects);
|
|
276
|
+
t.true(ids.includes("background"));
|
|
277
|
+
t.true(ids.includes("border"));
|
|
278
|
+
t.true(ids.includes("edge"));
|
|
279
|
+
t.true(ids.includes("visual"));
|
|
280
|
+
t.true(ids.includes("content"));
|
|
250
281
|
});
|
|
251
282
|
|
|
252
283
|
test("components includes core components", (t) => {
|
|
@@ -278,3 +309,70 @@ test("scaleValues includes common numeric scales", (t) => {
|
|
|
278
309
|
t.true(ids.includes("200"));
|
|
279
310
|
t.true(ids.includes("300"));
|
|
280
311
|
});
|
|
312
|
+
|
|
313
|
+
test("scaleValues includes extended numeric scales", (t) => {
|
|
314
|
+
const ids = getValues(scaleValues);
|
|
315
|
+
t.true(ids.includes("1100"));
|
|
316
|
+
t.true(ids.includes("1200"));
|
|
317
|
+
t.true(ids.includes("1500"));
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
// Taxonomy registry tests
|
|
321
|
+
|
|
322
|
+
const taxonomyRegistries = [
|
|
323
|
+
["tokenObjects", tokenObjects],
|
|
324
|
+
["structures", structures],
|
|
325
|
+
["substructures", substructures],
|
|
326
|
+
["orientations", orientations],
|
|
327
|
+
["positions", positions],
|
|
328
|
+
["densities", densities],
|
|
329
|
+
["shapes", shapes],
|
|
330
|
+
];
|
|
331
|
+
|
|
332
|
+
for (const [name, registry] of taxonomyRegistries) {
|
|
333
|
+
test(`${name} registry loads successfully`, (t) => {
|
|
334
|
+
t.truthy(registry);
|
|
335
|
+
t.truthy(registry.values);
|
|
336
|
+
t.true(Array.isArray(registry.values));
|
|
337
|
+
t.true(registry.values.length > 0);
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
test(`${name} registry has no duplicate IDs`, (t) => {
|
|
341
|
+
const ids = registry.values.map((v) => v.id);
|
|
342
|
+
const uniqueIds = new Set(ids);
|
|
343
|
+
t.is(ids.length, uniqueIds.size);
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
test(`all ${name} values have id and label`, (t) => {
|
|
347
|
+
registry.values.forEach((value) => {
|
|
348
|
+
t.truthy(value.id, `${name} value missing id`);
|
|
349
|
+
t.truthy(value.label, `${name} value ${value.id} missing label`);
|
|
350
|
+
});
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
test("structures includes base and container", (t) => {
|
|
355
|
+
const ids = getValues(structures);
|
|
356
|
+
t.true(ids.includes("base"));
|
|
357
|
+
t.true(ids.includes("container"));
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
test("orientations includes vertical and horizontal", (t) => {
|
|
361
|
+
const ids = getValues(orientations);
|
|
362
|
+
t.true(ids.includes("vertical"));
|
|
363
|
+
t.true(ids.includes("horizontal"));
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
test("positions includes directional terms", (t) => {
|
|
367
|
+
const ids = getValues(positions);
|
|
368
|
+
t.true(ids.includes("top"));
|
|
369
|
+
t.true(ids.includes("bottom"));
|
|
370
|
+
t.true(ids.includes("start"));
|
|
371
|
+
t.true(ids.includes("end"));
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
test("densities includes spacious and compact", (t) => {
|
|
375
|
+
const ids = getValues(densities);
|
|
376
|
+
t.true(ids.includes("spacious"));
|
|
377
|
+
t.true(ids.includes("compact"));
|
|
378
|
+
});
|