@adobe/spectrum-component-api-schemas 6.0.0 → 6.1.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 (95) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/index.js +28 -12
  3. package/moon.yml +1 -4
  4. package/package.json +3 -2
  5. package/scripts/convert-to-spec-format.mjs +136 -0
  6. package/test/index.test.js +64 -34
  7. package/test/integration.test.js +4 -6
  8. package/test/performance.test.js +7 -7
  9. package/test/schema-validation.test.js +64 -105
  10. package/schemas/component.json +0 -32
  11. package/schemas/components/accordion.json +0 -74
  12. package/schemas/components/action-bar.json +0 -18
  13. package/schemas/components/action-button.json +0 -62
  14. package/schemas/components/action-group.json +0 -69
  15. package/schemas/components/alert-banner.json +0 -29
  16. package/schemas/components/alert-dialog.json +0 -42
  17. package/schemas/components/avatar-group.json +0 -22
  18. package/schemas/components/avatar.json +0 -45
  19. package/schemas/components/badge.json +0 -69
  20. package/schemas/components/body.json +0 -25
  21. package/schemas/components/bottom-navigation-android.json +0 -37
  22. package/schemas/components/breadcrumbs.json +0 -72
  23. package/schemas/components/button-group.json +0 -33
  24. package/schemas/components/button.json +0 -61
  25. package/schemas/components/calendar.json +0 -100
  26. package/schemas/components/cards.json +0 -238
  27. package/schemas/components/checkbox-group.json +0 -49
  28. package/schemas/components/checkbox.json +0 -49
  29. package/schemas/components/close-button.json +0 -35
  30. package/schemas/components/coach-indicator.json +0 -34
  31. package/schemas/components/coach-mark.json +0 -51
  32. package/schemas/components/code.json +0 -21
  33. package/schemas/components/color-area.json +0 -64
  34. package/schemas/components/color-handle.json +0 -31
  35. package/schemas/components/color-loupe.json +0 -21
  36. package/schemas/components/color-slider.json +0 -66
  37. package/schemas/components/color-wheel.json +0 -47
  38. package/schemas/components/combo-box.json +0 -80
  39. package/schemas/components/contextual-help.json +0 -67
  40. package/schemas/components/date-picker.json +0 -157
  41. package/schemas/components/detail.json +0 -26
  42. package/schemas/components/divider.json +0 -23
  43. package/schemas/components/drop-zone.json +0 -41
  44. package/schemas/components/field-label.json +0 -39
  45. package/schemas/components/heading.json +0 -29
  46. package/schemas/components/help-text.json +0 -36
  47. package/schemas/components/illustrated-message.json +0 -45
  48. package/schemas/components/in-field-progress-button.json +0 -31
  49. package/schemas/components/in-field-progress-circle.json +0 -22
  50. package/schemas/components/in-line-alert.json +0 -43
  51. package/schemas/components/link.json +0 -32
  52. package/schemas/components/list-view.json +0 -89
  53. package/schemas/components/menu.json +0 -63
  54. package/schemas/components/meter.json +0 -44
  55. package/schemas/components/number-field.json +0 -57
  56. package/schemas/components/opacity-checkerboard.json +0 -21
  57. package/schemas/components/picker.json +0 -81
  58. package/schemas/components/popover.json +0 -65
  59. package/schemas/components/progress-bar.json +0 -64
  60. package/schemas/components/progress-circle.json +0 -41
  61. package/schemas/components/radio-button.json +0 -30
  62. package/schemas/components/radio-group.json +0 -58
  63. package/schemas/components/rating.json +0 -34
  64. package/schemas/components/scroll-zoom-bar.json +0 -44
  65. package/schemas/components/search-field.json +0 -58
  66. package/schemas/components/segmented-control.json +0 -72
  67. package/schemas/components/select-box.json +0 -50
  68. package/schemas/components/side-navigation.json +0 -59
  69. package/schemas/components/slider.json +0 -79
  70. package/schemas/components/standard-dialog.json +0 -49
  71. package/schemas/components/standard-panel.json +0 -49
  72. package/schemas/components/status-light.json +0 -51
  73. package/schemas/components/steplist.json +0 -52
  74. package/schemas/components/swatch-group.json +0 -44
  75. package/schemas/components/swatch.json +0 -46
  76. package/schemas/components/switch.json +0 -42
  77. package/schemas/components/tab-bar-ios.json +0 -37
  78. package/schemas/components/table.json +0 -118
  79. package/schemas/components/tabs.json +0 -75
  80. package/schemas/components/tag-field.json +0 -42
  81. package/schemas/components/tag-group.json +0 -31
  82. package/schemas/components/tag.json +0 -41
  83. package/schemas/components/takeover-dialog.json +0 -54
  84. package/schemas/components/text-area.json +0 -92
  85. package/schemas/components/text-field.json +0 -80
  86. package/schemas/components/thumbnail.json +0 -22
  87. package/schemas/components/toast.json +0 -29
  88. package/schemas/components/tooltip.json +0 -50
  89. package/schemas/components/tray.json +0 -17
  90. package/schemas/components/tree-view.json +0 -50
  91. package/schemas/types/hex-color.json +0 -8
  92. package/schemas/types/typography-classification.json +0 -9
  93. package/schemas/types/typography-script.json +0 -9
  94. package/schemas/types/workflow-icon.json +0 -901
  95. package/test/componentSchemaValidator.test.js +0 -74
