@adobe/spectrum-design-data 3.3.0-beta.2 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion.json +67 -15
- package/components/action-bar.json +30 -9
- package/components/action-button.json +92 -39
- package/components/action-group.json +137 -18
- package/components/alert-banner.json +27 -8
- package/components/alert-dialog.json +55 -34
- package/components/avatar-group.json +35 -9
- package/components/avatar.json +105 -29
- package/components/badge.json +163 -56
- package/components/breadcrumbs.json +107 -26
- package/components/button-group.json +63 -19
- package/components/button.json +105 -61
- package/components/calendar.json +74 -8
- package/components/card.json +13 -0
- package/components/cards.json +46 -31
- package/components/checkbox-group.json +85 -16
- package/components/checkbox.json +97 -27
- package/components/close-button.json +75 -20
- package/components/coach-indicator.json +44 -14
- package/components/coach-mark.json +26 -8
- package/components/color-area.json +100 -20
- package/components/color-handle.json +46 -25
- package/components/color-loupe.json +14 -2
- package/components/color-slider.json +129 -26
- package/components/color-wheel.json +91 -17
- package/components/combo-box.json +189 -50
- package/components/contextual-help.json +126 -80
- package/components/date-field.json +7 -0
- package/components/date-picker.json +127 -24
- package/components/divider.json +38 -12
- package/components/drop-zone.json +37 -18
- package/components/field-label.json +62 -21
- package/components/heading.json +7 -0
- package/components/help-text.json +53 -16
- package/components/illustrated-message.json +85 -21
- package/components/in-line-alert.json +53 -13
- package/components/link.json +63 -24
- package/components/list-view.json +80 -15
- package/components/menu.json +181 -45
- package/components/meter.json +78 -24
- package/components/number-field.json +175 -34
- package/components/picker.json +188 -42
- package/components/popover.json +126 -37
- package/components/progress-bar.json +108 -23
- package/components/progress-circle.json +55 -12
- package/components/radio-button.json +67 -14
- package/components/radio-group.json +132 -28
- package/components/rating.json +38 -9
- package/components/search-field.json +126 -34
- package/components/segmented-control.json +70 -21
- package/components/select-box.json +103 -29
- package/components/side-navigation.json +69 -28
- package/components/slider.json +155 -39
- package/components/standard-dialog.json +88 -16
- package/components/status-light.json +136 -41
- package/components/steplist.json +24 -5
- package/components/swatch-group.json +55 -19
- package/components/swatch.json +79 -24
- package/components/switch.json +79 -31
- package/components/table.json +73 -26
- package/components/tabs.json +52 -22
- package/components/tag-field.json +60 -14
- package/components/tag-group.json +56 -16
- package/components/tag.json +78 -21
- package/components/takeover-dialog.json +61 -10
- package/components/text-area.json +205 -49
- package/components/text-field.json +170 -42
- package/components/thumbnail.json +63 -22
- package/components/time-field.json +7 -0
- package/components/toast.json +50 -29
- package/components/tooltip.json +87 -27
- package/components/tree-view.json +147 -45
- package/components/user-card.json +7 -0
- package/guidelines/app-frame-overview.json +44 -46
- package/guidelines/attention-hierarchy.json +22 -13
- package/guidelines/background-layers.json +10 -80
- package/guidelines/brand.json +12 -32
- package/guidelines/colors.json +17 -47
- package/guidelines/developer-overview.json +9 -25
- package/guidelines/faqs.json +9 -96
- package/guidelines/fonts.json +14 -29
- package/guidelines/grays.json +44 -17
- package/guidelines/icon-fundamentals.json +18 -7
- package/guidelines/manifest.json +15 -367
- package/guidelines/motion.json +16 -17
- package/guidelines/principles.json +8 -7
- package/guidelines/resources.json +15 -21
- package/guidelines/states.json +11 -16
- package/guidelines/using-icons.json +44 -33
- package/package.json +2 -2
- package/registry/platform-implementations.json +30 -0
- package/guidelines/ai-resource-guide.json +0 -50
- package/guidelines/applying-the-type-system.json +0 -67
- package/guidelines/bi-directionality.json +0 -57
- package/guidelines/border-width.json +0 -58
- package/guidelines/cognitive.json +0 -197
- package/guidelines/component-spacing.json +0 -61
- package/guidelines/contact-us.json +0 -67
- package/guidelines/content-area-browsing-context.json +0 -65
- package/guidelines/content-design-grammar-and-mechanics.json +0 -241
- package/guidelines/content-design-voice-and-tone.json +0 -37
- package/guidelines/content-grammar-and-mechanics.json +0 -252
- package/guidelines/content-language-and-inclusivity-writing-about-people.json +0 -103
- package/guidelines/content-language-and-inclusivity-writing-with-visuals.json +0 -70
- package/guidelines/content-voice-and-tone.json +0 -47
- package/guidelines/creating-bluelines-browsing-context.json +0 -91
- package/guidelines/design-tokens.json +0 -158
- package/guidelines/drop-shadow.json +0 -68
- package/guidelines/grammar-and-mechanics.json +0 -252
- package/guidelines/header-browsing-context.json +0 -40
- package/guidelines/illustration.json +0 -105
- package/guidelines/in-product-word-list.json +0 -29
- package/guidelines/inclusive-design.json +0 -101
- package/guidelines/inclusive-ux-writing.json +0 -30
- package/guidelines/internationalization.json +0 -87
- package/guidelines/language-and-inclusivity-writing-about-people.json +0 -85
- package/guidelines/language-and-inclusivity-writing-with-visuals.json +0 -61
- package/guidelines/layout-and-structure-containers.json +0 -47
- package/guidelines/layout-and-structure-spacing-overview.json +0 -66
- package/guidelines/layout-spacing.json +0 -39
- package/guidelines/object-styles-overview.json +0 -17
- package/guidelines/rounding.json +0 -73
- package/guidelines/side-navigation-browsing-context.json +0 -74
- package/guidelines/spacing-overview.json +0 -45
- package/guidelines/support.json +0 -113
- package/guidelines/typography-overview.json +0 -43
- package/guidelines/typography-system.json +0 -208
- package/guidelines/visual-language-containers.json +0 -36
- package/guidelines/voice-and-tone.json +0 -47
- package/guidelines/whats-new.json +0 -32
- package/guidelines/writing-about-people.json +0 -103
- package/guidelines/writing-for-errors.json +0 -120
- package/guidelines/writing-for-onboarding.json +0 -119
- package/guidelines/writing-for-readability.json +0 -54
- package/guidelines/writing-with-visuals.json +0 -70
- package/registry/platform-extensions/web-components-states.json +0 -58
package/components/switch.json
CHANGED
|
@@ -9,6 +9,13 @@
|
|
|
9
9
|
"category": "inputs",
|
|
10
10
|
"documentationUrl": "https://spectrum.adobe.com/page/switch/"
|
|
11
11
|
},
|
|
12
|
+
"implementations": [
|
|
13
|
+
{
|
|
14
|
+
"platform": "web",
|
|
15
|
+
"componentName": "Switch",
|
|
16
|
+
"package": "@react-spectrum/s2"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
12
19
|
"documentBlocks": [
|
|
13
20
|
{
|
|
14
21
|
"type": "purpose",
|
|
@@ -16,100 +23,141 @@
|
|
|
16
23
|
},
|
|
17
24
|
{
|
|
18
25
|
"type": "guideline",
|
|
19
|
-
"content": "
|
|
26
|
+
"content": "Switches toggle an individual option on or off. They're typically used to activate or deactivate a specific setting."
|
|
20
27
|
},
|
|
21
28
|
{
|
|
22
29
|
"type": "guideline",
|
|
23
|
-
"content": "
|
|
30
|
+
"content": "Switch should always have a label for accessibility and clear comprehension. When the label is not defined, a switch becomes standalone. Standalone switches should only be used when their connection to other components is clear and they give sufficient context — for example, in application panels."
|
|
24
31
|
},
|
|
25
32
|
{
|
|
26
33
|
"type": "guideline",
|
|
27
|
-
"content": "
|
|
34
|
+
"content": "Switches can either be selected or not selected. They cannot be in an indeterminate state (unlike checkboxes). When a switch represents multiple values that are not identical, the switch should appear as not selected."
|
|
28
35
|
},
|
|
29
36
|
{
|
|
30
37
|
"type": "guideline",
|
|
31
|
-
"content": "
|
|
38
|
+
"content": "Switch 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."
|
|
32
39
|
},
|
|
33
40
|
{
|
|
34
41
|
"type": "guideline",
|
|
35
|
-
"content": "
|
|
42
|
+
"content": "By default, switches are not emphasized (gray). This version is optimal for when the switch is not the core part of an interface, such as in application panels, where all visual components are monochrome in order to direct focus to the content."
|
|
36
43
|
},
|
|
37
44
|
{
|
|
38
45
|
"type": "guideline",
|
|
39
|
-
"content": "
|
|
46
|
+
"content": "The emphasized (blue) version provides a visual prominence that is optimal for forms, settings, lists or grids of assets, and other situations where a switch needs to be noticed."
|
|
40
47
|
},
|
|
41
48
|
{
|
|
42
49
|
"type": "guideline",
|
|
43
|
-
"content": "
|
|
50
|
+
"content": "A switch in a disabled state shows that an action exists, but is not available in that circumstance. This state can be used to maintain layout continuity and to communicate that an action may become available later."
|
|
44
51
|
},
|
|
45
52
|
{
|
|
46
53
|
"type": "guideline",
|
|
47
|
-
"content": "
|
|
54
|
+
"content": "Switches have a read-only option for when they’re in the disabled state but still need their labels to be shown. This allows for content to be copied, but not interacted with or changed."
|
|
48
55
|
},
|
|
49
56
|
{
|
|
50
57
|
"type": "guideline",
|
|
51
|
-
"content": "
|
|
58
|
+
"content": "A 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."
|
|
52
59
|
},
|
|
53
60
|
{
|
|
54
61
|
"type": "guideline",
|
|
55
|
-
"content": "
|
|
62
|
+
"content": "When the label is too long for the horizontal space available, it wraps to form another line."
|
|
56
63
|
},
|
|
57
64
|
{
|
|
58
65
|
"type": "guideline",
|
|
59
|
-
"content": "
|
|
66
|
+
"content": "Emphasized 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."
|
|
60
67
|
},
|
|
61
68
|
{
|
|
62
69
|
"type": "guideline",
|
|
63
|
-
"content": "
|
|
70
|
+
"content": "Standalone 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."
|
|
64
71
|
},
|
|
65
72
|
{
|
|
66
73
|
"type": "guideline",
|
|
67
|
-
"content": "
|
|
74
|
+
"content": "Switches 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)."
|
|
68
75
|
},
|
|
69
76
|
{
|
|
70
77
|
"type": "guideline",
|
|
71
|
-
"content": "
|
|
78
|
+
"content": "When 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."
|
|
72
79
|
},
|
|
73
80
|
{
|
|
74
81
|
"type": "guideline",
|
|
75
|
-
"content": "
|
|
82
|
+
"content": "Switches 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."
|
|
76
83
|
},
|
|
77
84
|
{
|
|
78
85
|
"type": "guideline",
|
|
79
|
-
"content": "
|
|
86
|
+
"content": "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)."
|
|
80
87
|
}
|
|
81
88
|
],
|
|
82
89
|
"options": {
|
|
83
|
-
"label": {
|
|
84
|
-
|
|
90
|
+
"label": {
|
|
91
|
+
"type": "string"
|
|
92
|
+
},
|
|
93
|
+
"isSelected": {
|
|
94
|
+
"type": "boolean",
|
|
95
|
+
"default": false
|
|
96
|
+
},
|
|
85
97
|
"size": {
|
|
86
98
|
"type": "string",
|
|
87
99
|
"default": "m",
|
|
88
100
|
"values": [
|
|
89
|
-
{
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
{
|
|
101
|
+
{
|
|
102
|
+
"value": "s"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"value": "m"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"value": "l"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"value": "xl"
|
|
112
|
+
}
|
|
93
113
|
]
|
|
94
114
|
},
|
|
95
|
-
"isEmphasized": {
|
|
96
|
-
|
|
97
|
-
|
|
115
|
+
"isEmphasized": {
|
|
116
|
+
"type": "boolean",
|
|
117
|
+
"default": false
|
|
118
|
+
},
|
|
119
|
+
"isDisabled": {
|
|
120
|
+
"type": "boolean",
|
|
121
|
+
"default": false
|
|
122
|
+
},
|
|
123
|
+
"isReadOnly": {
|
|
124
|
+
"type": "boolean",
|
|
125
|
+
"default": false
|
|
126
|
+
}
|
|
98
127
|
},
|
|
99
128
|
"states": [
|
|
100
|
-
{
|
|
101
|
-
|
|
102
|
-
|
|
129
|
+
{
|
|
130
|
+
"name": "hover",
|
|
131
|
+
"trigger": "interaction"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "down",
|
|
135
|
+
"trigger": "interaction"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"name": "keyboard-focus",
|
|
139
|
+
"trigger": "interaction"
|
|
140
|
+
}
|
|
103
141
|
],
|
|
104
|
-
"lifecycle": {
|
|
142
|
+
"lifecycle": {
|
|
143
|
+
"introduced": "1.0.0-draft"
|
|
144
|
+
},
|
|
105
145
|
"accessibility": {
|
|
106
146
|
"role": "switch",
|
|
107
147
|
"intents": ["choose"],
|
|
108
148
|
"focusable": true,
|
|
109
149
|
"keyboardIntents": ["activate"],
|
|
110
150
|
"wcag": [
|
|
111
|
-
{
|
|
112
|
-
|
|
151
|
+
{
|
|
152
|
+
"criterion": "2.1.1",
|
|
153
|
+
"level": "A",
|
|
154
|
+
"title": "Keyboard"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"criterion": "4.1.2",
|
|
158
|
+
"level": "A",
|
|
159
|
+
"title": "Name, Role, Value"
|
|
160
|
+
}
|
|
113
161
|
]
|
|
114
162
|
}
|
|
115
163
|
}
|
package/components/table.json
CHANGED
|
@@ -16,64 +16,79 @@
|
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"type": "guideline",
|
|
19
|
-
"content": "
|
|
19
|
+
"content": "Tables organize and display structured information in rows and columns. They support scanning, sorting, comparing, and interacting with large amounts of data. Use when multiple data points need to be reviewed or acted on in one place."
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"type": "guideline",
|
|
23
|
-
"content": "
|
|
23
|
+
"content": "Tables come in three sizes: small, medium, and large. Size affects the overall scale, including font size and spacing. Medium is the default. Use large for high-visibility tables or when readability is critical. Use small in constrained spaces or when the table is secondary to other content."
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"type": "guideline",
|
|
27
|
+
"content": "If true, the table header is hidden."
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"type": "guideline",
|
|
31
|
+
"content": "Configuration for the table header row."
|
|
24
32
|
},
|
|
25
33
|
{
|
|
26
34
|
"type": "guideline",
|
|
27
|
-
"content": "
|
|
35
|
+
"content": "Tables come in three densities: compact, regular, and spacious. Density controls vertical spacing while keeping font sizes consistent—compact rows have tighter padding, spacious rows have more breathing room. Regular is the default for most use cases. Use compact when fitting more data in a limited viewport is critical (e.g., dashboards, data-heavy admin panels). Use spacious when scannability and visual comfort are priorities (e.g., transaction histories, settings tables with minimal data)."
|
|
28
36
|
},
|
|
29
37
|
{
|
|
30
38
|
"type": "guideline",
|
|
31
|
-
"content": "
|
|
39
|
+
"content": "Use a standard table when a table is the main focus of an experience. Quiet tables are for when a table is meant to be supplementary, subtle, or lightweight."
|
|
32
40
|
},
|
|
33
41
|
{
|
|
34
42
|
"type": "guideline",
|
|
35
|
-
"content": "
|
|
43
|
+
"content": "If true, table columns can be sorted."
|
|
36
44
|
},
|
|
37
45
|
{
|
|
38
46
|
"type": "guideline",
|
|
39
|
-
"content": "
|
|
47
|
+
"content": "An array of column definitions for the table."
|
|
40
48
|
},
|
|
41
49
|
{
|
|
42
50
|
"type": "guideline",
|
|
43
|
-
"content": "
|
|
51
|
+
"content": "An array of row data for the table."
|
|
44
52
|
},
|
|
45
53
|
{
|
|
46
54
|
"type": "guideline",
|
|
47
|
-
"content": "
|
|
55
|
+
"content": "Column dividers help organize table content and aid users in parsing related data. You can apply dividers selectively to group related columns—for example, separating user information from action columns, or grouping metadata fields together. Use dividers sparingly to avoid visual clutter."
|
|
48
56
|
},
|
|
49
57
|
{
|
|
50
|
-
"type": "
|
|
51
|
-
"content": "
|
|
52
|
-
"dont": "Tables use row dividers, hover states, and selection highlighting to help users track data. Zebra striping adds visual noise without improving usability."
|
|
58
|
+
"type": "guideline",
|
|
59
|
+
"content": "All tables have a hover state regardless of if actions or selections can be made. This aids the user in viewing content in a single row."
|
|
53
60
|
},
|
|
54
61
|
{
|
|
55
62
|
"type": "guideline",
|
|
56
|
-
"content": "
|
|
63
|
+
"content": "Similar to a paragraph of text, textual data should be start-aligned within a table (left-aligned in LTR languages, right-aligned in RTL languages). Never use center alignment."
|
|
57
64
|
},
|
|
58
65
|
{
|
|
59
66
|
"type": "guideline",
|
|
60
|
-
"content": "
|
|
67
|
+
"content": "Numerical data should generally be right-aligned for ease of scanning and comparing. This alignment typically does NOT reverse in RTL languages because:"
|
|
61
68
|
},
|
|
62
69
|
{
|
|
63
70
|
"type": "guideline",
|
|
64
|
-
"content": "
|
|
71
|
+
"content": "Exception: Use start-alignment (left in LTR, right in RTL) when numbers are arbitrary identifiers, known as \"nominal numbers,\" which can't be compared or combined arithmetically (e.g., ZIP codes, IP addresses, phone numbers). These behave like text."
|
|
65
72
|
},
|
|
66
73
|
{
|
|
67
74
|
"type": "guideline",
|
|
68
|
-
"content": "
|
|
75
|
+
"content": "Column headers follow the alignment of their data."
|
|
69
76
|
},
|
|
70
77
|
{
|
|
71
78
|
"type": "guideline",
|
|
72
|
-
"content": "
|
|
79
|
+
"content": "All content should be centered vertically within the row to offer the right visual balance."
|
|
73
80
|
},
|
|
74
81
|
{
|
|
75
82
|
"type": "guideline",
|
|
76
|
-
"content": "
|
|
83
|
+
"content": "Tables use row dividers, hover states, and selection highlighting to help users track data. Zebra striping adds visual noise without improving usability."
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"type": "guideline",
|
|
87
|
+
"content": "Column dividers are optional decorations that can help organize table content and create groups of data. Only use these when necessary, and don't add them to every column."
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"type": "guideline",
|
|
91
|
+
"content": "When there are gaps in the data, use an en dash (–) to represent null or not applicable (N/A) values."
|
|
77
92
|
}
|
|
78
93
|
],
|
|
79
94
|
"options": {
|
|
@@ -81,7 +96,17 @@
|
|
|
81
96
|
"type": "string",
|
|
82
97
|
"default": "m",
|
|
83
98
|
"description": "Controls the density of table rows.",
|
|
84
|
-
"values": [
|
|
99
|
+
"values": [
|
|
100
|
+
{
|
|
101
|
+
"value": "s"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"value": "m"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"value": "l"
|
|
108
|
+
}
|
|
109
|
+
]
|
|
85
110
|
},
|
|
86
111
|
"hideHeader": {
|
|
87
112
|
"type": "boolean",
|
|
@@ -110,9 +135,15 @@
|
|
|
110
135
|
"type": "string",
|
|
111
136
|
"default": "regular",
|
|
112
137
|
"values": [
|
|
113
|
-
{
|
|
114
|
-
|
|
115
|
-
|
|
138
|
+
{
|
|
139
|
+
"value": "compact"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"value": "regular"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"value": "spacious"
|
|
146
|
+
}
|
|
116
147
|
]
|
|
117
148
|
},
|
|
118
149
|
"isQuiet": {
|
|
@@ -209,18 +240,34 @@
|
|
|
209
240
|
"name": "header-row-checkbox",
|
|
210
241
|
"description": "Select-all checkbox within the column header row."
|
|
211
242
|
},
|
|
212
|
-
{
|
|
243
|
+
{
|
|
244
|
+
"name": "section-header"
|
|
245
|
+
}
|
|
213
246
|
],
|
|
214
|
-
"lifecycle": {
|
|
247
|
+
"lifecycle": {
|
|
248
|
+
"introduced": "1.0.0-draft"
|
|
249
|
+
},
|
|
215
250
|
"accessibility": {
|
|
216
251
|
"role": "grid",
|
|
217
252
|
"intents": ["select", "navigate"],
|
|
218
253
|
"focusable": true,
|
|
219
254
|
"keyboardIntents": ["navigate-items", "activate", "select-all"],
|
|
220
255
|
"wcag": [
|
|
221
|
-
{
|
|
222
|
-
|
|
223
|
-
|
|
256
|
+
{
|
|
257
|
+
"criterion": "1.3.1",
|
|
258
|
+
"level": "A",
|
|
259
|
+
"title": "Info and Relationships"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"criterion": "2.1.1",
|
|
263
|
+
"level": "A",
|
|
264
|
+
"title": "Keyboard"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"criterion": "4.1.2",
|
|
268
|
+
"level": "A",
|
|
269
|
+
"title": "Name, Role, Value"
|
|
270
|
+
}
|
|
224
271
|
]
|
|
225
272
|
}
|
|
226
273
|
}
|
package/components/tabs.json
CHANGED
|
@@ -9,6 +9,19 @@
|
|
|
9
9
|
"category": "navigation",
|
|
10
10
|
"documentationUrl": "https://spectrum.adobe.com/page/tabs/"
|
|
11
11
|
},
|
|
12
|
+
"implementations": [
|
|
13
|
+
{
|
|
14
|
+
"platform": "web",
|
|
15
|
+
"componentName": "Tabs",
|
|
16
|
+
"package": "@react-spectrum/s2"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"platform": "web",
|
|
20
|
+
"componentName": "Tabs",
|
|
21
|
+
"importPath": "@adobe/spectrum-wc/components/tabs",
|
|
22
|
+
"notes": "Spectrum 2 web component custom element: swc-tabs."
|
|
23
|
+
}
|
|
24
|
+
],
|
|
12
25
|
"documentBlocks": [
|
|
13
26
|
{
|
|
14
27
|
"type": "purpose",
|
|
@@ -16,59 +29,61 @@
|
|
|
16
29
|
},
|
|
17
30
|
{
|
|
18
31
|
"type": "guideline",
|
|
19
|
-
"content": "
|
|
32
|
+
"content": "Tabs organize related content into multiple sections. They allow navigation between views while keeping the content grouped under a single context. Use when content can be divided logically into categories within the same view."
|
|
20
33
|
},
|
|
21
34
|
{
|
|
22
35
|
"type": "guideline",
|
|
23
|
-
"content": "
|
|
36
|
+
"content": "Tabs can be horizontal or vertical. By default, tabs are horizontal and should be used when horizontal space is limited."
|
|
24
37
|
},
|
|
25
38
|
{
|
|
26
39
|
"type": "guideline",
|
|
27
|
-
"content": "
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"type": "do-dont",
|
|
31
|
-
"content": "Don't use tabs for varying levels of importance",
|
|
32
|
-
"dont": "Use tabs to organize sections of equal importance. Groups of content under each tab item should not be of different natures. Don't use tabs to replace a flow; use pagination components instead."
|
|
40
|
+
"content": "Use vertical tabs when horizontal space is more generous or when the list of sections is too long for a horizontal layout. Vertical tabs can also serve as anchor links, providing shortcuts to sections on a single page. In this case, tab items link to on-page anchors rather than opening a new tab view."
|
|
33
41
|
},
|
|
34
42
|
{
|
|
35
43
|
"type": "guideline",
|
|
36
|
-
"content": "
|
|
44
|
+
"content": "When a user selects a tab item, the selection indicator slides along the base to the newly selected tab. The text and icon colors of both tabs fade during the transition. The tab view changes immediately upon selection."
|
|
37
45
|
},
|
|
38
46
|
{
|
|
39
47
|
"type": "guideline",
|
|
40
|
-
"content": "
|
|
48
|
+
"content": "When there are too many tabs to fit horizontally across the viewport, display the tabs component as a quiet picker. When appropriate, you can also use alternative overflow methods such as horizontal scrolling."
|
|
41
49
|
},
|
|
42
50
|
{
|
|
43
51
|
"type": "guideline",
|
|
44
|
-
"content": "
|
|
52
|
+
"content": "When there are too many tabs to fit horizontally across the viewport, you can either allow horizontal scrolling or place all tab items in a quiet picker. Do not truncate multiple tab items just to make them fit horizontally."
|
|
45
53
|
},
|
|
46
54
|
{
|
|
47
55
|
"type": "guideline",
|
|
48
|
-
"content": "
|
|
56
|
+
"content": "Use tabs to organize sections of equal importance. Groups of content under each tab item should not be of different natures. Don't use tabs to replace a flow; use pagination components instead."
|
|
49
57
|
},
|
|
50
58
|
{
|
|
51
59
|
"type": "guideline",
|
|
52
|
-
"content": "
|
|
60
|
+
"content": "Avoid using multiple levels of tabs. Instead, consider other organizational patterns such as side navigation, accordions or collapsible panels. Nesting tabs is acceptable only when there is a clear separation between the two tab experiences or when different orientations are used."
|
|
53
61
|
},
|
|
54
62
|
{
|
|
55
63
|
"type": "guideline",
|
|
56
|
-
"content": "
|
|
64
|
+
"content": "Do not compromise hierarchy by using the same tab variations or orientations."
|
|
57
65
|
},
|
|
58
66
|
{
|
|
59
67
|
"type": "guideline",
|
|
60
|
-
"content": "
|
|
68
|
+
"content": "Don’t mix the use of icons in tabs. Navigation controls require a clear spacial relationship to one another, and mixing the use of icons can dramatically impact the visual balance and presence for each tab item. Keep in mind that if one tab item has an icon, then they all should have an icon."
|
|
61
69
|
},
|
|
62
70
|
{
|
|
63
71
|
"type": "guideline",
|
|
64
|
-
"content": "
|
|
72
|
+
"content": "It can often be hard to identify the meaning of icon-only tabs. An icon-only tab should always show a tooltip displaying the label on hover."
|
|
65
73
|
}
|
|
66
74
|
],
|
|
67
75
|
"options": {
|
|
68
76
|
"orientation": {
|
|
69
77
|
"type": "string",
|
|
70
78
|
"default": "horizontal",
|
|
71
|
-
"values": [
|
|
79
|
+
"values": [
|
|
80
|
+
{
|
|
81
|
+
"value": "horizontal"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"value": "vertical"
|
|
85
|
+
}
|
|
86
|
+
]
|
|
72
87
|
},
|
|
73
88
|
"items": {
|
|
74
89
|
"type": "array",
|
|
@@ -107,13 +122,18 @@
|
|
|
107
122
|
"default": false,
|
|
108
123
|
"description": "This overrides density and is only applicable to horizontal tabs."
|
|
109
124
|
},
|
|
110
|
-
"isEmphasized": {
|
|
125
|
+
"isEmphasized": {
|
|
126
|
+
"type": "boolean",
|
|
127
|
+
"default": false
|
|
128
|
+
},
|
|
111
129
|
"alignment": {
|
|
112
130
|
"type": "string",
|
|
113
131
|
"enum": ["start", "center"],
|
|
114
132
|
"default": "start"
|
|
115
133
|
},
|
|
116
|
-
"selectedItem": {
|
|
134
|
+
"selectedItem": {
|
|
135
|
+
"description": "(list of available items)"
|
|
136
|
+
},
|
|
117
137
|
"keyboardActivation": {
|
|
118
138
|
"type": "string",
|
|
119
139
|
"enum": ["manual", "automatic"],
|
|
@@ -123,7 +143,9 @@
|
|
|
123
143
|
}
|
|
124
144
|
}
|
|
125
145
|
},
|
|
126
|
-
"lifecycle": {
|
|
146
|
+
"lifecycle": {
|
|
147
|
+
"introduced": "1.0.0-draft"
|
|
148
|
+
},
|
|
127
149
|
"tokenBindings": [
|
|
128
150
|
{
|
|
129
151
|
"token": "tab-item-to-tab-item-compact-horizontal-medium",
|
|
@@ -139,8 +161,16 @@
|
|
|
139
161
|
"focusable": true,
|
|
140
162
|
"keyboardIntents": ["navigate-items"],
|
|
141
163
|
"wcag": [
|
|
142
|
-
{
|
|
143
|
-
|
|
164
|
+
{
|
|
165
|
+
"criterion": "2.1.1",
|
|
166
|
+
"level": "A",
|
|
167
|
+
"title": "Keyboard"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"criterion": "4.1.2",
|
|
171
|
+
"level": "A",
|
|
172
|
+
"title": "Name, Role, Value"
|
|
173
|
+
}
|
|
144
174
|
]
|
|
145
175
|
}
|
|
146
176
|
}
|