@adobe/spectrum-component-api-schemas 2.0.0 → 4.0.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 (40) hide show
  1. package/CHANGELOG.md +187 -0
  2. package/package.json +1 -1
  3. package/schemas/components/accordion.json +90 -0
  4. package/schemas/components/avatar-group.json +30 -0
  5. package/schemas/components/breadcrumbs.json +54 -0
  6. package/schemas/components/button-group.json +5 -0
  7. package/schemas/components/checkbox-group.json +1 -5
  8. package/schemas/components/color-handle.json +31 -0
  9. package/schemas/components/color-slider.json +7 -1
  10. package/schemas/components/combo-box.json +1 -5
  11. package/schemas/components/contextual-help.json +5 -2
  12. package/schemas/components/date-picker.json +157 -0
  13. package/schemas/components/divider.json +1 -1
  14. package/schemas/components/drop-zone.json +41 -0
  15. package/schemas/components/help-text.json +3 -2
  16. package/schemas/components/in-line-alert.json +19 -1
  17. package/schemas/components/menu.json +2 -4
  18. package/schemas/components/meter.json +4 -0
  19. package/schemas/components/number-field.json +73 -0
  20. package/schemas/components/popover.json +2 -2
  21. package/schemas/components/progress-bar.json +14 -0
  22. package/schemas/components/radio-button.json +8 -3
  23. package/schemas/components/radio-group.json +0 -4
  24. package/schemas/components/rating.json +4 -2
  25. package/schemas/components/scroll-zoom-bar.json +1 -1
  26. package/schemas/components/search-field.json +8 -0
  27. package/schemas/components/segmented-control.json +89 -0
  28. package/schemas/components/select-box.json +11 -2
  29. package/schemas/components/slider.json +19 -3
  30. package/schemas/components/status-light.json +8 -6
  31. package/schemas/components/step-list.json +52 -0
  32. package/schemas/components/swatch-group.json +25 -3
  33. package/schemas/components/swatch.json +23 -5
  34. package/schemas/components/tabs.json +78 -37
  35. package/schemas/components/tag-field.json +51 -0
  36. package/schemas/components/tag-group.json +38 -0
  37. package/schemas/components/text-area.json +4 -0
  38. package/schemas/components/text-field.json +19 -4
  39. package/schemas/components/tooltip.json +2 -2
  40. package/schemas/components/tree-view.json +1 -1
@@ -0,0 +1,41 @@
1
+ {
2
+ "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/component.json",
3
+ "$id": "https://opensource.adobe.com/spectrum-tokens/schemas/components/drop-zone.json",
4
+ "title": "Drop zone",
5
+ "description": "A drop zone allows users to drag and drop files or other content into a designated area.",
6
+ "meta": {
7
+ "category": "inputs",
8
+ "documentationUrl": "https://spectrum.adobe.com/page/drop-zone/"
9
+ },
10
+ "type": "object",
11
+ "properties": {
12
+ "accept": {
13
+ "type": "array",
14
+ "items": {
15
+ "type": "string",
16
+ "description": "File types that are accepted by the drop zone."
17
+ }
18
+ },
19
+ "size": {
20
+ "type": "string",
21
+ "enum": ["s", "m", "l"],
22
+ "default": "m"
23
+ },
24
+ "actionLabel": {
25
+ "type": "string",
26
+ "description": "If undefined, this button does not appear."
27
+ },
28
+ "onDrop": {
29
+ "type": "string",
30
+ "description": "Callback function called when files are dropped onto the drop zone."
31
+ },
32
+ "onDragOver": {
33
+ "type": "string",
34
+ "description": "Callback function called when a file is dragged over the drop zone."
35
+ },
36
+ "onDragLeave": {
37
+ "type": "string",
38
+ "description": "Callback function called when a file is dragged out of the drop zone."
39
+ }
40
+ }
41
+ }
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "variant": {
16
16
  "type": "string",
17
- "enum": ["neutral"],
17
+ "enum": ["neutral", "negative"],
18
18
  "default": "neutral"
19
19
  },
20
20
  "hideIcon": {
@@ -29,7 +29,8 @@
29
29
  },
30
30
  "isDisabled": {
31
31
  "type": "boolean",
32
- "default": false
32
+ "default": false,
33
+ "description": "Help text cannot be both disabled and negative variant."
33
34
  }
34
35
  }
35
36
  }
@@ -17,9 +17,27 @@
17
17
  "positive",
