@repobit/dex-system-design 0.11.0 → 0.12.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 (105) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/package.json +2 -2
  3. package/src/assets/icons/Identity_protection.png +0 -0
  4. package/src/assets/icons/arrow_down.png +0 -0
  5. package/src/assets/icons/arrow_up.png +0 -0
  6. package/src/assets/icons/device_protection.png +0 -0
  7. package/src/assets/icons/financial_insurance.png +0 -0
  8. package/src/assets/icons/privacy_protection.png +0 -0
  9. package/src/assets/icons/user_guide.png +0 -0
  10. package/src/components/Button/Button.js +19 -16
  11. package/src/components/Button/button.css.js +18 -16
  12. package/src/components/Button/icons.js +8 -8
  13. package/src/components/FAQ/faq.css.js +48 -49
  14. package/src/components/FAQ/faq.js +0 -86
  15. package/src/components/Input/Input.js +68 -6
  16. package/src/components/Input/custom-form.stories.js +88 -0
  17. package/src/components/Input/input-clipboard.css.js +168 -0
  18. package/src/components/Input/input-clipboard.js +137 -0
  19. package/src/components/Input/input.css.js +122 -42
  20. package/src/components/accordion/accordion-bg.css.js +117 -0
  21. package/src/components/accordion/accordion-bg.js +80 -0
  22. package/src/components/accordion/accordion-no-bg.css.js +114 -0
  23. package/src/components/accordion/accordion-no-bg.js +80 -0
  24. package/src/components/accordion/accordion.css.js +88 -0
  25. package/src/components/accordion/accordion.js +81 -0
  26. package/src/components/anchor/anchor-nav.css.js +15 -15
  27. package/src/components/anchor/anchor-nav.js +0 -1
  28. package/src/components/anchor/anchor.stories.js +10 -13
  29. package/src/components/badge/badge.css.js +6 -6
  30. package/src/components/badge/badge.js +1 -2
  31. package/src/components/badge/badge.stories.js +6 -6
  32. package/src/components/carousel/carousel.css.js +60 -60
  33. package/src/components/carousel/carousel.js +26 -30
  34. package/src/components/carousel/carousel.stories.js +55 -55
  35. package/src/components/checkbox/checkbox.css.js +14 -14
  36. package/src/components/divider/divider-horizontal.js +19 -14
  37. package/src/components/divider/divider-vertical.js +23 -14
  38. package/src/components/divider/divider.css.js +19 -0
  39. package/src/components/dropdown/dropdown.css.js +138 -0
  40. package/src/components/dropdown/dropdown.js +111 -0
  41. package/src/components/footer/footer-links-group.css.js +42 -0
  42. package/src/components/footer/footer-links-group.js +25 -0
  43. package/src/components/footer/footer-lp.css.js +625 -0
  44. package/src/components/footer/footer-lp.js +368 -0
  45. package/src/components/footer/footer-lp.stories.js +69 -0
  46. package/src/components/footer/footer-nav-menu.css.js +24 -0
  47. package/src/components/footer/footer-nav-menu.js +36 -0
  48. package/src/components/footer/footer.css.js +625 -0
  49. package/src/components/footer/footer.js +465 -0
  50. package/src/components/footer/footer.stories.js +60 -0
  51. package/src/components/footer/localeMap.js +1 -0
  52. package/src/components/grid/grid.css.js +38 -0
  53. package/src/components/grid/grid.js +55 -0
  54. package/src/components/header/header.css.js +81 -52
  55. package/src/components/header/header.js +19 -19
  56. package/src/components/highlight/highlight.css.js +32 -22
  57. package/src/components/highlight/highlight.js +15 -4
  58. package/src/components/highlight/highlight.stories.js +4 -4
  59. package/src/components/light-carousel/light-carousel-simple.css.js +183 -0
  60. package/src/components/light-carousel/light-carousel-simple.js +73 -0
  61. package/src/components/light-carousel/light-carousel.css.js +50 -31
  62. package/src/components/light-carousel/light-carousel.js +14 -57
  63. package/src/components/light-carousel/light-carousel.stories.js +51 -10
  64. package/src/components/link/link.css.js +41 -0
  65. package/src/components/link/link.js +54 -0
  66. package/src/components/modal/modal.css.js +75 -0
  67. package/src/components/modal/modal.js +41 -0
  68. package/src/components/modal/modal.stories.js +40 -0
  69. package/src/components/paragraph/paragraph.css.js +1 -3
  70. package/src/components/pricing-cards/new-pricing-card.js +30 -0
  71. package/src/components/pricing-cards/new-pricing.css.js +58 -0
  72. package/src/components/pricing-cards/pricing-card-actions.css.js +16 -0
  73. package/src/components/pricing-cards/pricing-card-actions.js +20 -0
  74. package/src/components/pricing-cards/pricing-card-container.css.js +41 -0
  75. package/src/components/pricing-cards/pricing-card-container.js +31 -0
  76. package/src/components/pricing-cards/pricing-card-header.css.js +70 -0
  77. package/src/components/pricing-cards/pricing-card-header.js +46 -0
  78. package/src/components/pricing-cards/pricing-card-pricing.css.js +63 -0
  79. package/src/components/pricing-cards/pricing-card-pricing.js +101 -0
  80. package/src/components/pricing-cards/pricing-card-show-more.css.js +22 -0
  81. package/src/components/pricing-cards/pricing-card-show-more.js +33 -0
  82. package/src/components/pricing-cards/pricing-card.css.js +91 -89
  83. package/src/components/pricing-cards/pricing-card.js +13 -16
  84. package/src/components/pricing-cards/pricing-feature-item.css.js +18 -0
  85. package/src/components/pricing-cards/pricing-feature-item.js +14 -0
  86. package/src/components/radio/radio.css.js +18 -18
  87. package/src/components/radio/radio.js +1 -0
  88. package/src/components/tabs/tabs.css.js +21 -11
  89. package/src/components/tabs/tabs.js +24 -18
  90. package/src/components/termsOfUse/terms.css.js +6 -6
  91. package/src/components/termsOfUse/terms.js +0 -1
  92. package/src/stories/demo.stories.js +271 -0
  93. package/src/tokens/colors.js +10 -10
  94. package/src/tokens/fonts.stories.js +5 -5
  95. package/src/tokens/layout.css +4 -3
  96. package/src/tokens/new-tokens.css +698 -0
  97. package/src/tokens/spacing.stories.js +1 -1
  98. package/src/tokens/tokens.css +1063 -0
  99. package/src/tokens/tokens.stories.js +3 -3
  100. package/src/tokens/typography.css.js +0 -4
  101. package/src/tokens/typography.stories.js +2 -2
  102. package/src/components/Input/index.js +0 -0
  103. package/src/components/highlight/highlight-s.css.js +0 -88
  104. package/src/components/highlight/highlight-s.js +0 -35
  105. package/src/components/highlight/highlight-s.stories.js +0 -22
