@repobit/dex-system-design 2.5.1 → 2.6.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 (173) hide show
  1. package/CHANGELOG.md +84 -0
  2. package/README.md +2 -1
  3. package/package.json +14 -27
  4. package/schemas/component-manifest.json +226 -33
  5. package/schemas/manifest-omissions.json +23 -0
  6. package/src/components/accordion/accordion-bg.css.js +39 -30
  7. package/src/components/accordion/accordion-bg.js +17 -28
  8. package/src/components/accordion/accordion-bg.stories.js +5 -0
  9. package/src/components/accordion/accordion-panel.js +24 -0
  10. package/src/components/accordion/accordion.css.js +105 -111
  11. package/src/components/accordion/accordion.js +23 -37
  12. package/src/components/accordion/accordion.stories.js +5 -1
  13. package/src/components/anchor/anchor-nav.css.js +131 -53
  14. package/src/components/anchor/anchor-nav.js +276 -201
  15. package/src/components/annotation/annotation.css.js +7 -4
  16. package/src/components/architecture.stories.js +8 -7
  17. package/src/components/audience-card/audience-card.css.js +30 -4
  18. package/src/components/audience-card/audience-card.js +8 -13
  19. package/src/components/awards/awards-flex.css.js +23 -6
  20. package/src/components/awards/awards-flex.js +21 -6
  21. package/src/components/awards/awards-spotlight.css.js +25 -5
  22. package/src/components/awards/awards-spotlight.js +19 -7
  23. package/src/components/awards/awards.css.js +20 -8
  24. package/src/components/awards/awards.js +30 -91
  25. package/src/components/awards/awards.stories.js +5 -5
  26. package/src/components/awards/scroll-slides.js +128 -0
  27. package/src/components/back/back.css.js +2 -0
  28. package/src/components/badge/badge.css.js +15 -0
  29. package/src/components/bento-grid/bento-grid.css.js +105 -11
  30. package/src/components/bento-grid/bento-grid.js +37 -124
  31. package/src/components/bento-grid/bento-grid.stories.js +3 -2
  32. package/src/components/bento-grid/bento-item.css.js +71 -32
  33. package/src/components/bento-grid/bento-item.js +1 -30
  34. package/src/components/blockquote/blockquote.css.js +2 -2
  35. package/src/components/breadcrumb/breadcrumb.css.js +10 -9
  36. package/src/components/breadcrumb/breadcrumb.js +35 -34
  37. package/src/components/button/button.css.js +42 -17
  38. package/src/components/button/button.js +84 -3
  39. package/src/components/button/button.stories.js +17 -0
  40. package/src/components/card-features/card-features.css.js +23 -2
  41. package/src/components/card-features/card-features.js +6 -48
  42. package/src/components/cards/card.css.js +43 -14
  43. package/src/components/cards/card.js +43 -177
  44. package/src/components/cards/card.stories.js +8 -10
  45. package/src/components/carousel/carousel.css.js +101 -70
  46. package/src/components/carousel/carousel.js +107 -71
  47. package/src/components/carousel/carousel.stories.js +18 -16
  48. package/src/components/checkbox/checkbox.css.js +26 -9
  49. package/src/components/checkbox/checkbox.js +73 -39
  50. package/src/components/checkbox/checkbox.stories.js +35 -18
  51. package/src/components/compare/compare.css.js +68 -10
  52. package/src/components/compare/compare.js +40 -103
  53. package/src/components/compare/compare.stories.js +1 -1
  54. package/src/components/compatibility-table/compatibility-table.css.js +70 -37
  55. package/src/components/compatibility-table/compatibility-table.js +47 -40
  56. package/src/components/compatibility-table/compatibility-table.stories.js +78 -1
  57. package/src/components/display/display.css.js +7 -0
  58. package/src/components/dropdown/dropdown.css.js +20 -3
  59. package/src/components/dropdown/dropdown.js +57 -21
  60. package/src/components/dropdown/dropdown.stories.js +31 -9
  61. package/src/components/features/features.css.js +56 -21
  62. package/src/components/features/features.js +7 -117
  63. package/src/components/fieldset/fieldset.stories.js +68 -0
  64. package/src/components/footer/footer-images.js +34 -0
  65. package/src/components/footer/footer-links-group.css.js +10 -10
  66. package/src/components/footer/footer-locale.js +47 -0
  67. package/src/components/footer/footer-lp.js +27 -114
  68. package/src/components/footer/footer-lp.stories.js +2 -2
  69. package/src/components/footer/footer-nav-menu.css.js +2 -2
  70. package/src/components/footer/footer-nav-menu.js +8 -3
  71. package/src/components/footer/footer.css.js +238 -197
  72. package/src/components/footer/footer.js +109 -187
  73. package/src/components/footer/footer.stories.js +14 -4
  74. package/src/components/grid/grid.css.js +64 -5
  75. package/src/components/header/header-code.css.js +20 -11
  76. package/src/components/header/header-code.js +1 -1
  77. package/src/components/header/header.css.js +20 -14
  78. package/src/components/header/header.js +6 -7
  79. package/src/components/header/header.stories.js +29 -24
  80. package/src/components/heading/heading.css.js +11 -0
  81. package/src/components/hero/hero.js +10 -2
  82. package/src/components/highlight/highlight.css.js +30 -6
  83. package/src/components/icons/arrow-icon.js +4 -1
  84. package/src/components/icons/arrow-right-icon.js +5 -1
  85. package/src/components/icons/icon-element.js +18 -0
  86. package/src/components/image/image.js +29 -9
  87. package/src/components/image/image.stories.js +38 -2
  88. package/src/components/input/custom-form.stories.js +38 -7
  89. package/src/components/input/input-clipboard.css.js +15 -1
  90. package/src/components/input/input-clipboard.js +84 -21
  91. package/src/components/input/input.js +27 -7
  92. package/src/components/install-options/install-options.css.js +26 -6
  93. package/src/components/install-options/install-options.js +32 -8
  94. package/src/components/label/label.css.js +1 -1
  95. package/src/components/light-carousel/light-carousel.css.js +100 -48
  96. package/src/components/light-carousel/light-carousel.js +43 -5
  97. package/src/components/link/link.css.js +15 -15
  98. package/src/components/link/link.js +17 -1
  99. package/src/components/link/link.stories.js +20 -7
  100. package/src/components/list/list.css.js +3 -3
  101. package/src/components/logo-marquee/logo-marquee.css.js +12 -1
  102. package/src/components/logo-marquee/logo-marquee.js +33 -8
  103. package/src/components/logo-marquee/logo-marquee.stories.js +10 -4
  104. package/src/components/modal/modal.css.js +74 -40
  105. package/src/components/modal/modal.js +85 -74
  106. package/src/components/modal/modal.stories.js +27 -14
  107. package/src/components/motion-art/motion-art.js +67 -1
  108. package/src/components/page-switcher/page-switcher.css.js +27 -9
  109. package/src/components/page-switcher/page-switcher.js +11 -8
  110. package/src/components/partner-banner/partner-banner.css.js +2 -0
  111. package/src/components/picture/picture.css.js +4 -4
  112. package/src/components/picture/picture.js +13 -3
  113. package/src/components/picture/picture.stories.js +28 -2
  114. package/src/components/post-card/post-card.css.js +18 -3
  115. package/src/components/pricing-cards/adopt-styles.js +16 -0
  116. package/src/components/pricing-cards/new-pricing-card.js +2 -4
  117. package/src/components/pricing-cards/new-pricing-card.stories.js +20 -22
  118. package/src/components/pricing-cards/pricing-card-actions.css.js +8 -12
  119. package/src/components/pricing-cards/pricing-card-actions.js +26 -13
  120. package/src/components/pricing-cards/pricing-card-container.css.js +4 -3
  121. package/src/components/pricing-cards/pricing-card-container.js +10 -4
  122. package/src/components/pricing-cards/pricing-card-header.css.js +5 -4
  123. package/src/components/pricing-cards/pricing-card-header.js +18 -31
  124. package/src/components/pricing-cards/pricing-card-pricing.css.js +84 -61
  125. package/src/components/pricing-cards/pricing-card-pricing.js +38 -24
  126. package/src/components/pricing-cards/pricing-card-show-more.js +8 -3
  127. package/src/components/pricing-cards/pricing-card.css.js +75 -41
  128. package/src/components/pricing-cards/pricing-card.js +356 -308
  129. package/src/components/progress/progress.css.js +58 -13
  130. package/src/components/progress/progress.js +13 -10
  131. package/src/components/progress/progress.stories.js +9 -7
  132. package/src/components/radio/radio-group.css.js +42 -0
  133. package/src/components/radio/radio-group.js +89 -0
  134. package/src/components/radio/radio.css.js +63 -6
  135. package/src/components/radio/radio.js +173 -140
  136. package/src/components/radio/radio.stories.js +99 -44
  137. package/src/components/radio/toggle-radio.js +44 -0
  138. package/src/components/review/review-grid.css.js +5 -1
  139. package/src/components/review/review-grid.js +2 -0
  140. package/src/components/review/review.js +13 -0
  141. package/src/components/shared/announcer.js +37 -0
  142. package/src/components/shared/fill-width.css.js +33 -0
  143. package/src/components/shared/form-control.js +194 -0
  144. package/src/components/shared/form-field.css.js +31 -3
  145. package/src/components/shared/token-scales.js +75 -26
  146. package/src/components/spotlight-section/spotlight-section.js +2 -2
  147. package/src/components/stat/stat-highlight.js +1 -1
  148. package/src/components/stat/stat.css.js +18 -3
  149. package/src/components/switch/switch.css.js +58 -5
  150. package/src/components/switch/switch.js +53 -5
  151. package/src/components/switch/switch.stories.js +30 -8
  152. package/src/components/tab-list/tab-list.css.js +51 -13
  153. package/src/components/tab-list/tab-list.js +7 -2
  154. package/src/components/tab-list/tab-list.stories.js +2 -2
  155. package/src/components/tabs/tabs.css.js +18 -1
  156. package/src/components/tabs/tabs.js +119 -41
  157. package/src/components/terminal/terminal-message.css.js +6 -1
  158. package/src/components/termsOfUse/terms.css.js +4 -2
  159. package/src/components/textarea/textarea.js +22 -7
  160. package/src/components/textarea/textarea.stories.js +12 -9
  161. package/src/components/trust-panel/trust-panel.css.js +13 -3
  162. package/src/components/ultimate-security-demo.stories.js +5 -5
  163. package/src/components/video/video.css.js +5 -0
  164. package/src/components/video/video.js +5 -0
  165. package/src/components/video/video.stories.js +12 -0
  166. package/src/components/video-player/video-player.css.js +20 -8
  167. package/src/components/video-player/video-player.js +74 -20
  168. package/src/components/video-player/video-player.stories.js +17 -3
  169. package/src/tokens/brands.stories.js +1 -1
  170. package/src/tokens/themes/index.js +2 -2
  171. package/src/tokens/typography.stories.js +4 -3
  172. package/src/vendor/motion-art/README.md +4 -1
  173. package/src/components/footer/footer-lp.css.js +0 -159