18
18
  "notice",
19
19
  "negative",
20
- "neutral"
20
+ "accent"
21
21
  ],
22
22
  "default": "neutral"
23
+ },
24
+ "style": {
25
+ "type": "string",
26
+ "enum": ["bold", "subtle", "outline"],
27
+ "default": "outline",
28
+ "description": "The visual style of the alert."
29
+ },
30
+ "href": {
31
+ "type": "string",
32
+ "description": "Optional URL within in-line alert content like a 'Learn more' link."
33
+ },
34
+ "heading": {
35
+ "type": "string",
36
+ "description": "Optional heading text displayed at the top of the alert."
37
+ },
38
+ "actionLabel": {
39
+ "type": "string",
40
+ "description": "If undefined, this button does not appear."
23
41
  }
24
42
  }
25
43
  }
@@ -11,8 +11,7 @@
11
11
  "properties": {
12
12
  "container": {
13
13
  "type": "string",
14
- "enum": ["popover", "tray"],
15
- "default": null
14
+ "enum": ["popover", "tray"]
16
15
  },
17
16
  "label": {
18
17
  "type": "string"
@@ -34,8 +33,7 @@
34
33
  },
35
34
  "selectionMode": {
36
35
  "type": "string",
37
- "enum": ["single", "multiple"],
38
- "default": null
36
+ "enum": ["single", "multiple", "no selection"]
39
37
  },
40
38
  "selectionStyle": {
41
39
  "type": "string",
@@ -17,6 +17,10 @@
17
17
  "label": {
18
18
  "type": "string"
19
19
  },
20
+ "hideLabel": {
21
+ "type": "boolean",
22
+ "default": false
23
+ },
20
24
  "valueLabel": {
21
25
  "type": "string"
22
26
  },
@@ -0,0 +1,73 @@
1
+ {
2
+ "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/component.json",
3
+ "$id": "https://opensource.adobe.com/spectrum-tokens/schemas/components/number-field.json",
4
+ "title": "Number field",
5
+ "description": "Number fields allow users to enter a numeric value, with optional increment and decrement buttons.",
6
+ "meta": {
7
+ "category": "inputs",
8
+ "documentationUrl": "https://spectrum.adobe.com/page/number-field/"
9
+ },
10
+ "type": "object",
11
+ "properties": {
12
+ "label": {
13
+ "type": "string"
14
+ },
15
+ "size": {
16
+ "type": "string",
17
+ "enum": [
18
+ "s",
19
+ "m",
20
+ "l",
21
+ "xl"
22
+ ],
23
+ "default": "m"
24
+ },
25
+ "labelPosition": {
26
+ "type": "string",
27
+ "default": "top",
28
+ "enum": [
29
+ "top",
30
+ "side"
31
+ ]
32
+ },
33
+ "hideLabel": {
34
+ "type": "boolean",
35
+ "default": false
36
+ },
37
+ "state": {
38
+ "type": "string",
39
+ "enum": [
40
+ "default",
41
+ "hover",
42
+ "focus + hover",
43
+ "focus + not hover"
44
+ ],
45
+ "default": "default"
46
+ },
47
+ "isDisabled": {
48
+ "type": "boolean",
49
+ "default": false
50
+ },
51
+ "isError": {
52
+ "type": "boolean",
53
+ "default": false
54
+ },
55
+ "isRequired": {
56
+ "type": "boolean",
57
+ "default": false
58
+ },
59
+ "necessityIndicator": {
60
+ "type": "string",
61
+ "enum": [
62
+ "text",
63
+ "icon"
64
+ ],
65
+ "default": "icon"
66
+ },
67
+ "hideStepper": {
68
+ "type": "boolean",
69
+ "default": false,
70
+ "description": "If true, hides in-field increment and decrement buttons (stepper)."
71
+ }
72
+ }
73
+ }
@@ -15,9 +15,9 @@
15
15
  "height": {
16
16
  "type": "number"
17
17
  },
18
- "showTip": {
18
+ "hideTip": {
19
19
  "type": "boolean",
20
- "default": true
20
+ "default": false
21
21
  },
22
22
  "placement": {
23
23
  "type": "string",
@@ -14,9 +14,23 @@
14
14
  "enum": ["default", "over background"],
15
15
  "default": "default"
16
16
  },
17
+ "staticColor": {
18
+ "type": "string",
19
+ "enum": ["white"],
20
+ "description": "Static color can only be white, otherwise it is default."
21
+ },
17
22
  "label": {
18
23
  "type": "string"
19
24
  },
25
+ "labelPosition": {
26
+ "type": "string",
27
+ "enum": ["top", "side"],
28
+ "default": "top"
29
+ },
30
+ "hideLabel": {
31
+ "type": "boolean",
32
+ "default": false
33
+ },
20
34
  "value": {
21
35
  "type": "number",
22
36
  "description": "Not applicable when indeterminate."
@@ -11,7 +11,12 @@
11
11
  "properties": {
12
12
  "state": {
13
13
  "type": "string",
14
- "enum": ["default", "hover", "down", "keyboard focus"],
14
+ "enum": [
15
+ "default",
16
+ "hover",
17
+ "down",
18
+ "keyboard focus"
19
+ ],
15
20
  "default": "default"
16
21
  },
17
22
  "isSelected": {
@@ -23,8 +28,8 @@
23
28
  "default": false
24
29
  },
25
30
  "label": {
26
- "type": "boolean",
27
- "default": true
31
+ "type": "string",
32
+ "description": "The text displayed next to a radio button."
28
33
  }
29
34
  }
30
35
  }
@@ -48,10 +48,6 @@
48
48
  "type": "boolean",
49
49
  "default": false
50
50
  },
51
- "isReadOnly": {
52
- "type": "boolean",
53
- "default": false
54
- },
55
51
  "errorMessage": {
56
52
  "type": "string"
57
53
  },
@@ -11,9 +11,11 @@
11
11
  "properties": {
12
12
  "value": {
13
13
  "type": "number",
14
- "enum": [0, 1, 2, 3, 4, 5],
14
+ "minimum": 0,
15
+ "maximum": 5,
15
16
  "default": 0,
16
- "description": "From 0 to 5"
17
+ "multipleOf": 0.5,
18
+ "description": "From 0 to 5, can be a decimal to represent half stars"
17
19
  },
18
20
  "isEmphasized": {
19
21
  "type": "boolean",
@@ -31,7 +31,7 @@
31
31
  "type": "boolean",
32
32
  "default": false
33
33
  },
34
- "isDetatched": {
34
+ "isDetached": {
35
35
  "type": "boolean",
36
36
  "default": false
37
37
  },
@@ -12,6 +12,14 @@
12
12
  "label": {
13
13
  "type": "string"
14
14
  },
15
+ "hideLabel": {
16
+ "type": "boolean",
17
+ "default": false
18
+ },
19
+ "icon": {
20
+ "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/types/workflow-icon.json",
21
+ "description": "Icon must be present if the label is not defined."
22
+ },
15
23
  "value": {
16
24
  "type": "string"
17
25
  },
@@ -0,0 +1,89 @@
1
+ {
2
+ "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/component.json",
3
+ "$id": "https://opensource.adobe.com/spectrum-tokens/schemas/components/segmented-control.json",
4
+ "title": "Segmented Control",
5
+ "description": "Segmented controls allow users to select one option from a set of mutually exclusive options.",
6
+ "meta": {
7
+ "category": "navigation",
8
+ "documentationUrl": "https://spectrum.adobe.com/page/segmented-control/"
9
+ },
10
+ "type": "object",
11
+ "properties": {
12
+ "orientation": {
13
+ "type": "string",
14
+ "enum": [
15
+ "horizontal",
16
+ "vertical"
17
+ ],
18
+ "default": "horizontal"
19
+ },
20
+ "isFluid": {
21
+ "type": "boolean",
22
+ "default": false,
23
+ "description": "If true, the control takes up the full width of its container. Only applicable to horizontal segmented controls."
24
+ },
25
+ "alignment": {
26
+ "type": "string",
27
+ "enum": [
28
+ "start",
29
+ "center"
30
+ ],
31
+ "default": "start"
32
+ },
33
+ "hideTracker": {
34
+ "type": "boolean",
35
+ "default": false,
36
+ "description": "If true, the tracker that indicates the selected item is hidden."
37
+ },
38
+ "selectedItem": {
39
+ "type": "string",
40
+ "description": "The identifier of the currently selected item."
41
+ },
42
+ "keyboardActivation": {
43
+ "type": "string",
44
+ "enum": [
45
+ "manual",
46
+ "automatic"
47
+ ],
48
+ "default": "manual"
49
+ },
50
+ "items": {
51
+ "type": "array",
52
+ "description": "An array of segmented control items.",
53
+ "items": {
54
+ "type": "object",
55
+ "properties": {
56
+ "label": {
57
+ "type": "string",
58
+ "description": "The text displayed for the segmented control item."
59
+ },
60
+ "isDisabled": {
61
+ "type": "boolean",
62
+ "default": false,
63
+ "description": "Whether the segmented control item is disabled."
64
+ },
65
+ "state": {
66
+ "type": "string",
67
+ "enum": [
68
+ "default",
69
+ "hover",
70
+ "keyboard focus"
71
+ ],
72
+ "default": "default",
73
+ "description": "The interaction state of the segmented control item."
74
+ },
75
+ "contentVariant": {
76
+ "type": "string",
77
+ "enum": [
78
+ "label-only",
79
+ "icon-only",
80
+ "icon-label"
81
+ ],
82
+ "default": "icon-label",
83
+ "description": "Controls whether the segmented control item displays a label, an icon, or both."
84
+ }
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }
@@ -15,7 +15,7 @@
15
15
  "orientation": {
16
16
  "type": "string",
17
17
  "enum": ["horizontal", "vertical"],
18
- "default": "horizontal"
18
+ "default": "vertical"
19
19
  },
20
20
  "body": {
21
21
  "type": "string"
@@ -24,7 +24,7 @@
24
24
  "type": "boolean",
25
25
  "default": false
26
26
  },
27
- "showIllustration": {
27
+ "hideIllustration": {
28
28
  "type": "boolean",
29
29
  "default": false
30
30
  },
@@ -32,10 +32,19 @@
32
32
  "type": "boolean",
33
33
  "default": false
34
34
  },
35
+ "isDisabled": {
36
+ "type": "boolean",
37
+ "default": false
38
+ },
35
39
  "state": {
36
40
  "type": "string",
37
41
  "enum": ["default", "down", "hover", "keyboard focus"],
38
42
  "default": "default"
43
+ },
44
+ "multiple": {
45
+ "type": "boolean",
46
+ "default": false,
47
+ "description": "Set to true to allow multiple selections."
39
48
  }
40
49
  }
41
50
  }
@@ -15,7 +15,10 @@
15
15
  "labelPosition": {
16
16
  "type": "string",
17
17
  "default": "top",
18
- "enum": ["top", "side"]
18
+ "enum": [
19
+ "top",
20
+ "side"
21
+ ]
19
22
  },
20
23
  "value": {
21
24
  "type": "number",
@@ -29,6 +32,11 @@
29
32
  "type": "number",
30
33
  "default": 100
31
34
  },
35
+ "isRange": {
36
+ "type": "boolean",
37
+ "default": false,
38
+ "description": "If true, the slider will allow selection of a range of values by displaying two handles."
39
+ },
32
40
  "step": {
33
41
  "type": "number",
34
42
  "default": 1
@@ -39,7 +47,10 @@
39
47
  },
40
48
  "progressionScale": {
41
49
  "type": "string",
42
- "enum": ["linear", "log"],
50
+ "enum": [
51
+ "linear",
52
+ "log"
53
+ ],
43
54
  "default": "linear"
44
55
  },
45
56
  "width": {
@@ -67,7 +78,12 @@
67
78
  },
68
79
  "state": {
69
80
  "type": "string",
70
- "enum": ["default", "hover", "down", "keyboard focus"],
81
+ "enum": [
82
+ "default",
83
+ "hover",
84
+ "down",
85
+ "keyboard focus"
86
+ ],
71
87
  "default": "default"
72
88
  }
73
89
  }
@@ -32,7 +32,12 @@
32
32
  "turquoise",
33
33
  "cinnamon",
34
34
  "brown",
35
- "silver"
35
+ "silver",
36
+ "gray",
37
+ "red",
38
+ "orange",
39
+ "green",
40
+ "cyan"
36
41
  ],
37
42
  "default": "informative"
38
43
  },
@@ -40,10 +45,7 @@
40
45
  "type": "string",
41
46
  "enum": ["s", "m", "l", "xl"],
42
47
  "default": "m"
43
- },
44
- "isDisabled": {
45
- "type": "boolean",
46
- "default": false
47
48
  }
48
- }
49
+ },
50
+ "required": ["label"]
49
51
  }
