@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,187 +16,90 @@
16
16
  },
17
17
  {
18
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."
19
+ "content": "Keyboard focus.\n\nA 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."
20
20
  },
21
21
  {
22
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."
23
+ "content": "Text overflow.\n\nWhen the label is too long for the horizontal space available, it wraps to form another line."
24
24
  },
25
25
  {
26
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."
27
+ "content": "Mixed value.\n\nWhen 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."
28
28
  },
29
29
  {
30
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."
31
+ "content": "When to use an emphasized radio group?\n\nEmphasized 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."
32
32
  },
33
33
  {
34
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."
35
+ "content": "Use radio buttons for mutually exclusive options.\n\nRadio 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)."
36
36
  },
37
37
  {
38
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."
39
+ "content": "Always label radio groups.\n\nRadio 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."
40
40
  },
41
41
  {
42
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."
43
+ "content": "Radio group, switch, or checkbox?\n\nRadio buttons are best when only one option can be selected at a time from a set (e.g., 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)."
44
44
  },
45
45
  {
46
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."
47
+ "content": "RTL.\n\nFor RTL (right-to-left) languages, the layout of the radio group (and its components) is mirrored. The radio buttons and icons are placed on the right side of the text, and text is aligned to the right."
48
48
  },
49
49
  {
50
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."
51
+ "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."
52
52
  },
53
53
  {
54
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."
55
+ "content": "Cursor guidelines.\n\nCursor Usage PointerUse the pointer cursor for all interactive components."
56
56
  },
57
57
  {
58
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)."
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)."
59
+ "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."
100
60
  }
101
61
  ],
102
62
  "options": {
103
- "label": {
104
- "type": "string"
105
- },
63
+ "label": { "type": "string" },
106
64
  "labelPosition": {
107
65
  "type": "string",
108
66
  "default": "top",
109
- "values": [
110
- {
111
- "value": "top"
112
- },
113
- {
114
- "value": "side"
115
- }
116
- ]
67
+ "values": [{ "value": "top" }, { "value": "side" }]
117
68
  },
118
69
  "orientation": {
119
70
  "type": "string",
120
71
  "default": "vertical",
121
- "values": [
122
- {
123
- "value": "horizontal"
124
- },
125
- {
126
- "value": "vertical"
127
- }
128
- ]
72
+ "values": [{ "value": "horizontal" }, { "value": "vertical" }]
129
73
  },
130
74
  "size": {
131
75
  "type": "string",
132
76
  "default": "m",
133
77
  "values": [
134
- {
135
- "value": "s"
136
- },
137
- {
138
- "value": "m"
139
- },
140
- {
141
- "value": "l"
142
- },
143
- {
144
- "value": "xl"
145
- }
78
+ { "value": "s" },
79
+ { "value": "m" },
80
+ { "value": "l" },
81
+ { "value": "xl" }
146
82
  ]
147
83
  },
148
- "isEmphasized": {
149
- "type": "boolean",
150
- "default": false
151
- },
84
+ "isEmphasized": { "type": "boolean", "default": false },
152
85
  "necessityIndicator": {
153
86
  "type": "string",
154
87
  "default": "icon",
155
- "values": [
156
- {
157
- "value": "text"
158
- },
159
- {
160
- "value": "icon"
161
- }
162
- ]
163
- },
164
- "isRequired": {
165
- "type": "boolean",
166
- "default": false
88
+ "values": [{ "value": "text" }, { "value": "icon" }]
167
89
  },
168
- "isError": {
169
- "type": "boolean",
170
- "default": false
171
- },
172
- "isDisabled": {
173
- "type": "boolean",
174
- "default": false
175
- },
176
- "errorMessage": {
177
- "type": "string"
178
- },
179
- "description": {
180
- "type": "string"
181
- }
182
- },
183
- "lifecycle": {
184
- "introduced": "1.0.0-draft"
90
+ "isRequired": { "type": "boolean", "default": false },
91
+ "isError": { "type": "boolean", "default": false },
92
+ "isDisabled": { "type": "boolean", "default": false },
93
+ "errorMessage": { "type": "string" },
94
+ "description": { "type": "string" }
185
95
  },
96
+ "lifecycle": { "introduced": "1.0.0-draft" },
186
97
  "accessibility": {
187
98
  "intents": ["choose"],
188
99
  "focusable": false,
189
100
  "wcag": [
190
- {
191
- "criterion": "1.3.1",
192
- "level": "A",
193
- "title": "Info and Relationships"
194
- },
195
- {
196
- "criterion": "4.1.2",
197
- "level": "A",
198
- "title": "Name, Role, Value"
199
- }
101
+ { "criterion": "1.3.1", "level": "A", "title": "Info and Relationships" },
102
+ { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
200
103
  ]
201
104
  }
202
105
  }
