@repobit/dex-system-design 0.21.2 → 0.22.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 (52) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/package.json +4 -2
  3. package/src/components/Button/Button.js +7 -2
  4. package/src/components/Button/button.css.js +30 -0
  5. package/src/components/accordion/accordion-bg.stories.js +341 -171
  6. package/src/components/accordion/accordion.stories.js +345 -0
  7. package/src/components/anchor/anchor.stories.js +134 -76
  8. package/src/components/back/back.css.js +1 -1
  9. package/src/components/back/back.stories.js +301 -63
  10. package/src/components/badge/badge.js +4 -7
  11. package/src/components/badge/badge.stories.js +89 -96
  12. package/src/components/breadcrumb/breadcrumb.stories.js +167 -3
  13. package/src/components/cards/card.stories.js +153 -3
  14. package/src/components/display/display.css.js +7 -10
  15. package/src/components/display/display.js +14 -2
  16. package/src/components/display/display.stories.js +213 -219
  17. package/src/components/divider/divider.stories.js +337 -30
  18. package/src/components/footer/footer-lp.stories.js +346 -3
  19. package/src/components/footer/footer.js +0 -3
  20. package/src/components/footer/footer.stories.js +267 -4
  21. package/src/components/header/header.css.js +1 -1
  22. package/src/components/header/header.js +77 -56
  23. package/src/components/header/header.stories.js +298 -22
  24. package/src/components/heading/heading.css.js +1 -1
  25. package/src/components/heading/heading.stories.js +355 -113
  26. package/src/components/image/image.css.js +146 -98
  27. package/src/components/image/image.js +13 -2
  28. package/src/components/image/image.stories.js +546 -160
  29. package/src/components/input/custom-form.stories.js +209 -12
  30. package/src/components/link/link.css.js +2 -2
  31. package/src/components/link/link.stories.js +383 -53
  32. package/src/components/paragraph/paragraph.css.js +1 -1
  33. package/src/components/paragraph/paragraph.stories.js +365 -157
  34. package/src/components/picture/picture.css.js +209 -0
  35. package/src/components/picture/picture.js +16 -2
  36. package/src/components/picture/picture.stories.js +525 -180
  37. package/src/components/pricing-cards/new-pricing-card.js +19 -4
  38. package/src/components/pricing-cards/new-pricing-card.stories.js +422 -0
  39. package/src/components/pricing-cards/new-pricing.css.js +8 -0
  40. package/src/components/pricing-cards/pricing-card-actions.js +49 -9
  41. package/src/components/pricing-cards/pricing-card-container.css.js +1 -1
  42. package/src/components/pricing-cards/pricing-card-header.css.js +73 -63
  43. package/src/components/pricing-cards/pricing-card-header.js +44 -10
  44. package/src/components/pricing-cards/pricing-card-pricing.js +63 -64
  45. package/src/components/pricing-cards/pricing-card.css.js +7 -15
  46. package/src/components/pricing-cards/pricing-card.js +353 -270
  47. package/src/components/pricing-cards/pricing-card.stories.js +3 -3
  48. package/src/tokens/fonts.stories.js +335 -8
  49. package/src/tokens/spacing.stories.js +701 -34
  50. package/src/tokens/tokens-grid.stories.js +897 -48
  51. package/src/tokens/typography.stories.js +980 -38
  52. package/src/components/accordion/accordion-light.stories.js +0 -241
@@ -1,70 +1,80 @@
1
1
  import { css } from "lit";
2
2
 
