@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.
Files changed (173) hide show
  1. package/CHANGELOG.md +84 -0
  2. package/README.md +2 -1
  3. package/package.json +14 -27
  4. package/schemas/component-manifest.json +226 -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 +238 -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 +64 -5
  75. package/src/components/header/header-code.css.js +20 -11
  76. package/src/components/header/header-code.js +1 -1
  77. package/src/components/header/header.css.js +20 -14
  78. package/src/components/header/header.js +6 -7
  79. package/src/components/header/header.stories.js +29 -24
  80. package/src/components/heading/heading.css.js +11 -0
  81. package/src/components/hero/hero.js +10 -2
  82. package/src/components/highlight/highlight.css.js +30 -6
  83. package/src/components/icons/arrow-icon.js +4 -1
  84. package/src/components/icons/arrow-right-icon.js +5 -1
  85. package/src/components/icons/icon-element.js +18 -0
  86. package/src/components/image/image.js +29 -9
  87. package/src/components/image/image.stories.js +38 -2
  88. package/src/components/input/custom-form.stories.js +38 -7
  89. package/src/components/input/input-clipboard.css.js +15 -1
  90. package/src/components/input/input-clipboard.js +84 -21
  91. package/src/components/input/input.js +27 -7
  92. package/src/components/install-options/install-options.css.js +26 -6
  93. package/src/components/install-options/install-options.js +32 -8
  94. package/src/components/label/label.css.js +1 -1
  95. package/src/components/light-carousel/light-carousel.css.js +100 -48
  96. package/src/components/light-carousel/light-carousel.js +43 -5
  97. package/src/components/link/link.css.js +15 -15
  98. package/src/components/link/link.js +17 -1
  99. package/src/components/link/link.stories.js +20 -7
  100. package/src/components/list/list.css.js +3 -3
  101. package/src/components/logo-marquee/logo-marquee.css.js +12 -1
  102. package/src/components/logo-marquee/logo-marquee.js +33 -8
  103. package/src/components/logo-marquee/logo-marquee.stories.js +10 -4
  104. package/src/components/modal/modal.css.js +74 -40
  105. package/src/components/modal/modal.js +85 -74
  106. package/src/components/modal/modal.stories.js +27 -14
  107. package/src/components/motion-art/motion-art.js +67 -1
  108. package/src/components/page-switcher/page-switcher.css.js +27 -9
  109. package/src/components/page-switcher/page-switcher.js +11 -8
  110. package/src/components/partner-banner/partner-banner.css.js +2 -0
  111. package/src/components/picture/picture.css.js +4 -4
  112. package/src/components/picture/picture.js +13 -3
  113. package/src/components/picture/picture.stories.js +28 -2
  114. package/src/components/post-card/post-card.css.js +18 -3
  115. package/src/components/pricing-cards/adopt-styles.js +16 -0
  116. package/src/components/pricing-cards/new-pricing-card.js +2 -4
  117. package/src/components/pricing-cards/new-pricing-card.stories.js +20 -22
  118. package/src/components/pricing-cards/pricing-card-actions.css.js +8 -12
  119. package/src/components/pricing-cards/pricing-card-actions.js +26 -13
  120. package/src/components/pricing-cards/pricing-card-container.css.js +4 -3
  121. package/src/components/pricing-cards/pricing-card-container.js +10 -4
  122. package/src/components/pricing-cards/pricing-card-header.css.js +5 -4
  123. package/src/components/pricing-cards/pricing-card-header.js +18 -31
  124. package/src/components/pricing-cards/pricing-card-pricing.css.js +84 -61
  125. package/src/components/pricing-cards/pricing-card-pricing.js +38 -24
  126. package/src/components/pricing-cards/pricing-card-show-more.js +8 -3
  127. package/src/components/pricing-cards/pricing-card.css.js +75 -41
  128. package/src/components/pricing-cards/pricing-card.js +356 -308
  129. package/src/components/progress/progress.css.js +58 -13
  130. package/src/components/progress/progress.js +13 -10
  131. package/src/components/progress/progress.stories.js +9 -7
  132. package/src/components/radio/radio-group.css.js +42 -0
  133. package/src/components/radio/radio-group.js +89 -0
  134. package/src/components/radio/radio.css.js +63 -6
  135. package/src/components/radio/radio.js +173 -140
  136. package/src/components/radio/radio.stories.js +99 -44
  137. package/src/components/radio/toggle-radio.js +44 -0
  138. package/src/components/review/review-grid.css.js +5 -1
  139. package/src/components/review/review-grid.js +2 -0
  140. package/src/components/review/review.js +13 -0
  141. package/src/components/shared/announcer.js +37 -0
  142. package/src/components/shared/fill-width.css.js +33 -0
  143. package/src/components/shared/form-control.js +194 -0
  144. package/src/components/shared/form-field.css.js +31 -3
  145. package/src/components/shared/token-scales.js +75 -26
  146. package/src/components/spotlight-section/spotlight-section.js +2 -2
  147. package/src/components/stat/stat-highlight.js +1 -1
  148. package/src/components/stat/stat.css.js +18 -3
  149. package/src/components/switch/switch.css.js +58 -5
  150. package/src/components/switch/switch.js +53 -5
  151. package/src/components/switch/switch.stories.js +30 -8
  152. package/src/components/tab-list/tab-list.css.js +51 -13
  153. package/src/components/tab-list/tab-list.js +7 -2
  154. package/src/components/tab-list/tab-list.stories.js +2 -2
  155. package/src/components/tabs/tabs.css.js +18 -1
  156. package/src/components/tabs/tabs.js +119 -41
  157. package/src/components/terminal/terminal-message.css.js +6 -1
  158. package/src/components/termsOfUse/terms.css.js +4 -2
  159. package/src/components/textarea/textarea.js +22 -7
  160. package/src/components/textarea/textarea.stories.js +12 -9
  161. package/src/components/trust-panel/trust-panel.css.js +13 -3
  162. package/src/components/ultimate-security-demo.stories.js +5 -5
  163. package/src/components/video/video.css.js +5 -0
  164. package/src/components/video/video.js +5 -0
  165. package/src/components/video/video.stories.js +12 -0
  166. package/src/components/video-player/video-player.css.js +20 -8
  167. package/src/components/video-player/video-player.js +74 -20
  168. package/src/components/video-player/video-player.stories.js +17 -3
  169. package/src/tokens/brands.stories.js +1 -1
  170. package/src/tokens/themes/index.js +2 -2
  171. package/src/tokens/typography.stories.js +4 -3
  172. package/src/vendor/motion-art/README.md +4 -1
  173. 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 "../badge/badge.js";
