@repobit/dex-system-design 0.19.1 → 0.20.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.
@@ -0,0 +1,79 @@
1
+ import { LitElement, html } from "lit";
2
+ import { tokens } from "../../tokens/tokens.js";
3
+ import carouselCSS from "./card.css.js";
4
+
5
+ class Card 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 CardItem extends LitElement {
34
+ static properties = {
35
+ title: { type: String },
36
+ icon : { type: String },
37
+ align: { type: String }
38
+ };
39
+
40
+ constructor() {
41
+ super();
42
+ this.title = "";
43
+ this.icon = "";
44
+ this.align = "start";
45
+ }
46
+
47
+ render() {
48
+ const isCentered = this.align === "center";
49
+ const hasContent = this.innerHTML.trim() !== '';
50
+
51
+ return html`
52
+ <div class="bd-light-box-s ${isCentered ? 'bd-light-box-center' : ''} ${!hasContent ? 'bd-light-box-no-content' : ''}">
53
+ <div class="bd-light-box-header-s ${isCentered ? 'bd-light-box-header-center' : ''}">
54
+ ${this.icon
55
+ ? html`<img
56
+ src="${this.icon}"
57
+ alt="icon"
58
+ class="bd-light-icon-s"
59
+ />`
60
+ : ""}
61
+ </div>
62
+ ${this.title
63
+ ? html`
64
+ <div class="bd-light-title-badge-wrapper-s ${!hasContent ? 'bd-light-title-no-content' : ''}">
65
+ <h3>${this.title}</h3>
66
+ </div>
67
+ `
68
+ : ""}
69
+ <slot></slot>
70
+ </div>
71
+ `;
72
+ }
73
+ }
74
+
75
+ Card.styles = [tokens, carouselCSS];
76
+ CardItem.styles = [tokens, carouselCSS];
77
+
78
+ customElements.define("bd-card-item", CardItem);
79
+ customElements.define("bd-card-section", Card);
@@ -0,0 +1,512 @@
1
+ import { html } from 'lit';
2
+ import './card.js';
3
+
4
+ export default {
5
+ title : 'Components/Card',
6
+ component : 'bd-card-section',
7
+ subcomponents: { 'bd-card-item': 'bd-card-item' },
8
+ argTypes : {
9
+ title: {
10
+ control : 'text',
11
+ description: 'Section title (optional)'
12
+ },
13
+ align: {
14
+ control : { type: 'select' },
15
+ options : ['start', 'center'],
16
+ description: 'Content alignment for card items'
17
+ }
18
+ }
19
+ };
20
+
21
+ const Template = (args) => html`
22
+ <bd-card-section title="${args.title}">
23
+ <bd-card-item
24
+ title="Scam Copilot Chatbot"
25
+ icon="/assets/device_protection.png"
26
+ align="${args.align}"
27
+ >
28
+ <p>
29
+ Specialized AI chatbot that helps you identify suspicious online
30
+ interactions so you don't become a victim.
31
+ </p>
32
+ </bd-card-item>
33
+
34
+ <bd-card-item
35
+ title="Privacy Protection"
36
+ icon="/assets/privacy_protection.png"
37
+ align="${args.align}"
38
+ >
39
+ <p>
40
+ Specialized AI chatbot that helps you identify suspicious online
41
+ interactions so you don't become a victim.
42
+ </p>
43
+ </bd-card-item>
44
+
45
+ <bd-card-item
46
+ title="Scam Wave Alerts"
47
+ icon="/assets/identity_protection.png"
48
+ align="${args.align}"
49
+ >
50
+ <p>
51
+ Stay informed with real-time alerts about ongoing scam outbreaks
52
+ detected in your area automatically.
53
+ </p>
54
+ </bd-card-item>
55
+
56
+ <bd-card-item
57
+ title="Online Scam Protection"
58
+ icon="/assets/financial_insurance.png"
59
+ align="${args.align}"
60
+ >
61
+ <p>
62
+ Focused on browsing activities, it specializes in detecting the newest
63
+ scam patterns and tactics.
64
+ </p>
65
+ </bd-card-item>
66
+ </bd-card-section>
67
+ `;
68
+
69
+ export const Default = Template.bind({});
70
+ Default.args = {
71
+ title: 'Security Features',
72
+ align: 'start'
73
+ };
74
+
75
+ export const CenterAligned = Template.bind({});
76
+ CenterAligned.args = {
77
+ title: 'Security Features - Centered',
78
+ align: 'center'
79
+ };
80
+
81
+ export const IconTitleOnly = () => html`
82
+ <bd-card-section title="Icon + Title Only Cards">
83
+ <bd-card-item
84
+ title="Device Protection"
85
+ icon="/assets/device_protection.png"
86
+ align="start"
87
+ ></bd-card-item>
88
+
89
+ <bd-card-item
90
+ title="Privacy Shield"
91
+ icon="/assets/privacy_protection.png"
92
+ align="start"
93
+ ></bd-card-item>
94
+
95
+ <bd-card-item
96
+ title="Identity Guard"
97
+ icon="/assets/identity_protection.png"
98
+ align="start"
99
+ ></bd-card-item>
100
+
101
+ <bd-card-item
102
+ title="Financial Safety"
103
+ icon="/assets/financial_insurance.png"
104
+ align="start"
105
+ ></bd-card-item>
106
+ </bd-card-section>
107
+ `;
108
+
109
+ export const IconTitleOnlyCentered = () => html`
110
+ <bd-card-section title="Icon + Title Only - Centered">
111
+ <bd-card-item
112
+ title="Device Protection"
113
+ icon="/assets/device_protection.png"
114
+ align="center"
115
+ ></bd-card-item>
116
+
117
+ <bd-card-item
118
+ title="Privacy Shield"
119
+ icon="/assets/privacy_protection.png"
120
+ align="center"
121
+ ></bd-card-item>
122
+
123
+ <bd-card-item
124
+ title="Identity Guard"
125
+ icon="/assets/identity_protection.png"
126
+ align="center"
127
+ ></bd-card-item>
128
+
129
+ <bd-card-item
130
+ title="Financial Safety"
131
+ icon="/assets/financial_insurance.png"
132
+ align="center"
133
+ ></bd-card-item>
134
+ </bd-card-section>
135
+ `;
136
+
137
+ export const MixedContentTypes = () => html`
138
+ <bd-card-section title="Mixed Content Types">
139
+ <bd-card-item
140
+ title="With Description"
141
+ icon="/assets/device_protection.png"
142
+ align="start"
143
+ >
144
+ <p>This card has both icon, title and description text below.</p>
145
+ </bd-card-item>
146
+
147
+ <bd-card-item
148
+ title="Icon + Title Only"
149
+ icon="/assets/privacy_protection.png"
150
+ align="start"
151
+ ></bd-card-item>
152
+
153
+ <bd-card-item
154
+ title="Another With Description"
155
+ icon="/assets/identity_protection.png"
156
+ align="start"
157
+ >
158
+ <p>This card includes detailed description about the feature.</p>
159
+ </bd-card-item>
160
+
161
+ <bd-card-item
162
+ title="Another Icon Only"
163
+ icon="/assets/financial_insurance.png"
164
+ align="start"
165
+ ></bd-card-item>
166
+ </bd-card-section>
167
+ `;
168
+
169
+ export const MixedContentTypesCentered = () => html`
170
+ <bd-card-section title="Mixed Content Types - Centered">
171
+ <bd-card-item
172
+ title="With Description"
173
+ icon="/assets/device_protection.png"
174
+ align="center"
175
+ >
176
+ <p>This card has both icon, title and description text below.</p>
177
+ </bd-card-item>
178
+
179
+ <bd-card-item
180
+ title="Icon + Title Only"
181
+ icon="/assets/privacy_protection.png"
182
+ align="center"
183
+ ></bd-card-item>
184
+
185
+ <bd-card-item
186
+ title="Another With Description"
187
+ icon="/assets/identity_protection.png"
188
+ align="center"
189
+ >
190
+ <p>This card includes detailed description about the feature.</p>
191
+ </bd-card-item>
192
+
193
+ <bd-card-item
194
+ title="Another Icon Only"
195
+ icon="/assets/financial_insurance.png"
196
+ align="center"
197
+ ></bd-card-item>
198
+ </bd-card-section>
199
+ `;
200
+
201
+ export const WithoutTitle = Template.bind({});
202
+ WithoutTitle.args = {
203
+ title: '',
204
+ align: 'start'
205
+ };
206
+
207
+ export const WithoutTitleCentered = Template.bind({});
208
+ WithoutTitleCentered.args = {
209
+ title: '',
210
+ align: 'center'
211
+ };
212
+
213
+ export const SingleCard = (args) => html`
214
+ <bd-card-section title="${args.title}">
215
+ <bd-card-item
216
+ title="${args.cardTitle}"
217
+ icon="${args.icon}"
218
+ align="${args.align}"
219
+ >
220
+ <p>${args.content}</p>
221
+ </bd-card-item>
222
+ </bd-card-section>
223
+ `;
224
+ SingleCard.args = {
225
+ title : 'Single Feature',
226
+ cardTitle: 'Scam Copilot Chatbot',
227
+ icon : '/assets/device_protection.png',
228
+ content : 'Specialized AI chatbot that helps you identify suspicious online interactions.',
229
+ align : 'start'
230
+ };
231
+
232
+ export const SingleCardCentered = SingleCard.bind({});
233
+ SingleCardCentered.args = {
234
+ ...SingleCard.args,
235
+ title: 'Single Feature - Centered',
236
+ align: 'center'
237
+ };
238
+
239
+ export const SingleCardNoContent = (args) => html`
240
+ <bd-card-section title="${args.title}">
241
+ <bd-card-item
242
+ title="${args.cardTitle}"
243
+ icon="${args.icon}"
244
+ align="${args.align}"
245
+ ></bd-card-item>
246
+ </bd-card-section>
247
+ `;
248
+ SingleCardNoContent.args = {
249
+ title : 'Single Feature - Icon + Title Only',
250
+ cardTitle: 'Device Protection',
251
+ icon : '/assets/device_protection.png',
252
+ align : 'start'
253
+ };
254
+
255
+ export const SingleCardNoContentCentered = SingleCardNoContent.bind({});
256
+ SingleCardNoContentCentered.args = {
257
+ ...SingleCardNoContent.args,
258
+ title: 'Single Feature - Icon + Title Only - Centered',
259
+ align: 'center'
260
+ };
261
+
262
+ export const MultipleCardsGrid = (args) => html`
263
+ <bd-card-section title="${args.title}">
264
+ ${Array.from({ length: args.cardCount }, (_, i) => html`
265
+ <bd-card-item
266
+ title="${args.cardTitle} ${i + 1}"
267
+ icon="${args.icon}"
268
+ align="${args.align}"
269
+ >
270
+ <p>${args.content} This is card number ${i + 1}.</p>
271
+ </bd-card-item>
272
+ `)}
273
+ </bd-card-section>
274
+ `;
275
+ MultipleCardsGrid.args = {
276
+ title : 'Multiple Security Features',
277
+ cardTitle: 'Security Feature',
278
+ icon : '/assets/device_protection.png',
279
+ content : 'Description for this security feature.',
280
+ cardCount: 6,
281
+ align : 'start'
282
+ };
283
+
284
+ export const MultipleCardsGridCentered = MultipleCardsGrid.bind({});
285
+ MultipleCardsGridCentered.args = {
286
+ ...MultipleCardsGrid.args,
287
+ title: 'Multiple Security Features - Centered',
288
+ align: 'center'
289
+ };
290
+
291
+ export const CardItemVariations = () => html`
292
+ <div style="display: flex; flex-direction: column; gap: 3rem;">
293
+ <!-- Start Aligned Variations -->
294
+ <bd-card-section title="Card Item Variations - Start Aligned">
295
+ <bd-card-item
296
+ title="With Icon and Title"
297
+ icon="/assets/device_protection.png"
298
+ align="start"
299
+ >
300
+ <p>This card has both an icon and a title with description.</p>
301
+ </bd-card-item>
302
+
303
+ <bd-card-item
304
+ title="Icon + Title Only"
305
+ icon="/assets/device_protection.png"
306
+ align="start"
307
+ ></bd-card-item>
308
+
309
+ <bd-card-item
310
+ title="Title Only"
311
+ align="start"
312
+ >
313
+ <p>This card has only a title without an icon, aligned to start.</p>
314
+ </bd-card-item>
315
+
316
+ <bd-card-item
317
+ icon="/assets/privacy_protection.png"
318
+ align="start"
319
+ >
320
+ <p>This card has only an icon without a title, aligned to start.</p>
321
+ </bd-card-item>
322
+
323
+ <bd-card-item align="start">
324
+ <p>This card has neither icon nor title - just content, aligned to start.</p>
325
+ </bd-card-item>
326
+ </bd-card-section>
327
+
328
+ <!-- Center Aligned Variations -->
329
+ <bd-card-section title="Card Item Variations - Center Aligned">
330
+ <bd-card-item
331
+ title="With Icon and Title"
332
+ icon="/assets/device_protection.png"
333
+ align="center"
334
+ >
335
+ <p>This card has both an icon and a title with description.</p>
336
+ </bd-card-item>
337
+
338
+ <bd-card-item
339
+ title="Icon + Title Only"
340
+ icon="/assets/device_protection.png"
341
+ align="center"
342
+ ></bd-card-item>
343
+
344
+ <bd-card-item
345
+ title="Title Only"
346
+ align="center"
347
+ >
348
+ <p>This card has only a title without an icon, centered alignment.</p>
349
+ </bd-card-item>
350
+
351
+ <bd-card-item
352
+ icon="/assets/privacy_protection.png"
353
+ align="center"
354
+ >
355
+ <p>This card has only an icon without a title, centered alignment.</p>
356
+ </bd-card-item>
357
+
358
+ <bd-card-item align="center">
359
+ <p>This card has neither icon nor title - just content, centered alignment.</p>
360
+ </bd-card-item>
361
+ </bd-card-section>
362
+ </div>
363
+ `;
364
+
365
+ export const LongContent = () => html`
366
+ <div style="display: flex; flex-direction: column; gap: 3rem;">
367
+ <!-- Start Aligned Long Content -->
368
+ <bd-card-section title="Cards with Long Content - Start Aligned">
369
+ <bd-card-item
370
+ title="Feature with Detailed Description"
371
+ icon="/assets/identity_protection.png"
372
+ align="start"
373
+ >
374
+ <p>
375
+ This is a much longer description that might wrap across multiple lines.
376
+ It provides comprehensive details about the feature, its benefits,
377
+ and how it helps protect users from various types of online threats
378
+ and scams in today's digital landscape.
379
+ </p>
380
+ <p>
381
+ Additional paragraph to demonstrate how multiple paragraphs of content
382
+ would appear within the card component.
383
+ </p>
384
+ </bd-card-item>
385
+
386
+ <bd-card-item
387
+ title="Very Long Title That Might Wrap to Multiple Lines"
388
+ icon="/assets/financial_insurance.png"
389
+ align="start"
390
+ >
391
+ <p>Regular content with an exceptionally long title, aligned to start.</p>
392
+ </bd-card-item>
393
+ </bd-card-section>
394
+
395
+ <!-- Center Aligned Long Content -->
396
+ <bd-card-section title="Cards with Long Content - Center Aligned">
397
+ <bd-card-item
398
+ title="Feature with Detailed Description"
399
+ icon="/assets/identity_protection.png"
400
+ align="center"
401
+ >
402
+ <p>
403
+ This is a much longer description that might wrap across multiple lines.
404
+ It provides comprehensive details about the feature, its benefits,
405
+ and how it helps protect users from various types of online threats
406
+ and scams in today's digital landscape.
407
+ </p>
408
+ <p>
409
+ Additional paragraph to demonstrate how multiple paragraphs of content
410
+ would appear within the card component.
411
+ </p>
412
+ </bd-card-item>
413
+
414
+ <bd-card-item
415
+ title="Very Long Title That Might Wrap to Multiple Lines"
416
+ icon="/assets/financial_insurance.png"
417
+ align="center"
418
+ >
419
+ <p>Regular content with an exceptionally long title, centered alignment.</p>
420
+ </bd-card-item>
421
+ </bd-card-section>
422
+ </div>
423
+ `;
424
+
425
+ export const MixedAlignment = () => html`
426
+ <bd-card-section title="Mixed Alignment Cards">
427
+ <bd-card-item
428
+ title="Start Aligned Card"
429
+ icon="/assets/device_protection.png"
430
+ align="start"
431
+ >
432
+ <p>This card is left aligned with content starting from the left side.</p>
433
+ <p>Perfect for longer text content that reads better when left aligned.</p>
434
+ </bd-card-item>
435
+
436
+ <bd-card-item
437
+ title="Center Aligned Card"
438
+ icon="/assets/privacy_protection.png"
439
+ align="center"
440
+ >
441
+ <p>This card is center aligned with everything centered.</p>
442
+ <p>Great for highlight features or call-to-action cards.</p>
443
+ </bd-card-item>
444
+
445
+ <bd-card-item
446
+ title="Another Start Aligned"
447
+ icon="/assets/identity_protection.png"
448
+ align="start"
449
+ >
450
+ <p>Another left aligned card with detailed description.</p>
451
+ </bd-card-item>
452
+
453
+ <bd-card-item
454
+ title="Another Center Aligned"
455
+ icon="/assets/financial_insurance.png"
456
+ align="center"
457
+ >
458
+ <p>Another center aligned card for balanced presentation.</p>
459
+ </bd-card-item>
460
+ </bd-card-section>
461
+ `;
462
+
463
+ export const AlignmentComparison = () => html`
464
+ <bd-card-section title="Alignment Comparison">
465
+ <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 2rem;">
466
+ <div>
467
+ <h3 style="text-align: center; color: #333;">Start Aligned</h3>
468
+ <bd-card-item
469
+ title="Start Aligned Example"
470
+ icon="/assets/device_protection.png"
471
+ align="start"
472
+ >
473
+ <p>This card shows start alignment where content begins from the left.</p>
474
+ <p>Ideal for readability and longer text content.</p>
475
+ </bd-card-item>
476
+ </div>
477
+ <div>
478
+ <h3 style="text-align: center; color: #333;">Center Aligned</h3>
479
+ <bd-card-item
480
+ title="Center Aligned Example"
481
+ icon="/assets/device_protection.png"
482
+ align="center"
483
+ >
484
+ <p>This card shows center alignment with balanced presentation.</p>
485
+ <p>Perfect for feature highlights and visual balance.</p>
486
+ </bd-card-item>
487
+ </div>
488
+ </div>
489
+ </bd-card-section>
490
+ `;
491
+
492
+ export const ResponsiveAlignment = () => html`
493
+ <bd-card-section title="Responsive Alignment Examples">
494
+ <bd-card-item
495
+ title="Responsive Start Aligned"
496
+ icon="/assets/device_protection.png"
497
+ align="start"
498
+ >
499
+ <p>This card maintains start alignment across all screen sizes.</p>
500
+ <p>On mobile devices, the content will still be aligned to the start.</p>
501
+ </bd-card-item>
502
+
503
+ <bd-card-item
504
+ title="Responsive Center Aligned"
505
+ icon="/assets/privacy_protection.png"
506
+ align="center"
507
+ >
508
+ <p>This card maintains center alignment across all screen sizes.</p>
509
+ <p>On mobile devices, the content will remain centered for consistency.</p>
510
+ </bd-card-item>
511
+ </bd-card-section>
512
+ `;