@adobe/spectrum-design-data 3.2.3 → 3.3.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion.json +15 -54
- package/components/action-bar.json +9 -23
- package/components/action-button.json +39 -79
- package/components/action-group.json +18 -129
- package/components/alert-banner.json +8 -27
- package/components/alert-dialog.json +34 -48
- package/components/avatar-group.json +9 -28
- package/components/avatar.json +29 -92
- package/components/badge.json +56 -150
- package/components/breadcrumbs.json +26 -100
- package/components/button-group.json +19 -50
- package/components/button.json +61 -92
- package/components/calendar.json +8 -67
- package/components/cards.json +31 -46
- package/components/checkbox-group.json +16 -78
- package/components/checkbox.json +27 -90
- package/components/close-button.json +20 -62
- package/components/coach-indicator.json +14 -44
- package/components/coach-mark.json +8 -26
- package/components/color-area.json +20 -93
- package/components/color-handle.json +25 -38
- package/components/color-loupe.json +2 -6
- package/components/color-slider.json +26 -122
- package/components/color-wheel.json +17 -84
- package/components/combo-box.json +50 -182
- package/components/contextual-help.json +80 -119
- package/components/date-picker.json +24 -120
- package/components/divider.json +12 -25
- package/components/drop-zone.json +18 -30
- package/components/field-label.json +21 -62
- package/components/help-text.json +16 -53
- package/components/illustrated-message.json +21 -72
- package/components/in-line-alert.json +13 -53
- package/components/link.json +24 -56
- package/components/list-view.json +15 -73
- package/components/menu.json +45 -174
- package/components/meter.json +24 -65
- package/components/number-field.json +34 -168
- package/components/picker.json +42 -181
- package/components/popover.json +37 -113
- package/components/progress-bar.json +23 -95
- package/components/progress-circle.json +12 -42
- package/components/radio-button.json +14 -67
- package/components/radio-group.json +28 -125
- package/components/rating.json +9 -38
- package/components/search-field.json +34 -119
- package/components/segmented-control.json +21 -63
- package/components/select-box.json +29 -96
- package/components/side-navigation.json +28 -69
- package/components/slider.json +39 -148
- package/components/standard-dialog.json +16 -88
- package/components/status-light.json +41 -123
- package/components/steplist.json +5 -24
- package/components/swatch-group.json +19 -55
- package/components/swatch.json +24 -79
- package/components/switch.json +31 -72
- package/components/table.json +26 -73
- package/components/tabs.json +22 -39
- package/components/tag-field.json +14 -60
- package/components/tag-group.json +16 -49
- package/components/tag.json +21 -71
- package/components/takeover-dialog.json +10 -61
- package/components/text-area.json +49 -198
- package/components/text-field.json +42 -163
- package/components/thumbnail.json +22 -63
- package/components/toast.json +29 -50
- package/components/tooltip.json +27 -74
- package/components/tree-view.json +45 -140
- package/guidelines/ai-resource-guide.json +50 -0
- package/guidelines/app-frame-overview.json +44 -50
- package/guidelines/applying-the-type-system.json +63 -0
- package/guidelines/attention-hierarchy.json +12 -21
- package/guidelines/background-layers.json +44 -10
- package/guidelines/bi-directionality.json +57 -0
- package/guidelines/border-width.json +42 -0
- package/guidelines/brand.json +30 -10
- package/guidelines/cognitive.json +197 -0
- package/guidelines/colors.json +35 -17
- package/guidelines/component-spacing.json +49 -0
- package/guidelines/contact-us.json +67 -0
- package/guidelines/content-area-browsing-context.json +65 -0
- package/guidelines/creating-bluelines-browsing-context.json +91 -0
- package/guidelines/design-tokens.json +122 -0
- package/guidelines/developer-overview.json +25 -9
- package/guidelines/drop-shadow.json +56 -0
- package/guidelines/faqs.json +96 -9
- package/guidelines/fonts.json +29 -14
- package/guidelines/grammar-and-mechanics.json +252 -0
- package/guidelines/grays.json +17 -44
- package/guidelines/header-browsing-context.json +37 -0
- package/guidelines/icon-fundamentals.json +7 -18
- package/guidelines/illustration.json +109 -0
- package/guidelines/in-product-word-list.json +29 -0
- package/guidelines/inclusive-design.json +93 -0
- package/guidelines/inclusive-ux-writing.json +30 -0
- package/guidelines/internationalization.json +87 -0
- package/guidelines/introduction.json +2 -2
- package/guidelines/layout-and-structure-containers.json +47 -0
- package/guidelines/layout-spacing.json +39 -0
- package/guidelines/manifest.json +252 -60
- package/guidelines/motion.json +17 -16
- package/guidelines/object-styles-overview.json +17 -0
- package/guidelines/principles.json +2 -2
- package/guidelines/resources.json +21 -15
- package/guidelines/rounding.json +61 -0
- package/guidelines/side-navigation-browsing-context.json +71 -0
- package/guidelines/spacing-overview.json +45 -0
- package/guidelines/states.json +15 -10
- package/guidelines/typography-overview.json +39 -0
- package/guidelines/typography-system.json +168 -0
- package/guidelines/using-icons.json +33 -44
- package/guidelines/visual-language-containers.json +36 -0
- package/guidelines/voice-and-tone.json +47 -0
- package/guidelines/writing-about-people.json +103 -0
- package/guidelines/writing-for-errors.json +120 -0
- package/guidelines/writing-for-onboarding.json +119 -0
- package/guidelines/writing-for-readability.json +54 -0
- package/guidelines/writing-with-visuals.json +70 -0
- package/package.json +1 -1
- package/guidelines/app-frame-content-area.json +0 -81
- package/guidelines/app-frame-creating-bluelines.json +0 -58
- package/guidelines/app-frame-header.json +0 -72
- package/guidelines/app-frame-side-navigation.json +0 -138
- package/guidelines/containers.json +0 -62
- package/guidelines/illustrations.json +0 -111
- package/guidelines/object-styles.json +0 -102
- package/guidelines/spacing.json +0 -25
- package/guidelines/typography-fundamentals.json +0 -142
package/components/calendar.json
CHANGED
|
@@ -16,87 +16,28 @@
|
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"type": "guideline",
|
|
19
|
-
"content": "
|
|
19
|
+
"content": "Unavailable dates.\n\nWhen a day or several days are unavailable within the calendar popover, each day should display a strikethrough to help the user understand that they cannot select it. Disabled days use a distinct gray style to clearly differentiate them from unavailable days. When the calendar prevents selection of past dates, this visual treatment helps users distinguish disabled days from those marked as unavailable."
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"type": "guideline",
|
|
23
|
-
"content": "
|
|
23
|
+
"content": "Why unavailable and disabled days are necessary.\n\nIn a date selection system, users often need to distinguish between dates that cannot be selected and dates that are simply inactive. Supporting both states improves clarity and prevents errors. Here's an example scenario: A potential guest is browsing a calendar to book a stay at a vacation rental. Unavailable dates: Days when the rental is already booked or blocked by the owner. These appear with a strikethrough, indicating they cannot be selected. Disabled dates: Past dates that are no longer valid for booking. These appear visually distinct (gray style) to show they are inactive. Guests see unavailable dates marked clearly so they don't attempt to select them. Hosts or admins can view past dates as disabled and also mark future dates as unavailable when needed. By supporting both behaviors, the system provides a clear, intuitive experience for different user roles and prevents confusion during date selection."
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"type": "guideline",
|
|
27
|
-
"content": "
|
|
27
|
+
"content": "Range fill color.\n\nThe range fill shows which days fall between two selected dates. If the range spans more than the three-month calendar view, it ends on the last visible day but continues as users navigate with the calendar chevrons. A dashed stroke outlines the fill to improve visibility on bright screens and for users with vision impairments."
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
|
-
"type": "
|
|
31
|
-
"content": "
|
|
32
|
-
|
|
33
|
-
{
|
|
34
|
-
"type": "guideline",
|
|
35
|
-
"content": "The calendar popover may display an error as error text when a user attempts to provide an input that violates the defined constraints of the date selection. For example, when the user selects dates that fall outside allowable limits, or conflict with contextual restrictions."
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"type": "guideline",
|
|
39
|
-
"content": "The calendar popover is disabled. For example, a month within a three-month range is disabled."
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"type": "guideline",
|
|
43
|
-
"content": "The types of selection available for the calendar."
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"type": "guideline",
|
|
47
|
-
"content": "The current year or month displayed in the calendar popover."
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"type": "guideline",
|
|
51
|
-
"content": "When a day or several days are unavailable within the calendar popover, each day should display a strikethrough to help the user understand that they cannot select it."
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"type": "guideline",
|
|
55
|
-
"content": "Disabled days use a distinct gray style to clearly differentiate them from unavailable days. When the calendar prevents selection of past dates, this visual treatment helps users distinguish disabled days from those marked as unavailable."
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"type": "guideline",
|
|
59
|
-
"content": "In a date selection system, users often need to distinguish between dates that cannot be selected and dates that are simply inactive. Supporting both states improves clarity and prevents errors."
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"type": "guideline",
|
|
63
|
-
"content": "Here’s an example scenario: A potential guest is browsing a calendar to book a stay at a vacation rental."
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"type": "guideline",
|
|
67
|
-
"content": "Unavailable dates: Days when the rental is already booked or blocked by the owner. These appear with a strikethrough, indicating they cannot be selected."
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
"type": "guideline",
|
|
71
|
-
"content": "Disabled dates: Past dates that are no longer valid for booking. These appear visually distinct (gray style) to show they are inactive."
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"type": "guideline",
|
|
75
|
-
"content": "Guests see unavailable dates marked clearly so they don’t attempt to select them. Hosts or admins can view past dates as disabled and also mark future dates as unavailable when needed."
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"type": "guideline",
|
|
79
|
-
"content": "By supporting both behaviors, the system provides a clear, intuitive experience for different user roles and prevents confusion during date selection."
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"type": "guideline",
|
|
83
|
-
"content": "The range fill shows which days fall between two selected dates. If the range spans more than the three-month calendar view, it ends on the last visible day but continues as users navigate with the calendar chevrons. A dashed stroke outlines the fill to improve visibility on bright screens and for users with vision impairments."
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"type": "guideline",
|
|
87
|
-
"content": "The strikethrough styling intentionally accommodates internationalization."
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
"type": "guideline",
|
|
91
|
-
"content": "The calendar popover supports a disabled state but not a read-only state. Dates or months may be temporarily disabled based on context (for example, if a user must complete a task before selecting a date). In these cases, help text can explain why certain dates are unavailable."
|
|
30
|
+
"type": "do-dont",
|
|
31
|
+
"content": "Do not change the styling of unavailable days",
|
|
32
|
+
"dont": "The strikethrough styling intentionally accommodates internationalization."
|
|
92
33
|
},
|
|
93
34
|
{
|
|
94
35
|
"type": "guideline",
|
|
95
|
-
"content": "If a date picker is truly read-only, users shouldn
|
|
36
|
+
"content": "Calendar popover states.\n\nThe calendar popover supports a disabled state but not a read-only state. Dates or months may be temporarily disabled based on context (for example, if a user must complete a task before selecting a date). In these cases, help text can explain why certain dates are unavailable. If a date picker is truly read-only, users shouldn't be able to open the calendar popover at all, since they can't interact with it."
|
|
96
37
|
},
|
|
97
38
|
{
|
|
98
39
|
"type": "guideline",
|
|
99
|
-
"content": "
|
|
40
|
+
"content": "Optional time fields.\n\nThe calendar popover can also include time-specific fields, allowing users to specify start and end times."
|
|
100
41
|
}
|
|
101
42
|
],
|
|
102
43
|
"options": {
|
package/components/cards.json
CHANGED
|
@@ -16,55 +16,62 @@
|
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"type": "guideline",
|
|
19
|
-
"content": "
|
|
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"
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"type": "guideline",
|
|
23
|
-
"content": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
47
|
-
"content": "
|
|
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": "
|
|
51
|
-
"content": "
|
|
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": "
|
|
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": "
|
|
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."
|
|
60
67
|
},
|
|
61
68
|
{
|
|
62
69
|
"type": "guideline",
|
|
63
|
-
"content": "
|
|
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."
|
|
64
71
|
},
|
|
65
72
|
{
|
|
66
73
|
"type": "guideline",
|
|
67
|
-
"content": "
|
|
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."
|
|
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
|
-
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
|
|
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
|
-
|
|
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
|
}
|
|
@@ -16,113 +16,51 @@
|
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"type": "guideline",
|
|
19
|
-
"content": "
|
|
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."
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"type": "guideline",
|
|
23
|
-
"content": "
|
|
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)."
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"type": "guideline",
|
|
27
|
-
"content": "
|
|
27
|
+
"content": "Cursor guidelines.\n\nCursor Description PointerUse the pointer cursor for interactive elements like checkboxes."
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
"type": "guideline",
|
|
31
|
-
"content": "
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"type": "guideline",
|
|
35
|
-
"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."
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"type": "guideline",
|
|
39
|
-
"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."
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"type": "guideline",
|
|
43
|
-
"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."
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"type": "guideline",
|
|
47
|
-
"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”)."
|
|
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."
|
|
48
32
|
}
|
|
49
33
|
],
|
|
50
34
|
"options": {
|
|
51
|
-
"label": {
|
|
52
|
-
"type": "string"
|
|
53
|
-
},
|
|
35
|
+
"label": { "type": "string" },
|
|
54
36
|
"labelPosition": {
|
|
55
37
|
"type": "string",
|
|
56
38
|
"default": "top",
|
|
57
|
-
"values": [
|
|
58
|
-
{
|
|
59
|
-
"value": "top"
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"value": "side"
|
|
63
|
-
}
|
|
64
|
-
]
|
|
39
|
+
"values": [{ "value": "top" }, { "value": "side" }]
|
|
65
40
|
},
|
|
66
41
|
"necessityIndicator": {
|
|
67
42
|
"type": "string",
|
|
68
43
|
"default": "icon",
|
|
69
|
-
"values": [
|
|
70
|
-
{
|
|
71
|
-
"value": "text"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"value": "icon"
|
|
75
|
-
}
|
|
76
|
-
]
|
|
77
|
-
},
|
|
78
|
-
"isRequired": {
|
|
79
|
-
"type": "boolean",
|
|
80
|
-
"default": false
|
|
44
|
+
"values": [{ "value": "text" }, { "value": "icon" }]
|
|
81
45
|
},
|
|
46
|
+
"isRequired": { "type": "boolean", "default": false },
|
|
82
47
|
"orientation": {
|
|
83
48
|
"type": "string",
|
|
84
49
|
"default": "vertical",
|
|
85
|
-
"values": [
|
|
86
|
-
{
|
|
87
|
-
"value": "horizontal"
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
"value": "vertical"
|
|
91
|
-
}
|
|
92
|
-
]
|
|
93
|
-
},
|
|
94
|
-
"isError": {
|
|
95
|
-
"type": "boolean",
|
|
96
|
-
"default": false
|
|
50
|
+
"values": [{ "value": "horizontal" }, { "value": "vertical" }]
|
|
97
51
|
},
|
|
98
|
-
"
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
"description": {
|
|
103
|
-
"type": "string"
|
|
104
|
-
},
|
|
105
|
-
"errorMessage": {
|
|
106
|
-
"type": "string"
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
"lifecycle": {
|
|
110
|
-
"introduced": "1.0.0-draft"
|
|
52
|
+
"isError": { "type": "boolean", "default": false },
|
|
53
|
+
"isDisabled": { "type": "boolean", "default": false },
|
|
54
|
+
"description": { "type": "string" },
|
|
55
|
+
"errorMessage": { "type": "string" }
|
|
111
56
|
},
|
|
57
|
+
"lifecycle": { "introduced": "1.0.0-draft" },
|
|
112
58
|
"accessibility": {
|
|
113
59
|
"intents": ["choose"],
|
|
114
60
|
"focusable": false,
|
|
115
61
|
"wcag": [
|
|
116
|
-
{
|
|
117
|
-
|
|
118
|
-
"level": "A",
|
|
119
|
-
"title": "Info and Relationships"
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
"criterion": "4.1.2",
|
|
123
|
-
"level": "A",
|
|
124
|
-
"title": "Name, Role, Value"
|
|
125
|
-
}
|
|
62
|
+
{ "criterion": "1.3.1", "level": "A", "title": "Info and Relationships" },
|
|
63
|
+
{ "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
|
|
126
64
|
]
|
|
127
65
|
}
|
|
128
66
|
}
|
package/components/checkbox.json
CHANGED
|
@@ -16,71 +16,51 @@
|
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"type": "guideline",
|
|
19
|
-
"content": "
|
|
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."
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"type": "guideline",
|
|
23
|
-
"content": "
|
|
23
|
+
"content": "Text overflow.\n\nWhen the label is too long for the horizontal space available, it wraps to form another line."
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"type": "guideline",
|
|
27
|
-
"content": "
|
|
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."
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
"type": "guideline",
|
|
31
|
-
"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."
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
"type": "guideline",
|
|
35
|
-
"content": "
|
|
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."
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"type": "guideline",
|
|
39
|
-
"content": "
|
|
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."
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
"type": "guideline",
|
|
43
|
-
"content": "
|
|
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."
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
"type": "guideline",
|
|
47
|
-
"content": "
|
|
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."
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
"type": "guideline",
|
|
51
|
-
"content": "
|
|
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."
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
"type": "guideline",
|
|
55
|
-
"content": "
|
|
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)."
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
"type": "guideline",
|
|
59
|
-
"content": "
|
|
59
|
+
"content": "Cursor guidelines.\n\nCursor Description PointerUse the pointer cursor for all interactive components in every state."
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
"type": "guideline",
|
|
63
|
-
"content": "
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"type": "guideline",
|
|
67
|
-
"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."
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
"type": "guideline",
|
|
71
|
-
"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."
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"type": "guideline",
|
|
75
|
-
"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."
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"type": "guideline",
|
|
79
|
-
"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."
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"type": "guideline",
|
|
83
|
-
"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."
|
|
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."
|
|
84
64
|
}
|
|
85
65
|
],
|
|
86
66
|
"options": {
|
|
@@ -88,10 +68,7 @@
|
|
|
88
68
|
"type": "string",
|
|
89
69
|
"description": "When the label is not defined, the checkbox appears as a standalone checkbox."
|
|
90
70
|
},
|
|
91
|
-
"isSelected": {
|
|
92
|
-
"type": "boolean",
|
|
93
|
-
"default": false
|
|
94
|
-
},
|
|
71
|
+
"isSelected": { "type": "boolean", "default": false },
|
|
95
72
|
"isIndeterminate": {
|
|
96
73
|
"type": "boolean",
|
|
97
74
|
"default": false,
|
|
@@ -101,71 +78,31 @@
|
|
|
101
78
|
"type": "string",
|
|
102
79
|
"default": "m",
|
|
103
80
|
"values": [
|
|
104
|
-
{
|
|
105
|
-
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
"value": "m"
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
"value": "l"
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
"value": "xl"
|
|
115
|
-
}
|
|
81
|
+
{ "value": "s" },
|
|
82
|
+
{ "value": "m" },
|
|
83
|
+
{ "value": "l" },
|
|
84
|
+
{ "value": "xl" }
|
|
116
85
|
]
|
|
117
86
|
},
|
|
118
|
-
"isEmphasized": {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
},
|
|
122
|
-
"isDisabled": {
|
|
123
|
-
"type": "boolean",
|
|
124
|
-
"default": false
|
|
125
|
-
},
|
|
126
|
-
"isError": {
|
|
127
|
-
"type": "boolean",
|
|
128
|
-
"default": false
|
|
129
|
-
}
|
|
87
|
+
"isEmphasized": { "type": "boolean", "default": false },
|
|
88
|
+
"isDisabled": { "type": "boolean", "default": false },
|
|
89
|
+
"isError": { "type": "boolean", "default": false }
|
|
130
90
|
},
|
|
131
91
|
"states": [
|
|
132
|
-
{
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
"name": "down",
|
|
138
|
-
"trigger": "interaction"
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
"name": "keyboard-focus",
|
|
142
|
-
"trigger": "interaction"
|
|
143
|
-
}
|
|
92
|
+
{ "name": "hover", "trigger": "interaction" },
|
|
93
|
+
{ "name": "down", "trigger": "interaction" },
|
|
94
|
+
{ "name": "keyboard-focus", "trigger": "interaction" }
|
|
144
95
|
],
|
|
145
|
-
"lifecycle": {
|
|
146
|
-
"introduced": "1.0.0-draft"
|
|
147
|
-
},
|
|
96
|
+
"lifecycle": { "introduced": "1.0.0-draft" },
|
|
148
97
|
"accessibility": {
|
|
149
98
|
"role": "checkbox",
|
|
150
99
|
"intents": ["choose"],
|
|
151
100
|
"focusable": true,
|
|
152
101
|
"keyboardIntents": ["activate"],
|
|
153
102
|
"wcag": [
|
|
154
|
-
{
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
"title": "Info and Relationships"
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
"criterion": "2.1.1",
|
|
161
|
-
"level": "A",
|
|
162
|
-
"title": "Keyboard"
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
"criterion": "4.1.2",
|
|
166
|
-
"level": "A",
|
|
167
|
-
"title": "Name, Role, Value"
|
|
168
|
-
}
|
|
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" }
|
|
169
106
|
]
|
|
170
107
|
}
|
|
171
108
|
}
|