@@ -0,0 +1,52 @@
1
+ {
2
+ "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/component.json",
3
+ "$id": "https://opensource.adobe.com/spectrum-tokens/schemas/components/step-list.json",
4
+ "title": "Step list",
5
+ "description": "Step lists display progress through a sequence of steps, with each step marked as completed, current, or incomplete.",
6
+ "meta": {
7
+ "category": "navigation",
8
+ "documentationUrl": "https://spectrum.adobe.com/page/step-list/"
9
+ },
10
+ "type": "object",
11
+ "properties": {
12
+ "orientation": {
13
+ "type": "string",
14
+ "enum": ["horizontal", "vertical"],
15
+ "default": "horizontal"
16
+ },
17
+ "items": {
18
+ "type": "array",
19
+ "description": "An array of step items in the step list.",
20
+ "items": {
21
+ "type": "object",
22
+ "properties": {
23
+ "label": {
24
+ "type": "string",
25
+ "description": "The text displayed for the step item."
26
+ },
27
+ "isDisabled": {
28
+ "type": "boolean",
29
+ "default": false,
30
+ "description": "Whether the step item is disabled."
31
+ },
32
+ "stepState": {
33
+ "type": "string",
34
+ "enum": [
35
+ "completed default",
36
+ "completed hover",
37
+ "current default",
38
+ "incomplete default"
39
+ ],
40
+ "default": "current default",
41
+ "description": "The current state of the step item."
42
+ }
43
+ },
44
+ "required": ["label", "stepState"]
45
+ }
46
+ },
47
+ "currentStep": {
48
+ "type": "string",
49
+ "description": "The identifier or label of the currently active step."
50
+ }
51
+ }
52
+ }
@@ -11,12 +11,21 @@
11
11
  "properties": {
12
12
  "size": {
13
13
  "type": "string",
14
- "enum": ["xs", "s", "m", "l"],
14
+ "enum": [
15
+ "xs",
16
+ "s",
17
+ "m",
18
+ "l"
19
+ ],
15
20
  "default": "m"
16
21
  },
17
22
  "density": {
18
23
  "type": "string",
19
- "enum": ["compact", "regular", "spacious"],
24
+ "enum": [
25
+ "compact",
26
+ "regular",
27
+ "spacious"
28
+ ],
20
29
  "default": "regular"
21
30
  },
22
31
  "enableSelection": {
@@ -26,13 +35,26 @@
26
35
  "selectionMode": {
27
36
  "type": "string",
28
37
  "description": "Only applicable if selection is enabled.",
29
- "enum": ["single", "multiple"],
38
+ "enum": [
39
+ "single",
40
+ "multiple"
41
+ ],
30
42
  "default": "single"
31
43
  },
32
44
  "allowsEmptySelection": {
33
45
  "type": "boolean",
34
46
  "default": false,
35
47
  "description": "Only applicable if selection is enabled."
48
+ },
49
+ "cornerRadius": {
50
+ "type": "string",
51
+ "enum": [
52
+ "none",
53
+ "full",
54
+ "partial"
55
+ ],
56
+ "default": "none",
57
+ "description": "Determines the corner radius of each swatch in the group. Partial refers to corner-radius-75."
36
58
  }
37
59
  }
38
60
  }