@@ -1,6 +1,62 @@
1
1
  import { css, unsafeCSS } from "lit";
2
2
  import { below } from "../shared/token-scales.js";
3
3
 
4
+ /* A card's own size at three widths, each said once and asked twice: of the
5
+ section, the container every width rule in this sheet reads, and of the
6
+ screen, for a card set on its own with no section around it
7
+ (Foundations/Visual Alignment's card family). The two never disagree: a
8
+ section is never wider than the screen, so wherever the screen says narrow
9
+ the section does too, and in a section on a wide screen the section alone
10
+ decides. */
11
+
12
+ /* No inset change at 1024. This box used to drop to 1.5em here and 1em at
13
+ 480, and it was an outlier twice over: it started shrinking 256px of
14
+ viewport before any sibling did, and it kept going to 16px where the rest
15
+ stop at 24. It takes the compact inset with the family at md instead --
16
+ see cardBelowMd.
17
+
18
+ The literals were also ems, so the inset scaled with whatever font-size the
19
+ box inherited while every sibling card's stayed put.
20
+
21
+ The width line is unrelated and stays. With box-sizing: border-box, the 380
22
+ is the card's whole width rather than its content width, so the card
23
+ measures 380 here instead of the 444 it used to render -- 64px narrower,
24
+ two still to a row, each one exactly filling its grid item. The declared
25
+ width was chosen over the rendered one on purpose: a rule that says 380 and
26
+ paints 444 is the kind of thing this file is being cleaned of. */
27
+ const cardUpTo1024 = css`
28
+ .bd-light-box {
29
+ width: 380px;
30
+ }
31
+ `;
32
+
33
+ const cardBelowMd = css`
34
+ .bd-light-box {
35
+ width: 100%;
36
+ max-width: 400px;
37
+ margin: var(--spacing-0) auto;
38
+ /* The compact inset, at the breakpoint the family takes it. Bento, the
39
+ Comparison Panel and the Trust Panel all step down here; this box used
40
+ to step down at 1024 and again at 480, which is why it read as the odd
41
+ one out when it was really just early and twice. */
42
+ padding: var(--card-padding-compact);
43
+ }
44
+ `;
45
+
46
+ const cardUpTo480 = css`
47
+ .bd-light-box {
48
+ width: 100%;
49
+ min-height: 300px;
50
+ }
51
+ .bd-light-icon {
52
+ bottom: var(--spacing-10);
53
+ }
54
+ `;
55
+
56
+ const cardUpTo1024Media = css`@media (max-width: 1024px) { ${cardUpTo1024} }`;
57
+ const cardBelowMdMedia = css`@media ${unsafeCSS(below('md'))} { ${cardBelowMd} }`;
58
+ const cardUpTo480Media = css`@media (max-width: 480px) { ${cardUpTo480} }`;
59
+
4
60
  export default css`
5
61
  /* One stylesheet for both public variants.
6
62
 
@@ -43,6 +99,18 @@ export default css`
43
99
  padding-top: var(--bd-lc-section-padding-block);
