@adobe/design-system-registry 0.0.0-layout-20260209174611

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.
@@ -0,0 +1,176 @@
1
+ {
2
+ "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/registry-value.json",
3
+ "type": "variant",
4
+ "description": "Color and style variants used across components",
5
+ "values": [
6
+ {
7
+ "id": "accent",
8
+ "label": "Accent",
9
+ "description": "Primary accent color variant",
10
+ "category": "emphasis",
11
+ "usedIn": ["component-schemas"]
12
+ },
13
+ {
14
+ "id": "negative",
15
+ "label": "Negative",
16
+ "description": "Destructive or negative action variant",
17
+ "category": "semantic",
18
+ "usedIn": ["component-schemas"]
19
+ },
20
+ {
21
+ "id": "primary",
22
+ "label": "Primary",
23
+ "description": "Primary emphasis variant",
24
+ "category": "emphasis",
25
+ "usedIn": ["component-schemas"]
26
+ },
27
+ {
28
+ "id": "secondary",
29
+ "label": "Secondary",
30
+ "description": "Secondary emphasis variant",
31
+ "category": "emphasis",
32
+ "usedIn": ["component-schemas"]
33
+ },
34
+ {
35
+ "id": "positive",
36
+ "label": "Positive",
37
+ "description": "Affirmative or positive action variant",
38
+ "category": "semantic",
39
+ "usedIn": ["component-schemas"]
40
+ },
41
+ {
42
+ "id": "notice",
43
+ "label": "Notice",
44
+ "description": "Notice or attention variant",
45
+ "category": "semantic",
46
+ "usedIn": ["component-schemas"]
47
+ },
48
+ {
49
+ "id": "informative",
50
+ "label": "Informative",
51
+ "description": "Informational variant",
52
+ "category": "semantic",
53
+ "usedIn": ["component-schemas"]
54
+ },
55
+ {
56
+ "id": "neutral",
57
+ "label": "Neutral",
58
+ "description": "Neutral variant",
59
+ "category": "semantic",
60
+ "usedIn": ["component-schemas"]
61
+ },
62
+ {
63
+ "id": "gray",
64
+ "label": "Gray",
65
+ "description": "Gray color variant",
66
+ "category": "color",
67
+ "usedIn": ["component-schemas"]
68
+ },
69
+ {
70
+ "id": "red",
71
+ "label": "Red",
72
+ "description": "Red color variant",
73
+ "category": "color",
74
+ "usedIn": ["component-schemas"]
75
+ },
76
+ {
77
+ "id": "orange",
78
+ "label": "Orange",
79
+ "description": "Orange color variant",
80
+ "category": "color",
81
+ "usedIn": ["component-schemas"]
82
+ },
83
+ {
84
+ "id": "yellow",
85
+ "label": "Yellow",
86
+ "description": "Yellow color variant",
87
+ "category": "color",
88
+ "usedIn": ["component-schemas"]
89
+ },
90
+ {
91
+ "id": "chartreuse",
92
+ "label": "Chartreuse",
93
+ "description": "Chartreuse color variant",
94
+ "category": "color",
95
+ "usedIn": ["component-schemas"]
96
+ },
97
+ {
98
+ "id": "celery",
99
+ "label": "Celery",
100
+ "description": "Celery color variant",
101
+ "category": "color",
102
+ "usedIn": ["component-schemas"]
103
+ },
104
+ {
105
+ "id": "green",
106
+ "label": "Green",
107
+ "description": "Green color variant",
108
+ "category": "color",
109
+ "usedIn": ["component-schemas"]
110
+ },
111
+ {
112
+ "id": "seafoam",
113
+ "label": "Seafoam",
114
+ "description": "Seafoam color variant",
115
+ "category": "color",
116
+ "usedIn": ["component-schemas"]
117
+ },
118
+ {
119
+ "id": "cyan",
120
+ "label": "Cyan",
121
+ "description": "Cyan color variant",
122
+ "category": "color",
123
+ "usedIn": ["component-schemas"]
124
+ },
125
+ {
126
+ "id": "blue",
127
+ "label": "Blue",
128
+ "description": "Blue color variant",
129
+ "category": "color",
130
+ "usedIn": ["component-schemas"]
131
+ },
132
+ {
133
+ "id": "indigo",
134
+ "label": "Indigo",
135
+ "description": "Indigo color variant",
136
+ "category": "color",
137
+ "usedIn": ["component-schemas"]
138
+ },
139
+ {
140
+ "id": "purple",
141
+ "label": "Purple",
142
+ "description": "Purple color variant",
143
+ "category": "color",
144
+ "usedIn": ["component-schemas"]
145
+ },
146
+ {
147
+ "id": "fuchsia",
148
+ "label": "Fuchsia",
149
+ "description": "Fuchsia color variant",
150
+ "category": "color",
151
+ "usedIn": ["component-schemas"]
152
+ },
153
+ {
154
+ "id": "magenta",
155
+ "label": "Magenta",
156
+ "description": "Magenta color variant",
157
+ "category": "color",
158
+ "usedIn": ["component-schemas"]
159
+ },
160
+ {
161
+ "id": "pink",
162
+ "label": "Pink",
163
+ "description": "Pink color variant",
164
+ "category": "color",
165
+ "usedIn": ["component-schemas"]
166
+ },
167
+ {
168
+ "id": "over-background",
169
+ "label": "Over Background",
170
+ "aliases": ["over background"],
171
+ "description": "Designed to be used over backgrounds",
172
+ "category": "context",
173
+ "usedIn": ["component-schemas"]
174
+ }
175
+ ]
176
+ }
@@ -0,0 +1,79 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://opensource.adobe.com/spectrum-design-data/schemas/platform-extension.json",
4
+ "title": "Platform Extension",
5
+ "description": "Schema for platform-specific terminology extensions",
6
+ "type": "object",
7
+ "required": ["platform", "extends", "extensions"],
8
+ "properties": {
9
+ "$schema": {
10
+ "type": "string",
11
+ "format": "uri"
12
+ },
13
+ "platform": {
14
+ "type": "string",
15
+ "description": "The platform this extension is for (e.g., iOS, Android, Web Components, Qt)"
16
+ },
17
+ "platformVersion": {
18
+ "type": "string",
19
+ "description": "Optional platform version or framework version"
20
+ },
21
+ "description": {
22
+ "type": "string",
23
+ "description": "Description of what this extension provides"
24
+ },
25
+ "extends": {
26
+ "type": "string",
27
+ "description": "Which registry this extends (sizes, states, variants, etc.)"
28
+ },
29
+ "extensions": {
30
+ "type": "array",
31
+ "description": "Array of term extensions",
32
+ "items": {
33
+ "$ref": "#/$defs/extension"
34
+ }
35
+ }
36
+ },
37
+ "$defs": {
38
+ "extension": {
39
+ "type": "object",
40
+ "required": ["termId"],
41
+ "properties": {
42
+ "termId": {
43
+ "type": "string",
44
+ "description": "The ID of the term being extended (must exist in the base registry)"
45
+ },
46
+ "platformTerm": {
47
+ "type": "string",
48
+ "description": "Platform-specific term or name"
49
+ },
50
+ "platformAliases": {
51
+ "type": "array",
52
+ "description": "Platform-specific aliases",
53
+ "items": {
54
+ "type": "string"
55
+ }
56
+ },
57
+ "notes": {
58
+ "type": "string",
59
+ "description": "Platform-specific implementation notes"
60
+ },
61
+ "reference": {
62
+ "type": "string",
63
+ "description": "Platform documentation reference or API name"
64
+ },
65
+ "codeExample": {
66
+ "type": "string",
67
+ "description": "Code example showing platform usage"
68
+ },
69
+ "differences": {
70
+ "type": "array",
71
+ "description": "Key differences from the base term",
72
+ "items": {
73
+ "type": "string"
74
+ }
75
+ }
76
+ }
77
+ }
78
+ }
79
+ }
@@ -0,0 +1,230 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://opensource.adobe.com/spectrum-design-data/schemas/registry-value.json",
4
+ "title": "Registry Value",
5
+ "description": "Schema for design system registry value entries",
6
+ "type": "object",
7
+ "required": ["type", "description", "values"],
8
+ "properties": {
9
+ "$schema": {
10
+ "type": "string",
11
+ "format": "uri"
12
+ },
13
+ "type": {
14
+ "type": "string",
15
+ "description": "The type of registry (size, state, variant, etc.)"
16
+ },
17
+ "description": {
18
+ "type": "string",
19
+ "description": "Description of what this registry contains"
20
+ },
21
+ "allowCustom": {
22
+ "type": "boolean",
23
+ "description": "Whether custom values are allowed beyond the registry"
24
+ },
25
+ "customPattern": {
26
+ "type": "string",
27
+ "description": "Regex pattern for validating custom values"
28
+ },
29
+ "values": {
30
+ "type": "array",
31
+ "description": "Array of registry values",
32
+ "items": {
33
+ "$ref": "#/$defs/value"
34
+ }
35
+ }
36
+ },
37
+ "$defs": {
38
+ "value": {
39
+ "type": "object",
40
+ "required": ["id", "label"],
41
+ "properties": {
42
+ "id": {
43
+ "type": "string",
44
+ "description": "Unique identifier for this value"
45
+ },
46
+ "label": {
47
+ "type": "string",
48
+ "description": "Human-readable label"
49
+ },
50
+ "aliases": {
51
+ "type": "array",
52
+ "description": "Alternative names or spellings",
53
+ "items": {
54
+ "type": "string"
55
+ }
56
+ },
57
+ "description": {
58
+ "type": "string",
59
+ "description": "Detailed description of this value"
60
+ },
61
+ "default": {
62
+ "type": "boolean",
63
+ "description": "Whether this is the default value"
64
+ },
65
+ "deprecated": {
66
+ "type": "boolean",
67
+ "description": "Whether this value is deprecated"
68
+ },
69
+ "usedIn": {
70
+ "type": "array",
71
+ "description": "Where this value is used (tokens, component-schemas, etc.)",
72
+ "items": {
73
+ "type": "string"
74
+ }
75
+ },
76
+ "category": {
77
+ "type": "string",
78
+ "description": "Category or grouping for this value"
79
+ },
80
+ "value": {
81
+ "type": ["string", "number", "boolean"],
82
+ "description": "Actual value (if different from id)"
83
+ },
84
+ "documentationUrl": {
85
+ "type": "string",
86
+ "format": "uri",
87
+ "description": "URL to documentation"
88
+ },
89
+ "definition": {
90
+ "type": "object",
91
+ "description": "Structured definition following Spectrum naming methodology",
92
+ "properties": {
93
+ "superordinate": {
94
+ "type": "string",
95
+ "description": "The higher-level category or class this term belongs to"
96
+ },
97
+ "description": {
98
+ "type": "string",
99
+ "description": "Core definition explaining what it is and how it differs"
100
+ },
101
+ "essentialCharacteristics": {
102
+ "type": "array",
103
+ "description": "Key characteristics that distinguish this term",
104
+ "items": {
105
+ "type": "string"
106
+ }
107
+ }
108
+ }
109
+ },
110
+ "platforms": {
111
+ "type": "object",
112
+ "description": "Platform-specific terminology and notes",
113
+ "patternProperties": {
114
+ ".*": {
115
+ "type": "object",
116
+ "properties": {
117
+ "term": {
118
+ "type": "string",
119
+ "description": "Platform-specific term or name"
120
+ },
121
+ "notes": {
122
+ "type": "string",
123
+ "description": "Platform-specific implementation notes"
124
+ },
125
+ "reference": {
126
+ "type": "string",
127
+ "description": "Platform documentation reference"
128
+ }
129
+ }
130
+ }
131
+ }
132
+ },
133
+ "terminology": {
134
+ "type": "object",
135
+ "description": "Terminology metadata and classification",
136
+ "properties": {
137
+ "conceptType": {
138
+ "type": "string",
139
+ "enum": ["word", "term", "name", "concept"],
140
+ "description": "Classification per Spectrum naming guide"
141
+ },
142
+ "namingRationale": {
143
+ "type": "string",
144
+ "description": "Why this name was chosen"
145
+ },
146
+ "alternatives": {
147
+ "type": "array",
148
+ "description": "Alternative terms considered but not used",
149
+ "items": {
150
+ "type": "string"
151
+ }
152
+ }
153
+ }
154
+ },
155
+ "sources": {
156
+ "type": "array",
157
+ "description": "References to source documentation",
158
+ "items": {
159
+ "type": "object",
160
+ "required": ["type"],
161
+ "properties": {
162
+ "type": {
163
+ "type": "string",
164
+ "enum": [
165
+ "wiki",
166
+ "industry-standard",
167
+ "platform-standard",
168
+ "internal-doc",
169
+ "research"
170
+ ],
171
+ "description": "Type of source"
172
+ },
173
+ "url": {
174
+ "type": "string",
175
+ "format": "uri",
176
+ "description": "URL to source"
177
+ },
178
+ "reference": {
179
+ "type": "string",
180
+ "description": "Text reference or citation"
181
+ },
182
+ "date": {
183
+ "type": "string",
184
+ "format": "date",
185
+ "description": "Date of source or last update"
186
+ }
187
+ }
188
+ }
189
+ },
190
+ "governance": {
191
+ "type": "object",
192
+ "description": "Governance and ownership metadata",
193
+ "properties": {
194
+ "owner": {
195
+ "type": "string",
196
+ "description": "Team or person responsible for this term"
197
+ },
198
+ "reviewDate": {
199
+ "type": "string",
200
+ "format": "date",
201
+ "description": "Last review date"
202
+ },
203
+ "nextReviewDate": {
204
+ "type": "string",
205
+ "format": "date",
206
+ "description": "Scheduled next review date"
207
+ },
208
+ "status": {
209
+ "type": "string",
210
+ "enum": ["draft", "review", "approved", "deprecated"],
211
+ "description": "Current status of this term"
212
+ },
213
+ "replacedBy": {
214
+ "type": "string",
215
+ "description": "If deprecated, the term that replaces this one"
216
+ }
217
+ }
218
+ },
219
+ "relatedTerms": {
220
+ "type": "array",
221
+ "description": "Related or cross-referenced terms",
222
+ "items": {
223
+ "type": "string",
224
+ "description": "ID of related term"
225
+ }
226
+ }
227
+ }
228
+ }
229
+ }
230
+ }
@@ -0,0 +1,134 @@
1
+ /*
2
+ Copyright 2025 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { readFileSync, readdirSync } from "node:fs";
14
+ import { join, dirname } from "node:path";
15
+ import { fileURLToPath } from "node:url";
16
+ import Ajv from "ajv";
17
+ import addFormats from "ajv-formats";
18
+
19
+ const __filename = fileURLToPath(import.meta.url);
20
+ const __dirname = dirname(__filename);
21
+ const registryDir = join(__dirname, "..", "registry");
22
+ const schemaPath = join(__dirname, "..", "schemas", "registry-value.json");
23
+
24
+ const ajv = new Ajv({ strict: false, allErrors: true });
25
+ addFormats(ajv);
26
+
27
+ const schema = JSON.parse(readFileSync(schemaPath, "utf-8"));
28
+ const validate = ajv.compile(schema);
29
+
30
+ let hasErrors = false;
31
+
32
+ console.log("🔍 Validating design system registry...\n");
33
+
34
+ // Get all registry files
35
+ const registryFiles = readdirSync(registryDir).filter((f) =>
36
+ f.endsWith(".json"),
37
+ );
38
+
39
+ for (const file of registryFiles) {
40
+ const filePath = join(registryDir, file);
41
+ const registry = JSON.parse(readFileSync(filePath, "utf-8"));
42
+
43
+ console.log(`📄 Validating ${file}...`);
44
+
45
+ // Validate against JSON schema
46
+ const valid = validate(registry);
47
+ if (!valid) {
48
+ console.error(` ❌ Schema validation failed:`);
49
+ validate.errors.forEach((err) => {
50
+ console.error(` ${err.instancePath}: ${err.message}`);
51
+ });
52
+ hasErrors = true;
53
+ continue;
54
+ }
55
+
56
+ // Check for duplicate IDs
57
+ const ids = new Set();
58
+ const duplicateIds = [];
59
+ for (const value of registry.values) {
60
+ if (ids.has(value.id)) {
61
+ duplicateIds.push(value.id);
62
+ }
63
+ ids.add(value.id);
64
+ }
65
+
66
+ if (duplicateIds.length > 0) {
67
+ console.error(` ❌ Duplicate IDs found: ${duplicateIds.join(", ")}`);
68
+ hasErrors = true;
69
+ }
70
+
71
+ // Check for duplicate aliases
72
+ const aliases = new Map();
73
+ for (const value of registry.values) {
74
+ if (value.aliases) {
75
+ for (const alias of value.aliases) {
76
+ if (aliases.has(alias)) {
77
+ console.error(
78
+ ` ❌ Duplicate alias "${alias}" found in ${value.id} (already used by ${aliases.get(alias)})`,
79
+ );
80
+ hasErrors = true;
81
+ }
82
+ aliases.set(alias, value.id);
83
+ }
84
+ }
85
+ }
86
+
87
+ // Check that only one value has default: true
88
+ const defaults = registry.values.filter((v) => v.default === true);
89
+ if (defaults.length > 1) {
90
+ console.error(
91
+ ` ❌ Multiple default values found: ${defaults.map((d) => d.id).join(", ")}`,
92
+ );
93
+ hasErrors = true;
94
+ }
95
+
96
+ // Check that relatedTerms reference valid IDs
97
+ for (const value of registry.values) {
98
+ if (value.relatedTerms) {
99
+ for (const relatedId of value.relatedTerms) {
100
+ if (!ids.has(relatedId)) {
101
+ console.error(
102
+ ` ❌ Invalid relatedTerm "${relatedId}" in ${value.id} (term does not exist)`,
103
+ );
104
+ hasErrors = true;
105
+ }
106
+ }
107
+ }
108
+ }
109
+
110
+ // Check that governance.replacedBy references valid IDs
111
+ for (const value of registry.values) {
112
+ if (value.governance?.replacedBy) {
113
+ if (!ids.has(value.governance.replacedBy)) {
114
+ console.error(
115
+ ` ❌ Invalid governance.replacedBy "${value.governance.replacedBy}" in ${value.id} (term does not exist)`,
116
+ );
117
+ hasErrors = true;
118
+ }
119
+ }
120
+ }
121
+
122
+ if (!hasErrors) {
123
+ console.log(` ✅ Valid (${registry.values.length} values)`);
124
+ }
125
+ console.log("");
126
+ }
127
+
128
+ if (hasErrors) {
129
+ console.error("❌ Validation failed with errors\n");
130
+ process.exit(1);
131
+ } else {
132
+ console.log("✅ All registry files validated successfully\n");
133
+ process.exit(0);
134
+ }