@adobe/spectrum-design-data 3.3.0-beta.1 → 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 (135) 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-content-area.json +81 -0
  75. package/guidelines/app-frame-creating-bluelines.json +58 -0
  76. package/guidelines/app-frame-header.json +72 -0
  77. package/guidelines/app-frame-overview.json +50 -44
  78. package/guidelines/app-frame-side-navigation.json +138 -0
  79. package/guidelines/attention-hierarchy.json +21 -12
  80. package/guidelines/background-layers.json +10 -44
  81. package/guidelines/brand.json +10 -30
  82. package/guidelines/colors.json +17 -35
  83. package/guidelines/containers.json +62 -0
  84. package/guidelines/developer-overview.json +9 -25
  85. package/guidelines/faqs.json +9 -96
  86. package/guidelines/fonts.json +14 -29
  87. package/guidelines/grays.json +44 -17
  88. package/guidelines/icon-fundamentals.json +18 -7
  89. package/guidelines/illustrations.json +111 -0
  90. package/guidelines/introduction.json +2 -2
  91. package/guidelines/manifest.json +60 -252
  92. package/guidelines/motion.json +16 -17
  93. package/guidelines/object-styles.json +102 -0
  94. package/guidelines/principles.json +2 -2
  95. package/guidelines/resources.json +15 -21
  96. package/guidelines/spacing.json +25 -0
  97. package/guidelines/states.json +10 -15
  98. package/guidelines/typography-fundamentals.json +142 -0
  99. package/guidelines/using-icons.json +44 -33
  100. package/package.json +2 -2
  101. package/registry/platform-implementations.json +30 -0
  102. package/guidelines/ai-resource-guide.json +0 -50
  103. package/guidelines/applying-the-type-system.json +0 -63
  104. package/guidelines/bi-directionality.json +0 -57
  105. package/guidelines/border-width.json +0 -42
  106. package/guidelines/cognitive.json +0 -197
  107. package/guidelines/component-spacing.json +0 -49
  108. package/guidelines/contact-us.json +0 -67
  109. package/guidelines/content-area-browsing-context.json +0 -65
  110. package/guidelines/creating-bluelines-browsing-context.json +0 -91
  111. package/guidelines/design-tokens.json +0 -122
  112. package/guidelines/drop-shadow.json +0 -56
  113. package/guidelines/grammar-and-mechanics.json +0 -252
  114. package/guidelines/header-browsing-context.json +0 -37
  115. package/guidelines/illustration.json +0 -109
  116. package/guidelines/in-product-word-list.json +0 -29
  117. package/guidelines/inclusive-design.json +0 -93
  118. package/guidelines/inclusive-ux-writing.json +0 -30
  119. package/guidelines/internationalization.json +0 -87
  120. package/guidelines/layout-and-structure-containers.json +0 -47
  121. package/guidelines/layout-spacing.json +0 -39
  122. package/guidelines/object-styles-overview.json +0 -17
  123. package/guidelines/rounding.json +0 -61
  124. package/guidelines/side-navigation-browsing-context.json +0 -71
  125. package/guidelines/spacing-overview.json +0 -45
  126. package/guidelines/typography-overview.json +0 -39
  127. package/guidelines/typography-system.json +0 -168
  128. package/guidelines/visual-language-containers.json +0 -36
  129. package/guidelines/voice-and-tone.json +0 -47
  130. package/guidelines/writing-about-people.json +0 -103
  131. package/guidelines/writing-for-errors.json +0 -120
  132. package/guidelines/writing-for-onboarding.json +0 -119
  133. package/guidelines/writing-for-readability.json +0 -54
  134. package/guidelines/writing-with-visuals.json +0 -70
  135. package/registry/platform-extensions/web-components-states.json +0 -58
@@ -16,62 +16,55 @@
16
16
  },
