@adobe/spectrum-design-data 3.3.0-beta.0 → 3.3.0-beta.1

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 (81) hide show
  1. package/components/accordion.json +15 -54
  2. package/components/action-bar.json +9 -23
  3. package/components/action-button.json +39 -79
  4. package/components/action-group.json +18 -129
  5. package/components/alert-banner.json +8 -27
  6. package/components/alert-dialog.json +34 -48
  7. package/components/avatar-group.json +9 -28
  8. package/components/avatar.json +29 -92
  9. package/components/badge.json +56 -150
  10. package/components/breadcrumbs.json +26 -100
  11. package/components/button-group.json +19 -50
  12. package/components/button.json +61 -92
  13. package/components/calendar.json +8 -67
  14. package/components/cards.json +31 -46
  15. package/components/checkbox-group.json +16 -78
  16. package/components/checkbox.json +27 -90
  17. package/components/close-button.json +20 -62
  18. package/components/coach-indicator.json +14 -44
  19. package/components/coach-mark.json +8 -26
  20. package/components/color-area.json +20 -93
  21. package/components/color-handle.json +25 -38
  22. package/components/color-loupe.json +2 -6
  23. package/components/color-slider.json +26 -122
  24. package/components/color-wheel.json +17 -84
  25. package/components/combo-box.json +50 -182
  26. package/components/contextual-help.json +80 -119
  27. package/components/date-picker.json +24 -120
  28. package/components/divider.json +12 -25
  29. package/components/drop-zone.json +18 -30
  30. package/components/field-label.json +21 -62
  31. package/components/help-text.json +16 -53
  32. package/components/illustrated-message.json +21 -72
  33. package/components/in-line-alert.json +13 -53
  34. package/components/link.json +24 -56
  35. package/components/list-view.json +15 -73
  36. package/components/menu.json +45 -174
  37. package/components/meter.json +24 -65
  38. package/components/number-field.json +34 -168
  39. package/components/picker.json +42 -181
  40. package/components/popover.json +37 -113
  41. package/components/progress-bar.json +23 -95
  42. package/components/progress-circle.json +12 -42
  43. package/components/radio-button.json +14 -67
  44. package/components/radio-group.json +28 -125
  45. package/components/rating.json +9 -38
  46. package/components/search-field.json +34 -119
  47. package/components/segmented-control.json +21 -63
  48. package/components/select-box.json +29 -96
  49. package/components/side-navigation.json +28 -69
  50. package/components/slider.json +39 -148
  51. package/components/standard-dialog.json +16 -88
  52. package/components/status-light.json +41 -123
  53. package/components/steplist.json +5 -24
  54. package/components/swatch-group.json +19 -55
  55. package/components/swatch.json +24 -79
  56. package/components/switch.json +31 -72
  57. package/components/table.json +26 -73
  58. package/components/tabs.json +22 -39
  59. package/components/tag-field.json +14 -60
  60. package/components/tag-group.json +16 -49
  61. package/components/tag.json +21 -71
  62. package/components/takeover-dialog.json +10 -61
  63. package/components/text-area.json +49 -198
  64. package/components/text-field.json +42 -163
  65. package/components/thumbnail.json +22 -63
  66. package/components/toast.json +29 -50
  67. package/components/tooltip.json +27 -74
  68. package/components/tree-view.json +45 -140
  69. package/guidelines/introduction.json +2 -2
  70. package/guidelines/manifest.json +2 -74
  71. package/guidelines/principles.json +2 -2
  72. package/package.json +1 -1
  73. package/guidelines/app-frame-content-area.json +0 -81
  74. package/guidelines/app-frame-creating-bluelines.json +0 -58
  75. package/guidelines/app-frame-header.json +0 -72
  76. package/guidelines/app-frame-side-navigation.json +0 -138
  77. package/guidelines/containers.json +0 -62
  78. package/guidelines/illustrations.json +0 -111
  79. package/guidelines/object-styles.json +0 -102
  80. package/guidelines/spacing.json +0 -25
  81. package/guidelines/typography-fundamentals.json +0 -142
@@ -16,71 +16,44 @@
16
16
  },
