@adobe/spectrum-design-data 3.3.0 → 3.4.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/package.json +2 -2
- package/tokens/layout.tokens.json +88 -0
package/components/menu.json
CHANGED
|
@@ -9,13 +9,6 @@
|
|
|
9
9
|
"category": "actions",
|
|
10
10
|
"documentationUrl": "https://spectrum.adobe.com/page/menu/"
|
|
11
11
|
},
|
|
12
|
-
"implementations": [
|
|
13
|
-
{
|
|
14
|
-
"platform": "web",
|
|
15
|
-
"componentName": "Menu",
|
|
16
|
-
"package": "@react-spectrum/s2"
|
|
17
|
-
}
|
|
18
|
-
],
|
|
19
12
|
"documentBlocks": [
|
|
20
13
|
{
|
|
21
14
|
"type": "purpose",
|
|
@@ -23,202 +16,117 @@
|
|
|
23
16
|
},
|
|
24
17
|
{
|
|
25
18
|
"type": "guideline",
|
|
26
|
-
"content": "
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"type": "guideline",
|
|
30
|
-
"content": "An unavailable menu item signals that an option exists but isn’t accessible in the current scenario. This helps ensure the label remains visible and provides context about why the option is unavailable, or directions for how to make it available."
|
|
19
|
+
"content": "Drill-in chevron.\n\nWhen a menu item includes a submenu, a drill-in chevron appears at the end of the item to indicate that additional options are available."
|
|
31
20
|
},
|
|
32
21
|
{
|
|
33
22
|
"type": "guideline",
|
|
34
|
-
"content": "
|
|
23
|
+
"content": "Link-out icon.\n\nWhen a menu item leads to a different context, such as a new page or dialog, a link-out icon appears at the end of the item to indicate that the user will navigate away from the current view."
|
|
35
24
|
},
|
|
36
25
|
{
|
|
37
26
|
"type": "guideline",
|
|
38
|
-
"content": "
|
|
27
|
+
"content": "Popover submenus.\n\nWhen a menu is displayed within popovers, a submenu will appear adjacent to the parent menu item in a separate popover. The submenu popover is aligned with an offset to horizontally overlap the parent menu and vertically align the first submenu item with the parent menu item. When a menu is shown in a popover, any submenu appears in a separate popover next to the parent item. The submenu popover is positioned to overlap the parent menu horizontally, with vertical alignment that matches the first submenu item to its parent."
|
|
39
28
|
},
|
|
40
29
|
{
|
|
41
30
|
"type": "guideline",
|
|
42
|
-
"content": "
|
|
31
|
+
"content": "Tray submenus.\n\nWhen a menu is shown in a tray, selecting a parent item with a submenu replaces the tray's content with the submenu. A back button labeled with the parent item's title appears at the top of the tray to let users return to the previous menu level."
|
|
43
32
|
},
|
|
44
33
|
{
|
|
45
34
|
"type": "guideline",
|
|
46
|
-
"content": "
|
|
35
|
+
"content": "Keyboard focus.\n\nA menu item can be navigated using a keyboard. The keyboard focus state takes the menu item's visual hover state and adds a focus ring around the item."
|
|
47
36
|
},
|
|
48
37
|
{
|
|
49
38
|
"type": "guideline",
|
|
50
|
-
"content": "
|
|
39
|
+
"content": "Text overflow.\n\nWhen a menu item's label or description are too long for the available horizontal space, they wrap to form another line."
|
|
51
40
|
},
|
|
52
41
|
{
|
|
53
42
|
"type": "guideline",
|
|
54
|
-
"content": "
|
|
43
|
+
"content": "Section dividers.\n\nDividers appear between sections when two or more sections are used within the same menu."
|
|
55
44
|
},
|
|
56
45
|
{
|
|
57
46
|
"type": "guideline",
|
|
58
|
-
"content": "
|
|
47
|
+
"content": "Windows high contrast mode.\n\nIn Windows high contrast mode, menu items should display with default text color. Selected items should have the background and text colors defined for selected text."
|
|
59
48
|
},
|
|
60
49
|
{
|
|
61
50
|
"type": "guideline",
|
|
62
|
-
"content": "
|
|
51
|
+
"content": "Use consistent sizing.\n\nMenus should be sized according to the component being used as the menu trigger. All submenus within the menu should also be using the same size as the menu trigger."
|
|
63
52
|
},
|
|
64
53
|
{
|
|
65
54
|
"type": "guideline",
|
|
66
|
-
"content": "
|
|
55
|
+
"content": "Use sentence case for menu items.\n\nFollowing Adobe's UX writing style, write menu items in sentence case unless they contain words that are branded terms."
|
|
67
56
|
},
|
|
68
57
|
{
|
|
69
58
|
"type": "guideline",
|
|
70
|
-
"content": "
|
|
59
|
+
"content": "Ellipses in menu commands.\n\nDon't end a menu command with an ellipsis (…) unless it requires additional input to complete the action, typically in a dialog."
|
|
71
60
|
},
|
|
72
61
|
{
|
|
73
62
|
"type": "guideline",
|
|
74
|
-
"content": "
|
|
63
|
+
"content": "Using descriptions in menu items.\n\nOnly use descriptions in menu items when the information will help a user to decide which action to take from the menu. Don't overload menu items with repetitive information or with promotional calls-to-action."
|
|
75
64
|
},
|
|
76
65
|
{
|
|
77
66
|
"type": "guideline",
|
|
78
|
-
"content": "
|
|
67
|
+
"content": "RTL.\n\nFor RTL (right-to-left) languages, the entire menu is mirrored horizontally, including the direction of the drill-in chevron and popover placement for submenus."
|
|
79
68
|
},
|
|
80
69
|
{
|
|
81
70
|
"type": "guideline",
|
|
82
|
-
"content": "
|
|
71
|
+
"content": "Keyboard interactions.\n\nKey Interaction Enter or Space Opens menu and moves focus to first item. Down Arrow (on trigger) Opens menu and moves focus to first item. Up Arrow (on trigger, optional) Opens menu and moves focus to last item. Up Arrow / Down Arrow (in menu) Moves focus to previous/next item at the current menu level (wrapping behavior may be implementation-defined). Right Arrow / Left Arrow In submenu hierarchies: opens child submenu or returns to parent menu item (direction follows hierarchy and orientation). Home / End Moves focus to first/last item in current menu level. Printable character keys Moves focus to the next item whose label begins with typed character(s) (typeahead). Enter or Space (on item) Activates item. For checkbox/radio/switch items, may toggle state and optionally keep menu open based on selection behavior. Esc Closes current submenu/menu and returns focus to parent item or menu trigger. Tab / Shift + Tab Exits menu, closes open menus, and moves focus to next/previous focusable element."
|
|
83
72
|
},
|
|
84
73
|
{
|
|
85
74
|
"type": "guideline",
|
|
86
|
-
"content": "
|
|
75
|
+
"content": "Cursor guidelines.\n\nCursor Description Pointer Use the pointer cursor for all interactive components in every state."
|
|
87
76
|
},
|
|
88
77
|
{
|
|
89
78
|
"type": "guideline",
|
|
90
|
-
"content": "
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"content": "When a menu is displayed within popovers, a submenu will appear adjacent to the parent menu item in a separate popover. The submenu popover is aligned with an offset to horizontally overlap the parent menu and vertically align the first submenu item with the parent menu item."
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"type": "guideline",
|
|
98
|
-
"content": "When a menu is shown in a popover, any submenu appears in a separate popover next to the parent item. The submenu popover is positioned to overlap the parent menu horizontally, with vertical alignment that matches the first submenu item to its parent."
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
"type": "guideline",
|
|
102
|
-
"content": "When a menu is shown in a tray, selecting a parent item with a submenu replaces the tray’s content with the submenu. A back button labeled with the parent item’s title appears at the top of the tray to let users return to the previous menu level."
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
"type": "guideline",
|
|
106
|
-
"content": "A menu item can be navigated using a keyboard. The keyboard focus state takes the menu item’s visual hover state and adds a focus ring around the item."
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
"type": "guideline",
|
|
110
|
-
"content": "When a menu item’s label or description are too long for the available horizontal space, they wrap to form another line."
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
"type": "guideline",
|
|
114
|
-
"content": "Dividers appear between sections when two or more sections are used within the same menu."
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
"type": "guideline",
|
|
118
|
-
"content": "In Windows high contrast mode, menu items should display with default text color. Selected items should have the background and text colors defined for selected text."
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
"type": "guideline",
|
|
122
|
-
"content": "Menus should be sized according to the component being used as the menu trigger. All submenus within the menu should also be using the same size as the menu trigger."
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
"type": "guideline",
|
|
126
|
-
"content": "Following Adobe’s UX writing style, write menu items in sentence case unless they contain words that are branded terms."
|
|
127
|
-
},
|
|
79
|
+
"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 menu items, must provide a text alternative that communicates the item's purpose. All menu items, especially icon-only items, 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 Menus must be understandable to assistive technologies, such as screen readers. Use proper semantic HTML or the appropriate ARIA roles to ensure accessibility. Text contrast 1.4.3 AA The visual presentation of text has a contrast ratio of at least 4.5:1. Resize text 1.4.4 AA Menus 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 illustrations and component 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."
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
"implementations": [
|
|
128
83
|
{
|
|
129
|
-
"
|
|
130
|
-
"
|
|
84
|
+
"platform": "web",
|
|
85
|
+
"componentName": "Menu",
|
|
86
|
+
"package": "@react-spectrum/s2"
|
|
131
87
|
}
|
|
132
88
|
],
|
|
133
89
|
"options": {
|
|
134
90
|
"container": {
|
|
135
91
|
"type": "string",
|
|
136
|
-
"values": [
|
|
137
|
-
{
|
|
138
|
-
"value": "popover"
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
"value": "tray"
|
|
142
|
-
}
|
|
143
|
-
]
|
|
144
|
-
},
|
|
145
|
-
"label": {
|
|
146
|
-
"type": "string"
|
|
92
|
+
"values": [{ "value": "popover" }, { "value": "tray" }]
|
|
147
93
|
},
|
|
94
|
+
"label": { "type": "string" },
|
|
148
95
|
"icon": {
|
|
149
96
|
"$ref": "https://opensource.adobe.com/spectrum-design-data/schemas/types/workflow-icon.json",
|
|
150
97
|
"description": "Icon must be present if the label is not defined."
|
|
151
98
|
},
|
|
152
|
-
"description": {
|
|
153
|
-
|
|
154
|
-
},
|
|
155
|
-
"value": {
|
|
156
|
-
"type": "string"
|
|
157
|
-
},
|
|
99
|
+
"description": { "type": "string" },
|
|
100
|
+
"value": { "type": "string" },
|
|
158
101
|
"size": {
|
|
159
102
|
"type": "string",
|
|
160
103
|
"default": "m",
|
|
161
104
|
"values": [
|
|
162
|
-
{
|
|
163
|
-
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
"value": "m"
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
"value": "l"
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
"value": "xl"
|
|
173
|
-
}
|
|
105
|
+
{ "value": "s" },
|
|
106
|
+
{ "value": "m" },
|
|
107
|
+
{ "value": "l" },
|
|
108
|
+
{ "value": "xl" }
|
|
174
109
|
]
|
|
175
110
|
},
|
|
176
111
|
"selectionMode": {
|
|
177
112
|
"type": "string",
|
|
178
113
|
"values": [
|
|
179
|
-
{
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
{
|
|
183
|
-
"value": "multiple"
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
"value": "no selection"
|
|
187
|
-
}
|
|
114
|
+
{ "value": "single" },
|
|
115
|
+
{ "value": "multiple" },
|
|
116
|
+
{ "value": "no selection" }
|
|
188
117
|
]
|
|
189
118
|
},
|
|
190
119
|
"selectionStyle": {
|
|
191
120
|
"type": "string",
|
|
192
|
-
"values": [
|
|
193
|
-
{
|
|
194
|
-
"value": "checkbox"
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
"value": "switch"
|
|
198
|
-
}
|
|
199
|
-
]
|
|
200
|
-
},
|
|
201
|
-
"sectionHeader": {
|
|
202
|
-
"type": "string"
|
|
203
|
-
},
|
|
204
|
-
"isCollapsible": {
|
|
205
|
-
"type": "boolean",
|
|
206
|
-
"default": false
|
|
121
|
+
"values": [{ "value": "checkbox" }, { "value": "switch" }]
|
|
207
122
|
},
|
|
208
|
-
"
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}
|
|
212
|
-
"isDisabled": {
|
|
213
|
-
"type": "boolean",
|
|
214
|
-
"default": false
|
|
215
|
-
}
|
|
123
|
+
"sectionHeader": { "type": "string" },
|
|
124
|
+
"isCollapsible": { "type": "boolean", "default": false },
|
|
125
|
+
"isUnavailable": { "type": "boolean", "default": false },
|
|
126
|
+
"isDisabled": { "type": "boolean", "default": false }
|
|
216
127
|
},
|
|
217
128
|
"anatomy": [
|
|
218
|
-
{
|
|
219
|
-
"name": "item-label",
|
|
220
|
-
"description": "Label text of a menu item."
|
|
221
|
-
},
|
|
129
|
+
{ "name": "item-label", "description": "Label text of a menu item." },
|
|
222
130
|
{
|
|
223
131
|
"name": "menu-item",
|
|
224
132
|
"description": "A single row within the menu.",
|
|
@@ -234,22 +142,13 @@
|
|
|
234
142
|
"link-out-icon"
|
|
235
143
|
]
|
|
236
144
|
},
|
|
237
|
-
{
|
|
238
|
-
|
|
239
|
-
"description": "Leading icon of a menu item."
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
"name": "label",
|
|
243
|
-
"description": "Primary label text of a menu item."
|
|
244
|
-
},
|
|
145
|
+
{ "name": "icon", "description": "Leading icon of a menu item." },
|
|
146
|
+
{ "name": "label", "description": "Primary label text of a menu item." },
|
|
245
147
|
{
|
|
246
148
|
"name": "description",
|
|
247
149
|
"description": "Secondary descriptive text of a menu item."
|
|
248
150
|
},
|
|
249
|
-
{
|
|
250
|
-
"name": "value",
|
|
251
|
-
"description": "Current value display of a menu item."
|
|
252
|
-
},
|
|
151
|
+
{ "name": "value", "description": "Current value display of a menu item." },
|
|
253
152
|
{
|
|
254
153
|
"name": "switch",
|
|
255
154
|
"description": "Switch control for a menu item with switch selection style."
|
|
@@ -258,10 +157,7 @@
|
|
|
258
157
|
"name": "checkbox",
|
|
259
158
|
"description": "Checkbox control for a menu item with checkbox selection style."
|
|
260
159
|
},
|
|
261
|
-
{
|
|
262
|
-
"name": "thumbnail",
|
|
263
|
-
"description": "Thumbnail image of a menu item."
|
|
264
|
-
},
|
|
160
|
+
{ "name": "thumbnail", "description": "Thumbnail image of a menu item." },
|
|
265
161
|
{
|
|
266
162
|
"name": "drill-in-chevron",
|
|
267
163
|
"description": "Chevron indicating a menu item opens a sub-menu."
|
|
@@ -272,46 +168,21 @@
|
|
|
272
168
|
}
|
|
273
169
|
],
|
|
274
170
|
"states": [
|
|
275
|
-
{
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
"name": "down",
|
|
281
|
-
"trigger": "interaction"
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
"name": "keyboard-focus",
|
|
285
|
-
"trigger": "interaction"
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
"name": "default",
|
|
289
|
-
"trigger": "prop"
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
"name": "disabled",
|
|
293
|
-
"trigger": "prop"
|
|
294
|
-
}
|
|
171
|
+
{ "name": "hover", "trigger": "interaction" },
|
|
172
|
+
{ "name": "down", "trigger": "interaction" },
|
|
173
|
+
{ "name": "keyboard-focus", "trigger": "interaction" },
|
|
174
|
+
{ "name": "default", "trigger": "prop" },
|
|
175
|
+
{ "name": "disabled", "trigger": "prop" }
|
|
295
176
|
],
|
|
296
|
-
"lifecycle": {
|
|
297
|
-
"introduced": "1.0.0-draft"
|
|
298
|
-
},
|
|
177
|
+
"lifecycle": { "introduced": "1.0.0-draft" },
|
|
299
178
|
"accessibility": {
|
|
300
179
|
"role": "menu",
|
|
301
180
|
"intents": ["select"],
|
|
302
181
|
"focusable": false,
|
|
303
182
|
"keyboardIntents": ["navigate-options", "activate", "dismiss"],
|
|
304
183
|
"wcag": [
|
|
305
|
-
{
|
|
306
|
-
|
|
307
|
-
"level": "A",
|
|
308
|
-
"title": "Keyboard"
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
"criterion": "4.1.2",
|
|
312
|
-
"level": "A",
|
|
313
|
-
"title": "Name, Role, Value"
|
|
314
|
-
}
|
|
184
|
+
{ "criterion": "2.1.1", "level": "A", "title": "Keyboard" },
|
|
185
|
+
{ "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
|
|
315
186
|
]
|
|
316
187
|
}
|
|
317
188
|
}
|
package/components/meter.json
CHANGED
|
@@ -9,19 +9,6 @@
|
|
|
9
9
|
"category": "status",
|
|
10
10
|
"documentationUrl": "https://spectrum.adobe.com/page/meter/"
|
|
11
11
|
},
|
|
12
|
-
"implementations": [
|
|
13
|
-
{
|
|
14
|
-
"platform": "web",
|
|
15
|
-
"componentName": "Meter",
|
|
16
|
-
"package": "@react-spectrum/s2"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"platform": "web",
|
|
20
|
-
"componentName": "Meter",
|
|
21
|
-
"importPath": "@adobe/spectrum-wc/components/meter",
|
|
22
|
-
"notes": "Spectrum 2 web component custom element: swc-meter."
|
|
23
|
-
}
|
|
24
|
-
],
|
|
25
12
|
"documentBlocks": [
|
|
26
13
|
{
|
|
27
14
|
"type": "purpose",
|
|
@@ -29,39 +16,48 @@
|
|
|
29
16
|
},
|
|
30
17
|
{
|
|
31
18
|
"type": "guideline",
|
|
32
|
-
"content": "
|
|
19
|
+
"content": "Text overflow.\n\nWhen the label is too long for the available horizontal space, it wraps to form another line. The value is always shown in full and never wraps or truncates."
|
|
33
20
|
},
|
|
34
21
|
{
|
|
35
22
|
"type": "guideline",
|
|
36
|
-
"content": "
|
|
23
|
+
"content": "Progress bar vs. meter.\n\nA progress bar fills automatically as the system loads either determinately or indeterminately. A user's actions do not affect the progress bar; it just indicates how long they must wait for the process to finish. A meter indicates how much the user has completed or how far they are in a continuum."
|
|
37
24
|
},
|
|
38
25
|
{
|
|
39
26
|
"type": "guideline",
|
|
40
|
-
"content": "
|
|
27
|
+
"content": "Labels.\n\nUse the built-in style for showing a label associated with the meter. By default, the label is start-aligned and an optional value is end-aligned above the track. (In left-to-right languages, this means the label appears on the left and the value on the right; in right-to-left languages, this flips.) The label should be written in sentence case. When meters appear in a table, you may use the column header as the label. In this case, set labelPosition=\"side\" or use hideLabel if the column header fully describes what each meter represents."
|
|
41
28
|
},
|
|
42
29
|
{
|
|
43
30
|
"type": "guideline",
|
|
44
|
-
"content": "
|
|
31
|
+
"content": "Representing semantic values.\n\nMeter variants can be used to represent semantic values by switching variants as the value changes, from positive, to notice, and then to negative. This kind of variant switching should be handled appropriately within the context of your product so that you're setting accurate expectations for your users about the semantic meaning."
|
|
45
32
|
},
|
|
46
33
|
{
|
|
47
34
|
"type": "guideline",
|
|
48
|
-
"content": "
|
|
35
|
+
"content": "RTL.\n\nFor RTL (right-to-left) languages, the layout of the meter is mirrored. The label is right-aligned, the value is left-aligned, and the fill progresses from right to left. Beware that the placement of the percent sign differs depending on the locale."
|
|
49
36
|
},
|
|
50
37
|
{
|
|
51
38
|
"type": "guideline",
|
|
52
|
-
"content": "
|
|
39
|
+
"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."
|
|
53
40
|
},
|
|
54
41
|
{
|
|
55
42
|
"type": "guideline",
|
|
56
|
-
"content": "
|
|
43
|
+
"content": "Cursor guidelines.\n\nCursor Usage Pointer Use the pointer cursor for all interactive components."
|
|
57
44
|
},
|
|
58
45
|
{
|
|
59
46
|
"type": "guideline",
|
|
60
|
-
"content": "
|
|
47
|
+
"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."
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"implementations": [
|
|
51
|
+
{
|
|
52
|
+
"platform": "web",
|
|
53
|
+
"componentName": "Meter",
|
|
54
|
+
"package": "@react-spectrum/s2"
|
|
61
55
|
},
|
|
62
56
|
{
|
|
63
|
-
"
|
|
64
|
-
"
|
|
57
|
+
"platform": "web",
|
|
58
|
+
"componentName": "Meter",
|
|
59
|
+
"importPath": "@adobe/spectrum-wc/components/meter",
|
|
60
|
+
"notes": "Spectrum 2 web component custom element: swc-meter."
|
|
65
61
|
}
|
|
66
62
|
],
|
|
67
63
|
"options": {
|
|
@@ -69,72 +65,35 @@
|
|
|
69
65
|
"type": "string",
|
|
70
66
|
"default": "informative",
|
|
71
67
|
"values": [
|
|
72
|
-
{
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
"value": "positive"
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
"value": "notice"
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"value": "negative"
|
|
83
|
-
}
|
|
68
|
+
{ "value": "informative" },
|
|
69
|
+
{ "value": "positive" },
|
|
70
|
+
{ "value": "notice" },
|
|
71
|
+
{ "value": "negative" }
|
|
84
72
|
]
|
|
85
73
|
},
|
|
86
|
-
"label": {
|
|
87
|
-
|
|
88
|
-
},
|
|
89
|
-
"
|
|
90
|
-
"type": "boolean",
|
|
91
|
-
"default": false
|
|
92
|
-
},
|
|
93
|
-
"valueLabel": {
|
|
94
|
-
"type": "string"
|
|
95
|
-
},
|
|
96
|
-
"width": {
|
|
97
|
-
"type": "number"
|
|
98
|
-
},
|
|
74
|
+
"label": { "type": "string" },
|
|
75
|
+
"hideLabel": { "type": "boolean", "default": false },
|
|
76
|
+
"valueLabel": { "type": "string" },
|
|
77
|
+
"width": { "type": "number" },
|
|
99
78
|
"size": {
|
|
100
79
|
"type": "string",
|
|
101
80
|
"default": "m",
|
|
102
81
|
"values": [
|
|
103
|
-
{
|
|
104
|
-
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"value": "m"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"value": "l"
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
"value": "xl"
|
|
114
|
-
}
|
|
82
|
+
{ "value": "s" },
|
|
83
|
+
{ "value": "m" },
|
|
84
|
+
{ "value": "l" },
|
|
85
|
+
{ "value": "xl" }
|
|
115
86
|
]
|
|
116
87
|
},
|
|
117
|
-
"value": {
|
|
118
|
-
|
|
119
|
-
"minimum": 0,
|
|
120
|
-
"maximum": 1
|
|
121
|
-
},
|
|
122
|
-
"helpText": {
|
|
123
|
-
"type": "string"
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
"lifecycle": {
|
|
127
|
-
"introduced": "1.0.0-draft"
|
|
88
|
+
"value": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
89
|
+
"helpText": { "type": "string" }
|
|
128
90
|
},
|
|
91
|
+
"lifecycle": { "introduced": "1.0.0-draft" },
|
|
129
92
|
"accessibility": {
|
|
130
93
|
"role": "meter",
|
|
131
94
|
"focusable": false,
|
|
132
95
|
"wcag": [
|
|
133
|
-
{
|
|
134
|
-
"criterion": "4.1.2",
|
|
135
|
-
"level": "A",
|
|
136
|
-
"title": "Name, Role, Value"
|
|
137
|
-
}
|
|
96
|
+
{ "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
|
|
138
97
|
]
|
|
139
98
|
}
|
|
140
99
|
}
|