3
3
  export default css`
4
- .card-header {
5
- text-align: center;
6
- }
4
+ :host {
5
+ font-family: var(--typography-fontFamily-sans);
6
+ }
7
7
 
8
- .card-title {
9
- font-size: var(--typography-heading-h4-fontSize);
10
- font-family: var(--typography-fontFamily-sans);
11
- font-weight: var(--typography-fontWeight-bold);
12
- margin: 0;
13
- text-align: left;
14
- color: #000000;
15
- }
16
- .card-title-brand {
17
- display: inline;
18
- font-family: var(--typography-fontFamily-sans);
19
- font-weight: var(--typography-fontWeight-bold);
20
- color: #000000;
21
- }
22
- .plus {
23
- color: var(--color-blue-600);
24
- font-weight: var(--typography-fontWeight-bold);
25
- font-family: var(--typography-fontFamily-sans);
26
- }
27
- .badge {
28
- display: inline-flex;
29
- align-items: center;
30
- gap: 0.25rem;
31
- font-weight: bold;
32
- background: #e8f0fe;
33
- padding: 0.25rem 0.5rem;
34
- border-radius: 4px;
35
- margin: 0.5rem 0;
36
- font-size: 0.875rem;
37
- }
8
+ .card-header {
9
+ text-align: center;
10
+ }
38
11
 
39
- .badge-icon {
40
- height: 1rem;
41
- }
12
+ .card-title {
13
+ font-size: var(--typography-heading-h4-fontSize);
14
+ font-family: var(--typography-fontFamily-sans);
15
+ font-weight: var(--typography-fontWeight-bold);
16
+ margin: 0;
17
+ text-align: left;
18
+ color: #000000;
19
+ }
42
20
 
43
- .badge-subtitle {
44
- font-size: var(--typography-body-regular-fontSize);
45
- text-align: left;
46
- font-family: var(--typography-fontFamily-sans);
47
- color: #000000;
48
- margin: 0;
49
- margin-bottom: var(--spacing-16);
50
- margin-top: -8px;
51
- }
21
+ .card-title-brand {
22
+ display: inline;
23
+ font-family: var(--typography-fontFamily-sans);
24
+ font-weight: var(--typography-fontWeight-bold);
25
+ color: #000000;
26
+ }
52
27
 
53
- .hr-line {
54
- border: none;
55
- border-top: 1px solid #ccc;
56
- margin: 1rem 0;
57
- }
58
- .badge-wrapper {
59
- text-align: left;
60
- margin-top: var(--spacing-8);
61
- margin-bottom: var(--spacing-8);
62
- }
63
- .badge-wrapper.multiple {
64
- display: flex;
65
- flex-wrap: wrap;
66
- gap: var(--spacing-8);
67
- margin-top: var(--spacing-8);
68
- margin-bottom: var(--spacing-8);
69
- }
70
- `;
28
+ /* Stil pentru cuvântul "Plus" evidențiat */
29
+ .plus-text {
30
+ color: var(--color-blue-600);
31
+ font-weight: var(--typography-fontWeight-bold);
32
+ font-family: var(--typography-fontFamily-sans);
33
+ }
34
+
35
+ .badge {
36
+ display: inline-flex;
37
+ align-items: center;
38
+ gap: 0.25rem;
39
+ font-weight: bold;
40
+ background: #e8f0fe;
41
+ padding: 0.25rem 0.5rem;
42
+ border-radius: 4px;
43
+ margin: 0.5rem 0;
44
+ font-size: 0.875rem;
45
+ }
46
+
47
+ .badge-icon {
48
+ height: 1rem;
49
+ }
50
+
51
+ .badge-subtitle {
52
+ font-size: var(--typography-body-regular-fontSize);
53
+ text-align: left;
54
+ font-family: var(--typography-fontFamily-sans);
55
+ color: #000000;
56
+ margin: 0;
57
+ margin-bottom: var(--spacing-16);
58
+ margin-top: -8px;
59
+ }
60
+
61
+ .hr-line {
62
+ border: none;
63
+ border-top: 1px solid #ccc;
64
+ margin: 1rem 0;
65
+ }
66
+
67
+ .badge-wrapper {
68
+ text-align: left;
69
+ margin-top: var(--spacing-8);
70
+ margin-bottom: var(--spacing-8);
71
+ }
72
+
73
+ .badge-wrapper.multiple {
74
+ display: flex;
75
+ flex-wrap: wrap;
76
+ gap: var(--spacing-8);
77
+ margin-top: var(--spacing-8);
78
+ margin-bottom: var(--spacing-8);
79
+ }
80
+ `;
@@ -1,5 +1,6 @@
1
1
  import { LitElement, html } from "lit";
2
2
  import { tokens } from "../../tokens/tokens.js";
3
+ import "../badge/badge.js";
3
4
  import "../heading/heading.js";
4
5
  import "../paragraph/paragraph.js";
5
6
  import newHeaderPricingCSS from "../pricing-cards/pricing-card-header.css.js";
@@ -16,19 +17,52 @@ class PricingCardHeader extends LitElement {
16
17
  return this.badges ? this.badges.split("|").map((b) => b.trim()) : [];
17
18
  }
18
19
 
19
- render() {
20
- const [brand, ...rest] = this.title ? this.title.split(" ") : ["", ""];
21
- const restOfTitle = rest.join(" ");
20
+ // Funcție pentru a evidenția "Plus" în titlu
21
+ renderTitleWithHighlightedPlus() {
22
+ if (!this.title) return "";
23
+
24
+ const title = this.title;
25
+ const plusIndex = title.toLowerCase().indexOf("plus");
26
+
27
+ if (plusIndex === -1) {
28
+ const [brand, ...rest] = title.split(" ");
29
+ const restOfTitle = rest.join(" ");
30
+
31
+ return html`
32
+ <bd-h as="h4" class="card-title">
33
+ <template shadowrootmode="open">
34
+ <h4 class="bd-heading h4"><slot></slot></h4>
35
+ </template>
36
+ <span class="card-title-brand">Internet Security</span>
37
+ </bd-h>
38
+ `;
39
+ }
40
+
41
+ // Conține "Plus" - evidențiază-l
42
+ const beforePlus = title.substring(0, plusIndex);
43
+ const plusWord = title.substring(plusIndex, plusIndex + 4); // "Plus" are 4 caractere
44
+ const afterPlus = title.substring(plusIndex + 4);
45
+
46
+ const [brand, ...restBefore] = beforePlus.split(" ");
47
+ const restOfBeforePlus = restBefore.join(" ");
22
48
 
49
+ return html`
50
+ <bd-h as="h4" class="card-title">
51
+ <span class="card-title-brand">${brand}</span>
52
+ </bd-h>
53
+ <bd-h as="h4" class="card-title">
54
+ ${restOfBeforePlus}
55
+ <span class="plus-text">${plusWord}</span>
56
+ ${afterPlus}
57
+ </bd-h>
58
+ `;
59
+ }
60
+
61
+ render() {
23
62
  return html`
