@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.
- package/CHANGELOG.md +91 -0
- package/README.md +2 -1
- package/package.json +14 -27
- package/schemas/component-manifest.json +226 -33
- package/schemas/manifest-omissions.json +23 -0
- package/src/components/accordion/accordion-bg.css.js +39 -30
- package/src/components/accordion/accordion-bg.js +17 -28
- package/src/components/accordion/accordion-bg.stories.js +5 -0
- package/src/components/accordion/accordion-panel.js +24 -0
- package/src/components/accordion/accordion.css.js +105 -111
- package/src/components/accordion/accordion.js +23 -37
- package/src/components/accordion/accordion.stories.js +5 -1
- package/src/components/anchor/anchor-nav.css.js +131 -53
- package/src/components/anchor/anchor-nav.js +276 -201
- package/src/components/annotation/annotation.css.js +7 -4
- package/src/components/architecture.stories.js +8 -7
- package/src/components/audience-card/audience-card.css.js +30 -4
- package/src/components/audience-card/audience-card.js +8 -13
- package/src/components/awards/awards-flex.css.js +23 -6
- package/src/components/awards/awards-flex.js +21 -6
- package/src/components/awards/awards-spotlight.css.js +25 -5
- package/src/components/awards/awards-spotlight.js +19 -7
- package/src/components/awards/awards.css.js +20 -8
- package/src/components/awards/awards.js +30 -91
- package/src/components/awards/awards.stories.js +5 -5
- package/src/components/awards/scroll-slides.js +128 -0
- package/src/components/back/back.css.js +2 -0
- package/src/components/badge/badge.css.js +15 -0
- package/src/components/bento-grid/bento-grid.css.js +105 -11
- package/src/components/bento-grid/bento-grid.js +37 -124
- package/src/components/bento-grid/bento-grid.stories.js +3 -2
- package/src/components/bento-grid/bento-item.css.js +71 -32
- package/src/components/bento-grid/bento-item.js +3 -30
- package/src/components/blockquote/blockquote.css.js +2 -2
- package/src/components/breadcrumb/breadcrumb.css.js +10 -9
- package/src/components/breadcrumb/breadcrumb.js +35 -34
- package/src/components/button/button.css.js +42 -17
- package/src/components/button/button.js +84 -3
- package/src/components/button/button.stories.js +17 -0
- package/src/components/card-features/card-features.css.js +23 -2
- package/src/components/card-features/card-features.js +6 -48
- package/src/components/cards/card.css.js +43 -14
- package/src/components/cards/card.js +43 -177
- package/src/components/cards/card.stories.js +8 -10
- package/src/components/carousel/carousel.css.js +101 -70
- package/src/components/carousel/carousel.js +107 -71
- package/src/components/carousel/carousel.stories.js +18 -16
- package/src/components/checkbox/checkbox.css.js +26 -9
- package/src/components/checkbox/checkbox.js +73 -39
- package/src/components/checkbox/checkbox.stories.js +35 -18
- package/src/components/compare/compare.css.js +68 -10
- package/src/components/compare/compare.js +40 -103
- package/src/components/compare/compare.stories.js +1 -1
- package/src/components/compatibility-table/compatibility-table.css.js +70 -37
- package/src/components/compatibility-table/compatibility-table.js +47 -40
- package/src/components/compatibility-table/compatibility-table.stories.js +78 -1
- package/src/components/display/display.css.js +7 -0
- package/src/components/dropdown/dropdown.css.js +20 -3
- package/src/components/dropdown/dropdown.js +57 -21
- package/src/components/dropdown/dropdown.stories.js +31 -9
- package/src/components/features/features.css.js +56 -21
- package/src/components/features/features.js +7 -117
- package/src/components/fieldset/fieldset.stories.js +68 -0
- package/src/components/footer/footer-images.js +34 -0
- package/src/components/footer/footer-links-group.css.js +10 -10
- package/src/components/footer/footer-locale.js +47 -0
- package/src/components/footer/footer-lp.js +27 -114
- package/src/components/footer/footer-lp.stories.js +2 -2
- package/src/components/footer/footer-nav-menu.css.js +2 -2
- package/src/components/footer/footer-nav-menu.js +8 -3
- package/src/components/footer/footer.css.js +238 -197
- package/src/components/footer/footer.js +109 -187
- package/src/components/footer/footer.stories.js +14 -4
- package/src/components/grid/grid.css.js +64 -5
- package/src/components/header/header-code.css.js +20 -11
- package/src/components/header/header-code.js +1 -1
- package/src/components/header/header.css.js +20 -14
- package/src/components/header/header.js +6 -7
- package/src/components/header/header.stories.js +29 -24
- package/src/components/heading/heading.css.js +11 -0
- package/src/components/hero/hero.js +10 -2
- package/src/components/highlight/highlight.css.js +30 -6
- package/src/components/icons/arrow-icon.js +4 -1
- package/src/components/icons/arrow-right-icon.js +5 -1
- package/src/components/icons/icon-element.js +18 -0
- package/src/components/image/image.js +29 -9
- package/src/components/image/image.stories.js +38 -2
- package/src/components/input/custom-form.stories.js +38 -7
- package/src/components/input/input-clipboard.css.js +15 -1
- package/src/components/input/input-clipboard.js +84 -21
- package/src/components/input/input.js +27 -7
- package/src/components/install-options/install-options.css.js +26 -6
- package/src/components/install-options/install-options.js +32 -8
- package/src/components/label/label.css.js +1 -1
- package/src/components/light-carousel/light-carousel.css.js +100 -48
- package/src/components/light-carousel/light-carousel.js +43 -5
- package/src/components/link/link.css.js +15 -15
- package/src/components/link/link.js +17 -1
- package/src/components/link/link.stories.js +20 -7
- package/src/components/list/list.css.js +3 -3
- package/src/components/logo-marquee/logo-marquee.css.js +12 -1
- package/src/components/logo-marquee/logo-marquee.js +33 -8
- package/src/components/logo-marquee/logo-marquee.stories.js +10 -4
- package/src/components/modal/modal.css.js +74 -40
- package/src/components/modal/modal.js +85 -74
- package/src/components/modal/modal.stories.js +27 -14
- package/src/components/motion-art/motion-art.js +67 -1
- package/src/components/page-switcher/page-switcher.css.js +27 -9
- package/src/components/page-switcher/page-switcher.js +11 -8
- package/src/components/partner-banner/partner-banner.css.js +2 -0
- package/src/components/picture/picture.css.js +4 -4
- package/src/components/picture/picture.js +13 -3
- package/src/components/picture/picture.stories.js +28 -2
- package/src/components/post-card/post-card.css.js +18 -3
- package/src/components/pricing-cards/adopt-styles.js +16 -0
- package/src/components/pricing-cards/new-pricing-card.js +2 -4
- package/src/components/pricing-cards/new-pricing-card.stories.js +20 -22
- package/src/components/pricing-cards/pricing-card-actions.css.js +8 -12
- package/src/components/pricing-cards/pricing-card-actions.js +26 -13
- package/src/components/pricing-cards/pricing-card-container.css.js +4 -3
- package/src/components/pricing-cards/pricing-card-container.js +10 -4
- package/src/components/pricing-cards/pricing-card-header.css.js +5 -4
- package/src/components/pricing-cards/pricing-card-header.js +18 -31
- package/src/components/pricing-cards/pricing-card-pricing.css.js +84 -61
- package/src/components/pricing-cards/pricing-card-pricing.js +38 -24
- package/src/components/pricing-cards/pricing-card-show-more.js +8 -3
- package/src/components/pricing-cards/pricing-card.css.js +75 -41
- package/src/components/pricing-cards/pricing-card.js +356 -308
- package/src/components/progress/progress.css.js +58 -13
- package/src/components/progress/progress.js +13 -10
- package/src/components/progress/progress.stories.js +9 -7
- package/src/components/radio/radio-group.css.js +42 -0
- package/src/components/radio/radio-group.js +89 -0
- package/src/components/radio/radio.css.js +63 -6
- package/src/components/radio/radio.js +173 -140
- package/src/components/radio/radio.stories.js +99 -44
- package/src/components/radio/toggle-radio.js +44 -0
- package/src/components/review/review-grid.css.js +5 -1
- package/src/components/review/review-grid.js +2 -0
- package/src/components/review/review.js +13 -0
- package/src/components/shared/announcer.js +37 -0
- package/src/components/shared/fill-width.css.js +33 -0
- package/src/components/shared/form-control.js +194 -0
- package/src/components/shared/form-field.css.js +31 -3
- package/src/components/shared/token-scales.js +75 -26
- package/src/components/spotlight-section/spotlight-section.js +2 -2
- package/src/components/stat/stat-highlight.js +1 -1
- package/src/components/stat/stat.css.js +18 -3
- package/src/components/switch/switch.css.js +58 -5
- package/src/components/switch/switch.js +53 -5
- package/src/components/switch/switch.stories.js +30 -8
- package/src/components/tab-list/tab-list.css.js +51 -13
- package/src/components/tab-list/tab-list.js +7 -2
- package/src/components/tab-list/tab-list.stories.js +2 -2
- package/src/components/tabs/tabs.css.js +18 -1
- package/src/components/tabs/tabs.js +119 -41
- package/src/components/terminal/terminal-message.css.js +6 -1
- package/src/components/termsOfUse/terms.css.js +4 -2
- package/src/components/textarea/textarea.js +22 -7
- package/src/components/textarea/textarea.stories.js +12 -9
- package/src/components/trust-panel/trust-panel.css.js +13 -3
- package/src/components/ultimate-security-demo.stories.js +5 -5
- package/src/components/video/video.css.js +5 -0
- package/src/components/video/video.js +5 -0
- package/src/components/video/video.stories.js +12 -0
- package/src/components/video-player/video-player.css.js +20 -8
- package/src/components/video-player/video-player.js +74 -20
- package/src/components/video-player/video-player.stories.js +17 -3
- package/src/tokens/brands.stories.js +1 -1
- package/src/tokens/themes/index.js +2 -2
- package/src/tokens/typography.stories.js +4 -3
- package/src/vendor/motion-art/README.md +4 -1
- 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
|
-
|
|
25
|
-
|
|
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
|
-
|
|
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
|
|
52
|
-
maxColumnsPerRow
|
|
53
|
-
_isMobile
|
|
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
|
-
|
|
88
|
+
this._watchViewport();
|
|
85
89
|
}
|
|
86
90
|
|
|
87
91
|
disconnectedCallback() {
|
|
88
92
|
super.disconnectedCallback();
|
|
89
|
-
|
|
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
|
-
|
|
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
|
-
|
|
153
|
-
|
|
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
|
-
|
|
171
|
-
|
|
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 (
|
|
202
|
-
|
|
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
|
|
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 (!
|
|
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
|
-
|
|
256
|
-
this._countriesOpen = false;
|
|
257
|
-
|
|
258
|
-
if (!this._isMobile) {
|
|
259
|
-
this._scrollToTop();
|
|
260
|
-
}
|
|
192
|
+
[this.currentLocale, this.selectedCountry] = resolved;
|
|
261
193
|
}
|
|
262
194
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
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
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
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
|
-
|
|
294
|
-
|
|
295
|
-
|
|
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
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
const
|
|
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
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
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
|
|
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
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
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"
|
|
413
|
+
<bd-close-icon size="18"></bd-close-icon>
|
|
488
414
|
</button>
|
|
489
415
|
${countryChunks.map(chunk => html`
|
|
490
|
-
<bd-footer-links-group
|
|
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
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
-
|
|
46
|
-
|
|
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/
|
|
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
|
-
|
|
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
|
-
@
|
|
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
|
-
@
|
|
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
|
-
|
|
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
|
-
|
|
22
|
-
|
|
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
|
-
|
|
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
|
-
|
|
303
|
-
|
|
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
|
-
|
|
308
|
-
|
|
309
|
-
|
|
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
|
|
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
|
)}
|