@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.
Files changed (136) hide show
  1. package/components/accordion.json +67 -15
  2. package/components/action-bar.json +30 -9
  3. package/components/action-button.json +92 -39
  4. package/components/action-group.json +137 -18
  5. package/components/alert-banner.json +27 -8
  6. package/components/alert-dialog.json +55 -34
  7. package/components/avatar-group.json +35 -9
  8. package/components/avatar.json +105 -29
  9. package/components/badge.json +163 -56
  10. package/components/breadcrumbs.json +107 -26
  11. package/components/button-group.json +63 -19
  12. package/components/button.json +105 -61
  13. package/components/calendar.json +74 -8
  14. package/components/card.json +13 -0
  15. package/components/cards.json +46 -31
  16. package/components/checkbox-group.json +85 -16
  17. package/components/checkbox.json +97 -27
  18. package/components/close-button.json +75 -20
  19. package/components/coach-indicator.json +44 -14
  20. package/components/coach-mark.json +26 -8
  21. package/components/color-area.json +100 -20
  22. package/components/color-handle.json +46 -25
  23. package/components/color-loupe.json +14 -2
  24. package/components/color-slider.json +129 -26
  25. package/components/color-wheel.json +91 -17
  26. package/components/combo-box.json +189 -50
  27. package/components/contextual-help.json +126 -80
  28. package/components/date-field.json +7 -0
  29. package/components/date-picker.json +127 -24
  30. package/components/divider.json +38 -12
  31. package/components/drop-zone.json +37 -18
  32. package/components/field-label.json +62 -21
  33. package/components/heading.json +7 -0
  34. package/components/help-text.json +53 -16
  35. package/components/illustrated-message.json +85 -21
  36. package/components/in-line-alert.json +53 -13
  37. package/components/link.json +63 -24
  38. package/components/list-view.json +80 -15
  39. package/components/menu.json +181 -45
  40. package/components/meter.json +78 -24
  41. package/components/number-field.json +175 -34
  42. package/components/picker.json +188 -42
  43. package/components/popover.json +126 -37
  44. package/components/progress-bar.json +108 -23
  45. package/components/progress-circle.json +55 -12
  46. package/components/radio-button.json +67 -14
  47. package/components/radio-group.json +132 -28
  48. package/components/rating.json +38 -9
  49. package/components/search-field.json +126 -34
  50. package/components/segmented-control.json +70 -21
  51. package/components/select-box.json +103 -29
  52. package/components/side-navigation.json +69 -28
  53. package/components/slider.json +155 -39
  54. package/components/standard-dialog.json +88 -16
  55. package/components/status-light.json +136 -41
  56. package/components/steplist.json +24 -5
  57. package/components/swatch-group.json +55 -19
  58. package/components/swatch.json +79 -24
  59. package/components/switch.json +79 -31
  60. package/components/table.json +73 -26
  61. package/components/tabs.json +52 -22
  62. package/components/tag-field.json +60 -14
  63. package/components/tag-group.json +56 -16
  64. package/components/tag.json +78 -21
  65. package/components/takeover-dialog.json +61 -10
  66. package/components/text-area.json +205 -49
  67. package/components/text-field.json +170 -42
  68. package/components/thumbnail.json +63 -22
  69. package/components/time-field.json +7 -0
  70. package/components/toast.json +50 -29
  71. package/components/tooltip.json +87 -27
  72. package/components/tree-view.json +147 -45
  73. package/components/user-card.json +7 -0
  74. package/guidelines/app-frame-overview.json +44 -46
  75. package/guidelines/attention-hierarchy.json +22 -13
  76. package/guidelines/background-layers.json +10 -80
  77. package/guidelines/brand.json +12 -32
  78. package/guidelines/colors.json +17 -47
  79. package/guidelines/developer-overview.json +9 -25
  80. package/guidelines/faqs.json +9 -96
  81. package/guidelines/fonts.json +14 -29
  82. package/guidelines/grays.json +44 -17
  83. package/guidelines/icon-fundamentals.json +18 -7
  84. package/guidelines/manifest.json +15 -367
  85. package/guidelines/motion.json +16 -17
  86. package/guidelines/principles.json +8 -7
  87. package/guidelines/resources.json +15 -21
  88. package/guidelines/states.json +11 -16
  89. package/guidelines/using-icons.json +44 -33
  90. package/package.json +2 -2
  91. package/registry/platform-implementations.json +30 -0
  92. package/guidelines/ai-resource-guide.json +0 -50
  93. package/guidelines/applying-the-type-system.json +0 -67
  94. package/guidelines/bi-directionality.json +0 -57
  95. package/guidelines/border-width.json +0 -58
  96. package/guidelines/cognitive.json +0 -197
  97. package/guidelines/component-spacing.json +0 -61
  98. package/guidelines/contact-us.json +0 -67
  99. package/guidelines/content-area-browsing-context.json +0 -65
  100. package/guidelines/content-design-grammar-and-mechanics.json +0 -241
  101. package/guidelines/content-design-voice-and-tone.json +0 -37
  102. package/guidelines/content-grammar-and-mechanics.json +0 -252
  103. package/guidelines/content-language-and-inclusivity-writing-about-people.json +0 -103
  104. package/guidelines/content-language-and-inclusivity-writing-with-visuals.json +0 -70
  105. package/guidelines/content-voice-and-tone.json +0 -47
  106. package/guidelines/creating-bluelines-browsing-context.json +0 -91
  107. package/guidelines/design-tokens.json +0 -158
  108. package/guidelines/drop-shadow.json +0 -68
  109. package/guidelines/grammar-and-mechanics.json +0 -252
  110. package/guidelines/header-browsing-context.json +0 -40
  111. package/guidelines/illustration.json +0 -105
  112. package/guidelines/in-product-word-list.json +0 -29
  113. package/guidelines/inclusive-design.json +0 -101
  114. package/guidelines/inclusive-ux-writing.json +0 -30
  115. package/guidelines/internationalization.json +0 -87
  116. package/guidelines/language-and-inclusivity-writing-about-people.json +0 -85
  117. package/guidelines/language-and-inclusivity-writing-with-visuals.json +0 -61
  118. package/guidelines/layout-and-structure-containers.json +0 -47
  119. package/guidelines/layout-and-structure-spacing-overview.json +0 -66
  120. package/guidelines/layout-spacing.json +0 -39
  121. package/guidelines/object-styles-overview.json +0 -17
  122. package/guidelines/rounding.json +0 -73
  123. package/guidelines/side-navigation-browsing-context.json +0 -74
  124. package/guidelines/spacing-overview.json +0 -45
  125. package/guidelines/support.json +0 -113
  126. package/guidelines/typography-overview.json +0 -43
  127. package/guidelines/typography-system.json +0 -208
  128. package/guidelines/visual-language-containers.json +0 -36
  129. package/guidelines/voice-and-tone.json +0 -47
  130. package/guidelines/whats-new.json +0 -32
  131. package/guidelines/writing-about-people.json +0 -103
  132. package/guidelines/writing-for-errors.json +0 -120
  133. package/guidelines/writing-for-onboarding.json +0 -119
  134. package/guidelines/writing-for-readability.json +0 -54
  135. package/guidelines/writing-with-visuals.json +0 -70
  136. package/registry/platform-extensions/web-components-states.json +0 -58