@@ -0,0 +1,73 @@
1
+ import { LitElement, html } from "lit";
2
+ import { tokens } from "../../tokens/tokens.js";
3
+ import carouselCSS from "../light-carousel/light-carousel-simple.css.js";
4
+
5
+ class CustomLightCarouselSimple extends LitElement {
6
+ static properties = {
7
+ title: { type: String }
8
+ };
9
+
10
+ constructor() {
11
+ super();
12
+ this.title = "";
13
+ }
14
+
15
+ render() {
16
+ return html`
17
+ <section class="bd-light-carousel-s">
18
+ ${this.title
19
+ ? html`
20
+ <div class="bd-header-light-carousel-s">
21
+ <h1 class="bd-section-title-s">${this.title}</h1>
22
+ </div>
23
+ `
24
+ : null}
25
+ <div class="bd-light-carousel-track-s">
26
+ <slot></slot>
27
+ </div>
28
+ </section>
29
+ `;
30
+ }
31
+
32
+ }
33
+ class LightCarouselSimpleItem extends LitElement {
34
+ static properties = {
35
+ title: { type: String },
36
+ icon : { type: String }
37
+ };
38
+
39
+ constructor() {
40
+ super();
41
+ this.title = "";
42
+ this.icon = "";
43
+ }
44
+
45
+ render() {
46
+ return html`
47
+ <div class="bd-light-box-s">
48
+ <div class="bd-light-box-header-s">
49
+ ${this.icon
50
+ ? html`<img
51
+ src="${this.icon}"
52
+ alt="icon"
53
+ class="bd-light-icon-s"
54
+ />`
55
+ : ""}
56
+ ${this.title
57
+ ? html`
58
+ <div class="bd-light-title-badge-wrapper-s">
59
+ <h3>${this.title}</h3>
60
+ </div>
61
+ `
62
+ : ""}
63
+ </div>
64
+ <slot></slot>
65
+ </div>
66
+ `;
67
+ }
68
+ }
69
+ CustomLightCarouselSimple.styles = [tokens, carouselCSS];
70
+ LightCarouselSimpleItem.styles = [tokens, carouselCSS];
71
+
72
+ customElements.define("bd-light-carousel-simple-item", LightCarouselSimpleItem);
73
+ customElements.define("bd-light-carousel-simple-section", CustomLightCarouselSimple);
@@ -7,23 +7,30 @@ export default css`
7
7
  --border-card-grey: var(--color-neutral-50);
8
8
  }
9
9
  .bd-section-title {
10
- font-family: var(--font-family-sans);
11
- font-weight: var(--font-weight-sans-semibold);
10
+ font-family: var(--typography-fontFamily-sans);
11
+ font-weight: var(--typography-fontWeight-semibold);
12
12
  font-size: 2em;
13
13
  }
14
14
  .bd-header-light-carousel {
15
15
  margin-bottom: 50px;
16
16
  margin-top: 50px;
17
17
  }
18
+
18
19
  .bd-light-carousel {
19
20
  display: flex;
20
21
  align-items: center;
21
22
  justify-content: center;
22
23
  position: relative;
23
24
  width: 100%;
24
- margin: var(--size-0) auto;
25
+ margin: var(--spacing-0) auto;
25
26
  overflow: hidden;
26
27
  flex-direction: column;
28
+ padding-left: var(--spacing-14);
29
+ padding-right: var(--spacing-14);
30
+ max-width: 1400px;
31
+ margin: 0 auto;
32
+ padding-top: var(--spacing-32);
33
+
27
34
  }
28
35
  .bd-light-carousel-title {
29
36
  font-size: 28px;
@@ -35,12 +42,10 @@ export default css`
35
42
  letter-spacing: 0.5px;
