@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
@@ -2,272 +2,271 @@ import { html } from 'lit';
2
2
  import './breadcrumb.js';
3
3
 
4
4
  export default {
5
- title : 'Components/Breadcrumb',
6
- component : 'bd-breadcrumb',
7
- subcomponents: { 'BreadcrumbItem': 'bd-breadcrumb-item' },
8
- tags : ['autodocs'],
9
- argTypes : {
5
+ title : 'Components/Breadcrumb',
6
+ tags : ['autodocs'],
7
+ parameters: {
8
+ docs: {
9
+ description: {
10
+ component: `
11
+ **Breadcrumb** and **BreadcrumbItem** are Lit web components for rendering accessible breadcrumb navigation.
12
+
13
+ Two elements are available:
14
+ - \`<bd-breadcrumb>\` — the nav container, handles responsive orientation and resize detection
15
+ - \`<bd-breadcrumb-item>\` — individual crumb items supporting links, current page, and dividers
16
+
17
+ ### Usage
18
+ \`\`\`html
19
+ <bd-breadcrumb>
20
+ <bd-breadcrumb-item href="/">Home</bd-breadcrumb-item>
21
+ <bd-breadcrumb-item href="/products">Products</bd-breadcrumb-item>
22
+ <bd-breadcrumb-item current>Total Security</bd-breadcrumb-item>
23
+ </bd-breadcrumb>
24
+ \`\`\`
25
+
26
+ ### Responsive Behavior
27
+ | Width | Layout |
28
+ |---|---|
29
+ | \`> mobileBreakpoint\` (default 768px) | Horizontal |
30
+ | \`≤ mobileBreakpoint\` | Vertical |
31
+
32
+ ### Item Rendering Logic
33
+ | Condition | Rendered as |
34
+ |---|---|
35
+ | \`current\` | \`<span>\` with \`aria-current="page"\` |
36
+ | \`href\` set | \`<bd-link>\` anchor |
37
+ | Neither | Plain \`<span>\` |
38
+
39
+ ### Divider Logic
40
+ - Divider \`/\` is shown after every non-current item unless \`no-trailing-slash\` is set on the container
41
+ `
42
+ }
43
+ }
44
+ },
45
+ argTypes: {
46
+ noTrailingSlash: {
47
+ control : 'boolean',
48
+ description: 'When true, hides the `/` divider after non-current items',
49
+ table : {
50
+ type : { summary: 'boolean' },
51
+ defaultValue: { summary: 'false' },
52
+ category : 'Breadcrumb'
53
+ }
54
+ },
10
55
  mobileBreakpoint: {
56
+ control : { type: 'number' },
57
+ description: 'Pixel width at which the layout switches from horizontal to vertical',
58
+ table : {
59
+ type : { summary: 'number' },
60
+ defaultValue: { summary: '768' },
61
+ category : 'Breadcrumb'
62
+ }
63
+ },
64
+ href: {
11
65
  control : 'text',
12
- description: 'Breakpoint for mobile responsive behavior',
66
+ description: 'URL for a breadcrumb item link',
13
67
  table : {
14
68
  type : { summary: 'string' },
15
- defaultValue: { summary: '768px' }
69
+ defaultValue: { summary: '' },
70
+ category : 'BreadcrumbItem'
71
+ }
72
+ },
73
+ current: {
74
+ control : 'boolean',
75
+ description: 'Marks this item as the current page. Renders as a `<span>` with `aria-current="page"`.',
76
+ table : {
77
+ type : { summary: 'boolean' },
78
+ defaultValue: { summary: 'false' },
79
+ category : 'BreadcrumbItem'
16
80
  }
17
81
  }
18
- },
82
+ }
83
+ };
84
+
85
+ // ─── Stories ───────────────────────────────────────────────────────────────
86
+
87
+ export const Default = {
88
+ name : 'Default (3 items)',
89
+ render: () => html`
90
+ <bd-breadcrumb>
91
+ <bd-breadcrumb-item href="/">Home</bd-breadcrumb-item>
92
+ <bd-breadcrumb-item href="/products">Products</bd-breadcrumb-item>
93
+ <bd-breadcrumb-item current>Total Security</bd-breadcrumb-item>
94
+ </bd-breadcrumb>
95
+ `,
19
96
  parameters: {
20
97
  docs: {
21
98
  description: {
22
- component: 'A navigation component that shows the current page location within a hierarchy. Supports responsive behavior and accessible navigation.'
99
+ story: 'Three-item breadcrumb: two linked items and one current page item. Dividers are shown after non-current items.'
23
100
  }
24
101
  }
25
102
  }
26
103
  };
