@adobe/spectrum-design-data 3.3.0-beta.1 → 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.
Files changed (135) hide show
  1. package/components/accordion.json +67 -15
  2. package/components/action-bar.json +30 -9
  3. package/components/action-button.json +92 -39
  4. package/components/action-group.json +137 -18
  5. package/components/alert-banner.json +27 -8
  6. package/components/alert-dialog.json +55 -34
  7. package/components/avatar-group.json +35 -9
  8. package/components/avatar.json +105 -29
  9. package/components/badge.json +163 -56
  10. package/components/breadcrumbs.json +107 -26
  11. package/components/button-group.json +63 -19
  12. package/components/button.json +105 -61
  13. package/components/calendar.json +74 -8
  14. package/components/card.json +13 -0
  15. package/components/cards.json +46 -31
  16. package/components/checkbox-group.json +85 -16
  17. package/components/checkbox.json +97 -27
  18. package/components/close-button.json +75 -20
  19. package/components/coach-indicator.json +44 -14
  20. package/components/coach-mark.json +26 -8
  21. package/components/color-area.json +100 -20
  22. package/components/color-handle.json +46 -25
  23. package/components/color-loupe.json +14 -2
  24. package/components/color-slider.json +129 -26
  25. package/components/color-wheel.json +91 -17
  26. package/components/combo-box.json +189 -50
  27. package/components/contextual-help.json +126 -80
  28. package/components/date-field.json +7 -0
  29. package/components/date-picker.json +127 -24
  30. package/components/divider.json +38 -12
  31. package/components/drop-zone.json +37 -18
  32. package/components/field-label.json +62 -21
  33. package/components/heading.json +7 -0
  34. package/components/help-text.json +53 -16
  35. package/components/illustrated-message.json +85 -21
  36. package/components/in-line-alert.json +53 -13
  37. package/components/link.json +63 -24
  38. package/components/list-view.json +80 -15
  39. package/components/menu.json +181 -45
  40. package/components/meter.json +78 -24
  41. package/components/number-field.json +175 -34
  42. package/components/picker.json +188 -42
  43. package/components/popover.json +126 -37
  44. package/components/progress-bar.json +108 -23
  45. package/components/progress-circle.json +55 -12
  46. package/components/radio-button.json +67 -14
  47. package/components/radio-group.json +132 -28
  48. package/components/rating.json +38 -9
  49. package/components/search-field.json +126 -34
  50. package/components/segmented-control.json +70 -21
  51. package/components/select-box.json +103 -29
  52. package/components/side-navigation.json +69 -28
  53. package/components/slider.json +155 -39
  54. package/components/standard-dialog.json +88 -16
  55. package/components/status-light.json +136 -41
  56. package/components/steplist.json +24 -5
  57. package/components/swatch-group.json +55 -19
  58. package/components/swatch.json +79 -24
  59. package/components/switch.json +79 -31
  60. package/components/table.json +73 -26
  61. package/components/tabs.json +52 -22
  62. package/components/tag-field.json +60 -14
  63. package/components/tag-group.json +56 -16
  64. package/components/tag.json +78 -21
  65. package/components/takeover-dialog.json +61 -10
  66. package/components/text-area.json +205 -49
  67. package/components/text-field.json +170 -42
  68. package/components/thumbnail.json +63 -22
  69. package/components/time-field.json +7 -0
  70. package/components/toast.json +50 -29
  71. package/components/tooltip.json +87 -27
  72. package/components/tree-view.json +147 -45
  73. package/components/user-card.json +7 -0
  74. package/guidelines/app-frame-content-area.json +81 -0
  75. package/guidelines/app-frame-creating-bluelines.json +58 -0
  76. package/guidelines/app-frame-header.json +72 -0
  77. package/guidelines/app-frame-overview.json +50 -44
  78. package/guidelines/app-frame-side-navigation.json +138 -0
  79. package/guidelines/attention-hierarchy.json +21 -12
  80. package/guidelines/background-layers.json +10 -44
  81. package/guidelines/brand.json +10 -30
  82. package/guidelines/colors.json +17 -35
  83. package/guidelines/containers.json +62 -0
  84. package/guidelines/developer-overview.json +9 -25
  85. package/guidelines/faqs.json +9 -96
  86. package/guidelines/fonts.json +14 -29
  87. package/guidelines/grays.json +44 -17
  88. package/guidelines/icon-fundamentals.json +18 -7
  89. package/guidelines/illustrations.json +111 -0
  90. package/guidelines/introduction.json +2 -2
  91. package/guidelines/manifest.json +60 -252
  92. package/guidelines/motion.json +16 -17
  93. package/guidelines/object-styles.json +102 -0
  94. package/guidelines/principles.json +2 -2
  95. package/guidelines/resources.json +15 -21
  96. package/guidelines/spacing.json +25 -0
  97. package/guidelines/states.json +10 -15
  98. package/guidelines/typography-fundamentals.json +142 -0
  99. package/guidelines/using-icons.json +44 -33
  100. package/package.json +2 -2
  101. package/registry/platform-implementations.json +30 -0
  102. package/guidelines/ai-resource-guide.json +0 -50
  103. package/guidelines/applying-the-type-system.json +0 -63
  104. package/guidelines/bi-directionality.json +0 -57
  105. package/guidelines/border-width.json +0 -42
  106. package/guidelines/cognitive.json +0 -197
  107. package/guidelines/component-spacing.json +0 -49
  108. package/guidelines/contact-us.json +0 -67
  109. package/guidelines/content-area-browsing-context.json +0 -65
  110. package/guidelines/creating-bluelines-browsing-context.json +0 -91
  111. package/guidelines/design-tokens.json +0 -122
  112. package/guidelines/drop-shadow.json +0 -56
  113. package/guidelines/grammar-and-mechanics.json +0 -252
  114. package/guidelines/header-browsing-context.json +0 -37
  115. package/guidelines/illustration.json +0 -109
  116. package/guidelines/in-product-word-list.json +0 -29
  117. package/guidelines/inclusive-design.json +0 -93
  118. package/guidelines/inclusive-ux-writing.json +0 -30
  119. package/guidelines/internationalization.json +0 -87
  120. package/guidelines/layout-and-structure-containers.json +0 -47
  121. package/guidelines/layout-spacing.json +0 -39
  122. package/guidelines/object-styles-overview.json +0 -17
  123. package/guidelines/rounding.json +0 -61
  124. package/guidelines/side-navigation-browsing-context.json +0 -71
  125. package/guidelines/spacing-overview.json +0 -45
  126. package/guidelines/typography-overview.json +0 -39
  127. package/guidelines/typography-system.json +0 -168
  128. package/guidelines/visual-language-containers.json +0 -36
  129. package/guidelines/voice-and-tone.json +0 -47
  130. package/guidelines/writing-about-people.json +0 -103
  131. package/guidelines/writing-for-errors.json +0 -120
  132. package/guidelines/writing-for-onboarding.json +0 -119
  133. package/guidelines/writing-for-readability.json +0 -54
  134. package/guidelines/writing-with-visuals.json +0 -70
  135. package/registry/platform-extensions/web-components-states.json +0 -58