17
17
  {
18
18
  "type": "guideline",
19
- "content": "When set to true, the breadcrumb item is displayed as an icon only."
19
+ "content": "Overflow.\n\nBreadcrumbs truncate when there is not enough room to display all levels of the breadcrumb list, or as a way of managing relevance of the visible breadcrumb items in a deeply nested hierarchy. The truncation of breadcrumb items begins when either there is not enough room to display all items, or if there are 5 or more breadcrumbs to display. The truncation menu displays all options within a breadcrumb. Items are listed with the hierarchy ordered from top (root) to bottom and include the currently selected item."
20
20
  },
21
21
  {
22
22
  "type": "guideline",
23
- "content": "Separators visually divide breadcrumb items and convey hierarchy."
23
+ "content": "Use breadcrumbs to show hierarchy.\n\nBreadcrumbs need a consistent hierarchical structure because they create a path for discovery and context for a user’s current location."
24
24
  },
25
25
  {
26
26
  "type": "guideline",
27
- "content": "Breadcrumbs can include multiple items, but too many levels can overwhelm users. Limit the hierarchy to four items (including the root, if shown) to provide clear context while keeping truncated options accessible."
27
+ "content": "Use breadcrumbs for hierarchical navigation.\n\nBreadcrumbs should be a form of navigating a linear hierarchy. They should not be used for any other interactions, such as displaying filters."
28
28
  },
29
29
  {
30
- "type": "guideline",
31
- "content": "Breadcrumbs come in two sizes: medium, and large. The medium size is the default and most frequently used option."
32
- },
33
- {
34
- "type": "guideline",
35
- "content": "The multiline variation places emphasis on the selected breadcrumb item as a page title, helping a user to more clearly identify their current location."
36
- },
37
- {
38
- "type": "guideline",
39
- "content": "Breadcrumbs truncate when there is not enough room to display all levels of the breadcrumb list, or as a way of managing relevance of the visible breadcrumb items in a deeply nested hierarchy. The truncation of breadcrumb items begins when either there is not enough room to display all items, or if there are 5 or more breadcrumbs to display."
40
- },
41
- {
42
- "type": "guideline",
43
- "content": "The truncation menu displays all options within a breadcrumb. Items are listed with the hierarchy ordered from top (root) to bottom and include the currently selected item."
44
- },
45
- {
46
- "type": "guideline",
47
- "content": "Breadcrumbs need a consistent hierarchical structure because they create a path for discovery and context for a user’s current location."
48
- },
49
- {
50
- "type": "guideline",
51
- "content": "Breadcrumbs should be a form of navigating a linear hierarchy. They should not be used for any other interactions, such as displaying filters."
52
- },
53
- {
54
- "type": "guideline",
55
- "content": "The truncation menu should display all available options within the hierarchy where a user is located — not as indented. Doing this provides context for the directionality of how the menu is being displayed. Adding indentation to the menu items does not add value to understanding the hierarchy, and it can actually decrease the readability of the menu options."
56
- },
57
- {
58
- "type": "guideline",
59
- "content": "When list items are truncated into a menu but the label text is still too large for the horizontal space, truncate the text with an ellipsis. By default, truncation should occur at the end of the title. If your users need to see the end of truncated titles, truncating the middle of the title is acceptable."
30
+ "type": "do-dont",
31
+ "content": "Don't indent menu items",
32
+ "dont": "The truncation menu should display all available options within the hierarchy where a user is located — not as indented. Doing this provides context for the directionality of how the menu is being displayed. Adding indentation to the menu items does not add value to understanding the hierarchy, and it can actually decrease the readability of the menu options."
60
33
  },
61
34
  {
62
35
  "type": "guideline",
63
- "content": "When the breadcrumb title is truncated, a tooltip should display the full title when the user hovers, keyboard focuses, or single-taps on mobile."
36
+ "content": "Don’t wrap breadcrumb list items.\n\nWhen list items are truncated into a menu but the label text is still too large for the horizontal space, truncate the text with an ellipsis. By default, truncation should occur at the end of the title. If your users need to see the end of truncated titles, truncating the middle of the title is acceptable."
64
37
  },
65
38
  {
66
39
  "type": "guideline",
67
- "content": "Prioritize using the truncation menu when breadcrumb labels are long. Never truncate more than one breadcrumb label. If the current location has a long label, all items can be truncated into the menu."
40
+ "content": "Tooltips.\n\nWhen the breadcrumb title is truncated, a tooltip should display the full title when the user hovers, keyboard focuses, or single-taps on mobile."
68
41
  },