17
17
  {
18
18
  "type": "guideline",
19
- "content": "Card component Purpose / use case Interaction type Common visual elements FlexGeneral-purpose, flexible content containerVaries (Static or Clickable)Title, preview, checkboxAssetDisplay assets like images, text documents, files, videos, materials, etc.Clickable (navigates to 1-up view), selectablePreview, filename, metadata, checkboxGalleryShow multiple images or videos in a river grid.Clickable (navigates to 1-up view), selectablePreview, badge, checkboxCollectionGroup related items such as assets or products in a library of items.Clickable (drill-in), selectablemulti or hero multi previews, collection title, checkboxProductDisplay product details for interactionClickable (drill-in), selectableCover image, thumbnail (logo), product title, checkboxHorizontalDisplaying mostly text, possibly with a cropped cover image or icon.Clickable (drill-in)Optional cropped preview, icon, or thumbnail, title, metadata"
19
+ "content": "Cards group related content and actions into flexible containers for browsing. They preview key information and reveal more detail on interaction."
20
20
  },
21
21
  {
22
22
  "type": "guideline",
23
- "content": "Preview minimum and maximum.\n\nCard preview areas have a maximum image height aspect ratio of 3:4, and a minimum height aspect ratio of of 4:1."
23
+ "content": "Card preview areas have a maximum image height aspect ratio of 3:4, and a minimum height aspect ratio of of 4:1."
24
24
  },
25
25
  {
26
26
  "type": "guideline",
27
- "content": "Text overflow.\n\nIf the card has a fixed height, such as in a tile grid, long titles will be truncated. Use short titles to avoid this. In layouts with variable height, like a waterfall grid, titles will wrap to fit."
27
+ "content": "If the card has a fixed height, such as in a tile grid, long titles will be truncated. Use short titles to avoid this. In layouts with variable height, like a waterfall grid, titles will wrap to fit."
28
28
  },
29
29
  {
30
30
  "type": "guideline",
31
- "content": "Clickable cards.\n\nCards, by definition, should have some form of interaction such as viewing, editing, purchasing, etc. Some actions are exposed in buttons, and others simply occur by clicking the card. If a card only has an ability to be opened or viewed in more detail, do not include a button. Clicking anywhere on the card should perform that action. If a card has other interactive elements such as a hidden actions menu or an avatar, but no buttons, the whole card (outside of those elements) should be clickable."
31
+ "content": "Cards, by definition, should have some form of interaction such as viewing, editing, purchasing, etc. Some actions are exposed in buttons, and others simply occur by clicking the card."
32
32
  },
33
33
  {
34
34
  "type": "guideline",
35
- "content": "Buttons in cards.\n\nIf there's only one action (that's not opening or viewing the card), use a button to communicate that action. If there are two or more available actions, and one of those actions is to open or view the card, use a button to communicate \"View\" or \"Open,\" instead of relying on clicking on the card. If a standard card has a footer with a button, only the button is clickable. If a card has a preview, clicking the preview will open that card. When a preview is purely decorative, it is not clickable."
35
+ "content": "If a card only has an ability to be opened or viewed in more detail, do not include a button. Clicking anywhere on the card should perform that action."
36
36
  },
37
37
  {
38
38
  "type": "guideline",
39
- "content": "Ghost loading.\n\nWhen a group of cards are loading, they follow the ghost loading convention. There are 5 phases for ghost loading: Card group (including metadata) ghost loads. If metadata for all cards is loaded before all preview images are loaded, the metadata is displayed for all cards as soon as the last piece of metadata loads. Previews continue to ghost load. If all preview images load within the x period (a period of time, usually measured in seconds, that you need to specify depending on the use case), they are shown as soon as the last preview loads. If all previews have not finished loading at the end of the x period, the loaded previews are shown, and the pending previews receive individual circle loaders. The group is no longer in a ghost loading state. If the preview load times out, an error is shown along with a mechanism to retry loading."
39
+ "content": "If a card has other interactive elements such as a hidden actions menu or an avatar, but no buttons, the whole card (outside of those elements) should be clickable."
40
40
  },
