@adobe/spectrum-design-data 3.3.0 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/components/accordion.json +32 -102
  2. package/components/action-bar.json +9 -23
  3. package/components/action-button.json +52 -92
  4. package/components/action-group.json +18 -129
  5. package/components/alert-banner.json +8 -27
  6. package/components/alert-dialog.json +45 -55
  7. package/components/avatar-group.json +20 -50
  8. package/components/avatar.json +44 -123
  9. package/components/badge.json +66 -160
  10. package/components/breadcrumbs.json +26 -100
  11. package/components/button-group.json +32 -63
  12. package/components/button.json +74 -105
  13. package/components/calendar.json +8 -67
  14. package/components/cards.json +31 -46
  15. package/components/checkbox-group.json +22 -84
  16. package/components/checkbox.json +33 -96
  17. package/components/close-button.json +31 -73
  18. package/components/coach-indicator.json +14 -44
  19. package/components/coach-mark.json +8 -26
  20. package/components/color-area.json +20 -93
  21. package/components/color-handle.json +25 -38
  22. package/components/color-loupe.json +18 -18
  23. package/components/color-slider.json +26 -122
  24. package/components/color-wheel.json +17 -84
  25. package/components/combo-box.json +56 -188
  26. package/components/contextual-help.json +87 -126
  27. package/components/date-picker.json +24 -120
  28. package/components/divider.json +25 -38
  29. package/components/drop-zone.json +25 -37
  30. package/components/field-label.json +22 -59
  31. package/components/help-text.json +16 -53
  32. package/components/illustrated-message.json +21 -72
  33. package/components/in-line-alert.json +13 -53
  34. package/components/link.json +31 -63
  35. package/components/list-view.json +15 -73
  36. package/components/menu.json +51 -180
  37. package/components/meter.json +35 -76
  38. package/components/number-field.json +34 -168
  39. package/components/picker.json +48 -187
  40. package/components/popover.json +47 -123
  41. package/components/progress-bar.json +33 -105
  42. package/components/progress-circle.json +25 -55
  43. package/components/radio-button.json +14 -67
  44. package/components/radio-group.json +34 -131
  45. package/components/rating.json +9 -38
  46. package/components/search-field.json +40 -125
  47. package/components/segmented-control.json +27 -69
  48. package/components/select-box.json +29 -96
  49. package/components/side-navigation.json +28 -69
  50. package/components/slider.json +45 -154
  51. package/components/standard-dialog.json +16 -88
  52. package/components/status-light.json +51 -133
  53. package/components/steplist.json +5 -24
  54. package/components/swatch-group.json +19 -55
  55. package/components/swatch.json +24 -79
  56. package/components/switch.json +42 -79
  57. package/components/table.json +26 -73
  58. package/components/tabs.json +35 -52
  59. package/components/tag-field.json +14 -60
  60. package/components/tag-group.json +22 -55
  61. package/components/tag.json +27 -77
  62. package/components/takeover-dialog.json +10 -61
  63. package/components/text-area.json +55 -204
  64. package/components/text-field.json +48 -169
  65. package/components/thumbnail.json +22 -63
  66. package/components/toast.json +30 -47
  67. package/components/tooltip.json +37 -84
  68. package/components/tree-view.json +51 -146
  69. package/fields/structure.json +1 -2
  70. package/guidelines/ai-resource-guide.json +42 -0
  71. package/guidelines/app-frame-overview.json +45 -44
  72. package/guidelines/applying-the-type-system.json +71 -0
  73. package/guidelines/attention-hierarchy.json +13 -22
  74. package/guidelines/background-layers.json +84 -10
  75. package/guidelines/bi-directionality.json +57 -0
  76. package/guidelines/border-width.json +70 -0
  77. package/guidelines/brand.json +24 -12
  78. package/guidelines/cognitive.json +229 -0
  79. package/guidelines/colors.json +55 -17
  80. package/guidelines/component-spacing.json +65 -0
  81. package/guidelines/contact-us.json +27 -0
  82. package/guidelines/containers.json +21 -28
  83. package/guidelines/content-area-browsing-context.json +73 -0
  84. package/guidelines/creating-bluelines-browsing-context.json +71 -0
  85. package/guidelines/design-tokens.json +186 -0
  86. package/guidelines/developer-overview.json +33 -9
  87. package/guidelines/drop-shadow.json +76 -0
  88. package/guidelines/faqs.json +100 -9
  89. package/guidelines/fonts.json +33 -14
  90. package/guidelines/grammar-and-mechanics.json +276 -0
  91. package/guidelines/grays.json +17 -44
  92. package/guidelines/header-browsing-context.json +40 -0
  93. package/guidelines/icon-fundamentals.json +7 -18
  94. package/guidelines/illustration.json +120 -0
  95. package/guidelines/in-product-word-list.json +25 -0
  96. package/guidelines/inclusive-design.json +101 -0
  97. package/guidelines/inclusive-ux-writing.json +34 -0
  98. package/guidelines/internationalization.json +103 -0
  99. package/guidelines/layout-spacing.json +39 -0
  100. package/guidelines/manifest.json +280 -16
  101. package/guidelines/motion.json +18 -13
  102. package/guidelines/object-styles-overview.json +17 -0
  103. package/guidelines/principles.json +7 -8
  104. package/guidelines/resources.json +29 -15
  105. package/guidelines/rounding.json +85 -0
  106. package/guidelines/side-navigation-browsing-context.json +74 -0
  107. package/guidelines/spacing-overview.json +78 -0
  108. package/guidelines/states.json +16 -11
  109. package/guidelines/support.json +125 -0
  110. package/guidelines/typography-overview.json +39 -0
  111. package/guidelines/typography-system.json +212 -0
  112. package/guidelines/using-icons.json +32 -47
  113. package/guidelines/voice-and-tone.json +51 -0
  114. package/guidelines/whats-new.json +21 -0
  115. package/guidelines/writing-about-people.json +99 -0
  116. package/guidelines/writing-for-errors.json +140 -0
  117. package/guidelines/writing-for-onboarding.json +123 -0
  118. package/guidelines/writing-for-readability.json +66 -0
  119. package/guidelines/writing-with-visuals.json +78 -0
  120. package/llms.txt +27 -0
  121. package/package.json +3 -2
  122. package/tokens/layout.tokens.json +88 -0
