@repobit/dex-system-design 0.5.0 → 0.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 (60) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/package.json +4 -3
  3. package/src/assets/images/bd-header-img.jpg +0 -0
  4. package/src/assets/images/bd-header-us.jpg +0 -0
  5. package/src/components/Button/Button.js +115 -3
  6. package/src/components/Button/button.css.js +80 -43
  7. package/src/components/Button/button.stories.js +83 -7
  8. package/src/components/FAQ/faq.css.js +27 -16
  9. package/src/components/FAQ/faq.js +23 -114
  10. package/src/components/FAQ/faq.stories.js +41 -20
  11. package/src/components/Input/Input.js +2 -2
  12. package/src/components/Input/input.css.js +1 -1
  13. package/src/components/anchor/anchor-nav.css.js +92 -0
  14. package/src/components/anchor/anchor-nav.js +121 -0
  15. package/src/components/anchor/anchor.stories.js +134 -0
  16. package/src/components/badge/badge.css.js +27 -0
  17. package/src/components/badge/badge.js +30 -0
  18. package/src/components/badge/badge.stories.js +36 -0
  19. package/src/components/carousel/carousel.css.js +36 -19
  20. package/src/components/carousel/carousel.js +149 -99
  21. package/src/components/carousel/carousel.stories.js +202 -46
  22. package/src/components/checkbox/checkbox.css.js +132 -0
  23. package/src/components/checkbox/checkbox.js +130 -0
  24. package/src/components/checkbox/checkbox.stories.js +63 -0
  25. package/src/components/divider/divider-horizontal.js +29 -0
  26. package/src/components/divider/divider-vertical.js +32 -0
  27. package/src/components/divider/divider.css.js +0 -0
  28. package/src/components/divider/divider.stories.js +77 -0
  29. package/src/components/header/header.css.js +248 -0
  30. package/src/components/header/header.js +87 -0
  31. package/src/components/header/header.stories.js +57 -0
  32. package/src/components/highlight/highlight-s.css.js +88 -0
  33. package/src/components/highlight/highlight-s.js +35 -0
  34. package/src/components/highlight/highlight-s.stories.js +22 -0
  35. package/src/components/highlight/highlight.css.js +119 -0
  36. package/src/components/highlight/highlight.js +60 -0
  37. package/src/components/highlight/highlight.stories.js +53 -0
  38. package/src/components/light-carousel/light-carousel.css.js +18 -10
  39. package/src/components/light-carousel/light-carousel.js +29 -16
  40. package/src/components/light-carousel/light-carousel.stories.js +9 -7
  41. package/src/components/paragraph/paragraph.css.js +1 -1
  42. package/src/components/pricing-cards/pricing-card.css.js +138 -3
  43. package/src/components/pricing-cards/pricing-card.js +63 -82
  44. package/src/components/pricing-cards/pricing-card.stories.js +1 -0
  45. package/src/components/radio/radio.css.js +168 -0
  46. package/src/components/radio/radio.js +222 -0
  47. package/src/components/radio/radio.stories.js +103 -0
  48. package/src/components/tabs/tabs.css.js +26 -8
  49. package/src/components/tabs/tabs.js +19 -12
  50. package/src/components/termsOfUse/terms.css.js +7 -1
  51. package/src/tokens/fonts.stories.js +73 -0
  52. package/src/tokens/spacing.stories.js +56 -0
  53. package/src/tokens/tokens-grid.stories.js +83 -0
  54. package/src/tokens/tokens.css +116 -1
  55. package/src/tokens/tokens.stories.js +67 -0
  56. package/src/tokens/typography.stories.js +69 -0
  57. package/src/tokens/tokens.js +0 -206
  58. /package/src/assets/{icons → images}/tabs-img1.png +0 -0
  59. /package/src/assets/{icons → images}/tabs-img2.png +0 -0
  60. /package/src/assets/{icons → images}/tabs-img3.png +0 -0