41
41
  {
42
42
  "type": "guideline",
43
- "content": "Keep cards simple.\n\nCards are meant to just show a taste of the available information. Don't overload cards with more information than necessary."
43
+ "content": "If there’s only one action (that’s not opening or viewing the card), use a button to communicate that action. If there are two or more available actions, and one of those actions is to open or view the card, use a button to communicate “View” or “Open,” instead of relying on clicking on the card."
44
44
  },
45
45
  {
46
- "type": "do-dont",
47
- "content": "Don't add buttons to quiet cards",
48
- "dont": "Only standard cards can have a footer, and buttons can only appear inside a footer."
49
- },
50
- {
51
- "type": "do-dont",
52
- "content": "Don't align individual cards to the column grid",
53
- "dont": "Individual cards are not aligned to individual columns in the page's responsive column grid. Instead, groups of cards are aligned to the column grid in a layout region."
46
+ "type": "guideline",
47
+ "content": "If a standard card has a footer with a button, only the button is clickable. If a card has a preview, clicking the preview will open that card. When a preview is purely decorative, it is not clickable."
54
48
  },
55
49
  {
56
- "type": "do-dont",
57
- "content": "Don't auto-play videos",
58
- "dont": "If the preview is a video clip or other moving item, do not automatically play the clip or motion. Save the movement for either when a user hovers on the card or when they click on a play button."
50
+ "type": "guideline",
51
+ "content": "When a group of cards are loading, they follow the ghost loading convention. There are 5 phases for ghost loading:"
59
52
  },
60
53
  {
61
54
  "type": "guideline",
62
- "content": "RTL.\n\nCards in RTL languages mirror their horizontal layout and directional cues, while their interaction behavior stays the same. Any element with a left‑right relationship flips. Thumbnails or avatars that appear on the left in LTR move to the right in RTL. Metadata stacks reverse order, such as an icon followed by text becoming text followed by an icon. Action areas, including overflow menus, shift from the top right of the card to the top left. Vertical layout and center‑aligned elements do not change. Most icons remain the same, but directional icons, such as arrows and chevrons, flip to match reading direction."
55
+ "content": "Cards are meant to just show a taste of the available information. Don’t overload cards with more information than necessary."
63
56
  },
64
57
  {
65
58
  "type": "guideline",
66
- "content": "Keyboard interactions.\n\nKey Interaction TabMoves focus forward to the next card.Arrow keysMoves focus within the card to focusable items within the card. If a button is included on the cards, the button should receive focus first. If there are multiple buttons, the primary or CTA button should receive focus first.Shift + TabMoves focus backward to the previous card.Return or EnterIf the card itself is clickable, Return or Enter will open the card. If the card is not clickable but has buttons, and the buttons or another item within the card is focused, that action is performed.SpaceIf the card is selectable, the space bar will toggle selection.Ctrl / Command + Arrow keysNon-contiguous selection of cards."
59
+ "content": "Only standard cards can have a footer, and buttons can only appear inside a footer."
67
60
  },
68
61
  {
69
62
  "type": "guideline",
70
- "content": "Cursor guidelines.\n\nNon-interactive cards Cursor Description Default (Arrow)Use the default cursor for non-interactive cards. Cards with interactive elements Cursor Description Default (Arrow)Use the default cursor for the non-interactive portions of the card.PointerUse the pointer cursor for the interactive elements.Grab handUse the grab hand cursor when hovering over cards that are draggable. Cards that have other interactive elements that are also draggable should first enter a drag mode before showing the grab cursors and allowing a drag action.Grab fistUse the grab fist cursor when actively dragging a card. Fully interactive cards Cursor Description PointerUse the pointer cursor for the entire card surface when the card is interactive, for example, if clicking the card will navigate to a one-up view.Grab handUse the grab hand cursor when hovering over cards that are draggable.Grab fistUse the grab fist cursor when actively dragging a card."
63
+ "content": "Individual cards are not aligned to individual columns in the page's responsive column grid. Instead, groups of cards are aligned to the column grid in a layout region."
71
64
  },