@@ -16,121 +16,104 @@
16
16
  },
17
17
  {
18
18
  "type": "guideline",
19
- "content": "Toasts display brief, temporary notifications. They appear briefly without blocking interaction and typically do not require user action."
19
+ "content": "Text overflow.\n\nWhen the text is too long for the available horizontal space, it wraps to form another line. In actionable toasts, the button moves below the text prior to text wrapping."
20
20
  },
21
21
  {
22
22
  "type": "guideline",
23
- "content": "Toasts must include text to communicate a message. Write the text as concisely as possible while still being clear about what has happened or is happening."
23
+ "content": "Multiple toasts.\n\nThe default state can display up to three toasts at a time. To view additional toasts beyond this limit, users can click the \"Show all\" action button. Alternatively, they can reveal remaining toasts by interacting with a button or dismissing the component. Additionally, hovering over the upper part of the toasts triggers a subtle animation, signaling to the user that the group can be fully expanded. The expanded state displays a minimum of two toasts with a visible scroll indicator, while the maximum number adapts based on screen size. Users can either dismiss the toasts or collapse them back to the previous state. To enhance contrast, an overlay is applied beneath the group, similar to components like takeover dialogs. In the React Spectrum implementation, the action button group has a fixed light theme, as switching modes significantly reduces contrast. Please refer to more multiple toasts usage guideline below."
24
24
  },
25
25
  {
26
26
  "type": "guideline",
27
- "content": "The neutral toast is the default variant. It is gray and does not have an icon. This is used when the message is neutral in tone or when its semantics do not fit in any of the other variants."
27
+ "content": "Toast or dialog?\n\nToasts should only be used for confirmations, simple notifications, and low-priority alerts that do not need to completely interrupt the user experience. Dialogs are ideal for when a situation requires a user's attention, either for displaying important information or prompting for a response."
28
28
  },
29
29
  {
30
30
  "type": "guideline",
31
- "content": "The informative toast uses the informative semantic color (blue) and has an info icon to help those with color vision deficiency discern the message tone. This should be used when the message should call extra attention compared to the neutral variant."
31
+ "content": "Placement.\n\nBy default, a toast is placed at the bottom center for both desktop and mobile platform scales to avoid disrupting the user experience. For desktop applications, a toast should be placed 16 px away from the bottom of the viewport. If a toast isn't noticeable or disrupts the user experience, its placement can be changed to bottom end, top end, or top center."
32
32
  },
