@adobe/design-system-registry 0.0.0-layout-20260211224825 → 1.2.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 +14 -3
- package/index.js +28 -0
- package/package.json +10 -3
- package/registry/anatomy-terms.json +1 -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 +1 -103
- package/registry/structures.json +27 -0
- package/registry/substructures.json +12 -0
- package/registry/token-objects.json +32 -0
- package/test/registry.test.js +100 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
# @adobe/design-system-registry
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 1.2.0
|
|
4
4
|
|
|
5
|
-
###
|
|
5
|
+
### Minor Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- [#812](https://github.com/adobe/spectrum-design-data/pull/812) [`32029a9`](https://github.com/adobe/spectrum-design-data/commit/32029a9d0565efcd448c399e767844389730ef2c) Thanks [@GarthDB](https://github.com/GarthDB)! - Split sizes.json: remove numeric scale values (50-1500), keeping
|
|
8
|
+
only semantic t-shirt sizes (xs-xxxl). Numeric values 1100-1500
|
|
9
|
+
added to scale-values.json to preserve data completeness.
|
|
10
|
+
|
|
11
|
+
- [#810](https://github.com/adobe/spectrum-design-data/pull/810) [`4a55a5f`](https://github.com/adobe/spectrum-design-data/commit/4a55a5f2b027d7df73852cb62dd633bd5da17c93) Thanks [@GarthDB](https://github.com/GarthDB)! - Add taxonomy registries and expand token name object schema.
|
|
12
|
+
- Split `anatomy-terms.json`: removed styling surfaces and positional terms
|
|
13
|
+
- Added `token-objects.json` (background, border, edge, visual, content)
|
|
14
|
+
- Added 6 new taxonomy registries:
|
|
15
|
+
structures, substructures, orientations, positions, densities, shapes
|
|
16
|
+
- Exported all 7 new registries from package index
|
|
17
|
+
- Added all 13 semantic fields explicitly to `nameObject` in
|
|
18
|
+
`token.schema.json`, distinguishing semantic from dimension fields
|
|
8
19
|
|
|
9
20
|
## 1.1.0
|
|
10
21
|
|
package/index.js
CHANGED
|
@@ -62,6 +62,34 @@ export const glossary = JSON.parse(
|
|
|
62
62
|
readFileSync(join(__dirname, "registry", "glossary.json"), "utf-8"),
|
|
63
63
|
);
|
|
64
64
|
|
|
65
|
+
export const tokenObjects = JSON.parse(
|
|
66
|
+
readFileSync(join(__dirname, "registry", "token-objects.json"), "utf-8"),
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
export const structures = JSON.parse(
|
|
70
|
+
readFileSync(join(__dirname, "registry", "structures.json"), "utf-8"),
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
export const substructures = JSON.parse(
|
|
74
|
+
readFileSync(join(__dirname, "registry", "substructures.json"), "utf-8"),
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
export const orientations = JSON.parse(
|
|
78
|
+
readFileSync(join(__dirname, "registry", "orientations.json"), "utf-8"),
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
export const positions = JSON.parse(
|
|
82
|
+
readFileSync(join(__dirname, "registry", "positions.json"), "utf-8"),
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
export const densities = JSON.parse(
|
|
86
|
+
readFileSync(join(__dirname, "registry", "densities.json"), "utf-8"),
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
export const shapes = JSON.parse(
|
|
90
|
+
readFileSync(join(__dirname, "registry", "shapes.json"), "utf-8"),
|
|
91
|
+
);
|
|
92
|
+
|
|
65
93
|
/**
|
|
66
94
|
* Get all values from a registry by ID
|
|
67
95
|
* @param {object} registry - The registry object
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/design-system-registry",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "A single source of truth for design system terminology used across Spectrum tokens, component schemas, and anatomy",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -13,7 +13,14 @@
|
|
|
13
13
|
"./registry/components.json": "./registry/components.json",
|
|
14
14
|
"./registry/scale-values.json": "./registry/scale-values.json",
|
|
15
15
|
"./registry/categories.json": "./registry/categories.json",
|
|
16
|
-
"./registry/platforms.json": "./registry/platforms.json"
|
|
16
|
+
"./registry/platforms.json": "./registry/platforms.json",
|
|
17
|
+
"./registry/token-objects.json": "./registry/token-objects.json",
|
|
18
|
+
"./registry/structures.json": "./registry/structures.json",
|
|
19
|
+
"./registry/substructures.json": "./registry/substructures.json",
|
|
20
|
+
"./registry/orientations.json": "./registry/orientations.json",
|
|
21
|
+
"./registry/positions.json": "./registry/positions.json",
|
|
22
|
+
"./registry/densities.json": "./registry/densities.json",
|
|
23
|
+
"./registry/shapes.json": "./registry/shapes.json"
|
|
17
24
|
},
|
|
18
25
|
"repository": {
|
|
19
26
|
"type": "git",
|
|
@@ -25,7 +32,7 @@
|
|
|
25
32
|
"url": "https://github.com/adobe/spectrum-design-data/issues"
|
|
26
33
|
},
|
|
27
34
|
"publishConfig": {
|
|
28
|
-
"provenance":
|
|
35
|
+
"provenance": true
|
|
29
36
|
},
|
|
30
37
|
"homepage": "https://github.com/adobe/spectrum-design-data/tree/main/packages/design-system-registry#readme",
|
|
31
38
|
"license": "Apache-2.0",
|
|
@@ -1,20 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/registry-value.json",
|
|
3
3
|
"type": "anatomy-term",
|
|
4
|
-
"description": "
|
|
4
|
+
"description": "Visible, named parts of components as defined by designers. These are the parts called out in component specification diagrams. Styling surfaces (background, border, etc.) belong in token-objects.json; positional terms (top, bottom, etc.) belong in positions.json.",
|
|
5
5
|
"values": [
|
|
6
|
-
{
|
|
7
|
-
"id": "edge",
|
|
8
|
-
"label": "Edge",
|
|
9
|
-
"description": "The outer boundary or border of a component",
|
|
10
|
-
"usedIn": ["tokens"]
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"id": "visual",
|
|
14
|
-
"label": "Visual",
|
|
15
|
-
"description": "Visual elements like icons, images, or decorative elements",
|
|
16
|
-
"usedIn": ["tokens"]
|
|
17
|
-
},
|
|
18
6
|
{
|
|
19
7
|
"id": "text",
|
|
20
8
|
"label": "Text",
|
|
@@ -27,18 +15,6 @@
|
|
|
27
15
|
"description": "Interactive control elements like checkboxes or radio buttons",
|
|
28
16
|
"usedIn": ["tokens"]
|
|
29
17
|
},
|
|
30
|
-
{
|
|
31
|
-
"id": "border",
|
|
32
|
-
"label": "Border",
|
|
33
|
-
"description": "Border or outline of a component",
|
|
34
|
-
"usedIn": ["tokens"]
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"id": "background",
|
|
38
|
-
"label": "Background",
|
|
39
|
-
"description": "Background surface or fill",
|
|
40
|
-
"usedIn": ["tokens"]
|
|
41
|
-
},
|
|
42
18
|
{
|
|
43
19
|
"id": "icon",
|
|
44
20
|
"label": "Icon",
|
|
@@ -51,36 +27,6 @@
|
|
|
51
27
|
"description": "Text labels",
|
|
52
28
|
"usedIn": ["tokens", "component-schemas"]
|
|
53
29
|
},
|
|
54
|
-
{
|
|
55
|
-
"id": "content",
|
|
56
|
-
"label": "Content",
|
|
57
|
-
"description": "Main content area",
|
|
58
|
-
"usedIn": ["tokens"]
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
"id": "top",
|
|
62
|
-
"label": "Top",
|
|
63
|
-
"description": "Top edge or boundary",
|
|
64
|
-
"usedIn": ["tokens"]
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"id": "bottom",
|
|
68
|
-
"label": "Bottom",
|
|
69
|
-
"description": "Bottom edge or boundary",
|
|
70
|
-
"usedIn": ["tokens"]
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
"id": "start",
|
|
74
|
-
"label": "Start",
|
|
75
|
-
"description": "Start edge (left in LTR, right in RTL)",
|
|
76
|
-
"usedIn": ["tokens"]
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
"id": "end",
|
|
80
|
-
"label": "End",
|
|
81
|
-
"description": "End edge (right in LTR, left in RTL)",
|
|
82
|
-
"usedIn": ["tokens"]
|
|
83
|
-
},
|
|
84
30
|
{
|
|
85
31
|
"id": "body",
|
|
86
32
|
"label": "Body",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/registry-value.json",
|
|
3
|
+
"type": "density",
|
|
4
|
+
"description": "Options that create more or less space within or around the parts of a component.",
|
|
5
|
+
"values": [
|
|
6
|
+
{
|
|
7
|
+
"id": "spacious",
|
|
8
|
+
"label": "Spacious",
|
|
9
|
+
"description": "More space within and around component parts"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"id": "compact",
|
|
13
|
+
"label": "Compact",
|
|
14
|
+
"description": "Less space within and around component parts"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/registry-value.json",
|
|
3
|
+
"type": "orientation",
|
|
4
|
+
"description": "Direction or order of structures and elements within a component or pattern.",
|
|
5
|
+
"values": [
|
|
6
|
+
{
|
|
7
|
+
"id": "vertical",
|
|
8
|
+
"label": "Vertical",
|
|
9
|
+
"description": "Top-to-bottom direction"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"id": "horizontal",
|
|
13
|
+
"label": "Horizontal",
|
|
14
|
+
"description": "Left-to-right (or right-to-left) direction"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/registry-value.json",
|
|
3
|
+
"type": "position",
|
|
4
|
+
"description": "Location of an object relative to another, with or without respect to directional order.",
|
|
5
|
+
"values": [
|
|
6
|
+
{
|
|
7
|
+
"id": "affixed",
|
|
8
|
+
"label": "Affixed",
|
|
9
|
+
"description": "Attached to another element in a fixed position"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"id": "top",
|
|
13
|
+
"label": "Top",
|
|
14
|
+
"description": "Top position relative to a reference element"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"id": "bottom",
|
|
18
|
+
"label": "Bottom",
|
|
19
|
+
"description": "Bottom position relative to a reference element"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"id": "start",
|
|
23
|
+
"label": "Start",
|
|
24
|
+
"description": "Start position (left in LTR, right in RTL)"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "end",
|
|
28
|
+
"label": "End",
|
|
29
|
+
"description": "End position (right in LTR, left in RTL)"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
@@ -86,6 +86,41 @@
|
|
|
86
86
|
"value": 1000,
|
|
87
87
|
"category": "extended",
|
|
88
88
|
"usedIn": ["tokens"]
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"id": "1100",
|
|
92
|
+
"label": "Scale 1100",
|
|
93
|
+
"value": 1100,
|
|
94
|
+
"category": "extended",
|
|
95
|
+
"usedIn": ["component-schemas"]
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"id": "1200",
|
|
99
|
+
"label": "Scale 1200",
|
|
100
|
+
"value": 1200,
|
|
101
|
+
"category": "extended",
|
|
102
|
+
"usedIn": ["component-schemas"]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"id": "1300",
|
|
106
|
+
"label": "Scale 1300",
|
|
107
|
+
"value": 1300,
|
|
108
|
+
"category": "extended",
|
|
109
|
+
"usedIn": ["component-schemas"]
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"id": "1400",
|
|
113
|
+
"label": "Scale 1400",
|
|
114
|
+
"value": 1400,
|
|
115
|
+
"category": "extended",
|
|
116
|
+
"usedIn": ["component-schemas"]
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"id": "1500",
|
|
120
|
+
"label": "Scale 1500",
|
|
121
|
+
"value": 1500,
|
|
122
|
+
"category": "extended",
|
|
123
|
+
"usedIn": ["component-schemas"]
|
|
89
124
|
}
|
|
90
125
|
]
|
|
91
126
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/registry-value.json",
|
|
3
|
+
"type": "shape",
|
|
4
|
+
"description": "Terms relative to the overall shape of a component. This is a starting vocabulary — new shape terms should be added here as design system patterns are identified.",
|
|
5
|
+
"values": [
|
|
6
|
+
{
|
|
7
|
+
"id": "uniform",
|
|
8
|
+
"label": "Uniform",
|
|
9
|
+
"description": "Equal proportions (e.g., 1:1 ratio between horizontal and vertical padding)"
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
}
|
package/registry/sizes.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/registry-value.json",
|
|
3
3
|
"type": "size",
|
|
4
|
-
"description": "
|
|
4
|
+
"description": "Semantic t-shirt size values used across Spectrum. Numeric scale values belong in scale-values.json.",
|
|
5
5
|
"values": [
|
|
6
6
|
{
|
|
7
7
|
"id": "xs",
|
|
@@ -45,108 +45,6 @@
|
|
|
45
45
|
"label": "3X Large",
|
|
46
46
|
"aliases": [],
|
|
47
47
|
"usedIn": ["component-options", "component-schemas"]
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"id": "50",
|
|
51
|
-
"label": "Size 50",
|
|
52
|
-
"aliases": [],
|
|
53
|
-
"usedIn": ["tokens", "component-schemas"]
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
"id": "75",
|
|
57
|
-
"label": "Size 75",
|
|
58
|
-
"aliases": [],
|
|
59
|
-
"usedIn": ["tokens", "component-schemas"]
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"id": "100",
|
|
63
|
-
"label": "Size 100",
|
|
64
|
-
"aliases": [],
|
|
65
|
-
"usedIn": ["tokens", "component-schemas"]
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
"id": "200",
|
|
69
|
-
"label": "Size 200",
|
|
70
|
-
"aliases": [],
|
|
71
|
-
"usedIn": ["tokens", "component-schemas"]
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"id": "300",
|
|
75
|
-
"label": "Size 300",
|
|
76
|
-
"aliases": [],
|
|
77
|
-
"usedIn": ["tokens", "component-schemas"]
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"id": "400",
|
|
81
|
-
"label": "Size 400",
|
|
82
|
-
"aliases": [],
|
|
83
|
-
"usedIn": ["tokens", "component-schemas"]
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"id": "500",
|
|
87
|
-
"label": "Size 500",
|
|
88
|
-
"aliases": [],
|
|
89
|
-
"usedIn": ["tokens", "component-schemas"]
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
"id": "600",
|
|
93
|
-
"label": "Size 600",
|
|
94
|
-
"aliases": [],
|
|
95
|
-
"usedIn": ["tokens", "component-schemas"]
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
"id": "700",
|
|
99
|
-
"label": "Size 700",
|
|
100
|
-
"aliases": [],
|
|
101
|
-
"usedIn": ["tokens", "component-schemas"]
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
"id": "800",
|
|
105
|
-
"label": "Size 800",
|
|
106
|
-
"aliases": [],
|
|
107
|
-
"usedIn": ["tokens", "component-schemas"]
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"id": "900",
|
|
111
|
-
"label": "Size 900",
|
|
112
|
-
"aliases": [],
|
|
113
|
-
"usedIn": ["tokens", "component-schemas"]
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
"id": "1000",
|
|
117
|
-
"label": "Size 1000",
|
|
118
|
-
"aliases": [],
|
|
119
|
-
"usedIn": ["tokens", "component-schemas"]
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
"id": "1100",
|
|
123
|
-
"label": "Size 1100",
|
|
124
|
-
"aliases": [],
|
|
125
|
-
"usedIn": ["component-schemas"]
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
"id": "1200",
|
|
129
|
-
"label": "Size 1200",
|
|
130
|
-
"aliases": [],
|
|
131
|
-
"usedIn": ["component-schemas"]
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
"id": "1300",
|
|
135
|
-
"label": "Size 1300",
|
|
136
|
-
"aliases": [],
|
|
137
|
-
"usedIn": ["component-schemas"]
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
"id": "1400",
|
|
141
|
-
"label": "Size 1400",
|
|
142
|
-
"aliases": [],
|
|
143
|
-
"usedIn": ["component-schemas"]
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
"id": "1500",
|
|
147
|
-
"label": "Size 1500",
|
|
148
|
-
"aliases": [],
|
|
149
|
-
"usedIn": ["component-schemas"]
|
|
150
48
|
}
|
|
151
49
|
]
|
|
152
50
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/registry-value.json",
|
|
3
|
+
"type": "structure",
|
|
4
|
+
"description": "Reusable visual patterns or object categories that occur across many varieties of components. Distinct from components, which are specific UI elements.",
|
|
5
|
+
"values": [
|
|
6
|
+
{
|
|
7
|
+
"id": "base",
|
|
8
|
+
"label": "Base",
|
|
9
|
+
"description": "Foundation structure shared across components"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"id": "container",
|
|
13
|
+
"label": "Container",
|
|
14
|
+
"description": "Enclosing structure that holds child elements"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"id": "list",
|
|
18
|
+
"label": "List",
|
|
19
|
+
"description": "Ordered or unordered collection of items"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"id": "accessory",
|
|
23
|
+
"label": "Accessory",
|
|
24
|
+
"description": "Supplementary element attached to a primary structure"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/registry-value.json",
|
|
3
|
+
"type": "substructure",
|
|
4
|
+
"description": "Structures that only exist within the context of a parent structure (e.g., item within a list).",
|
|
5
|
+
"values": [
|
|
6
|
+
{
|
|
7
|
+
"id": "item",
|
|
8
|
+
"label": "Item",
|
|
9
|
+
"description": "Individual element within a parent structure (e.g., list item)"
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/registry-value.json",
|
|
3
|
+
"type": "token-object",
|
|
4
|
+
"description": "Styling surfaces to which visual properties are applied. These are abstract targets that exist on any element regardless of component type. Not to be confused with component anatomy (visible named parts).",
|
|
5
|
+
"values": [
|
|
6
|
+
{
|
|
7
|
+
"id": "background",
|
|
8
|
+
"label": "Background",
|
|
9
|
+
"description": "Background surface or fill"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"id": "border",
|
|
13
|
+
"label": "Border",
|
|
14
|
+
"description": "Border or outline of a component"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"id": "edge",
|
|
18
|
+
"label": "Edge",
|
|
19
|
+
"description": "Outer boundary of a component (used in spacing tokens)"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"id": "visual",
|
|
23
|
+
"label": "Visual",
|
|
24
|
+
"description": "Visible graphic element area (may be inset from edge)"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "content",
|
|
28
|
+
"label": "Content",
|
|
29
|
+
"description": "Main content area"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
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
|
+
});
|