@@ -9,21 +9,43 @@ import "../paragraph/paragraph.js";
9
9
  import "../tab-list/tab-list.js";
10
10
  import pricingCardsCSS from "../pricing-cards/pricing-card.css.js";
11
11
  import { contentSwitcherCSS, tabListCSS } from "../tab-list/tab-list.css.js";
12
+ import { adoptStyles } from "./adopt-styles.js";
13
+
14
+ /* Each card's "Learn More", which was a <button> that did nothing: the
15
+ product's page in the section's own locale. It was always the en-us page,
16
+ so a German reader's "Learn More" left the German site for the US one and
17
+ its US prices. bitdefender.com spells a locale in its paths in lower case. */
18
+ const PRODUCT_PAGES = {
19
+ us_i: "consumer/ultimate-security",
20
+ ps_i: "consumer/premium-security",
21
+ ts_i: "consumer/total-security"
22
+ };
23
+
24
+ const productPage = (productId, locale) =>
25
+ `https://www.bitdefender.com/${(locale || "en-US").toLowerCase()}/${PRODUCT_PAGES[productId]}`;
12
26
 
13
27
  class PricingContainer extends LitElement {
14
28
  static properties = {
15
- planType: { type: String },
16
- locale : { type: String },
17
- currency: { type: String },
18
- shadow : { type: Boolean, reflect: true }
29
+ planType : { type: String },
30
+ locale : { type: String },
31
+ currency : { type: String },
32
+ shadow : { type: Boolean, reflect: true },
33
+ /** Where each card's "terms of use" goes. Without it the words are plain text. */
34
+ termsHref: { type: String, attribute: "terms-href" }
19
35
  };
20
36
 
37
+ /* One sheet for the section and every card in it: the cards render into
38
+ this shadow root, and so does the switch, whose bd-tab-list needs its
39
+ own sheets here. Each card used to carry a <style> copy of this. */
40
+ static styles = [pricingCardsCSS, tabListCSS, contentSwitcherCSS];
41
+
21
42
  constructor() {
22
43
  super();
23
44
  this.planType = "individual";
24
45
  this.locale = "en-US";
25
46
  this.currency = "EUR";
26
47
  this.shadow = true;
48
+ this.termsHref = "";
27
49
  }
28
50
 
29
51
  handleSwitch(event) {
@@ -31,53 +53,60 @@ class PricingContainer extends LitElement {
31
53
  }
32
54
 
33
55
  render() {
56
+ /* The switch's tabs control the cards, which are their tab panel. The
57
+ switch renders into this shadow root, so its tabs and the panel share a
58
+ tree and the IDREFs between them resolve. */
34
59
  return html`
35
- <style>
36
- ${pricingCardsCSS}
37
- </style>
38
-
39
60
  <div class="pricing-container">
40
61
  <pricing-switch
41
62
  .planType=${this.planType}
63
+ panel-id="plan-cards"
42
64
  @plan-switch=${this.handleSwitch}
43
65
  ></pricing-switch>
44
66
 
45
- <div class="pricing-cards">
67
+ <div
68
+ class="pricing-cards"
69
+ id="plan-cards"
70
+ role="tabpanel"
71
+ aria-labelledby=${this.planType === "family" ? "plan-1" : "plan-0"}
72
+ >
46
73
  ${this.planType === "individual"
47
74
  ? html`
48
- <!-- Card 1: VSB - Ultimate Security -->
75
+ <!-- Card 1: Ultimate Security -->
49
76
  <bd-context ignore-events-parent>
50
- <bd-product product-id="vsb">
77
+ <bd-product product-id="us_i">
51
78
  <bd-option devices="5" subscription="1" data-layer-event="info">
52
79
  <pricing-card
53
80
  title="Bitdefender Ultimate Security"
54
81
  planType="individual"
55
- productId="vsb"
82
+ learn-more-href=${productPage("us_i", this.locale)}
83
+ .termsHref=${this.termsHref}
56
84
  .shadow=${this.shadow}
57
85
  ></pricing-card>
58
86
  </bd-option>
59
87
  </bd-product>
60
88
  </bd-context>
61
89
 
62
- <!-- Card 2: TSI - Premium Security (highlighted) -->
90
+ <!-- Card 2: Premium Security, the default title (highlighted) -->
63
91
  <bd-context ignore-events-parent>
64
- <bd-product product-id="ts_i">
92
+ <bd-product product-id="ps_i">
65
93
  <bd-option devices="5" subscription="1" data-layer-event="info">
66
94
  <pricing-card
67
95
  highlight
68
96
  features
69
97
  identity
70
98
  planType="individual"
71
- productId="ts_i"
99
+ learn-more-href=${productPage("ps_i", this.locale)}
100
+ .termsHref=${this.termsHref}
72
101
  .shadow=${this.shadow}
73
102
  ></pricing-card>
74
103
  </bd-option>
75
104
  </bd-product>
76
105
  </bd-context>
77
106
 
78
- <!-- Card 3: PSI - Total Security -->
107
+ <!-- Card 3: Total Security -->
79
108
  <bd-context ignore-events-parent>
80
- <bd-product product-id="ps_i">
109
+ <bd-product product-id="ts_i">
81
110
  <bd-option devices="5" subscription="1" data-layer-event="info">
82
111
  <pricing-card
83
112
  title="Bitdefender Total Security"
@@ -85,7 +114,8 @@ class PricingContainer extends LitElement {
85
114
  privacy
86
115
  identity
87
116
  planType="individual"
88
- productId="ps_i"
117
+ learn-more-href=${productPage("ts_i", this.locale)}
118
+ .termsHref=${this.termsHref}
89
119
  .shadow=${this.shadow}
90
120
  ></pricing-card>
91
121
  </bd-option>
@@ -93,9 +123,9 @@ class PricingContainer extends LitElement {
93
123
  </bd-context>
94
124
  `
95
125
  : html`
96
- <!-- Family Card 1: VSB -->
126
+ <!-- Family Card 1: Ultimate Security -->
97
127
  <bd-context ignore-events-parent>
98
- <bd-product product-id="vsb">
128
+ <bd-product product-id="us_i">
99
129
  <bd-option devices="5" subscription="1" data-layer-event="info">
100
130
  <pricing-card-family
101
131
  title="Bitdefender Ultimate Security"
@@ -104,32 +134,34 @@ class PricingContainer extends LitElement {
104
134
  identityExtended
105
135
  parentalControl
106
136
  planType="family"
107
- productId="vsb"
137
+ learn-more-href=${productPage("us_i", this.locale)}
138
+ .termsHref=${this.termsHref}
108
139
  .shadow=${this.shadow}
109
140
  ></pricing-card-family>
110
141
  </bd-option>
111
142
  </bd-product>
112
143
  </bd-context>
113
144
 
114
- <!-- Family Card 2: TSI (highlighted) -->
145
+ <!-- Family Card 2: Premium Security, the default title (highlighted) -->
115
146
  <bd-context ignore-events-parent>
116
- <bd-product product-id="ts_i">
147
+ <bd-product product-id="ps_i">
117
148
  <bd-option devices="5" subscription="1" data-layer-event="info">
118
149
  <pricing-card-family
119
150
  highlight
120
151
  features
121
152
  identity
122
153
  planType="family"
123
- productId="ts_i"
154
+ learn-more-href=${productPage("ps_i", this.locale)}
155
+ .termsHref=${this.termsHref}
124
156
  .shadow=${this.shadow}
125
157
  ></pricing-card-family>
126
158
  </bd-option>
127
159
  </bd-product>
128
160
  </bd-context>
129
161
 
130
- <!-- Family Card 3: PSI -->
162
+ <!-- Family Card 3: Total Security -->
131
163
  <bd-context ignore-events-parent>
132
- <bd-product product-id="ps_i">
164
+ <bd-product product-id="ts_i">
133
165
  <bd-option devices="5" subscription="1" data-layer-event="info">
134
166
  <pricing-card-family
135
167
  title="Bitdefender Total Security"
@@ -137,7 +169,8 @@ class PricingContainer extends LitElement {
137
169
  privacy
138
170
  identity
139
171
  planType="family"
140
- productId="ps_i"
172
+ learn-more-href=${productPage("ts_i", this.locale)}
173
+ .termsHref=${this.termsHref}
141
174
  .shadow=${this.shadow}
142
175
  ></pricing-card-family>
143
176
  </bd-option>
@@ -150,6 +183,65 @@ class PricingContainer extends LitElement {
150
183
  }
151
184
  }
152
185
 
186
+ /* The price block and the buttons, which the individual and family cards
187
+ rendered as two identical copies.
188
+
189
+ The price is a paragraph and not an <h3>: a figure the card states, not the
190
+ title of anything, and as an h3 under the card's h4 it put an out-of-order
191
+ heading on every card. ".price" in the stylesheet keeps its look.
192
+
193
+ "terms of use" was <a href="#">, which goes nowhere; it is a link when the
194
+ card is given somewhere to go, and plain text otherwise. */
195
+ const renderPricing = termsHref => html`
196
+ <div class="pricing">
197
+ <div class="pricing-info" data-store-hide="!it.option.price.discounted">
198
+ <bd-p variant="small" class="original-price">
199
+ <s data-store-render data-store-price="full"></s>
200
+ </bd-p>
201
+ <bd-p variant="small" class="discount">
202
+ <bd-badge tone="success" variant="shade">
203
+ Save <span data-store-render data-store-discount="percentage"></span>
204
+ </bd-badge>
205
+ </bd-p>
206
+ </div>
207
+ <p class="price">
208
+ <span data-store-render data-store-price="discounted||full"></span>/year
209
+ </p>
210
+ <bd-p variant="small" class="terms">
211
+ First year price. Plus applicable sales tax. See
212
+ ${termsHref ? html`<a href=${termsHref}>terms of use</a>` : "terms of use"} below.
213
+ </bd-p>
214
+ </div>
215
+ `;
216
+
217
+ /* Every card's "Buy Now" had the same name, so the product follows the
218
+ visible words in it (WCAG 2.5.3 keeps those words first). "Learn More" was a
219
+ <button> that did nothing; it is a link to the product's page, and absent
220
+ without one. */
221
+ const renderActions = (title, learnMoreHref) => html`
222
+ <div class="actions">
223
+ <bd-button-link
224
+ label="Buy Now, ${title}"
225
+ variant="accent"
226
+ fullWidth
227
+ buyLink
228
+ >
229
+ Buy Now
230
+ </bd-button-link>
231
+
232
+ ${learnMoreHref
233
+ ? html`<bd-button-link
234
+ href=${learnMoreHref}
235
+ label="Learn more about ${title}"
236
+ variant="ghost"
237
+ fullWidth
238
+ >
239
+ Learn More
240
+ </bd-button-link>`
241
+ : ""}
242
+ </div>
243
+ `;
244
+
153
245
  class PricingCard extends LitElement {
154
246
  static properties = {
155
247
  title : { type: String },
@@ -163,7 +255,11 @@ class PricingCard extends LitElement {
163
255
  productId : { type: String, attribute: "product-id" },
164
256
  locale : { type: String },
165
257
  currency : { type: String },
166
- shadow : { type: Boolean, reflect: true }
258
+ shadow : { type: Boolean, reflect: true },
259
+ /** The product's page, for "Learn More". Without it there is no Learn More. */
260
+ learnMoreHref : { type: String, attribute: "learn-more-href" },
261
+ /** Where "terms of use" goes. Without it the words are plain text. */
262
+ termsHref : { type: String, attribute: "terms-href" }
167
263
  };
168
264
 
169
265
  constructor() {
@@ -180,75 +276,44 @@ class PricingCard extends LitElement {
180
276
  this.locale = "en-US";
181
277
  this.currency = "EUR";
182
278
  this.shadow = true;
279
+ this.learnMoreHref = "";
280
+ this.termsHref = "";
183
281
  }
184
282
 
185
283
  createRenderRoot() {
186
284
  return this; // Light DOM pentru BrightData
187
285
  }
188
286
 
287
+ connectedCallback() {
288
+ super.connectedCallback();
289
+ adoptStyles(this, pricingCardsCSS);
290
+ }
291
+
189
292
  render() {
190
293
  return html`
191
- <style>
192
- ${pricingCardsCSS}
193
- </style>
194
-
195
294
  <div class="card ${this.highlight ? "highlight" : ""}">
196
295
  ${this.highlight
197
296
  ? html`<div class="highlight-banner">Best value</div>`
198
297
  : ""}
199
298
  <div class="card-header">
200
299
  <bd-h as="h4" class="card-title">${this.title}</bd-h>
201
-
300
+
202
301
  <bd-badge tone="primary" variant="fill">
203
302
  Individual
204
303
  </bd-badge>
205
-
304
+
206
305
  <bd-p variant="small" class="badge-subtitle">1 account & 5 devices</bd-p>
207
306
  <bd-divider-horizontal color="subtle" opacity="0.25"></bd-divider-horizontal>
208
307
  </div>
209
-
308
+
210
309
  <!-- Pricing section with store integration -->
211
- <div class="pricing">
212
- <div class="pricing-info" data-store-hide="!it.option.price.discounted">
213
- <bd-p variant="small" class="original-price">
214
- <s data-store-render data-store-price="full"></s>
215
- </bd-p>
216
- <bd-p variant="small" class="discount">
217
- <bd-badge tone="success" variant="shade">
218
- Save <span data-store-render data-store-discount="percentage"></span>
219
- </bd-badge> </bd-p>
220
- </div>
221
- <bd-h as="h3" class="price">
222
- <span data-store-render data-store-price="discounted||full"></span>/year
223
- </bd-h>
224
- <bd-p variant="small" class="terms">
225
- First year price. Plus applicable sales tax. See
226
- <a href="#">terms of use</a> below.
227
- </bd-p>
228
- </div>
229
-
310
+ ${renderPricing(this.termsHref)}
311
+
230
312
  <!-- Actions with store integration -->
231
- <div class="actions">
232
- <bd-button-link
233
- label="Buy Now"
234
- variant="accent"
235
- fullWidth
236
- buyLink
237
- >
238
- Buy Now
239
- </bd-button-link>
240
-
241
- <bd-button
242
- label="Learn More"
243
- variant="ghost"
244
- fullWidth
245
- >
246
- Learn More
247
- </bd-button>
248
- </div>
249
-
313
+ ${renderActions(this.title, this.learnMoreHref)}
314
+
250
315
  <bd-divider-horizontal color="subtle" opacity="0.25"></bd-divider-horizontal>
251
-
316
+
252
317
  <!-- Features sections -->
253
318
  ${this.features ? html`<pricing-card-features .shadow=${this.shadow}></pricing-card-features>` : ""}
254
319
  ${this.privacy ? html`<pricing-card-privacy .shadow=${this.shadow}></pricing-card-privacy>` : ""}
@@ -273,7 +338,11 @@ class PricingCardFamily extends LitElement {
273
338
  productId : { type: String, attribute: "product-id" },
274
339
  locale : { type: String },
275
340
  currency : { type: String },
276
- shadow : { type: Boolean, reflect: true }
341
+ shadow : { type: Boolean, reflect: true },
342
+ /** The product's page, for "Learn More". Without it there is no Learn More. */
343
+ learnMoreHref : { type: String, attribute: "learn-more-href" },
344
+ /** Where "terms of use" goes. Without it the words are plain text. */
345
+ termsHref : { type: String, attribute: "terms-href" }
277
346
  };
278
347
 
279
348
  constructor() {
@@ -290,73 +359,42 @@ class PricingCardFamily extends LitElement {
290
359
  this.locale = "en-US";
291
360
  this.currency = "EUR";
292
361
  this.shadow = true;
362
+ this.learnMoreHref = "";
363
+ this.termsHref = "";
293
364
  }
294
365
 
295
366
  createRenderRoot() {
296
367
  return this; // Light DOM pentru BrightData
297
368
  }
298
369
 
370
+ connectedCallback() {
371
+ super.connectedCallback();
372
+ adoptStyles(this, pricingCardsCSS);
373
+ }
374
+
299
375
  render() {
300
376
  return html`
301
- <style>
302
- ${pricingCardsCSS}
303
- </style>
304
-
305
377
  <div class="card ${this.highlight ? "highlight" : ""}">
306
378
  ${this.highlight
307
379
  ? html`<div class="highlight-banner">Best value</div>`
308
380
  : ""}
309
381
  <div class="card-header">
310
382
  <bd-h as="h4" class="card-title">${this.title}</bd-h>
311
-
383
+
312
384
  <bd-badge tone="primary" variant="fill">
313
385
  Family
314
386
  </bd-badge>
315
-
387
+
316
388
  <bd-p variant="small" class="badge-subtitle">5 accounts & 25 devices</bd-p>
317
389
  <bd-divider-horizontal color="subtle" opacity="0.25"></bd-divider-horizontal>
318
390
  </div>
319
-
391
+
320
392
  <!-- Pricing section with store integration -->
321
- <div class="pricing">
322
- <div class="pricing-info" data-store-hide="!it.option.price.discounted">
323
- <bd-p variant="small" class="original-price">
324
- <s data-store-render data-store-price="full"></s>
325
- </bd-p>
326
- <bd-p variant="small" class="discount">
327
- <bd-badge tone="success" variant="shade">
328
- Save <span data-store-render data-store-discount="percentage"></span>
329
- </bd-badge> </bd-p>
330
- </div>
331
- <bd-h as="h3" class="price">
332
- <span data-store-render data-store-price="discounted||full"></span>/year
333
- </bd-h>
334
- <bd-p variant="small" class="terms">
335
- First year price. Plus applicable sales tax. See
336
- <a href="#">terms of use</a> below.
337
- </bd-p>
338
- </div>
339
-
393
+ ${renderPricing(this.termsHref)}
394
+
340
395
  <!-- Actions with store integration -->
341
- <div class="actions">
342
- <bd-button-link
343
- label="Buy Now"
344
- variant="accent"
345
- fullWidth
346
- buyLink
347
- >
348
- Buy Now
349
- </bd-button-link>
350
-
351
- <bd-button
352
- label="Learn More"
353
- variant="ghost"
354
- fullWidth
355
- >
356
- Learn More
357
- </bd-button>
358
- </div>
359
-
396
+ ${renderActions(this.title, this.learnMoreHref)}
397
+
360
398
  <bd-divider-horizontal color="subtle" opacity="0.25"></bd-divider-horizontal>
361
399
 
362
400
  <!-- Features sections -->
@@ -383,13 +421,29 @@ class PricingCardFamily extends LitElement {
383
421
  class PricingSwitch extends LitElement {
384
422
  static properties = {
385
423
  planType: { type: String },
386
- shadow : { type: Boolean, reflect: true }
424
+ shadow : { type: Boolean, reflect: true },
425
+ /** The id of the cards this switches between, in the switch's own tree. */
426
+ panelId : { type: String, attribute: "panel-id" }
387
427
  };
388
428
 
389
429
  constructor() {
390
430
  super();
391
431
  this.planType = "individual";
392
432
  this.shadow = true;
433
+ this.panelId = "";
434
+ }
435
+
436
+ /* Light DOM, for the reason bd-tab-list gives for its own: its tabs have to
437
+ sit in the same tree as the panel they control. In a shadow root of its
438
+ own, this switch kept bd-tab-list's tabs away from the cards, so they were
439
+ tabs controlling nothing. */
440
+ createRenderRoot() {
441
+ return this;
442
+ }
443
+
444
+ connectedCallback() {
445
+ super.connectedCallback();
446
+ adoptStyles(this, pricingCardsCSS, tabListCSS, contentSwitcherCSS);
393
447
  }
394
448
 
395
449
  /** bd-tab-list reports the option index; the plan type is this component's word for it. */
@@ -406,20 +460,13 @@ class PricingSwitch extends LitElement {
406
460
  }
407
461
 
408
462
  render() {
409
- /* bd-tab-list renders into light DOM, which inside this component means
410
- this shadow root -- so its sheets have to be in scope here. See the note
411
- at the top of tab-list.js on why that element works this way. */
412
463
  return html`
413
- <style>
414
- ${pricingCardsCSS}
415
- ${tabListCSS}
416
- ${contentSwitcherCSS}
417
- </style>
418
-
419
464
  <div class="switchBox">
420
465
  <bd-tab-list
421
466
  appearance="switcher"
422
467
  label="Plan type"
468
+ id-prefix="plan"
469
+ panel-id=${this.panelId || nothing}
423
470
  .tabs=${[{ label: "Individual" }, { label: "Family" }]}
424
471
  .selected=${this.planType === "family" ? 1 : 0}
425
472
  @bd-tab-select=${this.handleSwitch}
@@ -429,12 +476,155 @@ class PricingSwitch extends LitElement {
429
476
  }
430
477
  }
431
478
 
432
- class PricingCardFeatures extends LitElement {
479
+ /* A feature's description used to show on .feature-item:hover and nowhere
480
+ else: no keyboard path, no touch path, and nothing for a screen reader. The
481
+ feature's name is now the button that opens it -- a disclosure, so the
482
+ description follows the name in reading order once it is open. Escape, a
483
+ press outside the row, or Tab moving on closes it; one is open per list.
484
+ The pointer's hover still previews it, for a mouse only (see the stylesheet).
485
+
486
+ One per list element, which is its own shadow root, so the ids it hands out
487
+ only have to be unique within one list. */
488
+ class FeatureTips {
489
+ constructor(host) {
490
+ this.host = host;
491
+ this.open = -1;
492
+ /* Escape closes an open description, after everything else on the page
493
+ has had the key: in the bubble phase, left alone if something handled
494
+ it first, and not claimed -- it used to be taken in the capture phase
495
+ and cancelled, so while a description was open no other Escape on the
496
+ page did anything, a dialog's close request included. */
497
+ this._onKeydown = e => {
498
+ if (e.key === "Escape" && !e.defaultPrevented) this.close();
499
+ };
500
+ this._onPointerdown = e => {
501
+ const item = this.host.renderRoot.getElementById(this.id(this.open))?.closest(".feature-item");
502
+ if (!e.composedPath().includes(item)) this.close();
503
+ };
504
+ // only when focus moves on to something: a press on the open description
505
+ // blurs the button with no relatedTarget, and should not close it
506
+ this.onFocusOut = e => { if (e.relatedTarget) this.close(); };
507
+ host.addController(this);
508
+ }
509
+
510
+ /* Disconnected, the open description goes with the listeners that close
511
+ it, so a list put back on the page does not show one nothing can shut. */
512
+ hostDisconnected() {
513
+ this.open = -1;
514
+ this._listen(false);
515
+ }
516
+
517
+ id(i) {
518
+ return `feature-tip-${i}`;
519
+ }
520
+
521
+ toggle(i) {
522
+ this._set(this.open === i ? -1 : i);
523
+ }
524
+
525
+ close() {
526
+ if (this.open >= 0) this._set(-1);
527
+ }
528
+
529
+ _set(i) {
530
+ this.open = i;
531
+ this._listen(i >= 0);
532
+ this.host.requestUpdate();
533
+ }
534
+
535
+ _listen(on) {
536
+ const method = on ? "addEventListener" : "removeEventListener";
537
+ document[method]("keydown", this._onKeydown);
538
+ document[method]("pointerdown", this._onPointerdown, true);
539
+ }
540
+
541
+ /* The name, as the button; a feature with no description keeps it as text. */
542
+ name(i, name, description) {
543
+ if (!description) return html`<bd-p variant="regular">${name}</bd-p>`;
544
+ return html`<bd-p variant="regular"><button
545
+ type="button"
546
+ class="feature-toggle"
547
+ aria-expanded="${this.open === i}"
548
+ aria-controls="${this.id(i)}"
549
+ @click=${() => this.toggle(i)}
550
+ @focusout=${this.onFocusOut}
551
+ >${name}</button></bd-p>`;
552
+ }
553
+
554
+ tip(i, description) {
555
+ if (!description) return "";
556
+ return html`<div id="${this.id(i)}" class="tooltip ${this.open === i ? "open" : ""}"><bd-p variant="small">${description}</bd-p></div>`;
557
+ }
558
+ }
559
+
560
+ /* The five feature lists below: a heading over rows of a check, the feature's
561
+ name -- the button that opens its description --, an optional badge and the
562
+ description. Each list says its heading and its items; the row is drawn
563
+ here once. They render in shadow roots of their own, and each used to put a
564
+ <style> copy of the sheet in its render. The check is decoration -- the
565
+ feature's name is the text -- so its alt is empty; it was "icon", which a
566
+ screen reader read before every feature. */
567
+ class FeatureList extends LitElement {
433
568
  static properties = {
434
- features: { type: Array },
435
- shadow : { type: Boolean, reflect: true }
569
+ shadow: { type: Boolean, reflect: true }
436
570
  };
437
571
 
572
+ static styles = [pricingCardsCSS];
573
+
574
+ static heading = "";
575
+ static headingClass = "text-left";
576
+
577
+ constructor() {
578
+ super();
579
+ this.shadow = true;
580
+ this._tips = new FeatureTips(this);
581
+ }
582
+
583
+ /** The list's items, from the property each list names for them. */
584
+ get _items() {
585
+ return [];
586
+ }
587
+
588
+ /** A feature's name as the row shows it. */
589
+ _name(item) {
590
+ return item.name;
591
+ }
592
+
593
+ render() {
594
+ const { heading, headingClass } = this.constructor;
595
+ return html`
596
+ <div class="features">
597
+ <bd-h as="h4" class="${headingClass || nothing}">${heading}</bd-h>
598
+ <ul class="additional-info">
599
+ ${(this._items || []).map(
600
+ (item, i) => html` <li class="feature-item">
601
+ <img
602
+ src="/assets/verified_arrow.png"
603
+ alt=""
604
+ width="16"
605
+ height="16"
606
+ class="badge-icon"
607
+ />
608
+ ${this._tips.name(i, this._name(item), item.description)}
609
+ ${item.badge
610
+ ? html`<bd-badge tone="primary" variant="fill">${item.badge}</bd-badge>`
611
+ : ""}
612
+ ${this._tips.tip(i, item.description)}
613
+ </li>`
614
+ )}
615
+ </ul>
616
+ </div>
617
+ `;
618
+ }
619
+ }
620
+
621
+ class PricingCardFeatures extends FeatureList {
622
+ static properties = {
623
+ features: { type: Array }
624
+ };
625
+
626
+ static heading = "Device Security";
627
+
438
628
  constructor() {
439
629
  super();
440
630
  this.features = [
@@ -466,44 +656,21 @@ class PricingCardFeatures extends LitElement {
466
656
  "Scam Copilot: Get protection against online scams with AI-powered anti-scam features."
467
657
  }
468
658
  ];
469
- this.shadow = true;
470
659
  }
471
660
 
472
- render() {
473
- const features = this.features || [];
474
- return html`
475
- <style>
476
- ${pricingCardsCSS}
477
- </style>
478
-
479
- <div class="features">
480
- <bd-h as="h4" class="text-left">Device Security</bd-h>
481
- <ul class="additional-info">
482
- ${features.map(
483
- (feature) => html` <li class="feature-item">
484
- <img
485
- src="/assets/verified_arrow.png"
486
- alt="icon"
487
- class="badge-icon"
488
- />
489
- <bd-p variant="regular">${feature.name}</bd-p>
490
- ${feature.description
491
- ? html`<div class="tooltip"><bd-p variant="small">${feature.description}</bd-p></div>`
492
- : ""}
493
- </li>`
494
- )}
495
- </ul>
496
- </div>
497
- `;
661
+ get _items() {
662
+ return this.features;
498
663
  }
499
664
  }
500
665
 
501
- class PricingCardPrivacy extends LitElement {
666
+ class PricingCardPrivacy extends FeatureList {
502
667
  static properties = {
503
- privacy: { type: Array },
504
- shadow : { type: Boolean, reflect: true }
668
+ privacy: { type: Array }
505
669
  };
506
670
 
671
+ static heading = "Privacy";
672
+ static headingClass = "";
673
+
507
674
  constructor() {
508
675
  super();
509
676
  this.privacy = [
@@ -530,50 +697,25 @@ class PricingCardPrivacy extends LitElement {
530
697
  "Blocks ads, hinders ad targeting, and prevents online behavior profiling."
531
698
  }
532
699
  ];
533
- this.shadow = true;
534
700
  }
535
701
 
536
- render() {
537
- const privacy = this.privacy || [];
538
- return html`
539
- <style>
540
- ${pricingCardsCSS}
541
- </style>
542
-
543
- <div class="features">
544
- <bd-h as="h4">Privacy</bd-h>
545
- <ul class="additional-info">
546
- ${privacy.map(
547
- (priv) => html` <li class="feature-item">
548
- <img
549
- src="/assets/verified_arrow.png"
550
- alt="icon"
551
- class="badge-icon"
552
- />
553
- <bd-p variant="regular">${priv.name.replace(" 1x", "")}</bd-p>
554
- ${priv.badge
555
- ? html`
556
- <bd-badge tone="primary" variant="fill">
557
- ${priv.badge}
558
- `
559
- : ""}
560
- ${priv.description
561
- ? html`<div class="tooltip"><bd-p variant="small">${priv.description}</bd-p></div>`
562
- : ""}
563
- </li>`
564
- )}
565
- </ul>
566
- </div>
567
- `;
702
+ get _items() {
703
+ return this.privacy;
704
+ }
705
+
706
+ // the badge says "1x", so the name does not
707
+ _name(item) {
708
+ return item.name.replace(" 1x", "");
568
709
  }
569
710
  }
570
711
 
571
- class PricingCardIdentify extends LitElement {
712
+ class PricingCardIdentify extends FeatureList {
572
713
  static properties = {
573
- identity: { type: Array },
574
- shadow : { type: Boolean, reflect: true }
714
+ identity: { type: Array }
575
715
  };
576
716
 
717
+ static heading = "Identity Protection";
718
+
577
719
  constructor() {
578
720
  super();
579
721
  this.identity = [
@@ -584,51 +726,20 @@ class PricingCardIdentify extends LitElement {
584
726
  badge: "1x"
585
727
  }
586
728
  ];
587
- this.shadow = true;
588
729
  }
589
730
 
590
- render() {
591
- const identity = this.identity || [];
592
- return html`
593
- <style>
594
- ${pricingCardsCSS}
595
- </style>
596
-
597
- <div class="features">
598
- <bd-h as="h4" class="text-left">Identity Protection</bd-h>
599
- <ul class="additional-info">
600
- ${identity.map(
601
- (ident) => html` <li class="feature-item">
602
- <img
603
- src="/assets/verified_arrow.png"
604
- alt="icon"
605
- class="badge-icon"
606
- />
607
- <bd-p variant="regular">${ident.name}</bd-p>
608
- ${ident.badge
609
- ? html`
610
- <bd-badge tone="primary" variant="fill">
611
- ${ident.badge}
612
- </bd-badge>
613
- `
614
- : ""}
615
- ${ident.description
616
- ? html`<div class="tooltip"><bd-p variant="small">${ident.description}</bd-p></div>`
617
- : ""}
618
- </li>`
619
- )}
620
- </ul>
621
- </div>
622
- `;
731
+ get _items() {
732
+ return this.identity;
623
733
  }
624
734
  }
625
735
 
626
- class PricingCardIdentityExtend extends LitElement {
736
+ class PricingCardIdentityExtend extends FeatureList {
627
737
  static properties = {
628
- identity: { type: Array },
629
- shadow : { type: Boolean, reflect: true }
738
+ identity: { type: Array }
630
739
  };
631
740
 
741
+ static heading = "Identity Protection";
742
+
632
743
  constructor() {
633
744
  super();
634
745
  this.identity = [
@@ -659,51 +770,20 @@ class PricingCardIdentityExtend extends LitElement {
659
770
  "Stay one step ahead with our real-time breach notification feature. Instant alerts empower you to take immediate action, protecting your sensitive information and maintaining peace of mind effortlessly."
660
771
  }
661
772
  ];
662
- this.shadow = true;
663
773
  }
664
774
 
665
- render() {
666
- const identity = this.identity || [];
667
- return html`
668
- <style>
669
- ${pricingCardsCSS}
670
- </style>
671
-
672
- <div class="features">
673
- <bd-h as="h4" class="text-left">Identity Protection</bd-h>
674
- <ul class="additional-info">
675
- ${identity.map(
676
- (ident) => html` <li class="feature-item">
677
- <img
678
- src="/assets/verified_arrow.png"
679
- alt="icon"
680
- class="badge-icon"
681
- />
682
- <bd-p variant="regular">${ident.name}</bd-p>
683
- ${ident.badge
684
- ? html`
685
- <bd-badge tone="primary" variant="fill">
686
- ${ident.badge}
687
- </bd-badge>
688
- `
689
- : ""}
690
- ${ident.description
691
- ? html`<div class="tooltip"><bd-p variant="small">${ident.description}</bd-p></div>`
692
- : ""}
693
- </li>`
694
- )}
695
- </ul>
696
- </div>
697
- `;
775
+ get _items() {
776
+ return this.identity;
698
777
  }
699
778
  }
700
779
 
701
- class PricingCardParentalControl extends LitElement {
780
+ class PricingCardParentalControl extends FeatureList {
702
781
  static properties = {
703
- parentalControl: { type: Array },
704
- shadow : { type: Boolean, reflect: true }
782
+ parentalControl: { type: Array }
705
783
  };
706
784
 
785
+ static heading = "Parental Control";
786
+
707
787
  constructor() {
708
788
  super();
709
789
  this.parentalControl = [
@@ -737,42 +817,10 @@ class PricingCardParentalControl extends LitElement {
737
817
  "Unified reporting and easier management across all devices, providing you with a better overview of your child's online activities."
738
818
  }
739
819
  ];
740
- this.shadow = true;
741
820
  }
742
821
 
743
- render() {
744
- const parentalControl = this.parentalControl || [];
745
- return html`
746
- <style>
747
- ${pricingCardsCSS}
748
- </style>
749
-
750
- <div class="features">
751
- <bd-h as="h4" class="text-left">Parental Control</bd-h>
752
- <ul class="additional-info">
753
- ${parentalControl.map(
754
- (parental) => html` <li class="feature-item">
755
- <img
756
- src="/assets/verified_arrow.png"
757
- alt="icon"
758
- class="badge-icon"
759
- />
760
- <bd-p variant="regular">${parental.name}</bd-p>
761
- ${parental.badge
762
- ? html`
763
- <bd-badge tone="primary" variant="fill">
764
- ${parental.badge}
765
- </bd-badge>
766
- `
767
- : ""}
768
- ${parental.description
769
- ? html`<div class="tooltip"><bd-p variant="small">${parental.description}</bd-p></div>`
770
- : ""}
771
- </li>`
772
- )}
773
- </ul>
774
- </div>
775
- `;
822
+ get _items() {
823
+ return this.parentalControl;
776
824
  }
777
825
  }
778
826