@@ -0,0 +1,119 @@
1
+ import { css } from "lit";
2
+
3
+ export default css`
4
+ :host {
5
+ display: block;
6
+ font-family: 'IBM Plex Sans', sans-serif;
7
+ font-weight: 700;
8
+ font-size: 32px;
9
+ line-height: 1.3;
10
+ text-align: center;
11
+ color: #000;
12
+ }
13
+
14
+ .headline {
15
+ margin: 0;
16
+ }
17
+
18
+ .highlight {
19
+ display: inline;
20
+ background: #F1F7FE;
21
+ color: #000;
22
+ z-index: -1;
23
+ position: relative;
24
+ margin-left: calc(var(--size-4) * -1);
25
+ margin-right: var(--size-2);
26
+ }
27
+
28
+ .highlight-text {
29
+ position: relative;
30
+ z-index: 1;
31
+ padding-left: var(--size-4);
32
+ padding-right: 0px;
33
+ box-decoration-break: clone;
34
+ -webkit-box-decoration-break: clone;
35
+ }
36
+
37
+ .highlight-right-anchor {
38
+ display: inline-block;
39
+ width: 1px;
40
+ height: 1em;
41
+ vertical-align: bottom;
42
+ position: relative;
43
+ margin-left: -12px;
44
+
45
+ }
46
+
47
+ .highlight-deco {
48
+ position: absolute;
49
+ width: var(--size-8);
50
+ height: 46px;
51
+ display: flex;
52
+ flex-direction: column;
53
+ align-items: center;
54
+ justify-content: flex-start;
55
+ pointer-events: none;
56
+ z-index: 2;
57
+ }
58
+
59
+ .highlight-deco.left {
60
+ left: -3px;
61
+ top: -4px;
62
+ }
63
+
64
+ .highlight-deco.right {
65
+ bottom: 0;
66
+ left: 3px;
67
+ top: -10px;
68
+ }
69
+
70
+ .highlight-svg-rect {
71
+ width: var(--size-2);
72
+ height: 38px;
73
+ fill: #006DFF;
74
+ margin: 0;
75
+ display: block;
76
+ }
77
+
78
+ .highlight-svg-ellipse-top,
79
+ .highlight-svg-ellipse-bottom {
80
+ width: var(--size-8);
81
+ height: var(--size-8);
82
+ fill: #006DFF;
83
+ display: block;
84
+ }
85
+
86
+ @media (max-width: 600px) {
87
+ :host {
88
+ font-size: 20px;
89
+ }
90
+
91
+ .highlight {
92
+ margin-right: var(--size-2);
93
+ }
94
+
95
+ .highlight-deco {
96
+ height: var(--size-32);
97
+ width: var(--size-6);
98
+ }
99
+
100
+ .highlight-svg-rect {
101
+ var(--size-24);
102
+ }
103
+
104
+ .highlight-svg-ellipse-top,
105
+ .highlight-svg-ellipse-bottom {
106
+ width: var(--size-6);
107
+ height: var(--size-6);
108
+ }
109
+ .highlight-deco.right {
110
+ bottom: 0;
111
+ left: 3px;
112
+ top: -6px;
113
+ }
114
+ .highlight-text{
115
+ padding-right: 3px;
116
+ }
117
+ }
118
+
119
+ `;
@@ -0,0 +1,60 @@
1
+ import { LitElement, html } from "lit";
2
+ import highlightCSS from "./highlight.css.js";
3
+
4
+ class BdHighlightSection extends LitElement {
5
+ static properties = {
6
+ highlightText: { type: String, attribute: 'highlight-text' }
7
+ };
8
+
9
+ static styles = [highlightCSS];
10
+
11
+ render() {
12
+ const fullText = this.textContent || "";
13
+ const highlightText = this.highlightText || "";
14
+
15
+ if (!highlightText || !fullText.includes(highlightText)) {
16
+ return html`<p class="headline"><slot></slot></p>`;
17
+ }
18
+
19
+ const [before, after] = fullText.split(highlightText);
20
+
21
+ return html`
22
+ <p class="headline">
23
+ ${before}
24
+ <span class="highlight">
25
+ <span class="highlight-text">${highlightText}</span>
26
+ <span class="highlight-right-anchor"></span>
27
+ <span class="highlight-deco left">
28
+ <svg class="highlight-svg-ellipse-top" viewBox="0 0 8 8">
29
+ <ellipse cx="4" cy="4" rx="4" ry="4" />
30
+ </svg>
31
+ <svg class="highlight-svg-rect" viewBox="0 0 2 42">
32
+ <rect x="0" y="0" width="2" height="42" />
33
+ </svg>
34
+ </span>
35
+ <!-- deco-right moved to its own anchor -->
36
+ </span>
37
+ ${after}
38
+ </p>
39
+ `;
40
+ }
41
+
42
+ updated() {
43
+ const anchor = this.renderRoot.querySelector(".highlight-right-anchor");
44
+ if (!anchor) return;
45
+
46
+ const deco = document.createElement("span");
47
+ deco.classList.add("highlight-deco", "right");
48
+ deco.innerHTML = `
49
+ <svg class="highlight-svg-rect" viewBox="0 0 2 42">
50
+ <rect x="0" y="0" width="2" height="42" />
51
+ </svg>
52
+ <svg class="highlight-svg-ellipse-bottom" viewBox="0 0 8 8">
53
+ <ellipse cx="4" cy="4" rx="4" ry="4" />
54
+ </svg>
55
+ `;
56
+ anchor.appendChild(deco);
57
+ }
58
+ }
59
+
60
+ customElements.define("bd-highlight-section", BdHighlightSection);
@@ -0,0 +1,53 @@
1
+ import "./highlight.js";
2
+ import { html } from "lit";
3
+
4
+ export default {
5
+ title: "Atoms/Highlight Section",
6
+ component: "bd-highlight-section",
7
+ tags: ["autodocs"],
8
+ argTypes: {
9
+ highlightText: { control: "text" },
10
+ defaultSlot: { control: "text", name: "Text Content" },
11
+ },
12
+ };
13
+
14
+ const Template = ({ highlightText, defaultSlot }) => html`
15
+ <bd-highlight-section highlight-text="${highlightText}">
16
+ ${defaultSlot}
17
+ </bd-highlight-section>
18
+ `;
19
+
20
+ export const Default = Template.bind({});
21
+ Default.args = {
22
+ highlightText: "next generation of digital security",
23
+ defaultSlot:
24
+ "Introducing the next generation of digital security: your personalized shield for a worry-free online experience.",
25
+ };
26
+
27
+ export const LongText = Template.bind({});
28
+ LongText.args = {
29
+ highlightText: "next generation of digital security test test testtest123",
30
+ defaultSlot:
31
+ "Introducing the next generation of digital security test test testtest123: your personalized shield for a worry-free online experience.",
32
+ };
33
+
34
+ export const ShortText = Template.bind({});
35
+ ShortText.args = {
36
+ highlightText: "Introducing",
37
+ defaultSlot:
38
+ "Introducing the next generation of digital security: your personalized shield for a worry-free online experience.",
39
+ };
40
+
41
+ export const MissingHighlight = Template.bind({});
42
+ MissingHighlight.args = {
43
+ highlightText: "something not in the text",
44
+ defaultSlot:
45
+ "Introducing the next generation of digital security: your personalized shield for a worry-free online experience.",
46
+ };
47
+
48
+ export const MultipleOccurrences = Template.bind({});
49
+ MultipleOccurrences.args = {
50
+ highlightText: "security",
51
+ defaultSlot:
52
+ "This security system improves your security and brings peace of mind to your digital experience.",
53
+ };
@@ -9,12 +9,11 @@ export default css`
9
9
  .bd-section-title {
10
10
  font-family: var(--font-family-sans);
11
11
  font-weight: var(--font-weight-sans-semibold);
12
- font-size: 2em;
12
+ font-size: 2em;
13
13
  }
14
14
  .bd-header-light-carousel {
15
15
  margin-bottom: 50px;
16
16
  margin-top: 50px;
17
-
18
17
  }
19
18
  .bd-light-carousel {
20
19
  display: flex;
@@ -60,15 +59,14 @@ export default css`
60
59
  background: var(--background-card-grey);