44
100
  padding-bottom: var(--bd-lc-section-padding-block);
45
101
  }
102
+
103
+ /* The section is the container every width rule below reads -- the
104
+ track's columns and each card's size alike, so the two never disagree
105
+ -- where they used to read the screen. A section across the page is as
106
+ wide as the screen, so there nothing moves; one placed in a narrower
107
+ column steps down with it. width: 100% because a size container
108
+ contributes nothing to its own intrinsic width. */
109
+ :host(bd-light-carousel-section) {
110
+ container-type: inline-size;
111
+ width: 100%;
112
+ box-sizing: border-box;
113
+ }
46
114
  .bd-header-light-carousel {
47
115
  margin-bottom: 50px;
48
116
  margin-top: 50px;
@@ -68,12 +136,18 @@ export default css`
68
136
  .bd-light-carousel-track {
69
137
  scroll-behavior: smooth;
70
138
  flex: 1;
139
+ /* No wider than the column, so cards that do not fit scroll inside it.
140
+ Centred in the section's flex column, the track takes its cards' width,
141
+ which is right while they fit; but two 380 cards and the gap are 790,
142
+ and the column between 768 and 1024 is 656 to 944, so where they did
143
+ not fit the track never scrolled: it hung past the column on both
144
+ sides and the section's overflow: hidden cut the cards off there. */
145
+ max-width: 100%;
71
146
  position: relative;
72
147
  padding: var(--spacing-0);
73
148
  overflow-x: auto;
74
149
  overflow-y: hidden;
75
150
  scrollbar-width: none;
76
- -ms-overflow-style: none;
77
151
  z-index: var(--z-base);
78
152
  scroll-snap-type: x mandatory;
79
153
  }
@@ -86,6 +160,16 @@ export default css`
86
160
  display: none;
87
161
  }