72
65
  {
73
66
  "type": "guideline",
74
- "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 or illustrations used in cards—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 AACards 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 AACards 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, indicate an action, or prompt a response. Color is always paired with text or icons, and is only used to enhance the meaning of the text.Text contrast 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.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, icons, 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."
67
+ "content": "If the preview is a video clip or other moving item, do not automatically play the clip or motion. Save the movement for either when a user hovers on the card or when they click on a play button."
75
68
  }
76
69
  ],
77
70
  "options": {
@@ -80,23 +73,45 @@
80
73
  "default": "asset",
81
74
  "description": "Determines which card layout variant is used.",
82
75
  "values": [
83
- { "value": "asset" },
84
- { "value": "collection" },
85
- { "value": "flex" },
86
- { "value": "gallery" },
87
- { "value": "horizontal" },
88
- { "value": "product" }
76
+ {
77
+ "value": "asset"
78
+ },
79
+ {
80
+ "value": "collection"
81
+ },
82
+ {
83
+ "value": "flex"
84
+ },
85
+ {
86
+ "value": "gallery"
87
+ },
88
+ {
89
+ "value": "horizontal"
90
+ },
91
+ {
92
+ "value": "product"
93
+ }
89
94
  ]
90
95
  }
91
96
  },
92
- "lifecycle": { "introduced": "1.0.0-draft" },
97
+ "lifecycle": {
98
+ "introduced": "1.0.0-draft"
99
+ },
93
100
  "accessibility": {
94
101
  "intents": ["select"],
95
102
  "focusable": true,
96
103
  "keyboardIntents": ["activate"],
97
104
  "wcag": [
98
- { "criterion": "2.1.1", "level": "A", "title": "Keyboard" },
99
- { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
105
+ {
106
+ "criterion": "2.1.1",
107
+ "level": "A",
108
+ "title": "Keyboard"
109
+ },
110
+ {
111
+ "criterion": "4.1.2",
112
+ "level": "A",
113
+ "title": "Name, Role, Value"
114
+ }
100
115
  ]
101
116
  }
102
117
  }
@@ -9,6 +9,13 @@
9
9
  "category": "inputs",
10
10
  "documentationUrl": "https://spectrum.adobe.com/page/checkbox-group/"
11
11
  },