@@ -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": "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."
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": "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."
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": "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."
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": "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."
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": "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."
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": "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."
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": "Section dividers.\n\nDividers appear between sections when two or more sections are used within the same menu."
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": "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."
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": "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."
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": "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."
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": "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."
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": "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."
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": "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."
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": "Keyboard interactions.\n\nKey Interaction Enter or SpaceOpens 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 ArrowIn submenu hierarchies: opens child submenu or returns to parent menu item (direction follows hierarchy and orientation).Home / EndMoves focus to first/last item in current menu level.Printable character keysMoves 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.EscCloses current submenu/menu and returns focus to parent item or menu trigger.Tab / Shift + TabExits menu, closes open menus, and moves focus to next/previous focusable element."
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": "Cursor guidelines.\n\nCursor Description PointerUse the pointer cursor for all interactive components in every state."
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": "WCAG 2.2 compliance.\n\nAny criterion not mention in the below table are not applicable to this component or are resolved with underlying requirements, engineering, and styles of the entire system. 1. Perceivable Requirement Criterion Level Compliance Non-text content 1.1.1 ANon-text elements, such as icons used in 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, AAAMenus 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 AAThe visual presentation of text has a contrast ratio of at least 4.5:1.Resize text 1.4.4 AAMenus should be built in such a way that they can be resized without assistive technology up to 200%.Visual presentation 1.4.8 AAAThe width of text blocks is no more than 80 characters (40 for CJK languages), and text is never justified.Non-text contrast 1.4.11 AAThe visual presentation of illustrations and component states have a contrast ratio of at least 3:1.Text spacing 1.4.12 AALine height of text is at least 1.5x the font size. 2. Operable RequirementCriterionLevel Compliance Keyboard 2.1.1, 2.1.3 A, AAAAll functionality of the component is operable through a keyboard without specific timing for keystrokes.Keyboard traps 2.1.2 AFocus can be moved away from the component using only a keyboard.Seizures and physical reactions 2.3.1, 2.3.2, 2.3.3 A, AAA, AAAThere is no flashing content or unnecessary motion or animation in this component.Focus order 2.4.3 ANavigation sequences receive focus in an order that preserves meaning and operability.Focus visible 2.4.7 AAKeyboard states use an indicator that is visible with at least 3:1 contrast."
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": [{ "value": "popover" }, { "value": "tray" }]
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": { "type": "string" },
93
- "value": { "type": "string" },
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
- { "value": "s" },
99
- { "value": "m" },
100
- { "value": "l" },
101
- { "value": "xl" }
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
- { "value": "single" },
108
- { "value": "multiple" },
109
- { "value": "no selection" }
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": [{ "value": "checkbox" }, { "value": "switch" }]
192
+ "values": [
193
+ {
194
+ "value": "checkbox"
195
+ },
196
+ {
197
+ "value": "switch"
198
+ }
199
+ ]
115
200
  },