69
42
  {
70
43
  "type": "guideline",
71
- "content": "Truncation should be avoided by way of the breadcrumbs overflow behavior, although in some cases the final breadcrumb title may truncate with an ellipsis."
44
+ "content": "Truncation and overflow.\n\nPrioritize using the truncation menu when breadcrumb labels are long. Never truncate more than one breadcrumb label. If the current location has a long label, all items can be truncated into the menu. Truncation should be avoided by way of the breadcrumbs overflow behavior, although in some cases the final breadcrumb title may truncate with an ellipsis."
72
45
  },
73
46
  {
74
47
  "type": "guideline",
75
- "content": "Be mindful of your user’s cognitive load and truncate breadcrumbs appropriately. Displaying too many levels can be overwhelming. By displaying only 4 items in the hierarchy (including the root item, if you are displaying it), users will quickly understand context while still having easy access to any truncated options. Truncation of breadcrumb items begins when either there is not enough room to display all items, or if there are 5 or more breadcrumbs to display."
48
+ "content": "Don’t show too many breadcrumbs at once.\n\nBe mindful of your user’s cognitive load and truncate breadcrumbs appropriately. Displaying too many levels can be overwhelming. By displaying only 4 items in the hierarchy (including the root item, if you are displaying it), users will quickly understand context while still having easy access to any truncated options. Truncation of breadcrumb items begins when either there is not enough room to display all items, or if there are 5 or more breadcrumbs to display."
76
49
  },
77
50
  {
78
51
  "type": "guideline",
79
- "content": "Don't use icons within the labels for breadcrumbs. Since breadcrumb labels are horizontally distributed, icons disrupt the rhythm and readability of the list."
52
+ "content": "Icons in breadcrumbs.\n\nDon't use icons within the labels for breadcrumbs. Since breadcrumb labels are horizontally distributed, icons disrupt the rhythm and readability of the list."
80
53
  },
81
54
  {
82
55
  "type": "guideline",
83
- "content": "Breadcrumbs are a way for traveling up a hierarchical navigation and should not be mixed with controls intended for lateral or non-hierarchical navigation."
56
+ "content": "Don’t modify breadcrumbs for lateral navigation.\n\nBreadcrumbs are a way for traveling up a hierarchical navigation and should not be mixed with controls intended for lateral or non-hierarchical navigation."
84
57
  }
85
58
  ],
86
59
  "options": {
@@ -93,14 +66,7 @@
93
66
  "type": "string",
94
67
  "default": "m",
95
68
  "description": "Controls the overall size of the breadcrumb component.",
96
- "values": [
97
- {
98
- "value": "m"
99
- },
100
- {
101
- "value": "l"
102
- }
103
- ]
69
+ "values": [{ "value": "m" }, { "value": "l" }]
104
70
  },
105
71
  "items": {
106
72
  "type": "array",
@@ -121,10 +87,7 @@
121
87
  "description": "Indicates if the breadcrumb item represents the current page.",
122
88
  "default": false
123
89
  },
124
- "isDisabled": {
125
- "type": "boolean",
126
- "default": false
127
- }
90
+ "isDisabled": { "type": "boolean", "default": false }
128
91
  },
129
92
  "required": ["label"]
130
93
  }
@@ -133,14 +96,7 @@
133
96
  "type": "string",
134
97
  "default": "chevron",
135
98
  "description": "The separator icon used between breadcrumb items.",
136
- "values": [
137
- {
138
- "value": "chevron"
139
- },
140
- {
141
- "value": "none"
142
- }
143
- ]
99
+ "values": [{ "value": "chevron" }, { "value": "none" }]
144
100
  },
145
101
  "isTruncated": {
146
102
  "type": "boolean",
@@ -151,18 +107,10 @@
151
107
  "type": "string",
152
108
  "description": "Overrides the size of the breadcrumb items when isMultiline is true.",
153
109
  "values": [
154
- {
155
- "value": "s"
156
- },
157
- {
158
- "value": "m"
159
- },
160
- {
161
- "value": "l"
162
- },
163
- {
164
- "value": "xl"
165
- }
110
+ { "value": "s" },
111
+ { "value": "m" },
112
+ { "value": "l" },
113
+ { "value": "xl" }
166
114
  ]
167
115
  }
