@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.
Files changed (136) 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-overview.json +44 -46
  75. package/guidelines/attention-hierarchy.json +22 -13
  76. package/guidelines/background-layers.json +10 -80
  77. package/guidelines/brand.json +12 -32
  78. package/guidelines/colors.json +17 -47
  79. package/guidelines/developer-overview.json +9 -25
  80. package/guidelines/faqs.json +9 -96
  81. package/guidelines/fonts.json +14 -29
  82. package/guidelines/grays.json +44 -17
  83. package/guidelines/icon-fundamentals.json +18 -7
  84. package/guidelines/manifest.json +15 -367
  85. package/guidelines/motion.json +16 -17
  86. package/guidelines/principles.json +8 -7
  87. package/guidelines/resources.json +15 -21
  88. package/guidelines/states.json +11 -16
  89. package/guidelines/using-icons.json +44 -33
  90. package/package.json +2 -2
  91. package/registry/platform-implementations.json +30 -0
  92. package/guidelines/ai-resource-guide.json +0 -50
  93. package/guidelines/applying-the-type-system.json +0 -67
  94. package/guidelines/bi-directionality.json +0 -57
  95. package/guidelines/border-width.json +0 -58
  96. package/guidelines/cognitive.json +0 -197
  97. package/guidelines/component-spacing.json +0 -61
  98. package/guidelines/contact-us.json +0 -67
  99. package/guidelines/content-area-browsing-context.json +0 -65
  100. package/guidelines/content-design-grammar-and-mechanics.json +0 -241
  101. package/guidelines/content-design-voice-and-tone.json +0 -37
  102. package/guidelines/content-grammar-and-mechanics.json +0 -252
  103. package/guidelines/content-language-and-inclusivity-writing-about-people.json +0 -103
  104. package/guidelines/content-language-and-inclusivity-writing-with-visuals.json +0 -70
  105. package/guidelines/content-voice-and-tone.json +0 -47
  106. package/guidelines/creating-bluelines-browsing-context.json +0 -91
  107. package/guidelines/design-tokens.json +0 -158
  108. package/guidelines/drop-shadow.json +0 -68
  109. package/guidelines/grammar-and-mechanics.json +0 -252
  110. package/guidelines/header-browsing-context.json +0 -40
  111. package/guidelines/illustration.json +0 -105
  112. package/guidelines/in-product-word-list.json +0 -29
  113. package/guidelines/inclusive-design.json +0 -101
  114. package/guidelines/inclusive-ux-writing.json +0 -30
  115. package/guidelines/internationalization.json +0 -87
  116. package/guidelines/language-and-inclusivity-writing-about-people.json +0 -85
  117. package/guidelines/language-and-inclusivity-writing-with-visuals.json +0 -61
  118. package/guidelines/layout-and-structure-containers.json +0 -47
  119. package/guidelines/layout-and-structure-spacing-overview.json +0 -66
  120. package/guidelines/layout-spacing.json +0 -39
  121. package/guidelines/object-styles-overview.json +0 -17
  122. package/guidelines/rounding.json +0 -73
  123. package/guidelines/side-navigation-browsing-context.json +0 -74
  124. package/guidelines/spacing-overview.json +0 -45
  125. package/guidelines/support.json +0 -113
  126. package/guidelines/typography-overview.json +0 -43
  127. package/guidelines/typography-system.json +0 -208
  128. package/guidelines/visual-language-containers.json +0 -36
  129. package/guidelines/voice-and-tone.json +0 -47
  130. package/guidelines/whats-new.json +0 -32
  131. package/guidelines/writing-about-people.json +0 -103
  132. package/guidelines/writing-for-errors.json +0 -120
  133. package/guidelines/writing-for-onboarding.json +0 -119
  134. package/guidelines/writing-for-readability.json +0 -54
  135. package/guidelines/writing-with-visuals.json +0 -70
  136. package/registry/platform-extensions/web-components-states.json +0 -58
@@ -9,6 +9,13 @@
9
9
  "category": "inputs",
10
10
  "documentationUrl": "https://spectrum.adobe.com/page/number-field/"
