@repobit/dex-system-design 2.5.0 → 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 +91 -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 +3 -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
@@ -7,7 +7,6 @@ import "../link/link.js";
7
7
  import "../paragraph/paragraph.js";
8
8
  import compareCSS from "./compare.css.js";
9
9
  import { ensembleCSS } from "../shared/ensemble.css.js";
10
- import { matchesBelow } from "../shared/token-scales.js";
11
10
 
12
11
  function readStretchVars(el) {
13
12
  const styles = getComputedStyle(el);
@@ -25,7 +24,9 @@ const SCORE_ANIM_EASING = (t) => 1 - (1 - t) ** 3;
25
24
  let compareIntroDone = false;
26
25
  let compareIntroTimer = 0;
27
26
 
28
- function shouldPlayCompareIntro() { return !compareIntroDone; }
27
+ /* Reduced motion is asked when the intro would play, not once when the module
28
+ loaded: a reader who turns it on before scrolling to the bars gets them still. */
29
+ function shouldPlayCompareIntro() { return !compareIntroDone && !prefersReducedMotion(); }
29
30
 
30
31
  function scheduleCompareIntroDone() {
31
32
  if (compareIntroDone || compareIntroTimer) return;
@@ -40,10 +41,6 @@ function prefersReducedMotion() {
40
41
  catch { return false; }
41
42
  }
42
43
 
43
- if (typeof globalThis !== "undefined" && prefersReducedMotion()) {
44
- compareIntroDone = true;
45
- }
46
-
47
44
  class CompareBar extends LitElement {
48
45
  static properties = {
49
46
  label : { type: String },
@@ -69,11 +66,19 @@ class CompareBar extends LitElement {
69
66
  this.scale = 1;
70
67
  this._animatedScore = NaN;
71
68
  this._scoreAnimRaf = 0;
69
+ /* The bar is a meter, and says so through its internals: its role, its
70
+ name (the brand) and its value (the score, out of the scale). Its
71
+ inside is aria-hidden -- the label and the animated score are what a
72
+ sighted reader sees -- and the host used to carry an aria-label with no
73
+ role under it, which most screen readers do not announce, so the score
74
+ was silent. Internals rather than attributes: the page keeps the host's
75
+ own attributes, and nothing is written on it. */
76
+ this._internals = this.attachInternals?.();
77
+ if (this._internals) this._internals.role = "meter";
72
78
  }
73
79
 
74
80
  connectedCallback() {
75
81
  super.connectedCallback();
76
- this.setAttribute("aria-label", this._barAriaLabel());
77
82
  if (!shouldPlayCompareIntro()) {
78
83
  this.classList.add("compare-no-motion");
79
84
  return;
@@ -91,7 +96,7 @@ class CompareBar extends LitElement {
91
96
 
92
97
  updated(changed) {
93
98
  super.updated(changed);
94
- this.setAttribute("aria-label", this._barAriaLabel());
99
+ this._syncMeter();
95
100
  const deps = ["score", "referenceScore", "scoreLabel", "variant", "maxScore", "label"];
96
101
  if (!deps.some((k) => changed.has(k))) return;
97
102
 
@@ -200,10 +205,16 @@ class CompareBar extends LitElement {
200
205
  return (Math.round(v * 100) / 100).toFixed(2);
201
206
  }
202
207
 
203
- _barAriaLabel() {
208
+ _syncMeter() {
209
+ const internals = this._internals;
210
+ if (!internals) return;
204
211
  const max = this.maxScore ?? 6;
205
- const val = this.scoreLabel || this.score;
206
- return `${this.label}, score ${val} out of ${max}`;
212
+ const score = parseFloat(this.score);
213
+ internals.ariaLabel = this.label;
214
+ internals.ariaValueMin = "0";
215
+ internals.ariaValueMax = String(max);
216
+ internals.ariaValueNow = Number.isFinite(score) ? String(score) : null;
217
+ internals.ariaValueText = `score ${this.scoreLabel || this.score} out of ${max}`;
207
218
  }
208
219
 
209
220
  render() {
@@ -330,20 +341,6 @@ class CompareCard extends LitElement {
330
341
  });
331
342
  }
332
343
 
333
- /**
334
- * Called by CompareSection to set a fixed min-height on .card-header
335
- * so all headers in the same row are the same height.
336
- */
337
- setHeaderMinHeight(px) {
338
- const header = this.shadowRoot?.querySelector(".card-header");
339
- if (header) header.style.minHeight = px != null ? `${px}px` : "";
340
- }
341
-
342
- getHeaderHeight() {
343
- const header = this.shadowRoot?.querySelector(".card-header");
344
- return header ? header.getBoundingClientRect().height : 0;
345
- }
346
-
347
344
  _renderFootnote() {
348
345
  if (!this.footnote) return "";
349
346
 
@@ -392,9 +389,8 @@ class CompareCard extends LitElement {
392
389
  claimed a headingId property either. */
393
390
  _renderHorizontal() {
394
391
  return html`
395
- <div
392
+ <article
396
393
  class="card card--horizontal"
397
- role="article"
398
394
  aria-labelledby="${this._headingId}"
399
395
  aria-describedby="${this._chartHelpId}"
400
396
  >
@@ -437,19 +433,21 @@ class CompareCard extends LitElement {
437
433
  <slot @slotchange=${this._syncBarStretch}></slot>
438
434
  </div>
439
435
  </div>
440
- </div>
436
+ </article>
441
437
  `;
442
438
  }
443
439
 
444
440
  render() {
445
441
  if (this.layout === "horizontal") return this._renderHorizontal();
446
442
 
447
- const isMobile = matchesBelow('md');
448
-
443
+ /* One level and one variant at every width; compare.css.js steps the
444
+ title and the description down a size where the section is narrow.
445
+ They used to change here -- h4 to h5, regular to small -- read from the
446
+ screen once at render, so the outline moved with the size and neither
447
+ followed a resize. */
449
448
  return html`
450
- <div
449
+ <article
451
450
  class="card"
452
- role="article"
453
451
  aria-labelledby="${this._headingId}"
454
452
  aria-describedby="${this._chartHelpId}"
455
453
  >
@@ -475,12 +473,10 @@ class CompareCard extends LitElement {
475
473
  `
476
474
  : ""}
477
475
  <div class="card-text-wrap">
478
- ${isMobile
479
- ? html`<bd-h as="h5" class="card-title" id="${this._headingId}">${this.title}</bd-h>`
480
- : html`<bd-h as="h4" class="card-title" id="${this._headingId}">${this.title}</bd-h>`}
476
+ <bd-h as="h4" class="card-title" id="${this._headingId}">${this.title}</bd-h>
481
477
  ${this.description
482
478
  ? html`
483
- <bd-p variant="${isMobile ? "small" : "regular"}" class="card-description">
479
+ <bd-p variant="regular" class="card-description">
484
480
  ${this.description}
485
481
  </bd-p>
486
482
  `
@@ -493,7 +489,7 @@ class CompareCard extends LitElement {
493
489
  </div>
494
490
 
495
491
  ${this._renderFootnote()}
496
- </div>
492
+ </article>
497
493
  `;
498
494
  }
499
495
  }
@@ -520,74 +516,17 @@ class CompareSection extends LitElement {
520
516
  this.subtitle = "";
521
517
  this.columns = 2;
522
518
  this.gap = "";
523
- this._syncRaf = 0;
524
- this._ro = null;
525
- }
526
-
527
- connectedCallback() {
528
- super.connectedCallback();
529
- // ResizeObserver — re-sync whenever any card changes size
530
- this._ro = new ResizeObserver(() => this._syncHeaderHeights());
531
- this._ro.observe(this);
532
- }
533
-
534
- disconnectedCallback() {
535
- super.disconnectedCallback();
536
- this._ro?.disconnect();
537
- this._ro = null;
538
- if (this._syncRaf) cancelAnimationFrame(this._syncRaf);
539
519
  }
540
520
 
541
521
  firstUpdated() {
542
522
  scheduleCompareIntroDone();
543
- // Initial sync after first paint
544
- requestAnimationFrame(() => this._syncHeaderHeights());
545
- }
546
-
547
- /**
548
- * Reads all compare-card children, finds the tallest .card-header
549
- * across all of them, then sets that height as minHeight on every card.
550
- * Runs in a rAF to batch DOM reads before writes.
551
- */
552
- _syncHeaderHeights() {
553
- if (this._syncRaf) cancelAnimationFrame(this._syncRaf);
554
- this._syncRaf = requestAnimationFrame(() => {
555
- this._syncRaf = 0;
556
-
557
- const isMobile = matchesBelow('md');
558
-
559
- // Get all slotted compare-card elements
560
- const slot = this.shadowRoot?.querySelector("slot");
561
- if (!slot) return;
562
-
563
- const cards = slot
564
- .assignedElements({ flatten: true })
565
- .filter((el) => el.localName === "compare-card" && el.getAttribute("layout") !== "horizontal");
566
-
567
- if (!cards.length) return;
568
-
569
- // On mobile reset all — no alignment needed
570
- if (isMobile) {
571
- cards.forEach((c) => c.setHeaderMinHeight?.(null));
572
- return;
573
- }
574
-
575
- // Reset first so we get natural heights
576
- cards.forEach((c) => c.setHeaderMinHeight?.(null));
577
-
578
- // Read heights after reset
579
- requestAnimationFrame(() => {
580
- const heights = cards.map((c) => c.getHeaderHeight?.() ?? 0);
581
- const maxH = Math.max(...heights);
582
-
583
- // Write — set all to tallest
584
- cards.forEach((c) => c.setHeaderMinHeight?.(maxH));
585
- });
586
- });
587
523
  }
588
524
 
525
+ /* The cards' headers line up across a row because every card is a subgrid
526
+ of the section's rows -- header, bars, footnote; see compare.css.js. This
527
+ used to be a ResizeObserver on the section, two animation frames, and a
528
+ px min-height written on every header to match the tallest. */
589
529
  render() {
590
- const isMobile = matchesBelow('md');
591
530
  const gapStyle = this.gap
592
531
  ? `--_cols: ${this.columns}; --cs-gap: ${this.gap}`
593
532
  : `--_cols: ${this.columns}`;
@@ -601,13 +540,11 @@ class CompareSection extends LitElement {
601
540
  ? html`
602
541
  <div class="cs-heading">
603
542
  ${this.title
604
- ? isMobile
605
- ? html`<bd-h as="h4" class="cs-title" id="${this._sectionTitleId}">${this.title}</bd-h>`
606
- : html`<bd-h as="h3" class="cs-title" id="${this._sectionTitleId}">${this.title}</bd-h>`
543
+ ? html`<bd-h as="h3" class="cs-title" id="${this._sectionTitleId}">${this.title}</bd-h>`
607
544
  : ""}
608
545
  ${this.subtitle
609
546
  ? html`
610
- <bd-p variant="${isMobile ? "small" : "regular"}" class="cs-subtitle">
547
+ <bd-p variant="regular" class="cs-subtitle">
611
548
  ${this.subtitle}
612
549
  </bd-p>
613
550
  `
@@ -617,7 +554,7 @@ class CompareSection extends LitElement {
617
554
  : ""}
618
555
 
619
556
  <div class="cs-grid" style="${gapStyle}">
620
- <slot @slotchange=${this._syncHeaderHeights}></slot>
557
+ <slot></slot>
621
558
  </div>
622
559
  </section>
623
560
  `;
@@ -7,7 +7,7 @@ import "./compare.js";
7
7
 
8
8
  const SHIELD_ICON = "/assets/shield-check.svg";
9
9
  const SPEEDOMETER_ICON = "/assets/speedometer.svg";
10
- const REPAIR_ICON = "/assets/repair.svg";
10
+ const REPAIR_ICON = "/assets/device_protection.png";
11
11
 
12
12
  const AV_TEST_URL = "https://www.av-test.org/en/antivirus/home-users/";
13
13
 
@@ -58,8 +58,10 @@ export default css`
58
58
  max-width: var(--content-width-readable);
59
59
  }
60
60
 
61
+ /* The card. The table inside collapses its borders, which a table's own
62
+ radius does not survive, so the edge, the corners and the clip stay on
63
+ this wrapper. */
61
64
  .bd-compattable-table-container {
62
- display: table;
63
65
  width: 100%;
64
66
  background: var(--color-surface-default);
65
67
  border: var(--border-width-1) solid var(--color-border-container);
@@ -68,19 +70,37 @@ export default css`
68
70
  box-sizing: border-box;
69
71
  }
70
72
 
73
+ /* Collapsed, so a row's border draws; fixed, so the columns keep the
74
+ proportions the grid rows used to spell, here as shares of the width. */
75
+ .bd-compattable-table {
76
+ width: 100%;
77
+ border-collapse: collapse;
78
+ table-layout: fixed;
79
+ }
80
+
81
+ /* 1.4fr 1.2fr 2.4fr */
82
+ .bd-compattable-table col:nth-child(1) { width: calc(100% * 1.4 / 5); }
83
+ .bd-compattable-table col:nth-child(2) { width: calc(100% * 1.2 / 5); }
84
+ .bd-compattable-table col:nth-child(3) { width: calc(100% * 2.4 / 5); }
85
+
86
+ /* 1.2fr 1.6fr 1.6fr */
87
+ :host([variant="outcome"]) .bd-compattable-table col:nth-child(1) { width: calc(100% * 1.2 / 4.4); }
88
+ :host([variant="outcome"]) .bd-compattable-table col:nth-child(2),
89
+ :host([variant="outcome"]) .bd-compattable-table col:nth-child(3) { width: calc(100% * 1.6 / 4.4); }
90
+
91
+ /* 1fr 1.6fr */
92
+ :host([variant="risk"]) .bd-compattable-table col:nth-child(1) { width: calc(100% * 1 / 2.6); }
93
+ :host([variant="risk"]) .bd-compattable-table col:nth-child(2) { width: calc(100% * 1.6 / 2.6); }
94
+
71
95
  .bd-compattable-header {
72
- display: grid;
73
- grid-template-columns: 1.4fr 1.2fr 2.4fr;
74
96
  background: var(--color-surface-subtle);
75
97
  border-bottom: var(--border-width-1) solid var(--color-border-subtle);
76
98
  }
77
99
 
78
- :host([variant="outcome"]) .bd-compattable-header {
79
- grid-template-columns: 1.2fr 1.6fr 1.6fr;
80
- }
81
-
82
- :host([variant="risk"]) .bd-compattable-header {
83
- grid-template-columns: 1fr 1.6fr;
100
+ /* A <th> centres and bolds by default; every cell here starts at the
101
+ inline start, and each sets its own weight. */
102
+ th {
103
+ text-align: start;
84
104
  }
85
105
 
86
106
  .bd-compattable-header-cell {
@@ -129,14 +149,7 @@ export default css`
129
149
  color: var(--color-text-muted);
130
150
  }
131
151
 
132
- .bd-compattable-body {
133
- display: flex;
134
- flex-direction: column;
135
- }
136
-
137
152
  .bd-compattable-row {
138
- display: grid;
139
- grid-template-columns: 1.4fr 1.2fr 2.4fr;
140
153
  /* no role: a boundary, and no border role sits at neutral-50 -- the family
141
154
  starts at container (neutral-100) and gets darker. The decision of
142
155
  2026-09-14 was that a boundary like this is DECORATIVE, so it is exempt
@@ -147,22 +160,13 @@ export default css`
147
160
  border-bottom: var(--border-width-1) solid var(--color-neutral-50);
148
161
  }
149
162
 
150
- :host([variant="outcome"]) .bd-compattable-row {
151
- grid-template-columns: 1.2fr 1.6fr 1.6fr;
152
- }
153
-
154
- :host([variant="risk"]) .bd-compattable-row {
155
- grid-template-columns: 1fr 1.6fr;
156
- }
157
-
158
163
  .bd-compattable-row:last-child {
159
164
  border-bottom: none;
160
165
  }
161
166
 
162
167
  .bd-compattable-cell {
163
168
  padding: var(--spacing-20) var(--spacing-24);
164
- display: flex;
165
- align-items: center;
169
+ vertical-align: middle;
166
170
  /* Cell data, one step back from the row label beside it, which
167
171
  is text-primary. Secondary keeps that hierarchy; primary
168
172
  would have flattened the two together. */
@@ -189,8 +193,11 @@ export default css`
189
193
  gap: var(--spacing-8);
190
194
  }
191
195
 
192
- .bd-compattable-cell--notes ::slotted(*) {
193
- vertical-align: middle;
196
+ /* the notes' own items, spaced as the cell spaced them when it was a flex row */
197
+ .bd-compattable-notes {
198
+ display: flex;
199
+ align-items: center;
200
+ gap: var(--spacing-8);
194
201
  }
195
202
 
196
203
  .bd-compattable-cell--event {
@@ -238,8 +245,15 @@ export default css`
238
245
  color: var(--color-brand-700);
239
246
  }
240
247
 
241
- /* === LIGHT VARIANT === */
248
+ /* === LIGHT VARIANT ===
249
+ A table of label / value rows that flows into light-columns columns, so
250
+ the grid is on the body and the table itself is only its box. */
242
251
  .bd-compattable-lightgrid {
252
+ display: block;
253
+ width: 100%;
254
+ }
255
+
256
+ .bd-compattable-lightbody {
243
257
  display: grid;
244
258
  grid-template-columns: repeat(var(--bd-compattable-light-columns, 2), 1fr);
245
259
  column-gap: var(--spacing-48);
@@ -263,8 +277,15 @@ export default css`
263
277
  border-bottom: var(--border-width-1) solid var(--color-border-container);
264
278
  }
265
279
 
280
+ .bd-compattable-lightlabel,
281
+ .bd-compattable-lightvalue {
282
+ padding: 0;
283
+ }
284
+
266
285
  .bd-compattable-lightlabel {
267
286
  color: var(--color-text-subtle);
287
+ /* the label read at the page's weight, as the span it was did */
288
+ font-weight: inherit;
268
289
  /* no role: same table, same decision as the header cell above. The pair of
269
290
  axes this rule sets happens to match control-label-large, but a table cell is
270
291
  not a control label -- adopting it would restyle the table rather than
@@ -287,28 +308,40 @@ export default css`
287
308
  /* no role: the weight axis of the same table, and the same decision --
288
309
  see the header cell above. */
289
310
  font-weight: var(--typography-fontWeight-semibold);
311
+ /* no role: the leading the other five text sites took, and the one this
312
+ cell was still missing -- a value that wraps read line-height: normal,
313
+ found once the light variant had a story of its own. */
314
+ line-height: var(--typography-lineHeight-tight);
290
315
  text-align: right;
291
316
  }
292
317
 
293
318
  /* === RESPONSIVE === */
294
319
  @media ${unsafeCSS(below('md'))} {
320
+ /* Stacked: each row becomes a card of its cells, and the column names
321
+ move into the cells (below). The header goes, as the guide for a
322
+ responsive table has it -- the ::before labels say the same thing. */
295
323
  .bd-compattable-header {
296
324
  display: none;
297
325
  }
298
326
 
299
- /* The two variant rules above are more specific than a bare class, and a
300
- media query adds no specificity, so naming only .bd-compattable-row here
301
- left the outcome and risk variants on their desktop column template at
302
- phone widths. Outcome stayed three columns and ran 113px off the page. */
303
- .bd-compattable-row,
304
- :host([variant="outcome"]) .bd-compattable-row,
305
- :host([variant="risk"]) .bd-compattable-row {
327
+ .bd-compattable-table,
328
+ .bd-compattable-body {
329
+ display: block;
330
+ }
331
+
332
+ /* One rule for every variant: the desktop columns are the table's <col>s
333
+ now, not per-variant row templates that outranked a bare class here --
334
+ which once left outcome three columns wide and 113px off the page. */
335
+ .bd-compattable-row {
336
+ display: grid;
306
337
  grid-template-columns: 1fr;
307
338
  padding: var(--spacing-16) var(--spacing-20);
308
339
  gap: var(--spacing-4);
309
340
  }
310
341
 
311
342
  .bd-compattable-cell {
343
+ display: flex;
344
+ align-items: center;
312
345
  padding: var(--spacing-4) 0;
313
346
  }
314
347
 
@@ -338,7 +371,7 @@ export default css`
338
371
  text-transform: uppercase;
339
372
  }
340
373
 
341
- .bd-compattable-lightgrid {
374
+ .bd-compattable-lightbody {
342
375
  grid-template-columns: 1fr;
343
376
  }
344
377
 
@@ -58,41 +58,48 @@ class CompatibilityTable extends LitElement {
58
58
  return name ? `--bd-cell-label: "${String(name).replace(/["\\]/g, "")}: "` : nothing;
59
59
  }
60
60
 
61
+ /* A native table. It was divs carrying role="table", "row", "columnheader"
62
+ and "cell", which said in ARIA what the elements say for themselves --
63
+ and only for as long as every role stayed in step with the markup, which
64
+ the rowgroup note this replaces records it once did not. The first cell
65
+ of a row names the row, so it is the row's <th>. */
61
66
  _renderRow(row) {
62
67
  if (this.variant === "outcome") {
63
68
  return html`
64
- <div class="bd-compattable-row" role="row">
65
- <span class="bd-compattable-cell bd-compattable-cell--event" role="cell">${row.event}</span>
66
- <span class="bd-compattable-cell bd-compattable-cell--without" role="cell" style=${this._cellLabel(1)}>${row.without}</span>
67
- <span class="bd-compattable-cell bd-compattable-cell--with" role="cell" style=${this._cellLabel(2)}>${row.with}</span>
68
- </div>
69
+ <tr class="bd-compattable-row">
70
+ <th class="bd-compattable-cell bd-compattable-cell--event" scope="row">${row.event}</th>
71
+ <td class="bd-compattable-cell bd-compattable-cell--without" style=${this._cellLabel(1)}>${row.without}</td>
72
+ <td class="bd-compattable-cell bd-compattable-cell--with" style=${this._cellLabel(2)}>${row.with}</td>
73
+ </tr>
69
74
  `;
70
75
  }
71
76
 
72
77
  if (this.variant === "risk") {
73
78
  return html`
74
- <div class="bd-compattable-row" role="row">
75
- <span class="bd-compattable-cell bd-compattable-cell--category" role="cell">${row.category}</span>
76
- <span class="bd-compattable-cell bd-compattable-cell--riskcoverage" role="cell" style=${this._cellLabel(1)}>${row.coverage}</span>
77
- </div>
79
+ <tr class="bd-compattable-row">
80
+ <th class="bd-compattable-cell bd-compattable-cell--category" scope="row">${row.category}</th>
81
+ <td class="bd-compattable-cell bd-compattable-cell--riskcoverage" style=${this._cellLabel(1)}>${row.coverage}</td>
82
+ </tr>
78
83
  `;
79
84
  }
80
85
 
81
86
  if (this.variant === "light") {
82
87
  return html`
83
- <div class="bd-compattable-lightrow" role="row">
84
- <span class="bd-compattable-lightlabel" role="cell">${row.label}</span>
85
- <span class="bd-compattable-lightvalue" role="cell">${row.value}</span>
86
- </div>
88
+ <tr class="bd-compattable-lightrow">
89
+ <th class="bd-compattable-lightlabel" scope="row">${row.label}</th>
90
+ <td class="bd-compattable-lightvalue">${row.value}</td>
91
+ </tr>
87
92
  `;
88
93
  }
89
94
 
95
+ /* notes may be a template of several inline items, which the cell spaced
96
+ as a flex row; a table cell cannot be one, so the content is wrapped */
90
97
  return html`
91
- <div class="bd-compattable-row" role="row">
92
- <span class="bd-compattable-cell bd-compattable-cell--environment" role="cell">${row.environment}</span>
93
- <span class="bd-compattable-cell bd-compattable-cell--coverage" role="cell" style=${this._cellLabel(1)}>${row.coverage}</span>
94
- <span class="bd-compattable-cell bd-compattable-cell--notes" role="cell" style=${this._cellLabel(2)}>${row.notes}</span>
95
- </div>
98
+ <tr class="bd-compattable-row">
99
+ <th class="bd-compattable-cell bd-compattable-cell--environment" scope="row">${row.environment}</th>
100
+ <td class="bd-compattable-cell bd-compattable-cell--coverage" style=${this._cellLabel(1)}>${row.coverage}</td>
101
+ <td class="bd-compattable-cell bd-compattable-cell--notes" style=${this._cellLabel(2)}><span class="bd-compattable-notes">${row.notes}</span></td>
102
+ </tr>
96
103
  `;
97
104
  }
98
105
 
@@ -119,33 +126,33 @@ class CompatibilityTable extends LitElement {
119
126
 
120
127
  ${this.variant === "light"
121
128
  ? html`
122
- <div
129
+ <table
123
130
  class="bd-compattable-lightgrid"
124
- role="table"
125
131
  style="--bd-compattable-light-columns: ${this.lightColumns};"
126
132
  >
127
- ${this.rows.map((row) => this._renderRow(row))}
128
- <slot name="rows"></slot>
129
- </div>
133
+ <tbody class="bd-compattable-lightbody">
134
+ ${this.rows.map((row) => this._renderRow(row))}
135
+ </tbody>
136
+ </table>
137
+ <slot name="rows"></slot>
130
138
  `
131
139
  : html`
132
- <div class="bd-compattable-table-container" role="table">
133
- <div class="bd-compattable-header" role="row">
134
- ${columns.map(
135
- (col) => html`<span class="bd-compattable-header-cell" role="columnheader">${col}</span>`
136
- )}
137
- </div>
138
-
139
- <!-- role="rowgroup", because role="table" must own rowgroups or
140
- rows and this div had no role at all. Measured in the
141
- accessibility tree before it: table > row (the header),
142
- then a "none" node holding all five data rows, so the rows
143
- were not table-owned and their position and count were not
144
- the table's to compute. One attribute; no visual change. -->
145
- <div class="bd-compattable-body" role="rowgroup">
146
- ${this.rows.map((row) => this._renderRow(row))}
147
- </div>
148
-
140
+ <div class="bd-compattable-table-container">
141
+ <table class="bd-compattable-table">
142
+ <colgroup>${columns.map(() => html`<col>`)}</colgroup>
143
+ <thead class="bd-compattable-header">
144
+ <tr>
145
+ ${columns.map(
146
+ (col) => html`<th class="bd-compattable-header-cell" scope="col">${col}</th>`
147
+ )}
148
+ </tr>
149
+ </thead>
150
+ <tbody class="bd-compattable-body">
151
+ ${this.rows.map((row) => this._renderRow(row))}
152
+ </tbody>
153
+ </table>
154
+ <!-- after the table, inside the card: a slotted element
155
+ cannot become a row of a native table -->
149
156
  <slot name="rows"></slot>
150
157
  </div>
151
158
  `}