168
116
  },
@@ -173,41 +121,19 @@
173
121
  }
174
122
  ],
175
123
  "states": [
176
- {
177
- "name": "hover",
178
- "trigger": "interaction"
179
- },
180
- {
181
- "name": "down",
182
- "trigger": "interaction"
183
- },
184
- {
185
- "name": "keyboard-focus",
186
- "trigger": "interaction"
187
- },
188
- {
189
- "name": "drag-and-drop",
190
- "trigger": "prop"
191
- }
124
+ { "name": "hover", "trigger": "interaction" },
125
+ { "name": "down", "trigger": "interaction" },
126
+ { "name": "keyboard-focus", "trigger": "interaction" },
127
+ { "name": "drag-and-drop", "trigger": "prop" }
192
128
  ],
193
- "lifecycle": {
194
- "introduced": "1.0.0-draft"
195
- },
129
+ "lifecycle": { "introduced": "1.0.0-draft" },
196
130
  "accessibility": {
197
131
  "intents": ["navigate"],
198
132
  "focusable": true,
199
133
  "keyboardIntents": ["navigate-items", "activate"],
200
134
  "wcag": [
201
- {
202
- "criterion": "2.1.1",
203
- "level": "A",
204
- "title": "Keyboard"
205
- },
206
- {
207
- "criterion": "4.1.2",
208
- "level": "A",
209
- "title": "Name, Role, Value"
210
- }
135
+ { "criterion": "2.1.1", "level": "A", "title": "Keyboard" },
136
+ { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
211
137
  ]
212
138
  }
213
139
  }
@@ -16,107 +16,76 @@
16
16
  },
17
17
  {
18
18
  "type": "guideline",
19
- "content": "Button groups organize related buttons into a single group for presenting multiple, related actions."
19
+ "content": "Overflow.\n\nWhen horizontal space is limited, button groups stack vertically. Buttons are stacked by the importance of the action, with the most critical or primary action at the bottom."
20
20
  },
21
21
  {
22
22
  "type": "guideline",
23
- "content": "A button group in a disabled state shows that the buttons within the group exist, but are not available in that circumstance. This state can be used to maintain layout continuity and to communicate that a button group may become available later."
23
+ "content": "Use the recommended option for subsequent actions.\n\nThe most critical action within a button group should be an accent, primary, or negative button (fill or outline). The other actions should always be a secondary outline button."
24
24
  },
25
25
  {
26
26
  "type": "guideline",
27
- "content": "This option stacks button groups vertically when horizontal space is limited, placing the most important action at the bottom."
27
+ "content": "Align button groups based on content.\n\nButton groups are aligned contextually. In general, button groups are left-aligned to follow content such as a block of text. They are center-aligned in the context of an empty state. And, they should be right-aligned inside container components such as dialogs, popovers, or cards."
28
28
  },
29
29
  {
30
30
  "type": "guideline",
31
- "content": "Button 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."
31
+ "content": "Respect button order within a group.\n\nThe order of button priority should match the alignment of surrounding text. When text is left-aligned, buttons should be arranged so that the leftmost button is the most critical. When text is right- or center- aligned, the most critical action should be the furthest right."
32
32
  },
33
33
  {
34
34
  "type": "guideline",
35
- "content": "A button group can be either horizontal or vertical in its orientation. By default, a button group is horizontal. Use vertical option when horizontal space is limited."
35
+ "content": "Use icons only for the most critical actions.\n\nNot all buttons in a group require an icon, but buttons with icons should always be of a higher priority than ones without icons. If the most critical action in a group doesn't have an icon, don't use icons in the remaining lower-level actions."
36
36
  },
37
37
  {
38
38
  "type": "guideline",
39
- "content": "When horizontal space is limited, button groups stack vertically. Buttons are stacked by the importance of the action, with the most critical or primary action at the bottom."
39
+ "content": "Use a button group to show additional actions.\n\nInstead of a single split button (now a deprecated component), use a button group to show any additional actions related to the most critical action."
40
40
  },