@@ -15,18 +15,31 @@
15
15
  },
16
16
  "size": {
17
17
  "type": "string",
18
- "enum": ["xs", "s", "m", "l"],
18
+ "enum": [
19
+ "xs",
20
+ "s",
21
+ "m",
22
+ "l"
23
+ ],
19
24
  "default": "m"
20
25
  },
21
26
  "shape": {
22
27
  "type": "string",
23
- "enum": ["square", "rectangle"],
28
+ "enum": [
29
+ "square",
30
+ "rectangle"
31
+ ],
24
32
  "default": "square"
25
33
  },
26
34
  "cornerRounding": {
27
35
  "type": "string",
28
- "enum": ["default", "full"],
29
- "default": "default"
36
+ "enum": [
37
+ "none",
38
+ "partial",
39
+ "full"
40
+ ],
41
+ "default": "none",
42
+ "description": "Determines the corner radius of the swatch. Partial refers to corner-radius-75."
30
43
  },
31
44
  "isSelected": {
32
45
  "type": "boolean",
@@ -38,7 +51,12 @@
38
51
  },
39
52
  "state": {
40
53
  "type": "string",
41
- "enum": ["default", "hover", "down", "keyboard focus"],
54
+ "enum": [
55
+ "default",
56
+ "hover",
57
+ "down",
58
+ "keyboard focus"
59
+ ],
42
60
  "default": "default"
43
61
  }
44
62
  }