@repobit/dex-system-design 0.19.2 → 0.21.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 (75) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/package.json +2 -3
  3. package/src/components/Button/button.stories.js +51 -51
  4. package/src/components/accordion/accordion-bg.css.js +168 -102
  5. package/src/components/accordion/accordion-bg.js +13 -5
  6. package/src/components/accordion/accordion-bg.stories.js +281 -0
  7. package/src/components/accordion/accordion-light.stories.js +241 -0
  8. package/src/components/anchor/anchor.stories.js +24 -22
  9. package/src/components/back/back.css.js +56 -0
  10. package/src/components/back/back.js +39 -0
  11. package/src/components/back/back.stories.js +184 -0
  12. package/src/components/badge/badge.css.js +44 -6
  13. package/src/components/badge/badge.js +40 -2
  14. package/src/components/badge/badge.stories.js +3 -10
  15. package/src/components/breadcrumb/breadcrumb.css.js +98 -0
  16. package/src/components/breadcrumb/breadcrumb.js +136 -0
  17. package/src/components/breadcrumb/breadcrumb.stories.js +109 -0
  18. package/src/components/cards/card.css.js +245 -0
  19. package/src/components/cards/card.js +80 -0
  20. package/src/components/cards/card.stories.js +512 -0
  21. package/src/components/carousel/carousel.css.js +51 -36
  22. package/src/components/carousel/carousel.js +0 -1
  23. package/src/components/carousel/carousel.stories.js +21 -17
  24. package/src/components/display/display.css.js +68 -0
  25. package/src/components/display/display.js +26 -0
  26. package/src/components/display/display.stories.js +339 -0
  27. package/src/components/divider/divider-horizontal.js +1 -1
  28. package/src/components/footer/footer-links-group.css.js +1 -1
  29. package/src/components/footer/footer-links-group.js +3 -3
  30. package/src/components/footer/footer-lp.stories.js +26 -61
  31. package/src/components/footer/footer-nav-menu.css.js +9 -10
  32. package/src/components/footer/footer.css.js +95 -8
  33. package/src/components/footer/footer.js +31 -65
  34. package/src/components/footer/footer.stories.js +165 -48
  35. package/src/components/header/header.js +11 -11
  36. package/src/components/header/header.stories.js +36 -4
  37. package/src/components/heading/heading.css.js +79 -0
  38. package/src/components/heading/heading.js +79 -0
  39. package/src/components/heading/heading.stories.js +260 -0
  40. package/src/components/highlight/highlight.stories.js +1 -1
  41. package/src/components/image/image.css.js +101 -0
  42. package/src/components/image/image.js +57 -0
  43. package/src/components/image/image.stories.js +245 -0
  44. package/src/components/light-carousel/light-carousel-simple.js +3 -2
  45. package/src/components/light-carousel/light-carousel.js +3 -7
  46. package/src/components/light-carousel/light-carousel.stories.js +15 -16
  47. package/src/components/link/link.css.js +107 -18
  48. package/src/components/link/link.js +16 -12
  49. package/src/components/link/link.stories.js +177 -0
  50. package/src/components/list/list-item/list-item.css.js +106 -0
  51. package/src/components/list/list-item/list-item.js +43 -0
  52. package/src/components/list/list-item/list-item.stories.js +79 -0
  53. package/src/components/list/list.css.js +175 -0
  54. package/src/components/list/list.js +44 -0
  55. package/src/components/modal/modal.js +6 -5
  56. package/src/components/paragraph/paragraph.css.js +41 -11
  57. package/src/components/paragraph/paragraph.js +7 -45
  58. package/src/components/paragraph/paragraph.stories.js +235 -0
  59. package/src/components/picture/picture.css.js +0 -0
  60. package/src/components/picture/picture.js +46 -0
  61. package/src/components/picture/picture.stories.js +275 -0
  62. package/src/components/pricing-cards/pricing-card-actions.js +1 -1
  63. package/src/components/pricing-cards/pricing-card-header.js +9 -7
  64. package/src/components/pricing-cards/pricing-card-pricing.js +11 -12
  65. package/src/components/pricing-cards/pricing-card.css.js +28 -3
  66. package/src/components/pricing-cards/pricing-card.js +38 -50
  67. package/src/components/tabs/tabs.js +44 -47
  68. package/src/components/termsOfUse/terms.js +77 -161
  69. package/src/components/termsOfUse/terms.stories.js +4 -3
  70. package/src/stories/Header.js +6 -6
  71. package/src/tokens/layout.css +3 -3
  72. package/src/tokens/tokens.css +0 -23
  73. package/src/tokens/tokens.stories.js +9 -8
  74. package/src/components/accordion/accordion-no-bg.css.js +0 -114
  75. package/src/components/accordion/accordion-no-bg.js +0 -80