@@ -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": "Keyboard focus.\n\nA switch can be navigated using a keyboard. The keyboard focus state takes the switch's visual hover state and adds a blue ring to the switch in focus."
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": "Text overflow.\n\nWhen the label is too long for the horizontal space available, it wraps to form another line."
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": "When to use an emphasized switch?\n\nEmphasized switches are optimal for forms, settings, and other scenarios where the switches need to be noticed. Not emphasized switches are optimal for application panels where all the visual components are monochrome in order to direct focus to the canvas."
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": "When to use a standalone switch?\n\nStandalone switches should be used in situations where the context is clear without an associated text label. For example, a switch located at the top of a panel next to the panel's title makes it clear that the switch will enable/disable the panel options."
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": "Switch, checkbox or radio button?\n\nSwitches are best for communicating activation (e.g., turning a setting on or off). Checkboxes are best for communicating selection (e.g., selecting multiple items from a list). Radio buttons are best when only one option can be selected at a time from a set (e.g., choosing one preference or mode)."
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": "Representing mixed values.\n\nWhen a switch represents multiple values that are not identical, the switch should appear as not selected. Any subsequent click or tap should select the switch, and update all values to be selected. Another click or tap after that should deselect the switch, and update all values to be not selected."
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": "No partial state.\n\nSwitches can only be on or off. Indeterminate switches don't exist in accessibility APIs, so it's not possible to make an indeterminate switch accessible. If you need to show a partial state, use a checkbox instead of a switch. When a parent switch represents a group of switches, it should be turned off unless all of the switches are on (turning the parent switch on turns all of the switches on)."
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": "Consider if the label should use a verb or a noun.\n\nA switch shows a state of persistence for something — a noun or a proper noun — as either being \"on\" or \"off.\" A verb isn't usually needed to communicate the thing being turned on or off, but there can be instances where phrasing the label as a verb can aid in clarity. Just try to keep switches consistently using either verbs or nouns if you have more than one of them in a single view."
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": "Avoid using verb phrases related to a state of activity.\n\nAvoid using verb phrases related to activity states in a switch label, such as \"turn on\" or \"turn off.\" A switch is naturally either in a state of being on or off — active or inactive — so repeating in the label that something is \"on\" or \"off\" is redundant and clutters an interface."
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": "Use a neutral tone.\n\nBecause switches are used for controls and utility, their labels are written in a neutral, utilitarian way. There's no need for overly celebratory language."
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": "Use \"you\" or \"your\" if needed to refer to the user directly.\n\nDescribe switches objectively by using only the names of features or settings, or what those features and settings will do. In the case where it's necessary to refer to a user directly, do so sparingly and use the second person \"you/your.\" We aim to be conversational and talk to the user — not as them."
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": "Use sentence case.\n\nFollowing Adobe's UX writing style, labels for switches are written in sentence case unless they contain words that are branded terms."
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": "RTL.\n\nFor RTL (right-to-left) languages, the layout of the switch is mirrored. The track is placed on the right side of the text and the handle is positioned to the left when the switch is turned on."
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": "Keyboard interactions.\n\nKey Interaction TabMoves focus to the next item or group of items.Shift + TabMoves focus to the previous item or group of items.Space or EnterToggles the switch between on and off."
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": "Cursor guidelines.\n\nCursor Description PointerUse the pointer cursor for interactive elements in all states."
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": "WCAG 2.2 compliance.\n\nAny criterion not mention in the below table are not applicable to this component or are resolved with underlying requirements, engineering, and styles of the entire system. 1. Perceivable Requirement Criterion Level Compliance Info and relationships, Identify purpose 1.3.1, 1.3.6 A, AAASwitches should be understandable by assistive technologies like screen readers. This means the proper semantic HTML or ARIA role should be utilized.Use of color 1.4.1 ASwitches never rely on color alone to convey meaning. The active state uses blue to reinforce “on,” and the handle shifts position to clearly show whether the switch is on or off.Text contrast minimums 1.4.3 AALarge text has a contrast ratio of at least 3:1, and small text has a contrast ratio of at least 4.5:1. Incidental text such as disabled, hidden, or decorative text has no contrast requirement.Resize text 1.4.4 AASwitches should be built in such a way that they can be resized without assistive technology up to 200%.Non-text contrast 1.4.11 AAThe visual presentation of icons and various states have a contrast ratio of at least 3:1.Text spacing 1.4.12 AALine height of text is at least 1.5x the font size when the label is wrapped. 2. Operable RequirementCriterionLevel Compliance Keyboard 2.1.1, 2.1.3 A, AAAAll functionality of the component is operable through a keyboard without specific timing for keystrokes.Keyboard traps 2.1.2 AFocus can be moved away from the component using only a keyboard.Seizures and physical reactions 2.3.1, 2.3.2, 2.3.3 A, AAA, AAAThere is no flashing content or unnecessary motion or animation in this component.Focus order 2.4.3 ANavigation sequences receive focus in an order that preserves meaning and operability.Focus visible 2.4.7 AAKeyboard states use an indicator that is visible with at least 3:1 contrast."
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": { "type": "string" },
84
- "isSelected": { "type": "boolean", "default": false },
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
- { "value": "s" },
90
- { "value": "m" },
91
- { "value": "l" },
92
- { "value": "xl" }
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": { "type": "boolean", "default": false },
96
- "isDisabled": { "type": "boolean", "default": false },
97
- "isReadOnly": { "type": "boolean", "default": false }
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
- { "name": "hover", "trigger": "interaction" },
101
- { "name": "down", "trigger": "interaction" },
102
- { "name": "keyboard-focus", "trigger": "interaction" }
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": { "introduced": "1.0.0-draft" },
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
- { "criterion": "2.1.1", "level": "A", "title": "Keyboard" },
112
- { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
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
  }