41
41
  {
42
42
  "type": "guideline",
43
- "content": "Button groups are aligned contextually. In general, button groups are left-aligned to follow content such as a block of text. They are center-aligned in the context of an empty state. And, they should be right-aligned inside container components such as dialogs, popovers, or cards."
43
+ "content": "RTL.\n\nFor RTL (right-to-left) languages, the layout of the button group is mirrored."
44
44
  },
45
45
  {
46
46
  "type": "guideline",
47
- "content": "The order of button priority should match the alignment of surrounding text. When text is left-aligned, buttons should be arranged so that the leftmost button is the most critical. When text is right- or center- aligned, the most critical action should be the furthest right."
47
+ "content": "Keyboard interactions.\n\nKey Interaction TabMoves focus onto or off of the button group. Focus is placed on the primary button of the group.Shift + TabMoves focus to the previous component.Space or EnterExecutes the selected action within the button group. Focus remains on the active button to preserve context across the group. If the action opens or closes a related container, focus moves into the resulting context or returns to the triggering buttonArrow keysMoves focus through the group of buttons."
48
48
  },
49
49
  {
50
50
  "type": "guideline",
51
- "content": "Not all buttons in a group require an icon, but buttons with icons should always be of a higher priority than ones without icons. If the most critical action in a group doesn’t have an icon, don’t use icons in the remaining lower-level actions."
51
+ "content": "Cursor guidelines.\n\nCursor Usage PointerUse the pointer cursor for all interactive components in every state."
52
52
  },
53
53
  {
54
54
  "type": "guideline",
55
- "content": "Instead of a single split button (now a deprecated component), use a button group to show any additional actions related to the most critical action."
55
+ "content": "WCAG 2.2 compliance.\n\nAny criterion not mention in the below table are not applicable to this component or are resolved with underlying requirements, engineering, and styles of the entire system. 1. Perceivable Requirement Criterion Level Compliance Non-text content 1.1.1 ANon‑text elements—such as icons used in buttons—must provide a text alternative that communicates the button’s purpose. All buttons, especially icon‑only buttons, need an accessible name (for example, via a title, aria‑label, or associated text) so screen readers can announce their function.Info and relationships, Identify purpose 1.3.1, 1.3.6 A, AAAButtons should be understandable by assistive technologies like screen readers. This means using the proper semantic HTML or ARIA role of buttons should be utilized.Orientation 1.3.4 AAButton groups are available in both vertical and horizontal orientations.Use of color 1.4.1 AColor is never used as the sole way to convey meaning in buttons. While negative buttons do use red to reinforce their purpose, every button also includes a clear text label that communicates the action it performs.Text contrast 1.4.3 AALarge text has a contrast ratio of at least 3:1, and small text has a contrast ratio of at least 4.5:1. Incidental text such as disabled, hidden, or decorative text has no contrast requirement.Non-text contrast 1.4.11 AAThe visual presentation of icons and various states have a contrast ratio of at least 3:1.Text spacing 1.4.12 AALine height of text is at least 1.5x the font size when text is wrapped in buttons. 2. Operable Requirement Criterion Level Compliance Keyboard 2.1.1, 2.1.3 A, AAAAll functionality of the component is operable through a keyboard without specific timing for keystrokes.Keyboard traps 2.1.2 AFocus can be moved away from the component using only a keyboard.Seizures and physical reactions 2.3.1, 2.3.2, 2.3.3 A, AAA, AAAThere is no flashing content or unnecessary motion or animation in this component.Focus order 2.4.3 ANavigation sequences receive focus in an order that preserves meaning and operability.Focus visible 2.4.7 AAKeyboard states use an indicator that is visible with at least 3:1 contrast."
56
56
  }
57
57
  ],
