@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,55 +16,62 @@
16
16
  },
17
17
  {
18
18
  "type": "guideline",
19
- "content": "Cards group related content and actions into flexible containers for browsing. They preview key information and reveal more detail on interaction."
19
+ "content": "Card component Purpose / use case Interaction type Common visual elements Flex General-purpose, flexible content container Varies (Static or Clickable) Title, preview, checkbox Asset Display assets like images, text documents, files, videos, materials, etc. Clickable (navigates to 1-up view), selectable Preview, filename, metadata, checkbox Gallery Show multiple images or videos in a river grid. Clickable (navigates to 1-up view), selectable Preview, badge, checkbox Collection Group related items such as assets or products in a library of items. Clickable (drill-in), selectable multi or hero multi previews, collection title, checkbox Product Display product details for interaction Clickable (drill-in), selectable Cover image, thumbnail (logo), product title, checkbox Horizontal Displaying mostly text, possibly with a cropped cover image or icon. Clickable (drill-in) Optional cropped preview, icon, or thumbnail, title, metadata"
20
20
  },
21
21
  {
22
22
  "type": "guideline",
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."
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."
24
24
  },
25
25
  {
26
26
  "type": "guideline",
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."
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."
28
28
  },
29
29
  {
30
30
  "type": "guideline",
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."
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."
32
32
  },
33
33
  {
34
34
  "type": "guideline",
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."
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."
36
36
  },
37
37
  {
38
38
  "type": "guideline",
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."
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."
40
40
  },
41
41
  {
42
42
  "type": "guideline",
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."
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."
44
44
  },
45
45
  {
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."
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."
48
49
  },
49
50
  {
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:"
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."
54
+ },
55
+ {
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."
52
59
  },
53
60
  {
54
61
  "type": "guideline",
55
- "content": "Cards are meant to just show a taste of the available information. Don’t overload cards with more information than necessary."
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."
56
63
  },
57
64
  {
58
65
  "type": "guideline",
59
- "content": "Only standard cards can have a footer, and buttons can only appear inside a footer."
66
+ "content": "Keyboard interactions.\n\nKey Interaction Tab Moves focus forward to the next card. Arrow keys Moves 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 + Tab Moves focus backward to the previous card. Return or Enter If 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. Space If the card is selectable, the space bar will toggle selection. Ctrl / Command + Arrow keys Non-contiguous selection of cards."
60
67
  },
61
68
  {
62
69
  "type": "guideline",
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."
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. Pointer Use the pointer cursor for the interactive elements. Grab hand Use 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 fist Use the grab fist cursor when actively dragging a card. Fully interactive cards Cursor Description Pointer Use 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 hand Use the grab hand cursor when hovering over cards that are draggable. Grab fist Use the grab fist cursor when actively dragging a card."
64
71
  },
65
72
  {
66
73
  "type": "guideline",
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."
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 A Non‑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 AA Cards 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 AA Cards are available in both vertical and horizontal orientations. Use of color 1.4.1 A Color 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 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 illustrations, icons, and component 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. 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."
68
75
  }
69
76
  ],
70
77
  "options": {
@@ -73,45 +80,23 @@
73
80
  "default": "asset",
74
81
  "description": "Determines which card layout variant is used.",
75
82
  "values": [
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
- }
83
+ { "value": "asset" },
84
+ { "value": "collection" },
85
+ { "value": "flex" },
86
+ { "value": "gallery" },
87
+ { "value": "horizontal" },
88
+ { "value": "product" }
94
89
  ]
95
90
  }
96
91
  },
97
- "lifecycle": {
98
- "introduced": "1.0.0-draft"
99
- },
92
+ "lifecycle": { "introduced": "1.0.0-draft" },
100
93
  "accessibility": {
101
94
  "intents": ["select"],
102
95
  "focusable": true,
103
96
  "keyboardIntents": ["activate"],
104
97
  "wcag": [
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
- }
98
+ { "criterion": "2.1.1", "level": "A", "title": "Keyboard" },
99
+ { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
115
100
  ]
116
101
  }
117
102
  }