@@ -16,64 +16,79 @@
16
16
  },
17
17
  {
18
18
  "type": "guideline",
19
- "content": "Standard vs. quiet.\n\nUse 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."
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": "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."
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": "Selection.\n\nBy default, rows are not selectable. Enable selection with selectionMode=single or selectionMode=multiple. Checkbox selection (default): Checkboxes appear on the left. Clicking toggles selection. Use for bulk actions or when selection should be explicit. Highlight selection: No checkboxes—rows show a highlighted background when selected. Clicking a row selects it (use modifier keys for multi-select). Use when rows also need to support navigation or actions via onAction or href, or when a cleaner appearance is needed. Navigation: Use onAction for row actions or href for links. In highlight selection style, double-click performs actions while single-click selects, allowing both behaviors."
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": "Hover state.\n\nAll 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."
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": "Start-align textual data.\n\nSimilar 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."
43
+ "content": "If true, table columns can be sorted."
36
44
  },
37
45
  {
38
46
  "type": "guideline",
39
- "content": "Right align numerical data.\n\nNumerical data should generally be right-aligned for ease of scanning and comparing. This alignment typically does NOT reverse in RTL languages because: Numbers are written left-to-right even in RTL languages (e.g., Arabic numerals) Right-alignment ensures decimal places and digits line up vertically for comparison 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. Column headers follow the alignment of their data."
47
+ "content": "An array of column definitions for the table."
40
48
  },
