@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,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 { DEFAULT_THEME } from '../../tokens/themes/index.js';
@@ -6,7 +6,7 @@ import { DEFAULT_THEME } from '../../tokens/themes/index.js';
6
6
  JS cannot drift apart again: bd-footer switched at 767 while bd-footer-lp,
7
7
  sharing footer-nav-menu.css.js, switched at 768 — so at exactly 768px the
8
8
  LP footer rendered its mobile markup under the desktop stylesheet. */
9
- import { matchesBelow } from '../shared/token-scales.js';
9
+ import { below, matchesBelow } from '../shared/token-scales.js';
10
10
  import '../../components/divider/divider-horizontal.js';
11
11
  import '../../components/divider/divider-vertical.js';
12
12
  import '../../components/footer/footer-links-group.js';
@@ -20,14 +20,21 @@ import "../icons/globe-icon.js";
20
20
  import footerCSS from './footer.css.js';
21
21
  import { ensembleCSS } from '../shared/ensemble.css.js';
22
22
  import { localeMap } from './localeMap.js';
23
-
24
- /* The locale a footer shows when neither the page nor the URL says otherwise. */
25
- const DEFAULT_LOCALE = 'en';
23
+ import { DEFAULT_LOCALE, localeFromPath, toggleImpressum } from './footer-locale.js';
24
+ import { footerAnpc, footerLogo, footerMasterbrand } from './footer-images.js';
25
+
26
+ /* The labels in localeMap not written in their locale's language. A label is
27
+ "<place> - <language>", and these two were read in a Chinese voice: Hong
28
+ Kong's is English throughout, and Taiwan's place name is English beside
29
+ 台灣. */
30
+ const LABEL_LANG = {
31
+ 'zh-HK': { place: 'en', language: 'en' },
32
+ 'zh-TW': { place: 'en' }
33
+ };
26
34
 