11
11
  },
12
+ "implementations": [
13
+ {
14
+ "platform": "web",
15
+ "componentName": "NumberField",
16
+ "package": "@react-spectrum/s2"
17
+ }
18
+ ],
12
19
  "documentBlocks": [
13
20
  {
14
21
  "type": "purpose",
@@ -16,87 +23,198 @@
16
23
  },
17
24
  {
18
25
  "type": "guideline",
19
- "content": "Minimum width.\n\nThe minimum width for a number field is number-field-minimum-width-multiplier (without stepper) and number-field-with-stepper-minimum-width-[small/medium/large/extra-large] (with stepper). This minimum width guarantees that small number fields are readable and easy to interact with on touch devices."
26
+ "content": "Number fields accept numeric inputs and allow values to be incremented or decremented. They are commonly used when a defined range or step value is required."
20
27
  },
21
28
  {
22
29
  "type": "guideline",
23
- "content": "Text overflow.\n\nWhen the field label is too long for the available horizontal space, it wraps to form another line. The text inside the field truncates."
30
+ "content": "Number fields can have optional stepper buttons to the side of the field. Regardless of if a number field has these buttons or not, is should always accommodate arrow key shortcuts to increase or decrease the number."
24
31
  },
25
32
  {
26
33
  "type": "guideline",
27
- "content": "Mixed value.\n\nWhen a number field presents multiple values that are not identical, the field should show an en dash (–)."
34
+ "content": "If true, hides in-field increment and decrement buttons (stepper)."
28
35
  },
29
36
  {
30
37
  "type": "guideline",
31
- "content": "Help text and error message overflow.\n\nWhen the help text is too long for the available horizontal space, it wraps to form another line."
38
+ "content": "Number fields can be marked as optional or required, depending on the situation. For required number fields, there are two styling options: a “(required)” label or an asterisk. If you use an asterisk, be sure to include hint text to explain what the asterisk means. Optional number fields are either denoted with text added to the end of the label — “(optional)” — or have no indication at all."
32
39
  },
33
40
  {
34
41
  "type": "guideline",
35
- "content": "Calculations.\n\nNumber fields should always allow users to add, subtract, multiply, and divide, with the field automatically calculating the result."
42
+ "content": "The asterisk used in this component is an icon that has specific spacing from the label text — not part of the label text itself."
36
43
  },
37
44
  {
38
45
  "type": "guideline",
39
- "content": "Units.\n\nNumber fields can include units of measurement in the value. When focused or entering text, the units disappear. When scrolling, the units stay. If a user enters a unit that does not match the unit that the field requires, the field should automatically calculate a conversion and display the input value in the correct unit."
46
+ "content": "A number field can be marked as having an error to show that a value needs to be entered in order to move forward or that a value that was entered is invalid. For this component, an incorrect value should typically revert back to either the previously entered number or to the default value, rather than showing an error."
40
47
  },
41
48
  {
42
49
  "type": "guideline",
43
- "content": "Choose default values for number fields.\n\nChoose a default value for a field to revert back to if an invalid entry is input. If a user enters a valid number and then enters an invalid number, revert to the most recent valid entry."
50
+ "content": "A number field in a disabled state shows that an input exists, but is not available in that circumstance. This can be used to maintain layout continuity and communicate that the field may become available later."
44
51
  },
45
52
  {
46
53
  "type": "guideline",
47
- "content": "Review label-less designs.\n\nMost number fields should have a label. A field without a label is ambiguous and not accessible. In rare cases where context is sufficient and a label could be absent, make sure to have the design reviewed and approved by an accessibility expert. These should still include an aria-label in HTML (depending on the context, \"aria-label\" or \"aria-labelledby\")."
54
+ "content": "Number fields should always have an accessible name, typically provided by a visible text label. In rare cases where context is sufficient and an accessibility expert has reviewed the design, the visible label may be hidden or omitted. When no visible label is present, the input must still expose an accessible name (for example, in HTML via “aria-label” or “aria-labelledby,” and on other platforms via the platform’s accessible-name mechanism)."
48
55
  },
49
56
  {
50
57
  "type": "guideline",
51
- "content": "Follow capitalization rules.\n\nLabels for number fields should be in sentence case."
58
+ "content": "Number fields can show or hide the visible label."
52
59
  },
53
60
  {
54
61
  "type": "guideline",
55
- "content": "Marking Required vs. Optional number fields in Forms.\n\nWhen labeling number fields in a form, only mark the minority type—either required or optional—to reduce visual clutter: If most number fields are optional, mark only the required ones (e.g., add an asterisk or \"(required)\"). If most number fields are required, mark only the optional ones (e.g., append \"(optional)\" to their labels). Important: Never use an asterisk to indicate an optional number field."
62
+ "content": "Labels can be placed either on top or on the side,. Top labels are the default and are recommended because they work better with long copy, localization, and responsive layouts. Side labels are most useful when vertical space is limited."
56
63
  },
57
64
  {
58
- "type": "do-dont",
59
- "content": "Do not use placeholder text in number fields",
60
- "dont": "Putting instructions for how to complete an input, requirements, or any other essential information into placeholder text is not accessible, and should be avoided. Once a value is entered, placeholder text is no longer viewable; if someone is using an automatic form filler, they will never get the information in the placeholder text. Instead of placeholder text, choose a default value to include in the field in default state. Use the help text description to convey requirements or to show any formatting examples that would help user comprehension."
65
+ "type": "guideline",
66
+ "content": "Number fields come in four different sizes: small, medium, large, and extra-large. The medium size is the default and most frequently used option. Use the other sizes sparingly; they should be used to create a hierarchy of importance within the page."
61
67
  },
62
68
  {
63
69
  "type": "guideline",
64
- "content": "Use help text to show hints, formatting, and requirements.\n\nThe description in the help text is flexible and encompasses a range of guidance. Sometimes this guidance is about what to input, and sometimes it's about how to input. This includes information such as: An overall description of the number field Hints for what kind of information needs to be input Specific formatting examples or requirements The help text's message should not simply restate the same information in the label in order to prompt someone to interact with it. Don't add help text if it isn't actually relevant or meaningful to a user in order to try to maintain layout continuity with other inputs that require help text."
70
+ "content": "The value shows a user’s entered text or a default value, plus the units of measurement, if applicable."
65
71
  },
66
72
  {
67
73
  "type": "guideline",
68
- "content": "Switch help text with error text.\n\nThe help text area also displays an error message. When a number field already includes help text and an error is triggered, the help text is replaced with error text. Once the error is resolved, the help text description reappears below the field. Since one gets replaced by the other, the language of the help text and error text need to work together to convey the same messaging. Help text explains the requirement or adds supplementary context for how to successfully complete the input. Error text tells a user how to fix the error by re-stating the input requirements or describing the necessary interaction. Make sure that the help text and the error text include the same essential information so that it isn't lost if one replaces the other like formatting requirements."
74
+ "content": "A number field can be marked as having an error to show that a value needs to be entered in order to move forward or that a value that was entered is invalid. The error message communicates an error for when the field requirements aren’t met, prompting a user to adjust what they had originally input. If an error exists, the error icon always overrides the validation icon."
69
75
  },
70
76
  {
71
77
  "type": "guideline",
72
- "content": "Write error text that shows a solution.\n\nWrite error messaging in a human-centered way by guiding a user and showing them a solution — don't simply state what's wrong and then leave them guessing as to how to resolve it. Ambiguous error messages can be frustrating and even shame-inducing for users. Also, keep in mind that something that a system may deem an error may not actually be perceived as an error to a user. Error text should be written in 1-2 short, complete sentences and in a clear and straightforward way. Never end with an exclamation point. For number fields, the nature of the error is often related to something that needs to be fixed for in-line validation, so a helpful tone is most appropriate."
78
+ "content": "When an error message is displayed, it replaces the help text. If an error exists, the error icon always overrides the validation icon."
79
+ },
80
+ {
81
+ "type": "guideline",
82
+ "content": "A number field can have help text below the field to give extra context or instruction about what a user should input in the field. The help text communicates a hint or helpful information, such as specific requirements for correctly filling out the field."
83
+ },
84
+ {
85
+ "type": "guideline",
86
+ "content": "Help text is replaced by error messages when validation fails."
87
+ },
88
+ {
89
+ "type": "guideline",
90
+ "content": "When the field label is too long for the available horizontal space, it wraps to form another line. The text inside the field truncates."
91
+ },
92
+ {
93
+ "type": "guideline",
94
+ "content": "When a number field presents multiple values that are not identical, the field should show an en dash (–)."
95
+ },
96
+ {
97
+ "type": "guideline",
98
+ "content": "When the help text is too long for the available horizontal space, it wraps to form another line."
99
+ },
100
+ {
101
+ "type": "guideline",
102
+ "content": "Number fields should always allow users to add, subtract, multiply, and divide, with the field automatically calculating the result."
103
+ },
104
+ {
105
+ "type": "guideline",
106
+ "content": "Number fields can include units of measurement in the value. When focused or entering text, the units disappear. When scrolling, the units stay. If a user enters a unit that does not match the unit that the field requires, the field should automatically calculate a conversion and display the input value in the correct unit."
107
+ },
108
+ {
109
+ "type": "guideline",
110
+ "content": "Choose a default value for a field to revert back to if an invalid entry is input. If a user enters a valid number and then enters an invalid number, revert to the most recent valid entry."
111
+ },
112
+ {
113
+ "type": "guideline",
114
+ "content": "Most number fields should have a label. A field without a label is ambiguous and not accessible. In rare cases where context is sufficient and a label could be absent, make sure to have the design reviewed and approved by an accessibility expert. These should still include an aria-label in HTML (depending on the context, “aria-label” or “aria-labelledby”)."
115
+ },
116
+ {
117
+ "type": "guideline",
118
+ "content": "Labels for number fields should be in sentence case."
119
+ },
120
+ {
121
+ "type": "guideline",
122
+ "content": "When labeling number fields in a form, only mark the minority type—either required or optional—to reduce visual clutter:"
123
+ },
124
+ {
125
+ "type": "guideline",
126
+ "content": "Important: Never use an asterisk to indicate an optional number field."
127
+ },
128
+ {
129
+ "type": "guideline",
130
+ "content": "Putting instructions for how to complete an input, requirements, or any other essential information into placeholder text is not accessible, and should be avoided. Once a value is entered, placeholder text is no longer viewable; if someone is using an automatic form filler, they will never get the information in the placeholder text."
131
+ },
132
+ {
133
+ "type": "guideline",
134
+ "content": "Instead of placeholder text, choose a default value to include in the field in default state. Use the help text description to convey requirements or to show any formatting examples that would help user comprehension."
135
+ },
136
+ {
137
+ "type": "guideline",
138
+ "content": "The help text’s message should not simply restate the same information in the label in order to prompt someone to interact with it. Don’t add help text if it isn’t actually relevant or meaningful to a user in order to try to maintain layout continuity with other inputs that require help text."
139
+ },
140
+ {
141
+ "type": "guideline",
142
+ "content": "The help text area also displays an error message. When a number field already includes help text and an error is triggered, the help text is replaced with error text. Once the error is resolved, the help text description reappears below the field."
143
+ },
144
+ {
145
+ "type": "guideline",
146
+ "content": "Since one gets replaced by the other, the language of the help text and error text need to work together to convey the same messaging. Help text explains the requirement or adds supplementary context for how to successfully complete the input. Error text tells a user how to fix the error by re-stating the input requirements or describing the necessary interaction. Make sure that the help text and the error text include the same essential information so that it isn’t lost if one replaces the other like formatting requirements."
147
+ },
148
+ {
149
+ "type": "guideline",
150
+ "content": "Write error messaging in a human-centered way by guiding a user and showing them a solution — don’t simply state what’s wrong and then leave them guessing as to how to resolve it. Ambiguous error messages can be frustrating and even shame-inducing for users. Also, keep in mind that something that a system may deem an error may not actually be perceived as an error to a user."
151
+ },
152
+ {
153
+ "type": "guideline",
154
+ "content": "Error text should be written in 1-2 short, complete sentences and in a clear and straightforward way. Never end with an exclamation point. For number fields, the nature of the error is often related to something that needs to be fixed for in-line validation, so a helpful tone is most appropriate."
73
155
  }
74
156
  ],