@@ -68,53 +68,24 @@
68
68
  "multipleOf": 0.5,
69
69
  "description": "From 0 to 5, can be a decimal to represent half stars"
70
70
  },
71
- "isEmphasized": {
72
- "type": "boolean",
73
- "default": false
74
- },
75
- "isDisabled": {
76
- "type": "boolean",
77
- "default": false
78
- }
71
+ "isEmphasized": { "type": "boolean", "default": false },
72
+ "isDisabled": { "type": "boolean", "default": false }
79
73
  },
80
74
  "states": [
81
- {
82
- "name": "hover",
83
- "trigger": "interaction"
84
- },
85
- {
86
- "name": "down",
87
- "trigger": "interaction"
88
- },
89
- {
90
- "name": "keyboard-focus",
91
- "trigger": "interaction"
92
- }
75
+ { "name": "hover", "trigger": "interaction" },
76
+ { "name": "down", "trigger": "interaction" },
77
+ { "name": "keyboard-focus", "trigger": "interaction" }
93
78
  ],
94
- "lifecycle": {
95
- "introduced": "1.0.0-draft"
96
- },
79
+ "lifecycle": { "introduced": "1.0.0-draft" },
97
80
  "accessibility": {
98
81
  "role": "slider",
99
82
  "intents": ["choose"],
100
83
  "focusable": true,
101
84
  "keyboardIntents": ["increment", "decrement"],
102
85
  "wcag": [
103
- {
104
- "criterion": "1.3.1",
105
- "level": "A",
106
- "title": "Info and Relationships"
107
- },
108
- {
109
- "criterion": "2.1.1",
110
- "level": "A",
111
- "title": "Keyboard"
112
- },
113
- {
114
- "criterion": "4.1.2",
115
- "level": "A",
116
- "title": "Name, Role, Value"
117
- }
86
+ { "criterion": "1.3.1", "level": "A", "title": "Info and Relationships" },
87
+ { "criterion": "2.1.1", "level": "A", "title": "Keyboard" },
88
+ { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
118
89
  ]
119
90
  }
120
91
  }
@@ -16,191 +16,106 @@
16
16
  },
17
17
  {
18
18
  "type": "guideline",
19
- "content": "Search fields enable finding or filtering items based on text input."
19
+ "content": "Minimum width.\n\nThe minimum width for a search field is 3× the height of the field, for both standard and quiet style. This minimum width guarantees that small search fields are readable and easy to target on touch devices."
20
20
  },
21
21
  {
22
22
  "type": "guideline",
23
- "content": "A search field should include a label and a search icon. In the default state before a search term is input, the label is in regular body text style to meet contrast ratios and to show that this is a field label, not placeholder text. When no visible label is present, the input must still expose an accessible name (for example, in HTML via “aria-label” or “aria-labelledby,” and on other platforms via the platform’s accessible-name mechanism)."
23
+ "content": "Text overflow.\n\nWhen the entered text is too long for the available horizontal space in the field, the text truncates."
24
24
  },
25
25
  {
26
26
  "type": "guideline",
27
- "content": "The value shows a user’s entered text in regular body text style."
27
+ "content": "Help text overflow.\n\nWhen the help text is too long for the available horizontal space, it wraps to form another line."
28
28
  },
29
29
  {
30
30
  "type": "guideline",
31
- "content": "The width of a search field can be customized appropriately for its context."
31
+ "content": "Keyboard focus.\n\nA search field can be navigated using a keyboard. The keyboard focus state takes the field's visual hover state and adds a blue ring to the field in focus."
32
32
  },
33
33
  {
34
34
  "type": "guideline",
35
- "content": "Search fields 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."
35
+ "content": "In-field button.\n\nThe in-field button offers an option to clear any input search term. If search results are being shown in a menu or popover, selecting this button will close the menu and clear the field. If a search term has been entered and the results have appeared, selecting this will only clear the field and not affect the list of results."
36
36
  },
37
37
  {
38
38
  "type": "guideline",
39
- "content": "A search field can have help text below the field to give extra context or instruction about what a user should input. The description communicates a hint or helpful information, such as a search’s scope."
39
+ "content": "Show a \"No results\" state instead of an error.\n\nSearch fields do not have an error state. Search functionality should anticipate spelling mistakes in search queries, and accommodate multiple spellings of words in search results — not treating any search term as an error. Instead of showing an error, show a \"No results\" page or a section with any suggestions for how to get results to appear."
40
40
  },
