@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
@@ -9,19 +9,6 @@
9
9
  "category": "status",
10
10
  "documentationUrl": "https://spectrum.adobe.com/page/status-light/"
11
11
  },
12
- "implementations": [
13
- {
14
- "platform": "web",
15
- "componentName": "StatusLight",
16
- "package": "@react-spectrum/s2"
17
- },
18
- {
19
- "platform": "web",
20
- "componentName": "StatusLight",
21
- "importPath": "@adobe/spectrum-wc/components/status-light",
22
- "notes": "Spectrum 2 web component custom element: swc-status-light."
23
- }
24
- ],
25
12
  "documentBlocks": [
26
13
  {
27
14
  "type": "purpose",
@@ -29,160 +16,91 @@
29
16
  },
30
17
  {
31
18
  "type": "guideline",
32
- "content": "Status lights indicate the state or condition of an item. They convey semantic meaning such as statuses and categories."
19
+ "content": "Text overflow.\n\nWhen the text is too long for the horizontal space available, it wraps to form another line."
33
20
  },
34
21
  {
35
22
  "type": "guideline",
36
- "content": "Status lights should always include a label. Color alone is not enough to communicate the status."
23
+ "content": "Use the appropriate variation.\n\nSemantic status lights should never be used for color coding categories or labels, and vice versa."
37
24
  },
38
25
  {
39
26
  "type": "guideline",
40
- "content": "When status lights have a semantic meaning, they use semantic colors. Use these variants for the following statuses:"
27
+ "content": "Status light text.\n\nA status light should always include a label with text that clearly communicates about the kind of status being shown. Do not change the text color to match the dot."
41
28
  },
42
29
  {
43
30
  "type": "guideline",
44
- "content": "When status lights are used to color code categories and labels that are commonly found in data visualization, they use non-semantic label colors. The ideal usage for these is when there are 8 or fewer categories or labels being color coded."
31
+ "content": "RTL.\n\nFor RTL (right-to-left) languages, the layout of the status light is mirrored. The dot is placed on the right side of the text."
45
32
  },
46
33
  {
47
34
  "type": "guideline",
48
- "content": "Status lights 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."
35
+ "content": "Cursor Description Default (Arrow) Use the default cursor for non-interactive components like status light."
49
36
  },
50
37
  {
51
38
  "type": "guideline",
52
- "content": "When the text is too long for the horizontal space available, it wraps to form another line."
53
- },
39
+ "content": "Any criterion not mention in the below table are not applicable to this component or are resolved with underlying requirements, engineering, and styles of the entire system. 1. Perceivable Requirement Criterion Level Compliance Info and relationships, Identify purpose 1.3.1, 1.3.6 A, AAA Status lights should be understandable by assistive technologies like screen readers. This means using the proper semantic HTML or ARIA role should be utilized. Use of color 1.4.1 A Color is never used as the sole way to convey meaning in status lights. While color is used to reinforce their meaning, every status light also includes a clear text label that communicates the status. Text contrast minimums 1.4.3 AA Large text has a contrast ratio of at least 3:1, and small text has a contrast ratio of at least 4.5:1. Incidental text such as disabled, hidden, or decorative text has no contrast requirement. Visual presentation 1.4.8 AAA The width of text blocks is no more than 80 characters (40 for CJK languages), and text is never justified. Non-text contrast 1.4.11 AA The visual presentation of the status light dot has 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 wrapped. 2. Operable Requirement Criterion Level Compliance 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."
40
+ }
41
+ ],
42
+ "implementations": [
54
43
  {
55
- "type": "guideline",
56
- "content": "Semantic status lights should never be used for color coding categories or labels, and vice versa."
44
+ "platform": "web",
45
+ "componentName": "StatusLight",
46
+ "package": "@react-spectrum/s2"
57
47
  },
58
48
  {
59
- "type": "guideline",
60
- "content": "A status light should always include a label with text that clearly communicates about the kind of status being shown. Do not change the text color to match the dot."
49
+ "platform": "web",
50
+ "componentName": "StatusLight",
51
+ "importPath": "@adobe/spectrum-wc/components/status-light",
52
+ "notes": "Spectrum 2 web component custom element: swc-status-light."
61
53
  }
62
54
  ],