41
49
  {
42
50
  "type": "guideline",
43
- "content": "Use tabular numbers for numerical data.\n\nWhen users need to compare numerical values, use tabular (monospaced) and lining (not old style) numbers to make it easier. These features are supported by Adobe Clean via the OpenType panel in Illustrator or via the CSS font feature settings."
51
+ "content": "An array of row data for the table."
44
52
  },
45
53
  {
46
54
  "type": "guideline",
47
- "content": "Respect vertical alignment.\n\nAll content should be centered vertically within the row to offer the right visual balance."
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": "do-dont",
51
- "content": "Don't use zebra stripes",
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": "Use column dividers sparingly.\n\nColumn 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."
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": "Use an en dash (–) for missing values.\n\nWhen there are gaps in the data, use an en dash (–) to represent null or not applicable (N/A) values."
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": "RTL.\n\nIn right‑to‑left languages, the table layout is mirrored. The columns run from right to left, and the text alignment within each column is reversed. Keep in mind that some content, such as file extensions and email addresses, does not change direction or translate."
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": "Keyboard interactions.\n\nKey Interaction TabTabbing into an item that has a tooltip associated with it (e.g., an icon) shows the tooltip.EscHides the tooltip."
75
+ "content": "Column headers follow the alignment of their data."
69
76
  },
70
77
  {
71
78
  "type": "guideline",
72
- "content": "Cursor guidelines.\n\nCursor Description PointerIf 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.PointerIf the tooltip has a link, use the pointer cursor when interacting with the link."
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": "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 content1.1.1ANon‑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 purpose1.3.1, 1.3.6A, AAATooltips should be understandable by assistive technologies like screen readers. This means using the proper semantic HTML or ARIA role should be utilized.Use of color1.4.1AColor 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 minimums1.4.3AALarge 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 text1.4.4AATooltips should be built in such a way that they can be resized without assistive technology up to 200%.Visual presentation1.4.8AAAThe width of text blocks is no more than 80 characters (40 for CJK languages), and text is never justified.Non-text contrast1.4.11AAThe visual presentation of icons and various states have a contrast ratio of at least 3:1.Text spacing1.4.12AALine height of text is at least 1.5x the font size in wrapped tooltips. 2. Operable RequirementCriterionLevel Compliance Keyboard 2.1.1, 2.1.3 A, AAAAll functionality of the component is operable through a keyboard without specific timing for keystrokes.Keyboard traps 2.1.2 AFocus can be moved away from the component using only a keyboard.Seizures and physical reactions 2.3.1, 2.3.2, 2.3.3 A, AAA, AAAThere is no flashing content or unnecessary motion or animation in this component.Focus order 2.4.3 ANavigation sequences receive focus in an order that preserves meaning and operability.Focus visible 2.4.7 AAKeyboard states use an indicator that is visible with at least 3:1 contrast."
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": [{ "value": "s" }, { "value": "m" }, { "value": "l" }]
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
- { "value": "compact" },
114
- { "value": "regular" },
115
- { "value": "spacious" }
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
- { "name": "section-header" }
243
+ {
244
+ "name": "section-header"
245
+ }
213
246
  ],
