@repobit/dex-system-design 0.22.12 → 0.23.2

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 (39) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/package.json +4 -3
  3. package/src/components/Button/button.stories.js +292 -120
  4. package/src/components/accordion/accordion-bg.css.js +7 -2
  5. package/src/components/accordion/accordion-bg.stories.js +268 -449
  6. package/src/components/accordion/accordion.stories.js +259 -265
  7. package/src/components/anchor/anchor.stories.js +160 -159
  8. package/src/components/awards/awards-icon.js +44 -0
  9. package/src/components/awards/awards.css.js +328 -0
  10. package/src/components/awards/awards.js +224 -0
  11. package/src/components/awards/awards.stories.js +447 -0
  12. package/src/components/back/back.stories.js +100 -375
  13. package/src/components/badge/badge.stories.js +241 -129
  14. package/src/components/breadcrumb/breadcrumb.stories.js +218 -219
  15. package/src/components/cards/card.stories.js +174 -622
  16. package/src/components/carousel/carousel.stories.js +196 -225
  17. package/src/components/checkbox/checkbox.stories.js +136 -51
  18. package/src/components/compare/compare.css.js +237 -0
  19. package/src/components/compare/compare.js +253 -0
  20. package/src/components/compare/compare.stories.js +372 -0
  21. package/src/components/display/display.stories.js +91 -297
  22. package/src/components/divider/divider.stories.js +160 -342
  23. package/src/components/footer/footer.stories.js +177 -402
  24. package/src/components/header/header.stories.js +130 -338
  25. package/src/components/heading/heading.js +8 -5
  26. package/src/components/heading/heading.stories.js +162 -471
  27. package/src/components/highlight/highlight.stories.js +153 -38
  28. package/src/components/image/image.stories.js +135 -563
  29. package/src/components/input/custom-form.stories.js +761 -224
  30. package/src/components/link/link.js +29 -12
  31. package/src/components/link/link.stories.js +130 -468
  32. package/src/components/modal/modal.stories.js +174 -28
  33. package/src/components/paragraph/paragraph.css.js +10 -1
  34. package/src/components/paragraph/paragraph.stories.js +85 -410
  35. package/src/components/picture/picture.stories.js +147 -561
  36. package/src/components/radio/radio.stories.js +230 -81
  37. package/src/components/tabs/tabs.stories.js +126 -10
  38. package/src/components/termsOfUse/terms.stories.js +223 -8
  39. package/src/tokens/tokens.js +1 -0