27
104
 
28
- export const Default = () => html`
29
- <bd-breadcrumb>
30
- <bd-breadcrumb-item href="/">
31
- Home
32
- </bd-breadcrumb-item>
33
- <bd-breadcrumb-item href="/products">
34
- Products
35
- </bd-breadcrumb-item>
36
- <bd-breadcrumb-item href="/products/security">
37
- Security
38
- </bd-breadcrumb-item>
39
- <bd-breadcrumb-item current>
40
- Bitdefender Total Security
41
- </bd-breadcrumb-item>
42
- </bd-breadcrumb>
43
- `;
44
- Default.parameters = {
45
- docs: {
46
- description: {
47
- story: 'Default breadcrumb navigation showing a typical product hierarchy. The current page is marked with the `current` attribute and is not clickable.'
105
+ export const TwoItems = {
106
+ name : 'Two Items',
107
+ render: () => html`
108
+ <bd-breadcrumb>
109
+ <bd-breadcrumb-item href="/">Home</bd-breadcrumb-item>
110
+ <bd-breadcrumb-item current>Products</bd-breadcrumb-item>
111
+ </bd-breadcrumb>
112
+ `,
113
+ parameters: {
114
+ docs: {
115
+ description: {
116
+ story: 'Minimal two-item breadcrumb with one link and one current item.'
117
+ }
48
118
  }
49
119
  }
50
120
  };
51
121
 
52
- export const WithNestedLinks = () => html`
53
- <bd-breadcrumb>
54
- <bd-breadcrumb-item href="/">
55
- Home
56
- </bd-breadcrumb-item>
57
- <bd-breadcrumb-item href="/products">
58
- All Products
59
- </bd-breadcrumb-item>
60
- <bd-breadcrumb-item href="/products/security">
61
- Security Suite
62
- </bd-breadcrumb-item>
63
- <bd-breadcrumb-item current>
64
- Internet Security 2024
65
- </bd-breadcrumb-item>
66
- </bd-breadcrumb>
67
- `;
68
- WithNestedLinks.parameters = {
69
- docs: {
70
- description: {
71
- story: 'Breadcrumb with nested product categories demonstrating deep hierarchical navigation structure.'
122
+ export const DeepNesting = {
123
+ name : 'Deep Nesting (5 items)',
124
+ render: () => html`
125
+ <bd-breadcrumb>
126
+ <bd-breadcrumb-item href="/">Home</bd-breadcrumb-item>
127
+ <bd-breadcrumb-item href="/products">Products</bd-breadcrumb-item>
128
+ <bd-breadcrumb-item href="/products/security">Security</bd-breadcrumb-item>
129
+ <bd-breadcrumb-item href="/products/security/antivirus">Antivirus</bd-breadcrumb-item>
130
+ <bd-breadcrumb-item current>Bitdefender Total Security</bd-breadcrumb-item>
131
+ </bd-breadcrumb>
132
+ `,
133
+ parameters: {
134
+ docs: {
135
+ description: {
136
+ story: 'Five-level deep breadcrumb. Tests horizontal layout with many items and dividers.'
137
+ }
72
138
  }
73
139
  }
74
140
  };
75
141
 
76
- export const MixedItems = () => html`
77
- <bd-breadcrumb>
78
- <bd-breadcrumb-item href="/">
79
- Home
80
- </bd-breadcrumb-item>
81
- <bd-breadcrumb-item>
82
- Documentation
83
- </bd-breadcrumb-item>
84
- <bd-breadcrumb-item href="/docs/components">
85
- Components
86
- </bd-breadcrumb-item>
87
- <bd-breadcrumb-item current>
88
- Breadcrumb
89
- </bd-breadcrumb-item>
90
- </bd-breadcrumb>
91
- `;
92
- MixedItems.parameters = {
93
- docs: {
94
- description: {
95
- story: 'Breadcrumb with mixed navigation items - some are clickable links while others are non-clickable text nodes for intermediate hierarchy levels.'
142
+ export const NoTrailingSlash = {
143
+ name : 'No Trailing Slash',
144
+ render: () => html`
145
+ <bd-breadcrumb no-trailing-slash>
146
+ <bd-breadcrumb-item href="/">Home</bd-breadcrumb-item>
147
+ <bd-breadcrumb-item href="/products">Products</bd-breadcrumb-item>
148
+ <bd-breadcrumb-item current>Total Security</bd-breadcrumb-item>
149
+ </bd-breadcrumb>
150
+ `,
151
+ parameters: {
152
+ docs: {
153
+ description: {
154
+ story: '`no-trailing-slash` applied to the container. The `/` divider is hidden after all non-current items. The prop is propagated to each child item via `updateNoTrailingSlash()`.'
155
+ }
96
156
  }
97
157
  }
98
158
  };
99
159
 
100
- export const LongPath = () => html`
101
- <bd-breadcrumb>
102
- <bd-breadcrumb-item href="/">
103
- Home
104
- </bd-breadcrumb-item>
105
- <bd-breadcrumb-item href="/categories">
106
- Categories
107
- </bd-breadcrumb-item>
108
- <bd-breadcrumb-item href="/categories/technology">
109
- Technology
110
- </bd-breadcrumb-item>
111
- <bd-breadcrumb-item href="/categories/technology/software">
112
- Software
113
- </bd-breadcrumb-item>
114
- <bd-breadcrumb-item href="/categories/technology/software/security">
115
- Security Software
116
- </bd-breadcrumb-item>
117
- <bd-breadcrumb-item current>
118
- Bitdefender Internet Security Complete Edition
119
- </bd-breadcrumb-item>
120
- </bd-breadcrumb>
121
- `;
122
- LongPath.parameters = {
123
- docs: {
124
- description: {
125
- story: 'Breadcrumb with an extended hierarchical path showing how the component handles deep navigation structures and long product names.'
160
+ export const AllLinked = {
161
+ name : 'All Items Linked (no current)',
162
+ render: () => html`
163
+ <bd-breadcrumb>
164
+ <bd-breadcrumb-item href="/">Home</bd-breadcrumb-item>
165
+ <bd-breadcrumb-item href="/products">Products</bd-breadcrumb-item>
166
+ <bd-breadcrumb-item href="/products/security">Security</bd-breadcrumb-item>
167
+ </bd-breadcrumb>
168
+ `,
169
+ parameters: {
170
+ docs: {
171
+ description: {
172
+ story: 'All items have `href` set and none are `current`. All render as `<bd-link>` elements with dividers.'
173
+ }
126
174
  }
127
175
  }
128
176
  };
129
177
 
130
- export const MobileView = () => html`
131
- <div style="max-width: 400px; border: 1px solid #ccc; padding: 20px;">
132
- <bd-breadcrumb mobile-breakpoint="1200">
133
- <bd-breadcrumb-item href="/">
134
- Home
135
- </bd-breadcrumb-item>
136
- <bd-breadcrumb-item href="/products">
137
- Products
138
- </bd-breadcrumb-item>
139
- <bd-breadcrumb-item current>
140
- Current Page
141
- </bd-breadcrumb-item>
178
+ export const NoLinks = {
179
+ name : 'No Links (plain text items)',
180
+ render: () => html`
181
+ <bd-breadcrumb>
182
+ <bd-breadcrumb-item>Home</bd-breadcrumb-item>
183
+ <bd-breadcrumb-item>Products</bd-breadcrumb-item>
184
+ <bd-breadcrumb-item current>Total Security</bd-breadcrumb-item>
142
185
  </bd-breadcrumb>
143
- <p style="margin-top: 20px; font-size: 12px; color: #666;">
144
- This demo forces mobile view by setting breakpoint to 1200px.
145
- Resize window to see responsive behavior.
146
- </p>
147
- </div>
148
- `;
149
- MobileView.parameters = {
150
- docs: {
151
- description: {
152
- story: 'Mobile-optimized breadcrumb demonstration. The component automatically adapts to smaller screens by collapsing intermediate items when the viewport is below the specified breakpoint.'
186
+ `,
187
+ parameters: {
188
+ docs: {
189
+ description: {
190
+ story: 'Items without `href` or `current` render as plain `<span>` elements. The last item uses `current` for the active page indicator.'
191
+ }
153
192
  }
154
193
  }
155
194
  };
156
195
 
157
- export const EcommerceExample = () => html`
158
- <bd-breadcrumb>
159
- <bd-breadcrumb-item href="/">
160
- Home
161
- </bd-breadcrumb-item>
162
- <bd-breadcrumb-item href="/electronics">
163
- Electronics
164
- </bd-breadcrumb-item>
165
- <bd-breadcrumb-item href="/electronics/computers">
166
- Computers & Tablets
167
- </bd-breadcrumb-item>
168
- <bd-breadcrumb-item href="/electronics/computers/laptops">
169
- Laptops
170
- </bd-breadcrumb-item>
171
- <bd-breadcrumb-item current>
172
- Gaming Laptops - High Performance
173
- </bd-breadcrumb-item>
174
- </bd-breadcrumb>
175
- `;
176
- EcommerceExample.parameters = {
177
- docs: {
178
- description: {
179
- story: 'E-commerce style breadcrumb showing typical product categorization hierarchy commonly used in online shopping platforms.'
196
+ export const SingleItem = {
197
+ name : 'Single Item (edge case)',
198
+ render: () => html`
199
+ <bd-breadcrumb>
200
+ <bd-breadcrumb-item current>Home</bd-breadcrumb-item>
201
+ </bd-breadcrumb>
202
+ `,
203
+ parameters: {
204
+ docs: {
205
+ description: {
206
+ story: 'Edge case: only one item marked as current. No divider is shown.'
207
+ }
180
208
  }
181
209
  }
182
210
  };
183
211
 
184
- export const DocumentationExample = () => html`
185
- <bd-breadcrumb>
186
- <bd-breadcrumb-item href="/">
187
- Home
188
- </bd-breadcrumb-item>
189
- <bd-breadcrumb-item href="/help">
190
- Help Center
191
- </bd-breadcrumb-item>
192
- <bd-breadcrumb-item href="/help/getting-started">
193
- Getting Started
194
- </bd-breadcrumb-item>
195
- <bd-breadcrumb-item href="/help/getting-started/installation">
196
- Installation Guide
197
- </bd-breadcrumb-item>
198
- <bd-breadcrumb-item current>
199
- Troubleshooting
200
- </bd-breadcrumb-item>
201
- </bd-breadcrumb>
202
- `;
203
- DocumentationExample.parameters = {
204
- docs: {
205
- description: {
206
- story: 'Documentation site breadcrumb demonstrating hierarchical navigation through help articles and documentation sections.'
212
+ export const MobileVertical = {
213
+ name : 'Mobile — Vertical Layout',
214
+ render: () => html`
215
+ <bd-breadcrumb>
216
+ <bd-breadcrumb-item href="/">Home</bd-breadcrumb-item>
217
+ <bd-breadcrumb-item href="/products">Products</bd-breadcrumb-item>
218
+ <bd-breadcrumb-item current>Total Security</bd-breadcrumb-item>
219
+ </bd-breadcrumb>
220
+ `,
221
+ parameters: {
222
+ viewport: { defaultViewport: 'mobile1' },
223
+ docs : {
224
+ description: {
225
+ story: 'At 375px, the component detects mobile width (≤768px) and switches to a vertical layout via the `bd-breadcrumb--vertical` class.'
226
+ }
207
227
  }
208
228
  }
209
229
  };
210
230
 
211
- export const AccessibilityExample = () => html`
212
- <bd-breadcrumb aria-label="Breadcrumb navigation">
213
- <bd-breadcrumb-item href="/">
214
- Home
215
- </bd-breadcrumb-item>
216
- <bd-breadcrumb-item href="/accessibility">
217
- Accessibility
218
- </bd-breadcrumb-item>
219
- <bd-breadcrumb-item href="/accessibility/components">
220
- Components
221
- </bd-breadcrumb-item>
222
- <bd-breadcrumb-item current>
223
- Breadcrumb Best Practices
224
- </bd-breadcrumb-item>
225
- </bd-breadcrumb>
226
-
227
- <div style="margin-top: 2rem; padding: 1rem; background: #f5f5f5; border-radius: 4px;">
228
- <h4 style="margin-top: 0;">Accessibility Features</h4>
229
- <ul style="margin-bottom: 0;">
230
- <li><strong>ARIA landmarks:</strong> Proper navigation role with aria-label</li>
231
- <li><strong>Current page indication:</strong> aria-current="page" for active item</li>
232
- <li><strong>Keyboard navigation:</strong> All links are keyboard accessible</li>
233
- <li><strong>Semantic structure:</strong> Clear hierarchy for screen readers</li>
234
- </ul>
235
- </div>
236
- `;
237
- AccessibilityExample.parameters = {
238
- docs: {
239
- description: {
240
- story: 'Accessibility-focused breadcrumb example demonstrating proper ARIA attributes and semantic HTML structure for screen reader compatibility and keyboard navigation.'
231
+ export const CustomMobileBreakpoint = {
232
+ name : 'Custom Mobile Breakpoint (480px)',
233
+ render: () => html`
234
+ <bd-breadcrumb mobile-breakpoint="480">
235
+ <bd-breadcrumb-item href="/">Home</bd-breadcrumb-item>
236
+ <bd-breadcrumb-item href="/products">Products</bd-breadcrumb-item>
237
+ <bd-breadcrumb-item current>Total Security</bd-breadcrumb-item>
238
+ </bd-breadcrumb>
239
+ `,
240
+ parameters: {
241
+ docs: {
242
+ description: {
243
+ story: '`mobile-breakpoint` set to 480px instead of the default 768px. Layout switches to vertical only at very small widths.'
244
+ }
241
245
  }
242
246
  }
243
247
  };
244
248
 
245
- // Template for interactive controls
246
- const BreadcrumbTemplate = ({ mobileBreakpoint }) => html`
247
- <bd-breadcrumb mobile-breakpoint="${mobileBreakpoint}">
248
- <bd-breadcrumb-item href="/">
249
- Home
250
- </bd-breadcrumb-item>
251
- <bd-breadcrumb-item href="/products">
252
- Products
253
- </bd-breadcrumb-item>
254
- <bd-breadcrumb-item href="/products/security">
255
- Security
256
- </bd-breadcrumb-item>
257
- <bd-breadcrumb-item current>
258
- Current Product
259
- </bd-breadcrumb-item>
260
- </bd-breadcrumb>
261
- `;
262
-
263
- export const InteractiveExample = BreadcrumbTemplate.bind({});
264
- InteractiveExample.args = {
265
- mobileBreakpoint: '768px'
266
- };
267
- InteractiveExample.parameters = {
268
- docs: {
269
- description: {
270
- story: 'Interactive breadcrumb example. Use the controls panel to adjust the mobile breakpoint and see how it affects the responsive behavior.'
249
+ export const Playground = {
250
+ name: '🛝 Playground',
251
+ args: {
252
+ noTrailingSlash : false,
253
+ mobileBreakpoint: 768
254
+ },
255
+ render: (args) => html`
256
+ <bd-breadcrumb
257
+ ?no-trailing-slash="${args.noTrailingSlash}"
258
+ mobile-breakpoint="${args.mobileBreakpoint}"
259
+ >
260
+ <bd-breadcrumb-item href="/">Home</bd-breadcrumb-item>
261
+ <bd-breadcrumb-item href="/products">Products</bd-breadcrumb-item>
262
+ <bd-breadcrumb-item current>Total Security</bd-breadcrumb-item>
263
+ </bd-breadcrumb>
264
+ `,
265
+ parameters: {
266
+ docs: {
267
+ description: {
268
+ story: 'Interactive playground. Toggle `no-trailing-slash` and adjust `mobile-breakpoint` via Controls.'
269
+ }
271
270
  }
272
271
  }
273
272
  };