33
33
  {
34
- "type": "guideline",
35
- "content": "The positive toast uses the positive semantic color (green) and has a checkmark icon to help those with color vision deficiency discern the message tone. This is used to inform about a successful action or completion of a task."
34
+ "type": "do-dont",
35
+ "content": "Don't display more than one action",
36
+ "dont": "Actionable toasts should only have one button."
36
37
  },
37
38
  {
38
- "type": "guideline",
39
- "content": "The negative toast uses the negative semantic color (red) and has an alert icon to help those with color vision deficiency to discern the message tone. This is used to show an error or failure."
39
+ "type": "do-dont",
40
+ "content": "Don't include a redundant action",
41
+ "dont": "Actionable toasts should not have a button with a redundant action. For example, including a \"Dismiss\" button would be redundant because all toasts already have a close button."
40
42
  },
41
43
  {
42
44
  "type": "guideline",
43
- "content": "By default, a toast will dismiss when the user clicks the close button. A toast also has the option to auto-dismiss. Be sure to set a minimum of 5 seconds so that users can have time to read the toast message. If an actionable toast is set to auto-dismiss, make sure that the action is still available elsewhere in the app."
45
+ "content": "Multiple toasts.\n\nToasts are designed for brief, non-intrusive, and temporary notifications. While displaying multiple toasts is available via the React Spectrum implementation, we still discourage triggering multiple toasts simultaneously when possible, as this can be very distracting to the user. Frequent interruptions interfere with usability, especially for people with visual and cognitive disabilities (see WCAG Success Criterion 2.2.4 Interruptions). Products should allow for users to be able turn off all types of alerts. Doing this helps people who want to focus and minimize information that they may find non-essential."
44
46
  },
45
47
  {
46
48
  "type": "guideline",
47
- "content": "When the text is too long for the available horizontal space, it wraps to form another line. In actionable toasts, the button moves below the text prior to text wrapping."
49
+ "content": "Writing for toasts depends on the nature of the message, whether it's communicating confirmation, information, or an error. For all kinds of toasts, keep the text to fewer than 2 lines in English, since it will become longer when localized."
48
50
  },
49
51
  {
50
52
  "type": "guideline",
51
- "content": "The default state can display up to three toasts at a time. To view additional toasts beyond this limit, users can click the “Show all” action button. Alternatively, they can reveal remaining toasts by interacting with a button or dismissing the component. Additionally, hovering over the upper part of the toasts triggers a subtle animation, signaling to the user that the group can be fully expanded."
53
+ "content": "Confirmation.\n\nFor a confirmation message (neutral and positive variants), use a short past participle verb phrase: (optional) noun + verb ending in -ed + (optional) prepositional phrase with more information. If you refer to an interface element directly, put its name in bold text."
52
54
  },
53
55
  {
54
56
  "type": "guideline",
55
- "content": "Please refer to more multiple toasts usage guideline below."
57
+ "content": "Informational.\n\nFor an informational message (informative variant), write in a complete sentence following the formula of subject + verb phrase + optional additional information."
56
58
  },
57
59
  {
58
60
  "type": "guideline",
59
- "content": "Toasts should only be used for confirmations, simple notifications, and low-priority alerts that do not need to completely interrupt the user experience."
61
+ "content": "Error.\n\nFor an error message (negative variant), use a short phrase — it can be a complete sentence or not — to describe what's happening as succinctly as possible. Whenever possible, include an in-line action for a user to take so that they can readily address the issue explained in the message."
60
62
  },
61
63
  {
62
64
  "type": "guideline",
63
- "content": "Dialogs are ideal for when a situation requires a user’s attention, either for displaying important information or prompting for a response."
65
+ "content": "Write in sentence case with no period.\n\nLike all in-product content at Adobe, toasts and their actions are written in sentence case. If the toast's message is a single sentence, do not add a period to the end; this helps keep the text quicker to read and easier to parse. Toasts should ideally only be a single sentence, but if you need to use two or more sentences to most accurately communicate the information, add a period to the end of each sentence."
64
66
  },