12
+ "implementations": [
13
+ {
14
+ "platform": "web",
15
+ "componentName": "CheckboxGroup",
16
+ "package": "@react-spectrum/s2"
17
+ }
18
+ ],
12
19
  "documentBlocks": [
13
20
  {
14
21
  "type": "purpose",
@@ -16,51 +23,113 @@
16
23
  },
17
24
  {
18
25
  "type": "guideline",
19
- "content": "RTL.\n\nFor RTL (right-to-left) languages, the layout of the checkbox group (and its component parts) is mirrored. The checkmarks and icons are placed on the right side of the text, and text is aligned to the right."
26
+ "content": "When a description is present and an error is triggered, it is replaced with an error message. Once the error is resolved, the help text description reappears."
27
+ },
28
+ {
29
+ "type": "guideline",
30
+ "content": "A checkbox group in a disabled state shows that a selection exists, but is not available in that circumstance. This can be used to maintain layout continuity and communicate that an action may become available later. The field label, checkboxes, and help text are all displayed in a disabled state when the checkbox group is disabled."
31
+ },
32
+ {
33
+ "type": "guideline",
34
+ "content": "Checkbox groups can be either horizontal or vertical. By default, checkbox groups are stacked vertically. Use a horizontal checkbox group when vertical space is limited."
35
+ },
36
+ {
37
+ "type": "guideline",
38
+ "content": "Checkbox groups can be marked as optional or required, depending on the situation. Optional checkbox groups are either denoted with text added to the end of the label — “(optional)” — or have no indication at all."
39
+ },
40
+ {
41
+ "type": "guideline",
42
+ "content": "For required checkbox groups, there are two necessity indicator options: a “(required)” label or an asterisk. If you use an asterisk, be sure to include help text to explain what the asterisk means."
20
43
  },
21
44
  {
22
45
  "type": "guideline",
23
- "content": "Keyboard interactions.\n\nKey Interaction TabTabbing into a group of checkboxes places the focus on the first checkbox (only one checkbox receives the keyboard focus at a time).Shift + TabMoves focus to the previous item or group of items.Arrow keysMoves focus through the group of checkboxes.Page Up or Page DownMoves focus to the previous or next checkbox in the group (last becomes first, and first becomes last).Home or EndMoves focus to the first or last checkbox in the group.Space or EnterToggles the checkbox between selected and not selected. If the checkbox is partially selected initially, the checkbox becomes selected first (subsequent toggles alternate normally between selected and not selected)."
46
+ "content": "The asterisk used in this component is an icon that has specific spacing from the label text — not part of the label text itself."
24
47
  },
25
48
  {
26
49
  "type": "guideline",
27
- "content": "Cursor guidelines.\n\nCursor Description PointerUse the pointer cursor for interactive elements like checkboxes."
50
+ "content": "Labels can be placed either on top or on the side. Top labels are the default and are recommended because they work better with long copy, localization, and responsive layouts. Side labels are most useful when vertical space is limited."
28
51
  },
29
52
  {
30
53
  "type": "guideline",
31
- "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 the checkbox control—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, AAACheckboxes should be understandable by assistive technologies like screen readers. This means using the proper semantic HTML or ARIA role should be utilized.Orientation 1.3.4 AACheckbox groups 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, indicate an action, or prompt a response. Color is always paired with text or icons, and is only used to enhance the meaning of the text.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 AACheckboxes 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 checkbox control and its 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 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.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."
54
+ "content": "Checkbox groups should always have a label. In rare cases where context is sufficient and an accessibility expert has reviewed the design, the label could be undefined. These checkbox groups without a visible label should still include an aria-label in HTML (depending on the context, “aria-label” or “aria-labelledby”)."
32
55
  }
33
56
  ],
34
57
  "options": {
35
- "label": { "type": "string" },
58
+ "label": {
59
+ "type": "string"
60
+ },
36
61
  "labelPosition": {
37
62
  "type": "string",
38
63
  "default": "top",
39
- "values": [{ "value": "top" }, { "value": "side" }]
64
+ "values": [
65
+ {
66
+ "value": "top"
67
+ },
68
+ {
69
+ "value": "side"
70
+ }
71
+ ]
40
72
  },
41
73
  "necessityIndicator": {
42
74
  "type": "string",
43
75
  "default": "icon",
44
- "values": [{ "value": "text" }, { "value": "icon" }]
76
+ "values": [
77
+ {
78
+ "value": "text"
79
+ },
80
+ {
81
+ "value": "icon"
82
+ }
83
+ ]
84
+ },
85
+ "isRequired": {
86
+ "type": "boolean",
87
+ "default": false
45
88
  },
46
- "isRequired": { "type": "boolean", "default": false },
47
89
  "orientation": {
48
90
  "type": "string",
49
91
  "default": "vertical",
50
- "values": [{ "value": "horizontal" }, { "value": "vertical" }]
92
+ "values": [
93
+ {
94
+ "value": "horizontal"
95
+ },
96
+ {
97
+ "value": "vertical"
98
+ }
99
+ ]
51
100
  },
52
- "isError": { "type": "boolean", "default": false },
53
- "isDisabled": { "type": "boolean", "default": false },
54
- "description": { "type": "string" },
55
- "errorMessage": { "type": "string" }
101
+ "isError": {
102
+ "type": "boolean",
103
+ "default": false
104
+ },
105
+ "isDisabled": {
106
+ "type": "boolean",
107
+ "default": false
108
+ },
109
+ "description": {
110
+ "type": "string"
111
+ },
112
+ "errorMessage": {
113
+ "type": "string"
114
+ }
115
+ },
116
+ "lifecycle": {
117
+ "introduced": "1.0.0-draft"
56
118
  },
