@adobe/spectrum-design-data 3.3.0-beta.2 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/components/accordion.json +67 -15
  2. package/components/action-bar.json +30 -9
  3. package/components/action-button.json +92 -39
  4. package/components/action-group.json +137 -18
  5. package/components/alert-banner.json +27 -8
  6. package/components/alert-dialog.json +55 -34
  7. package/components/avatar-group.json +35 -9
  8. package/components/avatar.json +105 -29
  9. package/components/badge.json +163 -56
  10. package/components/breadcrumbs.json +107 -26
  11. package/components/button-group.json +63 -19
  12. package/components/button.json +105 -61
  13. package/components/calendar.json +74 -8
  14. package/components/card.json +13 -0
  15. package/components/cards.json +46 -31
  16. package/components/checkbox-group.json +85 -16
  17. package/components/checkbox.json +97 -27
  18. package/components/close-button.json +75 -20
  19. package/components/coach-indicator.json +44 -14
  20. package/components/coach-mark.json +26 -8
  21. package/components/color-area.json +100 -20
  22. package/components/color-handle.json +46 -25
  23. package/components/color-loupe.json +14 -2
  24. package/components/color-slider.json +129 -26
  25. package/components/color-wheel.json +91 -17
  26. package/components/combo-box.json +189 -50
  27. package/components/contextual-help.json +126 -80
  28. package/components/date-field.json +7 -0
  29. package/components/date-picker.json +127 -24
  30. package/components/divider.json +38 -12
  31. package/components/drop-zone.json +37 -18
  32. package/components/field-label.json +62 -21
  33. package/components/heading.json +7 -0
  34. package/components/help-text.json +53 -16
  35. package/components/illustrated-message.json +85 -21
  36. package/components/in-line-alert.json +53 -13
  37. package/components/link.json +63 -24
  38. package/components/list-view.json +80 -15
  39. package/components/menu.json +181 -45
  40. package/components/meter.json +78 -24
  41. package/components/number-field.json +175 -34
  42. package/components/picker.json +188 -42
  43. package/components/popover.json +126 -37
  44. package/components/progress-bar.json +108 -23
  45. package/components/progress-circle.json +55 -12
  46. package/components/radio-button.json +67 -14
  47. package/components/radio-group.json +132 -28
  48. package/components/rating.json +38 -9
  49. package/components/search-field.json +126 -34
  50. package/components/segmented-control.json +70 -21
  51. package/components/select-box.json +103 -29
  52. package/components/side-navigation.json +69 -28
  53. package/components/slider.json +155 -39
  54. package/components/standard-dialog.json +88 -16
  55. package/components/status-light.json +136 -41
  56. package/components/steplist.json +24 -5
  57. package/components/swatch-group.json +55 -19
  58. package/components/swatch.json +79 -24
  59. package/components/switch.json +79 -31
  60. package/components/table.json +73 -26
  61. package/components/tabs.json +52 -22
  62. package/components/tag-field.json +60 -14
  63. package/components/tag-group.json +56 -16
  64. package/components/tag.json +78 -21
  65. package/components/takeover-dialog.json +61 -10
  66. package/components/text-area.json +205 -49
  67. package/components/text-field.json +170 -42
  68. package/components/thumbnail.json +63 -22
  69. package/components/time-field.json +7 -0
  70. package/components/toast.json +50 -29
  71. package/components/tooltip.json +87 -27
  72. package/components/tree-view.json +147 -45
  73. package/components/user-card.json +7 -0
  74. package/guidelines/app-frame-overview.json +44 -46
  75. package/guidelines/attention-hierarchy.json +22 -13
  76. package/guidelines/background-layers.json +10 -80
  77. package/guidelines/brand.json +12 -32
  78. package/guidelines/colors.json +17 -47
  79. package/guidelines/developer-overview.json +9 -25
  80. package/guidelines/faqs.json +9 -96
  81. package/guidelines/fonts.json +14 -29
  82. package/guidelines/grays.json +44 -17
  83. package/guidelines/icon-fundamentals.json +18 -7
  84. package/guidelines/manifest.json +15 -367
  85. package/guidelines/motion.json +16 -17
  86. package/guidelines/principles.json +8 -7
  87. package/guidelines/resources.json +15 -21
  88. package/guidelines/states.json +11 -16
  89. package/guidelines/using-icons.json +44 -33
  90. package/package.json +2 -2
  91. package/registry/platform-implementations.json +30 -0
  92. package/guidelines/ai-resource-guide.json +0 -50
  93. package/guidelines/applying-the-type-system.json +0 -67
  94. package/guidelines/bi-directionality.json +0 -57
  95. package/guidelines/border-width.json +0 -58
  96. package/guidelines/cognitive.json +0 -197
  97. package/guidelines/component-spacing.json +0 -61
  98. package/guidelines/contact-us.json +0 -67
  99. package/guidelines/content-area-browsing-context.json +0 -65
  100. package/guidelines/content-design-grammar-and-mechanics.json +0 -241
  101. package/guidelines/content-design-voice-and-tone.json +0 -37
  102. package/guidelines/content-grammar-and-mechanics.json +0 -252
  103. package/guidelines/content-language-and-inclusivity-writing-about-people.json +0 -103
  104. package/guidelines/content-language-and-inclusivity-writing-with-visuals.json +0 -70
  105. package/guidelines/content-voice-and-tone.json +0 -47
  106. package/guidelines/creating-bluelines-browsing-context.json +0 -91
  107. package/guidelines/design-tokens.json +0 -158
  108. package/guidelines/drop-shadow.json +0 -68
  109. package/guidelines/grammar-and-mechanics.json +0 -252
  110. package/guidelines/header-browsing-context.json +0 -40
  111. package/guidelines/illustration.json +0 -105
  112. package/guidelines/in-product-word-list.json +0 -29
  113. package/guidelines/inclusive-design.json +0 -101
  114. package/guidelines/inclusive-ux-writing.json +0 -30
  115. package/guidelines/internationalization.json +0 -87
  116. package/guidelines/language-and-inclusivity-writing-about-people.json +0 -85
  117. package/guidelines/language-and-inclusivity-writing-with-visuals.json +0 -61
  118. package/guidelines/layout-and-structure-containers.json +0 -47
  119. package/guidelines/layout-and-structure-spacing-overview.json +0 -66
  120. package/guidelines/layout-spacing.json +0 -39
  121. package/guidelines/object-styles-overview.json +0 -17
  122. package/guidelines/rounding.json +0 -73
  123. package/guidelines/side-navigation-browsing-context.json +0 -74
  124. package/guidelines/spacing-overview.json +0 -45
  125. package/guidelines/support.json +0 -113
  126. package/guidelines/typography-overview.json +0 -43
  127. package/guidelines/typography-system.json +0 -208
  128. package/guidelines/visual-language-containers.json +0 -36
  129. package/guidelines/voice-and-tone.json +0 -47
  130. package/guidelines/whats-new.json +0 -32
  131. package/guidelines/writing-about-people.json +0 -103
  132. package/guidelines/writing-for-errors.json +0 -120
  133. package/guidelines/writing-for-onboarding.json +0 -119
  134. package/guidelines/writing-for-readability.json +0 -54
  135. package/guidelines/writing-with-visuals.json +0 -70
  136. package/registry/platform-extensions/web-components-states.json +0 -58