58
58
  "options": {
59
59
  "orientation": {
60
60
  "type": "string",
61
61
  "default": "horizontal",
62
- "values": [
63
- {
64
- "value": "horizontal"
65
- },
66
- {
67
- "value": "vertical"
68
- }
69
- ]
62
+ "values": [{ "value": "horizontal" }, { "value": "vertical" }]
70
63
  },
71
64
  "size": {
72
65
  "type": "string",
73
66
  "pattern": "^(x?s|m|x{0,3}l)$",
74
67
  "default": "m",
75
68
  "values": [
76
- {
77
- "value": "s"
78
- },
79
- {
80
- "value": "m"
81
- },
82
- {
83
- "value": "l"
84
- },
85
- {
86
- "value": "xl"
87
- }
69
+ { "value": "s" },
70
+ { "value": "m" },
71
+ { "value": "l" },
72
+ { "value": "xl" }
88
73
  ]
89
74
  },
90
75
  "overflowMode": {
91
76
  "type": "string",
92
77
  "default": "wrap",
93
- "values": [
94
- {
95
- "value": "wrap"
96
- },
97
- {
98
- "value": "collapse"
99
- }
100
- ]
78
+ "values": [{ "value": "wrap" }, { "value": "collapse" }]
101
79
  },
102
- "isDisabled": {
103
- "type": "boolean",
104
- "default": false
105
- }
106
- },
107
- "lifecycle": {
108
- "introduced": "1.0.0-draft"
80
+ "isDisabled": { "type": "boolean", "default": false }
109
81
  },
82
+ "lifecycle": { "introduced": "1.0.0-draft" },
110
83
  "accessibility": {
111
84
  "role": "group",
112
85
  "intents": ["trigger"],
113
86
  "focusable": false,
114
87
  "wcag": [
115
- {
116
- "criterion": "4.1.2",
117
- "level": "A",
118
- "title": "Name, Role, Value"
119
- }
88
+ { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
120
89
  ]
121
90
  }
122
91
  }
