@repobit/dex-system-design 0.23.9 → 0.23.11

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.
@@ -0,0 +1,354 @@
1
+ import { html } from "lit";
2
+ import "../heading/heading.js";
3
+ import "../image/image.js";
4
+ import "../link/link.js";
5
+ import "../paragraph/paragraph.js";
6
+ import "./awards-light.js";
7
+ import "./awards.js";
8
+
9
+ export default {
10
+ title : "Components/Awards Section Light",
11
+ component : "bd-awards-section-light",
12
+ tags : ["autodocs"],
13
+ parameters: {
14
+ layout: "fullscreen",
15
+ docs : {
16
+ description: {
17
+ component: `
18
+ **AwardsSectionLight** is a lightweight variant of the AwardsSection component that renders only the trust banner and award badges — without the "What's our secret" section or feature cards.
19
+
20
+ ### Usage
21
+ \`\`\`html
22
+ <bd-awards-section-light></bd-awards-section-light>
23
+ \`\`\`
24
+
25
+ ### Attributes
26
+ | Attribute | Type | Default | Description |
27
+ |----------------|--------|---------|-----------------------------------------|
28
+ | \`tagline\` | String | — | Small text above the headline |
29
+ | \`headline\` | String | — | Main heading of the trust banner |
30
+ | \`subtext\` | String | — | Supporting paragraph below the headline |
31
+ | \`desktopAwards\`| Array | — | Award badge objects |
32
+
33
+ ### Badge object shape
34
+ \`\`\`js
35
+ { id: string, label: string, type: "red" | "dark", format: "svg", src: string }
36
+ \`\`\`
37
+ `
38
+ }
39
+ }
40
+ },
41
+ argTypes: {
42
+ tagline: {
43
+ control : "text",
44
+ description: "Small text displayed above the headline",
45
+ table : { type: { summary: "string" }, category: "Content" }
46
+ },
47
+ headline: {
48
+ control : "text",
49
+ description: "Main heading of the trust banner",
50
+ table : { type: { summary: "string" }, category: "Content" }
51
+ },
52
+ subtext: {
53
+ control : "text",
54
+ description: "Supporting paragraph below the headline",
55
+ table : { type: { summary: "string" }, category: "Content" }
56
+ },
57
+ desktopAwards: {
58
+ control : "object",
59
+ description: "Array of award badge objects",
60
+ table : {
61
+ type : { summary: "Array<{ id, label, type, format, src }>" },
62
+ category: "Badges"
63
+ }
64
+ }
65
+ }
66
+ };
67
+
68
+
69
+ // ─── Shared defaults ─────────────────────────────────────────────────────────
70
+
71
+ const defaultArgs = {
72
+ tagline : "You're Making A Great Choice",
73
+ headline : "World-class security software you can trust. Always.",
74
+ subtext : "We've added 25 new accolades in the past two years to the hundreds we have won since we started in 2001 - so you know you are in good hands.",
75
+ desktopAwards: [
76
+ {
77
+ label : "PC MAG\nEDITORS' CHOICE",
78
+ type : "red",
79
+ format: "svg",
80
+ src : "/assets/pc-mag.svg",
81
+ id : "pc-mag"
82
+ },
83
+ {
84
+ label : "AV\ncomparatives",
85
+ type : "dark",
86
+ format: "svg",
87
+ src : "/assets/av-comparatives.svg",
88
+ id : "av-comparatives"
89
+ },
90
+ {
91
+ label : "Best\nBrands\n2024",
92
+ type : "dark",
93
+ format: "svg",
94
+ src : "/assets/best-brands.svg",
95
+ id : "best-brands"
96
+ },
97
+ {
98
+ label : "PC\nChoice\n2024",
99
+ type : "red",
100
+ format: "svg",
101
+ src : "/assets/pc-mag-2024.svg",
102
+ id : "pc-mag-2024"
103
+ },
104
+ {
105
+ label : "PC MAG\nREADERS'\nCHOICE",
106
+ type : "red",
107
+ format: "svg",
108
+ src : "/assets/pc-mag-readers.svg",
109
+ id : "pc-mag-readers"
110
+ },
111
+ {
112
+ label : "PC\nBusiness\nChoice",
113
+ type : "red",
114
+ format: "svg",
115
+ src : "/assets/pc-mag-business.svg",
116
+ id : "pc-mag-business"
117
+ },
118
+ {
119
+ label : "AV\nTEST\nTOP\nPRODUCT",
120
+ type : "red",
121
+ format: "svg",
122
+ src : "/assets/top-product.svg",
123
+ id : "top-product"
124
+ }
125
+ ]
126
+ };
127
+
128
+ const render = (args) => html`
129
+ <bd-awards-section-light
130
+ .tagline=${args.tagline}
131
+ .headline=${args.headline}
132
+ .subtext=${args.subtext}
133
+ .desktopAwards=${args.desktopAwards}
134
+ ></bd-awards-section-light>
135
+ `;
136
+
137
+
138
+ // ─── Default ─────────────────────────────────────────────────────────────────
139
+
140
+ export const Default = {
141
+ name : "Default (Desktop)",
142
+ args : { ...defaultArgs },
143
+ render,
144
+ parameters: {
145
+ viewport: { defaultViewport: "desktop" },
146
+ docs : {
147
+ description: {
148
+ story: "Full desktop layout. Trust banner with tagline, headline, subtext, and all 7 award badges split across two rows (3 top + 4 bottom)."
149
+ }
150
+ }
151
+ }
152
+ };
153
+
154
+
155
+ // ─── Mobile ───────────────────────────────────────────────────────────────────
156
+
157
+ export const Mobile = {
158
+ name : "Mobile (375px)",
159
+ args : { ...defaultArgs },
160
+ render,
161
+ parameters: {
162
+ viewport: { defaultViewport: "mobile1" },
163
+ docs : {
164
+ description: {
165
+ story: "Mobile layout at 375px. The `_narrow` state activates at ≤599px, switching to smaller typography variants and compact badge sizes."
166
+ }
167
+ }
168
+ }
169
+ };
170
+
171
+
172
+ // ─── Tablet ───────────────────────────────────────────────────────────────────
173
+
174
+ export const Tablet = {
175
+ name : "Tablet (768px)",
176
+ args : { ...defaultArgs },
177
+ render,
178
+ parameters: {
179
+ viewport: { defaultViewport: "tablet" },
180
+ docs : {
181
+ description: {
182
+ story: "Tablet layout at 768px. Desktop typography is active since the viewport exceeds 599px."
183
+ }
184
+ }
185
+ }
186
+ };
187
+
188
+
189
+ // ─── Custom text ──────────────────────────────────────────────────────────────
190
+
191
+ export const CustomContent = {
192
+ name: "Custom Text Content",
193
+ args: {
194
+ ...defaultArgs,
195
+ tagline : "Trusted by Millions Worldwide",
196
+ headline: "Award-winning protection for every device.",
197
+ subtext : "From homes to enterprises, Bitdefender has been recognised by the world's top security testing labs year after year."
198
+ },
199
+ render,
200
+ parameters: {
201
+ docs: {
202
+ description: {
203
+ story: "All text props replaced with custom values. Use the Controls panel to live-edit tagline, headline, and subtext."
204
+ }
205
+ }
206
+ }
207
+ };
208
+
209
+
210
+ // ─── Few badges ───────────────────────────────────────────────────────────────
211
+
212
+ export const FewBadges = {
213
+ name: "Reduced Badge Set (3 badges)",
214
+ args: {
215
+ ...defaultArgs,
216
+ desktopAwards: [
217
+ {
218
+ label : "PC MAG\nEDITORS' CHOICE",
219
+ type : "red",
220
+ format: "svg",
221
+ src : "/assets/pc-mag.svg",
222
+ id : "pc-mag"
223
+ },
224
+ {
225
+ label : "AV\ncomparatives",
226
+ type : "dark",
227
+ format: "svg",
228
+ src : "/assets/av-comparatives.svg",
229
+ id : "av-comparatives"
230
+ },
231
+ {
232
+ label : "AV\nTEST\nTOP\nPRODUCT",
233
+ type : "red",
234
+ format: "svg",
235
+ src : "/assets/top-product.svg",
236
+ id : "top-product"
237
+ }
238
+ ]
239
+ },
240
+ render,
241
+ parameters: {
242
+ docs: {
243
+ description: {
244
+ story: "Only 3 badges passed. The first row (`slice(0, 3)`) is full, the second row (`slice(3)`) renders empty. Verifies no layout breakage."
245
+ }
246
+ }
247
+ }
248
+ };
249
+
250
+
251
+ // ─── Single badge ─────────────────────────────────────────────────────────────
252
+
253
+ export const SingleBadge = {
254
+ name: "Single Badge (edge case)",
255
+ args: {
256
+ ...defaultArgs,
257
+ desktopAwards: [
258
+ {
259
+ label : "PC MAG\nEDITORS' CHOICE",
260
+ type : "red",
261
+ format: "svg",
262
+ src : "/assets/pc-mag.svg",
263
+ id : "pc-mag"
264
+ }
265
+ ]
266
+ },
267
+ render,
268
+ parameters: {
269
+ docs: {
270
+ description: {
271
+ story: "Minimum edge case: a single badge. Ensures no crash or layout breakage."
272
+ }
273
+ }
274
+ }
275
+ };
276
+
277
+
278
+ // ─── All dark badges ──────────────────────────────────────────────────────────
279
+
280
+ export const AllDarkBadges = {
281
+ name: "All Dark Badges",
282
+ args: {
283
+ ...defaultArgs,
284
+ desktopAwards: defaultArgs.desktopAwards.map((a) => ({ ...a, type: "dark" }))
285
+ },
286
+ render,
287
+ parameters: {
288
+ docs: {
289
+ description: {
290
+ story: "All badges set to `type: 'dark'`. Verifies the `.bd-awards-badge--dark` CSS class is applied to every badge."
291
+ }
292
+ }
293
+ }
294
+ };
295
+
296
+
297
+ // ─── All red badges ───────────────────────────────────────────────────────────
298
+
299
+ export const AllRedBadges = {
300
+ name: "All Red Badges",
301
+ args: {
302
+ ...defaultArgs,
303
+ desktopAwards: defaultArgs.desktopAwards.map((a) => ({ ...a, type: "red" }))
304
+ },
305
+ render,
306
+ parameters: {
307
+ docs: {
308
+ description: {
309
+ story: "All badges set to `type: 'red'`. The `.bd-awards-badge--dark` class is not applied to any badge."
310
+ }
311
+ }
312
+ }
313
+ };
314
+
315
+
316
+ // ─── Small mobile ─────────────────────────────────────────────────────────────
317
+
318
+ export const SmallMobile = {
319
+ name : "Small Mobile (320px)",
320
+ args : { ...defaultArgs },
321
+ render,
322
+ parameters: {
323
+ viewport: {
324
+ viewports: {
325
+ smallMobile: {
326
+ name : "Small Mobile",
327
+ styles: { width: "320px", height: "812px" }
328
+ }
329
+ },
330
+ defaultViewport: "smallMobile"
331
+ },
332
+ docs: {
333
+ description: {
334
+ story: "Smallest supported viewport at 320px. Verifies badge rows, text wrapping, and the laurel SVG icon do not overflow or clip."
335
+ }
336
+ }
337
+ }
338
+ };
339
+
340
+
341
+ // ─── Playground ───────────────────────────────────────────────────────────────
342
+
343
+ export const Playground = {
344
+ name : "Playground",
345
+ args : { ...defaultArgs },
346
+ render,
347
+ parameters: {
348
+ docs: {
349
+ description: {
350
+ story: "Fully interactive story. Use the Controls panel to modify every prop in real time: text content and badge arrays."
351
+ }
352
+ }
353
+ }
354
+ };
@@ -154,7 +154,7 @@ export const awardsCSS = css`
154
154
  align-items: stretch;
155
155
  gap: var(--spacing-32);
156
156
  width: 100%;
157
- max-width: 1228px;
157
+ max-width: 940px;
158
158
  margin: 0 auto;
159
159
  padding: 0 var(--spacing-24);
160
160
  box-sizing: border-box;
@@ -17,13 +17,17 @@ export default css`
17
17
  --cs-bar-track-border: var(--color-neutral-200);