65
67
  {
66
68
  "type": "guideline",
67
- "content": "By default, a toast is placed at the bottom center for both desktop and mobile platform scales to avoid disrupting the user experience."
69
+ "content": "Use an instructive tone.\n\nToasts offer quick reference or context, so a user should be able to quickly read a message that's brief and optimized for delivery. Use an instructive tone that presents the message in a concise and neutral way. Because users are likely to see several toasts in quick succession, it's not appropriate to use overly playful, encouraging, or celebratory language. Just convey the message, then get out of the way so that they can get back to the task at hand. Toasts are not appropriate for promotional messaging or upsells that show the benefit of doing or trying something."
68
70
  },
69
71
  {
70
72
  "type": "guideline",
71
- "content": "For desktop applications, a toast should be placed 16 px away from the bottom of the viewport."
73
+ "content": "Use generic language.\n\nWhenever possible, use generic language in confirmation and error messages. This approach allows for better localization and it also reduces the need to write many different versions of toasts for similar use cases. It's usually unnecessary to include specific filenames, usernames, or folders because a user can get that context from elsewhere in the UI."
72
74
  },
73
75
  {
74
76
  "type": "guideline",
75
- "content": "If a toast isn’t noticeable or disrupts the user experience, its placement can be changed to bottom end, top end, or top center."
77
+ "content": "RTL.\n\nFor RTL (right-to-left) languages, the layout of the toast is mirrored. The icon is right-aligned and the close button is left-aligned. If the toast is actionable, the button placement is also inverted and appears on the left side."
76
78
  },
77
79
  {
78
80
  "type": "guideline",
79
- "content": "Actionable toasts should only have one button."
81
+ "content": "Keyboard interactions.\n\nKey Interaction Tab Places the focus on the next interactive element, which is either a button or a close button. Shift + Tab Places the focus on the previous interactive element, which is either a button or a close button. Space or Enter If focus is on the close button, dismisses the toast. If focus is on the button, executes the button action. Esc Dismisses the toast. This is equivalent to selecting the close button."
80
82
  },
81
83
  {
82
84
  "type": "guideline",
83
- "content": "Actionable toasts should not have a button with a redundant action. For example, including a “Dismiss” button would be redundant because all toasts already have a close button."
85
+ "content": "Cursor guidelines.\n\nCursor Usage Default (Arrow) Use the default cursor for non-interactive areas on the toast. Pointer Use the pointer cursor for interactive areas on the toast such as the close button."
84
86
  },
85
87
  {
86
88
  "type": "guideline",
87
- "content": "Products should allow for users to be able turn off all types of alerts. Doing this helps people who want to focus and minimize information that they may find non-essential."
89
+ "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 A Non‑text elements—such as icons used in toasts—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, AAA Toasts 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 A Color is never used as the sole way to convey meaning in toasts. Toasts use color to reinforce their meaning, but every toast also includes a clear text description that communicates purpose. Text contrast minimums 1.4.3 AA Large 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. Visual presentation 1.4.8 AAA The 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 AA The visual presentation of icons have a contrast ratio of at least 3:1. Text spacing 1.4.12 AA Line height of text is at least 1.5x the font size. Text spacing 1.4.12 AA Line height of text is at least 1.5x the font size in wrapped tooltips. 2. Operable Requirement Criterion Level Compliance Keyboard 2.1.1, 2.1.3 A, AAA All functionality of the component is operable through a keyboard without specific timing for keystrokes. Keyboard traps 2.1.2 A Focus can be moved away from the component using only a keyboard. Timing adjustable 2.2.1 A Toasts should not auto-dismiss. If they do, users need a way to extend, pause, or dismiss time-limited content. Hovering, clicking, or keyboard focusing on the toast should keep it from disappearing. Seizures and physical feactions 2.3.1, 2.3.2, 2.3.3 A, AAA, AAA There is no flashing content or unnecessary motion or animation in this component. Focus order 2.4.3 A Navigation sequences receive focus in an order that preserves meaning and operability. Focus visible 2.4.7 AA Keyboard states use an indicator that is visible with at least 3:1 contrast."
88
90
  }
89
91
  ],