36
43
  }
37
44
  .bd-light-carousel-track {
38
- display: flex;
39
- gap: 2em;
40
45
  scroll-behavior: smooth;
41
46
  flex: 1;
42
47
  position: relative;
43
- padding: var(--size-0) var(--size-20);
48
+ padding: var(--spacing-0) var(--spacing-20);
44
49
  overflow-x: auto;
45
50
  overflow-y: hidden;
46
51
  scrollbar-width: none;
@@ -48,61 +53,63 @@ export default css`
48
53
  z-index: 1;
49
54
  scroll-snap-type: x mandatory;
50
55
  }
51
-
56
+ .bd-light-carousel-track {
57
+ display: grid;
58
+ gap: 30px;
59
+ grid-template-columns: repeat(3, 1fr); /* default fix 3 */
60
+ }
52
61
  .bd-light-carousel-track::-webkit-scrollbar {
53
62
  display: none;
54
63
  }
55
64
 
56
65
  .bd-light-box {
57
- flex: var(--size-0) var(--size-0) auto;
58
- width: 450px;
66
+ flex: var(--spacing-0) var(--spacing-0) auto;
59
67
  background: var(--background-card-grey);
60
68
  border-radius: 28px;
61
- border: var(--size-2) solid var(--border-card-grey);
62
- padding: var(--size-32);
63
- display: flex;
69
+ // border: var(--spacing-2) solid var(--border-card-grey);
70
+ padding: var(--spacing-32);
64
71
  flex-direction: column;
65
72
  align-items: start;
66
73
  justify-content: center;
67
74
  text-align: start;
68
75
  transition: transform 0.2s ease-in-out;
69
- min-height: 155px;
76
+ min-height: 135px;
70
77
  position: relative;
71
78
  z-index: 2;
72
79
  scroll-snap-align: start;
73
- font-family: var(--font-family-sans);
80
+ font-family: var(--typography-fontFamily-sans);
74
81
  }
75
82
 
76
83
  .bd-light-box h3 {
77
84
  font-size: var(--heading-xsmall);
78
- margin: var(--size-0) var(--size-8) var(--size-8) var(--size-0);
85
+ margin: var(--spacing-0) var(--spacing-8) var(--spacing-8) var(--spacing-0);
79
86
  font-weight: 600;
80
- font-family: var(--font-family-sans);
87
+ font-family: var(--typography-fontFamily-sans);
81
88
  }
82
89
 
83
90
  .bd-light-box p {
84
- font-size: var(--size-16);
85
- margin: var(--size-0) var(--size-0) 1em var(--size-0);
86
- font-family: var(--font-family-sans);
91
+ font-size: var(--spacing-16);
92
+ margin: var(--spacing-0) var(--spacing-0) 1em var(--spacing-0);
93
+ font-family: var(--typography-fontFamily-sans);
87
94
  }
88
95
 
89
96
  .bd-light-icon {
90
97
  position: relative;
91
- bottom: var(--size-6);
98
+ bottom: var(--spacing-6);
92
99
  max-width: 100%;
93
- height: var(--size-32);
94
- width: var(--size-32);
100
+ height: var(--spacing-32);
101
+ width: var(--spacing-32);
95
102
  }
96
103
  .bd-light-box-header {
97
104
  display: flex;
98
105
  align-items: center;
99
- gap: var(--size-8);
106
+ gap: var(--spacing-8);
107
+ }
108
+ .bd-light-title-badge-wrapper {
109
+ display: flex;
110
+ align-items: center;
111
+ gap: var(--spacing-4, 4px);
100
112
  }
101
- .bd-light-title-badge-wrapper {
102
- display: flex;
103
- align-items: center;
104
- gap: var(--size-4, 4px);
105
- }
106
113
 
107
114
  @media (max-width: 1024px) {
108
115
  .bd-light-box {
@@ -121,7 +128,7 @@ export default css`
121
128
  .bd-light-carousel-track {
122
129
  display: flex;
123
130
  flex-direction: column;
124
- gap: var(--size-20);
131
+ gap: var(--spacing-20);
125
132
  overflow-x: hidden;
126
133
  overflow-y: hidden;
127
134
  scroll-behavior: smooth;
@@ -130,7 +137,7 @@ export default css`
130
137
  .bd-light-box {
131
138
  width: 100%;
132
139
  max-width: 400px;
133
- margin: var(--size-0) auto;
140
+ margin: var(--spacing-0) auto;
134
141
  }
135
142
 
136
143
  .bd-arrow {
@@ -151,7 +158,19 @@ export default css`
151
158
  font-size: 0.9em;
152
159
  }
153
160
  .bd-light-icon {
154
- bottom: var(--size-10);
161
+ bottom: var(--spacing-10);
162
+ }
163
+ }
164
+
165
+ @media (max-width: 1024px) {
166
+ .bd-light-carousel-track {
167
+ grid-template-columns: repeat(2, 1fr);
168
+ }
169
+ }
170
+
171
+ @media (max-width: 600px) {
172
+ .bd-light-carousel-track {
173
+ grid-template-columns: 1fr;
155
174
  }
156
175
  }