18
18
  --cs-bar-height: var(--dimension-48px);
19
19
  --cs-gap: var(--spacing-32);
20
- /* Figma layout width; between --content-width-max (1200) and --grid-container-max-xxl (1320) */
21
20
  --cs-grid-max: 1228px;
22
21
  }
23
22
 
24
- :host(compare-card),
23
+ :host(compare-card) {
24
+ display: block;
25
+ height: 100%;
26
+ }
27
+
25
28
  :host(compare-bar) {
26
29
  display: block;
30
+ width: 100%;
27
31
  }
28
32
 
29
33
 
@@ -32,15 +36,15 @@ export default css`
32
36
  ──────────────────────────────────────────────────────────────── */
33
37
 
34
38
  .cs-sr-only {
35
- position: absolute;
36
- width: 1px;
37
- height: 1px;
38
- padding: 0;
39
- margin: -1px;
40
- overflow: hidden;
41
- clip: rect(0, 0, 0, 0);
39
+ position: absolute;
40
+ width: 1px;
41
+ height: 1px;
42
+ padding: 0;
43
+ margin: -1px;
44
+ overflow: hidden;
45
+ clip: rect(0, 0, 0, 0);
42
46
  white-space: nowrap;
43
- border: 0;
47
+ border: 0;
44
48
  }
45
49
 
46
50
  .cs-section {
@@ -70,6 +74,7 @@ export default css`
70
74
  max-width: var(--cs-grid-max);