63
55
  "options": {
64
- "label": {
65
- "type": "string"
66
- },
56
+ "label": { "type": "string" },
67
57
  "variant": {
68
58
  "type": "string",
69
59
  "default": "informative",
70
60
  "values": [
71
- {
72
- "value": "informative"
73
- },
74
- {
75
- "value": "neutral"
76
- },
77
- {
78
- "value": "positive"
79
- },
80
- {
81
- "value": "notice"
82
- },
83
- {
84
- "value": "negative"
85
- },
86
- {
87
- "value": "indigo"
88
- },
89
- {
90
- "value": "celery"
91
- },
92
- {
93
- "value": "chartreuse"
94
- },
95
- {
96
- "value": "yellow"
97
- },
98
- {
99
- "value": "magenta"
100
- },
101
- {
102
- "value": "fuchsia"
103
- },
104
- {
105
- "value": "purple"
106
- },
107
- {
108
- "value": "seafoam"
109
- },
110
- {
111
- "value": "pink"
112
- },
113
- {
114
- "value": "turquoise"
115
- },
116
- {
117
- "value": "cinnamon"
118
- },
119
- {
120
- "value": "brown"
121
- },
122
- {
123
- "value": "silver"
124
- },
125
- {
126
- "value": "gray"
127
- },
128
- {
129
- "value": "red"
130
- },
131
- {
132
- "value": "orange"
133
- },
134
- {
135
- "value": "green"
136
- },
137
- {
138
- "value": "cyan"
139
- }
61
+ { "value": "informative" },
62
+ { "value": "neutral" },
63
+ { "value": "positive" },
64
+ { "value": "notice" },
65
+ { "value": "negative" },
66
+ { "value": "indigo" },
67
+ { "value": "celery" },
68
+ { "value": "chartreuse" },
69
+ { "value": "yellow" },
70
+ { "value": "magenta" },
71
+ { "value": "fuchsia" },
72
+ { "value": "purple" },
73
+ { "value": "seafoam" },
74
+ { "value": "pink" },
75
+ { "value": "turquoise" },
76
+ { "value": "cinnamon" },
77
+ { "value": "brown" },
78
+ { "value": "silver" },
79
+ { "value": "gray" },
80
+ { "value": "red" },
81
+ { "value": "orange" },
82
+ { "value": "green" },
83
+ { "value": "cyan" }
140
84
  ]
141
85
  },
142
86
  "size": {
143
87
  "type": "string",
144
88
  "default": "m",
145
89
  "values": [
146
- {
147
- "value": "s"
148
- },
149
- {
150
- "value": "m"
151
- },
152
- {
153
- "value": "l"
154
- },
155
- {
156
- "value": "xl"
157
- }
90
+ { "value": "s" },
91
+ { "value": "m" },
92
+ { "value": "l" },
93
+ { "value": "xl" }
158
94
  ]
159
95
  }
160
96
  },
161
97
  "anatomy": [
162
- {
163
- "name": "visual-75",
164
- "description": "Severity dot, 75 size variant."
165
- },
166
- {
167
- "name": "visual-100",
168
- "description": "Severity dot, 100 size variant."
169
- },
170
- {
171
- "name": "visual-200",
172
- "description": "Severity dot, 200 size variant."
173
- },
174
- {
175
- "name": "visual-300",
176
- "description": "Severity dot, 300 size variant."
177
- },
178
- {
179
- "name": "dot"
180
- }
98
+ { "name": "visual-75", "description": "Severity dot, 75 size variant." },
99
+ { "name": "visual-100", "description": "Severity dot, 100 size variant." },
100
+ { "name": "visual-200", "description": "Severity dot, 200 size variant." },
101
+ { "name": "visual-300", "description": "Severity dot, 300 size variant." },
102
+ { "name": "dot" }
181
103
  ],
182
- "lifecycle": {
183
- "introduced": "1.0.0-draft"
184
- },
185
- "accessibility": {
186
- "focusable": false
187
- }
104
+ "lifecycle": { "introduced": "1.0.0-draft" },
105
+ "accessibility": { "focusable": false }
188
106
  }
@@ -51,14 +51,7 @@
51
51
  "orientation": {
52
52
  "type": "string",
53
53
  "default": "horizontal",
54
- "values": [
55
- {
56
- "value": "horizontal"
57
- },
58
- {
59
- "value": "vertical"
60
- }
61
- ]
54
+ "values": [{ "value": "horizontal" }, { "value": "vertical" }]
62
55
  },
