@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.
Files changed (175) hide show
  1. package/CHANGELOG.md +91 -0
  2. package/README.md +2 -1
  3. package/package.json +14 -27
  4. package/schemas/component-manifest.json +233 -33
  5. package/schemas/manifest-omissions.json +23 -0
  6. package/src/components/accordion/accordion-bg.css.js +39 -30
  7. package/src/components/accordion/accordion-bg.js +17 -28
  8. package/src/components/accordion/accordion-bg.stories.js +5 -0
  9. package/src/components/accordion/accordion-panel.js +24 -0
  10. package/src/components/accordion/accordion.css.js +105 -111
  11. package/src/components/accordion/accordion.js +23 -37
  12. package/src/components/accordion/accordion.stories.js +5 -1
  13. package/src/components/anchor/anchor-nav.css.js +131 -53
  14. package/src/components/anchor/anchor-nav.js +276 -201
  15. package/src/components/annotation/annotation.css.js +7 -4
  16. package/src/components/architecture.stories.js +8 -7
  17. package/src/components/audience-card/audience-card.css.js +30 -4
  18. package/src/components/audience-card/audience-card.js +8 -13
  19. package/src/components/awards/awards-flex.css.js +23 -6
  20. package/src/components/awards/awards-flex.js +21 -6
  21. package/src/components/awards/awards-spotlight.css.js +25 -5
  22. package/src/components/awards/awards-spotlight.js +19 -7
  23. package/src/components/awards/awards.css.js +20 -8
  24. package/src/components/awards/awards.js +30 -91
  25. package/src/components/awards/awards.stories.js +5 -5
  26. package/src/components/awards/scroll-slides.js +128 -0
  27. package/src/components/back/back.css.js +2 -0
  28. package/src/components/badge/badge.css.js +15 -0
  29. package/src/components/bento-grid/bento-grid.css.js +105 -11
  30. package/src/components/bento-grid/bento-grid.js +37 -124
  31. package/src/components/bento-grid/bento-grid.stories.js +3 -2
  32. package/src/components/bento-grid/bento-item.css.js +71 -32
  33. package/src/components/bento-grid/bento-item.js +1 -30
  34. package/src/components/blockquote/blockquote.css.js +2 -2
  35. package/src/components/breadcrumb/breadcrumb.css.js +10 -9
  36. package/src/components/breadcrumb/breadcrumb.js +35 -34
  37. package/src/components/button/button.css.js +42 -17
  38. package/src/components/button/button.js +84 -3
  39. package/src/components/button/button.stories.js +17 -0
  40. package/src/components/card-features/card-features.css.js +23 -2
  41. package/src/components/card-features/card-features.js +6 -48
  42. package/src/components/cards/card.css.js +43 -14
  43. package/src/components/cards/card.js +43 -177
  44. package/src/components/cards/card.stories.js +8 -10
  45. package/src/components/carousel/carousel.css.js +101 -70
  46. package/src/components/carousel/carousel.js +107 -71
  47. package/src/components/carousel/carousel.stories.js +18 -16
  48. package/src/components/checkbox/checkbox.css.js +26 -9
  49. package/src/components/checkbox/checkbox.js +73 -39
  50. package/src/components/checkbox/checkbox.stories.js +35 -18
  51. package/src/components/compare/compare.css.js +68 -10
  52. package/src/components/compare/compare.js +40 -103
  53. package/src/components/compare/compare.stories.js +1 -1
  54. package/src/components/compatibility-table/compatibility-table.css.js +70 -37
  55. package/src/components/compatibility-table/compatibility-table.js +47 -40
  56. package/src/components/compatibility-table/compatibility-table.stories.js +78 -1
  57. package/src/components/display/display.css.js +7 -0
  58. package/src/components/dropdown/dropdown.css.js +20 -3
  59. package/src/components/dropdown/dropdown.js +57 -21
  60. package/src/components/dropdown/dropdown.stories.js +31 -9
  61. package/src/components/features/features.css.js +56 -21
  62. package/src/components/features/features.js +7 -117
  63. package/src/components/fieldset/fieldset.stories.js +68 -0
  64. package/src/components/footer/footer-images.js +34 -0
  65. package/src/components/footer/footer-links-group.css.js +10 -10
  66. package/src/components/footer/footer-locale.js +47 -0
  67. package/src/components/footer/footer-lp.js +27 -114
  68. package/src/components/footer/footer-lp.stories.js +2 -2
  69. package/src/components/footer/footer-nav-menu.css.js +2 -2
  70. package/src/components/footer/footer-nav-menu.js +8 -3
  71. package/src/components/footer/footer.css.js +228 -197
  72. package/src/components/footer/footer.js +109 -187
  73. package/src/components/footer/footer.stories.js +14 -4
  74. package/src/components/grid/grid.css.js +56 -20
  75. package/src/components/grid/grid.js +20 -15
  76. package/src/components/grid/grid.stories.js +39 -11
  77. package/src/components/header/header-code.css.js +20 -11
  78. package/src/components/header/header-code.js +1 -1
  79. package/src/components/header/header.css.js +20 -14
  80. package/src/components/header/header.js +6 -7
  81. package/src/components/header/header.stories.js +29 -24
  82. package/src/components/heading/heading.css.js +11 -0
  83. package/src/components/hero/hero.js +10 -2
  84. package/src/components/highlight/highlight.css.js +30 -6
  85. package/src/components/icons/arrow-icon.js +4 -1
  86. package/src/components/icons/arrow-right-icon.js +5 -1
  87. package/src/components/icons/icon-element.js +18 -0
  88. package/src/components/image/image.js +29 -9
  89. package/src/components/image/image.stories.js +38 -2
  90. package/src/components/input/custom-form.stories.js +38 -7
  91. package/src/components/input/input-clipboard.css.js +15 -1
  92. package/src/components/input/input-clipboard.js +84 -21
  93. package/src/components/input/input.js +27 -7
  94. package/src/components/install-options/install-options.css.js +26 -6
  95. package/src/components/install-options/install-options.js +32 -8
  96. package/src/components/label/label.css.js +1 -1
  97. package/src/components/light-carousel/light-carousel.css.js +100 -48
  98. package/src/components/light-carousel/light-carousel.js +43 -5
  99. package/src/components/link/link.css.js +15 -15
  100. package/src/components/link/link.js +17 -1
  101. package/src/components/link/link.stories.js +20 -7
  102. package/src/components/list/list.css.js +3 -3
  103. package/src/components/logo-marquee/logo-marquee.css.js +12 -1
  104. package/src/components/logo-marquee/logo-marquee.js +33 -8
  105. package/src/components/logo-marquee/logo-marquee.stories.js +10 -4
  106. package/src/components/modal/modal.css.js +74 -40
  107. package/src/components/modal/modal.js +85 -74
  108. package/src/components/modal/modal.stories.js +27 -14
  109. package/src/components/motion-art/motion-art.js +67 -1
  110. package/src/components/page-switcher/page-switcher.css.js +27 -9
  111. package/src/components/page-switcher/page-switcher.js +11 -8
  112. package/src/components/partner-banner/partner-banner.css.js +2 -0
  113. package/src/components/picture/picture.css.js +4 -4
  114. package/src/components/picture/picture.js +13 -3
  115. package/src/components/picture/picture.stories.js +28 -2
  116. package/src/components/post-card/post-card.css.js +18 -3
  117. package/src/components/pricing-cards/adopt-styles.js +16 -0
  118. package/src/components/pricing-cards/new-pricing-card.js +2 -4
  119. package/src/components/pricing-cards/new-pricing-card.stories.js +20 -22
  120. package/src/components/pricing-cards/pricing-card-actions.css.js +8 -12
  121. package/src/components/pricing-cards/pricing-card-actions.js +26 -13
  122. package/src/components/pricing-cards/pricing-card-container.css.js +4 -3
  123. package/src/components/pricing-cards/pricing-card-container.js +10 -4
  124. package/src/components/pricing-cards/pricing-card-header.css.js +5 -4
  125. package/src/components/pricing-cards/pricing-card-header.js +18 -31
  126. package/src/components/pricing-cards/pricing-card-pricing.css.js +84 -61
  127. package/src/components/pricing-cards/pricing-card-pricing.js +38 -24
  128. package/src/components/pricing-cards/pricing-card-show-more.js +8 -3
  129. package/src/components/pricing-cards/pricing-card.css.js +75 -41
  130. package/src/components/pricing-cards/pricing-card.js +356 -308
  131. package/src/components/progress/progress.css.js +58 -13
  132. package/src/components/progress/progress.js +13 -10
  133. package/src/components/progress/progress.stories.js +9 -7
  134. package/src/components/radio/radio-group.css.js +42 -0
  135. package/src/components/radio/radio-group.js +89 -0
  136. package/src/components/radio/radio.css.js +63 -6
  137. package/src/components/radio/radio.js +173 -140
  138. package/src/components/radio/radio.stories.js +99 -44
  139. package/src/components/radio/toggle-radio.js +44 -0
  140. package/src/components/review/review-grid.css.js +5 -1
  141. package/src/components/review/review-grid.js +2 -0
  142. package/src/components/review/review.js +13 -0
  143. package/src/components/shared/announcer.js +37 -0
  144. package/src/components/shared/fill-width.css.js +29 -0
  145. package/src/components/shared/form-control.js +194 -0
  146. package/src/components/shared/form-field.css.js +31 -3
  147. package/src/components/shared/token-scales.js +75 -26
  148. package/src/components/spotlight-section/spotlight-section.js +2 -2
  149. package/src/components/stat/stat-highlight.js +1 -1
  150. package/src/components/stat/stat.css.js +18 -3
  151. package/src/components/switch/switch.css.js +58 -5
  152. package/src/components/switch/switch.js +53 -5
  153. package/src/components/switch/switch.stories.js +30 -8
  154. package/src/components/tab-list/tab-list.css.js +51 -13
  155. package/src/components/tab-list/tab-list.js +7 -2
  156. package/src/components/tab-list/tab-list.stories.js +2 -2
  157. package/src/components/tabs/tabs.css.js +18 -1
  158. package/src/components/tabs/tabs.js +119 -41
  159. package/src/components/terminal/terminal-message.css.js +6 -1
  160. package/src/components/termsOfUse/terms.css.js +4 -2
  161. package/src/components/textarea/textarea.js +22 -7
  162. package/src/components/textarea/textarea.stories.js +12 -9
  163. package/src/components/trust-panel/trust-panel.css.js +13 -3
  164. package/src/components/ultimate-security-demo.stories.js +5 -5
  165. package/src/components/video/video.css.js +5 -0
  166. package/src/components/video/video.js +5 -0
  167. package/src/components/video/video.stories.js +12 -0
  168. package/src/components/video-player/video-player.css.js +20 -8
  169. package/src/components/video-player/video-player.js +74 -20
  170. package/src/components/video-player/video-player.stories.js +17 -3
  171. package/src/tokens/brands.stories.js +1 -1
  172. package/src/tokens/themes/index.js +2 -2
  173. package/src/tokens/typography.stories.js +4 -3
  174. package/src/vendor/motion-art/README.md +4 -1
  175. 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