88
162
 
163
+ /* The track is a tab stop while it scrolls (light-carousel.js), with the
164
+ one focus ring -- see Foundations/Focus. It fits: the section clips at
165
+ its padding box, and the track sits inside the column's gutter. */
166
+ .bd-light-carousel-track:focus-visible {
167
+ outline: var(--border-width-2) solid transparent;
168
+ outline-offset: var(--focus-outline-offset);
169
+ box-shadow: var(--focus-outline-primary);
170
+ border-radius: var(--focus-outline-radius);
171
+ }
172
+
89
173
  .bd-light-box {
90
174
  flex: var(--spacing-0) var(--spacing-0) auto;
91
175
  background: var(--color-surface-container);
@@ -143,29 +227,11 @@ export default css`
143
227
  gap: var(--spacing-4);
144
228
  }
145
229
 
146
- /* No inset change at 1024. This box used to drop to 1.5em here and 1em at
147
- 480, and it was an outlier twice over: it started shrinking 256px of
148
- viewport before any sibling did, and it kept going to 16px where the rest
149
- stop at 24. It takes the compact inset with the family at md instead --
150
- see the below('md') block further down.
151
-
152
- The literals were also ems, so the inset scaled with whatever font-size the
153
- box inherited while every sibling card's stayed put.
154
-
155
- The width line is unrelated and stays. With box-sizing: border-box above,
156
- the 380 is the card's whole width rather than its content width, so the
157
- card measures 380 here instead of the 444 it used to render -- 64px
158
- narrower, two still to a row, each one exactly filling its grid item. The
159
- declared width was chosen over the rendered one on purpose: a rule that
160
- says 380 and paints 444 is the kind of thing this file is being cleaned
161
- of. */
162
- @media (max-width: 1024px) {
163
- .bd-light-box {
164
- width: 380px;
165
- }
166
- }
230
+ ${cardUpTo1024Media}
231
+ @container (width <= 1024px) { ${cardUpTo1024} }
167
232
 
168
- @media ${unsafeCSS(below('md'))} {
233
+ ${cardBelowMdMedia}
234
+ @container ${unsafeCSS(below('md'))} {
169
235
  .bd-light-carousel-track {
170
236
  display: flex;
171
237
  flex-direction: column;
@@ -175,39 +241,19 @@ export default css`
175
241
  scroll-behavior: smooth;
176
242
  }
177
243
 
178
- .bd-light-box {
179
- width: 100%;
180
- max-width: 400px;
181
- margin: var(--spacing-0) auto;
182
- /* The compact inset, at the breakpoint the family takes it. Bento, the
183
- Comparison Panel and the Trust Panel all step down here; this box used
184
- to step down at 1024 and again at 480, which is why it read as the odd
185
- one out when it was really just early and twice. */
186
- padding: var(--card-padding-compact);
187
- }
188
-
189
- .bd-arrow {
190
- display: none;
191
- }
244
+ ${cardBelowMd}
192
245
  }
193
246
 
194
- @media (max-width: 480px) {
195
- .bd-light-box {
196
- width: 100%;
197
- min-height: 300px;
198
- }
199
- .bd-light-icon {
200
- bottom: var(--spacing-10);
201
- }
202
- }
247
+ ${cardUpTo480Media}
248
+ @container (width <= 480px) { ${cardUpTo480} }
203
249
 