57
- "lifecycle": { "introduced": "1.0.0-draft" },
58
119
  "accessibility": {
59
120
  "intents": ["choose"],
60
121
  "focusable": false,
61
122
  "wcag": [
62
- { "criterion": "1.3.1", "level": "A", "title": "Info and Relationships" },
63
- { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
123
+ {
124
+ "criterion": "1.3.1",
125
+ "level": "A",
126
+ "title": "Info and Relationships"
127
+ },
128
+ {
129
+ "criterion": "4.1.2",
130
+ "level": "A",
131
+ "title": "Name, Role, Value"
132
+ }
64
133
  ]
65
134
  }
66
135
  }
@@ -9,6 +9,13 @@
9
9
  "category": "inputs",
10
10
  "documentationUrl": "https://spectrum.adobe.com/page/checkbox/"
11
11
  },
12
+ "implementations": [
13
+ {
14
+ "platform": "web",
15
+ "componentName": "Checkbox",
16
+ "package": "@react-spectrum/s2"
17
+ }
18
+ ],
12
19
  "documentBlocks": [
13
20
  {
14
21
  "type": "purpose",
@@ -16,51 +23,71 @@
16
23
  },
17
24
  {
18
25
  "type": "guideline",
19
- "content": "Keyboard focus.\n\nA checkbox can be navigated using a keyboard. The keyboard focus state takes the checkbox's visual hover state and adds a blue ring to the checkbox in focus."
26
+ "content": "Checkboxes support selecting one or more items from a list. Each item can be selected independently or in combination with others."
27
+ },
28
+ {
29
+ "type": "guideline",
30
+ "content": "Checkboxes can be marked as having an error to show that a selection needs to be made in order to move forward, or that a selection that was made is invalid. For example, in a form that requires a user to acknowledge legal terms before proceeding, the checkbox would show an unchecked error to communicate that it needs to be selected."
31
+ },
32
+ {
33
+ "type": "guideline",
34
+ "content": "A checkbox in a disabled state shows that a selection exists, but is not available in that circumstance. This can be used to maintain layout continuity and communicate that an action may become available later."
20
35
  },
21
36
  {
22
37
  "type": "guideline",
23
- "content": "Text overflow.\n\nWhen the label is too long for the horizontal space available, it wraps to form another line."
38
+ "content": "By default, checkboxes are not emphasized (gray). This version is optimal for when the checkbox 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."
24
39
  },
25
40
  {
26
41
  "type": "guideline",
27
- "content": "Emphasized or not?\n\nEmphasized checkboxes are optimal for forms, settings, etc. where the checkboxes need to be noticed, or to bring attention to selected items such as cards or table rows. Not emphasized checkboxes are optimal for application panels where all the visual components are monochrome in order to direct focus to the canvas."
42
+ "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 checkbox need to be noticed."
28
43
  },
29
44
  {
30
45
  "type": "guideline",
31
- "content": "When to use a standalone checkbox.\n\nStandalone checkboxes should be used in situations where the context is clear without an associated text label. An example of this would be when a checkbox is connected to other controls inside of a panel."
46
+ "content": "Checkboxes 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
47
  },
33
48
  {
34
49
  "type": "guideline",
35
- "content": "Checkbox vs. radio button.\n\nCheckboxes and radio buttons are not interchangeable. A set of checkboxes should be used to select as many options as desired (or none). A set of radio buttons should be used to select only a single option from a list of mutually exclusive options."
50
+ "content": "Checkboxes can be in an indeterminate state when they represent both selected and not selected values."
36
51
  },
37
52
  {
38
53
  "type": "guideline",
39
- "content": "Checkbox vs. switch.\n\nUse checkboxes to show selection, such as choosing multiple table rows. Use switches to show activation, like turning a setting on or off. Unlike switches, checkboxes can display an error state."
54
+ "content": "Checkboxes can be selected or not selected."
40
55
  },
41
56
  {
42
57
  "type": "guideline",
43
- "content": "Label groups of related checkboxes.\n\nSets of checkboxes should always have a clear label that describes what the list of options represents and guides users what to do. This is important for accessibility, since a screen reader will read the label before each option."
58
+ "content": "Checkboxes should always have a label. When the label is not defined, a checkbox becomes standalone. Standalone checkboxes are only used when their connection to other components is clear and they give sufficient context — for example, in application panels."
44
59
  },
45
60
  {
46
61
  "type": "guideline",
47
- "content": "Representing mixed values.\n\nWhen a checkbox represents multiple values that are not identical, the checkbox should appear in the indeterminate state. Any subsequent click or tap should select the checkbox, and update all values to be selected. Another click or tap after that should deselect the checkbox, and update all values to be not selected."
62
+ "content": "A checkbox can be navigated using a keyboard. The keyboard focus state takes the checkbox’s visual hover state and adds a blue ring to the checkbox in focus."
48
63
  },
49
64
  {
50
65
  "type": "guideline",
51
- "content": "RTL.\n\nFor RTL (right-to-left) languages, the layout of the checkbox is mirrored. The checkmark is placed on the right side of the text."
66
+ "content": "When the label is too long for the horizontal space available, it wraps to form another line."
52
67
  },
53
68
  {
54
69
  "type": "guideline",
55
- "content": "Keyboard interactions.\n\nKey Interaction TabTabbing into a group of checkboxes places the focus on the first checkbox (only one checkbox receives the keyboard focus at a time).Shift + TabMoves focus to the previous item or group of items.Space or EnterToggles the checkbox between selected and not selected. If the checkbox is partially selected initially, the checkbox becomes selected first (subsequent toggles alternate normally between selected and not selected)."
70
+ "content": "Emphasized checkboxes are optimal for forms, settings, etc. where the checkboxes need to be noticed, or to bring attention to selected items such as cards or table rows. Not emphasized checkboxes are optimal for application panels where all the visual components are monochrome in order to direct focus to the canvas."
56
71
  },
57
72
  {
58
73
  "type": "guideline",
59
- "content": "Cursor guidelines.\n\nCursor Description PointerUse the pointer cursor for all interactive components in every state."
74
+ "content": "Standalone checkboxes should be used in situations where the context is clear without an associated text label. An example of this would be when a checkbox is connected to other controls inside of a panel."
60
75
  },
61
76
  {
62
77
  "type": "guideline",
63
- "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 the checkbox control—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, AAACheckboxes should be understandable by assistive technologies like screen readers. This means using the proper semantic HTML or ARIA role should be utilized.Orientation 1.3.4 AACheckbox groups 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, indicate an action, or prompt a response. Color is always paired with text or icons, and is only used to enhance the meaning of the text.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 AACheckboxes should be built in such a way that they can be resized without assistive technology up to 200%.Visual presentation 1.4.8 AAACheckbox labels can wrap to multiple lines, so the 80-character (40 CJK) and no-justified-text guidance applies the same way it does for the group.Non-text contrast 1.4.11 AAThe checkbox control and its 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 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 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.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."
78
+ "content": "Checkboxes and radio buttons are not interchangeable. A set of checkboxes should be used to select as many options as desired (or none). A set of radio buttons should be used to select only a single option from a list of mutually exclusive options."
79
+ },
80
+ {
81
+ "type": "guideline",
82
+ "content": "Use checkboxes to show selection, such as choosing multiple table rows. Use switches to show activation, like turning a setting on or off. Unlike switches, checkboxes can display an error state."
83
+ },
84
+ {
85
+ "type": "guideline",
86
+ "content": "Sets of checkboxes should always have a clear label that describes what the list of options represents and guides users what to do. This is important for accessibility, since a screen reader will read the label before each option."
87
+ },
88
+ {
89
+ "type": "guideline",
90
+ "content": "When a checkbox represents multiple values that are not identical, the checkbox should appear in the indeterminate state. Any subsequent click or tap should select the checkbox, and update all values to be selected. Another click or tap after that should deselect the checkbox, and update all values to be not selected."
64
91
  }
65
92
  ],
