@adobe/spectrum-design-data 3.3.0 → 3.5.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.
- package/components/accordion.json +32 -102
- package/components/action-bar.json +9 -23
- package/components/action-button.json +52 -92
- package/components/action-group.json +18 -129
- package/components/alert-banner.json +8 -27
- package/components/alert-dialog.json +45 -55
- package/components/avatar-group.json +20 -50
- package/components/avatar.json +44 -123
- package/components/badge.json +66 -160
- package/components/breadcrumbs.json +26 -100
- package/components/button-group.json +32 -63
- package/components/button.json +74 -105
- package/components/calendar.json +8 -67
- package/components/cards.json +31 -46
- package/components/checkbox-group.json +22 -84
- package/components/checkbox.json +33 -96
- package/components/close-button.json +31 -73
- package/components/coach-indicator.json +14 -44
- package/components/coach-mark.json +8 -26
- package/components/color-area.json +20 -93
- package/components/color-handle.json +25 -38
- package/components/color-loupe.json +18 -18
- package/components/color-slider.json +26 -122
- package/components/color-wheel.json +17 -84
- package/components/combo-box.json +56 -188
- package/components/contextual-help.json +87 -126
- package/components/date-picker.json +24 -120
- package/components/divider.json +25 -38
- package/components/drop-zone.json +25 -37
- package/components/field-label.json +22 -59
- package/components/help-text.json +16 -53
- package/components/illustrated-message.json +21 -72
- package/components/in-line-alert.json +13 -53
- package/components/link.json +31 -63
- package/components/list-view.json +15 -73
- package/components/menu.json +51 -180
- package/components/meter.json +35 -76
- package/components/number-field.json +34 -168
- package/components/picker.json +48 -187
- package/components/popover.json +47 -123
- package/components/progress-bar.json +33 -105
- package/components/progress-circle.json +25 -55
- package/components/radio-button.json +14 -67
- package/components/radio-group.json +34 -131
- package/components/rating.json +9 -38
- package/components/search-field.json +40 -125
- package/components/segmented-control.json +27 -69
- package/components/select-box.json +29 -96
- package/components/side-navigation.json +28 -69
- package/components/slider.json +45 -154
- package/components/standard-dialog.json +16 -88
- package/components/status-light.json +51 -133
- package/components/steplist.json +5 -24
- package/components/swatch-group.json +19 -55
- package/components/swatch.json +24 -79
- package/components/switch.json +42 -79
- package/components/table.json +26 -73
- package/components/tabs.json +35 -52
- package/components/tag-field.json +14 -60
- package/components/tag-group.json +22 -55
- package/components/tag.json +27 -77
- package/components/takeover-dialog.json +10 -61
- package/components/text-area.json +55 -204
- package/components/text-field.json +48 -169
- package/components/thumbnail.json +22 -63
- package/components/toast.json +30 -47
- package/components/tooltip.json +37 -84
- package/components/tree-view.json +51 -146
- package/fields/structure.json +1 -2
- package/guidelines/ai-resource-guide.json +42 -0
- package/guidelines/app-frame-overview.json +45 -44
- package/guidelines/applying-the-type-system.json +71 -0
- package/guidelines/attention-hierarchy.json +13 -22
- package/guidelines/background-layers.json +84 -10
- package/guidelines/bi-directionality.json +57 -0
- package/guidelines/border-width.json +70 -0
- package/guidelines/brand.json +24 -12
- package/guidelines/cognitive.json +229 -0
- package/guidelines/colors.json +55 -17
- package/guidelines/component-spacing.json +65 -0
- package/guidelines/contact-us.json +27 -0
- package/guidelines/containers.json +21 -28
- package/guidelines/content-area-browsing-context.json +73 -0
- package/guidelines/creating-bluelines-browsing-context.json +71 -0
- package/guidelines/design-tokens.json +186 -0
- package/guidelines/developer-overview.json +33 -9
- package/guidelines/drop-shadow.json +76 -0
- package/guidelines/faqs.json +100 -9
- package/guidelines/fonts.json +33 -14
- package/guidelines/grammar-and-mechanics.json +276 -0
- package/guidelines/grays.json +17 -44
- package/guidelines/header-browsing-context.json +40 -0
- package/guidelines/icon-fundamentals.json +7 -18
- package/guidelines/illustration.json +120 -0
- package/guidelines/in-product-word-list.json +25 -0
- package/guidelines/inclusive-design.json +101 -0
- package/guidelines/inclusive-ux-writing.json +34 -0
- package/guidelines/internationalization.json +103 -0
- package/guidelines/layout-spacing.json +39 -0
- package/guidelines/manifest.json +280 -16
- package/guidelines/motion.json +18 -13
- package/guidelines/object-styles-overview.json +17 -0
- package/guidelines/principles.json +7 -8
- package/guidelines/resources.json +29 -15
- package/guidelines/rounding.json +85 -0
- package/guidelines/side-navigation-browsing-context.json +74 -0
- package/guidelines/spacing-overview.json +78 -0
- package/guidelines/states.json +16 -11
- package/guidelines/support.json +125 -0
- package/guidelines/typography-overview.json +39 -0
- package/guidelines/typography-system.json +212 -0
- package/guidelines/using-icons.json +32 -47
- package/guidelines/voice-and-tone.json +51 -0
- package/guidelines/whats-new.json +21 -0
- package/guidelines/writing-about-people.json +99 -0
- package/guidelines/writing-for-errors.json +140 -0
- package/guidelines/writing-for-onboarding.json +123 -0
- package/guidelines/writing-for-readability.json +66 -0
- package/guidelines/writing-with-visuals.json +78 -0
- package/llms.txt +27 -0
- package/package.json +3 -2
- package/tokens/layout.tokens.json +88 -0
|
@@ -9,13 +9,6 @@
|
|
|
9
9
|
"category": "inputs",
|
|
10
10
|
"documentationUrl": "https://spectrum.adobe.com/page/radio-group/"
|
|
11
11
|
},
|
|
12
|
-
"implementations": [
|
|
13
|
-
{
|
|
14
|
-
"platform": "web",
|
|
15
|
-
"componentName": "RadioGroup",
|
|
16
|
-
"package": "@react-spectrum/s2"
|
|
17
|
-
}
|
|
18
|
-
],
|
|
19
12
|
"documentBlocks": [
|
|
20
13
|
{
|
|
21
14
|
"type": "purpose",
|
|
@@ -23,187 +16,97 @@
|
|
|
23
16
|
},
|
|
24
17
|
{
|
|
25
18
|
"type": "guideline",
|
|
26
|
-
"content": "
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"type": "guideline",
|
|
30
|
-
"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."
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"type": "guideline",
|
|
34
|
-
"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."
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"type": "guideline",
|
|
38
|
-
"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."
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"type": "guideline",
|
|
42
|
-
"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."
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"type": "guideline",
|
|
46
|
-
"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."
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"type": "guideline",
|
|
50
|
-
"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."
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"type": "guideline",
|
|
54
|
-
"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."
|
|
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."
|
|
55
20
|
},
|
|
56
21
|
{
|
|
57
22
|
"type": "guideline",
|
|
58
|
-
"content": "
|
|
23
|
+
"content": "Text overflow.\n\nWhen the label is too long for the horizontal space available, it wraps to form another line."
|
|
59
24
|
},
|
|
60
25
|
{
|
|
61
26
|
"type": "guideline",
|
|
62
|
-
"content": "
|
|
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."
|
|
63
28
|
},
|
|
64
29
|
{
|
|
65
30
|
"type": "guideline",
|
|
66
|
-
"content": "
|
|
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."
|
|
67
32
|
},
|
|
68
33
|
{
|
|
69
34
|
"type": "guideline",
|
|
70
|
-
"content": "
|
|
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)."
|
|
71
36
|
},
|
|
72
37
|
{
|
|
73
38
|
"type": "guideline",
|
|
74
|
-
"content": "
|
|
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."
|
|
75
40
|
},
|
|
76
41
|
{
|
|
77
42
|
"type": "guideline",
|
|
78
|
-
"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)."
|
|
79
44
|
},
|
|
80
45
|
{
|
|
81
46
|
"type": "guideline",
|
|
82
|
-
"content": "
|
|
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."
|
|
83
48
|
},
|
|
84
49
|
{
|
|
85
50
|
"type": "guideline",
|
|
86
|
-
"content": "
|
|
51
|
+
"content": "Keyboard interactions.\n\nKey Interaction Tab Moves focus onto or off of the button. Space or Enter Executes 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."
|
|
87
52
|
},
|
|
88
53
|
{
|
|
89
54
|
"type": "guideline",
|
|
90
|
-
"content": "
|
|
55
|
+
"content": "Cursor guidelines.\n\nCursor Usage Pointer Use the pointer cursor for all interactive components."
|
|
91
56
|
},
|
|
92
57
|
{
|
|
93
58
|
"type": "guideline",
|
|
94
|
-
"content": "
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
"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)."
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
"type": "guideline",
|
|
102
|
-
"content": "Switches are best for communicating activation (e.g., turning a setting on or off)."
|
|
103
|
-
},
|
|
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 A Non‑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, AAA Buttons 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 A Color 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 AA Large 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 AA Buttons should be built in such a way that they can be resized without assistive technology up to 200%. Visual presentation 1.4.8 AAA The 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 AA The visual presentation of icons and various states have a contrast ratio of at least 3:1. Text spacing 1.4.12 AA Line 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, AAA All functionality of the component is operable through a keyboard without specific timing for keystrokes. Keyboard traps 2.1.2 A Focus 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, AAA There is no flashing content or unnecessary motion or animation in this component. Focus order 2.4.3 A Navigation sequences receive focus in an order that preserves meaning and operability. Focus visible 2.4.7 AA Keyboard states use an indicator that is visible with at least 3:1 contrast."
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"implementations": [
|
|
104
63
|
{
|
|
105
|
-
"
|
|
106
|
-
"
|
|
64
|
+
"platform": "web",
|
|
65
|
+
"componentName": "RadioGroup",
|
|
66
|
+
"package": "@react-spectrum/s2"
|
|
107
67
|
}
|
|
108
68
|
],
|
|
109
69
|
"options": {
|
|
110
|
-
"label": {
|
|
111
|
-
"type": "string"
|
|
112
|
-
},
|
|
70
|
+
"label": { "type": "string" },
|
|
113
71
|
"labelPosition": {
|
|
114
72
|
"type": "string",
|
|
115
73
|
"default": "top",
|
|
116
|
-
"values": [
|
|
117
|
-
{
|
|
118
|
-
"value": "top"
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
"value": "side"
|
|
122
|
-
}
|
|
123
|
-
]
|
|
74
|
+
"values": [{ "value": "top" }, { "value": "side" }]
|
|
124
75
|
},
|
|
125
76
|
"orientation": {
|
|
126
77
|
"type": "string",
|
|
127
78
|
"default": "vertical",
|
|
128
|
-
"values": [
|
|
129
|
-
{
|
|
130
|
-
"value": "horizontal"
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
"value": "vertical"
|
|
134
|
-
}
|
|
135
|
-
]
|
|
79
|
+
"values": [{ "value": "horizontal" }, { "value": "vertical" }]
|
|
136
80
|
},
|
|
137
81
|
"size": {
|
|
138
82
|
"type": "string",
|
|
139
83
|
"default": "m",
|
|
140
84
|
"values": [
|
|
141
|
-
{
|
|
142
|
-
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
"value": "m"
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
"value": "l"
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
"value": "xl"
|
|
152
|
-
}
|
|
85
|
+
{ "value": "s" },
|
|
86
|
+
{ "value": "m" },
|
|
87
|
+
{ "value": "l" },
|
|
88
|
+
{ "value": "xl" }
|
|
153
89
|
]
|
|
154
90
|
},
|
|
155
|
-
"isEmphasized": {
|
|
156
|
-
"type": "boolean",
|
|
157
|
-
"default": false
|
|
158
|
-
},
|
|
91
|
+
"isEmphasized": { "type": "boolean", "default": false },
|
|
159
92
|
"necessityIndicator": {
|
|
160
93
|
"type": "string",
|
|
161
94
|
"default": "icon",
|
|
162
|
-
"values": [
|
|
163
|
-
{
|
|
164
|
-
"value": "text"
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
"value": "icon"
|
|
168
|
-
}
|
|
169
|
-
]
|
|
170
|
-
},
|
|
171
|
-
"isRequired": {
|
|
172
|
-
"type": "boolean",
|
|
173
|
-
"default": false
|
|
174
|
-
},
|
|
175
|
-
"isError": {
|
|
176
|
-
"type": "boolean",
|
|
177
|
-
"default": false
|
|
178
|
-
},
|
|
179
|
-
"isDisabled": {
|
|
180
|
-
"type": "boolean",
|
|
181
|
-
"default": false
|
|
95
|
+
"values": [{ "value": "text" }, { "value": "icon" }]
|
|
182
96
|
},
|
|
183
|
-
"
|
|
184
|
-
|
|
185
|
-
},
|
|
186
|
-
"
|
|
187
|
-
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
"lifecycle": {
|
|
191
|
-
"introduced": "1.0.0-draft"
|
|
97
|
+
"isRequired": { "type": "boolean", "default": false },
|
|
98
|
+
"isError": { "type": "boolean", "default": false },
|
|
99
|
+
"isDisabled": { "type": "boolean", "default": false },
|
|
100
|
+
"errorMessage": { "type": "string" },
|
|
101
|
+
"description": { "type": "string" }
|
|
192
102
|
},
|
|
103
|
+
"lifecycle": { "introduced": "1.0.0-draft" },
|
|
193
104
|
"accessibility": {
|
|
194
105
|
"intents": ["choose"],
|
|
195
106
|
"focusable": false,
|
|
196
107
|
"wcag": [
|
|
197
|
-
{
|
|
198
|
-
|
|
199
|
-
"level": "A",
|
|
200
|
-
"title": "Info and Relationships"
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
"criterion": "4.1.2",
|
|
204
|
-
"level": "A",
|
|
205
|
-
"title": "Name, Role, Value"
|
|
206
|
-
}
|
|
108
|
+
{ "criterion": "1.3.1", "level": "A", "title": "Info and Relationships" },
|
|
109
|
+
{ "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
|
|
207
110
|
]
|
|
208
111
|
}
|
|
209
112
|
}
|
package/components/rating.json
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
83
|
-
|
|
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
|
-
|
|
105
|
-
|
|
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
|
}
|
|
@@ -9,13 +9,6 @@
|
|
|
9
9
|
"category": "inputs",
|
|
10
10
|
"documentationUrl": "https://spectrum.adobe.com/page/search-field/"
|
|
11
11
|
},
|
|
12
|
-
"implementations": [
|
|
13
|
-
{
|
|
14
|
-
"platform": "web",
|
|
15
|
-
"componentName": "SearchField",
|
|
16
|
-
"package": "@react-spectrum/s2"
|
|
17
|
-
}
|
|
18
|
-
],
|
|
19
12
|
"documentBlocks": [
|
|
20
13
|
{
|
|
21
14
|
"type": "purpose",
|
|
@@ -23,191 +16,113 @@
|
|
|
23
16
|
},
|
|
24
17
|
{
|
|
25
18
|
"type": "guideline",
|
|
26
|
-
"content": "
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"type": "guideline",
|
|
30
|
-
"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)."
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"type": "guideline",
|
|
34
|
-
"content": "The value shows a user’s entered text in regular body text style."
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"type": "guideline",
|
|
38
|
-
"content": "The width of a search field can be customized appropriately for its context."
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"type": "guideline",
|
|
42
|
-
"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."
|
|
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."
|
|
43
20
|
},
|
|
44
21
|
{
|
|
45
22
|
"type": "guideline",
|
|
46
|
-
"content": "
|
|
23
|
+
"content": "Text overflow.\n\nWhen the entered text is too long for the available horizontal space in the field, the text truncates."
|
|
47
24
|
},
|
|
48
25
|
{
|
|
49
26
|
"type": "guideline",
|
|
50
|
-
"content": "
|
|
27
|
+
"content": "Help text overflow.\n\nWhen the help text is too long for the available horizontal space, it wraps to form another line."
|
|
51
28
|
},
|
|
52
29
|
{
|
|
53
30
|
"type": "guideline",
|
|
54
|
-
"content": "
|
|
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."
|
|
55
32
|
},
|
|
56
33
|
{
|
|
57
34
|
"type": "guideline",
|
|
58
|
-
"content": "
|
|
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."
|
|
59
36
|
},
|
|
60
37
|
{
|
|
61
38
|
"type": "guideline",
|
|
62
|
-
"content": "
|
|
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."
|
|
63
40
|
},
|
|
64
41
|
{
|
|
65
42
|
"type": "guideline",
|
|
66
|
-
"content": "
|
|
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."
|
|
67
44
|
},
|
|
68
45
|
{
|
|
69
46
|
"type": "guideline",
|
|
70
|
-
"content": "
|
|
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."
|
|
71
48
|
},
|
|
72
49
|
{
|
|
73
50
|
"type": "guideline",
|
|
74
|
-
"content": "The in
|
|
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."
|
|
75
52
|
},
|
|
76
53
|
{
|
|
77
54
|
"type": "guideline",
|
|
78
|
-
"content": "
|
|
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."
|
|
79
56
|
},
|
|
80
57
|
{
|
|
81
58
|
"type": "guideline",
|
|
82
|
-
"content": "
|
|
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."
|
|
83
60
|
},
|
|
84
61
|
{
|
|
85
62
|
"type": "guideline",
|
|
86
|
-
"content": "
|
|
63
|
+
"content": "Keyboard interactions.\n\nKey Interaction Tab Moves focus onto or off of the button. Space or Enter Executes 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."
|
|
87
64
|
},
|
|
88
65
|
{
|
|
89
66
|
"type": "guideline",
|
|
90
|
-
"content": "
|
|
67
|
+
"content": "Cursor guidelines.\n\nCursor Usage Pointer Use the pointer cursor for all interactive components."
|
|
91
68
|
},
|
|
92
69
|
{
|
|
93
70
|
"type": "guideline",
|
|
94
|
-
"content": "
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
"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."
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
"type": "guideline",
|
|
102
|
-
"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."
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
"type": "guideline",
|
|
106
|
-
"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."
|
|
107
|
-
},
|
|
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 A Non‑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, AAA Buttons 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 A Color 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 AA Large 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 AA Buttons should be built in such a way that they can be resized without assistive technology up to 200%. Visual presentation 1.4.8 AAA The 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 AA The visual presentation of icons and various states have a contrast ratio of at least 3:1. Text spacing 1.4.12 AA Line 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, AAA All functionality of the component is operable through a keyboard without specific timing for keystrokes. Keyboard traps 2.1.2 A Focus 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, AAA There is no flashing content or unnecessary motion or animation in this component. Focus order 2.4.3 A Navigation sequences receive focus in an order that preserves meaning and operability. Focus visible 2.4.7 AA Keyboard states use an indicator that is visible with at least 3:1 contrast."
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"implementations": [
|
|
108
75
|
{
|
|
109
|
-
"
|
|
110
|
-
"
|
|
76
|
+
"platform": "web",
|
|
77
|
+
"componentName": "SearchField",
|
|
78
|
+
"package": "@react-spectrum/s2"
|
|
111
79
|
}
|
|
112
80
|
],
|
|
113
81
|
"options": {
|
|
114
|
-
"label": {
|
|
115
|
-
|
|
116
|
-
},
|
|
117
|
-
"hideLabel": {
|
|
118
|
-
"type": "boolean",
|
|
119
|
-
"default": false
|
|
120
|
-
},
|
|
82
|
+
"label": { "type": "string" },
|
|
83
|
+
"hideLabel": { "type": "boolean", "default": false },
|
|
121
84
|
"icon": {
|
|
122
85
|
"$ref": "https://opensource.adobe.com/spectrum-design-data/schemas/types/workflow-icon.json",
|
|
123
86
|
"description": "Icon must be present if the label is not defined."
|
|
124
87
|
},
|
|
125
|
-
"value": {
|
|
126
|
-
|
|
127
|
-
},
|
|
128
|
-
"width": {
|
|
129
|
-
"type": "number"
|
|
130
|
-
},
|
|
88
|
+
"value": { "type": "string" },
|
|
89
|
+
"width": { "type": "number" },
|
|
131
90
|
"size": {
|
|
132
91
|
"type": "string",
|
|
133
92
|
"default": "m",
|
|
134
93
|
"pattern": "^(x?s|m|x{0,3}l)$",
|
|
135
94
|
"values": [
|
|
136
|
-
{
|
|
137
|
-
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
"value": "m"
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
"value": "l"
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
"value": "xl"
|
|
147
|
-
}
|
|
95
|
+
{ "value": "s" },
|
|
96
|
+
{ "value": "m" },
|
|
97
|
+
{ "value": "l" },
|
|
98
|
+
{ "value": "xl" }
|
|
148
99
|
]
|
|
149
100
|
},
|
|
150
|
-
"helpText": {
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
"placeholder": {
|
|
154
|
-
"type": "string"
|
|
155
|
-
},
|
|
156
|
-
"isDisabled": {
|
|
157
|
-
"type": "boolean",
|
|
158
|
-
"default": false
|
|
159
|
-
}
|
|
101
|
+
"helpText": { "type": "string" },
|
|
102
|
+
"placeholder": { "type": "string" },
|
|
103
|
+
"isDisabled": { "type": "boolean", "default": false }
|
|
160
104
|
},
|
|
161
105
|
"states": [
|
|
162
|
-
{
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
"name": "hover",
|
|
168
|
-
"trigger": "interaction"
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
"name": "focus-+-hover",
|
|
172
|
-
"trigger": "prop"
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
"name": "focus-+-not-hover",
|
|
176
|
-
"trigger": "prop"
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
"name": "keyboard-focus",
|
|
180
|
-
"trigger": "interaction"
|
|
181
|
-
}
|
|
106
|
+
{ "name": "down", "trigger": "interaction" },
|
|
107
|
+
{ "name": "hover", "trigger": "interaction" },
|
|
108
|
+
{ "name": "focus-+-hover", "trigger": "prop" },
|
|
109
|
+
{ "name": "focus-+-not-hover", "trigger": "prop" },
|
|
110
|
+
{ "name": "keyboard-focus", "trigger": "interaction" }
|
|
182
111
|
],
|
|
183
|
-
"lifecycle": {
|
|
184
|
-
"introduced": "1.0.0-draft"
|
|
185
|
-
},
|
|
112
|
+
"lifecycle": { "introduced": "1.0.0-draft" },
|
|
186
113
|
"accessibility": {
|
|
187
114
|
"role": "textbox",
|
|
188
115
|
"intents": ["input"],
|
|
189
116
|
"focusable": true,
|
|
190
117
|
"wcag": [
|
|
191
|
-
{
|
|
192
|
-
"criterion": "1.3.1",
|
|
193
|
-
"level": "A",
|
|
194
|
-
"title": "Info and Relationships"
|
|
195
|
-
},
|
|
118
|
+
{ "criterion": "1.3.1", "level": "A", "title": "Info and Relationships" },
|
|
196
119
|
{
|
|
197
120
|
"criterion": "1.3.5",
|
|
198
121
|
"level": "AA",
|
|
199
122
|
"title": "Identify Input Purpose"
|
|
200
123
|
},
|
|
201
|
-
{
|
|
202
|
-
|
|
203
|
-
"level": "A",
|
|
204
|
-
"title": "Keyboard"
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
"criterion": "4.1.2",
|
|
208
|
-
"level": "A",
|
|
209
|
-
"title": "Name, Role, Value"
|
|
210
|
-
}
|
|
124
|
+
{ "criterion": "2.1.1", "level": "A", "title": "Keyboard" },
|
|
125
|
+
{ "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
|
|
211
126
|
]
|
|
212
127
|
}
|
|
213
128
|
}
|