157
176
  `;
@@ -12,66 +12,23 @@ class CustomLightCarousel extends LitElement {
12
12
  this.title = "";
13
13
  }
14
14
 
15
- firstUpdated() {
16
- this.updateArrowStates();
17
- }
18
-
19
- scrollCarousel(direction) {
20
- const track = this.shadowRoot.querySelector(".bd-light-carousel-track");
21
- const itemWidth = track.firstElementChild
22
- ? track.firstElementChild.offsetWidth
23
- : 300;
24
- const trackWidth = track.offsetWidth;
25
- const scrollPosition = track.scrollLeft;
26
-
27
- if (direction === "left" && scrollPosition > 0) {
28
- track.scrollBy({ left: -itemWidth, behavior: "smooth" });
29
- } else if (
30
- direction === "right" &&
31
- scrollPosition + trackWidth < track.scrollWidth
32
- ) {
33
- track.scrollBy({ left: itemWidth, behavior: "smooth" });
34
- }
35
-
36
- this.updateArrowStates();
37
- }
38
-
39
- updateArrowStates() {
40
- const track = this.shadowRoot.querySelector(".bd-light-carousel-track");
41
- const leftArrow = this.shadowRoot.querySelector(".bd-light-left-arrow");
42
- const rightArrow = this.shadowRoot.querySelector(".bd-light-right-arrow");
43
-
44
- if (!track || !leftArrow || !rightArrow) return; // Nu face nimic dacă lipsește ceva
45
15
 
46
- const trackWidth = track.offsetWidth;
47
- const totalWidth = track.scrollWidth;
48
- const scrollPosition = track.scrollLeft;
49
-
50
- if (scrollPosition === 0) {
51
- leftArrow.classList.add("bd-disabled");
52
- } else {
53
- leftArrow.classList.remove("bd-disabled");
54
- }
55
-
56
- if (scrollPosition + trackWidth >= totalWidth) {
57
- rightArrow.classList.add("bd-disabled");
58
- } else {
59
- rightArrow.classList.remove("bd-disabled");
60
- }
61
- }
62
16
 
63
17
  render() {
64
18
  return html`