@@ -9,6 +9,19 @@
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
+ ],
12
25
  "documentBlocks": [
13
26
  {
14
27
  "type": "purpose",
@@ -16,78 +29,160 @@
16
29
  },
17
30
  {
18
31
  "type": "guideline",
19
- "content": "Text overflow.\n\nWhen the text is too long for the horizontal space available, it wraps to form another line."
32
+ "content": "Status lights indicate the state or condition of an item. They convey semantic meaning such as statuses and categories."
33
+ },
34
+ {
35
+ "type": "guideline",
36
+ "content": "Status lights should always include a label. Color alone is not enough to communicate the status."
37
+ },
38
+ {
39
+ "type": "guideline",
40
+ "content": "When status lights have a semantic meaning, they use semantic colors. Use these variants for the following statuses:"
20
41
  },
21
42
  {
22
43
  "type": "guideline",
23
- "content": "Use the appropriate variation.\n\nSemantic status lights should never be used for color coding categories or labels, and vice versa."
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."
24
45
  },
25
46
  {
26
47
  "type": "guideline",
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."
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."
28
49
  },
29
50
  {
30
51
  "type": "guideline",
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."
52
+ "content": "When the text is too long for the horizontal space available, it wraps to form another line."
32
53
  },
33
54
  {
34
55
  "type": "guideline",
35
- "content": "Cursor Description Default (Arrow)Use the default cursor for non-interactive components like status light."
56
+ "content": "Semantic status lights should never be used for color coding categories or labels, and vice versa."
36
57
  },
37
58
  {
38
59
  "type": "guideline",
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, AAAStatus 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 AColor 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 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 the status light dot has 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 wrapped. 2. Operable RequirementCriterionLevel Compliance 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."
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."
40
61
  }
41
62
  ],