@@ -9,13 +9,6 @@
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
- ],
19
12
  "documentBlocks": [
20
13
  {
21
14
  "type": "purpose",
@@ -23,113 +16,58 @@
23
16
  },
24
17
  {
25
18
  "type": "guideline",
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."
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."
39
20
  },
40
21
  {
41
22
  "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."
23
+ "content": "Keyboard interactions.\n\nKey Interaction Tab Tabbing into a group of checkboxes places the focus on the first checkbox (only one checkbox receives the keyboard focus at a time). Shift + Tab Moves focus to the previous item or group of items. Arrow keys Moves focus through the group of checkboxes. Page Up or Page Down Moves focus to the previous or next checkbox in the group (last becomes first, and first becomes last). Home or End Moves focus to the first or last checkbox in the group. Space or Enter Toggles 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)."
43
24
  },
44
25
  {
45
26
  "type": "guideline",
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."
27
+ "content": "Cursor guidelines.\n\nCursor Description Pointer Use the pointer cursor for interactive elements like checkboxes."
47
28
  },
48
29
  {
49
30
  "type": "guideline",
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."
51
- },
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 A Non‑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, AAA Checkboxes 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 AA Checkbox groups are available in both vertical and horizontal orientations. Use of color 1.4.1 A Color 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 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 Checkboxes 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 checkbox control and its 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 when the label is wrapped. 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 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."
32
+ }
33
+ ],
34
+ "implementations": [
52
35
  {
53
- "type": "guideline",
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”)."
36
+ "platform": "web",
37
+ "componentName": "CheckboxGroup",
38
+ "package": "@react-spectrum/s2"
55
39
  }
56
40
  ],
57
41
  "options": {
58
- "label": {
59
- "type": "string"
60
- },
42
+ "label": { "type": "string" },
61
43
  "labelPosition": {
62
44
  "type": "string",
63
45
  "default": "top",
64
- "values": [
65
- {
66
- "value": "top"
67
- },
68
- {
69
- "value": "side"
70
- }
71
- ]
46
+ "values": [{ "value": "top" }, { "value": "side" }]
72
47
  },
73
48
  "necessityIndicator": {
74
49
  "type": "string",
75
50
  "default": "icon",
76
- "values": [
77
- {
78
- "value": "text"
79
- },
80
- {
81
- "value": "icon"
82
- }
83
- ]
84
- },
85
- "isRequired": {
86
- "type": "boolean",
87
- "default": false
51
+ "values": [{ "value": "text" }, { "value": "icon" }]
88
52
  },
53
+ "isRequired": { "type": "boolean", "default": false },
89
54
  "orientation": {
90
55
  "type": "string",
91
56
  "default": "vertical",
92
- "values": [
93
- {
94
- "value": "horizontal"
95
- },
96
- {
97
- "value": "vertical"
98
- }
99
- ]
100
- },
101
- "isError": {
102
- "type": "boolean",
103
- "default": false
104
- },
105
- "isDisabled": {
106
- "type": "boolean",
107
- "default": false
57
+ "values": [{ "value": "horizontal" }, { "value": "vertical" }]
108
58
  },
109
- "description": {
110
- "type": "string"
111
- },
112
- "errorMessage": {
113
- "type": "string"
114
- }
115
- },
116
- "lifecycle": {
117
- "introduced": "1.0.0-draft"
59
+ "isError": { "type": "boolean", "default": false },
60
+ "isDisabled": { "type": "boolean", "default": false },
61
+ "description": { "type": "string" },
62
+ "errorMessage": { "type": "string" }
118
63
  },
64
+ "lifecycle": { "introduced": "1.0.0-draft" },
119
65
  "accessibility": {
120
66
  "intents": ["choose"],
121
67
  "focusable": false,
122
68
  "wcag": [
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
- }
69
+ { "criterion": "1.3.1", "level": "A", "title": "Info and Relationships" },
70
+ { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
133
71
  ]
134
72
  }
135
73
  }
