@adobe/spectrum-design-data 0.4.0 → 0.7.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 (96) hide show
  1. package/components/accordion.json +108 -194
  2. package/components/action-bar.json +64 -97
  3. package/components/action-button.json +95 -230
  4. package/components/action-group.json +88 -86
  5. package/components/alert-banner.json +104 -76
  6. package/components/alert-dialog.json +78 -126
  7. package/components/avatar-group.json +61 -119
  8. package/components/avatar.json +98 -212
  9. package/components/badge.json +138 -256
  10. package/components/breadcrumbs.json +95 -89
  11. package/components/button-group.json +57 -48
  12. package/components/button.json +151 -368
  13. package/components/calendar.json +97 -34
  14. package/components/cards.json +109 -250
  15. package/components/checkbox-group.json +50 -58
  16. package/components/checkbox.json +121 -186
  17. package/components/close-button.json +61 -124
  18. package/components/coach-indicator.json +63 -72
  19. package/components/coach-mark.json +89 -93
  20. package/components/color-area.json +68 -94
  21. package/components/color-handle.json +39 -79
  22. package/components/color-loupe.json +35 -52
  23. package/components/color-slider.json +95 -116
  24. package/components/color-wheel.json +67 -73
  25. package/components/combo-box.json +243 -331
  26. package/components/contextual-help.json +86 -175
  27. package/components/date-picker.json +139 -179
  28. package/components/divider.json +30 -69
  29. package/components/drop-zone.json +51 -92
  30. package/components/field-label.json +75 -117
  31. package/components/help-text.json +81 -105
  32. package/components/illustrated-message.json +106 -73
  33. package/components/in-line-alert.json +50 -83
  34. package/components/link.json +63 -85
  35. package/components/list-view.json +107 -146
  36. package/components/menu.json +180 -274
  37. package/components/meter.json +72 -118
  38. package/components/number-field.json +213 -305
  39. package/components/picker.json +208 -320
  40. package/components/popover.json +94 -129
  41. package/components/progress-bar.json +94 -131
  42. package/components/progress-circle.json +45 -72
  43. package/components/radio-button.json +87 -156
  44. package/components/radio-group.json +107 -74
  45. package/components/rating.json +66 -99
  46. package/components/search-field.json +132 -202
  47. package/components/segmented-control.json +94 -109
  48. package/components/select-box.json +119 -179
  49. package/components/side-navigation.json +108 -118
  50. package/components/slider.json +143 -228
  51. package/components/standard-dialog.json +96 -114
  52. package/components/standard-panel.json +105 -53
  53. package/components/status-light.json +104 -240
  54. package/components/steplist.json +77 -161
  55. package/components/swatch-group.json +42 -58
  56. package/components/swatch.json +75 -162
  57. package/components/switch.json +101 -189
  58. package/components/table.json +97 -102
  59. package/components/tabs.json +77 -104
  60. package/components/tag-field.json +86 -150
  61. package/components/tag-group.json +50 -44
  62. package/components/tag.json +81 -198
  63. package/components/takeover-dialog.json +59 -57
  64. package/components/text-area.json +200 -323
  65. package/components/text-field.json +183 -304
  66. package/components/thumbnail.json +63 -105
  67. package/components/toast.json +97 -83
  68. package/components/tooltip.json +104 -96
  69. package/components/tree-view.json +169 -181
  70. package/guidelines/app-frame-content-area.json +81 -0
  71. package/guidelines/app-frame-creating-bluelines.json +58 -0
  72. package/guidelines/app-frame-header.json +72 -0
  73. package/guidelines/app-frame-overview.json +167 -0
  74. package/guidelines/app-frame-side-navigation.json +138 -0
  75. package/guidelines/attention-hierarchy.json +42 -0
  76. package/guidelines/background-layers.json +38 -0
  77. package/guidelines/brand.json +50 -0
  78. package/guidelines/colors.json +62 -0
  79. package/guidelines/containers.json +62 -0
  80. package/guidelines/developer-overview.json +35 -0
  81. package/guidelines/faqs.json +35 -0
  82. package/guidelines/fonts.json +58 -0
  83. package/guidelines/grays.json +66 -0
  84. package/guidelines/icon-fundamentals.json +45 -0
  85. package/guidelines/illustrations.json +111 -0
  86. package/guidelines/introduction.json +31 -0
  87. package/guidelines/manifest.json +204 -0
  88. package/guidelines/motion.json +41 -0
  89. package/guidelines/object-styles.json +102 -0
  90. package/guidelines/principles.json +30 -0
  91. package/guidelines/resources.json +59 -0
  92. package/guidelines/spacing.json +25 -0
  93. package/guidelines/states.json +34 -0
  94. package/guidelines/typography-fundamentals.json +142 -0
  95. package/guidelines/using-icons.json +107 -0
  96. package/package.json +4 -2