204
- @media (max-width: 1024px) {
250
+ @container (width <= 1024px) {
205
251
  .bd-light-carousel-track {
206
252
  grid-template-columns: repeat(2, 1fr);
207
253
  }
208
254
  }
209
255
 
210
- @media (max-width: 600px) {
256
+ @container (width <= 600px) {
211
257
  .bd-light-carousel-track {
212
258
  grid-template-columns: 1fr;
213
259
  }
@@ -220,5 +266,11 @@ export default css`
220
266
  .bd-light-box {
221
267
  transition: none;
222
268
  }
269
+
270
+ /* The track scrolls smoothly when its arrows or a script move it; a reader
271
+ who asked for less motion gets the jump. */
272
+ .bd-light-carousel-track {
273
+ scroll-behavior: auto;
274
+ }
223
275
  }
224
276
  `;
@@ -1,4 +1,4 @@
1
- import { LitElement, html } from "lit";
1
+ import { LitElement, html, nothing } from "lit";
2
2
  // Installs the design tokens into document scope; see src/tokens/tokens.js
3
3
  import "../../tokens/tokens.js";
4
4
  import "../badge/badge.js";
@@ -21,7 +21,8 @@ class CustomLightCarousel extends LitElement {
21
21
  * and docs table have always used, Standard and Simple, rather than new
22
22
  * ones invented at consolidation time.
23
23
  */
24
- variant : { type: String, reflect: true }
24
+ variant : { type: String, reflect: true },
25
+ _scrollable : { state: true }
25
26
  };
26
27
 
27
28
  constructor() {
@@ -29,6 +30,7 @@ class CustomLightCarousel extends LitElement {
29
30
  this.title = "";
30
31
  this.headingLevel = 2;
31
32
  this.variant = "standard";
33
+ this._scrollable = false;
32
34
  }
33
35
 
34
36
 
@@ -54,7 +56,38 @@ class CustomLightCarousel extends LitElement {
54
56
  >`;
55
57
  }
56
58
 
59
+ /* The track scrolls sideways when its cards do not fit (between md and
60
+ 1024 two cards of 380 rarely do), and a scroller the keyboard cannot
61
+ reach cannot be scrolled from the keyboard: it is a tab stop then, named
62
+ after the section's title, as a region. Only then -- a track whose cards
63
+ fit has nothing to scroll, and a tab stop that does nothing is noise. */
64
+ firstUpdated() {
65
+ this._track = this.renderRoot.querySelector(".bd-light-carousel-track");
66
+ this._overflow = new ResizeObserver(() => this._syncScrollable());
67
+ this._overflow.observe(this._track);
68
+ }
69
+
70
+ /* Put back on the page, the track is watched again: disconnecting stops
71
+ the observer, and firstUpdated does not run twice, so a moved carousel
72
+ kept the answer it had and never gained or lost its tab stop again. An
73
+ observer's first delivery comes on observe(), so the answer is current. */
74
+ connectedCallback() {
75
+ super.connectedCallback();
76
+ if (this._track) this._overflow.observe(this._track);
77
+ }
78
+
79
+ disconnectedCallback() {
80
+ super.disconnectedCallback();
81
+ this._overflow?.disconnect();
82
+ }
83
+
84
+ _syncScrollable() {
85
+ const track = this._track;
86
+ this._scrollable = !!track && track.scrollWidth > track.clientWidth + 1;
87
+ }
88
+
57
89
  render() {
90
+ const scrollable = this._scrollable;
58
91
  return html`
59
92
  <section class="bd-ensemble bd-light-carousel">
60
93
  ${this.title
@@ -64,8 +97,13 @@ class CustomLightCarousel extends LitElement {
64
97
  </div>
65
98
  `
66
99
  : null}
67
- <div class="bd-light-carousel-track">
68
- <slot></slot>
100
+ <div
101
+ class="bd-light-carousel-track"
102
+ tabindex=${scrollable ? "0" : nothing}
103
+ role=${scrollable ? "region" : nothing}
104
+ aria-label=${scrollable ? this.title || "Cards" : nothing}
105
+ >
106
+ <slot @slotchange=${() => this._syncScrollable()}></slot>
69
107
  </div>
70
108
  </section>
71
109
  `;
@@ -123,7 +161,7 @@ class LightCarouselItem extends LitElement {
123
161
  <div class="bd-light-box">
124
162
  <div class="bd-light-box-header">
125
163
  ${this.icon
126
- ? html`<img src="${this.icon}" alt="icon" class="bd-light-icon" />`
164
+ ? html`<img src="${this.icon}" alt="" class="bd-light-icon" />`
127
165
  : ""}
128
166
 
129
167
  ${this.title || this.badge
@@ -191,7 +191,10 @@ export default css`
191
191
  vertical-align: middle;
192
192
  }
193
193
 
194
- .bd-link--active {
194
+ /* The current link, read off the aria-current the <a> carries rather than
195
+ a class beside it, so what is drawn and what is announced are one
196
+ attribute and cannot disagree. */
197
+ .bd-link[aria-current] {
195
198
  /* no role: a link in its active state -- a state or modifier weight, not a text-content
196
199
  type. See button.css.js's .button--bold for the argument. */
197
200
  font-weight: var(--typography-fontWeight-bold);
@@ -200,17 +203,16 @@ export default css`
200
203
 
201
204
  /* The current item does not move under the pointer.
202
205
 
203
- --active and --primary are both present on a current nav item, and
204
- .bd-link--primary:hover at (0,2,0) outweighs .bd-link--active at (0,1,0)
205
- -- so without this rule hovering the page you are already on turned it
206
- back to the brand ink, which is the one thing that colour is not supposed
207
- to mean here. Measured on bd-page-switcher before the wayfinding family
208
- review: current + hover reported action/primary-active, the only one of
209
- the three that recoloured an item the reader had already arrived at.
206
+ The current state and --primary are both present on a current nav item,
207
+ and .bd-link--primary:hover outweighed the class this used to be -- so
208
+ without this rule hovering the page you are already on turned it back to
209
+ the brand ink, which is the one thing that colour is not supposed to mean
210
+ here. Measured on bd-page-switcher before the wayfinding family review:
211
+ current + hover reported action/primary-active, the only one of the
212
+ three that recoloured an item the reader had already arrived at.
210
213
 
211
- Same specificity as the kind hovers and declared after them, so it wins
212
- on order. */
213
- .bd-link--active:hover {
214
+ It outranks every kind hover, so it wins whatever the order. */
215
+ .bd-link[aria-current]:hover {
214
216
  color: var(--color-text-primary);
215
217
  }
216
218
 
@@ -223,10 +225,8 @@ export default css`
223
225
  pointer-events: none;
224
226
  }
225
227
 
226
- .bd-link:focus {
227
- outline: none;
228
- }
229
-
228
+ /* No :focus { outline: none } beside this: the browser's own ring is a
229
+ :focus-visible ring too, so a pointer focus never drew one. */
230
230
  .bd-link:focus-visible {
231
231
  /* the one focus ring — see Foundations/Focus. A two-colour ring whose
232
232
  white inner band keeps it visible on a coloured or dark surface, which a
@@ -45,6 +45,16 @@ class BdLink extends LitElement {
45
45
  without repositioning all of them. */
46
46
  inline : { type: Boolean, reflect: true },
47
47
  color : { type: String },
48
+ /* The link is the current one in its set: page, step, location, date,
49
+ time, or true -- the aria-current token, which lands on the <a>.
50
+ aria-current written on this element never reached the <a> in its
51
+ shadow root, which is where a screen reader looks: bd-anchor-nav and
52
+ bd-page-switcher both wrote it there and announced nothing. It
53
+ reflects, so the element that holds the link can style its own box --
54
+ an indicator, say -- from the same state. */
55
+ current : { type: String, reflect: true, converter: { toAttribute: value => value || null } },
56
+ /** @deprecated pass `current`. It drew the current state without
57
+ announcing it; it now means current="true". */
48
58
  active : { type: Boolean, reflect: true },
49
59
  /* The surface the link sits on, the same attribute bd-button uses. It
50
60
  replaces kind="light", which described the surface rather than the link
@@ -81,6 +91,7 @@ class BdLink extends LitElement {
81
91
  this.fontSize = "";
82
92
  this.inline = false;
83
93
  this.color = "";
94
+ this.current = "";
84
95
  this.active = false;
85
96
  this.surface = "light";
86
97
  this.arrow = false;
@@ -105,7 +116,6 @@ class BdLink extends LitElement {
105
116
  `bd-link--${this.variant}`,
106
117
  this.underline ? "bd-link--underline" : "",
107
118
  this.noUnderline ? "bd-link--no-underline" : "",
108
- this.active ? "bd-link--active" : "",
109
119
  this.disabled ? "bd-link--disabled" : "",
110
120
  this.arrow ? "bd-link--arrow" : ""
111
121
  ].filter(Boolean).join(" ");
@@ -157,6 +167,11 @@ class BdLink extends LitElement {
157
167
  .join("; ");
158
168
  }
159
169
 
170
+ /** The aria-current token, which is also what the current look keys on. */
171
+ get _current() {
172
+ return this.current || (this.active ? "true" : "");
173
+ }
174
+
160
175
  /* No whitespace anywhere in these templates: not between the tags and the
161
176
  slot, and not around the element either. The default flex row never
162
177
  rendered it, but inline drops the row, and there each newline became a
@@ -173,6 +188,7 @@ class BdLink extends LitElement {
173
188
  style="${this._inlineStyle}"
174
189
  href="${this.href || nothing}"
175
190
  target="${this.href ? this.target : nothing}"
191
+ aria-current="${this._current || nothing}"
176
192
  aria-describedby="${this.description ? "description" : nothing}"
177
193
  @click="${this._handleClick}"
178
194
  ><slot></slot>${this._arrow}</a>${this.description
@@ -1,4 +1,4 @@
1
- import { html } from 'lit';
1
+ import { html, nothing } from 'lit';
2
2
  import './link.js';
3
3
  import '../icons/arrow-right-icon.js';
4
4
  import '../visually-hidden/visually-hidden.js';
@@ -76,10 +76,15 @@ follows the link's ink in all of them.
76
76
  sets that: the link is a flex row, and a decoration is only drawn where there
77
77
  is text.
78
78
 
79
- ### active
80
- Marks the link as the current destination, for a nav or breadcrumb. It is
81
- styling only — pair it with \`aria-current="page"\` on the element for the state
82
- to be announced.
79
+ ### current
80
+ Marks the link as the current destination, for a nav or breadcrumb, with the
81
+ \`aria-current\` token: \`page\`, \`step\`, \`location\`, \`date\`, \`time\` or
82
+ \`true\`. It lands on the inner \`<a>\` as \`aria-current\`, so it is announced,
83
+ and the current look is drawn from that same attribute. \`aria-current\` written
84
+ on the \`bd-link\` element itself is not announced: the \`<a>\` is in the shadow
85
+ root. \`current\` reflects, so a container can style the item's box from it.
86
+
87
+ \`active\` is deprecated; it now means \`current="true"\`.
83
88
 
84
89
  ### Events
85
90
  - \`custom-click\` — NOT dispatched by BdLink (click handled natively by the \`<a>\` tag)
@@ -120,9 +125,15 @@ to be announced.
120
125
  description: 'Adds `bd-link--no-underline`. Overlaps with `underline` — see the note on the two of them.',
121
126
  table : { type: { summary: 'boolean' }, defaultValue: { summary: 'false' }, category: 'Appearance' }
122
127
  },
128
+ current: {
129
+ control : 'select',
130
+ options : ['', 'page', 'step', 'location', 'date', 'time', 'true'],
131
+ description: 'Marks the link as the current one, e.g. in a nav: the `aria-current` token, set on the inner `<a>`. The current look is drawn from it.',
132
+ table : { type: { summary: "'' | 'page' | 'step' | 'location' | 'date' | 'time' | 'true'" }, defaultValue: { summary: "''" }, category: 'State' }
133
+ },
123
134
  active: {
124
135
  control : 'boolean',
125
- description: 'Marks the link as the current one, e.g. in a nav. Adds `bd-link--active`.',
136
+ description: 'Deprecated: pass `current`. Means `current="true"`.',
126
137
  table : { type: { summary: 'boolean' }, defaultValue: { summary: 'false' }, category: 'State' }
127
138
  },
128
139
  arrow: {
@@ -161,6 +172,7 @@ const defaultArgs = {
161
172
  kind : 'primary',
162
173
  underline : false,
163
174
  noUnderline: false,
175
+ current : '',
164
176
  active : false,
165
177
  disabled : false,
166
178
  inline : false,
@@ -178,6 +190,7 @@ const render = (args) => html`
178
190
  color="${args.color}"
179
191
  ?underline="${args.underline}"
180
192
  ?no-underline="${args.noUnderline}"
193
+ current="${args.current || nothing}"
181
194
  ?active="${args.active}"
182
195
  ?inline="${args.inline}"
183
196
  ?disabled="${args.disabled}"
@@ -384,6 +397,6 @@ export const Playground = {
384
397
  render,
385
398
  parameters: {
386
399
  controls: { disable: false },
387
- docs : { description: { story: 'Interactive playground, and the only story wired to args. Every control here reaches the element: href, target, kind, underline, no-underline, active, disabled, inline, arrow, font-size and color.' } }
400
+ docs : { description: { story: 'Interactive playground, and the only story wired to args. Every control here reaches the element: href, target, kind, underline, no-underline, current, active, disabled, inline, arrow, font-size and color.' } }
388
401
  }
389
402
  };
@@ -37,7 +37,7 @@ export default css`
37
37
  argument. */
38
38
  font-weight: var(--typography-fontWeight-semibold);
39
39
  color: var(--color-text-muted);
40
- margin-right: var(--spacing-8);
40
+ margin-inline-end: var(--spacing-8);
41
41
  }
42
42
 
43
43
  /* Unordered list markers for vertical */
@@ -48,7 +48,7 @@ export default css`
48
48
  argument. */
49
49
  font-weight: var(--typography-fontWeight-semibold);
50
50
  color: var(--color-text-muted);
51
- margin-right: var(--spacing-8);
51
+ margin-inline-end: var(--spacing-8);
52
52
  }
53
53
 
54
54
  /* Horizontal */
@@ -136,7 +136,7 @@ export default css`
136
136
  /* === NESTED LISTS === */
137
137
 
138
138
  .bd-list .bd-list {
139
- margin-left: var(--spacing-16);
139
+ margin-inline-start: var(--spacing-16);
140
140
  margin-top: var(--spacing-8);
141
141
  }
142
142
 
@@ -37,7 +37,8 @@ export const logoMarqueeCSS = css`
37
37
  }
38
38
  }
39
39
 
40
- /* Held while the pointer or focus is on the row, and stopped by the paused attribute. */
40
+ /* Held while the pointer or focus is on the row, and stopped by the paused
41
+ attribute, which the button sets. */
41
42
  .viewport:hover .track,
42
43
  .viewport:focus-within .track,
43
44
  :host([paused]) .track {
@@ -57,6 +58,11 @@ export const logoMarqueeCSS = css`
57
58
  flex: none;
58
59
  }
59
60
 
61
+ /* the pause button, at the row's inline end, outside the fade */
62
+ .toggle {
63
+ flex: none;
64
+ }
65
+
60
66
  /* Still, and nothing hidden: the set wraps in place, and the copies and
61
67
  the fade go. */
62
68
  @media (prefers-reduced-motion: reduce) {
@@ -79,5 +85,10 @@ export const logoMarqueeCSS = css`
79
85
  .copy {
80
86
  display: none;
81
87
  }
88
+
89
+ /* nothing moves, so there is nothing to pause */
90
+ .toggle {
91
+ display: none;
92
+ }
82
93
  }
83
94
  `;
@@ -1,5 +1,8 @@
1
1
  import { LitElement, html } from "lit";
2
2
  import { tokens } from "../../tokens/tokens.js";
3
+ import "../button/button.js";
4
+ import "../icons/pause-icon.js";
5
+ import "../icons/play-icon.js";
3
6
  import { ensembleCSS } from "../shared/ensemble.css.js";
4
7
  import { spacing } from "../shared/token-scales.js";
5
8
  import { logoMarqueeCSS } from "./logo-marquee.css.js";
@@ -16,17 +19,23 @@ import { logoMarqueeCSS } from "./logo-marquee.css.js";
16
19
  * by one copy -- the jump back is then exactly one repeat, and invisible. The
17
20
  * copies are aria-hidden and inert: a screen reader reads the set once.
18
21
  *
19
- * There is no pause button: the pointer or focus on the row holds it, and a
20
- * page can stop it with `paused`. Under prefers-reduced-motion it never moves
21
- * -- the set wraps in place instead, so nothing is hidden behind the fade.
22
+ * It moves on its own for longer than five seconds, so it has a pause button
23
+ * (WCAG 2.2.2): holding it on hover or focus was not enough, because the
24
+ * logos are usually images and nothing in the row takes focus. The button
25
+ * sets `paused`, which a page can also set. The pointer or focus on the row
26
+ * still holds it. Under prefers-reduced-motion it never moves -- the set
27
+ * wraps in place instead, so nothing is hidden behind the fade -- and the
28
+ * button goes with the motion.
22
29
  */
23
30
  export class LogoMarquee extends LitElement {
24
31
  static properties = {
25
- label : { type: String },
26
- duration: { type: Number },
27
- gap : { type: String },
28
- paused : { type: Boolean, reflect: true },
29
- _copies : { state: true }
32
+ label : { type: String },
33
+ duration : { type: Number },
34
+ gap : { type: String },
35
+ paused : { type: Boolean, reflect: true },
36
+ pauseLabel: { type: String, attribute: "pause-label" },
37
+ playLabel : { type: String, attribute: "play-label" },
38
+ _copies : { state: true }
30
39
  };
31
40
 
32
41
  static styles = [tokens, ensembleCSS, logoMarqueeCSS];
@@ -39,6 +48,8 @@ export class LogoMarquee extends LitElement {
39
48
  // a step on the spacing scale, between two logos
40
49
  this.gap = "48";
41
50
  this.paused = false;
51
+ this.pauseLabel = "Pause the moving logos";
52
+ this.playLabel = "Play the moving logos";
42
53
  // copies of the set after the original; at least one, or there is no loop
43
54
  this._copies = 1;
44
55
  this._resize = new ResizeObserver(() => this._measure());
@@ -91,6 +102,10 @@ export class LogoMarquee extends LitElement {
91
102
  if (changed.has("_copies")) this._fillCopies();
92
103
  }
93
104
 
105
+ _toggle() {
106
+ this.paused = !this.paused;
107
+ }
108
+
94
109
  render() {
95
110
  const copies = Array.from({ length: this._copies });
96
111
  return html`
@@ -105,6 +120,16 @@ export class LogoMarquee extends LitElement {
105
120
  ${copies.map(() => html`<div class="group copy" aria-hidden="true" inert></div>`)}
106
121
  </div>
107
122
  </div>
123
+ <bd-button
124
+ class="toggle"
125
+ variant="ghost"
126
+ size="sm"
127
+ icon-only
128
+ label="${this.paused ? this.playLabel : this.pauseLabel}"
129
+ @click=${this._toggle}
130
+ >${this.paused
131
+ ? html`<bd-play-icon size="sm"></bd-play-icon>`
132
+ : html`<bd-pause-icon size="sm"></bd-pause-icon>`}</bd-button>
108
133
  </section>
109
134
  `;
110
135
  }
@@ -35,13 +35,19 @@ needs and moves the track by one copy, so the loop has no seam. The copies are
35
35
  | \`label\` | String | \`""\` | Names the region, in the page's language |
36
36
  | \`duration\` | Number | \`35\` | Seconds for one copy of the set to pass (35 for partners and awards) |
37
37
  | \`gap\` | String | \`"48"\` | A spacing step between two logos (48 partners, 24 awards) |
38
- | \`paused\` | Boolean | \`false\` | Stopped; a page sets it |
38
+ | \`paused\` | Boolean | \`false\` | Stopped; the pause button sets it, and so can a page |
39
+ | \`pause-label\` | String | \`"Pause the moving logos"\` | The pause button's accessible name while it moves |
40
+ | \`play-label\` | String | \`"Play the moving logos"\` | The button's accessible name while it is paused |
39
41
 
40
42
  ### Motion
41
43
 
42
- There is no pause button: the pointer or focus on the row holds it, and a
43
- page can stop it with \`paused\`. Under \`prefers-reduced-motion\` it never
44
- moves: the set wraps in place, the fade goes, and nothing is hidden.
44
+ It moves on its own for longer than five seconds, so a pause button sits at
45
+ the row's end (WCAG 2.2.2): the logos are usually images, so nothing in the
46
+ row takes focus and holding it on focus alone was no way to stop it. The
47
+ button sets \`paused\`, and a page can set it too; the pointer or focus on the
48
+ row still holds it. Under \`prefers-reduced-motion\` it never moves: the set
49
+ wraps in place, the fade goes, nothing is hidden, and the button goes too.
50
+ Pass \`pause-label\` and \`play-label\` in the page's language.
45
51
  `
46
52
  }
47
53
  }