75
157
  "options": {
76
- "label": { "type": "string" },
158
+ "label": {
159
+ "type": "string"
160
+ },
77
161
  "size": {
78
162
  "type": "string",
79
163
  "default": "m",
80
164
  "values": [
81
- { "value": "s" },
82
- { "value": "m" },
83
- { "value": "l" },
84
- { "value": "xl" }
165
+ {
166
+ "value": "s"
167
+ },
168
+ {
169
+ "value": "m"
170
+ },
171
+ {
172
+ "value": "l"
173
+ },
174
+ {
175
+ "value": "xl"
176
+ }
85
177
  ]
86
178
  },
87
179
  "labelPosition": {
88
180
  "type": "string",
89
181
  "default": "top",
90
- "values": [{ "value": "top" }, { "value": "side" }]
182
+ "values": [
183
+ {
184
+ "value": "top"
185
+ },
186
+ {
187
+ "value": "side"
188
+ }
189
+ ]
190
+ },
191
+ "hideLabel": {
192
+ "type": "boolean",
193
+ "default": false
194
+ },
195
+ "isDisabled": {
196
+ "type": "boolean",
197
+ "default": false
198
+ },
199
+ "isError": {
200
+ "type": "boolean",
201
+ "default": false
202
+ },
203
+ "isRequired": {
204
+ "type": "boolean",
205
+ "default": false
91
206
  },
92
- "hideLabel": { "type": "boolean", "default": false },
93
- "isDisabled": { "type": "boolean", "default": false },
94
- "isError": { "type": "boolean", "default": false },
95
- "isRequired": { "type": "boolean", "default": false },
96
207
  "necessityIndicator": {
97
208
  "type": "string",
98
209
  "default": "icon",
99
- "values": [{ "value": "text" }, { "value": "icon" }]
210
+ "values": [
211
+ {
212
+ "value": "text"
213
+ },
214
+ {
215
+ "value": "icon"
216
+ }
217
+ ]
100
218
  },
101
219
  "hideStepper": {
102
220
  "type": "boolean",
@@ -111,20 +229,43 @@
111
229
  }
112
230
  ],