65
- <section class="bd-light-carousel">
66
- <div class="bd-header-light-carousel">
67
- <h1 class="bd-section-title">${this.title}</h1>
68
- </div>
69
-
70
- <div class="bd-light-carousel-track">
71
- <slot></slot>
72
- </div>
73
- </section>
74
- `;
19
+ <section class="bd-light-carousel">
20
+ ${this.title
21
+ ? html`
22
+ <div class="bd-header-light-carousel">
23
+ <h1 class="bd-section-title">${this.title}</h1>
24
+ </div>
25
+ `
26
+ : null}
27
+ <div class="bd-light-carousel-track">
28
+ <slot></slot>
29
+ </div>
30
+ </section>
31
+ `;
75
32
  }
76
33
  }
77
34
  class LightCarouselItem extends LitElement {
@@ -101,7 +58,7 @@ class LightCarouselItem extends LitElement {
101
58
  <div class="bd-light-title-badge-wrapper">
102
59
  ${this.title ? html`<h3>${this.title}</h3>` : ""}
103
60
  ${this.badge
104
- ? html`<bd-badge text="${this.badge}" color="#026DFF"></bd-badge>`
61
+ ? html`<bd-badge color="#026DFF">${this.badge}</bd-badge>`
105
62
  : ""}
106
63
  </div>
107
64
  `
@@ -1,21 +1,22 @@
1
1
  import { html } from "lit";
2
+ import "./light-carousel-simple.js";
2
3
  import "./light-carousel.js";
3
- import "../badge/badge.js"; // asigură-te că bd-badge este importat
4
+
5
+ import "../badge/badge.js";
4
6
 
5
7
  export default {
6
- title: "Components/Light Carousel",
7
- component: "bd-light-carousel-section",
8
- tags: ["autodocs"],
8
+ title : "Components/Light Carousel",
9
+ tags : ["autodocs"],
9
10
  argTypes: {
10
- title: { control: "text" },
11
- },
11
+ title: { control: "text" }
12
+ }
12
13
  };
13
14
 
14
15
  const Template = (args) => html`
15
16
  <bd-light-carousel-section title="${args.title}">
16
17
  <bd-light-carousel-item
17
18
  title="How does Bitdefender Internet Security protect me?"
18
- icon="icons/light-carousel-img1.png"
19
+ icon="/assets/light-carousel-img1.png"
19
20
  badge="FAQ"
20
21
  >
21
22
  <p>Bitdefender Internet Security provides the best protection...</p>
@@ -24,14 +25,14 @@ const Template = (args) => html`
24
25
 
25
26
  <bd-light-carousel-item
26
27
  title="How to install Bitdefender on another device?"
27
- icon="icons/light-carousel-img1.png"
28
+ icon="/assets/light-carousel-img1.png"
28
29
  >
29
30
  <p>You can install Bitdefender on other devices by logging into your Central account and using the 'My Devices' tab.</p>
30
31
  </bd-light-carousel-item>
31
32
 
32
33
  <bd-light-carousel-item
33
34
  title="Can I transfer my license to a new computer?"
34
- icon="icons/light-carousel-img1.png"
35
+ icon="/assets/light-carousel-img1.png"
35
36
  badge="How To"
36
37
  >
37
38
  <p>Yes, just remove the license from the old device via Central and activate it on the new one.</p>
@@ -41,5 +42,45 @@ const Template = (args) => html`
41
42
 
42
43
  export const Default = Template.bind({});
43
44
  Default.args = {
44
- title: "Need help? We've got answers!",
45
+ title: "Need help? We've got answers!"
46
+ };
47
+
48
+ // NEW: Simple version
49
+ const TemplateSimple = (args) => html`
50
+ <bd-light-carousel-simple-section title="${args.title}">
51
+ <bd-light-carousel-simple-item
52
+ title="Scam Copilot Chatbot"
53
+ icon="src/assets//assets/light-carousel-img1.png"
54
+ >
55
+ <p>
56
+ Specialized AI chatbot that helps you identify suspicious online
57
+ interactions so you don’t become a victim.
58
+ </p>
59
+ </bd-light-carousel-simple-item>
60
+
61
+ <bd-light-carousel-simple-item
62
+ title="Scam Wave Alerts"
63
+ icon="src/assets//assets/light-carousel-img1.png"
64
+ >
65
+ <p>
66
+ Stay informed with real-time alerts about ongoing scam outbreaks
67
+ detected in your area automatically.
68
+ </p>
69
+ </bd-light-carousel-simple-item>
70
+
71
+ <bd-light-carousel-simple-item
72
+ title="Online Scam Protection"
73
+ icon="src/assets//assets/light-carousel-img1.png"
74
+ >
75
+ <p>
76
+ Focused on browsing activities, it specializes in detecting the newest
77
+ scam patterns and tactics.
78
+ </p>
79
+ </bd-light-carousel-simple-item>
80
+ </bd-light-carousel-simple-section>
81
+ `;
82
+
83
+ export const Simple = TemplateSimple.bind({});
84
+ Simple.args = {
85
+ title: "Our AI-powered platform that detects and fights scams. In real time."
45
86
  };
@@ -0,0 +1,41 @@
1
+ import { css } from "lit";
2
+
3
+ export default css`
4
+ :host {
5
+ display: inline-block;
6
+ font-family: var(--typography-fontFamily-sans);
7
+
8
+ }
9
+
10
+ .bd-link {
11
+ font-family: inherit;
12
+ font-size: 1rem;
13
+ color: var(--color-link-primary, #007bff);
14
+ text-decoration: none;
15
+ cursor: pointer;
16
+ transition: color 0.2s ease;
17
+ }
18
+
19
+ .bd-link:hover {
20
+ text-decoration: underline;
21
+ }
22
+
23
+ .bd-link--underline {
24
+ text-decoration: underline;
25
+ }
26
+
27
+ .bd-link--secondary {
28
+ color: var(--color-link-secondary, #6c757d);
29
+ }
30
+
31
+ .bd-link--danger {
32
+ color: var(--color-link-danger, #dc3545);
33
+ }
34
+
35
+ .bd-link--disabled {
36
+ color: var(--color-link-disabled, #adb5bd);
37
+ pointer-events: none;
38
+ cursor: default;
39
+ text-decoration: none;
40
+ }
41
+ `;
@@ -0,0 +1,54 @@
1
+ import { LitElement, html } from "lit";
2
+ import { tokens } from "../../tokens/tokens.js";
3
+ import linkCSS from "./link.css.js";
4
+
5
+ class BdLink extends LitElement {
6
+ static properties = {
7
+ href : { type: String },
8
+ target : { type: String },
9
+ kind : { type: String },
10
+ underline: { type: Boolean },
11
+ disabled : { type: Boolean, reflect: true }
12
+ };
13
+
14
+ constructor() {
15
+ super();
16
+ this.href = "#";
17
+ this.target = "_self";
18
+ this.kind = "primary";
19
+ this.underline = false;
20
+ this.disabled = false;
21
+ }
22
+
23
+ static styles = [tokens, linkCSS];
24
+
25
+ render() {
26
+ const kindClass = {
27
+ primary : "",
28
+ secondary: "bd-link--secondary",
29
+ danger : "bd-link--danger"
30
+ }[this.kind] || "";
31
+
32
+ return html`
33
+ <a
34
+ class="bd-link ${kindClass} ${this.underline ? "bd-link--underline" : ""} ${this.disabled
35
+ ? "bd-link--disabled"
36
+ : ""}"
37
+ href="${this.disabled ? "javascript:void(0)" : this.href}"
38
+ target="${this.target}"
39
+ @click="${this._handleClick}"
40
+ >
41
+ <slot></slot>
42
+ </a>
43
+ `;
44
+ }
45
+
46
+ _handleClick(e) {
47
+ if (this.disabled) {
48
+ e.preventDefault();
49
+ e.stopImmediatePropagation();
50
+ }
51
+ }
52
+ }
53
+
54
+ customElements.define("bd-link", BdLink);
@@ -0,0 +1,75 @@
1
+ import { css } from "lit";
2
+
3
+ export default css`
4
+ :host {
5
+ --bd-blue-color: var(--color-blue-500);
6
+ --bd-accesibility-focus: var(--color-blue-800);
7
+ }
8
+
9
+ .bd-modal {
10
+ position: fixed;
11
+ top: var(--spacing-0);
12
+ left: var(--spacing-0);
13
+ width: 100%;
14
+ height: 100%;
15
+ background: rgba(0, 0, 0, 0.5);
16
+ display: flex;
17
+ justify-content: center;
18
+ align-items: center;
19
+ z-index: 9999;
20
+ backdrop-filter: blur(var(--spacing-12));
21
+ opacity: 0;
22
+ transform: scale(0.9);
23
+ transition: opacity 0.3s ease, transform 0.3s ease;
24
+ }
25
+
26
+ :host([open]) .bd-modal {
27
+ opacity: 1;
28
+ transform: scale(1);
29
+ pointer-events: auto;
30
+ }
31
+
32
+ .bd-modal-content {
33
+ background: #fff;
34
+ padding: 2em;
35
+ border-radius: var(--spacing-12);
36
+ max-width: 500px;
37
+ text-align: start;
38
+ box-shadow: var(--spacing-0) var(--spacing-2) var(--spacing-8) rgba(0, 0, 0, 0.2);
39
+ font-family: var(--typography-fontFamily-sans);
40
+ }
41
+
42
+ .bd-modal-content h2 {
43
+ margin: var(--spacing-0) var(--spacing-0) 1em var(--spacing-0);
44
+ font-family: var(--typography-fontFamily-sans);
45
+ }
46
+
47
+ .bd-modal-content button {
48
+ margin-top: 1em;
49
+ padding: 0.5em 1em;
50
+ background: var(--bd-blue-color);
51
+ color: #fff;
52
+ border: none;
53
+ border-radius: var(--spacing-8);
54
+ cursor: pointer;
55
+ font-family: var(--typography-fontFamily-sans);
56
+ }
57
+
58
+ .bd-modal-content button:focus-visible {
59
+ outline: var(--spacing-2) solid var(--bd-accesibility-focus);
60
+ outline-offset: var(--spacing-2);
61
+ }
62
+
63
+ @media (max-width: 768px) {
64
+ .bd-modal-content {
65
+ max-width: 90%;
66
+ padding: 1.5em;
67
+ }
68
+ }
69
+
70
+ @media (max-width: 480px) {
71
+ .bd-modal-content {
72
+ padding: 2em;
73
+ }
74
+ }
75
+ `;
@@ -0,0 +1,41 @@
1
+ import { LitElement, html } from "lit";
2
+ import { tokens } from "../../tokens/tokens.js";
3
+ import modalCSS from "../modal/modal.css";
4
+
5
+ export class BdModal extends LitElement {
6
+ static properties = {
7
+ open : { type: Boolean, reflect: true },
8
+ title : { type: String },
9
+ icon : { type: String },
10
+ modalText: { type: String }
11
+ };
12
+
13
+
14
+
15
+ _onClose() {
16
+ this.dispatchEvent(new CustomEvent("close-modal", { bubbles: true, composed: true }));
17
+ }
18
+
19
+ render() {
20
+ return html`
21
+ <div class="bd-modal" @click="${this._onClose}" aria-hidden="${!this.open}">
22
+ <div
23
+ class="bd-modal-content"
24
+ @click="${(e) => e.stopPropagation()}"
25
+ aria-labelledby="modal-title"
26
+ aria-describedby="modal-description"
27
+ >
28
+ ${this.icon
29
+ ? html`<img src="${this.icon}" alt="icon" class="bd-carousel-modal-icon" />`
30
+ : ""}
31
+ <h2 id="modal-title">${this.title}</h2>
32
+ <p id="modal-description">${this.modalText}</p>
33
+ <button @click="${this._onClose}" aria-label="Close modal">Close</button>
34
+ </div>
35
+ </div>
36
+ `;
37
+ }
38
+ }
39
+ BdModal.styles = [tokens, modalCSS];
40
+
41
+ customElements.define("bd-modal", BdModal);
@@ -0,0 +1,40 @@
1
+ // src/stories/Modal.stories.js
2
+ import { html } from "lit";
3
+ import "../../components/modal/modal.js";
4
+
5
+ export default {
6
+ title : "Components/Modal",
7
+ component: "bd-modal",
8
+ argTypes : {
9
+ open : { control: "boolean" },
10
+ title : { control: "text" },
11
+ icon : { control: "text" },
12
+ modalText: { control: "text" },
13
+ onClose : { action: "close-modal" }
14
+ }
15
+ };
16
+
17
+ const Template = ({ open, title, icon, modalText, onClose }) => html`
18
+ <bd-modal
19
+ ?open=${open}
20
+ title=${title}
21
+ icon=${icon}
22
+ modalText=${modalText}
23
+ @close-modal=${onClose}
24
+ ></bd-modal>
25
+ `;
26
+
27
+ export const Default = Template.bind({});
28
+ Default.args = {
29
+ open : true,
30
+ title : "Example Modal",
31
+ icon : "https://via.placeholder.com/40",
32
+ modalText: "This is a simple modal component."
33
+ };
34
+
35
+ export const Closed = Template.bind({});
36
+ Closed.args = {
37
+ open : false,
38
+ title : "Closed Modal",
39
+ modalText: "You should not see this modal because it is closed."
40
+ };
@@ -1,10 +1,8 @@
1
1
  import { css } from "lit";
2
2
 
3
3
  export default css`
4
-
5
-
6
4
  .bd-font-brand{
7
- font-family: var(--font-family-sans);
5
+ font-family: var(--typography-fontFamily-sans);
8
6
  }
9
7
  .bd-font-cod {
10
8
  font-family: var(--font-family-mono);