@repobit/dex-system-design 2.5.1 → 2.7.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 +233 -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 +1 -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 +228 -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 +56 -20
- package/src/components/grid/grid.js +20 -15
- package/src/components/grid/grid.stories.js +39 -11
- 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 +29 -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,43 +1,79 @@
|
|
|
1
|
-
import { css } from "lit";
|
|
1
|
+
import { css, unsafeCSS } from "lit";
|
|
2
|
+
import { above } from "../shared/token-scales.js";
|
|
2
3
|
|
|
4
|
+
/* The column steps follow the screen: cols, then cols-sm, cols-md and
|
|
5
|
+
cols-lg from 576, 768 and 992 -- the sm, md and lg every other breakpoint
|
|
6
|
+
in this package means. A grid's steps are a page's structure, and that is
|
|
7
|
+
a question about the screen; it can answer differently at the same width
|
|
8
|
+
in two places -- a 492 grid across a 600 screen and a 518 one beside the
|
|
9
|
+
stat highlight at 1280 hold different layouts on the homepage.
|
|
10
|
+
|
|
11
|
+
2.6.0 stepped by the grid's own width instead, at the page column's widths
|
|
12
|
+
(492, 656, 880). A grid as wide as the page stepped where it always had; a
|
|
13
|
+
narrower one never reached its upper steps, so the homepage's stat tiles,
|
|
14
|
+
two across beside the highlight since they were drawn, stacked one a row
|
|
15
|
+
on every desktop, and bd-footer opted its grid out to keep its layout.
|
|
16
|
+
Nothing that was measured gained from it, so the steps read the screen
|
|
17
|
+
again.
|
|
18
|
+
|
|
19
|
+
What reading its own width was for -- a 3-column step taken at a 992
|
|
20
|
+
screen gave a 360 column 104px cells -- is min-col-width's: each step's
|
|
21
|
+
count becomes the most columns there will be, and a column is never
|
|
22
|
+
narrower than min-col-width, so a grid in a narrow column takes fewer,
|
|
23
|
+
wider ones, wherever it is laid out. It asks the cells, which is the
|
|
24
|
+
question a collection has, where the page's widths could only be answered
|
|
25
|
+
by a grid as wide as the page. */
|
|
3
26
|
export default css`
|
|
4
|
-
|
|
27
|
+
:host {
|
|
5
28
|
display: block;
|
|
6
29
|
}
|
|
7
30
|
|
|
31
|
+
/* Each step below says only which columns and which gap apply; they are
|
|
32
|
+
laid out here, once, so that min-col-width reads the same two. */
|
|
8
33
|
.grid {
|
|
9
34
|
display: grid;
|
|
10
|
-
gap: var(--spacing-24);
|
|
11
35
|
align-items: stretch;
|
|
12
36
|
justify-items: start;
|
|
37
|
+
--grid-cols-active: var(--grid-cols);
|
|
38
|
+
--grid-gap-active: var(--grid-gap, var(--spacing-24));
|
|
39
|
+
grid-template-columns: repeat(var(--grid-cols-active), 1fr);
|
|
40
|
+
gap: var(--grid-gap-active);
|
|
13
41
|
}
|
|
14
42
|
|
|
15
|
-
/*
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
gap: var(--grid-gap, var(--spacing-24));
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/* 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) {
|
|
43
|
+
/* The columns and the gap step together; a gap left unset carries the
|
|
44
|
+
one below it up. */
|
|
45
|
+
@media ${unsafeCSS(above('sm'))} {
|
|
24
46
|
.grid {
|
|
25
|
-
grid-
|
|
26
|
-
gap: var(--grid-gap-sm, var(--spacing-24));
|
|
47
|
+
--grid-cols-active: var(--grid-cols-sm);
|
|
48
|
+
--grid-gap-active: var(--grid-gap-sm, var(--spacing-24));
|
|
27
49
|
}
|
|
28
50
|
}
|
|
29
51
|
|
|
30
|
-
@media (
|
|
52
|
+
@media ${unsafeCSS(above('md'))} {
|
|
31
53
|
.grid {
|
|
32
|
-
grid-
|
|
33
|
-
gap: var(--grid-gap-md, var(--spacing-24));
|
|
54
|
+
--grid-cols-active: var(--grid-cols-md);
|
|
55
|
+
--grid-gap-active: var(--grid-gap-md, var(--spacing-24));
|
|
34
56
|
}
|
|
35
57
|
}
|
|
36
58
|
|
|
37
|
-
@media (
|
|
59
|
+
@media ${unsafeCSS(above('lg'))} {
|
|
38
60
|
.grid {
|
|
39
|
-
grid-
|
|
40
|
-
gap: var(--grid-gap-lg, var(--spacing-24));
|
|
61
|
+
--grid-cols-active: var(--grid-cols-lg);
|
|
62
|
+
--grid-gap-active: var(--grid-gap-lg, var(--spacing-24));
|
|
41
63
|
}
|
|
42
64
|
}
|
|
65
|
+
|
|
66
|
+
/* min-col-width: as many columns as fit at min-col-width, up to the
|
|
67
|
+
step's count. auto-fill takes as many as fit; the second term of max()
|
|
68
|
+
is what holds it to the count -- a column at least the grid less the
|
|
69
|
+
count's gaps, over the count, leaves no room for one more, with a gap
|
|
70
|
+
to spare so rounding cannot drop one either; and min(100%, ...) keeps
|
|
71
|
+
one column inside a grid narrower than the floor. The columns then
|
|
72
|
+
share what is left, as 1fr always has. */
|
|
73
|
+
.grid.grid--fit {
|
|
74
|
+
grid-template-columns: repeat(auto-fill, minmax(min(100%, max(
|
|
75
|
+
var(--grid-min-col-width),
|
|
76
|
+
(100% - var(--grid-cols-active) * var(--grid-gap-active)) / var(--grid-cols-active)
|
|
77
|
+
)), 1fr));
|
|
78
|
+
}
|
|
43
79
|
`;
|
|
@@ -46,18 +46,23 @@ class BdGrid extends LitElement {
|
|
|
46
46
|
the ones that were already there, and this adds no smartness to a layout
|
|
47
47
|
primitive -- it only lets the primitive hear what it is told. */
|
|
48
48
|
static properties = {
|
|
49
|
-
cols
|
|
50
|
-
colsSm
|
|
51
|
-
colsMd
|
|
52
|
-
colsLg
|
|
53
|
-
gap
|
|
54
|
-
gapSm
|
|
55
|
-
gapMd
|
|
56
|
-
gapLg
|
|
57
|
-
align
|
|
58
|
-
justify: { type: String }, // start, center, end, space-between
|
|
59
|
-
padding: { type: String } // e.g., 'none', 'sm', 'md', 'lg'
|
|
60
|
-
|
|
49
|
+
cols : { type: Number }, // default cols
|
|
50
|
+
colsSm : { type: Number, attribute: "cols-sm" }, // optional cols on small screens
|
|
51
|
+
colsMd : { type: Number, attribute: "cols-md" }, // optional cols on medium
|
|
52
|
+
colsLg : { type: Number, attribute: "cols-lg" }, // optional cols on large
|
|
53
|
+
gap : { type: String }, // e.g., 'sm', 'md'
|
|
54
|
+
gapSm : { type: String, attribute: "gap-sm" }, // optional gap from sm; unset keeps the step below
|
|
55
|
+
gapMd : { type: String, attribute: "gap-md" }, // optional gap from md
|
|
56
|
+
gapLg : { type: String, attribute: "gap-lg" }, // optional gap from lg
|
|
57
|
+
align : { type: String }, // start, center, end, stretch
|
|
58
|
+
justify : { type: String }, // start, center, end, space-between
|
|
59
|
+
padding : { type: String }, // e.g., 'none', 'sm', 'md', 'lg'
|
|
60
|
+
/* The narrowest a column may be. Unset, each step's count is the
|
|
61
|
+
columns there are; set, it is the most there will be, and the grid
|
|
62
|
+
takes fewer, wider ones where that many would not fit (grid.css.js).
|
|
63
|
+
A number of px at the default text size, laid out in rem: a cell holds
|
|
64
|
+
text, so its floor grows with the reader's text, as the gaps do. */
|
|
65
|
+
minColWidth: { type: Number, attribute: "min-col-width" }
|
|
61
66
|
};
|
|
62
67
|
|
|
63
68
|
constructor() {
|
|
@@ -73,14 +78,14 @@ class BdGrid extends LitElement {
|
|
|
73
78
|
this.align = "stretch";
|
|
74
79
|
this.justify = "start";
|
|
75
80
|
this.padding = "none";
|
|
76
|
-
|
|
81
|
+
this.minColWidth = 0;
|
|
77
82
|
}
|
|
78
83
|
|
|
79
84
|
|
|
80
85
|
render() {
|
|
81
86
|
return html`
|
|
82
87
|
<div
|
|
83
|
-
class="grid"
|
|
88
|
+
class="grid ${this.minColWidth > 0 ? "grid--fit" : ""}"
|
|
84
89
|
style="
|
|
85
90
|
--grid-cols: ${this.cols};
|
|
86
91
|
--grid-cols-sm: ${this.colsSm};
|
|
@@ -93,7 +98,7 @@ class BdGrid extends LitElement {
|
|
|
93
98
|
align-items: ${this.align};
|
|
94
99
|
justify-items: ${this.justify};
|
|
95
100
|
padding: ${space(this.padding)};
|
|
96
|
-
|
|
101
|
+
${this.minColWidth > 0 ? `--grid-min-col-width: ${this.minColWidth / 16}rem;` : ""}
|
|
97
102
|
"
|
|
98
103
|
>
|
|
99
104
|
<slot></slot>
|