@@ -0,0 +1,136 @@
1
+ import { LitElement, html } from 'lit';
2
+ import { tokens } from '../../tokens/tokens.js';
3
+ import '../link/link.js';
4
+ import '../paragraph/paragraph.js';
5
+ import breadcrumbCSS from './breadcrumb.css.js';
6
+
7
+ export class Breadcrumb extends LitElement {
8
+ static properties = {
9
+ noTrailingSlash : { type: Boolean, attribute: 'no-trailing-slash' },
10
+ mobileBreakpoint: { type: Number, attribute: 'mobile-breakpoint' },
11
+ _isMobile : { type: Boolean, state: true }
12
+ };
13
+
14
+ constructor() {
15
+ super();
16
+ this.noTrailingSlash = false;
17
+ this.mobileBreakpoint = 768;
18
+ this._isMobile = false;
19
+ this._resizeObserver = null;
20
+ }
21
+
22
+ firstUpdated() {
23
+ this._checkMobile();
24
+ this._setupResizeListener();
25
+ this._updateChildItems();
26
+ }
27
+
28
+ updated(changedProperties) {
29
+ if (changedProperties.has('noTrailingSlash')) {
30
+ this._updateChildItems();
31
+ }
32
+ }
33
+
34
+ _updateChildItems() {
35
+ const slot = this.shadowRoot?.querySelector('slot');
36
+ if (!slot) return;
37
+
38
+ const items = slot.assignedElements({ flatten: true });
39
+ items.forEach(item => {
40
+ if (item.updateNoTrailingSlash) {
41
+ item.updateNoTrailingSlash(this.noTrailingSlash);
42
+ }
43
+ });
44
+ }
45
+
46
+ _checkMobile() {
47
+ this._isMobile = window.innerWidth <= this.mobileBreakpoint;
48
+ }
49
+
50
+ _setupResizeListener() {
51
+ let resizeTimeout;
52
+ const handleResize = () => {
53
+ clearTimeout(resizeTimeout);
54
+ resizeTimeout = setTimeout(() => {
55
+ const wasMobile = this._isMobile;
56
+ this._checkMobile();
57
+ if (wasMobile !== this._isMobile) {
58
+ this.requestUpdate();
59
+ }
60
+ }, 100);
61
+ };
62
+
63
+ window.addEventListener('resize', handleResize);
64
+ this._resizeObserver = handleResize;
65
+ }
66
+
67
+ disconnectedCallback() {
68
+ if (this._resizeObserver) {
69
+ window.removeEventListener('resize', this._resizeObserver);
70
+ }
71
+ super.disconnectedCallback();
72
+ }
73
+
74
+ render() {
75
+ const orientation = this._isMobile ? 'vertical' : 'horizontal';
76
+
77
+ return html`
78
+ <nav class="bd-breadcrumb bd-breadcrumb--${orientation}"
79
+ aria-label="Breadcrumb">
80
+ <div class="bd-breadcrumb__items">
81
+ <slot></slot>
82
+ </div>
83
+ </nav>
84
+ `;
85
+ }
86
+
87
+ static styles = [tokens, breadcrumbCSS];
88
+ }
89
+
90
+ export class BreadcrumbItem extends LitElement {
91
+ static properties = {
92
+ href : { type: String },
93
+ current : { type: Boolean, reflect: true },
94
+ noTrailingSlash: { type: Boolean }
95
+ };
96
+
97
+ constructor() {
98
+ super();
99
+ this.href = '';
100
+ this.current = false;
101
+ this.noTrailingSlash = false;
102
+ }
103
+
104
+ updateNoTrailingSlash(value) {
105
+ this.noTrailingSlash = value;
106
+ this.requestUpdate();
107
+ }
108
+
109
+ render() {
110
+ const showDivider = !this.current && !this.noTrailingSlash;
111
+
112
+ const content = this.current
113
+ ? html`<span class="bd-breadcrumb__item bd-breadcrumb__item--current" aria-current="page">
114
+ <bd-p kind="small"><slot></slot></bd-p>
115
+ </span>`
116
+ : this.href
117
+ ? html`<bd-link href="${this.href}" size="small" class="bd-breadcrumb__item">
118
+ <slot></slot>
119
+ </bd-link>`
120
+ : html`<span class="bd-breadcrumb__item">
121
+ <bd-p kind="small"><slot></slot></bd-p>
122
+ </span>`;
123
+
124
+ return html`
125
+ <div class="bd-breadcrumb-item">
126
+ ${content}
127
+ ${showDivider ? html`<span class="bd-breadcrumb__divider">/</span>` : ''}
128
+ </div>
129
+ `;
130
+ }
131
+
132
+ static styles = [tokens, breadcrumbCSS];
133
+ }
134
+
135
+ customElements.define('bd-breadcrumb', Breadcrumb);
136
+ customElements.define('bd-breadcrumb-item', BreadcrumbItem);
@@ -0,0 +1,109 @@
1
+ import { html } from 'lit';
2
+ import './breadcrumb.js';
3
+
4
+ export default {
5
+ title : 'Components/Breadcrumb',
6
+ component : 'bd-breadcrumb',
7
+ subcomponents: { 'BreadcrumbItem': 'bd-breadcrumb-item' },
8
+ parameters : {
9
+ docs: {
10
+ description: {
11
+ component: 'A navigation component that shows the current page location within a hierarchy.'
12
+ }
13
+ }
14
+ }
15
+ };
16
+
17
+ export const Default = () => html`
18
+ <bd-breadcrumb>
19
+ <bd-breadcrumb-item href="/">
20
+ Home
21
+ </bd-breadcrumb-item>
22
+ <bd-breadcrumb-item href="/products">
23
+ Products
24
+ </bd-breadcrumb-item>
25
+ <bd-breadcrumb-item href="/products/security">
26
+ Security
27
+ </bd-breadcrumb-item>
28
+ <bd-breadcrumb-item current>
29
+ Bitdefender Total Security
30
+ </bd-breadcrumb-item>
31
+ </bd-breadcrumb>
32
+ `;
33
+
34
+ export const WithNestedLinks = () => html`
35
+ <bd-breadcrumb>
36
+ <bd-breadcrumb-item href="/">
37
+ Home
38
+ </bd-breadcrumb-item>
39
+ <bd-breadcrumb-item href="/products">
40
+ All Products
41
+ </bd-breadcrumb-item>
42
+ <bd-breadcrumb-item href="/products/security">
43
+ Security Suite
44
+ </bd-breadcrumb-item>
45
+ <bd-breadcrumb-item current>
46
+ Internet Security 2024
47
+ </bd-breadcrumb-item>
48
+ </bd-breadcrumb>
49
+ `;
50
+
51
+ export const MixedItems = () => html`
52
+ <bd-breadcrumb>
53
+ <bd-breadcrumb-item href="/">
54
+ Home
55
+ </bd-breadcrumb-item>
56
+ <bd-breadcrumb-item>
57
+ Documentation
58
+ </bd-breadcrumb-item>
59
+ <bd-breadcrumb-item href="/docs/components">
60
+ Components
61
+ </bd-breadcrumb-item>
62
+ <bd-breadcrumb-item current>
63
+ Breadcrumb
64
+ </bd-breadcrumb-item>
65
+ </bd-breadcrumb>
66
+ `;
67
+
68
+ export const LongPath = () => html`
69
+ <bd-breadcrumb>
70
+ <bd-breadcrumb-item href="/">
71
+ Home
72
+ </bd-breadcrumb-item>
73
+ <bd-breadcrumb-item href="/categories">
74
+ Categories
75
+ </bd-breadcrumb-item>
76
+ <bd-breadcrumb-item href="/categories/technology">
77
+ Technology
78
+ </bd-breadcrumb-item>
79
+ <bd-breadcrumb-item href="/categories/technology/software">
80
+ Software
81
+ </bd-breadcrumb-item>
82
+ <bd-breadcrumb-item href="/categories/technology/software/security">
83
+ Security Software
84
+ </bd-breadcrumb-item>
85
+ <bd-breadcrumb-item current>
86
+ Bitdefender Internet Security Complete Edition
87
+ </bd-breadcrumb-item>
88
+ </bd-breadcrumb>
89
+ `;
90
+
91
+ export const MobileView = () => html`
92
+ <div style="max-width: 400px; border: 1px solid #ccc; padding: 20px;">
93
+ <bd-breadcrumb mobile-breakpoint="1200">
94
+ <bd-breadcrumb-item href="/">
95
+ Home
96
+ </bd-breadcrumb-item>
97
+ <bd-breadcrumb-item href="/products">
98
+ Products
99
+ </bd-breadcrumb-item>
100
+ <bd-breadcrumb-item current>
101
+ Current Page
102
+ </bd-breadcrumb-item>
103
+ </bd-breadcrumb>
104
+ <p style="margin-top: 20px; font-size: 12px; color: #666;">
105
+ This demo forces mobile view by setting breakpoint to 1200px.
106
+ Resize window to see responsive behavior.
107
+ </p>
108
+ </div>
109
+ `;
@@ -0,0 +1,245 @@
1
+ import { css } from "lit";
2
+
3
+ export default css`
4
+ :host {
5
+ display: block;
6
+ --background-card-grey: var(--color-neutral-25);
7
+ --border-card-grey: var(--color-neutral-50);
8
+ padding-top: var(--spacing-32);
9
+ padding-bottom: var(--spacing-32);
10
+ }
11
+
12
+ .bd-section-title-s {
13
+ font-family: var(--typography-fontFamily-sans);
14
+ font-weight: var(--typography-fontWeight-semibold);
15
+ font-size: 2em;
16
+ }
17
+
18
+ .bd-header-light-carousel-s {
19
+ margin-bottom: 50px;
20
+ margin-top: 50px;
21
+ }
22
+
23
+ .bd-light-carousel-s {
24
+ display: flex;
25
+ align-items: center;
26
+ justify-content: center;
27
+ position: relative;
28
+ width: 100%;
29
+ margin: var(--spacing-0) auto;
30
+ overflow: hidden;
31
+ flex-direction: column;
32
+ padding-left: var(--spacing-14);
33
+ padding-right: var(--spacing-14);
34
+ max-width: 1400px;
35
+ margin: 0 auto;
36
+ }
37
+
38
+ .bd-light-carousel-title-s {
39
+ font-size: 28px;
40
+ font-weight: 700;
41
+ text-align: center;
42
+ color: #e4002b;
43
+ margin-bottom: 32px;
44
+ text-transform: uppercase;
45
+ letter-spacing: 0.5px;
46
+ }
47
+
48
+ .bd-light-carousel-track-s {
49
+ scroll-behavior: smooth;
50
+ flex: 1;
51
+ position: relative;
52
+ padding: var(--spacing-0) var(--spacing-20);
53
+ overflow-x: auto;
54
+ overflow-y: hidden;
55
+ scrollbar-width: none;
56
+ -ms-overflow-style: none;
57
+ z-index: 1;
58
+ scroll-snap-type: x mandatory;
59
+ display: grid;
60
+ gap: 1.5rem;
61
+ grid-template-columns: repeat(4, 1fr);
62
+ }
63
+
64
+ .bd-light-carousel-track-s::-webkit-scrollbar {
65
+ display: none;
66
+ }
67
+
68
+ .bd-light-box-s {
69
+ flex: var(--spacing-0) var(--spacing-0) auto;
70
+ background: var(--background-card-grey);
71
+ border-radius: 28px;
72
+ padding: var(--spacing-32);
73
+ display: flex;
74
+ flex-direction: column;
75
+ align-items: start;
76
+ justify-content: center;
77
+ text-align: start;
78
+ transition: transform 0.2s ease-in-out;
79
+ min-height: 135px;
80
+ position: relative;
81
+ z-index: 2;
82
+ scroll-snap-align: start;
83
+ font-family: var(--typography-fontFamily-sans);
84
+ }
85
+
86
+ /* Stiluri pentru carduri fără conținut (doar icon + titlu) */
87
+ .bd-light-box-no-content {
88
+ justify-content: center !important;
89
+ align-items: center !important;
90
+ text-align: center !important;
91
+ min-height: 200px;
92
+ gap: var(--spacing-32);
93
+ }
94
+
95
+ /* Stiluri pentru aliniere center */
96
+ .bd-light-box-center {
97
+ align-items: center !important;
98
+ justify-content: center !important;
99
+ text-align: center !important;
100
+ }
101
+
102
+ .bd-light-box-s h3 {
103
+ font-size: var(--heading-xsmall);
104
+ margin: var(--spacing-0) var(--spacing-8) var(--spacing-8) var(--spacing-0);
105
+ font-weight: 600;
106
+ font-family: var(--typography-fontFamily-sans);
107
+ text-align: start;
108
+ }
109
+
110
+ /* Titlu pentru carduri fără conținut */
111
+ .bd-light-title-no-content h3 {
112
+ margin: var(--spacing-0) !important;
113
+ font-size: var(--heading-small) !important;
114
+ text-align: center;
115
+ }
116
+
117
+ .bd-light-box-center h3 {
118
+ text-align: center !important;
119
+ margin: var(--spacing-0) var(--spacing-0) var(--spacing-8) var(--spacing-0) !important;
120
+ }
121
+
122
+ .bd-light-box-s p {
123
+ font-size: var(--spacing-16);
124
+ margin: var(--spacing-0) var(--spacing-0) 1em var(--spacing-0);
125
+ font-family: var(--typography-fontFamily-sans);
126
+ text-align: start;
127
+ }
128
+
129
+ .bd-light-box-center p {
130
+ text-align: center !important;
131
+ }
132
+
133
+ .bd-light-icon-s {
134
+ position: relative;
135
+ max-width: 100%;
136
+ height: var(--spacing-44);
137
+ width: var(--spacing-44);
138
+ }
139
+
140
+ /* Iconiță pentru carduri fără conținut */
141
+ .bd-light-box-no-content .bd-light-icon-s {
142
+ margin: 0 !important;
143
+ bottom: 0;
144
+ }
145
+
146
+ .bd-light-box-header-s {
147
+ display: flex;
148
+ flex-direction: column;
149
+ align-items: flex-start;
150
+ gap: var(--spacing-8);
151
+ padding-bottom: var(--spacing-16);
152
+ }
153
+
154
+ /* Header pentru carduri fără conținut */
155
+ .bd-light-box-no-content .bd-light-box-header-s {
156
+ align-items: center !important;
157
+ margin: 0 !important;
158
+ }
159
+
160
+ .bd-light-box-header-center {
161
+ align-items: center !important;
162
+ padding-bottom: var(--spacing-16);
163
+ }
164
+
165
+ .bd-light-title-badge-wrapper-s {
166
+ display: flex;
167
+ align-items: center;
168
+ gap: var(--spacing-4, 4px);
169
+ }
170
+
171
+ /* Container titlu pentru carduri fără conținut */
172
+ .bd-light-title-no-content {
173
+ margin: 0 !important;
174
+ width: 100%;
175
+ justify-content: center;
176
+ }
177
+
178
+ @media (max-width: 1024px) {
179
+ .bd-light-box-s {
180
+ width: 380px;
181
+ padding: 1.5em;
182
+ }
183
+ .bd-light-box-s h3 {
184
+ font-size: 1.1em;
185
+ }
186
+ .bd-light-box-s p {
187
+ font-size: 0.95em;
188
+ }
189
+
190
+ .bd-light-carousel-track-s {
191
+ grid-template-columns: repeat(2, 1fr);
192
+ }
193
+ }
194
+
195
+ @media (max-width: 768px) {
196
+ .bd-light-carousel-track-s {
197
+ display: flex;
198
+ flex-direction: column;
199
+ gap: var(--spacing-20);
200
+ overflow-x: hidden;
201
+ overflow-y: hidden;
202
+ scroll-behavior: smooth;
203
+ }
204
+
205
+ .bd-light-box-s {
206
+ width: 100%;
207
+ max-width: 400px;
208
+ margin: var(--spacing-0) auto;
209
+ }
210
+
211
+ .bd-arrow-s {
212
+ display: none;
213
+ }
214
+ }
215
+
216
+ @media (max-width: 480px) {
217
+ .bd-light-box-s {
218
+ width: 100%;
219
+ padding: 1em;
220
+ min-height: 300px;
221
+ }
222
+
223
+ .bd-light-box-no-content {
224
+ min-height: 250px;
225
+ }
226
+
227
+ .bd-light-box-s h3 {
228
+ font-size: 1em;
229
+ }
230
+
231
+ .bd-light-box-s p {
232
+ font-size: 0.9em;
233
+ }
234
+
235
+ .bd-light-icon-s {
236
+ bottom: var(--spacing-10);
237
+ }
238
+ }
239
+
240
+ @media (max-width: 600px) {
241
+ .bd-light-carousel-track-s {
242
+ grid-template-columns: 1fr;
243
+ }
244
+ }
245
+ `;
@@ -0,0 +1,80 @@
1
+ import { LitElement, html } from "lit";
2
+ import { tokens } from "../../tokens/tokens.js";
3
+ import "../heading/heading.js";
4
+ import carouselCSS from "./card.css.js";
5
+
6
+ class Card extends LitElement {
7
+ static properties = {
8
+ title: { type: String }
9
+ };
10
+
11
+ constructor() {
12
+ super();
13
+ this.title = "";
14
+ }
15
+
16
+ render() {
17
+ return html`
18
+ <section class="bd-light-carousel-s">
19
+ ${this.title
20
+ ? html`
21
+ <div class="bd-header-light-carousel-s">
22
+ <h1 class="bd-section-title-s">${this.title}</h1>
23
+ </div>
24
+ `
25
+ : null}
26
+ <div class="bd-light-carousel-track-s">
27
+ <slot></slot>
28
+ </div>
29
+ </section>
30
+ `;
31
+ }
32
+ }
33
+
34
+ class CardItem extends LitElement {
35
+ static properties = {
36
+ title: { type: String },
37
+ icon : { type: String },
38
+ align: { type: String }
39
+ };
40
+
41
+ constructor() {
42
+ super();
43
+ this.title = "";
44
+ this.icon = "";
45
+ this.align = "start";
46
+ }
47
+
48
+ render() {
49
+ const isCentered = this.align === "center";
50
+ const hasContent = this.innerHTML.trim() !== '';
51
+
52
+ return html`
53
+ <div class="bd-light-box-s ${isCentered ? 'bd-light-box-center' : ''} ${!hasContent ? 'bd-light-box-no-content' : ''}">
54
+ <div class="bd-light-box-header-s ${isCentered ? 'bd-light-box-header-center' : ''}">
55
+ ${this.icon
56
+ ? html`<img
57
+ src="${this.icon}"
58
+ alt="icon"
59
+ class="bd-light-icon-s"
60
+ />`
61
+ : ""}
62
+ </div>
63
+ ${this.title
64
+ ? html`
65
+ <div class="bd-light-title-badge-wrapper-s ${!hasContent ? 'bd-light-title-no-content' : ''}">
66
+ <bd-h as="h4" padding="10px 0">${this.title}</bd-h>
67
+ </div>
68
+ `
69
+ : ""}
70
+ <slot></slot>
71
+ </div>
72
+ `;
73
+ }
74
+ }
75
+
76
+ Card.styles = [tokens, carouselCSS];
77
+ CardItem.styles = [tokens, carouselCSS];
78
+
79
+ customElements.define("bd-card-item", CardItem);
80
+ customElements.define("bd-card-section", Card);