63
56
  "items": {
64
57
  "type": "array",
@@ -100,28 +93,16 @@
100
93
  "name": "track-size",
101
94
  "description": "The connecting track between steps."
102
95
  },
103
- {
104
- "name": "track"
105
- }
96
+ { "name": "track" }
106
97
  ],
107
- "lifecycle": {
108
- "introduced": "1.0.0-draft"
109
- },
98
+ "lifecycle": { "introduced": "1.0.0-draft" },
110
99
  "accessibility": {
111
100
  "intents": ["navigate"],
112
101
  "focusable": true,
113
102
  "keyboardIntents": ["navigate-items", "activate"],
114
103
  "wcag": [
115
- {
116
- "criterion": "2.1.1",
117
- "level": "A",
118
- "title": "Keyboard"
119
- },
120
- {
121
- "criterion": "4.1.2",
122
- "level": "A",
123
- "title": "Name, Role, Value"
124
- }
104
+ { "criterion": "2.1.1", "level": "A", "title": "Keyboard" },
105
+ { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
125
106
  ]
126
107
  }
127
108
  }
@@ -16,23 +16,23 @@
16
16
  },
17
17
  {
18
18
  "type": "guideline",
19
- "content": "Swatch groups organize related swatches into a single container. They’re used to display collections of colors, gradients, textures, or materials for comparison or selection."
19
+ "content": "Border only for low-contrast swatches.\n\nIt's important for users to compare colors when they're displayed in a swatch group. Because of this, swatches within a swatch group with low contrast (below 3:1 contrast with the background) have a less prominent border compared to the swatch component when used by itself. This reduces the likelihood of the UI interfering with color perception and comparisons."
20
20
  },
21
21
  {
22
22
  "type": "guideline",
23
- "content": "Swatch groups come in 3 densities: regular (default), compact, and spacious. Compact and spacious densities retain the same swatch size as regular density but have less or more padding between each swatch, respectively."
23
+ "content": "Corner rounding in swatch groups.\n\nA corner rounding of none should be used in a swatch group in order to help minimize the Hermann grid illusion that happens at the intersections of the white space within the group. The only exception is when a swatch group only takes up a single row. In that case, use any of the rounding options: none, partial rounding, or full rounding."
24
24
  },
25
25
  {
26
26
  "type": "guideline",
27
- "content": "By default, selection is not enabled in a swatch group. Selection can be enabled for a swatch group to allow for toggling. This is often used inside of swatch panels."
27
+ "content": "Keyboard interactions.\n\nKey Interaction Tab Moves focus onto the swatch or swatch group. Arrow keys Moves focus through the swatches in the group."
28
28
  },
29
29
  {
30
30
  "type": "guideline",
31
- "content": "When selection is enabled, a swatch group can allow for either single or multiple selection of swatches. This is often used inside of swatch panels to allow for bulk operations, such as deleting multiple swatches at once."
31
+ "content": "Cursor guidelines.\n\nCursor Description Pointer Use the pointer cursor for all interactive elements in every state."
32
32
  },
33
33
  {
34
34
  "type": "guideline",
35
- "content": "It’s important for users to compare colors when they’re displayed in a swatch group. Because of this, swatches within a swatch group with low contrast (below 3:1 contrast with the background) have a less prominent border compared to the swatch component when used by itself. This reduces the likelihood of the UI interfering with color perception and comparisons."
35
+ "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 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 Swatch groups should be understandable by assistive technologies like screen readers. This means the proper semantic HTML or ARIA role should be utilized, so the grouping relationship between swatches and the selected state are programmatically conveyed. Use of color 1.4.1 A This criterion requires that color not be the only method of communicating information. In swatches, the color itself is the content being presented, not a cue that conveys additional meaning. 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."
36
36
  }
37
37
  ],
38
38
  "options": {
@@ -40,51 +40,27 @@
40
40
  "type": "string",
41
41
  "default": "m",
42
42
  "values": [
43
- {
44
- "value": "xs"
45
- },
46
- {
47
- "value": "s"
48
- },
49
- {
50
- "value": "m"
51
- },
52
- {
53
- "value": "l"
54
- }
43
+ { "value": "xs" },
44
+ { "value": "s" },
45
+ { "value": "m" },
46
+ { "value": "l" }
55
47
  ]
56
48
  },