@@ -12,7 +12,7 @@
12
12
  "documentBlocks": [
13
13
  {
14
14
  "type": "purpose",
15
- "content": "Buttons enable actions or navigation between views. They come in multiple styles to support different levels of emphasis, and are commonly used to guide progression through a flow."
15
+ "content": "Buttons allow users to perform an action or to navigate to another page."
16
16
  },
17
17
  {
18
18
  "type": "guideline",
@@ -49,7 +49,7 @@
49
49
  {
50
50
  "type": "do-dont",
51
51
  "content": "Don't override color",
52
- "dont": "Do not use custom colors for buttons. The colors of different button variations have been designed to be consistent and accessible."
52
+ "dont": "Do not use custom colors for buttons. The colors of different button variations have been designed to be consistent and accessible"
53
53
  },
54
54
  {
55
55
  "type": "guideline",
@@ -58,15 +58,51 @@
58
58
  {
59
59
  "type": "do-dont",
60
60
  "content": "Don't use the pending state for long progress",
61
- "dont": "The pending state should be reserved for indeterminate actions that are expected to take 5 seconds or less. For determinate or longer actions, use a [progress bar](https://spectrum.adobe.com/page/progress-bar/) or [progress circle](https://spectrum.adobe.com/page/progress-circle/) outside of the button."
61
+ "dont": "The pending state should be reserved for indeterminate actions that are expected to take 5 seconds or less. For determinate or longer actions, use a progress bar or progress circle outside of the button."
62
62
  },
63
63
  {
64
64
  "type": "guideline",
65
- "content": "Use a button group to show additional actions.\n\nInstead of a single split button (now a deprecated component), use a [button group](https://spectrum.adobe.com/page/button-group/) to show any additional actions related to the most critical action."
65
+ "content": "Use a button group to show additional actions.\n\nInstead of a single split button (now a deprecated component), use a button group to show any additional actions related to the most critical action."
66
66
  },
67
67
  {
68
68
  "type": "guideline",
69
69
  "content": "Display a popover when featuring subsequent options.\n\nIn some instances, it's possible to have a call to action button display a popover (or tray) to feature subsequent options. These options should extend and parallel the action of the button. Do not include arbitrary or unrelated options."
70
+ },
71
+ {
72
+ "type": "guideline",
73
+ "content": "Be concise.\n\nButton text should be concise: 1 or 2 words, no longer than 4 words, with fewer than 20 characters including spaces. Don't use punctuation marks such as periods or exclamation points."
74
+ },
75
+ {
76
+ "type": "guideline",
77
+ "content": "Write labels as verbs.\n\nA button represents an action, so its label needs to reflect the action that a user is taking — which is a verb. Labels written as nouns or adjectives tend to be unclear and disorienting."
78
+ },
79
+ {
80
+ "type": "guideline",
81
+ "content": "Clearly state the action.\n\nMake sure that a button's label clearly states the outcome of the action. Use the same word or phrase as found elsewhere in the experience. For example, when designing a form for people to sign up for a trial offer, use \"Sign up\" as the call to action for completing the form. Phrases like \"Start trial\" skip the sign up step. Words like \"Submit\" or \"Enter,\" while technically correct, focus on the action of finishing filling out the form itself, rather than what the user is actually doing by filling it out (signing up for something)."
82
+ },
83
+ {
84
+ "type": "guideline",
85
+ "content": "Use sentence case.\n\nButton text should always be in sentence case. Never use capitalization to emphasize a specific button."
86
+ },
87
+ {
88
+ "type": "guideline",
89
+ "content": "Be aware of tone.\n\nEmoji and exclamation points aren't appropriate for the functional, utilitarian nature of buttons. Keep the label to just text, with no punctuation or extra decoration."
90
+ },
91
+ {
92
+ "type": "guideline",
93
+ "content": "RTL.\n\nFor RTL (right-to-left) languages, the layout of the button is mirrored. The icon is placed on the right side of the text."
94
+ },
95
+ {
96
+ "type": "guideline",
97
+ "content": "Keyboard interactions.\n\nKey Interaction TabMoves focus onto or off of the button.Space or EnterExecutes the button action. The focus remains on the button except if the button opens or closes the current container. In this case, the focus moves to the target or back to the caller."
98
+ },
99
+ {
100
+ "type": "guideline",
101
+ "content": "Cursor guidelines.\n\nCursor Usage PointerUse the pointer cursor for all interactive components."
102
+ },
103
+ {
104
+ "type": "guideline",
105
+ "content": "WCAG 2.2 compliance.\n\nAny criterion not mention in the below table are not applicable to this component or are resolved with underlying requirements, engineering, and styles of the entire system. 1. Perceivable Requirement Criterion Level Compliance Non-text content 1.1.1 ANon‑text elements—such as icons used in buttons—must provide a text alternative that communicates the button’s purpose. All buttons, especially icon‑only buttons, need an accessible name (for example, via a title, aria‑label, or associated text) so screen readers can announce their function.Info and relationships, Identify purpose 1.3.1, 1.3.6 A, AAAButtons should be understandable by assistive technologies like screen readers. This means using the proper semantic HTML or ARIA role of buttons should be utilized.Use of color 1.4.1 AColor is never used as the sole way to convey meaning in buttons. While negative buttons do use red to reinforce their purpose, every button also includes a clear text label that communicates the action it performs.Text contrast minimums 1.4.3 AALarge text has a contrast ratio of at least 3:1, and small text has a contrast ratio of at least 4.5:1. Incidental text such as disabled, hidden, or decorative text has no contrast requirement.Resize text 1.4.4 AAButtons should be built in such a way that they can be resized without assistive technology up to 200%.Visual presentation 1.4.8 AAAThe width of text blocks is no more than 80 characters (40 for CJK languages), and text is never justified.Non-text contrast 1.4.11 AAThe visual presentation of icons and various states have a contrast ratio of at least 3:1.Text spacing 1.4.12 AALine height of text is at least 1.5x the font size. 2. Operable Requirement Criterion Level Compliance Keyboard 2.1.1, 2.1.3 A, AAAAll functionality of the component is operable through a keyboard without specific timing for keystrokes.Keyboard traps 2.1.2 AFocus can be moved away from the component using only a keyboard.Seizures and physical reactions 2.3.1, 2.3.2, 2.3.3 A, AAA, AAAThere is no flashing content or unnecessary motion or animation in this component.Focus order 2.4.3 ANavigation sequences receive focus in an order that preserves meaning and operability.Focus visible 2.4.7 AAKeyboard states use an indicator that is visible with at least 3:1 contrast."
70
106
  }
71
107
  ],
72
108
  "options": {
@@ -75,62 +111,30 @@
75
111
  "default": "accent",
76
112
  "description": "Visual emphasis level.",
77
113
  "values": [
78
- {
79
- "value": "accent"
80
- },
81
- {
82
- "value": "negative"
83
- },
84
- {
85
- "value": "primary"
86
- },
87
- {
88
- "value": "secondary"
89
- }
114
+ { "value": "accent" },
115
+ { "value": "negative" },
116
+ { "value": "primary" },
117
+ { "value": "secondary" }
90
118
  ]
91
119
  },
92
120
  "style": {
93
121
  "type": "string",
94
122
  "default": "fill",
95
- "values": [
96
- {
97
- "value": "fill"
98
- },
99
- {
100
- "value": "outline"
101
- }
102
- ]
123
+ "values": [{ "value": "fill" }, { "value": "outline" }]
103
124
  },
104
125
  "size": {
105
126
  "type": "string",
106
127
  "default": "m",
107
128
  "values": [
108
- {
109
- "value": "s"
110
- },
111
- {
112
- "value": "m"
113
- },
114
- {
115
- "value": "l"
116
- },
117
- {
118
- "value": "xl"
119
- }
129
+ { "value": "s" },
130
+ { "value": "m" },
131
+ { "value": "l" },
132
+ { "value": "xl" }
120
133
  ]
121
134
  },
122
- "isDisabled": {
123
- "type": "boolean",
124
- "default": false
125
- },
126
- "isPending": {
127
- "type": "boolean",
128
- "default": false
129
- },
130
- "isLabelHidden": {
131
- "type": "boolean",
132
- "default": false
133
- },
135
+ "isDisabled": { "type": "boolean", "default": false },
136
+ "isPending": { "type": "boolean", "default": false },
137
+ "isLabelHidden": { "type": "boolean", "default": false },
134
138
  "icon": {
135
139
  "$ref": "https://opensource.adobe.com/spectrum-design-data/schemas/types/workflow-icon.json",
136
140
  "description": "Icon placed at the start of the button. Required when isLabelHidden is true."
@@ -138,14 +142,7 @@
138
142
  "staticColor": {
139
143
  "type": "string",
140
144
  "description": "Static color for use on colored backgrounds.",
141
- "values": [
142
- {
143
- "value": "white"
144
- },
145
- {
146
- "value": "black"
147
- }
148
- ]
145
+ "values": [{ "value": "white" }, { "value": "black" }]
149
146
  }
150
147
  },
151
148
  "slots": [
@@ -154,43 +151,23 @@
154
151
  "description": "Text label of the button.",
155
152
  "required": false
156
153
  },
157
- {
158
- "name": "icon",
159
- "description": "Icon placed at the start of the button."
160
- }
154
+ { "name": "icon", "description": "Icon placed at the start of the button." }
161
155
  ],
162
156
  "anatomy": [
163
- {
164
- "name": "icon",
165
- "description": "Leading icon."
166
- },
167
- {
168
- "name": "label",
169
- "description": "Button text.",
170
- "required": true
171
- }
157
+ { "name": "icon", "description": "Leading icon." },
158
+ { "name": "label", "description": "Button text.", "required": true }
172
159
  ],
173
160
  "states": [
174
- {
175
- "name": "hover",
176
- "trigger": "interaction",
177
- "precedence": 50
178
- },
161
+ { "name": "hover", "trigger": "interaction", "precedence": 50 },
179
162
  {
180
163
  "name": "focus",
181
164
  "trigger": "interaction",
182
165
  "precedence": 60,
183
166
  "layered": true
184
167
  },
185
- {
186
- "name": "disabled",
187
- "trigger": "prop",
188
- "precedence": 100
189
- }
168
+ { "name": "disabled", "trigger": "prop", "precedence": 100 }
190
169
  ],
191
- "lifecycle": {
192
- "introduced": "1.0.0-draft"
193
- },
170
+ "lifecycle": { "introduced": "1.0.0-draft" },
194
171
  "tokenBindings": [
195
172
  {
196
173
  "token": "corner-radius-button-small",
@@ -211,16 +188,8 @@
211
188
  "focusable": true,
212
189
  "keyboardIntents": ["activate"],
213
190
  "wcag": [
214
- {
215
- "criterion": "2.1.1",
216
- "level": "A",
217
- "title": "Keyboard"
218
- },
219
- {
220
- "criterion": "4.1.2",
221
- "level": "A",
222
- "title": "Name, Role, Value"
223
- }
191
+ { "criterion": "2.1.1", "level": "A", "title": "Keyboard" },
192
+ { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
224
193
  ]
225
194
  }
226
195
  }