61
60
  border-radius: 28px;
62
61
  border: var(--size-2) solid var(--border-card-grey);
63
- padding: 2em;
62
+ padding: var(--size-32);
64
63
  display: flex;
65
64
  flex-direction: column;
66
65
  align-items: start;
67
66
  justify-content: center;
68
67
  text-align: start;
69
- cursor: pointer;
70
68
  transition: transform 0.2s ease-in-out;
71
- min-height: 250px;
69
+ min-height: 155px;
72
70
  position: relative;
73
71
  z-index: 2;
74
72
  scroll-snap-align: start;
@@ -76,8 +74,8 @@ export default css`
76
74
  }
77
75
 
78
76
  .bd-light-box h3 {
79
- font-size: var(--size-18);
80
- margin: var(--size-0) var(--size-0) 0.5em var(--size-0);
77
+ font-size: var(--heading-xsmall);
78
+ margin: var(--size-0) var(--size-8) var(--size-8) var(--size-0);
81
79
  font-weight: 600;
82
80
  font-family: var(--font-family-sans);
83
81
  }
@@ -90,11 +88,21 @@ export default css`
90
88
 
91
89
  .bd-light-icon {
92
90
  position: relative;
93
- bottom: 15px;
91
+ bottom: var(--size-6);
94
92
  max-width: 100%;
95
- height: var(--size-40);
96
- width: var(--size-40);
93
+ height: var(--size-32);
94
+ width: var(--size-32);
97
95
  }
