@adobe/spectrum-design-data 3.3.0-beta.0 → 3.3.0-beta.1
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 +15 -54
- package/components/action-bar.json +9 -23
- package/components/action-button.json +39 -79
- package/components/action-group.json +18 -129
- package/components/alert-banner.json +8 -27
- package/components/alert-dialog.json +34 -48
- package/components/avatar-group.json +9 -28
- package/components/avatar.json +29 -92
- package/components/badge.json +56 -150
- package/components/breadcrumbs.json +26 -100
- package/components/button-group.json +19 -50
- package/components/button.json +61 -92
- package/components/calendar.json +8 -67
- package/components/cards.json +31 -46
- package/components/checkbox-group.json +16 -78
- package/components/checkbox.json +27 -90
- package/components/close-button.json +20 -62
- 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 +2 -6
- package/components/color-slider.json +26 -122
- package/components/color-wheel.json +17 -84
- package/components/combo-box.json +50 -182
- package/components/contextual-help.json +80 -119
- package/components/date-picker.json +24 -120
- package/components/divider.json +12 -25
- package/components/drop-zone.json +18 -30
- package/components/field-label.json +21 -62
- 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 +24 -56
- package/components/list-view.json +15 -73
- package/components/menu.json +45 -174
- package/components/meter.json +24 -65
- package/components/number-field.json +34 -168
- package/components/picker.json +42 -181
- package/components/popover.json +37 -113
- package/components/progress-bar.json +23 -95
- package/components/progress-circle.json +12 -42
- package/components/radio-button.json +14 -67
- package/components/radio-group.json +28 -125
- package/components/rating.json +9 -38
- package/components/search-field.json +34 -119
- package/components/segmented-control.json +21 -63
- package/components/select-box.json +29 -96
- package/components/side-navigation.json +28 -69
- package/components/slider.json +39 -148
- package/components/standard-dialog.json +16 -88
- package/components/status-light.json +41 -123
- package/components/steplist.json +5 -24
- package/components/swatch-group.json +19 -55
- package/components/swatch.json +24 -79
- package/components/switch.json +31 -72
- package/components/table.json +26 -73
- package/components/tabs.json +22 -39
- package/components/tag-field.json +14 -60
- package/components/tag-group.json +16 -49
- package/components/tag.json +21 -71
- package/components/takeover-dialog.json +10 -61
- package/components/text-area.json +49 -198
- package/components/text-field.json +42 -163
- package/components/thumbnail.json +22 -63
- package/components/toast.json +29 -50
- package/components/tooltip.json +27 -74
- package/components/tree-view.json +45 -140
- package/guidelines/introduction.json +2 -2
- package/guidelines/manifest.json +2 -74
- package/guidelines/principles.json +2 -2
- package/package.json +1 -1
- package/guidelines/app-frame-content-area.json +0 -81
- package/guidelines/app-frame-creating-bluelines.json +0 -58
- package/guidelines/app-frame-header.json +0 -72
- package/guidelines/app-frame-side-navigation.json +0 -138
- package/guidelines/containers.json +0 -62
- package/guidelines/illustrations.json +0 -111
- package/guidelines/object-styles.json +0 -102
- package/guidelines/spacing.json +0 -25
- package/guidelines/typography-fundamentals.json +0 -142
package/components/tag.json
CHANGED
|
@@ -16,108 +16,58 @@
|
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"type": "guideline",
|
|
19
|
-
"content": "
|
|
19
|
+
"content": "Text overflow.\n\nWhen the tag text is too long for the available horizontal space or when a tag reaches its maximum width, it truncates. Hovering over the tag shows a tooltip with the full text."
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
|
-
"type": "
|
|
23
|
-
"content": "
|
|
24
|
-
|
|
25
|
-
{
|
|
26
|
-
"type": "guideline",
|
|
27
|
-
"content": "Tags have the option to include an avatar in addition to the label. These should be used to represent entities."
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"type": "guideline",
|
|
31
|
-
"content": "Tags have the option to be removable or not. Removable tags have a small close (“x”) button."
|
|
22
|
+
"type": "do-dont",
|
|
23
|
+
"content": "Avoid conflicting tag actions",
|
|
24
|
+
"dont": "A tag can either trigger navigation or filtering, or act as a dismissible chip. Combining both interactions disrupts focus order and accessibility states. Choose one behavior — navigation or dismissal — and apply it consistently."
|
|
32
25
|
},
|
|
33
26
|
{
|
|
34
27
|
"type": "guideline",
|
|
35
|
-
"content": "
|
|
28
|
+
"content": "RTL.\n\nFor RTL (right-to-left) languages, the layout of the tag is mirrored. The avatar is right-aligned and the close button is left-aligned."
|
|
36
29
|
},
|
|
37
30
|
{
|
|
38
31
|
"type": "guideline",
|
|
39
|
-
"content": "
|
|
32
|
+
"content": "Keyboard interactions.\n\nKey Interaction TabTabbing into a group of tags places the focus on the first tag (only one tag receives the keyboard focus at a time).Arrow keysMoves focus through the group of tags.Page Up or Page DownMoves focus to the previous or next tag in the group (last becomes first, and first becomes last).Home or EndMoves focus to the first or last tag in the group.Backspace or DeleteRemoves the tag in focus from the group.SpaceIf the tag is selectable, the space bar will toggle selection."
|
|
40
33
|
},
|
|
41
34
|
{
|
|
42
35
|
"type": "guideline",
|
|
43
|
-
"content": "
|
|
36
|
+
"content": "Cursor guidelines.\n\nCursor Description Default (Arrow)Use the default cursor for non-interactive tags.PointerUse the pointer cursor for interactive tags, such as tags that are removable or can be used to filter content.Grab handUse the grab hand cursor when the order of tags can be rearranged.Grab fistUse the grab fist cursor when holding a tag."
|
|
44
37
|
},
|
|
45
38
|
{
|
|
46
39
|
"type": "guideline",
|
|
47
|
-
"content": "
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"type": "guideline",
|
|
51
|
-
"content": "A tag can either trigger navigation or filtering, or act as a dismissible chip. Combining both interactions disrupts focus order and accessibility states. Choose one behavior — navigation or dismissal — and apply it consistently."
|
|
40
|
+
"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 tags—must provide a text alternative that communicates the control’s purpose. All controls, especially icon‑only controls, 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 AATags should be understandable by assistive technologies like screen readers. This means the proper semantic HTML or ARIA role should be utilized.Text contrast 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 AATags should be built in such a way that they can be resized without assistive technology up to 200%.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 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."
|
|
52
41
|
}
|
|
53
42
|
],
|
|
54
43
|
"options": {
|
|
55
|
-
"label": {
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
"isRemovable": {
|
|
63
|
-
"type": "boolean",
|
|
64
|
-
"default": false
|
|
65
|
-
},
|
|
66
|
-
"isError": {
|
|
67
|
-
"type": "boolean",
|
|
68
|
-
"default": false
|
|
69
|
-
},
|
|
70
|
-
"isDisabled": {
|
|
71
|
-
"type": "boolean",
|
|
72
|
-
"default": false
|
|
73
|
-
},
|
|
74
|
-
"isReadOnly": {
|
|
75
|
-
"type": "boolean",
|
|
76
|
-
"default": false
|
|
77
|
-
}
|
|
44
|
+
"label": { "type": "string" },
|
|
45
|
+
"hasAvatar": { "type": "boolean", "default": false },
|
|
46
|
+
"isRemovable": { "type": "boolean", "default": false },
|
|
47
|
+
"isError": { "type": "boolean", "default": false },
|
|
48
|
+
"isDisabled": { "type": "boolean", "default": false },
|
|
49
|
+
"isReadOnly": { "type": "boolean", "default": false }
|
|
78
50
|
},
|
|
79
51
|
"anatomy": [
|
|
80
52
|
{
|
|
81
53
|
"name": "clear-icon",
|
|
82
54
|
"description": "Icon affordance that removes the tag."
|
|
83
55
|
},
|
|
84
|
-
{
|
|
85
|
-
"name": "cross-icon",
|
|
86
|
-
"description": "Cross/X icon shown on the tag."
|
|
87
|
-
}
|
|
56
|
+
{ "name": "cross-icon", "description": "Cross/X icon shown on the tag." }
|
|
88
57
|
],
|
|
89
58
|
"states": [
|
|
90
|
-
{
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"name": "down",
|
|
96
|
-
"trigger": "interaction"
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
"name": "keyboard-focus",
|
|
100
|
-
"trigger": "interaction"
|
|
101
|
-
}
|
|
59
|
+
{ "name": "hover", "trigger": "interaction" },
|
|
60
|
+
{ "name": "down", "trigger": "interaction" },
|
|
61
|
+
{ "name": "keyboard-focus", "trigger": "interaction" }
|
|
102
62
|
],
|
|
103
|
-
"lifecycle": {
|
|
104
|
-
"introduced": "1.0.0-draft"
|
|
105
|
-
},
|
|
63
|
+
"lifecycle": { "introduced": "1.0.0-draft" },
|
|
106
64
|
"accessibility": {
|
|
107
65
|
"intents": ["dismiss"],
|
|
108
66
|
"focusable": true,
|
|
109
67
|
"keyboardIntents": ["activate"],
|
|
110
68
|
"wcag": [
|
|
111
|
-
{
|
|
112
|
-
|
|
113
|
-
"level": "A",
|
|
114
|
-
"title": "Keyboard"
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
"criterion": "4.1.2",
|
|
118
|
-
"level": "A",
|
|
119
|
-
"title": "Name, Role, Value"
|
|
120
|
-
}
|
|
69
|
+
{ "criterion": "2.1.1", "level": "A", "title": "Keyboard" },
|
|
70
|
+
{ "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
|
|
121
71
|
]
|
|
122
72
|
}
|
|
123
73
|
}
|
|
@@ -16,67 +16,26 @@
|
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"type": "guideline",
|
|
19
|
-
"content": "
|
|
19
|
+
"content": "Title text overflow.\n\nWhen the title is too long for the available horizontal space, it wraps to form another line."
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"type": "guideline",
|
|
23
|
-
"content": "
|
|
23
|
+
"content": "Header content overflow.\n\nTakeover dialogs can optionally include additional elements in the header custom content area. When horizontal space is limited, the header custom content will be displayed underneath the title."
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"type": "guideline",
|
|
27
|
-
"content": "
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"type": "guideline",
|
|
31
|
-
"content": "All takeover dialogs must include a title. The title appears at the top of the dialog and should briefly describe the expected outcome if the user proceeds with the primary action."
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"type": "guideline",
|
|
35
|
-
"content": "A takeover dialog must include at least one button. The primary action label refers to the rightmost button in the dialog footer for languages that read left to right. It should use a short, actionable phrase that clearly communicates the result of selecting the action—whether that means taking action, progressing through a workflow, or dismissing the dialog."
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"type": "guideline",
|
|
39
|
-
"content": "Takeover dialogs can include up to three buttons if a secondary outline button label is defined. If no label is defined, the button won’t appear. The secondary outline button should use a short, actionable phrase that clearly communicates the result of selecting the action—typically describing the previous step or an alternative choice."
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"type": "guideline",
|
|
43
|
-
"content": "By default, a takeover dialog that includes a button to cancel or go back will be labeled “Cancel.”"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"type": "guideline",
|
|
47
|
-
"content": "When the title is too long for the available horizontal space, it wraps to form another line."
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"type": "guideline",
|
|
51
|
-
"content": "Takeover dialogs can optionally include additional elements in the header custom content area. When horizontal space is limited, the header custom content will be displayed underneath the title."
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"type": "guideline",
|
|
55
|
-
"content": "Most dialog titles should communicate the primary action of the dialog. When possible, the button label should use the same language as the action mentioned in the title. For example, if the title is “Delete conversation,” the primary action button label should be “Delete.”"
|
|
27
|
+
"content": "Use similar language for dialog titles and actions.\n\nMost dialog titles should communicate the primary action of the dialog. When possible, the button label should use the same language as the action mentioned in the title. For example, if the title is \"Delete conversation,\" the primary action button label should be \"Delete."
|
|
56
28
|
}
|
|
57
29
|
],
|
|
58
30
|
"options": {
|
|
59
|
-
"title": {
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
"description": {
|
|
63
|
-
"type": "string"
|
|
64
|
-
},
|
|
31
|
+
"title": { "type": "string" },
|
|
32
|
+
"description": { "type": "string" },
|
|
65
33
|
"variant": {
|
|
66
34
|
"type": "string",
|
|
67
35
|
"default": "dialog",
|
|
68
|
-
"values": [
|
|
69
|
-
{
|
|
70
|
-
"value": "dialog"
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
"value": "full screen"
|
|
74
|
-
}
|
|
75
|
-
]
|
|
76
|
-
},
|
|
77
|
-
"primaryActionLabel": {
|
|
78
|
-
"type": "string"
|
|
36
|
+
"values": [{ "value": "dialog" }, { "value": "full screen" }]
|
|
79
37
|
},
|
|
38
|
+
"primaryActionLabel": { "type": "string" },
|
|
80
39
|
"secondaryActionLabel": {
|
|
81
40
|
"type": "string",
|
|
82
41
|
"description": "If undefined, this button does not appear."
|
|
@@ -105,25 +64,15 @@
|
|
|
105
64
|
}
|
|
106
65
|
}
|
|
107
66
|
},
|
|
108
|
-
"lifecycle": {
|
|
109
|
-
"introduced": "1.0.0-draft"
|
|
110
|
-
},
|
|
67
|
+
"lifecycle": { "introduced": "1.0.0-draft" },
|
|
111
68
|
"accessibility": {
|
|
112
69
|
"role": "dialog",
|
|
113
70
|
"intents": ["dismiss"],
|
|
114
71
|
"focusable": false,
|
|
115
72
|
"keyboardIntents": ["dismiss"],
|
|
116
73
|
"wcag": [
|
|
117
|
-
{
|
|
118
|
-
|
|
119
|
-
"level": "A",
|
|
120
|
-
"title": "Focus Order"
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
"criterion": "4.1.2",
|
|
124
|
-
"level": "A",
|
|
125
|
-
"title": "Name, Role, Value"
|
|
126
|
-
}
|
|
74
|
+
{ "criterion": "2.4.3", "level": "A", "title": "Focus Order" },
|
|
75
|
+
{ "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
|
|
127
76
|
]
|
|
128
77
|
}
|
|
129
78
|
}
|
|
@@ -16,284 +16,135 @@
|
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"type": "guideline",
|
|
19
|
-
"content": "
|
|
19
|
+
"content": "Minimum width.\n\nText areas are ideal for long sentences or paragraphs, and should comfortably accommodate larger amounts of text. They should have a minimum height of text-area-minimum-height (when the height of the text area is a defined number). The minimum width is field-default-width-[small/medium/large/extra-large]."
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"type": "guideline",
|
|
23
|
-
"content": "
|
|
23
|
+
"content": "Text overflow.\n\nWhen typing into a text area and reaching the end of the field on a number-height text area, the cursor should remain as static in the bottom right corner (for left-to-right languages) while text above it overflows through the top of the field. When the field loses focus, text should overflow through the bottom of the text area, showing the beginning of the text."
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"type": "guideline",
|
|
27
|
-
"content": "
|
|
27
|
+
"content": "Mixed value.\n\nWhen a text area presents multiple values that are not identical, the field should show an en dash (–)."
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
"type": "guideline",
|
|
31
|
-
"content": "
|
|
31
|
+
"content": "Help text overflow.\n\nWhen the help text is too long for the available horizontal space, it wraps to form another line."
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
"type": "guideline",
|
|
35
|
-
"content": "
|
|
35
|
+
"content": "Include a label.\n\nEvery text area should have a label. A text area without a label is ambiguous and not accessible."
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"type": "guideline",
|
|
39
|
-
"content": "
|
|
39
|
+
"content": "Follow capitalization rules.\n\nText area labels and placeholder text should be written in sentence case."
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
"type": "guideline",
|
|
43
|
-
"content": "
|
|
43
|
+
"content": "Mark the minority of text areas in a form as required or optional.\n\nIn a single form, mark only the required fields or only the optional fields, depending on whichever is less frequent in the entire form. If most of the text fields are optional, only the required fields should be give an asterisk or have labels appended with \"(required)\". If most of the text fields are required, only the optional fields should be appended with \"(optional)\". An asterisk should never be used to note that a text area is optional."
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
"type": "guideline",
|
|
47
|
-
"content": "
|
|
47
|
+
"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 sometime it's about how to input. This includes information such as: An overall description of the input 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."
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
|
-
"type": "
|
|
51
|
-
"content": "
|
|
52
|
-
|
|
53
|
-
{
|
|
54
|
-
"type": "guideline",
|
|
55
|
-
"content": "A text area in a disabled state shows that the input field exists, but is not available in that circumstance. This can be used to maintain layout continuity and communicate that a text area may become available later."
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"type": "guideline",
|
|
59
|
-
"content": "If the height is defined, text areas can either be a static size or can be resizable with a drag icon in the bottom right corner. The drag icon should be hidden if the fixed variant is turned off, or if the text area should not be resizable."
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"type": "guideline",
|
|
63
|
-
"content": "When defined as fixed (either by the development team or by the end user via the dragIcon), users can scroll inside the field."
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"type": "guideline",
|
|
67
|
-
"content": "A text area 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."
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
"type": "guideline",
|
|
71
|
-
"content": "A text area 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."
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"type": "guideline",
|
|
75
|
-
"content": "A text area can have multiple input types, depending on the need and use case. Text areas have a text input type by default."
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"type": "guideline",
|
|
79
|
-
"content": "Use these input types for the following use cases:"
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"type": "guideline",
|
|
83
|
-
"content": "When typing into a text area and reaching the end of the field on a number-height text area, the cursor should remain as static in the bottom right corner (for left-to-right languages) while text above it overflows through the top of the field. When the field loses focus, text should overflow through the bottom of the text area, showing the beginning of the text."
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"type": "guideline",
|
|
87
|
-
"content": "When a text area presents multiple values that are not identical, the field should show an en dash (–)."
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
"type": "guideline",
|
|
91
|
-
"content": "When the help text is too long for the available horizontal space, it wraps to form another line."
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
"type": "guideline",
|
|
95
|
-
"content": "Every text area should have a label. A text area without a label is ambiguous and not accessible."
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
"type": "guideline",
|
|
99
|
-
"content": "Text area labels and placeholder text should be written in sentence case."
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
"type": "guideline",
|
|
103
|
-
"content": "In a single form, mark only the required fields or only the optional fields, depending on whichever is less frequent in the entire form. If most of the text fields are optional, only the required fields should be give an asterisk or have labels appended with “(required)”. If most of the text fields are required, only the optional fields should be appended with “(optional)”. An asterisk should never be used to note that a text area is optional."
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
"type": "guideline",
|
|
107
|
-
"content": "The description in the help text is flexible and encompasses a range of guidance. Sometimes this guidance is about what to input, and sometime it’s about how to input. This includes information such as:"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"type": "guideline",
|
|
111
|
-
"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."
|
|
50
|
+
"type": "do-dont",
|
|
51
|
+
"content": "Don't use placeholder text",
|
|
52
|
+
"dont": "Putting instructions for how to complete an input, requirements, or any other essential information into placeholder text is not accessible. 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, use the help text description to convey requirements or to show any formatting examples that would help user comprehension. If there's placeholder text and help text at the same time, it becomes redundant and distracting, especially if they're communicating the same thing."
|
|
112
53
|
},
|
|
113
54
|
{
|
|
114
55
|
"type": "guideline",
|
|
115
|
-
"content": "
|
|
56
|
+
"content": "Switch help text with error text.\n\nThe help text area also displays an error message. When a text area 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 minimum requirements."
|
|
116
57
|
},
|
|
117
58
|
{
|
|
118
59
|
"type": "guideline",
|
|
119
|
-
"content": "
|
|
60
|
+
"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. End sentences with a period, and never with an exclamation point. For text areas, 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. For example, if someone were to miss filling out a required field that asks for their interests, write the error text like you're offering a hint or a tip to help guide them to understand what needs to go in the missing field: \"Enter at least one interest."
|
|
120
61
|
},
|
|
121
62
|
{
|
|
122
63
|
"type": "guideline",
|
|
123
|
-
"content": "
|
|
64
|
+
"content": "RTL.\n\nIn right‑to‑left languages, the text‑area layout is mirrored. The label appears right‑aligned, and elements such as the character count, validation icon and error icon appear left‑aligned. Keep in mind that some content, including email addresses, does not change direction or translate."
|
|
124
65
|
},
|
|
125
66
|
{
|
|
126
67
|
"type": "guideline",
|
|
127
|
-
"content": "
|
|
68
|
+
"content": "Keyboard interactions.\n\nKey Interaction TabTabbing into a text area selects the existing text.Shift + TabMoves focus to the previous focusable element.EnterInserts a new line at the caret position.Arrow keysMove caret through text; with Shift, extend text selection.Home / EndMove caret to start/end of line (platform behavior may vary).Ctrl/Cmd + ASelect all text in the text area. Note: Standard native text-editing shortcuts (copy, paste, undo, redo, delete, word navigation) should be preserved and not overridden."
|
|
128
69
|
},
|
|
129
70
|
{
|
|
130
71
|
"type": "guideline",
|
|
131
|
-
"content": "
|
|
72
|
+
"content": "Cursor guidelines.\n\nCursor Description TextUse text cursor over editable text area content in all states.PointerAny clickable control that is part of the text area (e.g., clear/reveal/help icon) uses the pointer cursor.Move (up/down and left/right)Use while dragging the resize handle (if resizing is enabled)."
|
|
132
73
|
},
|
|
133
74
|
{
|
|
134
75
|
"type": "guideline",
|
|
135
|
-
"content": "
|
|
76
|
+
"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 paired with a text area (validation icons, clear-input icons), must provide a text alternative. All text areas need an accessible name (via a visible label, title, aria-label, or associated text) so screen readers can announce their purpose.Info and relationships, Identify purpose 1.3.1, 1.3.6 A, AAAText areas should be understandable by assistive technologies. The label, help text, error message, and required state must be programmatically associated with the field using semantic HTML or ARIA.Contrast 1.4.3 AAThe visual presentation of text has a contrast ratio of at least 4.5:1.Resize text 1.4.4 AAText areas can be resized up to 200% without loss of content or functionality and without assistive technology.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, icons, and component states have a contrast ratio of at least 3:1. Not applicable for empty fields.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."
|
|
136
77
|
}
|
|
137
78
|
],
|
|
138
79
|
"options": {
|
|
139
|
-
"label": {
|
|
140
|
-
"type": "string"
|
|
141
|
-
},
|
|
80
|
+
"label": { "type": "string" },
|
|
142
81
|
"labelPosition": {
|
|
143
82
|
"type": "string",
|
|
144
83
|
"default": "top",
|
|
145
|
-
"values": [
|
|
146
|
-
{
|
|
147
|
-
"value": "top"
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
"value": "side"
|
|
151
|
-
}
|
|
152
|
-
]
|
|
153
|
-
},
|
|
154
|
-
"hideLabel": {
|
|
155
|
-
"type": "boolean",
|
|
156
|
-
"default": false
|
|
157
|
-
},
|
|
158
|
-
"value": {
|
|
159
|
-
"type": "string",
|
|
160
|
-
"description": "from minValue to maxValue"
|
|
161
|
-
},
|
|
162
|
-
"width": {
|
|
163
|
-
"type": "number"
|
|
84
|
+
"values": [{ "value": "top" }, { "value": "side" }]
|
|
164
85
|
},
|
|
86
|
+
"hideLabel": { "type": "boolean", "default": false },
|
|
87
|
+
"value": { "type": "string", "description": "from minValue to maxValue" },
|
|
88
|
+
"width": { "type": "number" },
|
|
165
89
|
"size": {
|
|
166
90
|
"type": "string",
|
|
167
91
|
"default": "m",
|
|
168
92
|
"values": [
|
|
169
|
-
{
|
|
170
|
-
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
"value": "m"
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
"value": "l"
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
"value": "xl"
|
|
180
|
-
}
|
|
93
|
+
{ "value": "s" },
|
|
94
|
+
{ "value": "m" },
|
|
95
|
+
{ "value": "l" },
|
|
96
|
+
{ "value": "xl" }
|
|
181
97
|
]
|
|
182
98
|
},
|
|
183
99
|
"necessityIndicator": {
|
|
184
100
|
"type": "string",
|
|
185
101
|
"default": "icon",
|
|
186
|
-
"values": [
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
},
|
|
195
|
-
"isRequired": {
|
|
196
|
-
"type": "boolean",
|
|
197
|
-
"default": false
|
|
198
|
-
},
|
|
199
|
-
"hasCharacterCount": {
|
|
200
|
-
"type": "boolean",
|
|
201
|
-
"default": false
|
|
202
|
-
},
|
|
203
|
-
"showValidIcon": {
|
|
204
|
-
"type": "boolean",
|
|
205
|
-
"default": false
|
|
206
|
-
},
|
|
207
|
-
"isError": {
|
|
208
|
-
"type": "boolean",
|
|
209
|
-
"default": false
|
|
210
|
-
},
|
|
211
|
-
"isDisabled": {
|
|
212
|
-
"type": "boolean",
|
|
213
|
-
"default": false
|
|
214
|
-
},
|
|
215
|
-
"hideDragIcon": {
|
|
216
|
-
"type": "boolean",
|
|
217
|
-
"default": false
|
|
218
|
-
},
|
|
102
|
+
"values": [{ "value": "text" }, { "value": "icon" }]
|
|
103
|
+
},
|
|
104
|
+
"isRequired": { "type": "boolean", "default": false },
|
|
105
|
+
"hasCharacterCount": { "type": "boolean", "default": false },
|
|
106
|
+
"showValidIcon": { "type": "boolean", "default": false },
|
|
107
|
+
"isError": { "type": "boolean", "default": false },
|
|
108
|
+
"isDisabled": { "type": "boolean", "default": false },
|
|
109
|
+
"hideDragIcon": { "type": "boolean", "default": false },
|
|
219
110
|
"height": {
|
|
220
111
|
"type": "number",
|
|
221
112
|
"description": "If undefined, height is dynamic and grows with input text."
|
|
222
113
|
},
|
|
223
|
-
"helpText": {
|
|
224
|
-
|
|
225
|
-
},
|
|
226
|
-
"errorMessage": {
|
|
227
|
-
"type": "string"
|
|
228
|
-
},
|
|
114
|
+
"helpText": { "type": "string" },
|
|
115
|
+
"errorMessage": { "type": "string" },
|
|
229
116
|
"inputType": {
|
|
230
117
|
"type": "string",
|
|
231
118
|
"default": "text",
|
|
232
119
|
"values": [
|
|
233
|
-
{
|
|
234
|
-
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
"value": "phone"
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
"value": "email"
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
"value": "password"
|
|
247
|
-
}
|
|
120
|
+
{ "value": "text" },
|
|
121
|
+
{ "value": "url" },
|
|
122
|
+
{ "value": "phone" },
|
|
123
|
+
{ "value": "email" },
|
|
124
|
+
{ "value": "password" }
|
|
248
125
|
]
|
|
249
126
|
}
|
|
250
127
|
},
|
|
251
128
|
"states": [
|
|
252
|
-
{
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}
|
|
256
|
-
{
|
|
257
|
-
"name": "focus-+-hover",
|
|
258
|
-
"trigger": "prop"
|
|
259
|
-
},
|
|
260
|
-
{
|
|
261
|
-
"name": "focus-+-not-hover",
|
|
262
|
-
"trigger": "prop"
|
|
263
|
-
},
|
|
264
|
-
{
|
|
265
|
-
"name": "keyboard-focus",
|
|
266
|
-
"trigger": "interaction"
|
|
267
|
-
}
|
|
129
|
+
{ "name": "hover", "trigger": "interaction" },
|
|
130
|
+
{ "name": "focus-+-hover", "trigger": "prop" },
|
|
131
|
+
{ "name": "focus-+-not-hover", "trigger": "prop" },
|
|
132
|
+
{ "name": "keyboard-focus", "trigger": "interaction" }
|
|
268
133
|
],
|
|
269
|
-
"lifecycle": {
|
|
270
|
-
"introduced": "1.0.0-draft"
|
|
271
|
-
},
|
|
134
|
+
"lifecycle": { "introduced": "1.0.0-draft" },
|
|
272
135
|
"accessibility": {
|
|
273
136
|
"role": "textbox",
|
|
274
137
|
"intents": ["input"],
|
|
275
138
|
"focusable": true,
|
|
276
139
|
"wcag": [
|
|
277
|
-
{
|
|
278
|
-
"criterion": "1.3.1",
|
|
279
|
-
"level": "A",
|
|
280
|
-
"title": "Info and Relationships"
|
|
281
|
-
},
|
|
140
|
+
{ "criterion": "1.3.1", "level": "A", "title": "Info and Relationships" },
|
|
282
141
|
{
|
|
283
142
|
"criterion": "1.3.5",
|
|
284
143
|
"level": "AA",
|
|
285
144
|
"title": "Identify Input Purpose"
|
|
286
145
|
},
|
|
287
|
-
{
|
|
288
|
-
|
|
289
|
-
"level": "A",
|
|
290
|
-
"title": "Keyboard"
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
"criterion": "4.1.2",
|
|
294
|
-
"level": "A",
|
|
295
|
-
"title": "Name, Role, Value"
|
|
296
|
-
}
|
|
146
|
+
{ "criterion": "2.1.1", "level": "A", "title": "Keyboard" },
|
|
147
|
+
{ "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
|
|
297
148
|
]
|
|
298
149
|
}
|
|
299
150
|
}
|