90
92
  "options": {
91
- "text": {
92
- "type": "string"
93
- },
93
+ "text": { "type": "string" },
94
94
  "variant": {
95
95
  "type": "string",
96
96
  "default": "neutral",
97
97
  "values": [
98
- {
99
- "value": "neutral"
100
- },
101
- {
102
- "value": "informative"
103
- },
104
- {
105
- "value": "positive"
106
- },
107
- {
108
- "value": "negative"
109
- }
98
+ { "value": "neutral" },
99
+ { "value": "informative" },
100
+ { "value": "positive" },
101
+ { "value": "negative" }
110
102
  ]
111
103
  },
112
104
  "actionLabel": {
113
105
  "type": "string",
114
106
  "description": "If undefined, this button does not appear."
115
107
  },
116
- "isAutoDismissible": {
117
- "type": "boolean",
118
- "default": false
119
- }
120
- },
121
- "lifecycle": {
122
- "introduced": "1.0.0-draft"
108
+ "isAutoDismissible": { "type": "boolean", "default": false }
123
109
  },
110
+ "lifecycle": { "introduced": "1.0.0-draft" },
124
111
  "accessibility": {
125
112
  "intents": ["dismiss"],
126
113
  "focusable": true,
127
114
  "keyboardIntents": ["dismiss"],
128
115
  "wcag": [
129
- {
130
- "criterion": "4.1.3",
131
- "level": "AA",
132
- "title": "Status Messages"
133
- }
116
+ { "criterion": "4.1.3", "level": "AA", "title": "Status Messages" }
134
117
  ]
135
118
  }
136
119
  }
@@ -9,19 +9,6 @@
9
9
  "category": "feedback",
10
10
  "documentationUrl": "https://spectrum.adobe.com/page/tooltip/"
11
11
  },