24
63
  <div class="card-header">
25
- <bd-h as="h4" class="card-title">
26
- <span class="card-title-brand">${brand}</span>
27
- </bd-h>
28
- <bd-h as="h4" class="card-title">
29
- ${restOfTitle}
30
- ${this.plus ? html` <span class="plus">Plus</span>` : ""}
31
- </bd-h>
64
+ ${this.renderTitleWithHighlightedPlus()}
65
+
32
66
  ${this.parsedBadges.length
33
67
  ? html`
34
68
  <div class="badge-wrapper multiple">
@@ -1,89 +1,90 @@
1
1
  import { LitElement, html } from "lit";
2
2
  import { tokens } from "../../tokens/tokens.js";
3
+ import "../badge/badge.js";
3
4
  import "../heading/heading.js";
4
5
  import "../paragraph/paragraph.js";
5
6
  import newPricingPricingCSS from "../pricing-cards/pricing-card-pricing.css.js";
6
7
 
7
8
  class PricingCardPricing extends LitElement {
8
9
  static properties = {
9
- price : { type: String }, // monthly price
10
- originalPrice: { type: String, attribute: "original-price" }, // monthly original price
11
- discount : { type: String }, // monthly discount text
12
- billingPeriod: { type: String, state: true } // "monthly" or "yearly"
10
+ productId : { type: String, attribute: "product-id" },
11
+ devices : { type: String },
12
+ subscription : { type: String },
13
+ billingPeriod : { type: String, state: true },
14
+ dataLayerEvent: { type: String }
13
15
  };
14
16
 
15
17
  constructor() {
16
18
  super();
17
19
  this.billingPeriod = "monthly";
20
+ this.productId = "vsb";
21
+ this.devices = "5";
22
+ this.subscription = "1";
23
+ this.dataLayerEvent = "info";
18
24
  }
19
25
 
20
- formatCurrency(value) {
21
- if (!value || isNaN(value)) return "";
22
- return `$${parseFloat(value).toFixed(2)}`;
23
- }
24
-
25
- get yearlyPrice() {
26
- const monthlyPrice = parseFloat(this.price);
27
- if (isNaN(monthlyPrice)) return "";
28
- const yearly = monthlyPrice * 12 * 0.9;
29
- return yearly.toFixed(2);
30
- }
31
-
32
- get yearlyOriginalPrice() {
33
- const monthlyOriginal = parseFloat(this.originalPrice);
34
- if (isNaN(monthlyOriginal)) return "";
35
- const yearlyOriginal = monthlyOriginal * 12;
36
- return yearlyOriginal.toFixed(2);
37
- }
38
-
39
- get yearlyDiscount() {
40
- return "Save 25%";
26
+ // FOLOSEȘTE LIGHT DOM
27
+ createRenderRoot() {
28
+ return this;
41
29
  }
42
30
 
43
31
  render() {
44
32
  const isMonthly = this.billingPeriod === "monthly";
45
33
 
46
- const originalPrice = isMonthly
47
- ? this.originalPrice
48
- : this.yearlyOriginalPrice;
49
- const discount = isMonthly ? this.discount : this.yearlyDiscount;
50
- const price = isMonthly ? this.price : this.yearlyPrice;
51
-
52
34
  return html`
53
- <div class="pricing">
54
- <div class="toggle-group">
55
- <bd-radio
56
- name="billing"
57
- value="monthly"
58
- label="Monthly"
59
- ?checked=${isMonthly}
60
- @change=${this.onBillingChange}
61
- ></bd-radio>
62
- <bd-radio
63
- name="billing"
64
- value="yearly"
65
- label="Yearly"
66
- ?checked=${!isMonthly}
67
- @change=${this.onBillingChange}
68
- ></bd-radio>
69
- </div>
35
+ <style>
36
+ ${tokens}
37
+ ${newPricingPricingCSS}
38
+ </style>
39
+
40
+ <bd-context ignore-events-parent>
41
+ <bd-product product-id="${this.productId}">
42
+ <bd-option
43
+ devices="${this.devices}"
44
+ subscription="${this.subscription}"
45
+ data-layer-event="${this.dataLayerEvent}">
46
+
47
+ <div class="pricing">
48
+ <div class="toggle-group">
49
+ <bd-radio
50
+ name="billing"
51
+ value="monthly"
52
+ label="Monthly"
53
+ ?checked=${isMonthly}
54
+ @change=${this.onBillingChange}
55
+ ></bd-radio>
56
+ <bd-radio
57
+ name="billing"
58
+ value="yearly"
59
+ label="Yearly"
60
+ ?checked=${!isMonthly}
61
+ @change=${this.onBillingChange}
62
+ ></bd-radio>
63
+ </div>
70
64
 
71
- <div class="pricing-info">
72
- ${originalPrice
73
- ? html`<bd-p kind="small" class="original-price">
74
- ${this.formatCurrency(originalPrice)}
75
- </bd-p>`
76
- : null}
77
- <bd-p kind="small" class="discount">${discount}</bd-p>
78
- </div>
65
+ <div class="pricing-info" data-store-hide="!it.option.price.discounted">
66
+ <bd-p kind="small" class="original-price">
67
+ <s data-store-render data-store-price="full"></s>
68
+ </bd-p>
69
+
70
+ <bd-badge variant="bd-light-green">
71
+ Save <span data-store-render data-store-discount="percentage"></span>
72
+ </bd-badge>
73
+ </div>
79
74
 
80
- <bd-h as="h3" class="price">${this.formatCurrency(price)}</bd-h>
75
+ <bd-h as="h3" class="price">
76
+ <span data-store-render data-store-price="discounted||full"></span>/month
77
+ </bd-h>
81
78
 
82
- <bd-p kind="small" class="terms">
83
- First year price. Plus applicable sales tax. See
84
- <a href="#">terms of use</a> below.
85
- </bd-p>
86
- </div>
79
+ <bd-p kind="small" class="terms">
80
+ First year price. Plus applicable sales tax. See
81
+ <a href="#">terms of use</a> below.
82
+ </bd-p>
83
+ </div>
84
+
85
+ </bd-option>
86
+ </bd-product>
87
+ </bd-context>
87
88
  `;
88
89
  }
89
90
 
@@ -95,6 +96,4 @@ class PricingCardPricing extends LitElement {
95
96
  }
96
97
  }
97
98
 
98
- PricingCardPricing.styles = [tokens, newPricingPricingCSS];
99
-
100
99
  customElements.define("pricing-card-pricing", PricingCardPricing);
@@ -112,20 +112,7 @@ export default css`
112
112
  margin: var(--spacing-0);
113
113
  margin-top: var(--spacing-8);
114
114
  }
