@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
|
@@ -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">
|
|
@@ -1,70 +1,93 @@
|
|
|
1
1
|
import { css } from "lit";
|
|
2
2
|
|
|
3
|
+
/* Adopted by the document (or the shadow root the card sits in) rather than
|
|
4
|
+
copied into each card, so every selector starts at the element: unscoped,
|
|
5
|
+
".price" and ".terms" would style any element of that class on the page. */
|
|
3
6
|
export default css`
|
|
4
|
-
.pricing {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
pricing-card-pricing .pricing {
|
|
8
|
+
text-align: start;
|
|
9
|
+
margin-top: var(--spacing-16);
|
|
10
|
+
}
|
|
11
|
+
pricing-card-pricing .pricing-info {
|
|
12
|
+
display: flex;
|
|
13
|
+
gap: var(--spacing-8);
|
|
14
|
+
align-items: baseline;
|
|
15
|
+
margin-top: var(--spacing-16);
|
|
16
|
+
}
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
pricing-card-pricing .original-price {
|
|
19
|
+
text-decoration: line-through;
|
|
20
|
+
font-family: var(--typography-fontFamily-sans);
|
|
21
|
+
color: var(--color-text-primary);
|
|
22
|
+
font-size: var(--typography-body-regular-fontSize);
|
|
23
|
+
margin: 0;
|
|
24
|
+
}
|
|
22
25
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
pricing-card-pricing .discount {
|
|
27
|
+
color: var(--color-text-success);
|
|
28
|
+
font-weight: bold;
|
|
29
|
+
/* -surface-strong is the step tokens.js calls "the heavier tint, badge
|
|
30
|
+
shade", and this pill's ink is already --color-text-success, which is
|
|
31
|
+
the same green-800 --status-success-text resolves to. So the pair now
|
|
32
|
+
matches bd-badge's success variant exactly (badge.css.js:78-79) and
|
|
33
|
+
measures the 5.93:1 that file records. Value-identical at #d1fadc. */
|
|
34
|
+
background: var(--status-success-surface-strong);
|
|
35
|
+
font-size: var(--typography-body-regular-fontSize);
|
|
36
|
+
padding: 5px;
|
|
37
|
+
border-radius: var(--radius-full);
|
|
38
|
+
font-family: var(--typography-fontFamily-sans);
|
|
39
|
+
margin: 0;
|
|
40
|
+
}
|
|
38
41
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
/* The price, a paragraph and not a heading: a figure the card states, not
|
|
43
|
+
the title of anything below it. As an <h3> under the card's <h4> it put an
|
|
44
|
+
out-of-order heading on every card. It keeps the look it had by reading
|
|
45
|
+
the heading-h3 role's axes directly, as the hero's final price reads
|
|
46
|
+
heading-h2. The 40px that stood here was on the bd-h host, where the atom
|
|
47
|
+
sets its own size, and never painted. */
|
|
48
|
+
pricing-card-pricing .price {
|
|
49
|
+
margin: 0;
|
|
50
|
+
text-align: start;
|
|
51
|
+
font-family: var(--typography-heading-h3-fontFamily);
|
|
52
|
+
font-size: var(--typography-heading-h3-fontSize);
|
|
53
|
+
font-weight: var(--typography-heading-h3-fontWeight);
|
|
54
|
+
line-height: var(--typography-heading-h3-lineHeight);
|
|
55
|
+
letter-spacing: var(--typography-heading-h3-letterSpacing);
|
|
56
|
+
color: var(--color-text-primary);
|
|
57
|
+
}
|
|
49
58
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
pricing-card-pricing .terms {
|
|
60
|
+
font-family: var(--typography-fontFamily-sans);
|
|
61
|
+
font-size: var(--typography-label-small-fontSize);
|
|
62
|
+
color: var(--color-text-primary);
|
|
63
|
+
text-align: start;
|
|
64
|
+
margin: 0;
|
|
65
|
+
margin-top: var(--spacing-8);
|
|
66
|
+
margin-bottom: var(--spacing-16);
|
|
67
|
+
}
|
|
59
68
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
pricing-card-pricing .terms a {
|
|
70
|
+
font-family: var(--typography-fontFamily-sans);
|
|
71
|
+
font-size: var(--typography-label-small-fontSize);
|
|
72
|
+
color: var(--color-text-primary);
|
|
73
|
+
text-decoration: underline;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* The two radios side by side, as the .toggle-group row they replace, and
|
|
77
|
+
the group's label kept for a screen reader only: the card's layout has
|
|
78
|
+
no line for it. */
|
|
79
|
+
pricing-card-pricing .billing::part(options) {
|
|
80
|
+
flex-direction: row;
|
|
81
|
+
gap: var(--spacing-16);
|
|
82
|
+
}
|
|
83
|
+
pricing-card-pricing .billing::part(label) {
|
|
84
|
+
position: absolute;
|
|
85
|
+
/* no token: 1px is the clip idiom's own measure, as in
|
|
86
|
+
visually-hidden.css.js */
|
|
87
|
+
width: 1px;
|
|
88
|
+
height: 1px;
|
|
89
|
+
overflow: hidden;
|
|
90
|
+
clip-path: inset(50%);
|
|
91
|
+
white-space: nowrap;
|
|
92
|
+
}
|
|
70
93
|
`;
|
|
@@ -2,11 +2,20 @@ import { LitElement, html } 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 "../badge/badge.js";
|
|
5
|
-
import "../heading/heading.js";
|
|
6
5
|
import "../paragraph/paragraph.js";
|
|
7
6
|
import "../link/link.js";
|
|
8
7
|
import "../radio/radio.js";
|
|
8
|
+
import "../radio/radio-group.js";
|
|
9
9
|
import newPricingPricingCSS from "../pricing-cards/pricing-card-pricing.css.js";
|
|
10
|
+
import { adoptStyles } from "./adopt-styles.js";
|
|
11
|
+
|
|
12
|
+
/* What the store renders for each billing period, and the period it is per.
|
|
13
|
+
The toggle used to change nothing but its own radios: the card showed the
|
|
14
|
+
yearly price, labelled "/month", whichever was selected. */
|
|
15
|
+
const PERIODS = {
|
|
16
|
+
monthly: { price: "discounted-monthly||full-monthly", full: "full-monthly", per: "/month" },
|
|
17
|
+
yearly : { price: "discounted||full", full: "full", per: "/year" }
|
|
18
|
+
};
|
|
10
19
|
|
|
11
20
|
class PricingCardPricing extends LitElement {
|
|
12
21
|
static properties = {
|
|
@@ -14,7 +23,9 @@ class PricingCardPricing extends LitElement {
|
|
|
14
23
|
devices : { type: String },
|
|
15
24
|
subscription : { type: String },
|
|
16
25
|
billingPeriod : { type: String, state: true },
|
|
17
|
-
dataLayerEvent: { type: String }
|
|
26
|
+
dataLayerEvent: { type: String },
|
|
27
|
+
/** Where "terms of use" goes. Without it the words are plain text. */
|
|
28
|
+
termsHref : { type: String, attribute: "terms-href" }
|
|
18
29
|
};
|
|
19
30
|
|
|
20
31
|
constructor() {
|
|
@@ -24,6 +35,7 @@ class PricingCardPricing extends LitElement {
|
|
|
24
35
|
this.devices = "5";
|
|
25
36
|
this.subscription = "1";
|
|
26
37
|
this.dataLayerEvent = "info";
|
|
38
|
+
this.termsHref = "";
|
|
27
39
|
}
|
|
28
40
|
|
|
29
41
|
// FOLOSEȘTE LIGHT DOM
|
|
@@ -31,61 +43,63 @@ class PricingCardPricing extends LitElement {
|
|
|
31
43
|
return this;
|
|
32
44
|
}
|
|
33
45
|
|
|
46
|
+
connectedCallback() {
|
|
47
|
+
super.connectedCallback();
|
|
48
|
+
adoptStyles(this, newPricingPricingCSS);
|
|
49
|
+
}
|
|
50
|
+
|
|
34
51
|
render() {
|
|
35
52
|
const isMonthly = this.billingPeriod === "monthly";
|
|
53
|
+
const period = PERIODS[this.billingPeriod];
|
|
36
54
|
|
|
55
|
+
/* Each card's pair is its own group. Three cards on a page all named their
|
|
56
|
+
radios "billing", so choosing a period in one card cleared the others. */
|
|
37
57
|
return html`
|
|
38
|
-
<style>
|
|
39
|
-
${newPricingPricingCSS}
|
|
40
|
-
</style>
|
|
41
|
-
|
|
42
58
|
<bd-context ignore-events-parent>
|
|
43
59
|
<bd-product product-id="${this.productId}">
|
|
44
|
-
<bd-option
|
|
45
|
-
devices="${this.devices}"
|
|
46
|
-
subscription="${this.subscription}"
|
|
60
|
+
<bd-option
|
|
61
|
+
devices="${this.devices}"
|
|
62
|
+
subscription="${this.subscription}"
|
|
47
63
|
data-layer-event="${this.dataLayerEvent}">
|
|
48
|
-
|
|
64
|
+
|
|
49
65
|
<div class="pricing">
|
|
50
|
-
<
|
|
66
|
+
<bd-radio-group class="billing" label="Billing period" name="billing">
|
|
51
67
|
<bd-radio
|
|
52
|
-
name="billing"
|
|
53
68
|
value="monthly"
|
|
54
69
|
label="Monthly"
|
|
55
70
|
?checked=${isMonthly}
|
|
56
71
|
@change=${this.onBillingChange}
|
|
57
72
|
></bd-radio>
|
|
58
73
|
<bd-radio
|
|
59
|
-
name="billing"
|
|
60
74
|
value="yearly"
|
|
61
75
|
label="Yearly"
|
|
62
76
|
?checked=${!isMonthly}
|
|
63
77
|
@change=${this.onBillingChange}
|
|
64
78
|
></bd-radio>
|
|
65
|
-
</
|
|
79
|
+
</bd-radio-group>
|
|
66
80
|
|
|
67
81
|
<div class="pricing-info" data-store-hide="!it.option.price.discounted">
|
|
68
82
|
<bd-p variant="small" class="original-price">
|
|
69
|
-
<s data-store-render data-store-price="full"></s>
|
|
83
|
+
<s data-store-render data-store-price="${period.full}"></s>
|
|
70
84
|
</bd-p>
|
|
71
|
-
|
|
85
|
+
|
|
72
86
|
<bd-badge tone="success" variant="shade">
|
|
73
87
|
Save <span data-store-render data-store-discount="percentage"></span>
|
|
74
88
|
</bd-badge>
|
|
75
89
|
</div>
|
|
76
90
|
|
|
77
|
-
<
|
|
78
|
-
<span data-store-render data-store-price="
|
|
79
|
-
</
|
|
91
|
+
<p class="price">
|
|
92
|
+
<span data-store-render data-store-price="${period.price}"></span>${period.per}
|
|
93
|
+
</p>
|
|
80
94
|
|
|
81
95
|
<bd-p variant="small" class="terms">
|
|
82
96
|
First year price. Plus applicable sales tax. See
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
97
|
+
${this.termsHref
|
|
98
|
+
? html`<bd-link href="${this.termsHref}" font-size="sm" color="strong" underline>terms of use</bd-link>`
|
|
99
|
+
: "terms of use"}
|
|
86
100
|
</bd-p>
|
|
87
101
|
</div>
|
|
88
|
-
|
|
102
|
+
|
|
89
103
|
</bd-option>
|
|
90
104
|
</bd-product>
|
|
91
105
|
</bd-context>
|
|
@@ -100,4 +114,4 @@ class PricingCardPricing extends LitElement {
|
|
|
100
114
|
}
|
|
101
115
|
}
|
|
102
116
|
|
|
103
|
-
customElements.define("pricing-card-pricing", PricingCardPricing);
|
|
117
|
+
customElements.define("pricing-card-pricing", PricingCardPricing);
|
|
@@ -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 newShowMorePricingCSS from "../pricing-cards/pricing-card-show-more.css.js";
|
|
@@ -22,13 +22,18 @@ class PricingCardShowMore extends LitElement {
|
|
|
22
22
|
|
|
23
23
|
render() {
|
|
24
24
|
return html`
|
|
25
|
-
<button
|
|
25
|
+
<button
|
|
26
|
+
@click="${this.toggleFeatures}"
|
|
27
|
+
class="show-more-toggle"
|
|
28
|
+
aria-expanded="${this.expanded}"
|
|
29
|
+
aria-controls="${this.expanded ? "feature-items" : nothing}"
|
|
30
|
+
>
|
|
26
31
|
${this.expanded
|
|
27
32
|
? html`<bd-minus-icon aria-hidden="true"></bd-minus-icon>Hide features`
|
|
28
33
|
: html`<bd-plus-icon aria-hidden="true"></bd-plus-icon>Show more features`}
|
|
29
34
|
</button>
|
|
30
35
|
${this.expanded
|
|
31
|
-
? html`<div class="feature-items"><slot></slot></div>`
|
|
36
|
+
? html`<div id="feature-items" class="feature-items"><slot></slot></div>`
|
|
32
37
|
: ''}
|
|
33
38
|
`;
|
|
34
39
|
}
|