@@ -1,131 +1,90 @@
1
+ /*
2
+ Copyright 2026 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
+ */
1
12
  import test from "ava";
2
- import {
3
- readJSON,
4
- getSchemaFiles,
5
- createAjvInstance,
6
- validateSchema,
7
- validateExamples,
8
- } from "./utils/test-helpers.js";
13
+ import { readFile } from "fs/promises";
14
+ import { resolve } from "path";
15
+ import { glob } from "glob";
16
+ import { createRequire } from "module";
17
+ import Ajv from "ajv/dist/2020.js";
18
+ import addFormats from "ajv-formats";
19
+ import * as url from "url";
9
20
 
10
- // Setup Ajv instance once for all tests
11
- let ajv;
12
-
13
- test.before(async () => {
14
- ajv = await createAjvInstance();
15
- });
16
-
17
- test("component schema should be valid", async (t) => {
18
- const componentSchema = await readJSON("schemas/component.json");
19
- const result = validateSchema(componentSchema, ajv);
21
+ const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
20
22
 
21
- t.true(
22
- result.valid,
23
- `Component schema validation failed: ${JSON.stringify(result.errors, null, 2)}`,
24
- );
25
- });
23
+ const specPkgPath = createRequire(import.meta.url).resolve(
24
+ "@adobe/design-data-spec/package.json",
25
+ );
26
+ const specPkgDir = resolve(specPkgPath, "..");
27
+ const componentsDir = resolve(specPkgDir, "components");
26
28
 