96
+ .bd-light-box-header {
97
+ display: flex;
98
+ align-items: center;
99
+ gap: var(--size-8);
100
+ }
101
+ .bd-light-title-badge-wrapper {
102
+ display: flex;
103
+ align-items: center;
104
+ gap: var(--size-4, 4px);
105
+ }
98
106
 
99
107
  @media (max-width: 1024px) {
100
108
  .bd-light-box {
@@ -37,13 +37,15 @@ class CustomLightCarousel extends LitElement {
37
37
 
38
38
  updateArrowStates() {
39
39
  const track = this.shadowRoot.querySelector(".bd-light-carousel-track");
40
+ const leftArrow = this.shadowRoot.querySelector(".bd-light-left-arrow");
41
+ const rightArrow = this.shadowRoot.querySelector(".bd-light-right-arrow");
42
+
43
+ if (!track || !leftArrow || !rightArrow) return; // Nu face nimic dacă lipsește ceva
44
+
40
45
  const trackWidth = track.offsetWidth;
41
46
  const totalWidth = track.scrollWidth;
42
47
  const scrollPosition = track.scrollLeft;
43
48
 
44
- const leftArrow = this.shadowRoot.querySelector(".bd-light-left-arrow");
45
- const rightArrow = this.shadowRoot.querySelector(".bd-light-right-arrow");
46
-
47
49
  if (scrollPosition === 0) {
48
50
  leftArrow.classList.add("bd-disabled");
49
51
  } else {
@@ -60,15 +62,13 @@ class CustomLightCarousel extends LitElement {
60
62
  render() {
61
63
  return html`
62
64
  <section class="bd-light-carousel">
63
- <div class="bd-header-light-carousel">
65
+ <div class="bd-header-light-carousel">
64
66
  <h1 class="bd-section-title">${this.title}</h1>
65
67
  </div>
66
-
68
+
67
69
  <div class="bd-light-carousel-track">
68
- <slot></slot>
70
+ <slot></slot>
69
71
  </div>
70
-
71
-
72
72
  </section>
73
73
  `;
74
74
  }
@@ -87,18 +87,31 @@ class LightCarouselItem extends LitElement {
87
87
  this.icon = "";
88
88
  }
89
89
 
90
- render() {
91
- return html`
92
- <div class="bd-light-box">
93
-
90
+ render() {
91
+ return html`
92
+ <div class="bd-light-box">
93
+ <div class="bd-light-box-header">
94
94
  ${this.icon
95
95
  ? html`<img src="${this.icon}" alt="icon" class="bd-light-icon" />`
96
96
  : ""}
97
- ${this.title ? html`<h3>${this.title}</h3>` : ""}
98
- <slot></slot>
97
+
98
+ ${this.title || this.badge
99
+ ? html`
100
+ <div class="bd-light-title-badge-wrapper">
101
+ ${this.title ? html`<h3>${this.title}</h3>` : ""}
102
+ ${this.badge
103
+ ? html`<bd-badge text="${this.badge}" color="#026DFF"></bd-badge>`
104
+ : ""}
105
+ </div>
106
+ `
107
+ : ""}
99
108
  </div>
100
- `;
101
- }
109
+ <slot></slot>
110
+ </div>
111
+ `;
112
+ }
113
+
114
+
102
115
  }
103
116
  CustomLightCarousel.styles = [carouselCSS];
104
117
  LightCarouselItem.styles = [carouselCSS];
@@ -1,5 +1,6 @@
1
1
  import { html } from "lit";
2
2
  import "./light-carousel.js";
3
+ import "../badge/badge.js"; // asigură-te că bd-badge este importat
3
4
 
4
5
  export default {
5
6
  title: "Components/Light Carousel",
@@ -14,25 +15,26 @@ const Template = (args) => html`
14
15
  <bd-light-carousel-section title="${args.title}">
15
16
  <bd-light-carousel-item
16
17
  title="How does Bitdefender Internet Security protect me?"
17
- icon="src/assets/icons/light-carousel-img1.png"
18
+ icon="icons/light-carousel-img1.png"
18
19
  badge="FAQ"
19
20
  >
20
21
  <p>Bitdefender Internet Security provides the best protection...</p>
21
- <p>Bitdefender Internet Security provides the best protection...</p>
22
+ <p>Advanced AI and behavior-based detection ensure safety online and offline.</p>
22
23
  </bd-light-carousel-item>
23
24
 
24
25
  <bd-light-carousel-item
25
26
  title="How to install Bitdefender on another device?"
26
- icon="src/assets/icons/light-carousel-img1.png"
27
+ icon="icons/light-carousel-img1.png"
27
28
  >
28
- <p>You can install Bitdefender on other devices by...</p>
29
+ <p>You can install Bitdefender on other devices by logging into your Central account and using the 'My Devices' tab.</p>
29
30
  </bd-light-carousel-item>
30
31
 
31
32
  <bd-light-carousel-item
32
- title="How to install Bitdefender on another device?"
33
- icon="src/assets/icons/light-carousel-img1.png"
33
+ title="Can I transfer my license to a new computer?"
34
+ icon="icons/light-carousel-img1.png"
35
+ badge="How To"
34
36
  >
35
- <p>You can install Bitdefender on other devices by...</p>
37
+ <p>Yes, just remove the license from the old device via Central and activate it on the new one.</p>
36
38
  </bd-light-carousel-item>
37
39
  </bd-light-carousel-section>
38
40
  `;
@@ -1,4 +1,4 @@
1
- import { css } from "lit";
1
+ import { css } from "../lit";
2
2
 
3
3
  export default css`
4
4
 
@@ -1,4 +1,4 @@
1
- import { css } from "lit";
1
+ import { css } from "../lit";
2
2
 
3
3
  export default css`
4
4
  :host {
@@ -7,11 +7,27 @@ export default css`
7
7
  --border-card-green: var(--color-green-700);
8
8
  --badge-background: var(--color-blue-500);
9
9
  --text-color-white: var(--color-neutral-0);
10
+ --bd-accesibility-focus: var(--color-blue-500);
10
11
  }
11
12
  body {
12
13
  font-family: "IBM Plex Mono", monospace;
13
14
  }
15
+
16
+ button {
17
+ outline: none;
18
+ }
19
+
20
+ button:focus-visible {
21
+ outline: var(--size-2) solid var(--bd-accesibility-focus);
22
+ outline-offset: var(--size-2);
23
+ }
24
+ a:focus-visible {
25
+ outline: var(--size-2) solid var(--bd-accesibility-focus);
26
+ outline-offset: var(--size-2);
27
+ border-radius: var(--space-2xs);
28
+ }
14
29
  .card {
30
+ padding-top: 2em;
15
31
  background: var(--background-card-grey);
16
32
  border: var(--size-2) solid var(--border-card-grey);
17
33
  border-radius: var(--size-20);
@@ -21,6 +37,10 @@ export default css`
21
37
  position: relative;
22
38
  height: 100%;
23
39
  }
40
+ .bd-section-title {
41
+ font-family: var(--font-family-sans);
42
+ font-weight: var(--font-weight-sans-semibold);
43
+ }
24
44
 
25
45
  .highlight {
26
46
  border: var(--size-2) solid var(--border-card-green);
@@ -34,15 +54,18 @@ export default css`
34
54
  border-top-left-radius: var(--size-20);
35
55
  border-top-right-radius: var(--size-20);
36
56
  position: absolute;
37
- top: -47px;
57
+ top: -2.67em; /* echivalent cu -3rem */
38
58
  left: 50%;
39
59
  transform: translateX(-50%);
40
60
  width: 85%;
41
61
  font-family: var(--font-family-sans);
42
62
  font-weight: 600;
43
63
  line-height: 14px;
64
+ z-index: 1;
65
+ }
66
+ .pricing-cards .card:nth-child(2) .highlight-banner {
67
+ top: -30px;
44
68
  }
45
-
46
69
  .card-header {
47
70
  text-align: start;
48
71
  }
@@ -157,6 +180,7 @@ export default css`
157
180
  gap: var(--size-12);
158
181
  align-items: stretch;
159
182
  margin-bottom: var(--size-20);
183
+ width: 100%;
160
184
  }
161
185
 
162
186
  .features h4 {
@@ -406,4 +430,115 @@ export default css`
406
430
  position: relative;
407
431
  bottom: var(--size-4);
408
432
  }
433
+
434
+ @media (max-width: 1024px) {
435
+ .pricing-cards {
436
+ flex-direction: column;
437
+ align-items: center;
438
+ gap: var(--size-52);
439
+ }
440
+
441
+ .pricing-card {
442
+ max-width: 80%;
443
+ }
444
+
445
+ .card-title {
446
+ font-size: 1.5em;
447
+ line-height: 28px;
448
+ }
449
+
450
+ .price {
451
+ font-size: 32px;
452
+ }
453
+
454
+ .highlight-banner {
455
+ font-size: 16px;
456
+ width: 90%;
457
+ }
458
+ }
459
+
460
+ @media (max-width: 768px) {
461
+ .pricing-card {
462
+ max-width: 90%;
463
+ padding: var(--size-24);
464
+ }
465
+ .switchBox {
466
+ text-align: center;
467
+ padding-bottom: 30px;
468
+ }
469
+ .bd-section-title {
470
+ text-align: center;
471
+ font-size: 2em;
472
+ }
473
+
474
+ .card-title {
475
+ font-size: 1.3em;
476
+ }
477
+
478
+ .price {
479
+ font-size: 28px;
480
+ }
481
+
482
+ .badge-subtitle,
483
+ .original-price,
484
+ .discount,
485
+ .terms {
486
+ font-size: 14px;
487
+ }
488
+
489
+ .pricing-info {
490
+ flex-direction: column;
491
+ gap: var(--size-4);
492
+ }
493
+
494
+ .highlight-banner {
495
+ font-size: 14px;
496
+ padding: var(--size-8);
497
+ }
498
+
499
+ .actions {
500
+ flex-direction: column;
501
+ gap: var(--size-8);
502
+ }
503
+ }
504
+
505
+ @media (max-width: 480px) {
506
+ .pricing-card {
507
+ max-width: 100%;
508
+ padding: var(--size-16);
509
+ }
510
+
511
+ .card-title {
512
+ font-size: 1.1em;
513
+ }
514
+
515
+ .price {
516
+ font-size: 24px;
517
+ }
518
+
519
+ .badge-subtitle,
520
+ .original-price,
521
+ .discount,
522
+ .terms {
523
+ font-size: 12px;
524
+ }
525
+
526
+ .highlight-banner {
527
+ font-size: 12px;
528
+ }
529
+
530
+ .badge {
531
+ font-size: 12px;
532
+ padding: var(--size-4) var(--size-6);
533
+ }
534
+
535
+ .actions {
536
+ gap: var(--size-6);
537
+ }
538
+ }
539
+ @media (min-width: 768px) and (max-width: 1024px) {
540
+ pricing-card {
541
+ margin-bottom: 100px;
542
+ }
543
+ }
409
544
  `;