66
93
  "options": {
@@ -68,7 +95,10 @@
68
95
  "type": "string",
69
96
  "description": "When the label is not defined, the checkbox appears as a standalone checkbox."
70
97
  },
71
- "isSelected": { "type": "boolean", "default": false },
98
+ "isSelected": {
99
+ "type": "boolean",
100
+ "default": false
101
+ },
72
102
  "isIndeterminate": {
73
103
  "type": "boolean",
74
104
  "default": false,
@@ -78,31 +108,71 @@
78
108
  "type": "string",
79
109
  "default": "m",
80
110
  "values": [
81
- { "value": "s" },
82
- { "value": "m" },
83
- { "value": "l" },
84
- { "value": "xl" }
111
+ {
112
+ "value": "s"
113
+ },
114
+ {
115
+ "value": "m"
116
+ },
117
+ {
118
+ "value": "l"
119
+ },
120
+ {
121
+ "value": "xl"
122
+ }
85
123
  ]
86
124
  },
87
- "isEmphasized": { "type": "boolean", "default": false },
88
- "isDisabled": { "type": "boolean", "default": false },
89
- "isError": { "type": "boolean", "default": false }
125
+ "isEmphasized": {
126
+ "type": "boolean",
127
+ "default": false
128
+ },
129
+ "isDisabled": {
130
+ "type": "boolean",
131
+ "default": false
132
+ },
133
+ "isError": {
134
+ "type": "boolean",
135
+ "default": false
136
+ }
90
137
  },