41
41
  {
42
42
  "type": "guideline",
43
- "content": "Placeholder text provides hints about expected input values."
43
+ "content": "Searching versus filtering.\n\nIn a searching scenario, a user inputs a search term for a specific thing they're looking for. In a filtering scenario, a user generally knows what they're looking for, but may not have a specific thing in mind. The search field can be used for both of these contexts. For a search experience, use the search field as-is. For a filtering experience, add a filter icon next to the search field, where a user can narrow down their search results before (or instead of) searching using a specific term. Filters can appear below the search field as tags."
44
44
  },
45
45
  {
46
46
  "type": "guideline",
47
- "content": "A search field in a disabled state shows that a search option exists, but is not available in that circumstance. This can be used to maintain layout continuity and communicate that it may become available later."
47
+ "content": "Searching within a category.\n\nCreate a scoped search by pairing a search field with a picker component. Add a picker (either quiet or standard style) where a user can select a topic or category that they would like to search within. It's helpful to also update the search field label to communicate what the user is searching within. Spectrum previously had a specific \"search within\" component that would allow a user to filter down a search field category before searching for a particular term. It was deprecated because it did not meet accessibility and localization requirements."
48
48
  },
49
49
  {
50
50
  "type": "guideline",
51
- "content": "The minimum width for a search field is 3× the height of the field, for both standard and quiet style. This minimum width guarantees that small search fields are readable and easy to target on touch devices."
51
+ "content": "Include a label.\n\nAny search field should include a label inside the field, in the default state. The default label text is Search, but this can be customized to be more specific for use cases like scoped search, wayfinding, or building context — acting like a prompt for a user to search more specifically. Keep in mind that once a search term is entered the label text is no longer viewable. Use help text to show search formatting examples or give hints about what to input. It can be distracting or redundant if the search field label and its help text are both communicating the same thing, so write these thoughtfully."
52
52
  },
53
53
  {
54
54
  "type": "guideline",
55
- "content": "When the entered text is too long for the available horizontal space in the field, the text truncates."
55
+ "content": "Follow capitalization rules.\n\nThe label within the search field should be in sentence case, following Spectrum's UX writing standards for capitalization."
56
56
  },
57
57
  {
58
58
  "type": "guideline",
59
- "content": "When the help text is too long for the available horizontal space, it wraps to form another line."
59
+ "content": "RTL.\n\nIn right‑to‑left languages, the search‑field layout is mirrored. The icon and label are right‑aligned, and the in‑field button is left‑aligned. Keep in mind that some content, such as email addresses, does not change direction or translate. The magnifying‑glass icon itself is not mirrored. The handle stays on the right side because it represents holding the object, and most people worldwide are right‑handed."
60
60
  },
61
61
  {
62
62
  "type": "guideline",
63
- "content": "A search field can be navigated using a keyboard. The keyboard focus state takes the field’s visual hover state and adds a blue ring to the field in focus."
63
+ "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."
64
64
  },
65
65
  {
66
66
  "type": "guideline",
67
- "content": "The in-field button offers an option to clear any input search term."
67
+ "content": "Cursor guidelines.\n\nCursor Usage PointerUse the pointer cursor for all interactive components."
68
68
  },
69
69
  {
70
70
  "type": "guideline",
71
- "content": "If search results are being shown in a menu or popover, selecting this button will close the menu and clear the field. If a search term has been entered and the results have appeared, selecting this will only clear the field and not affect the list of results."
72
- },
73
- {
74
- "type": "guideline",
75
- "content": "Search fields do not have an error state. Search functionality should anticipate spelling mistakes in search queries, and accommodate multiple spellings of words in search results — not treating any search term as an error."
76
- },
77
- {
78
- "type": "guideline",
79
- "content": "Instead of showing an error, show a “No results” page or a section with any suggestions for how to get results to appear."
80
- },
81
- {
82
- "type": "guideline",
83
- "content": "In a searching scenario, a user inputs a search term for a specific thing they’re looking for. In a filtering scenario, a user generally knows what they’re looking for, but may not have a specific thing in mind."
84
- },
85
- {
86
- "type": "guideline",
87
- "content": "The search field can be used for both of these contexts. For a search experience, use the search field as-is. For a filtering experience, add a filter icon next to the search field, where a user can narrow down their search results before (or instead of) searching using a specific term. Filters can appear below the search field as tags."
88
- },
89
- {
90
- "type": "guideline",
91
- "content": "Spectrum previously had a specific “search within” component that would allow a user to filter down a search field category before searching for a particular term. It was deprecated because it did not meet accessibility and localization requirements."
92
- },
93
- {
94
- "type": "guideline",
95
- "content": "Any search field should include a label inside the field, in the default state. The default label text is Search, but this can be customized to be more specific for use cases like scoped search, wayfinding, or building context — acting like a prompt for a user to search more specifically."
96
- },
97
- {
98
- "type": "guideline",
99
- "content": "Keep in mind that once a search term is entered the label text is no longer viewable. Use help text to show search formatting examples or give hints about what to input. It can be distracting or redundant if the search field label and its help text are both communicating the same thing, so write these thoughtfully."
100
- },
101
- {
102
- "type": "guideline",
103
- "content": "The label within the search field should be in sentence case, following Spectrum’s UX writing standards for capitalization."
71
+ "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."
104
72
  }
