@adobe/spectrum-design-data 3.3.0-beta.0 → 3.3.0-beta.2
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/app-frame-overview.json +18 -10
- package/guidelines/applying-the-type-system.json +14 -10
- package/guidelines/attention-hierarchy.json +3 -3
- package/guidelines/background-layers.json +41 -5
- package/guidelines/bi-directionality.json +8 -8
- package/guidelines/border-width.json +17 -1
- package/guidelines/brand.json +6 -6
- package/guidelines/colors.json +24 -12
- package/guidelines/component-spacing.json +14 -2
- package/guidelines/contact-us.json +1 -1
- package/guidelines/content-area-browsing-context.json +11 -11
- package/guidelines/content-design-grammar-and-mechanics.json +241 -0
- package/guidelines/content-design-voice-and-tone.json +37 -0
- package/guidelines/content-grammar-and-mechanics.json +252 -0
- package/guidelines/content-language-and-inclusivity-writing-about-people.json +103 -0
- package/guidelines/content-language-and-inclusivity-writing-with-visuals.json +70 -0
- package/guidelines/content-voice-and-tone.json +47 -0
- package/guidelines/creating-bluelines-browsing-context.json +9 -9
- package/guidelines/design-tokens.json +50 -14
- package/guidelines/drop-shadow.json +13 -1
- package/guidelines/grays.json +5 -5
- package/guidelines/header-browsing-context.json +7 -4
- package/guidelines/icon-fundamentals.json +4 -4
- package/guidelines/illustration.json +21 -25
- package/guidelines/in-product-word-list.json +1 -1
- package/guidelines/inclusive-design.json +14 -6
- package/guidelines/inclusive-ux-writing.json +1 -1
- package/guidelines/internationalization.json +13 -13
- package/guidelines/language-and-inclusivity-writing-about-people.json +85 -0
- package/guidelines/language-and-inclusivity-writing-with-visuals.json +61 -0
- package/guidelines/layout-and-structure-containers.json +7 -7
- package/guidelines/layout-and-structure-spacing-overview.json +66 -0
- package/guidelines/layout-spacing.json +4 -4
- package/guidelines/manifest.json +126 -38
- package/guidelines/motion.json +5 -5
- package/guidelines/object-styles-overview.json +2 -2
- package/guidelines/principles.json +7 -8
- package/guidelines/rounding.json +15 -3
- package/guidelines/side-navigation-browsing-context.json +16 -13
- package/guidelines/spacing-overview.json +7 -7
- package/guidelines/states.json +4 -4
- package/guidelines/support.json +113 -0
- package/guidelines/typography-overview.json +7 -3
- package/guidelines/typography-system.json +56 -16
- package/guidelines/using-icons.json +14 -14
- package/guidelines/visual-language-containers.json +7 -7
- package/guidelines/whats-new.json +32 -0
- package/guidelines/writing-for-errors.json +21 -21
- package/guidelines/writing-for-onboarding.json +17 -17
- package/guidelines/writing-for-readability.json +4 -4
- package/package.json +1 -1
package/components/steplist.json
CHANGED
|
@@ -51,14 +51,7 @@
|
|
|
51
51
|
"orientation": {
|
|
52
52
|
"type": "string",
|
|
53
53
|
"default": "horizontal",
|
|
54
|
-
"values": [
|
|
55
|
-
{
|
|
56
|
-
"value": "horizontal"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"value": "vertical"
|
|
60
|
-
}
|
|
61
|
-
]
|
|
54
|
+
"values": [{ "value": "horizontal" }, { "value": "vertical" }]
|
|
62
55
|
},
|
|
63
56
|
"items": {
|
|
64
57
|
"type": "array",
|
|
@@ -100,28 +93,16 @@
|
|
|
100
93
|
"name": "track-size",
|
|
101
94
|
"description": "The connecting track between steps."
|
|
102
95
|
},
|
|
103
|
-
{
|
|
104
|
-
"name": "track"
|
|
105
|
-
}
|
|
96
|
+
{ "name": "track" }
|
|
106
97
|
],
|
|
107
|
-
"lifecycle": {
|
|
108
|
-
"introduced": "1.0.0-draft"
|
|
109
|
-
},
|
|
98
|
+
"lifecycle": { "introduced": "1.0.0-draft" },
|
|
110
99
|
"accessibility": {
|
|
111
100
|
"intents": ["navigate"],
|
|
112
101
|
"focusable": true,
|
|
113
102
|
"keyboardIntents": ["navigate-items", "activate"],
|
|
114
103
|
"wcag": [
|
|
115
|
-
{
|
|
116
|
-
|
|
117
|
-
"level": "A",
|
|
118
|
-
"title": "Keyboard"
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
"criterion": "4.1.2",
|
|
122
|
-
"level": "A",
|
|
123
|
-
"title": "Name, Role, Value"
|
|
124
|
-
}
|
|
104
|
+
{ "criterion": "2.1.1", "level": "A", "title": "Keyboard" },
|
|
105
|
+
{ "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
|
|
125
106
|
]
|
|
126
107
|
}
|
|
127
108
|
}
|
|
@@ -16,23 +16,23 @@
|
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"type": "guideline",
|
|
19
|
-
"content": "
|
|
19
|
+
"content": "Border only for low-contrast swatches.\n\nIt's important for users to compare colors when they're displayed in a swatch group. Because of this, swatches within a swatch group with low contrast (below 3:1 contrast with the background) have a less prominent border compared to the swatch component when used by itself. This reduces the likelihood of the UI interfering with color perception and comparisons."
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"type": "guideline",
|
|
23
|
-
"content": "
|
|
23
|
+
"content": "Corner rounding in swatch groups.\n\nA corner rounding of none should be used in a swatch group in order to help minimize the Hermann grid illusion that happens at the intersections of the white space within the group. The only exception is when a swatch group only takes up a single row. In that case, use any of the rounding options: none, partial rounding, or full rounding."
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"type": "guideline",
|
|
27
|
-
"content": "
|
|
27
|
+
"content": "Keyboard interactions.\n\nKey Interaction TabMoves focus onto the swatch or swatch group.Arrow keysMoves focus through the swatches in the group."
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
"type": "guideline",
|
|
31
|
-
"content": "
|
|
31
|
+
"content": "Cursor guidelines.\n\nCursor Description PointerUse the pointer cursor for all interactive elements in every state."
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
"type": "guideline",
|
|
35
|
-
"content": "
|
|
35
|
+
"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 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 A, AAASwatch groups should be understandable by assistive technologies like screen readers. This means the proper semantic HTML or ARIA role should be utilized, so the grouping relationship between swatches and the selected state are programmatically conveyed.Use of color 1.4.1 AThis criterion requires that color not be the only method of communicating information. In swatches, the color itself is the content being presented, not a cue that conveys additional meaning. 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."
|
|
36
36
|
}
|
|
37
37
|
],
|
|
38
38
|
"options": {
|
|
@@ -40,51 +40,27 @@
|
|
|
40
40
|
"type": "string",
|
|
41
41
|
"default": "m",
|
|
42
42
|
"values": [
|
|
43
|
-
{
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"value": "s"
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"value": "m"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"value": "l"
|
|
54
|
-
}
|
|
43
|
+
{ "value": "xs" },
|
|
44
|
+
{ "value": "s" },
|
|
45
|
+
{ "value": "m" },
|
|
46
|
+
{ "value": "l" }
|
|
55
47
|
]
|
|
56
48
|
},
|
|
57
49
|
"density": {
|
|
58
50
|
"type": "string",
|
|
59
51
|
"default": "regular",
|
|
60
52
|
"values": [
|
|
61
|
-
{
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
{
|
|
65
|
-
"value": "regular"
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
"value": "spacious"
|
|
69
|
-
}
|
|
53
|
+
{ "value": "compact" },
|
|
54
|
+
{ "value": "regular" },
|
|
55
|
+
{ "value": "spacious" }
|
|
70
56
|
]
|
|
71
57
|
},
|
|
72
|
-
"enableSelection": {
|
|
73
|
-
"type": "boolean",
|
|
74
|
-
"default": false
|
|
75
|
-
},
|
|
58
|
+
"enableSelection": { "type": "boolean", "default": false },
|
|
76
59
|
"selectionMode": {
|
|
77
60
|
"type": "string",
|
|
78
61
|
"description": "Only applicable if selection is enabled.",
|
|
79
62
|
"default": "single",
|
|
80
|
-
"values": [
|
|
81
|
-
{
|
|
82
|
-
"value": "single"
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
"value": "multiple"
|
|
86
|
-
}
|
|
87
|
-
]
|
|
63
|
+
"values": [{ "value": "single" }, { "value": "multiple" }]
|
|
88
64
|
},
|
|
89
65
|
"allowsEmptySelection": {
|
|
90
66
|
"type": "boolean",
|
|
@@ -96,31 +72,19 @@
|
|
|
96
72
|
"default": "none",
|
|
97
73
|
"description": "Determines the corner radius of each swatch in the group. Partial refers to corner-radius-75.",
|
|
98
74
|
"values": [
|
|
99
|
-
{
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
{
|
|
103
|
-
"value": "full"
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
"value": "partial"
|
|
107
|
-
}
|
|
75
|
+
{ "value": "none" },
|
|
76
|
+
{ "value": "full" },
|
|
77
|
+
{ "value": "partial" }
|
|
108
78
|
]
|
|
109
79
|
}
|
|
110
80
|
},
|
|
111
|
-
"lifecycle": {
|
|
112
|
-
"introduced": "1.0.0-draft"
|
|
113
|
-
},
|
|
81
|
+
"lifecycle": { "introduced": "1.0.0-draft" },
|
|
114
82
|
"accessibility": {
|
|
115
83
|
"role": "group",
|
|
116
84
|
"intents": ["choose"],
|
|
117
85
|
"focusable": false,
|
|
118
86
|
"wcag": [
|
|
119
|
-
{
|
|
120
|
-
"criterion": "4.1.2",
|
|
121
|
-
"level": "A",
|
|
122
|
-
"title": "Name, Role, Value"
|
|
123
|
-
}
|
|
87
|
+
{ "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
|
|
124
88
|
]
|
|
125
89
|
}
|
|
126
90
|
}
|
package/components/swatch.json
CHANGED
|
@@ -16,31 +16,27 @@
|
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"type": "guideline",
|
|
19
|
-
"content": "
|
|
19
|
+
"content": "Keyboard focus.\n\nA swatch can be navigated using a keyboard. The keyboard focus state adds a blue ring to the swatch in focus."
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"type": "guideline",
|
|
23
|
-
"content": "
|
|
23
|
+
"content": "Mixed value.\n\nWhen a swatch represents multiple values that are not identical, the preview shows a gray fill and a dash UI icon."
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"type": "guideline",
|
|
27
|
-
"content": "
|
|
27
|
+
"content": "Hide unavailable swatches when possible.\n\nEven though swatches can have a disabled state, hiding unavailable swatches reduces visual clutter and eases cognitive load. Only show disabled swatches if hiding them would cause confusion to your users."
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
"type": "guideline",
|
|
31
|
-
"content": "
|
|
31
|
+
"content": "Keyboard interactions.\n\nKeyInteractionTabMoves focus onto or off of the swatch group. Focus moves to the first swatch in the group.Space or EnterTriggers an action or selects the swatch when selection is enabled. The focus remains on the swatch, unless the swatch opens or closes the current container. In this case, the focus moves to the target or back to the caller."
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
"type": "guideline",
|
|
35
|
-
"content": "
|
|
35
|
+
"content": "Cursor guidelines.\n\nCursor Description PointerUse the pointer cursor for all interactive elements in every state."
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"type": "guideline",
|
|
39
|
-
"content": "A
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"type": "guideline",
|
|
43
|
-
"content": "Even though swatches can have a disabled state, hiding unavailable swatches reduces visual clutter and eases cognitive load. Only show disabled swatches if hiding them would cause confusion to your users."
|
|
39
|
+
"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 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 A, AAASwatch groups should be understandable by assistive technologies like screen readers. This means the proper semantic HTML or ARIA role should be utilized, so the grouping relationship between swatches and the selected state are programmatically conveyed.Use of color 1.4.1 AThis criterion requires that color not be the only method of communicating information. In swatches, the color itself is the content being presented, not a cue that conveys additional meaning. 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."
|
|
44
40
|
}
|
|
45
41
|
],
|
|
46
42
|
"options": {
|
|
@@ -52,102 +48,51 @@
|
|
|
52
48
|
"type": "string",
|
|
53
49
|
"default": "m",
|
|
54
50
|
"values": [
|
|
55
|
-
{
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"value": "s"
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"value": "m"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"value": "l"
|
|
66
|
-
}
|
|
51
|
+
{ "value": "xs" },
|
|
52
|
+
{ "value": "s" },
|
|
53
|
+
{ "value": "m" },
|
|
54
|
+
{ "value": "l" }
|
|
67
55
|
]
|
|
68
56
|
},
|
|
69
57
|
"shape": {
|
|
70
58
|
"type": "string",
|
|
71
59
|
"default": "square",
|
|
72
|
-
"values": [
|
|
73
|
-
{
|
|
74
|
-
"value": "square"
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
"value": "rectangle"
|
|
78
|
-
}
|
|
79
|
-
]
|
|
60
|
+
"values": [{ "value": "square" }, { "value": "rectangle" }]
|
|
80
61
|
},
|
|
81
62
|
"cornerRounding": {
|
|
82
63
|
"type": "string",
|
|
83
64
|
"default": "none",
|
|
84
65
|
"description": "Determines the corner radius of the swatch. Partial refers to corner-radius-75.",
|
|
85
66
|
"values": [
|
|
86
|
-
{
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
{
|
|
90
|
-
"value": "partial"
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
"value": "full"
|
|
94
|
-
}
|
|
67
|
+
{ "value": "none" },
|
|
68
|
+
{ "value": "partial" },
|
|
69
|
+
{ "value": "full" }
|
|
95
70
|
]
|
|
96
71
|
},
|
|
97
|
-
"isSelected": {
|
|
98
|
-
|
|
99
|
-
"default": false
|
|
100
|
-
},
|
|
101
|
-
"isDisabled": {
|
|
102
|
-
"type": "boolean",
|
|
103
|
-
"default": false
|
|
104
|
-
}
|
|
72
|
+
"isSelected": { "type": "boolean", "default": false },
|
|
73
|
+
"isDisabled": { "type": "boolean", "default": false }
|
|
105
74
|
},
|
|
106
75
|
"anatomy": [
|
|
107
76
|
{
|
|
108
77
|
"name": "slash",
|
|
109
78
|
"description": "Diagonal slash indicating an empty or \"none\" swatch."
|
|
110
79
|
},
|
|
111
|
-
{
|
|
112
|
-
"name": "icon"
|
|
113
|
-
}
|
|
80
|
+
{ "name": "icon" }
|
|
114
81
|
],
|
|
115
82
|
"states": [
|
|
116
|
-
{
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
{
|
|
121
|
-
"name": "down",
|
|
122
|
-
"trigger": "interaction"
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
"name": "keyboard-focus",
|
|
126
|
-
"trigger": "interaction"
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
"name": "disabled",
|
|
130
|
-
"trigger": "prop"
|
|
131
|
-
}
|
|
83
|
+
{ "name": "hover", "trigger": "interaction" },
|
|
84
|
+
{ "name": "down", "trigger": "interaction" },
|
|
85
|
+
{ "name": "keyboard-focus", "trigger": "interaction" },
|
|
86
|
+
{ "name": "disabled", "trigger": "prop" }
|
|
132
87
|
],
|
|
133
|
-
"lifecycle": {
|
|
134
|
-
"introduced": "1.0.0-draft"
|
|
135
|
-
},
|
|
88
|
+
"lifecycle": { "introduced": "1.0.0-draft" },
|
|
136
89
|
"accessibility": {
|
|
137
90
|
"intents": ["choose"],
|
|
138
91
|
"focusable": true,
|
|
139
92
|
"keyboardIntents": ["activate"],
|
|
140
93
|
"wcag": [
|
|
141
|
-
{
|
|
142
|
-
|
|
143
|
-
"level": "A",
|
|
144
|
-
"title": "Keyboard"
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
"criterion": "4.1.2",
|
|
148
|
-
"level": "A",
|
|
149
|
-
"title": "Name, Role, Value"
|
|
150
|
-
}
|
|
94
|
+
{ "criterion": "2.1.1", "level": "A", "title": "Keyboard" },
|
|
95
|
+
{ "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
|
|
151
96
|
]
|
|
152
97
|
}
|
|
153
98
|
}
|
package/components/switch.json
CHANGED
|
@@ -16,141 +16,100 @@
|
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"type": "guideline",
|
|
19
|
-
"content": "
|
|
19
|
+
"content": "Keyboard focus.\n\nA switch can be navigated using a keyboard. The keyboard focus state takes the switch's visual hover state and adds a blue ring to the switch in focus."
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"type": "guideline",
|
|
23
|
-
"content": "
|
|
23
|
+
"content": "Text overflow.\n\nWhen the label is too long for the horizontal space available, it wraps to form another line."
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"type": "guideline",
|
|
27
|
-
"content": "
|
|
27
|
+
"content": "When to use an emphasized switch?\n\nEmphasized switches are optimal for forms, settings, and other scenarios where the switches need to be noticed. Not emphasized switches are optimal for application panels where all the visual components are monochrome in order to direct focus to the canvas."
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
"type": "guideline",
|
|
31
|
-
"content": "
|
|
31
|
+
"content": "When to use a standalone switch?\n\nStandalone switches should be used in situations where the context is clear without an associated text label. For example, a switch located at the top of a panel next to the panel's title makes it clear that the switch will enable/disable the panel options."
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
"type": "guideline",
|
|
35
|
-
"content": "
|
|
35
|
+
"content": "Switch, checkbox or radio button?\n\nSwitches are best for communicating activation (e.g., turning a setting on or off). Checkboxes are best for communicating selection (e.g., selecting multiple items from a list). Radio buttons are best when only one option can be selected at a time from a set (e.g., choosing one preference or mode)."
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"type": "guideline",
|
|
39
|
-
"content": "
|
|
39
|
+
"content": "Representing mixed values.\n\nWhen a switch represents multiple values that are not identical, the switch should appear as not selected. Any subsequent click or tap should select the switch, and update all values to be selected. Another click or tap after that should deselect the switch, and update all values to be not selected."
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
"type": "guideline",
|
|
43
|
-
"content": "
|
|
43
|
+
"content": "No partial state.\n\nSwitches can only be on or off. Indeterminate switches don't exist in accessibility APIs, so it's not possible to make an indeterminate switch accessible. If you need to show a partial state, use a checkbox instead of a switch. When a parent switch represents a group of switches, it should be turned off unless all of the switches are on (turning the parent switch on turns all of the switches on)."
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
"type": "guideline",
|
|
47
|
-
"content": "
|
|
47
|
+
"content": "Consider if the label should use a verb or a noun.\n\nA switch shows a state of persistence for something — a noun or a proper noun — as either being \"on\" or \"off.\" A verb isn't usually needed to communicate the thing being turned on or off, but there can be instances where phrasing the label as a verb can aid in clarity. Just try to keep switches consistently using either verbs or nouns if you have more than one of them in a single view."
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
"type": "guideline",
|
|
51
|
-
"content": "
|
|
51
|
+
"content": "Avoid using verb phrases related to a state of activity.\n\nAvoid using verb phrases related to activity states in a switch label, such as \"turn on\" or \"turn off.\" A switch is naturally either in a state of being on or off — active or inactive — so repeating in the label that something is \"on\" or \"off\" is redundant and clutters an interface."
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
"type": "guideline",
|
|
55
|
-
"content": "
|
|
55
|
+
"content": "Use a neutral tone.\n\nBecause switches are used for controls and utility, their labels are written in a neutral, utilitarian way. There's no need for overly celebratory language."
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
"type": "guideline",
|
|
59
|
-
"content": "
|
|
59
|
+
"content": "Use \"you\" or \"your\" if needed to refer to the user directly.\n\nDescribe switches objectively by using only the names of features or settings, or what those features and settings will do. In the case where it's necessary to refer to a user directly, do so sparingly and use the second person \"you/your.\" We aim to be conversational and talk to the user — not as them."
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
"type": "guideline",
|
|
63
|
-
"content": "
|
|
63
|
+
"content": "Use sentence case.\n\nFollowing Adobe's UX writing style, labels for switches are written in sentence case unless they contain words that are branded terms."
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
"type": "guideline",
|
|
67
|
-
"content": "
|
|
67
|
+
"content": "RTL.\n\nFor RTL (right-to-left) languages, the layout of the switch is mirrored. The track is placed on the right side of the text and the handle is positioned to the left when the switch is turned on."
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
"type": "guideline",
|
|
71
|
-
"content": "
|
|
71
|
+
"content": "Keyboard interactions.\n\nKey Interaction TabMoves focus to the next item or group of items.Shift + TabMoves focus to the previous item or group of items.Space or EnterToggles the switch between on and off."
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
"type": "guideline",
|
|
75
|
-
"content": "
|
|
75
|
+
"content": "Cursor guidelines.\n\nCursor Description PointerUse the pointer cursor for interactive elements in all states."
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
"type": "guideline",
|
|
79
|
-
"content": "
|
|
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 Info and relationships, Identify purpose 1.3.1, 1.3.6 A, AAASwitches should be understandable by assistive technologies like screen readers. This means the proper semantic HTML or ARIA role should be utilized.Use of color 1.4.1 ASwitches never rely on color alone to convey meaning. The active state uses blue to reinforce “on,” and the handle shifts position to clearly show whether the switch is on or off.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 AASwitches 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 when the label is wrapped. 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."
|
|
80
80
|
}
|
|
81
81
|
],
|
|
82
82
|
"options": {
|
|
83
|
-
"label": {
|
|
84
|
-
|
|
85
|
-
},
|
|
86
|
-
"isSelected": {
|
|
87
|
-
"type": "boolean",
|
|
88
|
-
"default": false
|
|
89
|
-
},
|
|
83
|
+
"label": { "type": "string" },
|
|
84
|
+
"isSelected": { "type": "boolean", "default": false },
|
|
90
85
|
"size": {
|
|
91
86
|
"type": "string",
|
|
92
87
|
"default": "m",
|
|
93
88
|
"values": [
|
|
94
|
-
{
|
|
95
|
-
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
"value": "m"
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
"value": "l"
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
"value": "xl"
|
|
105
|
-
}
|
|
89
|
+
{ "value": "s" },
|
|
90
|
+
{ "value": "m" },
|
|
91
|
+
{ "value": "l" },
|
|
92
|
+
{ "value": "xl" }
|
|
106
93
|
]
|
|
107
94
|
},
|
|
108
|
-
"isEmphasized": {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
},
|
|
112
|
-
"isDisabled": {
|
|
113
|
-
"type": "boolean",
|
|
114
|
-
"default": false
|
|
115
|
-
},
|
|
116
|
-
"isReadOnly": {
|
|
117
|
-
"type": "boolean",
|
|
118
|
-
"default": false
|
|
119
|
-
}
|
|
95
|
+
"isEmphasized": { "type": "boolean", "default": false },
|
|
96
|
+
"isDisabled": { "type": "boolean", "default": false },
|
|
97
|
+
"isReadOnly": { "type": "boolean", "default": false }
|
|
120
98
|
},
|
|
121
99
|
"states": [
|
|
122
|
-
{
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
"name": "down",
|
|
128
|
-
"trigger": "interaction"
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
"name": "keyboard-focus",
|
|
132
|
-
"trigger": "interaction"
|
|
133
|
-
}
|
|
100
|
+
{ "name": "hover", "trigger": "interaction" },
|
|
101
|
+
{ "name": "down", "trigger": "interaction" },
|
|
102
|
+
{ "name": "keyboard-focus", "trigger": "interaction" }
|
|
134
103
|
],
|
|
135
|
-
"lifecycle": {
|
|
136
|
-
"introduced": "1.0.0-draft"
|
|
137
|
-
},
|
|
104
|
+
"lifecycle": { "introduced": "1.0.0-draft" },
|
|
138
105
|
"accessibility": {
|
|
139
106
|
"role": "switch",
|
|
140
107
|
"intents": ["choose"],
|
|
141
108
|
"focusable": true,
|
|
142
109
|
"keyboardIntents": ["activate"],
|
|
143
110
|
"wcag": [
|
|
144
|
-
{
|
|
145
|
-
|
|
146
|
-
"level": "A",
|
|
147
|
-
"title": "Keyboard"
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
"criterion": "4.1.2",
|
|
151
|
-
"level": "A",
|
|
152
|
-
"title": "Name, Role, Value"
|
|
153
|
-
}
|
|
111
|
+
{ "criterion": "2.1.1", "level": "A", "title": "Keyboard" },
|
|
112
|
+
{ "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
|
|
154
113
|
]
|
|
155
114
|
}
|
|
156
115
|
}
|