12
- "implementations": [
13
- {
14
- "platform": "web",
15
- "componentName": "Tooltip",
16
- "package": "@react-spectrum/s2"
17
- },
18
- {
19
- "platform": "web",
20
- "componentName": "Tooltip",
21
- "importPath": "@adobe/spectrum-wc/components/tooltip",
22
- "notes": "Spectrum 2 web component custom element: swc-tooltip."
23
- }
24
- ],
25
12
  "documentBlocks": [
26
13
  {
27
14
  "type": "purpose",
@@ -29,94 +16,77 @@
29
16
  },
30
17
  {
31
18
  "type": "guideline",
32
- "content": "Tooltips display contextual information related to a specific component. They appear on hover or focus to clarify purpose or behavior."
33
- },
34
- {
35
- "type": "guideline",
36
- "content": "All tooltips have a label. The label communicates the contextual help or information about specific components when a user hovers over or focuses on them."
37
- },
38
- {
39
- "type": "guideline",
40
- "content": "By default, tooltips are the neutral variant. These are the most common variant because most tooltips are used to only disclose additional information, without conveying a semantic meaning. The neutral variant never includes an icon."
41
- },
42
- {
43
- "type": "guideline",
44
- "content": "Tooltips also come in semantic variants: informative (blue), and negative (red). An icon is required for these variants to ensure information isn’t conveyed by color alone."
45
- },
46
- {
47
- "type": "guideline",
48
- "content": "2 of the 3 tooltip variants (informative and negative) can include an icon to supplement the messaging. These icons are predefined and can not be customized. Unless it's being used to provide context about the exact same icon, a semantic tooltip should always show an icon. Doing this is essential for helping users with color vision deficiency to discern the message tone."
19
+ "content": "Text overflow.\n\nWhen the label is too long for the available horizontal space, it wraps to form another line."
49
20
  },
50
21
  {
51
22
  "type": "guideline",
52
- "content": "A tooltip is positioned in relation to its target."
23
+ "content": "Animation.\n\nA tooltip fades in and out when showing and hiding, and slides a short distance from the source to indicate its origin. The direction of the slide (left, right, top, bottom) depends on the placement of the tooltip. The animation attributes (duration, easing, offset) are the same whether it's showing or hiding."
53
24
  },
54
25
  {
55
26
  "type": "guideline",
56
- "content": "This option determines whether or not a tooltip should be able to switch sides when constrained by space. A tooltip placed at the top would flip to be placed at the bottom (and vice versa), and a tooltip placed at the left would flip to be placed at the right (and vice versa)."
27
+ "content": "Immediate or delayed appearance.\n\nTooltips attached to help icons appear immediately. For conventional UI elements where a tooltip appearing immediately would be intrusive, delay appearance with a warmup period."
57
28
  },
58
29
  {
59
30
  "type": "guideline",
60
- "content": "The offset is the distance between the end of the tip and the target."
31
+ "content": "Warmup and cooldown.\n\nThe warmup period is a global timer that requires the cursor to remain on a UI element for the allotted time before a tooltip appears. Once this period is complete, a tooltip appears instantly on any hovered-upon UI element until the cursor is in an area that does not trigger a tooltip for the duration of the cooldown period."
61
32
  },
62
33
  {
63
34
  "type": "guideline",
64
- "content": "To make sure that the tooltip will stay within certain boundaries (e.g., a browser window) it’s possible to define a container and a container padding value to respect."
35
+ "content": "Use tooltips to describe icons.\n\nIcons are not always easy to identify on their own. When you use components that don't have labels — for example, icon-only action buttons and tabs — make sure to use tooltips to provide context for the icons."
65
36
  },
66
37
  {
67
- "type": "guideline",
68
- "content": "When the label is too long for the available horizontal space, it wraps to form another line."
38
+ "type": "do-dont",
39
+ "content": "Don't use tooltips to communicate crucial information",
40
+ "dont": "Show crucial information at all times, not just when a tooltip is displayed. A tooltip should only be used to provide supplementary context or hints to the message shown in help text. For example, in a scenario where a user is entering their password into a field, the crucial information would be to state the password requirements. Supplementary context would be a message about how to get help if they have forgotten their password."
69
41
  },
70
42
  {
71
43
  "type": "guideline",
72
- "content": "A tooltip fades in and out when showing and hiding, and slides a short distance from the source to indicate its origin. The direction of the slide (left, right, top, bottom) depends on the placement of the tooltip. The animation attributes (duration, easing, offset) are the same whether it’s showing or hiding."
44
+ "content": "Be concise.\n\nTooltips should be as concise and clear as possible. Keep the text to 1 or 2 short sentences. If the information you need to communicate is longer than that, look into using a different design. If a tooltip is written in a full sentence (or is 2 or more sentences), include a period at the end. If it's a short phrase or is only the name of a tool, action, or icon, don't add a period to the end."
73
45
  },
74
46
  {
75
- "type": "guideline",
76
- "content": "Tooltips attached to help icons appear immediately. For conventional UI elements where a tooltip appearing immediately would be intrusive, delay appearance with a warmup period."
47
+ "type": "do-dont",
48
+ "content": "Don't place actions inside a tooltip",
49
+ "dont": "Tooltips appear only on hover or when in keyboard focus. They should not contain actions or links."
77
50
  },
78
51
  {
79
52
  "type": "guideline",
80
- "content": "The warmup period is a global timer that requires the cursor to remain on a UI element for the allotted time before a tooltip appears. Once this period is complete, a tooltip appears instantly on any hovered-upon UI element until the cursor is in an area that does not trigger a tooltip for the duration of the cooldown period."
53
+ "content": "RTL.\n\nFor RTL (right-to-left) languages, the layout of the tooltip is mirrored. The icon is placed on the right side of the text."
81
54
  },
82
55
  {
83
56
  "type": "guideline",
84
- "content": "Icons are not always easy to identify on their own. When you use components that don’t have labels — for example, icon-only action buttons and tabs — make sure to use tooltips to provide context for the icons."
57
+ "content": "Keyboard interactions.\n\nKey Interaction Tab Tabbing into an item that has a tooltip associated with it (e.g., an icon) shows the tooltip. Esc Hides the tooltip."
85
58
  },
86
59
  {
87
60
  "type": "guideline",
88
- "content": "For example, in a scenario where a user is entering their password into a field, the crucial information would be to state the password requirements. Supplementary context would be a message about how to get help if they have forgotten their password."
61
+ "content": "Cursor guidelines.\n\nCursor Usage Pointer If the trigger is a button or link, or a focus-only element (like an info icon that shows a tooltip on hover), use the pointer cursor. Default (Arrow) If the trigger is an icon that is not clickable, use the default cursor. Pointer If the tooltip has a link, use the pointer cursor when interacting with the link."
89
62
  },
90
63
  {
91
64
  "type": "guideline",
92
- "content": "Tooltips should be as concise and clear as possible. Keep the text to 1 or 2 short sentences. If the information you need to communicate is longer than that, look into using a different design."
93
- },
65
+ "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 A Non‑text elements—such as icons used in tooltips and icons that trigger tooltips—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, AAA Tooltips 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 A Color is never used as the sole way to convey meaning in tooltips. Tooltips use color to reinforce their meaning, but every tooltip also includes a clear text label that communicates purpose. Text contrast minimums 1.4.3 AA Large 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 AA Tooltips should be built in such a way that they can be resized without assistive technology up to 200%. Visual presentation 1.4.8 AAA The 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 AA The visual presentation of icons and various states have a contrast ratio of at least 3:1. Text spacing 1.4.12 AA Line height of text is at least 1.5x the font size in wrapped tooltips. 2. Operable Requirement Criterion Level Compliance Keyboard 2.1.1, 2.1.3 A, AAA All functionality of the component is operable through a keyboard without specific timing for keystrokes. Keyboard traps 2.1.2 A Focus 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, AAA There is no flashing content or unnecessary motion or animation in this component. Focus order 2.4.3 A Navigation sequences receive focus in an order that preserves meaning and operability. Focus visible 2.4.7 AA Keyboard states use an indicator that is visible with at least 3:1 contrast."
66
+ }
67
+ ],
68
+ "implementations": [
94
69
  {
95
- "type": "guideline",
96
- "content": "If a tooltip is written in a full sentence (or is 2 or more sentences), include a period at the end. If it's a short phrase or is only the name of a tool, action, or icon, don't add a period to the end."
70
+ "platform": "web",
71
+ "componentName": "Tooltip",
72
+ "package": "@react-spectrum/s2"
97
73
  },
98
74
  {
99
- "type": "guideline",
100
- "content": "Tooltips appear only on hover or when in keyboard focus. They should not contain actions or links."
75
+ "platform": "web",
76
+ "componentName": "Tooltip",
77
+ "importPath": "@adobe/spectrum-wc/components/tooltip",
78
+ "notes": "Spectrum 2 web component custom element: swc-tooltip."
101
79
  }
102
80
  ],