113
231
  "states": [
114
- { "name": "hover", "trigger": "interaction" },
115
- { "name": "focus-+-hover", "trigger": "prop" },
116
- { "name": "focus-+-not-hover", "trigger": "prop" }
232
+ {
233
+ "name": "hover",
234
+ "trigger": "interaction"
235
+ },
236
+ {
237
+ "name": "focus-+-hover",
238
+ "trigger": "prop"
239
+ },
240
+ {
241
+ "name": "focus-+-not-hover",
242
+ "trigger": "prop"
243
+ }
117
244
  ],
118
- "lifecycle": { "introduced": "1.0.0-draft" },
245
+ "lifecycle": {
246
+ "introduced": "1.0.0-draft"
247
+ },
119
248
  "accessibility": {
120
249
  "role": "spinbutton",
121
250
  "intents": ["choose", "input"],
122
251
  "focusable": true,
123
252
  "keyboardIntents": ["increment", "decrement"],
124
253
  "wcag": [
125
- { "criterion": "1.3.1", "level": "A", "title": "Info and Relationships" },
126
- { "criterion": "2.1.1", "level": "A", "title": "Keyboard" },
127
- { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
254
+ {
255
+ "criterion": "1.3.1",
256
+ "level": "A",
257
+ "title": "Info and Relationships"
258
+ },
259
+ {
260
+ "criterion": "2.1.1",
261
+ "level": "A",
262
+ "title": "Keyboard"
263
+ },
264
+ {
265
+ "criterion": "4.1.2",
266
+ "level": "A",
267
+ "title": "Name, Role, Value"
268
+ }
128
269
  ]
129
270
  }
130
271
  }