@@ -9,18 +9,41 @@
9
9
  "category": "status",
10
10
  "documentationUrl": "https://spectrum.adobe.com/page/progress-circle/"
11
11
  },
12
+ "documentBlocks": [
13
+ {
14
+ "type": "purpose",
15
+ "content": "Progress circles show the progression of a system operation such as downloading, uploading, processing, etc. in a visual way. They can represent determinate or indeterminate progress."
16
+ },
17
+ {
18
+ "type": "guideline",
19
+ "content": "Progress circles can be determinate or indeterminate. Use determinate when progress can be measured against a goal, such as downloading a file. Use indeterminate when the duration or effort is unknown, like reconnecting to a server."
20
+ },
21
+ {
22
+ "type": "guideline",
23
+ "content": "Progress circles come in 3 sizes: small, medium (default), or large. These are available to fit various contexts. For example, the small progress circle can be used in place of an icon or in tight spaces, while the large one can be used for full-page loading."
24
+ },
25
+ {
26
+ "type": "guideline",
27
+ "content": "The value represents progress within the circle’s range, from minimum to maximum. These defaults are 0 and 100 but can be customized. Min and max values don’t apply to indeterminate progress circles."
28
+ },
29
+ {
30
+ "type": "guideline",
31
+ "content": "When a progress circle needs to be placed on top of a colored background, use the over background variant. This progress circle uses a static white color regardless of the color theme. Make sure the background offers enough contrast for the progress circle to be legible."
32
+ },
33
+ {
34
+ "type": "guideline",
35
+ "content": "Medium and large progress circles are optimized for large areas with no space constraints. Use them for loading content into views (e.g., web pages, panels, etc.)"
36
+ },
37
+ {
38
+ "type": "guideline",
39
+ "content": "Small progress circles are well suited when space is limited both vertically and horizontally, such as in buttons, menu items, and input fields."
40
+ }
41
+ ],
12
42
  "options": {
13
43
  "variant": {
14
44
  "type": "string",
15
45
  "default": "default",
16
- "values": [
17
- {
18
- "value": "default"
19
- },
20
- {
21
- "value": "over background"
22
- }
23
- ]
46
+ "values": [{ "value": "default" }, { "value": "over background" }]
24
47
  },
25
48
  "value": {
26
49
  "type": "number",
@@ -39,63 +62,21 @@
39
62
  "size": {
40
63
  "type": "string",
41
64
  "default": "m",
42
- "values": [
43
- {
44
- "value": "s"
45
- },
46
- {
47
- "value": "m"
48
- },
49
- {
50
- "value": "l"
51
- }
52
- ]
65
+ "values": [{ "value": "s" }, { "value": "m" }, { "value": "l" }]
53
66
  },
54
- "isIndeterminate": {
55
- "type": "boolean",
56
- "default": false
57
- }
58
- },
59
- "lifecycle": {
60
- "introduced": "1.0.0-draft"
67
+ "isIndeterminate": { "type": "boolean", "default": false }
61
68
  },
69
+ "lifecycle": { "introduced": "1.0.0-draft" },
62
70
  "tokenBindings": [
63
- {
64
- "token": "progress-circle-size-small",
65
- "context": "Size"
66
- },
67
- {
68
- "token": "progress-circle-size-medium",
69
- "context": "Size"
70
- },
71
- {
72
- "token": "progress-circle-size-large",
73
- "context": "Size"
74
- },
75
- {
76
- "token": "progress-circle-thickness-small",
77
- "context": "Thickness"
78
- },
79
- {
80
- "token": "progress-circle-thickness-medium",
81
- "context": "Thickness"
82
- },
83
- {
84
- "token": "progress-circle-thickness-large",
85
- "context": "Thickness"
86
- },
87
- {
88
- "token": "corner-radius-full",
89
- "context": "Rounding (fill)"
90
- },
91
- {
92
- "token": "track-color",
93
- "context": "Track and fill"
94
- },
95
- {
96
- "token": "accent-content-color-default",
97
- "context": "Track and fill"
98
- },
71
+ { "token": "progress-circle-size-small", "context": "Size" },
72
+ { "token": "progress-circle-size-medium", "context": "Size" },
73
+ { "token": "progress-circle-size-large", "context": "Size" },
74
+ { "token": "progress-circle-thickness-small", "context": "Thickness" },
75
+ { "token": "progress-circle-thickness-medium", "context": "Thickness" },
76
+ { "token": "progress-circle-thickness-large", "context": "Thickness" },
77
+ { "token": "corner-radius-full", "context": "Rounding (fill)" },
78
+ { "token": "track-color", "context": "Track and fill" },
79
+ { "token": "accent-content-color-default", "context": "Track and fill" },
99
80
  {
100
81
  "token": "static-white-track-color",
101
82
  "context": "Track and fill (white)"
@@ -117,16 +98,8 @@
117
98
  "role": "progressbar",
118
99
  "focusable": false,
119
100
  "wcag": [
120
- {
121
- "criterion": "4.1.2",
122
- "level": "A",
123
- "title": "Name, Role, Value"
124
- },
125
- {
126
- "criterion": "4.1.3",
127
- "level": "AA",
128
- "title": "Status Messages"
129
- }
101
+ { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" },
102
+ { "criterion": "4.1.3", "level": "AA", "title": "Status Messages" }
130
103
  ]
131
104
  }
132
105
  }
@@ -9,37 +9,70 @@
9
9
  "category": "inputs",
10
10
  "documentationUrl": "https://spectrum.adobe.com/page/radio-button/"
11
11
  },
12
- "options": {
13
- "isSelected": {
14
- "type": "boolean",
15
- "default": false
12
+ "documentBlocks": [
13
+ {
14
+ "type": "purpose",
15
+ "content": "Radio buttons allow users to select a single option from a list of mutually exclusive options."
16
16
  },
17
- "isEmphasized": {
18
- "type": "boolean",
19
- "default": false
17
+ {
18
+ "type": "guideline",
19
+ "content": "Radio buttons present a list of options where only one can be selected at a time. They are styled consistently with other components that support binary selection. Use when all options should be visible and only one can apply."
20
+ },
21
+ {
22
+ "type": "guideline",
23
+ "content": "Radio button should always have a label for accessibility and clear comprehension. When the label is not defined, a radio button becomes standalone. Standalone radio buttons should only be used when their connection to other components is clear and they give sufficient context — for example, in application panels."
24
+ },
25
+ {
26
+ "type": "guideline",
27
+ "content": "By default, radio buttons are not emphasized. This version is optimal for when the radio button is not the core part of an interface, such as in application panels, where all visual components are monochrome in order to direct focus to the content."
28
+ },
29
+ {
30
+ "type": "guideline",
31
+ "content": "The emphasized version provides a visual prominence that is optimal for forms, settings, lists or grids of assets, and other situations where a radio button needs to be noticed."
32
+ },
33
+ {
34
+ "type": "guideline",
35
+ "content": "Radio button can either be selected or not selected. They cannot be in an indeterminate state (unlike checkboxes)."
36
+ },
37
+ {
38
+ "type": "guideline",
39
+ "content": "Radio buttons come in four different sizes: small, medium, large, and extra-large. The medium size is the default and most frequently used option. Use the other sizes sparingly; they should be used to create a hierarchy of importance within the page."
40
+ },
41
+ {
42
+ "type": "guideline",
43
+ "content": "A radio button can be navigated using a keyboard. The keyboard focus state takes the radio button’s visual hover state and adds a blue ring to the radio button in focus."
44
+ },
45
+ {
46
+ "type": "guideline",
47
+ "content": "When the button text is too long for the horizontal space available, it wraps to form another line."
20
48
  },
21
- "label": {
22
- "type": "string",
23
- "description": "The text displayed next to a radio button."
24
- }
25
- },
26
- "states": [
27
49
  {
28
- "name": "hover",
29
- "trigger": "interaction"
50
+ "type": "guideline",
51
+ "content": "Radio buttons are best when only one option can be selected at a time from a set (for example choosing one preference or mode). Switches are best for communicating activation (e.g., turning a setting on or off). Checkboxes are best for communicating selection (e.g., selecting multiple items from a list)."
30
52
  },
31
53
  {
32
- "name": "down",
33
- "trigger": "interaction"
54
+ "type": "guideline",
55
+ "content": "Emphasized radio buttons are optimal for forms, settings, and other scenarios where the radio buttons need to be noticed. Default radio buttons are optimal for application panels where all the visual components are monochrome in order to direct focus to the canvas."
34
56
  },
35
57
  {
36
- "name": "keyboard-focus",
37
- "trigger": "interaction"
58
+ "type": "guideline",
59
+ "content": "Radio buttons can only be on or off. Indeterminate radio buttons don’t exist in accessibility APIs, so it’s not possible to make an indeterminate radio button accessible. If you need to show a partial state, use a checkbox instead of a radio button. When a parent radio button represents a group of radio buttons, it should be turned off unless all of the radio buttons are on (turning the parent radio button on turns all of the radio buttons on)."
38
60
  }
39
61
  ],
40
- "lifecycle": {
41
- "introduced": "1.0.0-draft"
62
+ "options": {
63
+ "isSelected": { "type": "boolean", "default": false },
64
+ "isEmphasized": { "type": "boolean", "default": false },
65
+ "label": {
66
+ "type": "string",
67
+ "description": "The text displayed next to a radio button."
68
+ }
42
69
  },
70
+ "states": [
71
+ { "name": "hover", "trigger": "interaction" },
72
+ { "name": "down", "trigger": "interaction" },
73
+ { "name": "keyboard-focus", "trigger": "interaction" }
74
+ ],
75
+ "lifecycle": { "introduced": "1.0.0-draft" },
43
76
  "tokenBindings": [
44
77
  {
45
78
  "token": "radio-button-control-size-small",
@@ -97,22 +130,10 @@
97
130
  "token": "neutral-background-color-selected-key-focus",
98
131
  "context": "S1 Control (selected, non emphasized)"
99
132
  },
100
- {
101
- "token": "component-height-75",
102
- "context": "Minimum height"
103
- },
104
- {
105
- "token": "component-height-100",
106
- "context": "Minimum height"
107
- },
108
- {
109
- "token": "component-height-200",
110
- "context": "Minimum height"
111
- },
112
- {
113
- "token": "component-height-300",
114
- "context": "Minimum height"
115
- },
133
+ { "token": "component-height-75", "context": "Minimum height" },
134
+ { "token": "component-height-100", "context": "Minimum height" },
135
+ { "token": "component-height-200", "context": "Minimum height" },
136
+ { "token": "component-height-300", "context": "Minimum height" },
116
137
  {
117
138
  "token": "component-size-difference-down",
118
139
  "context": "Component size (down)"
@@ -125,26 +146,11 @@
125
146
  "token": "component-size-minimum-perspective-down",
126
147
  "context": "Component size (down)"
127
148
  },
128
- {
129
- "token": "border-width-200",
130
- "context": "Control (border)"
131
- },
132
- {
133
- "token": "text-to-control-75",
134
- "context": "Spacing (control to label)"
135
- },
136
- {
137
- "token": "text-to-control-100",
138
- "context": "Spacing (control to label)"
139
- },
140
- {
141
- "token": "text-to-control-200",
142
- "context": "Spacing (control to label)"
143
- },
144
- {
145
- "token": "text-to-control-300",
146
- "context": "Spacing (control to label)"
147
- },
149
+ { "token": "border-width-200", "context": "Control (border)" },
150
+ { "token": "text-to-control-75", "context": "Spacing (control to label)" },
151
+ { "token": "text-to-control-100", "context": "Spacing (control to label)" },
152
+ { "token": "text-to-control-200", "context": "Spacing (control to label)" },
153
+ { "token": "text-to-control-300", "context": "Spacing (control to label)" },
148
154
  {
149
155
  "token": "component-top-to-text-75",
150
156
  "context": "Spacing (top/bottom edge to label)"
@@ -177,42 +183,18 @@
177
183
  "token": "component-bottom-to-text-300",
178
184
  "context": "Spacing (top/bottom edge to label)"
179
185
  },
180
- {
181
- "token": "focus-indicator-thickness",
182
- "context": "Focus ring"
183
- },
184
- {
185
- "token": "focus-indicator-gap",
186
- "context": "Focus ring"
187
- },
186
+ { "token": "focus-indicator-thickness", "context": "Focus ring" },
187
+ { "token": "focus-indicator-gap", "context": "Focus ring" },
188
188
  {
189
189
  "token": "radio-button-selection-indicator",
190
190
  "context": "Selection indicator"
191
191
  },
192
- {
193
- "token": "spacing-300",
194
- "context": "Radio group spacing (horizontal)"
195
- },
196
- {
197
- "token": "neutral-content-color-default",
198
- "context": "Label"
199
- },
200
- {
201
- "token": "neutral-content-color-hover",
202
- "context": "Label"
203
- },
204
- {
205
- "token": "neutral-content-color-down",
206
- "context": "Label"
207
- },
208
- {
209
- "token": "neutral-content-color-key-focus",
210
- "context": "Label"
211
- },
212
- {
213
- "token": "gray-25",
214
- "context": "Control"
215
- },
192
+ { "token": "spacing-300", "context": "Radio group spacing (horizontal)" },
193
+ { "token": "neutral-content-color-default", "context": "Label" },
194
+ { "token": "neutral-content-color-hover", "context": "Label" },
195
+ { "token": "neutral-content-color-down", "context": "Label" },
196
+ { "token": "neutral-content-color-key-focus", "context": "Label" },
197
+ { "token": "gray-25", "context": "Control" },
216
198
  {
217
199
  "token": "accent-content-color-default",
218
200
  "context": "Control (selected, emphasized)"
@@ -229,58 +211,19 @@
229
211
  "token": "accent-content-color-key-focus",
230
212
  "context": "Control (selected, emphasized)"
231
213
  },
232
- {
233
- "token": "disabled-content-color",
234
- "context": "Label (disabled)"
235
- },
236
- {
237
- "token": "focus-indicator-color",
238
- "context": "Focus ring"
239
- },
240
- {
241
- "token": "negative-color-900",
242
- "context": "Radio button colors"
243
- },
244
- {
245
- "token": "negative-color-1000",
246
- "context": "Radio button colors"
247
- },
248
- {
249
- "token": "default-font-family",
250
- "context": "Label"
251
- },
252
- {
253
- "token": "regular-font-weight",
254
- "context": "Label"
255
- },
256
- {
257
- "token": "default-font-style",
258
- "context": "Label"
259
- },
260
- {
261
- "token": "font-size-75",
262
- "context": "Label"
263
- },
264
- {
265
- "token": "font-size-100",
266
- "context": "Label"
267
- },
268
- {
269
- "token": "font-size-200",
270
- "context": "Label"
271
- },
272
- {
273
- "token": "font-size-300",
274
- "context": "Label"
275
- },
276
- {
277
- "token": "line-height-100",
278
- "context": "Label"
279
- },
280
- {
281
- "token": "cjk-line-height-100",
282
- "context": "Label"
283
- }
214
+ { "token": "disabled-content-color", "context": "Label (disabled)" },
215
+ { "token": "focus-indicator-color", "context": "Focus ring" },
216
+ { "token": "negative-color-900", "context": "Radio button colors" },
217
+ { "token": "negative-color-1000", "context": "Radio button colors" },
218
+ { "token": "default-font-family", "context": "Label" },
219
+ { "token": "regular-font-weight", "context": "Label" },
220
+ { "token": "default-font-style", "context": "Label" },
221
+ { "token": "font-size-75", "context": "Label" },
222
+ { "token": "font-size-100", "context": "Label" },
223
+ { "token": "font-size-200", "context": "Label" },
224
+ { "token": "font-size-300", "context": "Label" },
225
+ { "token": "line-height-100", "context": "Label" },
226
+ { "token": "cjk-line-height-100", "context": "Label" }
284
227
  ],
285
228
  "accessibility": {
286
229
  "role": "radio",
@@ -288,21 +231,9 @@
288
231
  "focusable": true,
289
232
  "keyboardIntents": ["activate"],
290
233
  "wcag": [
291
- {
292
- "criterion": "1.3.1",
293
- "level": "A",
294
- "title": "Info and Relationships"
295
- },
296
- {
297
- "criterion": "2.1.1",
298
- "level": "A",
299
- "title": "Keyboard"
300
- },
301
- {
302
- "criterion": "4.1.2",
303
- "level": "A",
304
- "title": "Name, Role, Value"
305
- }
234
+ { "criterion": "1.3.1", "level": "A", "title": "Info and Relationships" },
235
+ { "criterion": "2.1.1", "level": "A", "title": "Keyboard" },
236
+ { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
306
237
  ]
307
238
  }
308
239
  }
@@ -9,105 +9,138 @@
9
9
  "category": "inputs",
10
10
  "documentationUrl": "https://spectrum.adobe.com/page/radio-group/"
11
11
  },
12
- "options": {
13
- "label": {
14
- "type": "string"
12
+ "documentBlocks": [
13
+ {
14
+ "type": "purpose",
15
+ "content": "A radio group is a grouping of radio buttons that are related to each other."
16
+ },
17
+ {
18
+ "type": "guideline",
19
+ "content": "Radio groups organize related radio buttons into a single selection set. Only one option can be selected at a time."
20
+ },
21
+ {
22
+ "type": "guideline",
23
+ "content": "Radio groups should use help text for error messaging and descriptions. Descriptions are valuable for giving context behind why a selection is required, or for clarifying the options."
24
+ },
25
+ {
26
+ "type": "guideline",
27
+ "content": "Radio groups can be marked as having an error to show that a selection needs to be made in order to move forward, or that a selection that was made is invalid. The error is indicated with negative help text, along with an icon."
28
+ },
29
+ {
30
+ "type": "guideline",
31
+ "content": "A radio group in a disabled state shows that a selection exists, but is not available in that circumstance. This can be used to maintain layout continuity and communicate that an action may become available later. The field label, radio buttons, and help text are all displayed in a disabled state when the radio group is disabled."
32
+ },
33
+ {
34
+ "type": "guideline",
35
+ "content": "Radio groups can be marked as optional or required, depending on the situation. For required radio groups, there are two styling options: a “(required)” label or an asterisk. If you use an asterisk, be sure to include help text to explain what the asterisk means. Optional radio groups are either denoted with text added to the end of the label — “(optional)” — or have no indication at all."
36
+ },
37
+ {
38
+ "type": "guideline",
39
+ "content": "The asterisk used in this component is an icon that has specific spacing from the label text — not part of the label text itself."
40
+ },
41
+ {
42
+ "type": "guideline",
43
+ "content": "By default, radio buttons are not emphasized (gray). This option is best for when the radio button is not the core part of an interface, such as in application panels, where all visual components are monochrome in order to direct focus to the content."
44
+ },
45
+ {
46
+ "type": "guideline",
47
+ "content": "The emphasized (blue) version provides a visual prominence that is best for forms, settings, lists or grids of assets, and other situations where a radio button needs to be noticed."
48
+ },
49
+ {
50
+ "type": "guideline",
51
+ "content": "Radio groups come in four different sizes: small, medium, large, and extra-large. The medium size is the default and most frequently used option. Use the other sizes sparingly; they should be used to create a hierarchy of importance within the page."
52
+ },
53
+ {
54
+ "type": "guideline",
55
+ "content": "Radio groups can be either horizontal or vertical. By default, radio groups are vertical. Use a horizontal radio group when vertical space is limited."
56
+ },
57
+ {
58
+ "type": "guideline",
59
+ "content": "Labels can be placed either on top or on the side. Top labels are the default and are recommended because they work better with long copy, localization, and responsive layouts. Side labels are most useful when vertical space is limited."
60
+ },
61
+ {
62
+ "type": "guideline",
63
+ "content": "Radio groups should always have a label. In rare cases where context is sufficient and an accessibility expert has reviewed the design, the label could be undefined. These radio groups without a visible label should still include an aria-label in HTML (depending on the context, “aria-label” or “aria-labelledby”)."
64
+ },
65
+ {
66
+ "type": "guideline",
67
+ "content": "A radio button can be navigated using a keyboard. The keyboard focus state takes the radio button’s visual hover state and adds a blue ring to the radio button in focus."
68
+ },
69
+ {
70
+ "type": "guideline",
71
+ "content": "When the label is too long for the horizontal space available, it wraps to form another line."
72
+ },
73
+ {
74
+ "type": "guideline",
75
+ "content": "When a radio button group presents multiple values that are not identical, the group should not show a selection. Any subsequent selection should update all values."
76
+ },
77
+ {
78
+ "type": "guideline",
79
+ "content": "Emphasized radio group is optimal for forms, settings, and other scenarios where the radio group need to be noticed. Default radio group is optimal for application panels where all the visual components are monochrome in order to direct focus to the canvas."
80
+ },
81
+ {
82
+ "type": "guideline",
83
+ "content": "Radio buttons and checkboxes are not interchangeable. Radio buttons are best used for selecting a single option from a list of mutually exclusive options. Checkboxes are best used for selecting multiple options at once (or no options)."
15
84
  },
85
+ {
86
+ "type": "guideline",
87
+ "content": "Radio groups should always have a label that clearly describes what the list of options represents. This is important for accessibility, since a screen reader will read the label before each option. Make sure to include a label, and don't assume that the options are self-explanatory without one. Write the label in sentence case."
88
+ },
89
+ {
90
+ "type": "guideline",
91
+ "content": "Radio buttons are best when only one option can be selected at a time from a set (e.g., choosing one preference or mode)."
92
+ },
93
+ {
94
+ "type": "guideline",
95
+ "content": "Switches are best for communicating activation (e.g., turning a setting on or off)."
96
+ },
97
+ {
98
+ "type": "guideline",
99
+ "content": "Checkboxes are best for communicating selection (e.g., selecting multiple items from a list)."
100
+ }
101
+ ],
102
+ "options": {
103
+ "label": { "type": "string" },
16
104
  "labelPosition": {
17
105
  "type": "string",
18
106
  "default": "top",
19
- "values": [
20
- {
21
- "value": "top"
22
- },
23
- {
24
- "value": "side"
25
- }
26
- ]
107
+ "values": [{ "value": "top" }, { "value": "side" }]
27
108
  },
28
109
  "orientation": {
29
110
  "type": "string",
30
111
  "default": "vertical",
31
- "values": [
32
- {
33
- "value": "horizontal"
34
- },
35
- {
36
- "value": "vertical"
37
- }
38
- ]
112
+ "values": [{ "value": "horizontal" }, { "value": "vertical" }]
39
113
  },
40
114
  "size": {
41
115
  "type": "string",
42
116
  "default": "m",
43
117
  "values": [
44
- {
45
- "value": "s"
46
- },
47
- {
48
- "value": "m"
49
- },
50
- {
51
- "value": "l"
52
- },
53
- {
54
- "value": "xl"
55
- }
118
+ { "value": "s" },
119
+ { "value": "m" },
120
+ { "value": "l" },
121
+ { "value": "xl" }
56
122
  ]
57
123
  },
58
- "isEmphasized": {
59
- "type": "boolean",
60
- "default": false
61
- },
124
+ "isEmphasized": { "type": "boolean", "default": false },
62
125
  "necessityIndicator": {
63
126
  "type": "string",
64
127
  "default": "icon",
65
- "values": [
66
- {
67
- "value": "text"
68
- },
69
- {
70
- "value": "icon"
71
- }
72
- ]
73
- },
74
- "isRequired": {
75
- "type": "boolean",
76
- "default": false
77
- },
78
- "isError": {
79
- "type": "boolean",
80
- "default": false
128
+ "values": [{ "value": "text" }, { "value": "icon" }]
81
129
  },
82
- "isDisabled": {
83
- "type": "boolean",
84
- "default": false
85
- },
86
- "errorMessage": {
87
- "type": "string"
88
- },
89
- "description": {
90
- "type": "string"
91
- }
92
- },
93
- "lifecycle": {
94
- "introduced": "1.0.0-draft"
130
+ "isRequired": { "type": "boolean", "default": false },
131
+ "isError": { "type": "boolean", "default": false },
132
+ "isDisabled": { "type": "boolean", "default": false },
133
+ "errorMessage": { "type": "string" },
134
+ "description": { "type": "string" }
95
135
  },
136
+ "lifecycle": { "introduced": "1.0.0-draft" },
96
137
  "tokenBindings": [],
97
138
  "accessibility": {
98
139
  "intents": ["choose"],
99
140
  "focusable": false,
100
141
  "wcag": [
101
- {
102
- "criterion": "1.3.1",
103
- "level": "A",
104
- "title": "Info and Relationships"
105
- },
106
- {
107
- "criterion": "4.1.2",
108
- "level": "A",
109
- "title": "Name, Role, Value"
110
- }
142
+ { "criterion": "1.3.1", "level": "A", "title": "Info and Relationships" },
143
+ { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
111
144
  ]
112
145
  }
113
146
  }