103
81
  "options": {
104
- "label": {
105
- "type": "string"
106
- },
82
+ "label": { "type": "string" },
107
83
  "variant": {
108
84
  "type": "string",
109
85
  "default": "neutral",
110
86
  "values": [
111
- {
112
- "value": "neutral"
113
- },
114
- {
115
- "value": "informative"
116
- },
117
- {
118
- "value": "negative"
119
- }
87
+ { "value": "neutral" },
88
+ { "value": "informative" },
89
+ { "value": "negative" }
120
90
  ]
121
91
  },
122
92
  "hasIcon": {
@@ -133,24 +103,13 @@
133
103
  "type": "string",
134
104
  "default": "top",
135
105
  "values": [
136
- {
137
- "value": "top"
138
- },
139
- {
140
- "value": "bottom"
141
- },
142
- {
143
- "value": "left"
144
- },
145
- {
146
- "value": "right"
147
- }
106
+ { "value": "top" },
107
+ { "value": "bottom" },
108
+ { "value": "left" },
109
+ { "value": "right" }
148
110
  ]
149
111
  },
150
- "shouldFlip": {
151
- "type": "boolean",
152
- "default": false
153
- },
112
+ "shouldFlip": { "type": "boolean", "default": false },
154
113
  "offset": {
155
114
  "type": "number",
156
115
  "default": 4,
@@ -162,9 +121,7 @@
162
121
  "description": "units: pixels"
163
122
  }
164
123
  },
165
- "lifecycle": {
166
- "introduced": "1.0.0-draft"
167
- },
124
+ "lifecycle": { "introduced": "1.0.0-draft" },
168
125
  "accessibility": {
169
126
  "role": "tooltip",
170
127
  "focusable": false,
@@ -174,11 +131,7 @@
174
131
  "level": "AA",
175
132
  "title": "Content on Hover or Focus"
176
133
  },
177
- {
178
- "criterion": "4.1.2",
179
- "level": "A",
180
- "title": "Name, Role, Value"
181
- }
134
+ { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
182
135
  ]
183
136
  }
184
137
  }