214
- "lifecycle": { "introduced": "1.0.0-draft" },
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
- { "criterion": "1.3.1", "level": "A", "title": "Info and Relationships" },
222
- { "criterion": "2.1.1", "level": "A", "title": "Keyboard" },
223
- { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
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
  }
@@ -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": "Animation.\n\nWhen 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."
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": "Tab overflow.\n\nWhen 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."
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": "Too many tabs.\n\nWhen 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."
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": "Nested tabs.\n\nAvoid 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. Do not compromise hierarchy by using the same tab variations or orientations."
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": "Use icons consistently.\n\nDon'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."
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": "Use tooltips for icon only tabs.\n\nIt 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."
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": "RTL horizontal tabs.\n\nFor RTL (right-to-left) languages, the layout of the horizontal tabs is mirrored. The tabs are right-aligned and their order is reverse."
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": "RTL vertical tabs.\n\nFor RTL (right-to-left) languages, the layout of the vertical tabs is mirrored. The divider and selection indicator should be placed on the right, as they are meant to visually anchor the text labels."
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": "Keyboard interactions.\n\nThere are two possible behaviors for manipulating tabs with the keyboard: manual or automatic activation. Typically, manual activation of tabs is only necessary when content cannot be displayed instantly (i.e., not all the panel content is present in the DOM.) For additional guidance, see Deciding When to Make Selection Automatically Follow Focus. Option 1: Manual activation Key Interaction TabMoves focus into the tabs component and places focus on the selected tab item. If the tabs component is already in focus, moves focus to the next element in the page tab sequence.Left ArrowMoves focus to the previous tab item. If focus is on the first tab item, moves focus to the last tab item.Right ArrowMoves focus to the next tab item. If focus is on the last tab item, moves focus to the first tab item.Space or EnterActivates the tab item in focus.Home (optional)Moves focus to the first tab item.End (optional)Moves focus to the last tab item.Delete (optional)When deletion is allowed, Delete closes the currently activated tab item. If any tab items remain, moves focus to the tab item following one that was closed. Option 2: Automatic activation Key Interaction TabMoves focus into the tabs component and places focus on the selected tab item. If the tabs component is already in focus, moves focus to the next element in the page tab sequence.Left ArrowMoves focus to the previous tab item and automatically activates it. If focus is on the first tab item, moves focus to the last tab item.Right ArrowMoves focus to the next tab item and automatically activates it. If focus is on the last tab item, moves focus to the first tab item.Home (optional)Moves focus to the first tab item and automatically activates it.End (optional)Moves focus to the last tab item and automatically activates it.Delete (optional)When deletion is allowed, Delete closes the currently activated tab item. If any tab items remain, moves focus to and activates the tab item following one that was closed."
64
+ "content": "Do not compromise hierarchy by using the same tab variations or orientations."
57
65
  },
58
66
  {
59
67
  "type": "guideline",
60
- "content": "Cursor guidelines.\n\nCursor Usage PointerUse the pointer cursor for interactive elements including tabs."
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": "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 tabs, must provide a text alternative that communicates the tab's purpose. All tabs, especially icon-only tabs, 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, AAATabs should be understandable by assistive technologies like screen readers. This means the proper semantic HTML or ARIA role should be utilized.Orientation 1.3.4 AATabs are available in both vertical and horizontal orientations.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.Resize text 1.4.4 AATabs should be built in such a way that they can be resized without assistive technology up to 200%.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 icons and various states have a contrast ratio of at least 3:1.Text spacing 1.4.12 AALine height of text is at least 1.5x the font size. 2. Operable RequirementCriterionLevel Compliance Keyboard 2.1.1, 2.1.3 A, AAAAll functionality of the component is operable through a keyboard without specific timing for keystrokes.Keyboard traps 2.1.2 AFocus can be moved away from the component using only a keyboard.Seizures and physical reactions 2.3.1, 2.3.2, 2.3.3 A, AAA, AAAThere is no flashing content or unnecessary motion or animation in this component.Focus order 2.4.3 ANavigation sequences receive focus in an order that preserves meaning and operability.Focus visible 2.4.7 AAKeyboard states use an indicator that is visible with at least 3:1 contrast."
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": [{ "value": "horizontal" }, { "value": "vertical" }]
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": { "type": "boolean", "default": false },
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": { "description": "(list of available items)" },
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": { "introduced": "1.0.0-draft" },
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
- { "criterion": "2.1.1", "level": "A", "title": "Keyboard" },
143
- { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
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
  }