115
- .badge {
116
- display: inline-block;
117
- background: var(--badge-background);
118
- color: var(--text-color-white);
119
- font-size: 14px;
120
- padding: var(--spacing-6) 9px var(--spacing-6) var(--spacing-8);
121
- border-radius: var(--spacing-16);
122
- margin: var(--spacing-20) var(--spacing-0) 5px var(--spacing-0);
123
- text-align: left;
124
- font-family: var(--typography-fontFamily-sans);
125
- font-weight: 500;
126
- line-height: var(--spacing-14);
127
- gap: var(--spacing-10);
128
- }
115
+
129
116
  .badge img {
130
117
  position: relative;
131
118
  top: var(--spacing-1);
@@ -162,7 +149,7 @@ export default css`
162
149
  font-size: 16px;
163
150
  font-weight: bold;
164
151
  border-radius: 22px;
165
- padding: var(--spacing-6) var(--spacing-12) var(--spacing-8) var(--spacing-12);
152
+ // padding: var(--spacing-6) var(--spacing-12) var(--spacing-8) var(--spacing-12);
166
153
  gap: var(--spacing-10);
167
154
  color: var(--color-green-800);
168
155
  margin: var(--spacing-0);
@@ -209,6 +196,7 @@ export default css`
209
196
 
210
197
  .features ul {
211
198
  padding-left: var(--spacing-0);
199
+ padding-top: var(--spacing-16);
212
200
  }
213
201
 
214
202
  .pricing-card {
@@ -568,4 +556,8 @@ export default css`
568
556
  margin-bottom: 100px;
569
557
  }
570
558
  }
559
+ .text-left {
560
+ text-align: left !important;
561
+ padding-bottom: 15px;
562
+ }
571
563
  `;