@@ -9,13 +9,6 @@
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
- ],
19
12
  "documentBlocks": [
20
13
  {
21
14
  "type": "purpose",
@@ -23,71 +16,58 @@
23
16
  },
24
17
  {
25
18
  "type": "guideline",
26
- "content": "Checkboxes support selecting one or more items from a list. Each item can be selected independently or in combination with others."
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."
27
20
  },
28
21
  {
29
22
  "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."
23
+ "content": "Text overflow.\n\nWhen the label is too long for the horizontal space available, it wraps to form another line."
31
24
  },
32
25
  {
33
26
  "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."
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."
35
28
  },
36
29
  {
37
30
  "type": "guideline",
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."
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."
39
32
  },
40
33
  {
41
34
  "type": "guideline",
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."
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."
43
36
  },
44
37
  {
45
38
  "type": "guideline",
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."
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."
47
40
  },
48
41
  {
49
42
  "type": "guideline",
50
- "content": "Checkboxes can be in an indeterminate state when they represent both selected and not selected values."
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."
51
44
  },
52
45
  {
53
46
  "type": "guideline",
54
- "content": "Checkboxes can be selected or not selected."
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."
55
48
  },
56
49
  {
57
50
  "type": "guideline",
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."
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."
59
52
  },
60
53
  {
61
54
  "type": "guideline",
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."
55
+ "content": "Keyboard interactions.\n\nKey Interaction Tab Tabbing into a group of checkboxes places the focus on the first checkbox (only one checkbox receives the keyboard focus at a time). Shift + Tab Moves focus to the previous item or group of items. Space or Enter Toggles 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)."
63
56
  },
64
57
  {
65
58
  "type": "guideline",
66
- "content": "When the label is too long for the horizontal space available, it wraps to form another line."
59
+ "content": "Cursor guidelines.\n\nCursor Description Pointer Use the pointer cursor for all interactive components in every state."
67
60
  },
68
61
  {
69
62
  "type": "guideline",
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."
71
- },
72
- {
73
- "type": "guideline",
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."
75
- },
76
- {
77
- "type": "guideline",
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
- },
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 A Non‑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, AAA Checkboxes 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 AA Checkbox groups are available in both vertical and horizontal orientations. Use of color 1.4.1 A Color 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 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 Checkboxes should be built in such a way that they can be resized without assistive technology up to 200%. Visual presentation 1.4.8 AAA Checkbox 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 AA The checkbox control and its 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 when the label is wrapped. 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 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."
64
+ }
65
+ ],
66
+ "implementations": [
88
67
  {
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."
68
+ "platform": "web",
69
+ "componentName": "Checkbox",
70
+ "package": "@react-spectrum/s2"
91
71
  }
92
72
  ],
93
73
  "options": {
@@ -95,10 +75,7 @@
95
75
  "type": "string",
96
76
  "description": "When the label is not defined, the checkbox appears as a standalone checkbox."
97
77
  },
98
- "isSelected": {
99
- "type": "boolean",
100
- "default": false
101
- },
78
+ "isSelected": { "type": "boolean", "default": false },
102
79
  "isIndeterminate": {
103
80
  "type": "boolean",
104
81
  "default": false,
@@ -108,71 +85,31 @@
108
85
  "type": "string",
109
86
  "default": "m",
110
87
  "values": [
111
- {
112
- "value": "s"
113
- },
114
- {
115
- "value": "m"
116
- },
117
- {
118
- "value": "l"
119
- },
120
- {
121
- "value": "xl"
122
- }
88
+ { "value": "s" },
89
+ { "value": "m" },
90
+ { "value": "l" },
91
+ { "value": "xl" }
123
92
  ]
124
93
  },
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
- }
94
+ "isEmphasized": { "type": "boolean", "default": false },
95
+ "isDisabled": { "type": "boolean", "default": false },
96
+ "isError": { "type": "boolean", "default": false }
137
97
  },
138
98
  "states": [
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
- }
99
+ { "name": "hover", "trigger": "interaction" },
100
+ { "name": "down", "trigger": "interaction" },
101
+ { "name": "keyboard-focus", "trigger": "interaction" }
151
102
  ],
152
- "lifecycle": {
153
- "introduced": "1.0.0-draft"
154
- },
103
+ "lifecycle": { "introduced": "1.0.0-draft" },
155
104
  "accessibility": {
156
105
  "role": "checkbox",
157
106
  "intents": ["choose"],
158
107
  "focusable": true,
159
108
  "keyboardIntents": ["activate"],
160
109
  "wcag": [
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
- }
110
+ { "criterion": "1.3.1", "level": "A", "title": "Info and Relationships" },
111
+ { "criterion": "2.1.1", "level": "A", "title": "Keyboard" },
112
+ { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
176
113
  ]
177
114
  }
178
115
  }