42
63
  "options": {
43
- "label": { "type": "string" },
64
+ "label": {
65
+ "type": "string"
66
+ },
44
67
  "variant": {
45
68
  "type": "string",
46
69
  "default": "informative",
47
70
  "values": [
48
- { "value": "informative" },
49
- { "value": "neutral" },
50
- { "value": "positive" },
51
- { "value": "notice" },
52
- { "value": "negative" },
53
- { "value": "indigo" },
54
- { "value": "celery" },
55
- { "value": "chartreuse" },
56
- { "value": "yellow" },
57
- { "value": "magenta" },
58
- { "value": "fuchsia" },
59
- { "value": "purple" },
60
- { "value": "seafoam" },
61
- { "value": "pink" },
62
- { "value": "turquoise" },
63
- { "value": "cinnamon" },
64
- { "value": "brown" },
65
- { "value": "silver" },
66
- { "value": "gray" },
67
- { "value": "red" },
68
- { "value": "orange" },
69
- { "value": "green" },
70
- { "value": "cyan" }
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
+ }
71
140
  ]
72
141
  },
73
142
  "size": {
74
143
  "type": "string",
75
144
  "default": "m",
76
145
  "values": [
77
- { "value": "s" },
78
- { "value": "m" },
79
- { "value": "l" },
80
- { "value": "xl" }
146
+ {
147
+ "value": "s"
148
+ },
149
+ {
150
+ "value": "m"
151
+ },
152
+ {
153
+ "value": "l"
154
+ },
155
+ {
156
+ "value": "xl"
157
+ }
81
158
  ]
82
159
  }
83
160
  },
84
161
  "anatomy": [
85
- { "name": "visual-75", "description": "Severity dot, 75 size variant." },
86
- { "name": "visual-100", "description": "Severity dot, 100 size variant." },
87
- { "name": "visual-200", "description": "Severity dot, 200 size variant." },
88
- { "name": "visual-300", "description": "Severity dot, 300 size variant." },
89
- { "name": "dot" }
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
+ }
90
181
  ],
91
- "lifecycle": { "introduced": "1.0.0-draft" },
92
- "accessibility": { "focusable": false }
182
+ "lifecycle": {
183
+ "introduced": "1.0.0-draft"
184
+ },
185
+ "accessibility": {
186
+ "focusable": false
187
+ }
93
188
  }
@@ -51,7 +51,14 @@
51
51
  "orientation": {
52
52
  "type": "string",
53
53
  "default": "horizontal",
54
- "values": [{ "value": "horizontal" }, { "value": "vertical" }]
54
+ "values": [
55
+ {
56
+ "value": "horizontal"
57
+ },
58
+ {
59
+ "value": "vertical"
60
+ }
61
+ ]
55
62
  },
56
63
  "items": {
57
64
  "type": "array",
@@ -93,16 +100,28 @@
93
100
  "name": "track-size",
94
101
  "description": "The connecting track between steps."
95
102
  },
96
- { "name": "track" }
103
+ {
104
+ "name": "track"
105
+ }
97
106
  ],
98
- "lifecycle": { "introduced": "1.0.0-draft" },
107
+ "lifecycle": {
108
+ "introduced": "1.0.0-draft"
109
+ },
99
110
  "accessibility": {
100
111
  "intents": ["navigate"],
101
112
  "focusable": true,
102
113
  "keyboardIntents": ["navigate-items", "activate"],
103
114
  "wcag": [
104
- { "criterion": "2.1.1", "level": "A", "title": "Keyboard" },
105
- { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
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
+ }
106
125
  ]
107
126
  }
108
127
  }
@@ -16,23 +16,23 @@
16
16
  },
17
17
  {
18
18
  "type": "guideline",
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."
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."
20
20
  },
