@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.
- package/CHANGELOG.md +84 -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 +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 +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
|
@@ -14,19 +14,23 @@ import { ensembleCSS } from "../shared/ensemble.css.js";
|
|
|
14
14
|
* The ink is Position 2 of the wayfinding family review: colour means
|
|
15
15
|
* AVAILABLE and neutral means current. Every item is variant="primary", so a
|
|
16
16
|
* resting item is --color-text-brand and hovers to --color-action-primary-active;
|
|
17
|
-
* the current one carries `
|
|
18
|
-
* weight 700 and takes the 3px indicator. bd-link's
|
|
17
|
+
* the current one carries `current`, which drops it to --color-text-primary at
|
|
18
|
+
* weight 700 and takes the 3px indicator. bd-link's current-and-hovered rule
|
|
19
19
|
* keeps it there under the pointer.
|
|
20
20
|
*
|
|
21
21
|
* The variant is no longer switched per item. It used to be primary for the
|
|
22
22
|
* current one and secondary for the rest, which made the current item the only
|
|
23
23
|
* blue one -- the inverse of what the indicator says -- and left the resting
|
|
24
|
-
* items on the muted ramp. One variant plus `
|
|
24
|
+
* items on the muted ramp. One variant plus `current` is the same information
|
|
25
25
|
* with one fewer thing to keep in step.
|
|
26
26
|
*
|
|
27
|
-
* `
|
|
27
|
+
* `current` is `page`, not the generic `true`. These items are pages; the
|
|
28
28
|
* anchor nav's items are positions inside one page and say `location`. Both are
|
|
29
|
-
* current-location markers and they are not the same claim.
|
|
29
|
+
* current-location markers and they are not the same claim. bd-link puts it on
|
|
30
|
+
* its <a> as aria-current; written here as aria-current, on the bd-link
|
|
31
|
+
* element, it was never announced -- the <a> is in bd-link's shadow root. The
|
|
32
|
+
* look, the indicator below included, keys on the same attribute, so the item
|
|
33
|
+
* cannot be drawn current without being announced so.
|
|
30
34
|
*/
|
|
31
35
|
class BdPageSwitcher extends LitElement {
|
|
32
36
|
static properties = {
|
|
@@ -51,9 +55,8 @@ class BdPageSwitcher extends LitElement {
|
|
|
51
55
|
href=${href}
|
|
52
56
|
variant="primary"
|
|
53
57
|
no-underline
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
class="page-link ${active ? "active" : ""}"
|
|
58
|
+
current=${active ? "page" : nothing}
|
|
59
|
+
class="page-link"
|
|
57
60
|
>${title || nothing}</bd-link>
|
|
58
61
|
`)}
|
|
59
62
|
</nav>
|
|
@@ -142,6 +142,8 @@ export const partnerBannerCSS = css`
|
|
|
142
142
|
color-mix(in srgb, var(--color-surface-brand) 5%, transparent) 0%,
|
|
143
143
|
var(--color-surface-brand) 35%
|
|
144
144
|
);
|
|
145
|
+
/* Safari before 18 knows the blur only by its prefixed name */
|
|
146
|
+
-webkit-backdrop-filter: blur(29px);
|
|
145
147
|
backdrop-filter: blur(29px);
|
|
146
148
|
}
|
|
147
149
|
|
|
@@ -158,10 +158,10 @@ export default css`
|
|
|
158
158
|
transform: scale(1);
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
/*
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
161
|
+
/* No will-change. It stood here on every image, at rest as well as
|
|
162
|
+
during the fade, which keeps a compositor layer per image for the life
|
|
163
|
+
of the page to speed up one transition that runs once. The browser
|
|
164
|
+
promotes an element for the length of a transition on its own. */
|
|
165
165
|
|
|
166
166
|
/* Two @container queries used to sit here, for .mobile-full and
|
|
167
167
|
.tablet-optimized. Neither could ever match: a container query needs an
|
|
@@ -32,6 +32,8 @@ export class BdPicture extends LitElement {
|
|
|
32
32
|
width : { type: Number },
|
|
33
33
|
height : { type: Number },
|
|
34
34
|
loading : { type: String },
|
|
35
|
+
fetchPriority : { type: String, attribute: "fetchpriority" },
|
|
36
|
+
decoding : { type: String },
|
|
35
37
|
fit : { type: String },
|
|
36
38
|
radius : { type: String },
|
|
37
39
|
referrerPolicy: { type: String, attribute: "referrer-policy" }
|
|
@@ -45,6 +47,8 @@ export class BdPicture extends LitElement {
|
|
|
45
47
|
this.width = null;
|
|
46
48
|
this.height = null;
|
|
47
49
|
this.loading = "lazy";
|
|
50
|
+
this.fetchPriority = "";
|
|
51
|
+
this.decoding = "";
|
|
48
52
|
this.fit = "cover";
|
|
49
53
|
this.radius = "none";
|
|
50
54
|
this.referrerPolicy = "";
|
|
@@ -58,6 +62,10 @@ export class BdPicture extends LitElement {
|
|
|
58
62
|
`fit-${FITS.includes(this.fit) ? this.fit : 'cover'}`,
|
|
59
63
|
`radius-${RADIUS_STEPS.includes(this.radius) ? this.radius : 'none'}`
|
|
60
64
|
].filter(Boolean).join(' ');
|
|
65
|
+
/* Never lazy at fetchpriority="high", as in bd-img. That also skips the
|
|
66
|
+
fade in picture.css.js, which is keyed on loading="lazy": an LCP image
|
|
67
|
+
held at opacity 0 until its load event is an LCP held back with it. */
|
|
68
|
+
const lcp = this.fetchPriority === 'high';
|
|
61
69
|
|
|
62
70
|
// Each source's optional attributes are left off when not given. type
|
|
63
71
|
// used to be written as-is, so a source without one rendered
|
|
@@ -73,9 +81,11 @@ export class BdPicture extends LitElement {
|
|
|
73
81
|
sizes="${source.sizes || nothing}"
|
|
74
82
|
>
|
|
75
83
|
`)}
|
|
76
|
-
<img
|
|
77
|
-
loading="${this.loading}"
|
|
78
|
-
|
|
84
|
+
<img
|
|
85
|
+
loading="${lcp ? nothing : this.loading}"
|
|
86
|
+
fetchpriority="${this.fetchPriority || nothing}"
|
|
87
|
+
decoding="${this.decoding || nothing}"
|
|
88
|
+
alt="${this.alt}"
|
|
79
89
|
src="${this.fallbackSrc}"
|
|
80
90
|
width="${this.width ?? nothing}"
|
|
81
91
|
height="${this.height ?? nothing}"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
1
|
+
import { html, nothing } from 'lit';
|
|
2
2
|
import './picture.js';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
@@ -27,6 +27,10 @@ export default {
|
|
|
27
27
|
></bd-picture>
|
|
28
28
|
\`\`\`
|
|
29
29
|
|
|
30
|
+
An image the page is waiting for -- a hero, its Largest Contentful Paint --
|
|
31
|
+
takes \`fetchpriority="high"\`: it is never lazy then, and it skips the fade-in,
|
|
32
|
+
which would hold it at opacity 0 until its load event.
|
|
33
|
+
|
|
30
34
|
### Sources Array
|
|
31
35
|
Each source object supports:
|
|
32
36
|
- \`type\` — MIME type (e.g. \`"image/webp"\`)
|
|
@@ -75,6 +79,18 @@ Each source object supports:
|
|
|
75
79
|
description: 'Native browser loading strategy',
|
|
76
80
|
table : { type: { summary: "'lazy'|'eager'" }, defaultValue: { summary: 'lazy' }, category: 'Performance' }
|
|
77
81
|
},
|
|
82
|
+
fetchpriority: {
|
|
83
|
+
control : { type: 'select' },
|
|
84
|
+
options : [undefined, 'high', 'low'],
|
|
85
|
+
description: '`high` for the image the page is waiting for (its Largest Contentful Paint) -- never lazy then; `low` for one that is above the fold but hidden at first. Leave it unset otherwise.',
|
|
86
|
+
table : { type: { summary: "'high' | 'low'" }, defaultValue: { summary: 'unset' }, category: 'Performance' }
|
|
87
|
+
},
|
|
88
|
+
decoding: {
|
|
89
|
+
control : { type: 'select' },
|
|
90
|
+
options : [undefined, 'async', 'sync'],
|
|
91
|
+
description: 'Decoding hint for the browser',
|
|
92
|
+
table : { type: { summary: "'async' | 'sync' | 'auto'" }, defaultValue: { summary: 'unset' }, category: 'Performance' }
|
|
93
|
+
},
|
|
78
94
|
fit: {
|
|
79
95
|
control : { type: 'select' },
|
|
80
96
|
options : ['cover', 'contain', 'fill', 'none', 'scale-down'],
|
|
@@ -90,7 +106,7 @@ Each source object supports:
|
|
|
90
106
|
}
|
|
91
107
|
};
|
|
92
108
|
|
|
93
|
-
const placeholder = '
|
|
109
|
+
const placeholder = '/assets/bd-header-img.jpg';
|
|
94
110
|
|
|
95
111
|
const defaultSources = [
|
|
96
112
|
{ type: 'image/webp', srcset: placeholder + '?format=webp', media: '(min-width: 600px)' },
|
|
@@ -110,6 +126,8 @@ const render = (args) => html`
|
|
|
110
126
|
width="${args.width}"
|
|
111
127
|
height="${args.height}"
|
|
112
128
|
loading="${args.loading}"
|
|
129
|
+
fetchpriority="${args.fetchpriority || nothing}"
|
|
130
|
+
decoding="${args.decoding || nothing}"
|
|
113
131
|
fit="${args.fit}"
|
|
114
132
|
radius="${args.radius}"
|
|
115
133
|
.sources="${args.sources}"
|
|
@@ -198,6 +216,14 @@ export const LazyVsEager = {
|
|
|
198
216
|
parameters: { docs: { description: { story: 'Comparison of `loading="lazy"` and `loading="eager"` side by side.' } } }
|
|
199
217
|
};
|
|
200
218
|
|
|
219
|
+
export const HighPriority = {
|
|
220
|
+
name : 'High Priority (LCP)',
|
|
221
|
+
render: () => html`
|
|
222
|
+
<bd-picture fallback-src="${placeholder}" alt="Product image" width="800" height="450" fetchpriority="high" .sources="${[]}"></bd-picture>
|
|
223
|
+
`,
|
|
224
|
+
parameters: { docs: { description: { story: '`fetchpriority="high"` -- never lazy, and no fade: the image paints as it arrives, which is when the page counts it as painted.' } } }
|
|
225
|
+
};
|
|
226
|
+
|
|
201
227
|
export const Playground = {
|
|
202
228
|
name : '🛝 Playground',
|
|
203
229
|
args : { ...defaultArgs },
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import { css, unsafeCSS } from "lit";
|
|
2
|
-
import { above
|
|
2
|
+
import { above } from "../shared/token-scales.js";
|
|
3
|
+
import { hostFillsWidth } from "../shared/fill-width.css.js";
|
|
3
4
|
|
|
4
5
|
/* A post card on the page ground beside two others, where the design draws
|
|
5
6
|
an edge: surface/default with a border/container edge, at the card corner.
|
|
6
7
|
The cover runs to the card's edges and the copy takes the compact inset. */
|
|
7
8
|
export const postCardCSS = css`
|
|
9
|
+
/* The card is a size container, so its content gives it no width: it
|
|
10
|
+
takes its cell's whole width, as it takes the row's height, and lays
|
|
11
|
+
itself out for that. Left to fit its content -- bd-grid places its items
|
|
12
|
+
at start -- a container measures 0 wide. The width is the column less
|
|
13
|
+
the card's margins (shared/fill-width.css.js). */
|
|
8
14
|
:host {
|
|
9
15
|
display: block;
|
|
10
16
|
height: 100%;
|
|
17
|
+
container-type: inline-size;
|
|
11
18
|
}
|
|
12
19
|
|
|
20
|
+
${hostFillsWidth()}
|
|
21
|
+
|
|
13
22
|
.card {
|
|
14
23
|
position: relative;
|
|
15
24
|
box-sizing: border-box;
|
|
@@ -113,8 +122,14 @@ export const postCardCSS = css`
|
|
|
113
122
|
color: var(--color-text-brand);
|
|
114
123
|
}
|
|
115
124
|
|
|
116
|
-
/* The tablet row
|
|
117
|
-
|
|
125
|
+
/* The tablet row, the cover on the left, wherever the card is wide enough
|
|
126
|
+
for it -- not wherever the screen is. It used to follow the viewport
|
|
127
|
+
from md to lg, which put a card in a two- or three-column grid at tablet
|
|
128
|
+
width into a row it had no room for (a 384 card: a 154 cover beside
|
|
129
|
+
230 of copy), and a lone card on a desktop page under a full-width
|
|
130
|
+
cover. A card in a three-up grid is at most 415 wide; one alone in the
|
|
131
|
+
tablet column is 656. */
|
|
132
|
+
@container ${unsafeCSS(above("sm"))} {
|
|
118
133
|
.card {
|
|
119
134
|
flex-direction: row;
|
|
120
135
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pricing elements that render into light DOM -- so a crawler reading the
|
|
3
|
+
* page, and the store filling it, find the prices in the document -- used to
|
|
4
|
+
* put a <style> copy of their stylesheet inside every card they rendered. The
|
|
5
|
+
* sheet now goes to the tree the element sits in once, adopted by its root:
|
|
6
|
+
* the document, or the shadow root of the section that renders the card. A
|
|
7
|
+
* card inside bd-pricing-container finds the sheet already there.
|
|
8
|
+
*/
|
|
9
|
+
export function adoptStyles(host, ...sheets) {
|
|
10
|
+
const root = host.getRootNode();
|
|
11
|
+
if (!("adoptedStyleSheets" in root)) return;
|
|
12
|
+
const missing = sheets
|
|
13
|
+
.map(sheet => sheet.styleSheet)
|
|
14
|
+
.filter(sheet => sheet && !root.adoptedStyleSheets.includes(sheet));
|
|
15
|
+
if (missing.length) root.adoptedStyleSheets = [...root.adoptedStyleSheets, ...missing];
|
|
16
|
+
}
|
|
@@ -21,12 +21,10 @@ class PricingCard extends LitElement {
|
|
|
21
21
|
this.shadow = true;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
static styles = [newPricingCSS];
|
|
25
|
+
|
|
24
26
|
render() {
|
|
25
27
|
return html`
|
|
26
|
-
<style>
|
|
27
|
-
${newPricingCSS}
|
|
28
|
-
</style>
|
|
29
|
-
|
|
30
28
|
<div class="card-wrapper">
|
|
31
29
|
${this.highlight
|
|
32
30
|
? html`<div class="highlight-banner">Best Value</div>`
|
|
@@ -62,10 +62,8 @@ export default {
|
|
|
62
62
|
const PricingCardTemplate = (args) => html`
|
|
63
63
|
<new-pricing-card
|
|
64
64
|
?highlight="${args.highlight}"
|
|
65
|
-
product-id="${args.productId}"
|
|
66
65
|
devices="${args.devices}"
|
|
67
66
|
subscription="${args.subscription}"
|
|
68
|
-
data-layer-event="${args.dataLayerEvent}"
|
|
69
67
|
>
|
|
70
68
|
<pricing-card-header
|
|
71
69
|
slot="header"
|
|
@@ -79,7 +77,7 @@ const PricingCardTemplate = (args) => html`
|
|
|
79
77
|
product-id="${args.productId}"
|
|
80
78
|
devices="${args.devices}"
|
|
81
79
|
subscription="${args.subscription}"
|
|
82
|
-
|
|
80
|
+
.dataLayerEvent="${args.dataLayerEvent}"
|
|
83
81
|
></pricing-card-pricing>
|
|
84
82
|
|
|
85
83
|
<pricing-card-actions
|
|
@@ -87,7 +85,7 @@ const PricingCardTemplate = (args) => html`
|
|
|
87
85
|
product-id="${args.productId}"
|
|
88
86
|
devices="${args.devices}"
|
|
89
87
|
subscription="${args.subscription}"
|
|
90
|
-
|
|
88
|
+
.dataLayerEvent="${args.dataLayerEvent}"
|
|
91
89
|
></pricing-card-actions>
|
|
92
90
|
|
|
93
91
|
<pricing-card-show-more slot="features">
|
|
@@ -106,7 +104,7 @@ VSBCard.args = {
|
|
|
106
104
|
devices : '5',
|
|
107
105
|
subscription : '1',
|
|
108
106
|
dataLayerEvent: 'info',
|
|
109
|
-
title : 'Bitdefender
|
|
107
|
+
title : 'Bitdefender Ultimate Small Business Security',
|
|
110
108
|
subtitle : '1 account – 5 devices',
|
|
111
109
|
badges : 'Premium',
|
|
112
110
|
features : [
|
|
@@ -123,7 +121,7 @@ VSBCard.args = {
|
|
|
123
121
|
VSBCard.parameters = {
|
|
124
122
|
docs: {
|
|
125
123
|
description: {
|
|
126
|
-
story: 'Premium
|
|
124
|
+
story: 'Premium card with product ID "vsb" (Bitdefender Ultimate Small Business Security). Includes all advanced features.'
|
|
127
125
|
}
|
|
128
126
|
}
|
|
129
127
|
};
|
|
@@ -134,7 +132,7 @@ TSI_Card.args = {
|
|
|
134
132
|
devices : '5',
|
|
135
133
|
subscription : '1',
|
|
136
134
|
dataLayerEvent: 'info',
|
|
137
|
-
title : 'Bitdefender
|
|
135
|
+
title : 'Bitdefender Total Security',
|
|
138
136
|
subtitle : '1 account – 5 devices',
|
|
139
137
|
badges : 'Most Popular',
|
|
140
138
|
features : [
|
|
@@ -151,7 +149,7 @@ TSI_Card.args = {
|
|
|
151
149
|
TSI_Card.parameters = {
|
|
152
150
|
docs: {
|
|
153
151
|
description: {
|
|
154
|
-
story: '
|
|
152
|
+
story: 'Total Security card with product ID "ts_i". Balanced protection for everyday use.'
|
|
155
153
|
}
|
|
156
154
|
}
|
|
157
155
|
};
|
|
@@ -162,9 +160,9 @@ PSI_Card.args = {
|
|
|
162
160
|
devices : '5',
|
|
163
161
|
subscription : '1',
|
|
164
162
|
dataLayerEvent: 'info',
|
|
165
|
-
title : 'Bitdefender
|
|
166
|
-
subtitle : '
|
|
167
|
-
badges : '
|
|
163
|
+
title : 'Bitdefender Premium Security',
|
|
164
|
+
subtitle : '1 account – 5 devices',
|
|
165
|
+
badges : 'Privacy',
|
|
168
166
|
features : [
|
|
169
167
|
'Antivirus protection',
|
|
170
168
|
'Real-time scanning',
|
|
@@ -178,7 +176,7 @@ PSI_Card.args = {
|
|
|
178
176
|
PSI_Card.parameters = {
|
|
179
177
|
docs: {
|
|
180
178
|
description: {
|
|
181
|
-
story: '
|
|
179
|
+
story: 'Premium Security card with product ID "ps_i".'
|
|
182
180
|
}
|
|
183
181
|
}
|
|
184
182
|
};
|
|
@@ -275,9 +273,9 @@ export const ThreeProductGrid = () => html`
|
|
|
275
273
|
<h2 style="text-align: center; margin-bottom: 30px; color: #212529;">Compare Security Plans</h2>
|
|
276
274
|
|
|
277
275
|
<pricing-cards-container count="3">
|
|
278
|
-
<!-- Card 1:
|
|
276
|
+
<!-- Card 1: Antivirus Plus - Basic -->
|
|
279
277
|
${PricingCardTemplate({
|
|
280
|
-
productId : '
|
|
278
|
+
productId : 'av',
|
|
281
279
|
devices : '5',
|
|
282
280
|
subscription : '1',
|
|
283
281
|
dataLayerEvent: 'info',
|
|
@@ -294,14 +292,14 @@ export const ThreeProductGrid = () => html`
|
|
|
294
292
|
shadow : true
|
|
295
293
|
})}
|
|
296
294
|
|
|
297
|
-
<!-- Card 2:
|
|
295
|
+
<!-- Card 2: Internet Security - Standard (Highlighted) -->
|
|
298
296
|
${PricingCardTemplate({
|
|
299
|
-
productId : '
|
|
300
|
-
devices : '
|
|
297
|
+
productId : 'is',
|
|
298
|
+
devices : '3',
|
|
301
299
|
subscription : '1',
|
|
302
300
|
dataLayerEvent: 'info',
|
|
303
301
|
title : 'Bitdefender Internet Security',
|
|
304
|
-
subtitle : '1 account –
|
|
302
|
+
subtitle : '1 account – 3 devices',
|
|
305
303
|
badges : 'Most Popular',
|
|
306
304
|
features : [
|
|
307
305
|
'All Antivirus Plus features',
|
|
@@ -315,10 +313,10 @@ export const ThreeProductGrid = () => html`
|
|
|
315
313
|
shadow : true
|
|
316
314
|
})}
|
|
317
315
|
|
|
318
|
-
<!-- Card 3:
|
|
316
|
+
<!-- Card 3: Total Security - Premium -->
|
|
319
317
|
${PricingCardTemplate({
|
|
320
|
-
productId : '
|
|
321
|
-
devices : '
|
|
318
|
+
productId : 'ts_i',
|
|
319
|
+
devices : '5',
|
|
322
320
|
subscription : '1',
|
|
323
321
|
dataLayerEvent: 'info',
|
|
324
322
|
title : 'Bitdefender Total Security',
|
|
@@ -346,7 +344,7 @@ export const ThreeProductGrid = () => html`
|
|
|
346
344
|
ThreeProductGrid.parameters = {
|
|
347
345
|
docs: {
|
|
348
346
|
description: {
|
|
349
|
-
story: 'Grid comparing three different security products: Basic (
|
|
347
|
+
story: 'Grid comparing three different security products: Basic (av, Antivirus Plus), Standard (is, Internet Security), and Premium (ts_i, Total Security). Each card has independent store integration.'
|
|
350
348
|
}
|
|
351
349
|
}
|
|
352
350
|
};
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { css } from "lit";
|
|
2
2
|
|
|
3
|
+
/* Adopted by the document (or the shadow root the card sits in), so each
|
|
4
|
+
selector starts at the element; see pricing-card-pricing.css.js. */
|
|
3
5
|
export default css`
|
|
4
|
-
.actions {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
.hr-line {
|
|
12
|
-
border: none;
|
|
13
|
-
border-top: 1px solid var(--color-border-subtle);
|
|
14
|
-
margin: 1.5rem 0;
|
|
15
|
-
}
|
|
6
|
+
pricing-card-actions .actions {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
gap: 0.5rem;
|
|
10
|
+
margin-top: 1rem;
|
|
11
|
+
}
|
|
16
12
|
`;
|
|
@@ -1,8 +1,9 @@
|
|
|
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 "../button/button.js";
|
|
5
5
|
import newPricingActionsCSS from "../pricing-cards/pricing-card-actions.css.js";
|
|
6
|
+
import { adoptStyles } from "./adopt-styles.js";
|
|
6
7
|
|
|
7
8
|
class PricingCardActions extends LitElement {
|
|
8
9
|
static properties = {
|
|
@@ -24,23 +25,35 @@ class PricingCardActions extends LitElement {
|
|
|
24
25
|
return this;
|
|
25
26
|
}
|
|
26
27
|
|
|
28
|
+
connectedCallback() {
|
|
29
|
+
super.connectedCallback();
|
|
30
|
+
adoptStyles(this, newPricingActionsCSS);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* Every card's button reads "Buy Now", so a page's list of links held one
|
|
34
|
+
name three times. The card's product follows the visible words in the
|
|
35
|
+
accessible name, which keeps those words first (WCAG 2.5.3). The title is
|
|
36
|
+
the header's, read from the card this sits in. */
|
|
37
|
+
get _label() {
|
|
38
|
+
const title = this.closest("new-pricing-card")
|
|
39
|
+
?.querySelector("pricing-card-header")
|
|
40
|
+
?.getAttribute("title");
|
|
41
|
+
return title ? `Buy Now, ${title}` : nothing;
|
|
42
|
+
}
|
|
43
|
+
|
|
27
44
|
render() {
|
|
28
45
|
return html`
|
|
29
|
-
<style>
|
|
30
|
-
${newPricingActionsCSS}
|
|
31
|
-
</style>
|
|
32
|
-
|
|
33
46
|
<bd-context ignore-events-parent>
|
|
34
47
|
<!-- AICI TREBUIE product-id CU CRATIMĂ! -->
|
|
35
|
-
<bd-product product-id="${this.productId}">
|
|
36
|
-
<bd-option
|
|
37
|
-
devices="${this.devices}"
|
|
38
|
-
subscription="${this.subscription}"
|
|
48
|
+
<bd-product product-id="${this.productId}">
|
|
49
|
+
<bd-option
|
|
50
|
+
devices="${this.devices}"
|
|
51
|
+
subscription="${this.subscription}"
|
|
39
52
|
data-layer-event="${this.dataLayerEvent}">
|
|
40
|
-
|
|
53
|
+
|
|
41
54
|
<div class="actions">
|
|
42
55
|
<bd-button-link
|
|
43
|
-
label
|
|
56
|
+
label=${this._label}
|
|
44
57
|
variant="accent"
|
|
45
58
|
fullwidth
|
|
46
59
|
buyLink
|
|
@@ -48,7 +61,7 @@ class PricingCardActions extends LitElement {
|
|
|
48
61
|
Buy Now
|
|
49
62
|
</bd-button-link>
|
|
50
63
|
</div>
|
|
51
|
-
|
|
64
|
+
|
|
52
65
|
</bd-option>
|
|
53
66
|
</bd-product>
|
|
54
67
|
</bd-context>
|
|
@@ -56,4 +69,4 @@ class PricingCardActions extends LitElement {
|
|
|
56
69
|
}
|
|
57
70
|
}
|
|
58
71
|
|
|
59
|
-
customElements.define("pricing-card-actions", PricingCardActions);
|
|
72
|
+
customElements.define("pricing-card-actions", PricingCardActions);
|
|
@@ -26,9 +26,10 @@ export default css`
|
|
|
26
26
|
flex: 1 1 calc(33.333% - 1rem);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
/* 4+ cards
|
|
30
|
-
|
|
31
|
-
:host([count="
|
|
29
|
+
/* 4+ cards. Each selector needs its own ::slotted: the first two used to
|
|
30
|
+
style the container itself, so four or five cards never got a quarter. */
|
|
31
|
+
:host([count="4"]) ::slotted(new-pricing-card),
|
|
32
|
+
:host([count="5"]) ::slotted(new-pricing-card),
|
|
32
33
|
:host([count="6"]) ::slotted(new-pricing-card) {
|
|
33
34
|
flex: 1 1 calc(25% - 1rem);
|
|
34
35
|
}
|
|
@@ -14,15 +14,21 @@ export class PricingCardsContainer extends LitElement {
|
|
|
14
14
|
this.count = 0;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
/* Counted before the first render, and again whenever the cards change.
|
|
18
|
+
Counting in firstUpdated set the reflected count after the render it
|
|
19
|
+
styles, which is a second render -- Lit's change-in-update warning. */
|
|
20
|
+
willUpdate() {
|
|
21
|
+
if (!this.hasUpdated) this._countCards();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
_countCards() {
|
|
25
|
+
this.count = this.querySelectorAll("new-pricing-card").length;
|
|
20
26
|
}
|
|
21
27
|
|
|
22
28
|
render() {
|
|
23
29
|
return html`
|
|
24
30
|
<div class="cards-row">
|
|
25
|
-
<slot></slot>
|
|
31
|
+
<slot @slotchange=${this._countCards}></slot>
|
|
26
32
|
</div>
|
|
27
33
|
`;
|
|
28
34
|
}
|
|
@@ -13,12 +13,13 @@ export default css`
|
|
|
13
13
|
font-size: var(--typography-heading-h4-fontSize);
|
|
14
14
|
font-family: var(--typography-fontFamily-sans);
|
|
15
15
|
margin: 0;
|
|
16
|
-
text-align:
|
|
16
|
+
text-align: start;
|
|
17
17
|
color: var(--color-text-primary);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
/* its own line, as when it was a heading of its own */
|
|
20
21
|
.card-title-brand {
|
|
21
|
-
display:
|
|
22
|
+
display: block;
|
|
22
23
|
font-family: var(--typography-fontFamily-sans);
|
|
23
24
|
font-weight: var(--typography-fontWeight-bold);
|
|
24
25
|
color: var(--color-text-primary);
|
|
@@ -52,7 +53,7 @@ export default css`
|
|
|
52
53
|
|
|
53
54
|
.badge-subtitle {
|
|
54
55
|
font-size: var(--typography-body-regular-fontSize);
|
|
55
|
-
text-align:
|
|
56
|
+
text-align: start;
|
|
56
57
|
font-family: var(--typography-fontFamily-sans);
|
|
57
58
|
color: var(--color-text-primary);
|
|
58
59
|
margin: 0;
|
|
@@ -67,7 +68,7 @@ export default css`
|
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
.badge-wrapper {
|
|
70
|
-
text-align:
|
|
71
|
+
text-align: start;
|
|
71
72
|
margin-top: var(--spacing-8);
|
|
72
73
|
margin-bottom: var(--spacing-8);
|
|
73
74
|
}
|
|
@@ -19,40 +19,27 @@ class PricingCardHeader extends LitElement {
|
|
|
19
19
|
return this.badges ? this.badges.split("|").map((b) => b.trim()) : [];
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (!this.title) return "";
|
|
25
|
-
|
|
26
|
-
const title = this.title;
|
|
27
|
-
const plusIndex = title.toLowerCase().indexOf("plus");
|
|
22
|
+
/* The title, as one heading: "Bitdefender" on a line of its own when the
|
|
23
|
+
title starts with it, and the word "Plus" in the brand colour.
|
|
28
24
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
`;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// Conține "Plus" - evidențiază-l
|
|
41
|
-
const beforePlus = title.substring(0, plusIndex);
|
|
42
|
-
const plusWord = title.substring(plusIndex, plusIndex + 4); // "Plus" are 4 caractere
|
|
43
|
-
const afterPlus = title.substring(plusIndex + 4);
|
|
25
|
+
A title without "Plus" used to render the words "Internet Security"
|
|
26
|
+
whatever it said -- every card but Antivirus Plus named the wrong product
|
|
27
|
+
-- inside a <template shadowrootmode> that never attaches when Lit clones
|
|
28
|
+
a template, so it sat in the heading as an inert element. A title with
|
|
29
|
+
"Plus" was split across two <h4>s, which a screen reader announced as two
|
|
30
|
+
headings. */
|
|
31
|
+
renderTitle() {
|
|
32
|
+
if (!this.title) return "";
|
|
44
33
|
|
|
45
|
-
const
|
|
46
|
-
const
|
|
34
|
+
const match = this.title.match(/^(Bitdefender)\s+(.*)$/i);
|
|
35
|
+
const brand = match ? match[1] : "";
|
|
36
|
+
const rest = match ? match[2] : this.title;
|
|
37
|
+
const highlighted = rest.split(/\b(plus)\b/i).map((part, i) =>
|
|
38
|
+
i % 2 ? html`<span class="plus-text">${part}</span>` : part);
|
|
47
39
|
|
|
48
40
|
return html`
|
|
49
41
|
<bd-h as="h4" class="card-title">
|
|
50
|
-
|
|
51
|
-
</bd-h>
|
|
52
|
-
<bd-h as="h4" class="card-title">
|
|
53
|
-
${restOfBeforePlus}
|
|
54
|
-
<span class="plus-text">${plusWord}</span>
|
|
55
|
-
${afterPlus}
|
|
42
|
+
${brand ? html`<span class="card-title-brand">${brand}</span>` : ""}${highlighted}
|
|
56
43
|
</bd-h>
|
|
57
44
|
`;
|
|
58
45
|
}
|
|
@@ -60,8 +47,8 @@ class PricingCardHeader extends LitElement {
|
|
|
60
47
|
render() {
|
|
61
48
|
return html`
|
|
62
49
|
<div class="card-header">
|
|
63
|
-
${this.
|
|
64
|
-
|
|
50
|
+
${this.renderTitle()}
|
|
51
|
+
|
|
65
52
|
${this.parsedBadges.length
|
|
66
53
|
? html`
|
|
67
54
|
<div class="badge-wrapper multiple">
|