27
35
  export class BdFooter extends LitElement {
28
36
  static properties = {
29
- _countriesOpen : { state: true },
30
- selectedCountry : { state: true },
37
+ selectedCountry : { state: true },
31
38
  /* `current-locale` and `max-columns-per-row`, both documented dash-cased
32
39
  and both previously inert for the same reason as bd-header above: Lit
33
40
  lowercases a property name to get its observed attribute, so these were
@@ -48,20 +55,17 @@ export class BdFooter extends LitElement {
48
55
 
49
56
  Zero consumers of either working lowercase spelling across src, schemas
50
57
  and docs, and no property bindings, so naming the attributes is safe. */
51
- currentLocale : { type: String, attribute: "current-locale" },
52
- maxColumnsPerRow : { type: Number, attribute: "max-columns-per-row" },
53
- _isMobile : { state: true },
54
- _countriesContainer: { state: true }
58
+ currentLocale : { type: String, attribute: "current-locale" },
59
+ maxColumnsPerRow: { type: Number, attribute: "max-columns-per-row" },
60
+ _isMobile : { state: true }
55
61
  };
56
62
 
57
63
  constructor() {
58
64
  super();
59
- this._countriesOpen = false;
60
65
  this.maxColumnsPerRow = 2;
61
66
  this.currentLocale = DEFAULT_LOCALE;
62
67
  this.selectedCountry = 'Choose your country';
63
68
  this._isMobile = matchesBelow('md');
64
- this._countriesContainer = null;
65
69
  }
66
70
 
67
71
  connectedCallback() {
@@ -81,12 +85,22 @@ export class BdFooter extends LitElement {
81
85
  this._localeExplicit =
82
86
  this.hasAttribute('current-locale') || this.currentLocale !== DEFAULT_LOCALE;
83
87
  this._initLocaleFromUrl();
84
- window.addEventListener('resize', this._handleResize.bind(this));
88
+ this._watchViewport();
85
89
  }
86
90
 
87
91
  disconnectedCallback() {
88
92
  super.disconnectedCallback();
89
- window.removeEventListener('resize', this._handleResize.bind(this));
93
+ this._viewport?.removeEventListener('change', this._onViewport);
94
+ }
95
+
96
+ /* The viewport, as one media query's change event. It was a window resize
97
+ listener, removed with a fresh .bind(this) that matched nothing, so every
98
+ footer ever disconnected kept its listener and kept running. */
99
+ _watchViewport() {
100
+ this._onViewport ??= e => { this._isMobile = e.matches; };
101
+ this._viewport ??= window.matchMedia(below('md'));
102
+ this._viewport.addEventListener('change', this._onViewport);
103
+ this._isMobile = this._viewport.matches;
90
104
  }
91
105
 
92
106
  firstUpdated() {
@@ -97,11 +111,6 @@ export class BdFooter extends LitElement {
97
111
  if (changedProps.has('currentLocale')) {
98
112
  this._toggleImpressumVisibility();
99
113
  }
100
-
101
- if (changedProps.has('_countriesOpen') && this._countriesOpen) {
102
- this._countriesContainer = this.shadowRoot.querySelector('.footer-countries-container');
103
- this._scrollToCountries();
104
- }
105
114
  }
106
115
 
107
116
  /* maxColumnsPerRow, finally read. The property has been declared here with
@@ -129,51 +138,21 @@ export class BdFooter extends LitElement {
129
138
  }
130
139
 
131
140
  _toggleImpressumVisibility() {
132
- const showImpressum = this.locale === 'de-de' || this.locale === 'de';
133
- const slot = this.shadowRoot.querySelector('slot[name="secondary-nav"]');
134
- const assignedElements = slot?.assignedElements({ flatten: true }) || [];
135
-
136
- if (assignedElements.length > 0) {
137
- const footerNav = assignedElements[0];
138
- const impressumLink = footerNav.querySelector('.impressum-link');
139
- const impressumDivider = footerNav.querySelector('bd-divider-vertical + .impressum-link')?.previousElementSibling;
140
-
141
- if (impressumLink) {
142
- impressumLink.style.display = showImpressum ? '' : 'none';
143
-
144
- if (impressumDivider && impressumDivider.tagName === 'BD-DIVIDER-VERTICAL') {
145
- impressumDivider.style.display = showImpressum ? '' : 'none';
146
- }
147
- }
148
- }
141
+ toggleImpressum(this.shadowRoot.querySelector('slot[name="secondary-nav"]'), this.locale);
149
142
  }
150
143
 
144
+ /* Smooth only for a reader who has not asked for reduced motion. */
151
145
  _scrollToCountries() {
152
- const container = this.shadowRoot.querySelector('.footer-countries-container');
153
- if (container) {
154
- setTimeout(() => {
155
- container.scrollIntoView({
156
- behavior: 'smooth',
157
- block : 'start'
158
- });
159
- }, 100);
160
- }
146
+ this.shadowRoot.querySelector('.footer-countries-container')
147
+ ?.scrollIntoView({ behavior: this._scrollBehavior, block: 'start' });
161
148
  }
162
149
 
163
150
  _scrollToTop() {
164
- this.scrollIntoView({
165
- behavior: 'smooth',
166
- block : 'start'
167
- });
151
+ this.scrollIntoView({ behavior: this._scrollBehavior, block: 'start' });
168
152
  }
169
153
 
170
- _handleResize() {
171
- this._isMobile = matchesBelow('md');
172
- const newIsMobile = matchesBelow('md');
173
-
174
- if (this._isMobile !== newIsMobile) {
175
- this._isMobile = newIsMobile;
176
- }
154
+ get _scrollBehavior() {
155
+ return window.matchMedia('(prefers-reduced-motion: reduce)').matches ? 'auto' : 'smooth';
177
156
  }
178
157
 
179
158
  /* Locale precedence, and it is a precedence rather than a sequence of
@@ -198,89 +177,40 @@ export class BdFooter extends LitElement {
198
177
  The second is why Storybook showed "iframe.html" as a locale, and the fix
199
178
  is not a Storybook exception -- there is none here. A segment that does
200
179
  not resolve against localeMap is simply not a locale, on any host. The
201
- resolution itself (exact key, then language with a matching region, then
202
- any key sharing the language) is unchanged; only its authority is. */
180
+ resolution itself is localeFromPath (footer-locale.js), which bd-footer-lp
181
+ shares; only its authority is decided here. */
203
182
  _initLocaleFromUrl() {
204
183
  if (this._localeExplicit) return;
205
184
 
206
- const urlLocale = window.location.pathname.split('/')[1]?.toLowerCase();
207
- if (!urlLocale) return;
208
-
209
- const normalized = {};
210
- Object.entries(localeMap).forEach(([key, value]) => {
211
- normalized[key.toLowerCase()] = value;
212
- });
213
- const originalKeyFor = lower =>
214
- Object.keys(localeMap).find(k => k.toLowerCase() === lower);
215
-
216
- let resolvedKey = null;
217
- let country = null;
218
-
219
- if (normalized[urlLocale]) {
220
- resolvedKey = originalKeyFor(urlLocale) || urlLocale;
221
- country = normalized[urlLocale];
222
- } else {
223
- const [language, region] = urlLocale.split('-');
224
- const sameLanguage = Object.entries(normalized)
225
- .filter(([key]) => key.startsWith(language));
226
-
227
- if (sameLanguage.length) {
228
- const exactRegion = sameLanguage.find(([key]) => {
229
- const keyRegion = key.split('-')[1];
230
- return (region && keyRegion === region) || (!region && !keyRegion);
231
- });
232
- const [matchKey, matchCountry] = exactRegion || sameLanguage[0];
233
- resolvedKey = originalKeyFor(matchKey) || matchKey;
234
- country = matchCountry;
235
- }
236
- }
185
+ const resolved = localeFromPath(window.location.pathname);
237
186
 
238
187
  /* Nothing resolved: the segment is not a locale, so neither the locale nor
239
188
  the country is touched. This is the line that used to assign the raw
240
189
  path segment. */
241
- if (!resolvedKey) return;
242
-
243
- this.currentLocale = resolvedKey;
244
- this.selectedCountry = country;
245
- }
246
-
247
- _toggleCountries() {
248
- this._countriesOpen = !this._countriesOpen;
249
-
250
- if (!this._countriesOpen) {
251
- this._scrollToTop();
252
- }
253
- }
190
+ if (!resolved) return;
254
191
 
255
- _closeCountries() {
256
- this._countriesOpen = false;
257
-
258
- if (!this._isMobile) {
259
- this._scrollToTop();
260
- }
192
+ [this.currentLocale, this.selectedCountry] = resolved;
261
193
  }
262
194
 
263
- _handleCountryClick(e, countryLabel, locale) {
264
- e.preventDefault();
265
- this._selectCountry(countryLabel);
266
-
267
- const newPath = `/${locale.toLowerCase()}/`;
268
- window.location.href = newPath;
195
+ /* The country list is a <details>, so the browser keeps its state, its
196
+ expanded/collapsed announcement and its keyboard, and finds a country in
197
+ it with Ctrl+F while it is shut. What is left here is where the page
198
+ scrolls: to the list when it opens, back to the footer when it shuts --
199
+ except from the list's own close button on a phone, where the reader is
200
+ already where they want to be. */
201
+ _onCountriesToggle(e) {
202
+ if (e.target.open) this._scrollToCountries();
203
+ else if (!this._closingInPlace) this._scrollToTop();
204
+ this._closingInPlace = false;
269
205
  }
270
206
 
271
- _selectCountry(countryLabel) {
272
- this.selectedCountry = countryLabel;
273
- this._countriesOpen = false;
274
-
275
- const localeEntry = Object.entries(localeMap).find(
276
- ([, country]) => country === countryLabel
277
- );
278
-
279
- if (localeEntry) {
280
- this.currentLocale = localeEntry[0];
281
- }
282
-
283
- this._scrollToTop();
207
+ /* Focus goes back to the summary, which is what opened the list: the
208
+ button that had it is inside the list, and closing it hides it. */
209
+ _closeCountries(e) {
210
+ const details = e.currentTarget.closest('details');
211
+ this._closingInPlace = this._isMobile;
212
+ details.open = false;
213
+ details.querySelector('summary').focus({ preventScroll: true });
284
214
  }
285
215
 
286
216
  getCountriesList() {
@@ -290,25 +220,32 @@ export class BdFooter extends LitElement {
290
220
  }));
291
221
  }
292
222
 
293
- get locale() {
294
- const val = (this.currentLocale || 'en').toLowerCase();
295
- return val;
223
+ /* The languages a country's label is written in: its place, and the
224
+ language after the dash. lang is how the label is read aloud, and
225
+ hreflang, not lang, says what the link leads to, so a label written in
226
+ another language than its locale's says so (LABEL_LANG). */
227
+ _labelLang({ locale }) {
228
+ return { place: locale, language: locale, ...LABEL_LANG[locale] };
296
229
  }
297
230
 
298
- _updateSlotStyles() {
299
- const isMobile = matchesBelow('md');
300
- const slot = this.shadowRoot.querySelector('slot[name="nav"]');
301
- const assignedElements = slot.assignedElements();
231
+ /* The place in a lang of its own only when it differs from the rest. No
232
+ whitespace is added: the label reads as localeMap spells it. */
233
+ _renderCountryLabel(c) {
234
+ const { place, language } = this._labelLang(c);
235
+ const [name, tongue] = c.label.split(' - ');
236
+ if (place === language || tongue === undefined) return c.label;
237
+ return html`<span lang="${place}">${name}</span> - ${tongue}`;
238
+ }
302
239
 
303
- assignedElements.forEach(element => {
304
- if (isMobile) {
305
- element.style.color = 'var(--color-neutral-900)';
306
- element.style.setProperty('color', 'var(--color-neutral-900)', 'important');
307
- } else {
308
- element.style.color = '';
309
- element.style.removeProperty('color');
310
- }
311
- });
240
+ /* The country the page is in: the one picked from the URL, or the one an
241
+ explicit current-locale names exactly. */
242
+ _isCurrentCountry({ locale, label }) {
243
+ return this.selectedCountry === label || locale.toLowerCase() === this.locale;
244
+ }
245
+
246
+ get locale() {
247
+ const val = (this.currentLocale || 'en').toLowerCase();
248
+ return val;
312
249
  }
313
250
 
314
251
  /* No _updateNavLinks. It queried '.footer-nav-main bd-link' inside this
@@ -330,15 +267,6 @@ export class BdFooter extends LitElement {
330
267
  const showAnpc = this.locale.startsWith('ro');
331
268
  const countriesList = this.getCountriesList();
332
269
 
333
- const masterbrandUrl = this._isMobile
334
- ? '/assets/Bitdefender-Masterbrand_mobile.png'
335
- : '/assets/Bitdefender-Masterbrand.png';
336
-
337
- const anpcUrl = this._isMobile
338
- ? '/assets/anpc_mobile.png'
339
- : '/assets/anpc.png';
340
-
341
- const logoUrl = '/assets/BD_logo.png';
342
270
  const chunkSize = Math.ceil(countriesList.length / 3);
343
271
  const countryChunks = [
344
272
  countriesList.slice(0, chunkSize),
@@ -365,15 +293,13 @@ export class BdFooter extends LitElement {
365
293
  <div class="footer-top">
366
294
  <div class="footer-logo">
367
295
  <slot name="logo">
368
- <span><img src="${logoUrl}" alt="Bitdefender Logo"></span>
296
+ <span>${footerLogo}</span>
369
297
  </slot>
370
298
  </div>
371
299
  <div class="footer-top-right">
372
300
  <slot name="top-right">
373
301
  <div slot="top-right">
374
- <span slot="logo">
375
- <img src="${masterbrandUrl}" alt="Bitdefender Masterbrand">
376
- </span>
302
+ <span slot="logo">${footerMasterbrand}</span>
377
303
  </div>
378
304
  </slot>
379
305
  </div>
@@ -452,27 +378,27 @@ export class BdFooter extends LitElement {
452
378
  ${showAnpc
453
379
  ? html`
454
380
  <div class="footer-anpc">
455
- <slot name="anpc">
456
- <img src="${anpcUrl}" alt="Certificat" />
457
- </slot>
381
+ <slot name="anpc">${footerAnpc}</slot>
458
382
  </div>
459
383
  `
460
384
  : null}
461
385
 
462
- <div class="footer-countries-toggle">
463
- <button class="country-toggle" @click="${this._toggleCountries}">
464
- <bd-globe-icon size="20" color="white"></bd-globe-icon>
465
- ${this.selectedCountry}
466
- ${this._countriesOpen
467
- ? html`<bd-arrow-up-icon size="20" color="white"></bd-arrow-up-icon>`
468
- : html`<bd-arrow-down-icon size="20" color="white"></bd-arrow-down-icon>`
469
- }
470
- </button>
471
- </div>
472
- </div>
473
-
474
- ${this._countriesOpen
475
- ? html`
386
+ <!-- The list is the summary's own content, so it opens under the
387
+ toggle in the same row; the stylesheet runs it the row's full width.
388
+ Its links are plain anchors: a reader who picks a country follows a
389
+ link: hreflang says which language it leads to, lang which one its
390
+ label is in. -->
391
+ <!-- No icon here has a colour of its own: each takes its summary's or
392
+ button's, so forced colours repaint it (footer.css.js). -->
393
+ <details class="footer-countries-toggle" @toggle="${this._onCountriesToggle}">
394
+ <summary class="country-toggle">
395
+ <span class="country-toggle-row">
396
+ <bd-globe-icon size="20"></bd-globe-icon>
397
+ <span class="country-toggle-label">${this.selectedCountry}</span>
398
+ <bd-arrow-down-icon class="when-closed" size="20"></bd-arrow-down-icon>
399
+ <bd-arrow-up-icon class="when-open" size="20"></bd-arrow-up-icon>
400
+ </span>
401
+ </summary>
476
402
  <div class="footer-countries-container">
477
403
  <!-- The icon is the only content and bd-close-icon's svg is aria-hidden,
478
404
  so without a label this button had no accessible name at all: a
@@ -484,25 +410,21 @@ export class BdFooter extends LitElement {
484
410
  aria-label="Close country list"
485
411
  @click="${this._closeCountries}"
486
412
  >
487
- <bd-close-icon size="18" color="white"></bd-close-icon>
413
+ <bd-close-icon size="18"></bd-close-icon>
488
414
  </button>
489
415
  ${countryChunks.map(chunk => html`
490
- <bd-footer-links-group slot="countries" title="${chunk === countryChunks[0] ? 'Choose your country' : ''}">
491
- ${chunk.map(c => html`
492
- <bd-link
416
+ <bd-footer-links-group title="${chunk === countryChunks[0] ? 'Choose your country' : ''}">
417
+ ${chunk.map(c => html`<a
493
418
  href="/${c.locale.toLowerCase()}/"
494
- data-locale="${c.locale}"
495
- variant="light"
496
- class="${this.selectedCountry === c.label ? 'selected' : ''}"
497
- @click="${(e) => this._handleCountryClick(e, c.label, c.locale)}">
498
- ${c.label}
499
- </bd-link>
500
- `)}
419
+ hreflang="${c.locale}"
420
+ lang="${this._labelLang(c).language}"
421
+ aria-current="${this._isCurrentCountry(c) ? 'true' : nothing}"
422
+ >${this._renderCountryLabel(c)}</a>`)}
501
423
  </bd-footer-links-group>
502
424
  `)}
503
425
  </div>
504
- `
505
- : null}
426
+ </details>
427
+ </div>
506
428
  </footer>
507
429
  `;
508
430
  }
@@ -38,14 +38,24 @@ export default {
38
38
  ### Responsive Behavior
39
39
  | Width | Behavior |
40
40
  |---|---|
41
- | \`≤ 767px\` | Mobile layout, extra dividers, mobile masterbrand image |
41
+ | \`≤ 767px\` | Mobile layout, extra dividers, mobile masterbrand and ANPC images |
42
42
  | \`> 767px\` | Desktop layout |
43
43
 
44
+ The phone images are \`<picture><source media>\`, so the browser fetches one
45
+ file per image; every default image is lazy and sized.
46
+
44
47
  ### Country Selector
45
- - Clicking the country toggle opens a 3-column country grid
46
- - Selecting a country navigates to \`/{locale}/\`
48
+ - A native \`<details>\`: the toggle is its \`<summary>\`, announced as expanded
49
+ or collapsed, and the list opens under it in a 3-column grid
50
+ - Each country is a plain link to \`/{locale}/\` with \`hreflang\` and \`lang\`;
51
+ the current one carries \`aria-current\`
47
52
  - Locale is auto-detected from \`window.location.pathname\`
48
53
 
54
+ ### Navigation names
55
+ Each \`bd-footer-nav\` is a \`<nav>\` named by its \`label\` ("Footer" by
56
+ default). With two in one footer, give each its own: \`label="Solutions"\`,
57
+ \`label="Company and legal"\`.
58
+
49
59
  ### Locale-specific Features
50
60
  - \`de\` / \`de-de\`: Shows Impressum link in secondary nav
51
61
  - \`ro*\`: Shows ANPC compliance image
@@ -124,7 +134,7 @@ export const WithCustomLogo = {
124
134
  render: () => html`
125
135
  <bd-footer current-locale="en">
126
136
  <span slot="logo">
127
- <img src="/assets/custom-logo.png" alt="Custom Logo" style="height:32px;">
137
+ <img src="/assets/BD_logo.png" alt="Custom Logo" style="height:32px;">
128
138
  </span>
129
139
  ${quickLinks}
130
140
  </bd-footer>
@@ -1,10 +1,37 @@
1
- import { css } from "lit";
1
+ import { css, unsafeCSS } from "lit";
2
+ import { above } from "../shared/token-scales.js";
3
+ import { hostFillsWidth } from "../shared/fill-width.css.js";
2
4
 
5
+ /* The column steps follow the grid's own width, not the screen's. A grid is
6
+ what a component is laid out on, and it is as often in a half column, a
7
+ card or a tab as across the page; a 3-column step taken at a 992 screen
8
+ gave a 360 column 104px cells.
9
+
10
+ The widths it steps at are the page column's at sm, md and lg -- 492, 656
11
+ and 880, --grid-container-max-* less twice --grid-padding-* -- so a grid
12
+ as wide as the page column steps exactly where it did when it read the
13
+ screen (at 768 and 992; at 524 rather than 576 for sm, because the xs
14
+ column runs wider than the sm one), and a grid in anything narrower steps
15
+ later. One of the four always applies, so nothing the screen-width rules
16
+ below say survives in a grid that is a container.
17
+
18
+ The grid fills its column, less its own margins (shared/fill-width.css.js),
19
+ because a size container contributes nothing to its own intrinsic width:
20
+ in a parent that sizes it to its content (a flex row, a grid with
21
+ justify-items: start -- this one's own default) it would measure 0. A page
22
+ that wants that, a grid hugging its content, sets
23
+ --bd-grid-container-type: normal and --bd-grid-width: auto on it, and the
24
+ grid steps with the screen, as it always did. */
3
25
  export default css`
4
26
  :host {
5
27
  display: block;
28
+ container-name: bd-grid;
29
+ container-type: var(--bd-grid-container-type, inline-size);
30
+ box-sizing: border-box;
6
31
  }
7
32
 
33
+ ${hostFillsWidth("--bd-grid-width")}
34
+
8
35
  .grid {
9
36
  display: grid;
10
37
  gap: var(--spacing-24);
@@ -19,22 +46,54 @@ export default css`
19
46
  }
20
47
 
21
48
  /* Responsive overrides: the columns and the gap step together; a gap
22
- left unset carries the one below it up */
23
- @media (min-width: 576px) {
49
+ left unset carries the one below it up.
50
+
51
+ By the screen: only where the page has opted the grid out of being a
52
+ container, since the container rules after these always win. */
53
+ @media ${unsafeCSS(above('sm'))} {
54
+ .grid {
55
+ grid-template-columns: repeat(var(--grid-cols-sm), 1fr);
56
+ gap: var(--grid-gap-sm, var(--spacing-24));
57
+ }
58
+ }
59
+
60
+ @media ${unsafeCSS(above('md'))} {
61
+ .grid {
62
+ grid-template-columns: repeat(var(--grid-cols-md), 1fr);
63
+ gap: var(--grid-gap-md, var(--spacing-24));
64
+ }
65
+ }
66
+
67
+ @media ${unsafeCSS(above('lg'))} {
68
+ .grid {
69
+ grid-template-columns: repeat(var(--grid-cols-lg), 1fr);
70
+ gap: var(--grid-gap-lg, var(--spacing-24));
71
+ }
72
+ }
73
+
74
+ /* By the grid's own width. */
75
+ @container bd-grid (width < 492px) {
76
+ .grid {
77
+ grid-template-columns: repeat(var(--grid-cols), 1fr);
78
+ gap: var(--grid-gap, var(--spacing-24));
79
+ }
80
+ }
81
+
82
+ @container bd-grid (492px <= width < 656px) {
24
83
  .grid {
25
84
  grid-template-columns: repeat(var(--grid-cols-sm), 1fr);
26
85
  gap: var(--grid-gap-sm, var(--spacing-24));
27
86
  }
28
87
  }
29
88
 
30
- @media (min-width: 768px) {
89
+ @container bd-grid (656px <= width < 880px) {
31
90
  .grid {
32
91
  grid-template-columns: repeat(var(--grid-cols-md), 1fr);
33
92
  gap: var(--grid-gap-md, var(--spacing-24));
34
93
  }
35
94
  }
36
95
 
37
- @media (min-width: 992px) {
96
+ @container bd-grid (width >= 880px) {
38
97
  .grid {
39
98
  grid-template-columns: repeat(var(--grid-cols-lg), 1fr);
40
99
  gap: var(--grid-gap-lg, var(--spacing-24));
@@ -7,7 +7,9 @@ export default css`
7
7
  font-family: var(--typography-fontFamily-sans);
8
8
  position: relative;
9
9
  background-color: var(--color-surface-default);
10
- overflow: hidden; /* clips the ::after floor grid, which extends past the edges */
10
+ /* clips the ::after floor grid, which extends past the edges. clip, not
11
+ hidden: nothing in here scrolls, so it needs no scroll container. */
12
+ overflow: clip;
11
13
  }
12
14
 
13
15
  :host([variant="tint"]) {
@@ -18,16 +20,14 @@ export default css`
18
20
  :host([variant="tint"])::after {
19
21
  content: "";
20
22
  position: absolute;
21
- left: -20%;
22
- right: -20%;
23
- bottom: -38%;
23
+ inset-inline: -20%;
24
+ inset-block-end: -38%;
24
25
  height: 72%;
25
26
  transform-origin: 50% 0;
26
27
  transform: perspective(620px) rotateX(64deg);
27
28
  background:
28
29
  linear-gradient(color-mix(in srgb, var(--color-brand-500) 10%, transparent) 1px, transparent 1px) 0 0 / 100% 44px,
29
30
  linear-gradient(90deg, color-mix(in srgb, var(--color-brand-500) 10%, transparent) 1px, transparent 1px) 0 0 / 44px 100%;
30
- -webkit-mask-image: linear-gradient(transparent 0%, var(--color-neutral-1000) 45%, transparent 100%);
31
31
  mask-image: linear-gradient(transparent 0%, var(--color-neutral-1000) 45%, transparent 100%);
32
32
  pointer-events: none;
33
33
  z-index: 0;
@@ -235,7 +235,16 @@ export default css`
235
235
  .bd-headercode-right ::slotted(*) {
236
236
  display: block;
237
237
  width: 100%;
238
- box-shadow: 0 1px 2px #0003, 0 18px 48px #000a1e73;
238
+ /* no token: the code window's lift off the hero -- a 20% black contact
239
+ line under a 45% navy ambient layer. No --shadow-* step is that deep
240
+ (xl blurs 25px at 10%). The black is mixed over the palette, as the
241
+ annotation's shadow below is (it was #0003, the same pixels). The navy,
242
+ #000a1e73, stays a literal and stays in the lint baseline: it is no
243
+ palette step -- between neutral-950 and blue-950 -- so mixing it from
244
+ one would recolour it, and tinting it with --color-brand-950 would make
245
+ the shadow follow a partner theme, which is a design call. */
246
+ box-shadow: 0 1px 2px color-mix(in srgb, var(--color-neutral-1000) 20%, transparent),
247
+ 0 18px 48px #000a1e73;
239
248
  position: relative;
240
249
  z-index: var(--z-base); /* sits above the rings */
241
250
  }
@@ -299,14 +308,14 @@ export default css`
299
308
  }
300
309
 
301
310
  .bd-headercode-annotation--top {
302
- top: calc(-1 * var(--spacing-14));
303
- right: var(--spacing-32);
311
+ inset-block-start: calc(-1 * var(--spacing-14));
312
+ inset-inline-end: var(--spacing-32);
304
313
  }
305
314
 
306
315
  .bd-headercode-annotation--bottom {
307
- bottom: calc(-1 * var(--spacing-14));
308
- left: var(--spacing-16);
309
- right: auto;
316
+ inset-block-end: calc(-1 * var(--spacing-14));
317
+ inset-inline-start: var(--spacing-16);
318
+ inset-inline-end: auto;
310
319
  }
311
320
 
312
321
  .bd-headercode-annotation:not(:has(*)) {
@@ -144,7 +144,7 @@ class HeaderCode extends LitElement {
144
144
  font-family="mono"
145
145
  letter-spacing="widest"
146
146
  >${fact.label}</bd-p>
147
- <bd-p kind="regular" font-weight="bold" class="bd-headercode-meta-fact-value">${fact.value}</bd-p>
147
+ <bd-p variant="regular" font-weight="bold" class="bd-headercode-meta-fact-value">${fact.value}</bd-p>
148
148
  </div>
149
149
  `
150
150
  )}