116
- "sectionHeader": { "type": "string" },
117
- "isCollapsible": { "type": "boolean", "default": false },
118
- "isUnavailable": { "type": "boolean", "default": false },
119
- "isDisabled": { "type": "boolean", "default": false }
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
- { "name": "item-label", "description": "Label text of a menu item." },
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
- { "name": "icon", "description": "Leading icon of a menu item." },
139
- { "name": "label", "description": "Primary label text of a menu item." },
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
- { "name": "value", "description": "Current value display of a menu item." },
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
- { "name": "thumbnail", "description": "Thumbnail image of a menu item." },
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
- { "name": "hover", "trigger": "interaction" },
165
- { "name": "down", "trigger": "interaction" },
166
- { "name": "keyboard-focus", "trigger": "interaction" },
167
- { "name": "default", "trigger": "prop" },
168
- { "name": "disabled", "trigger": "prop" }
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": { "introduced": "1.0.0-draft" },
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
- { "criterion": "2.1.1", "level": "A", "title": "Keyboard" },
178
- { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
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
  }
@@ -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": "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."
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": "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."
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": "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."
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": "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."
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": "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."
52
+ "content": "Meter has four variants: informative, positive, notice, and negative."
36
53
  },
37
54
  {
38
55
  "type": "guideline",
39
- "content": "Keyboard interactions.\n\nKey Interaction TabMoves focus onto or off of the button.Space or EnterExecutes the button action. The focus remains on the button except if the button opens or closes the current container. In this case, the focus moves to the target or back to the caller."
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": "Cursor guidelines.\n\nCursor Usage PointerUse the pointer cursor for all interactive components."
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": "WCAG 2.2 compliance.\n\nAny criterion not mention in the below table are not applicable to this component or are resolved with underlying requirements, engineering, and styles of the entire system. 1. Perceivable Requirement Criterion Level Compliance Non-text content 1.1.1 ANon‑text elements—such as icons used in buttons—must provide a text alternative that communicates the button’s purpose. All buttons, especially icon‑only buttons, need an accessible name (for example, via a title, aria‑label, or associated text) so screen readers can announce their function.Info and relationships, Identify purpose 1.3.1, 1.3.6 A, AAAButtons should be understandable by assistive technologies like screen readers. This means using the proper semantic HTML or ARIA role of buttons should be utilized.Use of color 1.4.1 AColor is never used as the sole way to convey meaning in buttons. While negative buttons do use red to reinforce their purpose, every button also includes a clear text label that communicates the action it performs.Text contrast minimums 1.4.3 AALarge text has a contrast ratio of at least 3:1, and small text has a contrast ratio of at least 4.5:1. Incidental text such as disabled, hidden, or decorative text has no contrast requirement.Resize text 1.4.4 AAButtons should be built in such a way that they can be resized without assistive technology up to 200%.Visual presentation 1.4.8 AAAThe width of text blocks is no more than 80 characters (40 for CJK languages), and text is never justified.Non-text contrast 1.4.11 AAThe visual presentation of icons and various states have a contrast ratio of at least 3:1.Text spacing 1.4.12 AALine height of text is at least 1.5x the font size. 2. Operable Requirement Criterion Level Compliance Keyboard 2.1.1, 2.1.3 A, AAAAll functionality of the component is operable through a keyboard without specific timing for keystrokes.Keyboard traps 2.1.2 AFocus can be moved away from the component using only a keyboard.Seizures and physical reactions 2.3.1, 2.3.2, 2.3.3 A, AAA, AAAThere is no flashing content or unnecessary motion or animation in this component.Focus order 2.4.3 ANavigation sequences receive focus in an order that preserves meaning and operability.Focus visible 2.4.7 AAKeyboard states use an indicator that is visible with at least 3:1 contrast."
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
- { "value": "informative" },
56
- { "value": "positive" },
57
- { "value": "notice" },
58
- { "value": "negative" }
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": { "type": "string" },
62
- "hideLabel": { "type": "boolean", "default": false },
63
- "valueLabel": { "type": "string" },
64
- "width": { "type": "number" },
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
- { "value": "s" },
70
- { "value": "m" },
71
- { "value": "l" },
72
- { "value": "xl" }
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": { "type": "number", "minimum": 0, "maximum": 1 },
76
- "helpText": { "type": "string" }
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
- { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
133
+ {
134
+ "criterion": "4.1.2",
135
+ "level": "A",
136
+ "title": "Name, Role, Value"
137
+ }
84
138
  ]
85
139
  }
86
140
  }