57
49
  "density": {
58
50
  "type": "string",
59
51
  "default": "regular",
60
52
  "values": [
61
- {
62
- "value": "compact"
63
- },
64
- {
65
- "value": "regular"
66
- },
67
- {
68
- "value": "spacious"
69
- }
53
+ { "value": "compact" },
54
+ { "value": "regular" },
55
+ { "value": "spacious" }
70
56
  ]
71
57
  },
72
- "enableSelection": {
73
- "type": "boolean",
74
- "default": false
75
- },
58
+ "enableSelection": { "type": "boolean", "default": false },
76
59
  "selectionMode": {
77
60
  "type": "string",
78
61
  "description": "Only applicable if selection is enabled.",
79
62
  "default": "single",
80
- "values": [
81
- {
82
- "value": "single"
83
- },
84
- {
85
- "value": "multiple"
86
- }
87
- ]
63
+ "values": [{ "value": "single" }, { "value": "multiple" }]
88
64
  },
89
65
  "allowsEmptySelection": {
90
66
  "type": "boolean",
@@ -96,31 +72,19 @@
96
72
  "default": "none",
97
73
  "description": "Determines the corner radius of each swatch in the group. Partial refers to corner-radius-75.",
98
74
  "values": [
99
- {
100
- "value": "none"
101
- },
102
- {
103
- "value": "full"
104
- },
105
- {
106
- "value": "partial"
107
- }
75
+ { "value": "none" },
76
+ { "value": "full" },
77
+ { "value": "partial" }
108
78
  ]
109
79
  }
110
80
  },
111
- "lifecycle": {
112
- "introduced": "1.0.0-draft"
113
- },
81
+ "lifecycle": { "introduced": "1.0.0-draft" },
114
82
  "accessibility": {
115
83
  "role": "group",
116
84
  "intents": ["choose"],
117
85
  "focusable": false,
118
86
  "wcag": [
119
- {
120
- "criterion": "4.1.2",
121
- "level": "A",
122
- "title": "Name, Role, Value"
123
- }
87
+ { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
124
88
  ]
125
89
  }
126
90
  }
@@ -16,31 +16,27 @@
16
16
  },
17
17
  {
18
18
  "type": "guideline",
19
- "content": "The preview shows the sample of the fill that the swatch represents. This property can be a color, gradient, texture, or material. The exact format this property takes will depend on implementation. Some examples of the format include color values, image, canvas, and gradient."
19
+ "content": "Keyboard focus.\n\nA swatch can be navigated using a keyboard. The keyboard focus state adds a blue ring to the swatch in focus."
20
20
  },
21
21
  {
22
22
  "type": "guideline",
23
- "content": "Swatches come in four different sizes: extra-small, small, medium, and 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."
23
+ "content": "Mixed value.\n\nWhen a swatch represents multiple values that are not identical, the preview shows a gray fill and a dash UI icon."
24
24
  },
25
25
  {
26
26
  "type": "guideline",
27
- "content": "By default, swatches have partial rounding. There are 3 options for a swatch’s rounding: none, partial rounding, and full rounding."
27
+ "content": "Hide unavailable swatches when possible.\n\nEven though swatches can have a disabled state, hiding unavailable swatches reduces visual clutter and eases cognitive load. Only show disabled swatches if hiding them would cause confusion to your users."
28
28
  },
29
29
  {
30
30
  "type": "guideline",
31
- "content": "A swatch can have a selected state to allow for selection. This is often used in a swatch group."
31
+ "content": "Keyboard interactions.\n\nKey Interaction Tab Moves focus onto or off of the swatch group. Focus moves to the first swatch in the group. Space or Enter Triggers an action or selects the swatch when selection is enabled. The focus remains on the swatch, unless the swatch opens or closes the current container. In this case, the focus moves to the target or back to the caller."
32
32
  },
33
33
  {
34
34
  "type": "guideline",
35
- "content": "A swatch in a disabled state shows that the swatch exists, but is not available in that circumstance. This state can be used to maintain layout continuity and to communicate that a swatch may become available later. Disabled swatches should be used with caution."
35
+ "content": "Cursor guidelines.\n\nCursor Description Pointer Use the pointer cursor for all interactive elements in every state."
36
36
  },
