@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
|
@@ -16,80 +16,76 @@
|
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"type": "guideline",
|
|
19
|
-
"content": "
|
|
19
|
+
"content": "Text overflow.\n\nWhen the title and description text are too long for the available horizontal space, they wrap to form another line."
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"type": "guideline",
|
|
23
|
-
"content": "
|
|
23
|
+
"content": "Button group overflow.\n\nAlert dialogs can include up to three buttons. When horizontal space is limited, the buttons stack vertically. Buttons should be ordered by ascending importance, with the most critical action placed at the end or bottom of the stack."
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"type": "guideline",
|
|
27
|
-
"content": "
|
|
27
|
+
"content": "Use alert dialogs sparingly.\n\nAlert dialogs are interruptive, so they should be reserved for important information that users must acknowledge before continuing a task or workflow. Use them only when absolutely necessary—not for low-priority notifications or excessive confirmations."
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
"type": "guideline",
|
|
31
|
-
"content": "
|
|
31
|
+
"content": "Don’t nest alert dialogs.\n\nAlert dialogs are designed to pause the experience until a decision is made, so only one should appear at a time. Avoid opening an alert dialog from within another. If a situation seems to require a sequence of decisions, consider using a different design pattern."
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
"type": "guideline",
|
|
35
|
-
"content": "
|
|
35
|
+
"content": "Writing the title.\n\nAll alert dialogs must have a title. The title communicates the upshot of the message, such as the eventual outcome or conclusion of an action. It should be as close as possible to a complete sentence (subject + verb). Don’t use punctuation at the end of the title. Most alert dialog titles communicate the main effect of whatever a person is about to do. Titles ideally use the same or similar phrasing as the call-to-action that had led someone to the alert dialog in the first place. The title of an error alert dialog communicates the result of the error. Don’t just state that an error has occurred."
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"type": "guideline",
|
|
39
|
-
"content": "
|
|
39
|
+
"content": "Writing the description.\n\nAlert dialog descriptions share any additional information or context that a person needs to know in order to make one of the decisions offered by the actions. Descriptions are written in complete sentences, and any error code is included in parentheses at the end of the last sentence."
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
"type": "guideline",
|
|
43
|
-
"content": "
|
|
43
|
+
"content": "Writing the actions.\n\nUse a short phrase to succinctly describe the options for next steps. If possible, have the button label use the same language as the action mentioned in the alert dialog title (e.g., if a dialog's title is “Delete conversation,” its primary action button label would be “Delete”)."
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
"type": "guideline",
|
|
47
|
-
"content": "
|
|
47
|
+
"content": "Make button labels specific and actionable.\n\nFor alert dialog buttons, make the labels as specific and actionable as possible. Even if someone were to only read the word or phrase on the button, they should be able to get a summary of the alert dialog’s entire message."
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
"type": "guideline",
|
|
51
|
-
"content": "
|
|
51
|
+
"content": "Avoid asking questions.\n\nQuestions in alert dialog titles — such as “Are you sure you want to quit?” or “Do you want to cancel?” — are redundant and undermine a user's agency in the decision they've already made by taking a previous action to get to the alert dialog. This phrasing also sets up for a yes/no set of actions, which can become confusing. Instead, reframe the message to focus on the outcome or effect."
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
"type": "guideline",
|
|
55
|
-
"content": "
|
|
55
|
+
"content": "Pair confirmation with distinct actions.\n\nIt’s OK to ask a question in an alert dialog's description to confirm if someone wants to go ahead with a choice that the system is making on their behalf. However, this should still be paired with distinct actions that show that a person has control over what happens next."
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
"type": "guideline",
|
|
59
|
-
"content": "
|
|
59
|
+
"content": "RTL.\n\nFor RTL (right-to-left) languages, the layout of the alert dialog is mirrored. Texts are right-aligned and buttons are left-aligned."
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"type": "guideline",
|
|
63
|
+
"content": "Keyboard interactions.\n\nKey Interaction TabMoves focus to the next button inside the alert dialog (last becomes first). If none of the buttons are selected, the focus is set on the first button.Shift + TabMoves focus to the previous button inside the alert dialog (first becomes last). If none of the buttons are selected, the focus is set on the last button.EscDismisses the alert dialog. This is equivalent to choosing “Cancel” or an “OK” confirmation.EscDismisses the alert banner if possible. This is equivalent to selecting the close button."
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"type": "guideline",
|
|
67
|
+
"content": "Cursor guidelines.\n\nCursor Usage Default (Arrow)Use the default cursor for non-interactive elements and text within the alert dialog.PointerUse the pointer cursor for any interactive elements, such as buttons, inside the alert dialog."
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"type": "guideline",
|
|
71
|
+
"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 alert dialogs, must provide a text alternative that communicates the dialog's purpose. All alert dialogs 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, AAAAlert dialogs should be understandable by assistive technologies like screen readers. This means using the proper semantic HTML or ARIA role of alertdialog should be utilized.Use of color 1.4.1 AColor is not used as a means to convey information or distinguish elements.Contrast 1.4.3 AAThe visual presentation of text has a contrast ratio of at least 4.5:1.Visual presentation 1.4.8 AAAThe width of text blocks is no more than 80 characters (40 for CJK languages), and text is never justified.Non-text contrast 1.4.11 AAThe visual presentation of illustrations and component states have a contrast ratio of at least 3:1.Text spacing 1.4.12 AALine height of text is at least 1.5x the font size. 2. Operable Requirement Criterion Level Compliance Keyboard 2.1.1, 2.1.3 A, AAAAll functionality of the component is operable through a keyboard without specific timing for keystrokes.Keyboard traps 2.1.2 AFocus can be moved away from the component using only a keyboard.Seizures and physical reactions 2.3.1, 2.3.2, 2.3.3 A, AAA, AAAThere is no flashing content or unnecessary motion or animation in this component.Focus order 2.4.3 ANavigation sequences receive focus in an order that preserves meaning and operability.Focus visible 2.4.7 AAKeyboard states use an indicator that is visible with at least 3:1 contrast."
|
|
60
72
|
}
|
|
61
73
|
],
|
|
62
74
|
"options": {
|
|
63
|
-
"title": {
|
|
64
|
-
|
|
65
|
-
},
|
|
66
|
-
"description": {
|
|
67
|
-
"type": "string"
|
|
68
|
-
},
|
|
75
|
+
"title": { "type": "string" },
|
|
76
|
+
"description": { "type": "string" },
|
|
69
77
|
"variant": {
|
|
70
78
|
"type": "string",
|
|
71
79
|
"default": "confirmation",
|
|
72
80
|
"values": [
|
|
73
|
-
{
|
|
74
|
-
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"value": "warning"
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
"value": "destructive"
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"value": "error"
|
|
87
|
-
}
|
|
81
|
+
{ "value": "confirmation" },
|
|
82
|
+
{ "value": "information" },
|
|
83
|
+
{ "value": "warning" },
|
|
84
|
+
{ "value": "destructive" },
|
|
85
|
+
{ "value": "error" }
|
|
88
86
|
]
|
|
89
87
|
},
|
|
90
|
-
"primaryActionLabel": {
|
|
91
|
-
"type": "string"
|
|
92
|
-
},
|
|
88
|
+
"primaryActionLabel": { "type": "string" },
|
|
93
89
|
"secondaryActionLabel": {
|
|
94
90
|
"type": "string",
|
|
95
91
|
"description": "If undefined, this button does not appear."
|
|
@@ -100,25 +96,15 @@
|
|
|
100
96
|
"description": "If undefined, this button does not appear."
|
|
101
97
|
}
|
|
102
98
|
},
|
|
103
|
-
"lifecycle": {
|
|
104
|
-
"introduced": "1.0.0-draft"
|
|
105
|
-
},
|
|
99
|
+
"lifecycle": { "introduced": "1.0.0-draft" },
|
|
106
100
|
"accessibility": {
|
|
107
101
|
"role": "dialog",
|
|
108
102
|
"intents": ["dismiss"],
|
|
109
103
|
"focusable": false,
|
|
110
104
|
"keyboardIntents": ["dismiss"],
|
|
111
105
|
"wcag": [
|
|
112
|
-
{
|
|
113
|
-
|
|
114
|
-
"level": "A",
|
|
115
|
-
"title": "Focus Order"
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
"criterion": "4.1.2",
|
|
119
|
-
"level": "A",
|
|
120
|
-
"title": "Name, Role, Value"
|
|
121
|
-
}
|
|
106
|
+
{ "criterion": "2.4.3", "level": "A", "title": "Focus Order" },
|
|
107
|
+
{ "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
|
|
122
108
|
]
|
|
123
109
|
}
|
|
124
110
|
}
|
|
@@ -48,35 +48,16 @@
|
|
|
48
48
|
"type": "number",
|
|
49
49
|
"default": 100,
|
|
50
50
|
"values": [
|
|
51
|
-
{
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"value": 100
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
"value": 200
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"value": 300
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"value": 400
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
"value": 500
|
|
71
|
-
}
|
|
51
|
+
{ "value": 50 },
|
|
52
|
+
{ "value": 75 },
|
|
53
|
+
{ "value": 100 },
|
|
54
|
+
{ "value": 200 },
|
|
55
|
+
{ "value": 300 },
|
|
56
|
+
{ "value": 400 },
|
|
57
|
+
{ "value": 500 }
|
|
72
58
|
]
|
|
73
59
|
}
|
|
74
60
|
},
|
|
75
|
-
"lifecycle": {
|
|
76
|
-
|
|
77
|
-
},
|
|
78
|
-
"accessibility": {
|
|
79
|
-
"role": "group",
|
|
80
|
-
"focusable": false
|
|
81
|
-
}
|
|
61
|
+
"lifecycle": { "introduced": "1.0.0-draft" },
|
|
62
|
+
"accessibility": { "role": "group", "focusable": false }
|
|
82
63
|
}
|
package/components/avatar.json
CHANGED
|
@@ -56,107 +56,44 @@
|
|
|
56
56
|
"type": "number",
|
|
57
57
|
"default": 500,
|
|
58
58
|
"values": [
|
|
59
|
-
{
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"value": 500
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
"value": 600
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
"value": 700
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"value": 800
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
"value": 900
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
"value": 1000
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
"value": 1100
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
"value": 1200
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
"value": 1300
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
"value": 1400
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
"value": 1500
|
|
109
|
-
}
|
|
59
|
+
{ "value": 50 },
|
|
60
|
+
{ "value": 75 },
|
|
61
|
+
{ "value": 100 },
|
|
62
|
+
{ "value": 200 },
|
|
63
|
+
{ "value": 300 },
|
|
64
|
+
{ "value": 400 },
|
|
65
|
+
{ "value": 500 },
|
|
66
|
+
{ "value": 600 },
|
|
67
|
+
{ "value": 700 },
|
|
68
|
+
{ "value": 800 },
|
|
69
|
+
{ "value": 900 },
|
|
70
|
+
{ "value": 1000 },
|
|
71
|
+
{ "value": 1100 },
|
|
72
|
+
{ "value": 1200 },
|
|
73
|
+
{ "value": 1300 },
|
|
74
|
+
{ "value": 1400 },
|
|
75
|
+
{ "value": 1500 }
|
|
110
76
|
]
|
|
111
77
|
},
|
|
112
78
|
"image": {
|
|
113
79
|
"type": "string",
|
|
114
80
|
"default": "user image",
|
|
115
81
|
"values": [
|
|
116
|
-
{
|
|
117
|
-
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
"value": "gradient"
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
"value": "guest image"
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
"value": "initials"
|
|
130
|
-
}
|
|
82
|
+
{ "value": "user image" },
|
|
83
|
+
{ "value": "gradient image" },
|
|
84
|
+
{ "value": "gradient" },
|
|
85
|
+
{ "value": "guest image" },
|
|
86
|
+
{ "value": "initials" }
|
|
131
87
|
]
|
|
132
88
|
},
|
|
133
|
-
"isDisabled": {
|
|
134
|
-
|
|
135
|
-
"default": false
|
|
136
|
-
},
|
|
137
|
-
"showStroke": {
|
|
138
|
-
"type": "boolean",
|
|
139
|
-
"default": false
|
|
140
|
-
}
|
|
89
|
+
"isDisabled": { "type": "boolean", "default": false },
|
|
90
|
+
"showStroke": { "type": "boolean", "default": false }
|
|
141
91
|
},
|
|
142
92
|
"states": [
|
|
143
|
-
{
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
"name": "keyboard-focus",
|
|
149
|
-
"trigger": "interaction"
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
"name": "disabled",
|
|
153
|
-
"trigger": "prop"
|
|
154
|
-
}
|
|
93
|
+
{ "name": "down", "trigger": "interaction" },
|
|
94
|
+
{ "name": "keyboard-focus", "trigger": "interaction" },
|
|
95
|
+
{ "name": "disabled", "trigger": "prop" }
|
|
155
96
|
],
|
|
156
|
-
"lifecycle": {
|
|
157
|
-
|
|
158
|
-
},
|
|
159
|
-
"accessibility": {
|
|
160
|
-
"focusable": false
|
|
161
|
-
}
|
|
97
|
+
"lifecycle": { "introduced": "1.0.0-draft" },
|
|
98
|
+
"accessibility": { "focusable": false }
|
|
162
99
|
}
|
package/components/badge.json
CHANGED
|
@@ -16,59 +16,46 @@
|
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"type": "guideline",
|
|
19
|
-
"content": "
|
|
19
|
+
"content": "Non‑interactive by default.\n\nBadges are display elements, not actions. They should not behave like buttons or links. If an action is required, use a more appropriate component (e.g., Button, Action button)."
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"type": "guideline",
|
|
23
|
-
"content": "
|
|
23
|
+
"content": "Text overflow.\n\nWhen a badge's label is too long for the available horizontal space, it wraps to form another line."
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
|
-
"type": "
|
|
27
|
-
"content": "
|
|
28
|
-
|
|
29
|
-
{
|
|
30
|
-
"type": "guideline",
|
|
31
|
-
"content": "When badges have a semantic meaning, they use semantic colors. Use these variants for the following statuses:"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"type": "guideline",
|
|
35
|
-
"content": "When badges are for color-coded categories, they use non-semantic colors. Non-semantic variants are ideally used for when there are 8 categories or less."
|
|
26
|
+
"type": "do-dont",
|
|
27
|
+
"content": "Avoid using a blue badge",
|
|
28
|
+
"dont": "Blue badges are easily confused with Spectrum's blue accent buttons. Only use blue badges when absolutely necessary."
|
|
36
29
|
},
|
|
37
30
|
{
|
|
38
31
|
"type": "guideline",
|
|
39
|
-
"content": "
|
|
32
|
+
"content": "Only use a yellow badge for discounts.\n\nThe yellow badge is reserved to communicate \"best deal\" or \"discount\" situations only. Do not use the yellow badge for other situations."
|
|
40
33
|
},
|
|
41
34
|
{
|
|
42
|
-
"type": "
|
|
43
|
-
"content": "
|
|
35
|
+
"type": "do-dont",
|
|
36
|
+
"content": "Don't display multiple badges",
|
|
37
|
+
"dont": "Badges are meant to offer quick context about what category, status, or meaning an item is associated with. If your design requires multiple badges, consider using regular text metadata and reserve a single badge for only the most important status, category, or meaning instead."
|
|
44
38
|
},
|
|
45
39
|
{
|
|
46
|
-
"type": "
|
|
47
|
-
"content": "
|
|
40
|
+
"type": "do-dont",
|
|
41
|
+
"content": "Avoid using icon-only badges",
|
|
42
|
+
"dont": "It's best to use a text label on a badge whenever possible because communicating with an icon alone may be unclear or subjective. Reserve icon-only badges for responsive cases, such as for cards in a panel that don't have space for a full badge. In related contexts, pair the icon with a label to help teach a user what the icon means. Icon-only badges should always include a tooltip on hover to show their associated label."
|
|
48
43
|
},
|
|
49
44
|
{
|
|
50
45
|
"type": "guideline",
|
|
51
|
-
"content": "
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"type": "guideline",
|
|
55
|
-
"content": "Blue badges are easily confused with Spectrum's blue accent buttons. Only use blue badges when absolutely necessary."
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"type": "guideline",
|
|
59
|
-
"content": "The yellow badge is reserved to communicate \"best deal\" or \"discount\" situations only. Do not use the yellow badge for other situations."
|
|
46
|
+
"content": "Badge placement varies widely depending on the use case. In cards, place the badge on the left side of the footer, if possible. If there is no footer or if that space is filled, affix the badge to the right edge of the preview. If there is no preview, affix the badge to the top right corner of the card."
|
|
60
47
|
},
|
|
61
48
|
{
|
|
62
49
|
"type": "guideline",
|
|
63
|
-
"content": "
|
|
50
|
+
"content": "RTL.\n\nFor RTL (right-to-left) languages, the layout of the badge is mirrored. The icon (if present) is right-aligned with text on the right."
|
|
64
51
|
},
|
|
65
52
|
{
|
|
66
53
|
"type": "guideline",
|
|
67
|
-
"content": "
|
|
54
|
+
"content": "Cursor guidelines.\n\nCursor Usage Default (Arrow)Use the default cursor for non-interactive components like the badge."
|
|
68
55
|
},
|
|
69
56
|
{
|
|
70
57
|
"type": "guideline",
|
|
71
|
-
"content": "
|
|
58
|
+
"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 badges—must provide a text alternative that communicates the badge’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, AAABadges should be understandable by assistive technologies like screen readers. This means using the proper semantic HTML or ARIA role should be utilized.Use of color 1.4.1 AColor is never used as the sole way to convey meaning in buttons. Badges use color to reinforce their meaning, but every badge also includes a clear text label that communicates purpose.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.Non-text contrast 1.4.11 AAThe visual presentation of icons 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 wrapped. 2. Operable Requirement Criterion Level Compliance Seizures and physical feactions 2.3.1, 2.3.2, 2.3.3 A, AAA, AAAThere is no flashing content or unnecessary motion or animation in this component."
|
|
72
59
|
}
|
|
73
60
|
],
|
|
74
61
|
"options": {
|
|
@@ -82,146 +69,65 @@
|
|
|
82
69
|
"variant": {
|
|
83
70
|
"type": "string",
|
|
84
71
|
"values": [
|
|
85
|
-
{
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"value": "purple"
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
"value": "seafoam"
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
"value": "accent"
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"value": "notice"
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
"value": "gray"
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
"value": "red"
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
"value": "orange"
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
"value": "chartreuse"
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
"value": "celery"
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
"value": "green"
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
"value": "cyan"
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
"value": "blue"
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
"value": "pink"
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
"value": "turquoise"
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
"value": "brown"
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
"value": "cinnamon"
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
"value": "silver"
|
|
159
|
-
}
|
|
72
|
+
{ "value": "neutral" },
|
|
73
|
+
{ "value": "info" },
|
|
74
|
+
{ "value": "positive" },
|
|
75
|
+
{ "value": "negative" },
|
|
76
|
+
{ "value": "indigo" },
|
|
77
|
+
{ "value": "yellow" },
|
|
78
|
+
{ "value": "magenta" },
|
|
79
|
+
{ "value": "fuchsia" },
|
|
80
|
+
{ "value": "purple" },
|
|
81
|
+
{ "value": "seafoam" },
|
|
82
|
+
{ "value": "accent" },
|
|
83
|
+
{ "value": "notice" },
|
|
84
|
+
{ "value": "gray" },
|
|
85
|
+
{ "value": "red" },
|
|
86
|
+
{ "value": "orange" },
|
|
87
|
+
{ "value": "chartreuse" },
|
|
88
|
+
{ "value": "celery" },
|
|
89
|
+
{ "value": "green" },
|
|
90
|
+
{ "value": "cyan" },
|
|
91
|
+
{ "value": "blue" },
|
|
92
|
+
{ "value": "pink" },
|
|
93
|
+
{ "value": "turquoise" },
|
|
94
|
+
{ "value": "brown" },
|
|
95
|
+
{ "value": "cinnamon" },
|
|
96
|
+
{ "value": "silver" }
|
|
160
97
|
]
|
|
161
98
|
},
|
|
162
99
|
"style": {
|
|
163
100
|
"type": "string",
|
|
164
101
|
"values": [
|
|
165
|
-
{
|
|
166
|
-
|
|
167
|
-
}
|
|
168
|
-
{
|
|
169
|
-
"value": "subtle"
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
"value": "outline"
|
|
173
|
-
}
|
|
102
|
+
{ "value": "bold" },
|
|
103
|
+
{ "value": "subtle" },
|
|
104
|
+
{ "value": "outline" }
|
|
174
105
|
]
|
|
175
106
|
},
|
|
176
107
|
"fixed": {
|
|
177
108
|
"type": "string",
|
|
178
109
|
"default": "none",
|
|
179
110
|
"values": [
|
|
180
|
-
{
|
|
181
|
-
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
"value": "right"
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
"value": "bottom"
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
"value": "left"
|
|
194
|
-
}
|
|
111
|
+
{ "value": "none" },
|
|
112
|
+
{ "value": "top" },
|
|
113
|
+
{ "value": "right" },
|
|
114
|
+
{ "value": "bottom" },
|
|
115
|
+
{ "value": "left" }
|
|
195
116
|
]
|
|
196
117
|
},
|
|
197
|
-
"isDisabled": {
|
|
198
|
-
"type": "boolean",
|
|
199
|
-
"default": false
|
|
200
|
-
},
|
|
118
|
+
"isDisabled": { "type": "boolean", "default": false },
|
|
201
119
|
"size": {
|
|
202
120
|
"type": "string",
|
|
203
121
|
"pattern": "^(x?s|m|x{0,3}l)$",
|
|
204
122
|
"default": "s",
|
|
205
123
|
"values": [
|
|
206
|
-
{
|
|
207
|
-
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
"value": "m"
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
"value": "l"
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
"value": "xl"
|
|
217
|
-
}
|
|
124
|
+
{ "value": "s" },
|
|
125
|
+
{ "value": "m" },
|
|
126
|
+
{ "value": "l" },
|
|
127
|
+
{ "value": "xl" }
|
|
218
128
|
]
|
|
219
129
|
}
|
|
220
130
|
},
|
|
221
|
-
"lifecycle": {
|
|
222
|
-
|
|
223
|
-
},
|
|
224
|
-
"accessibility": {
|
|
225
|
-
"focusable": false
|
|
226
|
-
}
|
|
131
|
+
"lifecycle": { "introduced": "1.0.0-draft" },
|
|
132
|
+
"accessibility": { "focusable": false }
|
|
227
133
|
}
|