91
138
  "states": [
92
- { "name": "hover", "trigger": "interaction" },
93
- { "name": "down", "trigger": "interaction" },
94
- { "name": "keyboard-focus", "trigger": "interaction" }
139
+ {
140
+ "name": "hover",
141
+ "trigger": "interaction"
142
+ },
143
+ {
144
+ "name": "down",
145
+ "trigger": "interaction"
146
+ },
147
+ {
148
+ "name": "keyboard-focus",
149
+ "trigger": "interaction"
150
+ }
95
151
  ],
96
- "lifecycle": { "introduced": "1.0.0-draft" },
152
+ "lifecycle": {
153
+ "introduced": "1.0.0-draft"
154
+ },
97
155
  "accessibility": {
98
156
  "role": "checkbox",
99
157
  "intents": ["choose"],
100
158
  "focusable": true,
101
159
  "keyboardIntents": ["activate"],
102
160
  "wcag": [
103
- { "criterion": "1.3.1", "level": "A", "title": "Info and Relationships" },
104
- { "criterion": "2.1.1", "level": "A", "title": "Keyboard" },
105
- { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
161
+ {
162
+ "criterion": "1.3.1",
163
+ "level": "A",
164
+ "title": "Info and Relationships"
165
+ },
166
+ {
167
+ "criterion": "2.1.1",
168
+ "level": "A",
169
+ "title": "Keyboard"
170
+ },
171
+ {
172
+ "criterion": "4.1.2",
173
+ "level": "A",
174
+ "title": "Name, Role, Value"
175
+ }
106
176
  ]
107
177
  }
108
178
  }