@@ -0,0 +1,372 @@
1
+ import { html } from "lit";
2
+ import "./compare.js";
3
+
4
+ // ─── Asset paths ──────────────────────────────────────────────────────────────
5
+
6
+ const SHIELD_ICON = "/assets/shield-check.png";
7
+ const SPEEDOMETER_ICON = "/assets/speedometer.png";
8
+ const REPAIR_ICON = "/assets/speedometer.png"; // swap for a repair asset when available
9
+
10
+ const AV_TEST_URL = "https://www.av-test.org/en/antivirus/home-users/";
11
+
12
+ // ─── Meta ─────────────────────────────────────────────────────────────────────
13
+
14
+ export default {
15
+ title : "Components/CompareSection",
16
+ tags : ["autodocs"],
17
+ parameters: {
18
+ layout: "fullscreen",
19
+ docs : {
20
+ description: {
21
+ component: `
22
+ Three Lit Element web components for building customizable comparison sections.
23
+
24
+ \`\`\`html
25
+ <bd-compare-section title="How Bitdefender Compares To Other Cybersecurity Brands" gap="32px">
26
+
27
+ <compare-card
28
+ title="Best Protection"
29
+ description="Best Protection against e-Threats (On a scale of 0 to 6, with 6 as the highest level of protection)"
30
+ footnote="Overall Score. July 2011 – February 2025. Source AV TEST.org"
31
+ footnote-href="https://www.av-test.org/en/antivirus/home-users/"
32
+ icon-src="/assets/shield-check.png"
33
+ >
34
+ <compare-bar label="Bitdefender" score="5.95" max-score="6" variant="primary"></compare-bar>
35
+ <compare-bar label="Norton" score="5.59" max-score="6" variant="secondary"></compare-bar>
36
+ <compare-bar label="McAfee" score="5.45" max-score="6" variant="secondary"></compare-bar>
37
+ </compare-card>
38
+
39
+ <compare-card
40
+ title="Best Performance"
41
+ description="Lightest Impact on Performance (On a scale of 0 to 6, with 6 as the lightest level of impact)"
42
+ footnote="Overall Score. February 2013 - February 2025. Source AV TEST.org"
43
+ footnote-href="https://www.av-test.org/en/antivirus/home-users/"
44
+ icon-src="/assets/speedometer.png"
45
+ >
46
+ <compare-bar label="Bitdefender" score="5.86" max-score="6" variant="primary"></compare-bar>
47
+ <compare-bar label="Norton" score="5.59" max-score="6" variant="secondary"></compare-bar>
48
+ <compare-bar label="McAfee" score="5.53" max-score="6" variant="secondary"></compare-bar>
49
+ </compare-card>
50
+
51
+ </bd-compare-section>
52
+ \`\`\`
53
+
54
+ ### Attributes
55
+
56
+ #### \`bd-compare-section\`
57
+ | Attribute | Type | Default | Description |
58
+ |------------|----------|---------|--------------------------------------|
59
+ | \`title\` | String | — | Section heading |
60
+ | \`subtitle\` | String | — | Optional subheading |
61
+ | \`columns\` | Number | \`2\` | Number of columns |
62
+ | \`gap\` | String | — | Gap between cards e.g. \`"32px"\` |
63
+
64
+ #### \`compare-card\`
65
+ | Attribute | Type | Default | Description |
66
+ |-----------------|--------|---------|------------------------------------------|
67
+ | \`title\` | String | — | Card heading |
68
+ | \`description\` | String | — | Explanatory subtitle |
69
+ | \`footnote\` | String | — | Source text at the bottom |
70
+ | \`footnote-href\` | String | — | URL — links text after "Source " |
71
+ | \`icon-src\` | String | — | Path to icon asset |
72
+
73
+ #### \`compare-bar\`
74
+ | Attribute | Type | Default | Description |
75
+ |----------------|--------|---------------|--------------------------|
76
+ | \`label\` | String | — | Brand / product name |
77
+ | \`score\` | Number | — | Numeric score |
78
+ | \`max-score\` | Number | \`6\` | Max possible score |
79
+ | \`variant\` | String | \`secondary\` | \`primary\` or \`secondary\` |
80
+ | \`score-label\` | String | — | Override text for score |
81
+
82
+ ### CSS Custom Properties (all overridable on \`bd-compare-section\`)
83
+
84
+ | Property | Default | Description |
85
+ |---------------------------|----------------------|---------------------------|
86
+ | \`--cs-bg\` | \`#f5f6fa\` | Section background |
87
+ | \`--cs-gap\` | \`1.5rem\` | Gap between cards |
88
+ | \`--cs-bar-height\` | \`44px\` | Height of every bar |
89
+ | \`--cs-bar-radius\` | \`0.45rem\` | Bar corner radius |
90
+ | \`--cs-icon-color\` | \`var(--color-blue-500)\` | Card icon colour |
91
+ `
92
+ }
93
+ }
94
+ }
95
+ };
96
+
97
+ // ─── Default ─────────────────────────────────────────────────────────────────
98
+
99
+ export const Default = {
100
+ name : "Default (Bitdefender)",
101
+ render: () => html`
102
+ <bd-compare-section
103
+ title="How Bitdefender Compares To Other Cybersecurity Brands"
104
+ gap="32px"
105
+ >
106
+ <compare-card
107
+ title="Best Protection"
108
+ description="Best Protection against e-Threats (On a scale of 0 to 6, with 6 as the highest level of protection)"
109
+ footnote="Overall Score. July 2011 – February 2025. Source AV TEST.org"
110
+ footnote-href="${AV_TEST_URL}"
111
+ icon-src="${SHIELD_ICON}"
112
+ >
113
+ <compare-bar label="Bitdefender" score="5.95" max-score="6" variant="primary"></compare-bar>
114
+ <compare-bar label="Norton" score="5.59" max-score="6" variant="secondary"></compare-bar>
115
+ <compare-bar label="McAfee" score="5.45" max-score="6" variant="secondary"></compare-bar>
116
+ </compare-card>
117
+
118
+ <compare-card
119
+ title="Best Performance"
120
+ description="Lightest Impact on Performance (On a scale of 0 to 6, with 6 as the lightest level of impact)"
121
+ footnote="Overall Score. February 2013 - February 2025. Source AV TEST.org"
122
+ footnote-href="${AV_TEST_URL}"
123
+ icon-src="${SPEEDOMETER_ICON}"
124
+ >
125
+ <compare-bar label="Bitdefender" score="5.86" max-score="6" variant="primary"></compare-bar>
126
+ <compare-bar label="Norton" score="5.59" max-score="6" variant="secondary"></compare-bar>
127
+ <compare-bar label="McAfee" score="5.53" max-score="6" variant="secondary"></compare-bar>
128
+ </compare-card>
129
+ </bd-compare-section>
130
+ `
131
+ };
132
+
133
+ // ─── Three columns ────────────────────────────────────────────────────────────
134
+
135
+ export const ThreeColumns = {
136
+ name : "Three Columns",
137
+ render: () => html`
138
+ <bd-compare-section
139
+ title="Full Security Benchmark"
140
+ subtitle="Independent testing data across all major categories."
141
+ columns="3"
142
+ gap="32px"
143
+ >
144
+ <compare-card
145
+ title="Best Protection"
146
+ description="Scale of 0–6. Higher is better."
147
+ footnote="Overall Score. July 2011 – February 2025. Source AV TEST.org"
148
+ footnote-href="${AV_TEST_URL}"
149
+ icon-src="${SHIELD_ICON}"
150
+ >
151
+ <compare-bar label="Bitdefender" score="5.95" max-score="6" variant="primary"></compare-bar>
152
+ <compare-bar label="Norton" score="5.89" max-score="6" variant="secondary"></compare-bar>
153
+ <compare-bar label="McAfee" score="5.45" max-score="6" variant="secondary"></compare-bar>
154
+ </compare-card>
155
+
156
+ <compare-card
157
+ title="Best Performance"
158
+ description="Scale of 0–6. Higher = lightest impact."
159
+ footnote="Overall Score. February 2013 - February 2025. Source AV TEST.org"
160
+ footnote-href="${AV_TEST_URL}"
161
+ icon-src="${SPEEDOMETER_ICON}"
162
+ >
163
+ <compare-bar label="Bitdefender" score="5.86" max-score="6" variant="primary"></compare-bar>
164
+ <compare-bar label="Norton" score="5.59" max-score="6" variant="secondary"></compare-bar>
165
+ <compare-bar label="McAfee" score="5.53" max-score="6" variant="secondary"></compare-bar>
166
+ </compare-card>
167
+
168
+ <compare-card
169
+ title="Best Repair"
170
+ description="Ability to repair an infected system (0–6)."
171
+ footnote="Overall Score. 2020 – February 2025. Source AV TEST.org"
172
+ footnote-href="${AV_TEST_URL}"
173
+ icon-src="${REPAIR_ICON}"
174
+ >
175
+ <compare-bar label="Bitdefender" score="5.90" max-score="6" variant="primary"></compare-bar>
176
+ <compare-bar label="Kaspersky" score="5.75" max-score="6" variant="secondary"></compare-bar>
177
+ <compare-bar label="Norton" score="5.60" max-score="6" variant="secondary"></compare-bar>
178
+ </compare-card>
179
+ </bd-compare-section>
180
+ `
181
+ };
182
+
183
+ // ─── Single CompareCard ───────────────────────────────────────────────────────
184
+
185
+ export const SingleCard = {
186
+ name : "compare-card (isolated)",
187
+ render: () => html`
188
+ <div style="padding: 2rem; background: #f5f6fa; max-width: 480px;">
189
+ <compare-card
190
+ title="Best Protection"
191
+ description="Best Protection against e-Threats (On a scale of 0 to 6, with 6 as the highest level of protection)"
192
+ footnote="Overall Score. July 2011 – February 2025. Source AV TEST.org"
193
+ footnote-href="${AV_TEST_URL}"
194
+ icon-src="${SHIELD_ICON}"
195
+ >
196
+ <compare-bar label="Bitdefender" score="5.95" max-score="6" variant="primary"></compare-bar>
197
+ <compare-bar label="Norton" score="5.89" max-score="6" variant="secondary"></compare-bar>
198
+ <compare-bar label="McAfee" score="5.45" max-score="6" variant="secondary"></compare-bar>
199
+ </compare-card>
200
+ </div>
201
+ `
202
+ };
203
+
204
+ // ─── CompareBar showcase ──────────────────────────────────────────────────────
205
+
206
+ export const BarsShowcase = {
207
+ name : "compare-bar (isolated)",
208
+ render: () => html`
209
+ <div style="padding: 2rem; background: #f5f6fa; max-width: 480px;
210
+ display: flex; flex-direction: column; gap: 0.75rem;">
211
+ <compare-bar label="Primary bar (blue)" score="5.95" max-score="6" variant="primary"></compare-bar>
212
+ <compare-bar label="Secondary bar (grey)" score="5.50" max-score="6" variant="secondary"></compare-bar>
213
+ <compare-bar label="Low score" score="2.10" max-score="6" variant="secondary"></compare-bar>
214
+ <compare-bar label="Perfect score" score="6" max-score="6" variant="primary" score-label="6 / 6"></compare-bar>
215
+ </div>
216
+ `
217
+ };
218
+
219
+ // ─── No heading ───────────────────────────────────────────────────────────────
220
+
221
+ export const NoHeading = {
222
+ name : "No Section Heading",
223
+ render: () => html`
224
+ <bd-compare-section gap="32px">
225
+ <compare-card
226
+ title="Protection"
227
+ description="Scale 0–6."
228
+ footnote="Overall Score. July 2011 – February 2025. Source AV TEST.org"
229
+ footnote-href="${AV_TEST_URL}"
230
+ icon-src="${SHIELD_ICON}"
231
+ >
232
+ <compare-bar label="Bitdefender" score="5.95" max-score="6" variant="primary"></compare-bar>
233
+ <compare-bar label="Competitor" score="5.20" max-score="6" variant="secondary"></compare-bar>
234
+ </compare-card>
235
+
236
+ <compare-card
237
+ title="Performance"
238
+ description="Scale 0–6."
239
+ footnote="Overall Score. February 2013 - February 2025. Source AV TEST.org"
240
+ footnote-href="${AV_TEST_URL}"
241
+ icon-src="${SPEEDOMETER_ICON}"
242
+ >
243
+ <compare-bar label="Bitdefender" score="5.86" max-score="6" variant="primary"></compare-bar>
244
+ <compare-bar label="Competitor" score="5.10" max-score="6" variant="secondary"></compare-bar>
245
+ </compare-card>
246
+ </bd-compare-section>
247
+ `
248
+ };
249
+
250
+ // ─── Custom bar height & radius ───────────────────────────────────────────────
251
+
252
+ export const CustomBarSize = {
253
+ name : "Custom Bar Height & Radius",
254
+ render: () => html`
255
+ <bd-compare-section
256
+ title="Tall bars, pill radius"
257
+ gap="32px"
258
+ style="
259
+ --cs-bar-height: 56px;
260
+ --cs-bar-radius: 999px;
261
+ "
262
+ >
263
+ <compare-card
264
+ title="Best Protection"
265
+ description="Scale 0–6."
266
+ footnote="Overall Score. July 2011 – February 2025. Source AV TEST.org"
267
+ footnote-href="${AV_TEST_URL}"
268
+ icon-src="${SHIELD_ICON}"
269
+ >
270
+ <compare-bar label="Bitdefender" score="5.95" max-score="6" variant="primary"></compare-bar>
271
+ <compare-bar label="Norton" score="5.89" max-score="6" variant="secondary"></compare-bar>
272
+ <compare-bar label="McAfee" score="5.45" max-score="6" variant="secondary"></compare-bar>
273
+ </compare-card>
274
+
275
+ <compare-card
276
+ title="Best Performance"
277
+ description="Scale 0–6."
278
+ footnote="Overall Score. February 2013 - February 2025. Source AV TEST.org"
279
+ footnote-href="${AV_TEST_URL}"
280
+ icon-src="${SPEEDOMETER_ICON}"
281
+ >
282
+ <compare-bar label="Bitdefender" score="5.86" max-score="6" variant="primary"></compare-bar>
283
+ <compare-bar label="Norton" score="5.59" max-score="6" variant="secondary"></compare-bar>
284
+ <compare-bar label="McAfee" score="5.53" max-score="6" variant="secondary"></compare-bar>
285
+ </compare-card>
286
+ </bd-compare-section>
287
+ `
288
+ };
289
+
290
+ // ─── Custom gap ───────────────────────────────────────────────────────────────
291
+
292
+ export const CustomGapTwoCards = {
293
+ name : "Custom Gap — 2 cards (16px)",
294
+ render: () => html`
295
+ <bd-compare-section
296
+ title="2 Columns — 16px gap"
297
+ columns="2"
298
+ gap="16px"
299
+ >
300
+ <compare-card
301
+ title="Best Protection"
302
+ description="Scale of 0–6. Higher is better."
303
+ footnote="Overall Score. July 2011 – February 2025. Source AV TEST.org"
304
+ footnote-href="${AV_TEST_URL}"
305
+ icon-src="${SHIELD_ICON}"
306
+ >
307
+ <compare-bar label="Bitdefender" score="5.95" max-score="6" variant="primary"></compare-bar>
308
+ <compare-bar label="Norton" score="5.59" max-score="6" variant="secondary"></compare-bar>
309
+ <compare-bar label="McAfee" score="5.45" max-score="6" variant="secondary"></compare-bar>
310
+ </compare-card>
311
+
312
+ <compare-card
313
+ title="Best Performance"
314
+ description="Scale of 0–6. Higher = lightest impact."
315
+ footnote="Overall Score. February 2013 - February 2025. Source AV TEST.org"
316
+ footnote-href="${AV_TEST_URL}"
317
+ icon-src="${SPEEDOMETER_ICON}"
318
+ >
319
+ <compare-bar label="Bitdefender" score="5.86" max-score="6" variant="primary"></compare-bar>
320
+ <compare-bar label="Norton" score="5.59" max-score="6" variant="secondary"></compare-bar>
321
+ <compare-bar label="McAfee" score="5.53" max-score="6" variant="secondary"></compare-bar>
322
+ </compare-card>
323
+ </bd-compare-section>
324
+ `
325
+ };
326
+
327
+ export const CustomGapThreeCards = {
328
+ name : "Custom Gap — 3 cards (12px)",
329
+ render: () => html`
330
+ <bd-compare-section
331
+ title="3 Columns — 12px gap"
332
+ columns="3"
333
+ gap="12px"
334
+ >
335
+ <compare-card
336
+ title="Best Protection"
337
+ description="Scale of 0–6. Higher is better."
338
+ footnote="Overall Score. July 2011 – February 2025. Source AV TEST.org"
339
+ footnote-href="${AV_TEST_URL}"
340
+ icon-src="${SHIELD_ICON}"
341
+ >
342
+ <compare-bar label="Bitdefender" score="5.95" max-score="6" variant="primary"></compare-bar>
343
+ <compare-bar label="Norton" score="5.89" max-score="6" variant="secondary"></compare-bar>
344
+ <compare-bar label="McAfee" score="5.45" max-score="6" variant="secondary"></compare-bar>
345
+ </compare-card>
346
+
347
+ <compare-card
348
+ title="Best Performance"
349
+ description="Scale of 0–6. Higher = lightest impact."
350
+ footnote="Overall Score. February 2013 - February 2025. Source AV TEST.org"
351
+ footnote-href="${AV_TEST_URL}"
352
+ icon-src="${SPEEDOMETER_ICON}"
353
+ >
354
+ <compare-bar label="Bitdefender" score="5.86" max-score="6" variant="primary"></compare-bar>
355
+ <compare-bar label="Norton" score="5.59" max-score="6" variant="secondary"></compare-bar>
356
+ <compare-bar label="McAfee" score="5.53" max-score="6" variant="secondary"></compare-bar>
357
+ </compare-card>
358
+
359
+ <compare-card
360
+ title="Best Repair"
361
+ description="Ability to repair an infected system (0–6)."
362
+ footnote="Overall Score. 2020 – February 2025. Source AV TEST.org"
363
+ footnote-href="${AV_TEST_URL}"
364
+ icon-src="${REPAIR_ICON}"
365
+ >
366
+ <compare-bar label="Bitdefender" score="5.90" max-score="6" variant="primary"></compare-bar>
367
+ <compare-bar label="Kaspersky" score="5.75" max-score="6" variant="secondary"></compare-bar>
368
+ <compare-bar label="Norton" score="5.60" max-score="6" variant="secondary"></compare-bar>
369
+ </compare-card>
370
+ </bd-compare-section>
371
+ `
372
+ };