71
75
  margin: 0 auto;
72
76
  justify-content: center;
77
+ align-items: stretch;
73
78
  }
74
79
 
75
80
  @media (max-width: 768px) {
@@ -80,7 +85,7 @@ export default css`
80
85
 
81
86
 
82
87
  /* ──────────────────────────────────────────────────────────────
83
- 3. compare-card (nearest radii: 20px Figma → --radius-3xl 24px)
88
+ 3. compare-card
84
89
  ──────────────────────────────────────────────────────────────── */
85
90
 
86
91
  .card {
@@ -99,6 +104,7 @@ export default css`
99
104
  flex-direction: column;
100
105
  align-items: flex-start;
101
106
  gap: var(--spacing-8);
107
+ flex: 1 1 auto;
102
108
  }
103
109
 
104
110
  .card-icon-wrap {
@@ -109,10 +115,10 @@ export default css`
109
115
 
110
116
  .card-icon-wrap bd-img {
111
117
  display: block;
112
- width: 100%;
113
- height: 100%;
118
+ width: 100%;
119
+ height: 100%;
114
120
  }
115
-
121
+
116
122
  .card-text-wrap {
117
123
  display: flex;
118
124
  flex-direction: column;
@@ -133,22 +139,20 @@ export default css`
133
139
  flex-direction: column;
134
140
  gap: var(--spacing-8);
135
141
  align-self: stretch;
142
+ flex: 0 0 auto;
136
143
  }