21
21
  {
22
22
  "type": "guideline",
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."
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."
24
24
  },
25
25
  {
26
26
  "type": "guideline",
27
- "content": "Keyboard interactions.\n\nKey Interaction TabMoves focus onto the swatch or swatch group.Arrow keysMoves focus through the swatches in the group."
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."
28
28
  },
29
29
  {
30
30
  "type": "guideline",
31
- "content": "Cursor guidelines.\n\nCursor Description PointerUse the pointer cursor for all interactive elements in every state."
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."
32
32
  },
33
33
  {
34
34
  "type": "guideline",
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 ANon‑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, AAASwatch 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 AThis 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 RequirementCriterionLevel Compliance Keyboard 2.1.1, 2.1.3 A, AAAAll functionality of the component is operable through a keyboard without specific timing for keystrokes.Keyboard traps 2.1.2 AFocus can be moved away from the component using only a keyboard.Seizures and physical reactions 2.3.1, 2.3.2, 2.3.3 A, AAA, AAAThere is no flashing content or unnecessary motion or animation in this component.Focus order 2.4.3 ANavigation sequences receive focus in an order that preserves meaning and operability.Focus visible 2.4.7 AAKeyboard states use an indicator that is visible with at least 3:1 contrast."
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."
36
36
  }
37
37
  ],
38
38
  "options": {
@@ -40,27 +40,51 @@
40
40
  "type": "string",
41
41
  "default": "m",
42
42
  "values": [
43
- { "value": "xs" },
44
- { "value": "s" },
45
- { "value": "m" },
46
- { "value": "l" }
43
+ {
44
+ "value": "xs"
45
+ },
46
+ {
47
+ "value": "s"
48
+ },
49
+ {
50
+ "value": "m"
51
+ },
52
+ {
53
+ "value": "l"
54
+ }
47
55
  ]
48
56
  },
49
57
  "density": {
50
58
  "type": "string",
51
59
  "default": "regular",
52
60
  "values": [
53
- { "value": "compact" },
54
- { "value": "regular" },
55
- { "value": "spacious" }
61
+ {
62
+ "value": "compact"
63
+ },
64
+ {
65
+ "value": "regular"
66
+ },
67
+ {
68
+ "value": "spacious"
69
+ }
56
70
  ]
57
71
  },
58
- "enableSelection": { "type": "boolean", "default": false },
72
+ "enableSelection": {
73
+ "type": "boolean",
74
+ "default": false
75
+ },
59
76
  "selectionMode": {
60
77
  "type": "string",
61
78
  "description": "Only applicable if selection is enabled.",
62
79
  "default": "single",
63
- "values": [{ "value": "single" }, { "value": "multiple" }]
80
+ "values": [
81
+ {
82
+ "value": "single"
83
+ },
84
+ {
85
+ "value": "multiple"
86
+ }
87
+ ]
64
88
  },
65
89
  "allowsEmptySelection": {
66
90
  "type": "boolean",
@@ -72,19 +96,31 @@
72
96
  "default": "none",
73
97
  "description": "Determines the corner radius of each swatch in the group. Partial refers to corner-radius-75.",
74
98
  "values": [
75
- { "value": "none" },
76
- { "value": "full" },
77
- { "value": "partial" }
99
+ {
100
+ "value": "none"
101
+ },
102
+ {
103
+ "value": "full"
104
+ },
105
+ {
106
+ "value": "partial"
107
+ }
78
108
  ]
79
109
  }
80
110
  },
81
- "lifecycle": { "introduced": "1.0.0-draft" },
111
+ "lifecycle": {
112
+ "introduced": "1.0.0-draft"
113
+ },
82
114
  "accessibility": {
83
115
  "role": "group",
84
116
  "intents": ["choose"],
85
117
  "focusable": false,
86
118
  "wcag": [
87
- { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
119
+ {
120
+ "criterion": "4.1.2",
121
+ "level": "A",
122
+ "title": "Name, Role, Value"
123
+ }
88
124
  ]
89
125
  }
90
126
  }
@@ -16,27 +16,31 @@
16
16
  },
17
17
  {
18
18
  "type": "guideline",
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."
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."
20
20
  },
21
21
  {
22
22
  "type": "guideline",
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."
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."
24
24
  },
25
25
  {
26
26
  "type": "guideline",
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."
27
+ "content": "By default, swatches have partial rounding. There are 3 options for a swatch’s rounding: none, partial rounding, and full rounding."
28
28
  },