37
37
  {
38
38
  "type": "guideline",
39
- "content": "A swatch can be navigated using a keyboard. The keyboard focus state adds a blue ring to the swatch in focus."
40
- },
41
- {
42
- "type": "guideline",
43
- "content": "Even though swatches can have a disabled state, hiding unavailable swatches reduces visual clutter and eases cognitive load. Only show disabled swatches if hiding them would cause confusion to your users."
39
+ "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 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 Swatch groups should be understandable by assistive technologies like screen readers. This means the proper semantic HTML or ARIA role should be utilized, so the grouping relationship between swatches and the selected state are programmatically conveyed. Use of color 1.4.1 A This criterion requires that color not be the only method of communicating information. In swatches, the color itself is the content being presented, not a cue that conveys additional meaning. 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."
44
40
  }
45
41
  ],
46
42
  "options": {
@@ -52,102 +48,51 @@
52
48
  "type": "string",
53
49
  "default": "m",
54
50
  "values": [
55
- {
56
- "value": "xs"
57
- },
58
- {
59
- "value": "s"
60
- },
61
- {
62
- "value": "m"
63
- },
64
- {
65
- "value": "l"
66
- }
51
+ { "value": "xs" },
52
+ { "value": "s" },
53
+ { "value": "m" },
54
+ { "value": "l" }
67
55
  ]
68
56
  },
69
57
  "shape": {
70
58
  "type": "string",
71
59
  "default": "square",
72
- "values": [
73
- {
74
- "value": "square"
75
- },
76
- {
77
- "value": "rectangle"
78
- }
79
- ]
60
+ "values": [{ "value": "square" }, { "value": "rectangle" }]
80
61
  },
81
62
  "cornerRounding": {
82
63
  "type": "string",
83
64
  "default": "none",
84
65
  "description": "Determines the corner radius of the swatch. Partial refers to corner-radius-75.",
85
66
  "values": [
86
- {
87
- "value": "none"
88
- },
89
- {
90
- "value": "partial"
91
- },
92
- {
93
- "value": "full"
94
- }
67
+ { "value": "none" },
68
+ { "value": "partial" },
69
+ { "value": "full" }
95
70
  ]
96
71
  },
97
- "isSelected": {
98
- "type": "boolean",
99
- "default": false
100
- },
101
- "isDisabled": {
102
- "type": "boolean",
103
- "default": false
104
- }
72
+ "isSelected": { "type": "boolean", "default": false },
73
+ "isDisabled": { "type": "boolean", "default": false }
105
74
  },
106
75
  "anatomy": [
107
76
  {
108
77
  "name": "slash",
109
78
  "description": "Diagonal slash indicating an empty or \"none\" swatch."
110
79
  },
111
- {
112
- "name": "icon"
113
- }
80
+ { "name": "icon" }
114
81
  ],
115
82
  "states": [
116
- {
117
- "name": "hover",
118
- "trigger": "interaction"
119
- },
120
- {
121
- "name": "down",
122
- "trigger": "interaction"
123
- },
124
- {
125
- "name": "keyboard-focus",
126
- "trigger": "interaction"
127
- },
128
- {
129
- "name": "disabled",
130
- "trigger": "prop"
131
- }
83
+ { "name": "hover", "trigger": "interaction" },
84
+ { "name": "down", "trigger": "interaction" },
85
+ { "name": "keyboard-focus", "trigger": "interaction" },
86
+ { "name": "disabled", "trigger": "prop" }
132
87
  ],
133
- "lifecycle": {
134
- "introduced": "1.0.0-draft"
135
- },
88
+ "lifecycle": { "introduced": "1.0.0-draft" },
136
89
  "accessibility": {
137
90
  "intents": ["choose"],
138
91
  "focusable": true,
139
92
  "keyboardIntents": ["activate"],
140
93
  "wcag": [
141
- {
142
- "criterion": "2.1.1",
143
- "level": "A",
144
- "title": "Keyboard"
145
- },
146
- {
147
- "criterion": "4.1.2",
148
- "level": "A",
149
- "title": "Name, Role, Value"
150
- }
94
+ { "criterion": "2.1.1", "level": "A", "title": "Keyboard" },
95
+ { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
151
96
  ]
152
97
  }
153
98
  }