@adobe/spectrum-design-data 3.3.0-beta.2 → 3.3.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 +67 -15
- package/components/action-bar.json +30 -9
- package/components/action-button.json +92 -39
- package/components/action-group.json +137 -18
- package/components/alert-banner.json +27 -8
- package/components/alert-dialog.json +55 -34
- package/components/avatar-group.json +35 -9
- package/components/avatar.json +105 -29
- package/components/badge.json +163 -56
- package/components/breadcrumbs.json +107 -26
- package/components/button-group.json +63 -19
- package/components/button.json +105 -61
- package/components/calendar.json +74 -8
- package/components/card.json +13 -0
- package/components/cards.json +46 -31
- package/components/checkbox-group.json +85 -16
- package/components/checkbox.json +97 -27
- package/components/close-button.json +75 -20
- package/components/coach-indicator.json +44 -14
- package/components/coach-mark.json +26 -8
- package/components/color-area.json +100 -20
- package/components/color-handle.json +46 -25
- package/components/color-loupe.json +14 -2
- package/components/color-slider.json +129 -26
- package/components/color-wheel.json +91 -17
- package/components/combo-box.json +189 -50
- package/components/contextual-help.json +126 -80
- package/components/date-field.json +7 -0
- package/components/date-picker.json +127 -24
- package/components/divider.json +38 -12
- package/components/drop-zone.json +37 -18
- package/components/field-label.json +62 -21
- package/components/heading.json +7 -0
- package/components/help-text.json +53 -16
- package/components/illustrated-message.json +85 -21
- package/components/in-line-alert.json +53 -13
- package/components/link.json +63 -24
- package/components/list-view.json +80 -15
- package/components/menu.json +181 -45
- package/components/meter.json +78 -24
- package/components/number-field.json +175 -34
- package/components/picker.json +188 -42
- package/components/popover.json +126 -37
- package/components/progress-bar.json +108 -23
- package/components/progress-circle.json +55 -12
- package/components/radio-button.json +67 -14
- package/components/radio-group.json +132 -28
- package/components/rating.json +38 -9
- package/components/search-field.json +126 -34
- package/components/segmented-control.json +70 -21
- package/components/select-box.json +103 -29
- package/components/side-navigation.json +69 -28
- package/components/slider.json +155 -39
- package/components/standard-dialog.json +88 -16
- package/components/status-light.json +136 -41
- package/components/steplist.json +24 -5
- package/components/swatch-group.json +55 -19
- package/components/swatch.json +79 -24
- package/components/switch.json +79 -31
- package/components/table.json +73 -26
- package/components/tabs.json +52 -22
- package/components/tag-field.json +60 -14
- package/components/tag-group.json +56 -16
- package/components/tag.json +78 -21
- package/components/takeover-dialog.json +61 -10
- package/components/text-area.json +205 -49
- package/components/text-field.json +170 -42
- package/components/thumbnail.json +63 -22
- package/components/time-field.json +7 -0
- package/components/toast.json +50 -29
- package/components/tooltip.json +87 -27
- package/components/tree-view.json +147 -45
- package/components/user-card.json +7 -0
- package/guidelines/app-frame-overview.json +44 -46
- package/guidelines/attention-hierarchy.json +22 -13
- package/guidelines/background-layers.json +10 -80
- package/guidelines/brand.json +12 -32
- package/guidelines/colors.json +17 -47
- package/guidelines/developer-overview.json +9 -25
- package/guidelines/faqs.json +9 -96
- package/guidelines/fonts.json +14 -29
- package/guidelines/grays.json +44 -17
- package/guidelines/icon-fundamentals.json +18 -7
- package/guidelines/manifest.json +15 -367
- package/guidelines/motion.json +16 -17
- package/guidelines/principles.json +8 -7
- package/guidelines/resources.json +15 -21
- package/guidelines/states.json +11 -16
- package/guidelines/using-icons.json +44 -33
- package/package.json +2 -2
- package/registry/platform-implementations.json +30 -0
- package/guidelines/ai-resource-guide.json +0 -50
- package/guidelines/applying-the-type-system.json +0 -67
- package/guidelines/bi-directionality.json +0 -57
- package/guidelines/border-width.json +0 -58
- package/guidelines/cognitive.json +0 -197
- package/guidelines/component-spacing.json +0 -61
- package/guidelines/contact-us.json +0 -67
- package/guidelines/content-area-browsing-context.json +0 -65
- package/guidelines/content-design-grammar-and-mechanics.json +0 -241
- package/guidelines/content-design-voice-and-tone.json +0 -37
- package/guidelines/content-grammar-and-mechanics.json +0 -252
- package/guidelines/content-language-and-inclusivity-writing-about-people.json +0 -103
- package/guidelines/content-language-and-inclusivity-writing-with-visuals.json +0 -70
- package/guidelines/content-voice-and-tone.json +0 -47
- package/guidelines/creating-bluelines-browsing-context.json +0 -91
- package/guidelines/design-tokens.json +0 -158
- package/guidelines/drop-shadow.json +0 -68
- package/guidelines/grammar-and-mechanics.json +0 -252
- package/guidelines/header-browsing-context.json +0 -40
- package/guidelines/illustration.json +0 -105
- package/guidelines/in-product-word-list.json +0 -29
- package/guidelines/inclusive-design.json +0 -101
- package/guidelines/inclusive-ux-writing.json +0 -30
- package/guidelines/internationalization.json +0 -87
- package/guidelines/language-and-inclusivity-writing-about-people.json +0 -85
- package/guidelines/language-and-inclusivity-writing-with-visuals.json +0 -61
- package/guidelines/layout-and-structure-containers.json +0 -47
- package/guidelines/layout-and-structure-spacing-overview.json +0 -66
- package/guidelines/layout-spacing.json +0 -39
- package/guidelines/object-styles-overview.json +0 -17
- package/guidelines/rounding.json +0 -73
- package/guidelines/side-navigation-browsing-context.json +0 -74
- package/guidelines/spacing-overview.json +0 -45
- package/guidelines/support.json +0 -113
- package/guidelines/typography-overview.json +0 -43
- package/guidelines/typography-system.json +0 -208
- package/guidelines/visual-language-containers.json +0 -36
- package/guidelines/voice-and-tone.json +0 -47
- package/guidelines/whats-new.json +0 -32
- package/guidelines/writing-about-people.json +0 -103
- package/guidelines/writing-for-errors.json +0 -120
- package/guidelines/writing-for-onboarding.json +0 -119
- package/guidelines/writing-for-readability.json +0 -54
- package/guidelines/writing-with-visuals.json +0 -70
- package/registry/platform-extensions/web-components-states.json +0 -58
package/components/menu.json
CHANGED
|
@@ -9,6 +9,13 @@
|
|
|
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
|
+
],
|
|
12
19
|
"documentBlocks": [
|
|
13
20
|
{
|
|
14
21
|
"type": "purpose",
|
|
@@ -16,110 +23,202 @@
|
|
|
16
23
|
},
|
|
17
24
|
{
|
|
18
25
|
"type": "guideline",
|
|
19
|
-
"content": "
|
|
26
|
+
"content": "A disabled menu item indicates that an option exists but isn’t available in the current context. This helps preserve layout consistency and signals that the action might be available later."
|
|
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."
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"type": "guideline",
|
|
34
|
+
"content": "Displays submenus in a collapsed, nested format within the parent menu container. Works with both popover and tray styles. When using a tray, set a fixed height to avoid disorienting shifts when items expand or collapse."
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"type": "guideline",
|
|
38
|
+
"content": "Use a section header when a menu section requires a label or descriptor. Section headers are helpful when two or more sections differ in function or context, making it easier for users to understand the structure."
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"type": "guideline",
|
|
42
|
+
"content": "When the selection option is enabled, the selection can be displayed using checkmarks, checkboxes or switches. Switches are more commonly used on mobile."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"type": "guideline",
|
|
46
|
+
"content": "A menu section has the options of single selection, multiple selection, or having no selection. By default, menu items have no selection, and perform an action on press."
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"type": "guideline",
|
|
50
|
+
"content": "For single selection menu sections, menu items show a single checkmark to indicate the selected item. Multiple selection menu sections can display checkboxes or switches beside each menu item."
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"type": "guideline",
|
|
54
|
+
"content": "Menus come in four different sizes: small, medium, large, and extra-large. Medium is the default and most commonly used. Menu sizes should correspond to the size of the menu trigger component (like an action button), and any embedded components (like switches) should follow suit."
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"type": "guideline",
|
|
58
|
+
"content": "Use the other sizes sparingly; they should be used to create a hierarchy of importance within the page."
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"type": "guideline",
|
|
62
|
+
"content": "A menu item can display a related value in the value area. Examples of values include the selected option from a submenu, a keyboard shortcut for the action, or other content that clarifies the menu item."
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"type": "guideline",
|
|
66
|
+
"content": "Menu items can include description text to provide extra clarity beyond the label. Descriptions help users understand the action and make informed choices."
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"type": "guideline",
|
|
70
|
+
"content": "Avoid cluttering items with repetitive details or promotional content."
|
|
20
71
|
},
|
|
21
72
|
{
|
|
22
73
|
"type": "guideline",
|
|
23
|
-
"content": "
|
|
74
|
+
"content": "Menu items can include icons, but only when they add meaningful context — not just for decoration. Use icons when they have a strong, recognizable association with the label (like tool switching in a toolbar)."
|
|
24
75
|
},
|
|
25
76
|
{
|
|
26
77
|
"type": "guideline",
|
|
27
|
-
"content": "
|
|
78
|
+
"content": "A menu item must include a label that clearly communicates the action or option it represents."
|
|
28
79
|
},
|
|
29
80
|
{
|
|
30
81
|
"type": "guideline",
|
|
31
|
-
"content": "
|
|
82
|
+
"content": "On desktop, menus are shown in a popover by default. On mobile, popovers can be used when appropriate. Submenus cascade in a separate popover by default."
|
|
32
83
|
},
|
|
33
84
|
{
|
|
34
85
|
"type": "guideline",
|
|
35
|
-
"content": "
|
|
86
|
+
"content": "When a menu item includes a submenu, a drill-in chevron appears at the end of the item to indicate that additional options are available."
|
|
36
87
|
},
|
|
37
88
|
{
|
|
38
89
|
"type": "guideline",
|
|
39
|
-
"content": "
|
|
90
|
+
"content": "When 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."
|
|
40
91
|
},
|
|
41
92
|
{
|
|
42
93
|
"type": "guideline",
|
|
43
|
-
"content": "
|
|
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."
|
|
44
95
|
},
|
|
45
96
|
{
|
|
46
97
|
"type": "guideline",
|
|
47
|
-
"content": "
|
|
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."
|
|
48
99
|
},
|
|
49
100
|
{
|
|
50
101
|
"type": "guideline",
|
|
51
|
-
"content": "
|
|
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."
|
|
52
103
|
},
|
|
53
104
|
{
|
|
54
105
|
"type": "guideline",
|
|
55
|
-
"content": "
|
|
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."
|
|
56
107
|
},
|
|
57
108
|
{
|
|
58
109
|
"type": "guideline",
|
|
59
|
-
"content": "
|
|
110
|
+
"content": "When a menu item’s label or description are too long for the available horizontal space, they wrap to form another line."
|
|
60
111
|
},
|
|
61
112
|
{
|
|
62
113
|
"type": "guideline",
|
|
63
|
-
"content": "
|
|
114
|
+
"content": "Dividers appear between sections when two or more sections are used within the same menu."
|
|
64
115
|
},
|
|
65
116
|
{
|
|
66
117
|
"type": "guideline",
|
|
67
|
-
"content": "
|
|
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."
|
|
68
119
|
},
|
|
69
120
|
{
|
|
70
121
|
"type": "guideline",
|
|
71
|
-
"content": "
|
|
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."
|
|
72
123
|
},
|
|
73
124
|
{
|
|
74
125
|
"type": "guideline",
|
|
75
|
-
"content": "
|
|
126
|
+
"content": "Following Adobe’s UX writing style, write menu items in sentence case unless they contain words that are branded terms."
|
|
76
127
|
},
|
|
77
128
|
{
|
|
78
129
|
"type": "guideline",
|
|
79
|
-
"content": "
|
|
130
|
+
"content": "Don’t end a menu command with an ellipsis (…) unless it requires additional input to complete the action, typically in a dialog."
|
|
80
131
|
}
|
|
81
132
|
],
|
|
82
133
|
"options": {
|
|
83
134
|
"container": {
|
|
84
135
|
"type": "string",
|
|
85
|
-
"values": [
|
|
136
|
+
"values": [
|
|
137
|
+
{
|
|
138
|
+
"value": "popover"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"value": "tray"
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
"label": {
|
|
146
|
+
"type": "string"
|
|
86
147
|
},
|
|
87
|
-
"label": { "type": "string" },
|
|
88
148
|
"icon": {
|
|
89
149
|
"$ref": "https://opensource.adobe.com/spectrum-design-data/schemas/types/workflow-icon.json",
|
|
90
150
|
"description": "Icon must be present if the label is not defined."
|
|
91
151
|
},
|
|
92
|
-
"description": {
|
|
93
|
-
|
|
152
|
+
"description": {
|
|
153
|
+
"type": "string"
|
|
154
|
+
},
|
|
155
|
+
"value": {
|
|
156
|
+
"type": "string"
|
|
157
|
+
},
|
|
94
158
|
"size": {
|
|
95
159
|
"type": "string",
|
|
96
160
|
"default": "m",
|
|
97
161
|
"values": [
|
|
98
|
-
{
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
{
|
|
162
|
+
{
|
|
163
|
+
"value": "s"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"value": "m"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"value": "l"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"value": "xl"
|
|
173
|
+
}
|
|
102
174
|
]
|
|
103
175
|
},
|
|
104
176
|
"selectionMode": {
|
|
105
177
|
"type": "string",
|
|
106
178
|
"values": [
|
|
107
|
-
{
|
|
108
|
-
|
|
109
|
-
|
|
179
|
+
{
|
|
180
|
+
"value": "single"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"value": "multiple"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"value": "no selection"
|
|
187
|
+
}
|
|
110
188
|
]
|
|
111
189
|
},
|
|
112
190
|
"selectionStyle": {
|
|
113
191
|
"type": "string",
|
|
114
|
-
"values": [
|
|
192
|
+
"values": [
|
|
193
|
+
{
|
|
194
|
+
"value": "checkbox"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"value": "switch"
|
|
198
|
+
}
|
|
199
|
+
]
|
|
115
200
|
},
|
|
116
|
-
"sectionHeader": {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
"
|
|
201
|
+
"sectionHeader": {
|
|
202
|
+
"type": "string"
|
|
203
|
+
},
|
|
204
|
+
"isCollapsible": {
|
|
205
|
+
"type": "boolean",
|
|
206
|
+
"default": false
|
|
207
|
+
},
|
|
208
|
+
"isUnavailable": {
|
|
209
|
+
"type": "boolean",
|
|
210
|
+
"default": false
|
|
211
|
+
},
|
|
212
|
+
"isDisabled": {
|
|
213
|
+
"type": "boolean",
|
|
214
|
+
"default": false
|
|
215
|
+
}
|
|
120
216
|
},
|
|
121
217
|
"anatomy": [
|
|
122
|
-
{
|
|
218
|
+
{
|
|
219
|
+
"name": "item-label",
|
|
220
|
+
"description": "Label text of a menu item."
|
|
221
|
+
},
|
|
123
222
|
{
|
|
124
223
|
"name": "menu-item",
|
|
125
224
|
"description": "A single row within the menu.",
|
|
@@ -135,13 +234,22 @@
|
|
|
135
234
|
"link-out-icon"
|
|
136
235
|
]
|
|
137
236
|
},
|
|
138
|
-
{
|
|
139
|
-
|
|
237
|
+
{
|
|
238
|
+
"name": "icon",
|
|
239
|
+
"description": "Leading icon of a menu item."
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"name": "label",
|
|
243
|
+
"description": "Primary label text of a menu item."
|
|
244
|
+
},
|
|
140
245
|
{
|
|
141
246
|
"name": "description",
|
|
142
247
|
"description": "Secondary descriptive text of a menu item."
|
|
143
248
|
},
|
|
144
|
-
{
|
|
249
|
+
{
|
|
250
|
+
"name": "value",
|
|
251
|
+
"description": "Current value display of a menu item."
|
|
252
|
+
},
|
|
145
253
|
{
|
|
146
254
|
"name": "switch",
|
|
147
255
|
"description": "Switch control for a menu item with switch selection style."
|
|
@@ -150,7 +258,10 @@
|
|
|
150
258
|
"name": "checkbox",
|
|
151
259
|
"description": "Checkbox control for a menu item with checkbox selection style."
|
|
152
260
|
},
|
|
153
|
-
{
|
|
261
|
+
{
|
|
262
|
+
"name": "thumbnail",
|
|
263
|
+
"description": "Thumbnail image of a menu item."
|
|
264
|
+
},
|
|
154
265
|
{
|
|
155
266
|
"name": "drill-in-chevron",
|
|
156
267
|
"description": "Chevron indicating a menu item opens a sub-menu."
|
|
@@ -161,21 +272,46 @@
|
|
|
161
272
|
}
|
|
162
273
|
],
|
|
163
274
|
"states": [
|
|
164
|
-
{
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
{
|
|
275
|
+
{
|
|
276
|
+
"name": "hover",
|
|
277
|
+
"trigger": "interaction"
|
|
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
|
+
}
|
|
169
295
|
],
|
|
170
|
-
"lifecycle": {
|
|
296
|
+
"lifecycle": {
|
|
297
|
+
"introduced": "1.0.0-draft"
|
|
298
|
+
},
|
|
171
299
|
"accessibility": {
|
|
172
300
|
"role": "menu",
|
|
173
301
|
"intents": ["select"],
|
|
174
302
|
"focusable": false,
|
|
175
303
|
"keyboardIntents": ["navigate-options", "activate", "dismiss"],
|
|
176
304
|
"wcag": [
|
|
177
|
-
{
|
|
178
|
-
|
|
305
|
+
{
|
|
306
|
+
"criterion": "2.1.1",
|
|
307
|
+
"level": "A",
|
|
308
|
+
"title": "Keyboard"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"criterion": "4.1.2",
|
|
312
|
+
"level": "A",
|
|
313
|
+
"title": "Name, Role, Value"
|
|
314
|
+
}
|
|
179
315
|
]
|
|
180
316
|
}
|
|
181
317
|
}
|
package/components/meter.json
CHANGED
|
@@ -9,6 +9,19 @@
|
|
|
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
|
+
],
|
|
12
25
|
"documentBlocks": [
|
|
13
26
|
{
|
|
14
27
|
"type": "purpose",
|
|
@@ -16,35 +29,39 @@
|
|
|
16
29
|
},
|
|
17
30
|
{
|
|
18
31
|
"type": "guideline",
|
|
19
|
-
"content": "
|
|
32
|
+
"content": "A meter can include help text below it to explain what the value means and how to reach the target. This text may include units, value ranges, thresholds like targets or warnings, and actions that affect the meter."
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"type": "guideline",
|
|
36
|
+
"content": "The value represents a user-driven quantity or achievement, such as tutorials completed or storage used. Unlike a progress bar, it reflects user actions, not system activity."
|
|
20
37
|
},
|
|
21
38
|
{
|
|
22
39
|
"type": "guideline",
|
|
23
|
-
"content": "
|
|
40
|
+
"content": "Meters come in four different sizes: small, medium, large, and extra-large. By default, meters use medium size. Use the small size when there are multiple meters shown at the same time in a more confined space, such as in tables or cards."
|
|
24
41
|
},
|
|
25
42
|
{
|
|
26
43
|
"type": "guideline",
|
|
27
|
-
"content": "
|
|
44
|
+
"content": "Meters can include a value label to show details like “60%” or “2 of 8.” It should only appear if the main label is shown and is always placed above the track."
|
|
28
45
|
},
|
|
29
46
|
{
|
|
30
47
|
"type": "guideline",
|
|
31
|
-
"content": "
|
|
48
|
+
"content": "Meters should always have a label placed above the track. In rare cases where context is sufficient and an accessibility expert has reviewed the design, the label could be undefined. These meters without a visible label should still include an aria-label in HTML (depending on the context, “aria-label” or “aria-labelledby”)."
|
|
32
49
|
},
|
|
33
50
|
{
|
|
34
51
|
"type": "guideline",
|
|
35
|
-
"content": "
|
|
52
|
+
"content": "Meter has four variants: informative, positive, notice, and negative."
|
|
36
53
|
},
|
|
37
54
|
{
|
|
38
55
|
"type": "guideline",
|
|
39
|
-
"content": "
|
|
56
|
+
"content": "When 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."
|
|
40
57
|
},
|
|
41
58
|
{
|
|
42
59
|
"type": "guideline",
|
|
43
|
-
"content": "
|
|
60
|
+
"content": "Use 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."
|
|
44
61
|
},
|
|
45
62
|
{
|
|
46
63
|
"type": "guideline",
|
|
47
|
-
"content": "
|
|
64
|
+
"content": "Meter 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."
|
|
48
65
|
}
|
|
49
66
|
],
|
|
50
67
|
"options": {
|
|
@@ -52,35 +69,72 @@
|
|
|
52
69
|
"type": "string",
|
|
53
70
|
"default": "informative",
|
|
54
71
|
"values": [
|
|
55
|
-
{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
{
|
|
72
|
+
{
|
|
73
|
+
"value": "informative"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"value": "positive"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"value": "notice"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"value": "negative"
|
|
83
|
+
}
|
|
59
84
|
]
|
|
60
85
|
},
|
|
61
|
-
"label": {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
"
|
|
86
|
+
"label": {
|
|
87
|
+
"type": "string"
|
|
88
|
+
},
|
|
89
|
+
"hideLabel": {
|
|
90
|
+
"type": "boolean",
|
|
91
|
+
"default": false
|
|
92
|
+
},
|
|
93
|
+
"valueLabel": {
|
|
94
|
+
"type": "string"
|
|
95
|
+
},
|
|
96
|
+
"width": {
|
|
97
|
+
"type": "number"
|
|
98
|
+
},
|
|
65
99
|
"size": {
|
|
66
100
|
"type": "string",
|
|
67
101
|
"default": "m",
|
|
68
102
|
"values": [
|
|
69
|
-
{
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
{
|
|
103
|
+
{
|
|
104
|
+
"value": "s"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"value": "m"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"value": "l"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"value": "xl"
|
|
114
|
+
}
|
|
73
115
|
]
|
|
74
116
|
},
|
|
75
|
-
"value": {
|
|
76
|
-
|
|
117
|
+
"value": {
|
|
118
|
+
"type": "number",
|
|
119
|
+
"minimum": 0,
|
|
120
|
+
"maximum": 1
|
|
121
|
+
},
|
|
122
|
+
"helpText": {
|
|
123
|
+
"type": "string"
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"lifecycle": {
|
|
127
|
+
"introduced": "1.0.0-draft"
|
|
77
128
|
},
|
|
78
|
-
"lifecycle": { "introduced": "1.0.0-draft" },
|
|
79
129
|
"accessibility": {
|
|
80
130
|
"role": "meter",
|
|
81
131
|
"focusable": false,
|
|
82
132
|
"wcag": [
|
|
83
|
-
{
|
|
133
|
+
{
|
|
134
|
+
"criterion": "4.1.2",
|
|
135
|
+
"level": "A",
|
|
136
|
+
"title": "Name, Role, Value"
|
|
137
|
+
}
|
|
84
138
|
]
|
|
85
139
|
}
|
|
86
140
|
}
|