29
29
  {
30
30
  "type": "guideline",
31
- "content": "Keyboard interactions.\n\nKeyInteractionTabMoves focus onto or off of the swatch group. Focus moves to the first swatch in the group.Space or EnterTriggers 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."
31
+ "content": "A swatch can have a selected state to allow for selection. This is often used in a swatch group."
32
32
  },
33
33
  {
34
34
  "type": "guideline",
35
- "content": "Cursor guidelines.\n\nCursor Description PointerUse the pointer cursor for all interactive elements in every state."
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."
36
36
  },
37
37
  {
38
38
  "type": "guideline",
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 ANon‑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, AAASwatch 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 AThis 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 RequirementCriterionLevel Compliance Keyboard 2.1.1, 2.1.3 A, AAAAll functionality of the component is operable through a keyboard without specific timing for keystrokes.Keyboard traps 2.1.2 AFocus can be moved away from the component using only a keyboard.Seizures and physical reactions 2.3.1, 2.3.2, 2.3.3 A, AAA, AAAThere is no flashing content or unnecessary motion or animation in this component.Focus order 2.4.3 ANavigation sequences receive focus in an order that preserves meaning and operability.Focus visible 2.4.7 AAKeyboard states use an indicator that is visible with at least 3:1 contrast."
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."
40
44
  }
41
45
  ],
42
46
  "options": {
@@ -48,51 +52,102 @@
48
52
  "type": "string",
49
53
  "default": "m",
50
54
  "values": [
51
- { "value": "xs" },
52
- { "value": "s" },
53
- { "value": "m" },
54
- { "value": "l" }
55
+ {
56
+ "value": "xs"
57
+ },
58
+ {
59
+ "value": "s"
60
+ },
61
+ {
62
+ "value": "m"
63
+ },
64
+ {
65
+ "value": "l"
66
+ }
55
67
  ]
56
68
  },
57
69
  "shape": {
58
70
  "type": "string",
59
71
  "default": "square",
60
- "values": [{ "value": "square" }, { "value": "rectangle" }]
72
+ "values": [
73
+ {
74
+ "value": "square"
75
+ },
76
+ {
77
+ "value": "rectangle"
78
+ }
79
+ ]
61
80
  },
62
81
  "cornerRounding": {
63
82
  "type": "string",
64
83
  "default": "none",
65
84
  "description": "Determines the corner radius of the swatch. Partial refers to corner-radius-75.",
66
85
  "values": [
67
- { "value": "none" },
68
- { "value": "partial" },
69
- { "value": "full" }
86
+ {
87
+ "value": "none"
88
+ },
89
+ {
90
+ "value": "partial"
91
+ },
92
+ {
93
+ "value": "full"
94
+ }
70
95
  ]
71
96
  },
72
- "isSelected": { "type": "boolean", "default": false },
73
- "isDisabled": { "type": "boolean", "default": false }
97
+ "isSelected": {
98
+ "type": "boolean",
99
+ "default": false
100
+ },
101
+ "isDisabled": {
102
+ "type": "boolean",
103
+ "default": false
104
+ }
74
105
  },
75
106
  "anatomy": [
76
107
  {
77
108
  "name": "slash",
78
109
  "description": "Diagonal slash indicating an empty or \"none\" swatch."
79
110
  },
80
- { "name": "icon" }
111
+ {
112
+ "name": "icon"
113
+ }
81
114
  ],
82
115
  "states": [
83
- { "name": "hover", "trigger": "interaction" },
84
- { "name": "down", "trigger": "interaction" },
85
- { "name": "keyboard-focus", "trigger": "interaction" },
86
- { "name": "disabled", "trigger": "prop" }
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
+ }
87
132
  ],
88
- "lifecycle": { "introduced": "1.0.0-draft" },
133
+ "lifecycle": {
134
+ "introduced": "1.0.0-draft"
135
+ },
89
136
  "accessibility": {
90
137
  "intents": ["choose"],
91
138
  "focusable": true,
92
139
  "keyboardIntents": ["activate"],
93
140
  "wcag": [
94
- { "criterion": "2.1.1", "level": "A", "title": "Keyboard" },
95
- { "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
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
+ }
96
151
  ]
97
152
  }
98
153
  }