27
- test("all component schemas should validate against the definition", async (t) => {
28
- const componentFiles = await getSchemaFiles("schemas/components/*.json");
29
- const validationResults = [];
29
+ const readJSON = async (filePath) =>
30
+ JSON.parse(await readFile(filePath, "utf8"));
30
31
 
31
- for (const filePath of componentFiles) {
32
- const schema = await readJSON(filePath);
33
- const result = validateSchema(schema, ajv);
34
-
35
- if (!result.valid) {
36
- validationResults.push({
37
- file: filePath,
38
- errors: result.errors,
39
- });
40
- }
41
- }
32
+ let ajv;
33
+ let componentSchema;
42
34
 
43
- t.is(
44
- validationResults.length,
45
- 0,
46
- `Schema validation failed for:\n${validationResults
47
- .map((r) => `${r.file}:\n${JSON.stringify(r.errors, null, 2)}`)
48
- .join("\n\n")}`,
35
+ test.before(async () => {
36
+ componentSchema = await readJSON(
37
+ resolve(specPkgDir, "schemas/component.schema.json"),
49
38
  );
50
- });
51
-
52
- test("all component examples should validate against their schemas", async (t) => {
53
- const componentFiles = await getSchemaFiles("schemas/components/*.json");
54
- const validationResults = [];
55
-
56
- for (const filePath of componentFiles) {
57
- const schema = await readJSON(filePath);
58
- const result = validateExamples(schema, ajv);
59
39
 
60
- if (!result.valid) {
61
- validationResults.push({
62
- file: filePath,
63
- errors: result.errors,
64
- });
65
- }
66
- }
67
-
68
- t.is(
69
- validationResults.length,
70
- 0,
71
- `Example validation failed for:\n${validationResults
72
- .map((r) => `${r.file}:\n${JSON.stringify(r.errors, null, 2)}`)
73
- .join("\n\n")}`,
40
+ ajv = new Ajv({ allErrors: true, strict: false });
41
+ addFormats(ajv);
42
+ ajv.addSchema(
43
+ await readJSON(resolve(specPkgDir, "schemas/anatomy-part.schema.json")),
44
+ );
45
+ ajv.addSchema(
46
+ await readJSON(
47
+ resolve(specPkgDir, "schemas/state-declaration.schema.json"),
48
+ ),
74
49
  );
75
50
  });
76
51
 
77
- test("all type schemas should be valid JSON Schema", async (t) => {
78
- const typeFiles = await getSchemaFiles("schemas/types/*.json");
79
- const validationResults = [];
80
-
81
- for (const filePath of typeFiles) {
82
- const schema = await readJSON(filePath);
83
- const result = validateSchema(schema, ajv);
52
+ test("all component files should validate against component.schema.json", async (t) => {
53
+ const componentFiles = (await glob(`${componentsDir}/*.json`)).sort();
54
+ const validate = ajv.compile(componentSchema);
55
+ const failures = [];
84
56
 
85
- if (!result.valid) {
86
- validationResults.push({
87
- file: filePath,
88
- errors: result.errors,
89
- });
57
+ for (const filePath of componentFiles) {
58
+ const data = await readJSON(filePath);
59
+ const valid = validate(data);
60
+ if (!valid) {
61
+ failures.push({ file: filePath, errors: validate.errors });
90
62
  }
91
63
  }
92
64
 
93
65
  t.is(
94
- validationResults.length,
66
+ failures.length,
95
67
  0,
96
- `Type schema validation failed for:\n${validationResults
97
- .map((r) => `${r.file}:\n${JSON.stringify(r.errors, null, 2)}`)
68
+ `Schema validation failed:\n${failures
69
+ .map((f) => `${f.file}:\n${JSON.stringify(f.errors, null, 2)}`)
98
70
  .join("\n\n")}`,
99
71
  );
100
72
  });
101
73
 
102
- test("component schemas should have required metadata", async (t) => {
103
- const componentFiles = await getSchemaFiles("schemas/components/*.json");
104
- const missingMetadata = [];
74
+ test("all component files should have required metadata", async (t) => {
75
+ const componentFiles = (await glob(`${componentsDir}/*.json`)).sort();
76
+ const missing = [];
105
77
 
106
78
  for (const filePath of componentFiles) {
107
- const schema = await readJSON(filePath);
108
-
109
- if (!schema.meta?.category) {
110
- missingMetadata.push(`${filePath}: missing category`);
111
- }
112
-
113
- if (!schema.meta?.documentationUrl) {
114
- missingMetadata.push(`${filePath}: missing documentationUrl`);
115
- }
116
-
117
- if (!schema.title) {
118
- missingMetadata.push(`${filePath}: missing title`);
119
- }
120
-
121
- if (!Object.hasOwn(schema, "description")) {
122
- missingMetadata.push(`${filePath}: missing description`);
123
- }
79
+ const data = await readJSON(filePath);
80
+
81
+ if (!data.name) missing.push(`${filePath}: missing name`);
82
+ if (!data.displayName) missing.push(`${filePath}: missing displayName`);
83
+ if (!data.meta?.category)
84
+ missing.push(`${filePath}: missing meta.category`);
85
+ if (!data.meta?.documentationUrl)
86
+ missing.push(`${filePath}: missing meta.documentationUrl`);
124
87
  }
125
88
 
126
- t.is(
127
- missingMetadata.length,
128
- 0,
129
- `Missing required metadata:\n${missingMetadata.join("\n")}`,
130
- );
89
+ t.is(missing.length, 0, `Missing required metadata:\n${missing.join("\n")}`);
131
90
  });
@@ -1,32 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://opensource.adobe.com/spectrum-design-data/schemas/component.json",
4
- "title": "Component",
5
- "type": "object",
6
- "properties": {
7
- "meta": {
8
- "type": "object",
9
- "properties": {
10
- "category": {
11
- "type": "string",
12
- "enum": [
13
- "actions",
14
- "containers",
15
- "data visualization",
16
- "feedback",
17
- "inputs",
18
- "navigation",
19
- "status",
20
- "typography"
21
- ]
22
- },
23
- "documentationUrl": {
24
- "type": "string",
25
- "format": "uri"
26
- }
27
- },
28
- "required": ["category", "documentationUrl"]
29
- }
30
- },
31
- "required": ["meta", "title", "description", "properties", "$id"]
32
- }
@@ -1,74 +0,0 @@
1
- {
2
- "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/component.json",
3
- "$id": "https://opensource.adobe.com/spectrum-design-data/schemas/components/accordion.json",
4
- "title": "Accordion",
5
- "description": "An accordion is a vertically stacked set of interactive headings that each contain a title and a content area.",
6
- "meta": {
7
- "category": "inputs",
8
- "documentationUrl": "https://spectrum.adobe.com/page/accordion/"
9
- },
10
- "type": "object",
11
- "properties": {
12
- "state": {
13
- "type": "string",
14
- "enum": ["default", "hover", "down", "keyboard focus"],
15
- "default": "default"
16
- },
17
- "size": {
18
- "type": "string",
19
- "enum": ["s", "m", "l", "xl"],
20
- "default": "m"
21
- },
22
- "isQuiet": {
23
- "type": "boolean",
24
- "default": false
25
- },
26
- "isDisabled": {
27
- "type": "boolean",
28
- "default": false
29
- },
30
- "density": {
31
- "type": "string",
32
- "enum": ["compact", "regular", "spacious"],
33
- "default": "regular"
34
- },
35
- "items": {
36
- "type": "array",
37
- "description": "An array of accordion items.",
38
- "items": {
39
- "type": "object",
40
- "properties": {
41
- "label": {
42
- "type": "string",
43
- "description": "The text label displayed for the accordion item."
44
- },
45
- "content": {
46
- "type": "string",
47
- "description": "The content shown when the accordion item is expanded."
48
- },
49
- "isExpanded": {
50
- "type": "boolean",
51
- "default": false,
52
- "description": "Whether the accordion item is expanded by default."
53
- },
54
- "hasSwitch": {
55
- "type": "boolean",
56
- "default": false,
57
- "description": "If true, the accordion item includes a switch."
58
- },
59
- "hasActionButton": {
60
- "type": "boolean",
61
- "default": false,
62
- "description": "If true, the accordion item includes an action button."
63
- }
64
- },
65
- "required": ["label"]
66
- }
67
- },
68
- "isMultiple": {
69
- "type": "boolean",
70
- "default": false,
71
- "description": "If true, multiple accordion items can be expanded at the same time."
72
- }
73
- }
74
- }
@@ -1,18 +0,0 @@
1
- {
2
- "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/component.json",
3
- "$id": "https://opensource.adobe.com/spectrum-design-data/schemas/components/action-bar.json",
4
- "title": "Action bar",
5
- "description": "Action bars are used for single and bulk selection patterns, when a user needs to perform actions on either a single or multiple items at the same time.",
6
- "meta": {
7
- "category": "actions",
8
- "documentationUrl": "https://spectrum.adobe.com/page/action-bar/"
9
- },
10
- "type": "object",
11
- "properties": {
12
- "isEmphasized": {
13
- "type": "boolean",
14
- "default": false
15
- }
16
- },
17
- "examples": [{ "isEmphasized": true }, { "isEmphasized": false }, {}]
18
- }
@@ -1,62 +0,0 @@
1
- {
2
- "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/component.json",
3
- "$id": "https://opensource.adobe.com/spectrum-design-data/schemas/components/action-button.json",
4
- "title": "Action button",
5
- "description": "Action buttons allow users to perform an action or mark a selection. They're used for similar, task-based options within a workflow, and are ideal for interfaces where buttons aren't meant to draw a lot of attention.",
6
- "meta": {
7
- "category": "actions",
8
- "documentationUrl": "https://spectrum.adobe.com/page/action-button/"
9
- },
10
- "type": "object",
11
- "properties": {
12
- "label": {
13
- "type": "string"
14
- },
15
- "hideLabel": {
16
- "type": "boolean",
17
- "default": false
18
- },
19
- "icon": {
20
- "$ref": "https://opensource.adobe.com/spectrum-design-data/schemas/types/workflow-icon.json",
21
- "description": "Icon must be present if the label is not defined."
22
- },
23
- "size": {
24
- "type": "string",
25
- "enum": ["xs", "s", "m", "l", "xl"],
26
- "default": "m"
27
- },
28
- "isQuiet": {
29
- "type": "boolean",
30
- "default": false
31
- },
32
- "isSelected": {
33
- "type": "boolean",
34
- "default": false
35
- },
36
- "isEmphasized": {
37
- "type": "boolean",
38
- "default": false
39
- },
40
- "staticColor": {
41
- "type": "string",
42
- "enum": ["white", "black"],
43
- "description": "Static color must not be set for the default version of this component."
44
- },
45
- "selectedTextColor": {
46
- "$ref": "https://opensource.adobe.com/spectrum-design-data/schemas/types/hex-color.json"
47
- },
48
- "hasHoldIcon": {
49
- "type": "boolean",
50
- "default": false
51
- },
52
- "isDisabled": {
53
- "type": "boolean",
54
- "default": false
55
- },
56
- "state": {
57
- "type": "string",
58
- "enum": ["default", "hover", "down", "keyboard focus"],
59
- "default": "default"
60
- }
61
- }
62
- }
@@ -1,69 +0,0 @@
1
- {
2
- "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/component.json",
3
- "$id": "https://opensource.adobe.com/spectrum-design-data/schemas/components/action-group.json",
4
- "title": "Action group",
5
- "description": "An action group is a grouping of action buttons that are related to each other.",
6
- "meta": {
7
- "category": "actions",
8
- "documentationUrl": "https://spectrum.adobe.com/page/action-group/"
9
- },
10
- "type": "object",
11
- "properties": {
12
- "orientation": {
13
- "type": "string",
14
- "enum": ["horizontal", "vertical"],
15
- "default": "horizontal"
16
- },
17
- "size": {
18
- "type": "string",
19
- "enum": ["s", "m", "l", "xl"],
20
- "default": "m"
21
- },
22
- "density": {
23
- "type": "string",
24
- "enum": ["regular", "compact"],
25
- "default": "regular"
26
- },
27
- "isJustified": {
28
- "type": "boolean",
29
- "default": false
30
- },
31
- "isQuiet": {
32
- "type": "boolean",
33
- "default": false
34
- },
35
- "isEmphasized": {
36
- "type": "boolean",
37
- "default": false
38
- },
39
- "enableSelection": {
40
- "type": "boolean",
41
- "default": false
42
- },
43
- "selectionMode": {
44
- "type": "string",
45
- "enum": ["single", "multiple"],
46
- "default": "single",
47
- "description": "Only applicable if selection is enabled"
48
- },
49
- "allowsEmptySelection": {
50
- "type": "boolean",
51
- "default": false,
52
- "description": "Only applicable if selection is enabled"
53
- },
54
- "overflowMode": {
55
- "type": "string",
56
- "enum": ["wrap", "collapse"],
57
- "default": "wrap"
58
- },
59
- "isDisabled": {
60
- "type": "boolean",
61
- "default": false
62
- }
63
- },
64
- "examples": [
65
- {
66
- "size": "s"
67
- }
68
- ]
69
- }
@@ -1,29 +0,0 @@
1
- {
2
- "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/component.json",
3
- "$id": "https://opensource.adobe.com/spectrum-design-data/schemas/components/alert-banner.json",
4
- "title": "Alert banner",
5
- "description": "Alert banners show pressing and high-signal messages, such as system alerts. They're meant to be noticed and prompt users to take action.",
6
- "meta": {
7
- "category": "feedback",
8
- "documentationUrl": "https://spectrum.adobe.com/page/alert-banner/"
9
- },
10
- "type": "object",
11
- "properties": {
12
- "text": {
13
- "type": "string"
14
- },
15
- "variant": {
16
- "type": "string",
17
- "enum": ["neutral", "informative", "negative", "accent"],
18
- "default": "neutral"
19
- },
20
- "actionLabel": {
21
- "type": "string",
22
- "description": "If undefined, this button does not appear."
23
- },
24
- "isDismissible": {
25
- "type": "boolean",
26
- "default": false
27
- }
28
- }
29
- }
@@ -1,42 +0,0 @@
1
- {
2
- "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/component.json",
3
- "$id": "https://opensource.adobe.com/spectrum-design-data/schemas/components/alert-dialog.json",
4
- "title": "Alert dialog",
5
- "description": "Alert dialogs display important information that users need to acknowledge. They appear over the interface and block further interactions until an action is selected.",
6
- "meta": {
7
- "category": "feedback",
8
- "documentationUrl": "https://spectrum.adobe.com/page/alert-dialog/"
9
- },
10
- "type": "object",
11
- "properties": {
12
- "title": {
13
- "type": "string"
14
- },
15
- "description": {
16
- "type": "string"
17
- },
18
- "variant": {
19
- "type": "string",
20
- "enum": [
21
- "confirmation",
22
- "information",
23
- "warning",
24
- "destructive",
25
- "error"
26
- ],
27
- "default": "confirmation"
28
- },
29
- "primaryActionLabel": {
30
- "type": "string"
31
- },
32
- "secondaryActionLabel": {
33
- "type": "string",
34
- "description": "If undefined, this button does not appear."
35
- },
36
- "cancelActionLabel": {
37
- "type": "string",
38
- "default": "cancel",
39
- "description": "If undefined, this button does not appear."
40
- }
41
- }
42
- }
@@ -1,22 +0,0 @@
1
- {
2
- "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/component.json",
3
- "$id": "https://opensource.adobe.com/spectrum-design-data/schemas/components/avatar-group.json",
4
- "title": "Avatar group",
5
- "description": "Avatar groups display a collection of avatars representing people or entities.",
6
- "meta": {
7
- "category": "actions",
8
- "documentationUrl": "https://spectrum.adobe.com/page/avatar-group/"
9
- },
10
- "type": "object",
11
- "properties": {
12
- "label": {
13
- "type": "string",
14
- "description": "Optional text label displayed with the avatar group (e.g., group name)."
15
- },
16
- "size": {
17
- "type": "number",
18
- "enum": [50, 75, 100, 200, 300, 400, 500],
19
- "default": 100
20
- }
21
- }
22
- }
@@ -1,45 +0,0 @@
1
- {
2
- "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/component.json",
3
- "$id": "https://opensource.adobe.com/spectrum-design-data/schemas/components/avatar.json",
4
- "title": "Avatar",
5
- "description": "An avatar is a thumbnail representation of an entity, such as a user or an organization.",
6
- "meta": {
7
- "category": "navigation",
8
- "documentationUrl": "https://spectrum.adobe.com/page/avatar/"
9
- },
10
- "type": "object",
11
- "properties": {
12
- "size": {
13
- "type": "number",
14
- "enum": [
15
- 50, 75, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200,
16
- 1300, 1400, 1500
17
- ],
18
- "default": 500
19
- },
20
- "image": {
21
- "type": "string",
22
- "enum": [
23
- "user image",
24
- "gradient image",
25
- "gradient",
26
- "guest image",
27
- "initials"
28
- ],
29
- "default": "user image"
30
- },
31
- "isDisabled": {
32
- "type": "boolean",
33
- "default": false
34
- },
35
- "showStroke": {
36
- "type": "boolean",
37
- "default": false
38
- },
39
- "state": {
40
- "type": "string",
41
- "enum": ["default", "down", "keyboard focus"],
42
- "default": "default"
43
- }
44
- }
45
- }
@@ -1,69 +0,0 @@
1
- {
2
- "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/component.json",
3
- "$id": "https://opensource.adobe.com/spectrum-design-data/schemas/components/badge.json",
4
- "title": "Badge",
5
- "description": "Similar to status lights, badges are for showing a small amount of color-categorized metadata. They're ideal for getting a user''s attention.",
6
- "meta": {
7
- "category": "status",
8
- "documentationUrl": "https://spectrum.adobe.com/page/badge/"
9
- },
10
- "type": "object",
11
- "properties": {
12
- "label": {
13
- "type": "string",
14
- "description": "When the label is not defined, the badge appears as icon-only."
15
- },
16
- "icon": {
17
- "$ref": "https://opensource.adobe.com/spectrum-design-data/schemas/types/workflow-icon.json"
18
- },
19
- "variant": {
20
- "type": "string",
21
- "enum": [
22
- "neutral",
23
- "info",
24
- "positive",
25
- "negative",
26
- "indigo",
27
- "yellow",
28
- "magenta",
29
- "fuchsia",
30
- "purple",
31
- "seafoam",
32
- "accent",
33
- "notice",
34
- "gray",
35
- "red",
36
- "orange",
37
- "chartreuse",
38
- "celery",
39
- "green",
40
- "cyan",
41
- "blue",
42
- "pink",
43
- "turquoise",
44
- "brown",
45
- "cinnamon",
46
- "silver"
47
- ]
48
- },
49
- "style": {
50
- "type": "string",
51
- "enum": ["bold", "subtle", "outline"]
52
- },
53
- "fixed": {
54
- "type": "string",
55
- "enum": ["none", "top", "right", "bottom", "left"],
56
- "default": "none"
57
- },
58
- "isDisabled": {
59
- "type": "boolean",
60
- "default": false
61
- },
62
- "size": {
63
- "type": "string",
64
- "pattern": "^(x?s|m|x{0,3}l)$",
65
- "enum": ["s", "m", "l", "xl"],
66
- "default": "s"
67
- }
68
- }
69
- }