137
144
 
138
145
  .card-footnote {
139
146
  margin: 0;
140
147
  color: var(--color-neutral-900);
148
+ flex: 0 0 auto;
141
149
  }
142
150
 
143
151
 
144
152
  /* ──────────────────────────────────────────────────────────────
145
- 4. compare-bar (10px radius Figma → --radius-xl 12px)
153
+ 4. compare-bar
146
154
  ──────────────────────────────────────────────────────────────── */
147
155
 
148
- :host(compare-bar) {
149
- width: 100%;
150
- }
151
-
152
156
  .bar-track {
153
157
  position: relative;
154
158
  height: var(--cs-bar-height);
@@ -172,7 +176,7 @@ export default css`
172
176
  box-sizing: border-box;
173
177
  background: transparent;
174
178
  transition: width calc(var(--transition-duration-slower) + 300ms)
175
- cubic-bezier(0.22, 1, 0.36, 1);
179
+ cubic-bezier(0.22, 1, 0.36, 1);
176
180
  min-width: 0;
177
181
  }
178
182
 
@@ -239,29 +243,28 @@ export default css`
239
243
  ══════════════════════════════════════════════════════════════ */
240
244
 
241
245
  :host(bd-compare-section.theme-green) {
242
- --cs-bar-primary-bg: var(--color-green-500);
246
+ --cs-bar-primary-bg: var(--color-green-500);
243
247
  --cs-bar-primary-fg: var(--color-neutral-0);
244
248
  --cs-icon-color: var(--color-green-500);
245
249
  --cs-icon-filter: invert(35%) sepia(72%) saturate(500%) hue-rotate(100deg) brightness(95%) contrast(95%);
246
250
  }
247
251
 
248
252
  :host(bd-compare-section.theme-red) {
249
- --cs-bar-primary-bg: var(--color-red-500);
253
+ --cs-bar-primary-bg: var(--color-red-500);
250
254
  --cs-bar-primary-fg: var(--color-neutral-0);
251
255
  --cs-icon-color: var(--color-red-500);
252
256
  --cs-icon-filter: invert(22%) sepia(90%) saturate(700%) hue-rotate(345deg) brightness(95%) contrast(95%);
253
257
  }
254
258
 
255
- /* No violet in DS; keep marketing accent */
256
259
  :host(bd-compare-section.theme-purple) {
257
- --cs-bar-primary-bg: #7c3aed;
260
+ --cs-bar-primary-bg: #7c3aed;
258
261
  --cs-bar-primary-fg: var(--color-neutral-0);
259
262
  --cs-icon-color: #7c3aed;
260
263
  --cs-icon-filter: invert(25%) sepia(80%) saturate(800%) hue-rotate(255deg) brightness(90%) contrast(95%);
261
264
  }
262
265
 
263
266
  :host(bd-compare-section.theme-dark) {
264
- --cs-bar-primary-bg: var(--color-blue-400);
267
+ --cs-bar-primary-bg: var(--color-blue-400);
265
268
  --cs-bar-primary-fg: var(--color-neutral-0);
266
269
  --cs-icon-color: var(--color-blue-400);
267
270
  --cs-icon-filter: invert(65%) sepia(50%) saturate(500%) hue-rotate(195deg) brightness(105%) contrast(95%);
@@ -280,4 +283,4 @@ export default css`
280
283
  --cs-bar-height: var(--dimension-40px);
281
284
  --cs-gap: var(--spacing-24);
282
285
  }
283
- `;
286
+ `;
@@ -101,7 +101,7 @@ export const Default = {
101
101
  >
102
102
  <compare-card
103
103
  title="Best Protection"
104
- description="Best Protection against e-Threats (On a scale of 0 to 6, with 6 as the highest level of protection)"
104
+ description="Best Protection against e-Threats (On a scale of 0 to 6, with 6 as the highest level of protection)Best Protection against e-Threats (On a scale of 0 to 6, with 6 as the highest level of protection)Best Protection against e-Threats (On a scale of 0 to 6, with 6 as the highest level of protection)"
105
105
  footnote="Overall Score. July 2011 – February 2025. Source AV TEST.org"
106
106
  footnote-href="${AV_TEST_URL}"
107
107
  icon-src="${SHIELD_ICON}"