105
73
  ],
106
74
  "options": {
107
- "label": {
108
- "type": "string"
109
- },
110
- "hideLabel": {
111
- "type": "boolean",
112
- "default": false
113
- },
75
+ "label": { "type": "string" },
76
+ "hideLabel": { "type": "boolean", "default": false },
114
77
  "icon": {
115
78
  "$ref": "https://opensource.adobe.com/spectrum-design-data/schemas/types/workflow-icon.json",
116
79
  "description": "Icon must be present if the label is not defined."
117
80
  },
118
- "value": {
119
- "type": "string"
120
- },
121
- "width": {
122
- "type": "number"
123
- },
81
+ "value": { "type": "string" },
82
+ "width": { "type": "number" },
124
83
  "size": {
125
84
  "type": "string",
126
85
  "default": "m",
127
86
  "pattern": "^(x?s|m|x{0,3}l)$",
128
87
  "values": [
129
- {
130
- "value": "s"
131
- },
132
- {
133
- "value": "m"
134
- },
135
- {
136
- "value": "l"
137
- },
138
- {
139
- "value": "xl"
140
- }
88
+ { "value": "s" },
89
+ { "value": "m" },
90
+ { "value": "l" },
91
+ { "value": "xl" }
141
92
  ]
142
93
  },
143
- "helpText": {
144
- "type": "string"
145
- },
146
- "placeholder": {
147
- "type": "string"
148
- },
149
- "isDisabled": {
150
- "type": "boolean",
151
- "default": false
152
- }
94
+ "helpText": { "type": "string" },
95
+ "placeholder": { "type": "string" },
96
+ "isDisabled": { "type": "boolean", "default": false }
153
97
  },
154
98
  "states": [
155
- {
156
- "name": "down",
157
- "trigger": "interaction"
158
- },
159
- {
160
- "name": "hover",
161
- "trigger": "interaction"
162
- },
163
- {
164
- "name": "focus-+-hover",
165
- "trigger": "prop"
166
- },
167
- {
168
- "name": "focus-+-not-hover",
169
- "trigger": "prop"
170
- },
171
- {
172
- "name": "keyboard-focus",
173
- "trigger": "interaction"
174
- }
99
+ { "name": "down", "trigger": "interaction" },
100
+ { "name": "hover", "trigger": "interaction" },
101
+ { "name": "focus-+-hover", "trigger": "prop" },
102
+ { "name": "focus-+-not-hover", "trigger": "prop" },
103
+ { "name": "keyboard-focus", "trigger": "interaction" }
175
104
  ],
176
- "lifecycle": {
177
- "introduced": "1.0.0-draft"
178
- },
105
+ "lifecycle": { "introduced": "1.0.0-draft" },
179
106
  "accessibility": {
180
107
  "role": "textbox",
181
108
  "intents": ["input"],
182
109
  "focusable": true,
183
110
  "wcag": [
184
- {
185
- "criterion": "1.3.1",
186
- "level": "A",
187
- "title": "Info and Relationships"
188
- },
111
+ { "criterion": "1.3.1", "level": "A", "title": "Info and Relationships" },
189
112
  {
190
113
  "criterion": "1.3.5",
191
114
  "level": "AA",
192
115
  "title": "Identify Input Purpose"
193
116
  },
194
- {
195
- "criterion": "2.1.1",
196
- "level": "A",
197
- "title": "Keyboard"
198
- },
199
- {
200
- "criterion": "4.1.2",
201
- "level": "A",
202
- "title": "Name, Role, Value"
203
- }
117
+ { "criterion": "2.1.1", "level": "A", "title": "Keyboard" },
118
+ { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
204
119
  ]
205
120
  }
206
121
  }