- :host([count="4"]),
31
- :host([count="5"]),
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
- firstUpdated() {
18
- const cards = this.querySelectorAll("new-pricing-card");
19
- this.count = cards.length;
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: left;
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: inline;
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: left;
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: left;
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
- // Funcție pentru a evidenția "Plus" în titlu
23
- renderTitleWithHighlightedPlus() {
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
- if (plusIndex === -1) {
30
- return html`
31
- <bd-h as="h4" class="card-title">
32
- <template shadowrootmode="open">
33
- <h4 class="bd-heading h4"><slot></slot></h4>
34
- </template>
35
- <span class="card-title-brand">Internet Security</span>
36
- </bd-h>
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 [brand, ...restBefore] = beforePlus.split(" ");
46
- const restOfBeforePlus = restBefore.join(" ");
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
- <span class="card-title-brand">${brand}</span>
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.renderTitleWithHighlightedPlus()}
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
- text-align: left;
6
- margin-top: var(--spacing-16);
7
- }
8
- .pricing-info {
9
- display: flex;
10
- gap: var(--spacing-8);
11
- align-items: baseline;
12
- margin-top: var(--spacing-16);
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
- .original-price {
16
- text-decoration: line-through;
17
- font-family: var(--typography-fontFamily-sans);
18
- color: var(--color-text-primary);
19
- font-size: var(--typography-body-regular-fontSize);
20
- margin: 0;
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
- .discount {
24
- color: var(--color-text-success);
25
- font-weight: bold;
26
- /* -surface-strong is the step tokens.js calls "the heavier tint, badge
27
- shade", and this pill's ink is already --color-text-success, which is
28
- the same green-800 --status-success-text resolves to. So the pair now
29
- matches bd-badge's success variant exactly (badge.css.js:78-79) and
30
- measures the 5.93:1 that file records. Value-identical at #d1fadc. */
31
- background: var(--status-success-surface-strong);
32
- font-size: var(--typography-body-regular-fontSize);
33
- padding: 5px;
34
- border-radius: var(--radius-full);
35
- font-family: var(--typography-fontFamily-sans);
36
- margin: 0;
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
- .price {
40
- /* no token: 40px is not on the type scale — 4xl is 36 and 5xl is 48 —
41
- and this was reading --heading-xxlarge, a legacy pixel size deleted with the
42
- rest of that family. Adding the step is its own decision. */
43
- font-size: 40px;
44
- text-align: left;
45
- font-family: var(--typography-fontFamily-sans);
46
- color: var(--color-text-primary);
47
- margin: 0;
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
- .terms {
51
- font-family: var(--typography-fontFamily-sans);
52
- font-size: var(--typography-label-small-fontSize);
53
- color: var(--color-text-primary);
54
- text-align: left;
55
- margin: 0;
56
- margin-top: var(--spacing-8);
57
- margin-bottom: var(--spacing-16);
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
- .terms a {
61
- font-family: var(--typography-fontFamily-sans);
62
- font-size: var(--typography-label-small-fontSize);
63
- color: var(--color-text-primary);
64
- text-decoration: underline;
65
- }
66
- .toggle-group {
67
- gap: var(--spacing-16);
68
- display: flex;
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
- <div class="toggle-group">
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
- </div>
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
- <bd-h as="h3" class="price">
78
- <span data-store-render data-store-price="discounted||full"></span>/month
79
- </bd-h>
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
- <bd-link href="#" target="_blank" font-size="sm" color="strong" underline>
84
- terms of use
85
- </bd-link>
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 @click="${this.toggleFeatures}" class="show-more-toggle">
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
  }