@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
@@ -1,502 +1,193 @@
1
1
  import { html } from 'lit';
2
- import '../paragraph/paragraph.js';
3
2
  import './heading.js';
4
3
 
5
4
  export default {
6
- title : 'Atoms/Heading',
7
- component: 'bd-h',
8
- tags : ['autodocs'],
9
- argTypes : {
5
+ title : 'Components/Heading',
6
+ tags : ['autodocs'],
7
+ parameters: {
8
+ docs: {
9
+ description: {
10
+ component: `
11
+ **BdH** is a Lit heading component that renders semantic HTML heading elements (h1–h6) with configurable styling.
12
+
13
+ ### Usage
14
+ \`\`\`html
15
+ <bd-h as="h1">Page Title</bd-h>
16
+ <bd-h as="h3" color="#026DFF" font-weight="700" padding-bottom="16px">Section Title</bd-h>
17
+ \`\`\`
18
+
19
+ ### Valid Heading Tags
20
+ \`h1\`, \`h2\`, \`h3\`, \`h4\`, \`h5\`, \`h6\` — falls back to \`h1\` for invalid values.
21
+
22
+ ### Style Prop Validation
23
+ - **fontWeight**: accepts numeric strings (\`"100"\`–\`"900"\`) and keyword values (\`"normal"\`, \`"bold"\`, \`"lighter"\`, \`"bolder"\`)
24
+ - **color**: accepts \`var(--...)\`, \`#hex\`, \`rgb(...)\`, \`hsl(...)\` — rejects bare color names
25
+ - **padding / paddingBottom**: any valid CSS value string
26
+
27
+ ### Notes
28
+ - \`ariaLevel\` can override the implicit ARIA level for accessibility
29
+ - Styles are applied inline via \`_computeStyles()\`
30
+ `
31
+ }
32
+ }
33
+ },
34
+ argTypes: {
10
35
  as: {
11
36
  control : { type: 'select' },
12
37
  options : ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
13
- description: 'Semantic HTML heading level (h1-h6)',
14
- table : {
15
- type : { summary: 'string' },
16
- defaultValue: { summary: 'h2' }
17
- }
38
+ description: 'Which heading tag to render. Falls back to `h1` if invalid.',
39
+ table : { type: { summary: "'h1'|'h2'|'h3'|'h4'|'h5'|'h6'" }, defaultValue: { summary: 'h1' }, category: 'Semantic' }
18
40
  },
19
- color: {
20
- control : 'color',
21
- description: 'Custom text color for the heading',
22
- table : {
23
- type : { summary: 'string' },
24
- defaultValue: { summary: 'inherit' }
25
- }
41
+ ariaLevel: {
42
+ control : 'number',
43
+ description: 'Overrides the implicit ARIA level (e.g. for accessibility when visual level differs from semantic level)',
44
+ table : { type: { summary: 'number' }, defaultValue: { summary: 'null' }, category: 'Accessibility' }
26
45
  },
27
- align: {
28
- control : { type: 'select' },
29
- options : ['left', 'center', 'right'],
30
- description: 'Text alignment',
31
- table : {
32
- type : { summary: 'string' },
33
- defaultValue: { summary: 'left' }
34
- }
46
+ padding: {
47
+ control : 'text',
48
+ description: 'CSS padding shorthand applied inline',
49
+ table : { type: { summary: 'string' }, defaultValue: { summary: '' }, category: 'Spacing' }
35
50
  },
36
- content: {
51
+ paddingBottom: {
37
52
  control : 'text',
38
- description: 'Heading text content',
39
- table : {
40
- type : { summary: 'string' },
41
- defaultValue: { summary: 'Heading Text' }
42
- }
43
- }
44
- },
45
- parameters: {
46
- docs: {
47
- description: {
48
- component: 'A semantic heading component that provides proper HTML structure with consistent typography. Supports all heading levels from h1 to h6 with customizable styling.'
49
- }
53
+ description: 'CSS padding-bottom applied inline',
54
+ table : { type: { summary: 'string' }, defaultValue: { summary: '' }, category: 'Spacing' }
55
+ },
56
+ fontWeight: {
57
+ control : { type: 'select' },
58
+ options : ['', '100', '200', '300', '400', '500', '600', '700', '800', '900', 'normal', 'bold', 'lighter', 'bolder'],
59
+ description: 'Font weight applied inline. Invalid values are ignored.',
60
+ table : { type: { summary: 'string' }, defaultValue: { summary: '' }, category: 'Typography' }
61
+ },
62
+ color: {
63
+ control : 'color',
64
+ description: 'Text color. Must be a hex, rgb, hsl, or var() value.',
65
+ table : { type: { summary: 'string' }, defaultValue: { summary: '' }, category: 'Typography' }
50
66
  }
51
67
  }
52
68
  };
53
69
 
54
- const Template = ({ as, color, align, content }) => html`
55
- <bd-h
56
- as="${as}"
57
- style="${color ? `color: ${color};` : ''} ${align ? `text-align: ${align};` : ''}"
70
+ const render = (args) => html`
71
+ <bd-h
72
+ as="${args.as}"
73
+ padding="${args.padding}"
74
+ paddingBottom="${args.paddingBottom}"
75
+ fontWeight="${args.fontWeight}"
76
+ color="${args.color}"
58
77
  >
59
- ${content}
78
+ Sample Heading Text
60
79
  </bd-h>
61
80
  `;
62
81
 
63
- // ============ STORIES ============
64
-
65
- export const Default = Template.bind({});
66
- Default.args = {
67
- as : 'h2',
68
- content: 'Default Heading',
69
- color : '',
70
- align : 'left'
71
- };
72
- Default.parameters = {
73
- docs: {
74
- description: {
75
- story: 'Default heading component with h2 level. Perfect for most section titles and content headings.'
76
- }
77
- }
78
- };
79
-
80
- export const AllHeadingLevels = () => html`
81
- <div style="display: flex; flex-direction: column; gap: 2rem; max-width: 800px; margin: 0 auto; padding: 2rem;">
82
- <bd-h as="h1" style="margin-bottom: 0.5rem;">Heading Level 1 - Main Title</bd-h>
83
- <bd-p kind="small" style="color: #64748b; margin-bottom: 1rem;">
84
- <strong>Use case:</strong> Primary page title, main hero sections<br>
85
- <strong>CSS Variables:</strong> --typography-heading-h1-fontSize, --typography-heading-h1-fontWeight<br>
86
- <strong>SEO:</strong> One h1 per page for optimal search engine ranking
87
- </bd-p>
88
-
89
- <bd-h as="h2" style="margin-bottom: 0.5rem;">Heading Level 2 - Section Title</bd-h>
90
- <bd-p kind="small" style="color: #64748b; margin-bottom: 1rem;">
91
- <strong>Use case:</strong> Major section titles, main content divisions<br>
92
- <strong>CSS Variables:</strong> --typography-heading-h2-fontSize, --typography-heading-h2-fontWeight<br>
93
- <strong>Structure:</strong> Used for primary content sections
94
- </bd-p>
95
-
96
- <bd-h as="h3" style="margin-bottom: 0.5rem;">Heading Level 3 - Subsection Title</bd-h>
97
- <bd-p kind="small" style="color: #64748b; margin-bottom: 1rem;">
98
- <strong>Use case:</strong> Sub-sections, feature titles, card headers<br>
99
- <strong>CSS Variables:</strong> --typography-heading-h3-fontSize, --typography-heading-h3-fontWeight<br>
100
- <strong>Hierarchy:</strong> Nested under h2 sections
101
- </bd-p>
102
-
103
- <bd-h as="h4" style="margin-bottom: 0.5rem;">Heading Level 4 - Content Heading</bd-h>
104
- <bd-p kind="small" style="color: #64748b; margin-bottom: 1rem;">
105
- <strong>Use case:</strong> Smaller sections, widget titles, detailed content<br>
106
- <strong>CSS Variables:</strong> --typography-heading-h4-fontSize, --typography-heading-h4-fontWeight<br>
107
- <strong>Usage:</strong> For content that needs less visual emphasis
108
- </bd-p>
109
-
110
- <bd-h as="h5" style="margin-bottom: 0.5rem;">Heading Level 5 - Minor Heading</bd-h>
111
- <bd-p kind="small" style="color: #64748b; margin-bottom: 1rem;">
112
- <strong>Use case:</strong> Sidebar titles, footer sections, minor labels<br>
113
- <strong>CSS Variables:</strong> --typography-heading-h5-fontSize, --typography-heading-h5-fontWeight<br>
114
- <strong>Appearance:</strong> Smaller and less prominent
115
- </bd-p>
116
-
117
- <bd-h as="h6" style="margin-bottom: 0.5rem;">Heading Level 6 - Smallest Heading</bd-h>
118
- <bd-p kind="small" style="color: #64748b;">
119
- <strong>Use case:</strong> Legal text, captions, fine print headings<br>
120
- <strong>CSS Variables:</strong> --typography-heading-h6-fontSize, --typography-heading-h6-fontWeight<br>
121
- <strong>Note:</strong> Smallest heading level available
122
- </bd-p>
123
- </div>
124
- `;
125
- AllHeadingLevels.parameters = {
126
- docs: {
127
- description: {
128
- story: 'Complete overview of all heading levels from h1 (largest) to h6 (smallest) with usage guidelines, CSS variable references, and semantic recommendations.'
129
- }
130
- }
131
- };
132
-
133
- export const Heading1 = Template.bind({});
134
- Heading1.args = {
135
- as : 'h1',
136
- content: 'Main Page Title (H1)',
137
- color : '',
138
- align : 'left'
139
- };
140
- Heading1.parameters = {
141
- docs: {
142
- description: {
143
- story: 'Primary heading level (h1) - Use as the main title for pages and major sections. There should typically be only one h1 per page for optimal SEO and accessibility.'
144
- }
145
- }
146
- };
147
-
148
- export const Heading2 = Template.bind({});
149
- Heading2.args = {
150
- as : 'h2',
151
- content: 'Section Title (H2)',
152
- color : '',
153
- align : 'left'
154
- };
155
- Heading2.parameters = {
156
- docs: {
157
- description: {
158
- story: 'Secondary heading level (h2) - Perfect for major content sections and primary division titles within a page.'
159
- }
160
- }
161
- };
162
-
163
- export const Heading3 = Template.bind({});
164
- Heading3.args = {
165
- as : 'h3',
166
- content: 'Subsection Title (H3)',
167
- color : '',
168
- align : 'left'
169
- };
170
- Heading3.parameters = {
171
- docs: {
172
- description: {
173
- story: 'Tertiary heading level (h3) - Ideal for subsection titles, feature headings, and card headers within h2 sections.'
174
- }
175
- }
176
- };
177
-
178
- export const Heading4 = Template.bind({});
179
- Heading4.args = {
180
- as : 'h4',
181
- content: 'Content Heading (H4)',
182
- color : '',
183
- align : 'left'
184
- };
185
- Heading4.parameters = {
186
- docs: {
187
- description: {
188
- story: 'Content heading level (h4) - Suitable for smaller content sections, widget titles, and detailed information headings.'
189
- }
190
- }
191
- };
192
-
193
- export const Heading5 = Template.bind({});
194
- Heading5.args = {
195
- as : 'h5',
196
- content: 'Minor Heading (H5)',
197
- color : '',
198
- align : 'left'
199
- };
200
- Heading5.parameters = {
201
- docs: {
202
- description: {
203
- story: 'Minor heading level (h5) - Use for sidebar sections, footer headings, and less important content labels.'
204
- }
205
- }
206
- };
207
-
208
- export const Heading6 = Template.bind({});
209
- Heading6.args = {
210
- as : 'h6',
211
- content: 'Smallest Heading (H6)',
212
- color : '',
213
- align : 'left'
214
- };
215
- Heading6.parameters = {
216
- docs: {
217
- description: {
218
- story: 'Smallest heading level (h6) - Designed for legal text, captions, fine print, and the least prominent headings.'
219
- }
220
- }
221
- };
222
-
223
- export const TextAlignment = () => html`
224
- <div style="display: flex; flex-direction: column; gap: 2rem; max-width: 800px; margin: 0 auto; padding: 2rem;">
225
- <bd-h as="h2" style="margin-bottom: 1rem;">Text Alignment Options</bd-h>
226
-
227
- <div style="border: 2px solid #e2e8f0; padding: 2rem; border-radius: 8px;">
228
- <bd-h as="h3" style="text-align: left; margin-bottom: 1rem;">Left Aligned Heading</bd-h>
229
- <bd-p kind="regular" style="color: #64748b;">
230
- Default alignment. Best for most content sections, articles, and body text. Provides optimal readability for long content.
231
- </bd-p>
232
- </div>
233
-
234
- <div style="border: 2px solid #e2e8f0; padding: 2rem; border-radius: 8px;">
235
- <bd-h as="h3" style="text-align: center; margin-bottom: 1rem;">Center Aligned Heading</bd-h>
236
- <bd-p kind="regular" style="color: #64748b; text-align: center;">
237
- Ideal for hero sections, testimonials, feature highlights, and marketing content. Creates visual balance and emphasis.
238
- </bd-p>
239
- </div>
240
-
241
- <div style="border: 2px solid #e2e8f0; padding: 2rem; border-radius: 8px;">
242
- <bd-h as="h3" style="text-align: right; margin-bottom: 1rem;">Right Aligned Heading</bd-h>
243
- <bd-p kind="regular" style="color: #64748b; text-align: right;">
244
- Useful for asymmetric layouts, creative designs, and specific visual compositions. Use sparingly for intentional design effects.
245
- </bd-p>
246
- </div>
247
- </div>
248
- `;
249
- TextAlignment.parameters = {
250
- docs: {
251
- description: {
252
- story: 'Demonstrates different text alignment options for headings with recommendations for when to use left, center, or right alignment based on content type and design context.'
253
- }
254
- }
255
- };
256
-
257
- export const ColorCustomization = () => html`
258
- <div style="display: flex; flex-direction: column; gap: 2rem; max-width: 800px; margin: 0 auto; padding: 2rem;">
259
- <bd-h as="h2" style="margin-bottom: 1rem;">Color Customization Examples</bd-h>
260
-
261
- <div style="background: #1e293b; padding: 2rem; border-radius: 8px;">
262
- <bd-h as="h3" style="color: #ffffff; margin-bottom: 1rem;">White Text on Dark Background</bd-h>
263
- <bd-p kind="regular" style="color: #cbd5e1;">
264
- Perfect for dark theme sections, hero areas with dark backgrounds, and high-contrast designs.
265
- </bd-p>
266
- </div>
267
-
268
- <div style="background: #dbeafe; padding: 2rem; border-radius: 8px;">
269
- <bd-h as="h3" style="color: #1e40af; margin-bottom: 1rem;">Primary Brand Color</bd-h>
270
- <bd-p kind="regular" style="color: #374151;">
271
- Using brand colors for visual consistency and emphasis. Maintains brand identity across the application.
272
- </bd-p>
273
- </div>
274
-
275
- <div style="background: #f0fdf4; padding: 2rem; border-radius: 8px;">
276
- <bd-h as="h3" style="color: #166534; margin-bottom: 1rem;">Success Green Color</bd-h>
277
- <bd-p kind="regular" style="color: #374151;">
278
- Color coding for specific contexts like success states, positive outcomes, and confirmation messages.
279
- </bd-p>
280
- </div>
281
-
282
- <div style="background: #fef2f2; padding: 2rem; border-radius: 8px;">
283
- <bd-h as="h3" style="color: #dc2626; margin-bottom: 1rem;">Error Red Color</bd-h>
284
- <bd-p kind="regular" style="color: #374151;">
285
- Using red for error states, warnings, critical information, and attention-requiring content.
286
- </bd-p>
287
- </div>
82
+ const defaultArgs = { as: 'h2', padding: '', paddingBottom: '', fontWeight: '', color: '' };
288
83
 
289
- <div style="background: #f8fafc; padding: 2rem; border-radius: 8px;">
290
- <bd-h as="h3" style="color: #7c3aed; margin-bottom: 1rem;">Accent Purple Color</bd-h>
291
- <bd-p kind="regular" style="color: #374151;">
292
- Alternative brand color for variety while maintaining visual harmony and design system consistency.
293
- </bd-p>
294
- </div>
295
- </div>
296
- `;
297
- ColorCustomization.parameters = {
298
- docs: {
299
- description: {
300
- story: 'Shows how heading components can be customized with different colors for various contexts, themes, and semantic meanings while maintaining readability and accessibility.'
301
- }
302
- }
303
- };
84
+ // ─── Stories ───────────────────────────────────────────────────────────────
304
85
 
305
- export const ContentHierarchy = () => html`
306
- <div style="max-width: 800px; margin: 0 auto; padding: 2rem;">
307
- <bd-h as="h1" style="margin-bottom: 1rem;">Product Documentation</bd-h>
308
- <bd-p kind="lead" style="margin-bottom: 2rem;">
309
- Comprehensive guide to using our product features and capabilities effectively.
310
- </bd-p>
311
-
312
- <bd-h as="h2" style="margin-bottom: 1rem;">Getting Started</bd-h>
313
- <bd-p kind="regular" style="margin-bottom: 1.5rem;">
314
- Learn the basics and set up your account quickly and efficiently.
315
- </bd-p>
316
-
317
- <bd-h as="h3" style="margin-bottom: 1rem;">Account Setup</bd-h>
318
- <bd-p kind="regular" style="margin-bottom: 1.5rem;">
319
- Step-by-step instructions for creating and configuring your account.
320
- </bd-p>
321
-
322
- <bd-h as="h4" style="margin-bottom: 1rem;">Profile Configuration</bd-h>
323
- <bd-p kind="regular" style="margin-bottom: 2rem;">
324
- Customize your profile settings and preferences for optimal experience.
325
- </bd-p>
326
-
327
- <bd-h as="h2" style="margin-bottom: 1rem;">Advanced Features</bd-h>
328
- <bd-p kind="regular" style="margin-bottom: 1.5rem;">
329
- Explore powerful features to maximize your productivity and results.
330
- </bd-p>
331
-
332
- <bd-h as="h3" style="margin-bottom: 1rem;">Automation Tools</bd-h>
333
- <bd-p kind="regular" style="margin-bottom: 1.5rem;">
334
- Set up automated workflows to save time and reduce manual tasks.
335
- </bd-p>
336
-
337
- <bd-h as="h4" style="margin-bottom: 1rem;">Custom Scripts</bd-h>
338
- <bd-p kind="regular">
339
- Create and manage custom scripts for specialized automation needs.
340
- </bd-p>
341
- </div>
342
- `;
343
- ContentHierarchy.parameters = {
344
- docs: {
345
- description: {
346
- story: 'Demonstrates proper semantic heading hierarchy in a real-world content scenario. Shows how headings should be nested logically without skipping levels for optimal accessibility and SEO.'
347
- }
348
- }
86
+ export const Default = {
87
+ name : 'Default (h1)',
88
+ render : () => html`<bd-h as="h1">Page Title</bd-h>`,
89
+ parameters: { docs: { description: { story: 'Default `h1` heading with no inline styles.' } } }
349
90
  };
350
91
 
351
- export const CardLayoutExample = () => html`
352
- <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; padding: 2rem; max-width: 1200px; margin: 0 auto;">
353
- <div style="border: 1px solid #e2e8f0; border-radius: 12px; padding: 2rem; background: white; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);">
354
- <bd-h as="h3" style="color: #3b82f6; margin-bottom: 1rem;">Advanced Security</bd-h>
355
- <bd-p kind="regular" style="margin-bottom: 1.5rem;">
356
- Comprehensive protection against malware, ransomware, phishing, and online threats with real-time monitoring.
357
- </bd-p>
358
- <bd-h as="h5" style="color: #64748b; margin-bottom: 0.5rem;">Key Features:</bd-h>
359
- <bd-p kind="small" style="color: #64748b;">
360
- • Real-time threat detection<br>
361
- • Behavioral analysis<br>
362
- • Automatic updates
363
- </bd-p>
92
+ export const AllLevels = {
93
+ name : 'All Heading Levels',
94
+ render: () => html`
95
+ <div style="display:flex; flex-direction:column; gap:8px;">
96
+ <bd-h as="h1">Heading 1</bd-h>
97
+ <bd-h as="h2">Heading 2</bd-h>
98
+ <bd-h as="h3">Heading 3</bd-h>
99
+ <bd-h as="h4">Heading 4</bd-h>
100
+ <bd-h as="h5">Heading 5</bd-h>
101
+ <bd-h as="h6">Heading 6</bd-h>
364
102
  </div>
365
-
366
- <div style="border: 1px solid #e2e8f0; border-radius: 12px; padding: 2rem; background: white; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);">
367
- <bd-h as="h3" style="color: #8b5cf6; margin-bottom: 1rem;">Privacy Protection</bd-h>
368
- <bd-p kind="regular" style="margin-bottom: 1.5rem;">
369
- VPN, password manager, and webcam protection to keep your personal data and privacy secure from intrusions.
370
- </bd-p>
371
- <bd-h as="h5" style="color: #64748b; margin-bottom: 0.5rem;">Included Tools:</bd-h>
372
- <bd-p kind="small" style="color: #64748b;">
373
- Encrypted VPN<br>
374
- Password manager<br>
375
- Webcam shield
376
- </bd-p>
103
+ `,
104
+ parameters: { docs: { description: { story: 'All six heading levels rendered for typographic scale comparison.' } } }
105
+ };
106
+
107
+ export const CustomColor = {
108
+ name : 'Custom Color',
109
+ render: () => html`
110
+ <div style="display:flex; flex-direction:column; gap:12px;">
111
+ <bd-h as="h2" color="#026DFF">Blue Heading</bd-h>
112
+ <bd-h as="h2" color="#E53935">Red Heading</bd-h>
113
+ <bd-h as="h2" color="#43A047">Green Heading</bd-h>
114
+ <bd-h as="h2" color="var(--color-neutral-1000)">Token Color</bd-h>
377
115
  </div>
378
-
379
- <div style="border: 1px solid #e2e8f0; border-radius: 12px; padding: 2rem; background: white; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);">
380
- <bd-h as="h3" style="color: #10b981; margin-bottom: 1rem;">Performance Boost</bd-h>
381
- <bd-p kind="regular" style="margin-bottom: 1.5rem;">
382
- Lightweight design with minimal impact on system resources while optimizing performance and speed.
383
- </bd-p>
384
- <bd-h as="h5" style="color: #64748b; margin-bottom: 0.5rem;">Benefits:</bd-h>
385
- <bd-p kind="small" style="color: #64748b;">
386
- Fast scanning<br>
387
- Low resource usage<br>
388
- Quick startup
389
- </bd-p>
116
+ `,
117
+ parameters: { docs: { description: { story: 'Headings with hex colors and a CSS variable token. Bare color names like "blue" are rejected by `_getValidColor()`.' } } }
118
+ };
119
+
120
+ export const FontWeights = {
121
+ name : 'Font Weights',
122
+ render: () => html`
123
+ <div style="display:flex; flex-direction:column; gap:8px;">
124
+ <bd-h as="h3" fontWeight="300">Light (300)</bd-h>
125
+ <bd-h as="h3" fontWeight="400">Regular (400)</bd-h>
126
+ <bd-h as="h3" fontWeight="600">Semibold (600)</bd-h>
127
+ <bd-h as="h3" fontWeight="700">Bold (700)</bd-h>
128
+ <bd-h as="h3" fontWeight="800">Extrabold (800)</bd-h>
129
+ <bd-h as="h3" fontWeight="900">Black (900)</bd-h>
390
130
  </div>
391
- </div>
392
- `;
393
- CardLayoutExample.parameters = {
394
- docs: {
395
- description: {
396
- story: 'Real-world example showing headings used in card layouts with different colors and hierarchy levels. Demonstrates how headings work in modern UI designs and component-based layouts.'
397
- }
398
- }
131
+ `,
132
+ parameters: { docs: { description: { story: 'Various font weights from light (300) to black (900). Invalid weights like "purple" are silently ignored.' } } }
399
133
  };
400
134
 
401
- export const AccessibilityGuidelines = () => html`
402
- <div style="max-width: 800px; margin: 0 auto; padding: 2rem;">
403
- <bd-h as="h1" style="margin-bottom: 1rem;">Accessibility Best Practices</bd-h>
404
- <bd-p kind="lead" style="margin-bottom: 2rem;">
405
- Proper heading structure is essential for screen reader users, keyboard navigation, and search engine optimization.
406
- </bd-p>
407
-
408
- <bd-h as="h2" style="margin-bottom: 1rem;">Semantic Structure</bd-h>
409
- <bd-p kind="regular" style="margin-bottom: 1.5rem;">
410
- Headings should follow a logical hierarchy without skipping levels. Screen reader users often navigate by headings to understand page structure.
411
- </bd-p>
412
-
413
- <bd-h as="h3" style="margin-bottom: 1rem;">Proper Hierarchy Example</bd-h>
414
- <div style="background: #f8fafc; padding: 1.5rem; border-radius: 8px; margin-bottom: 1.5rem;">
415
- <bd-p kind="regular" style="color: #334155;">
416
- <strong>✅ Correct:</strong> h1 → h2 → h3 → h2 → h3 → h4<br>
417
- <strong>❌ Avoid:</strong> h1 → h3 → h4 → h2 → h5
418
- </bd-p>
135
+ export const CustomPadding = {
136
+ name : 'Custom Padding',
137
+ render: () => html`
138
+ <div style="outline:1px solid #eee; display:inline-block;">
139
+ <bd-h as="h3" padding="24px 40px">With Full Padding</bd-h>
419
140
  </div>
420
-
421
- <bd-h as="h3" style="margin-bottom: 1rem;">Screen Reader Navigation</bd-h>
422
- <bd-p kind="regular" style="margin-bottom: 1.5rem;">
423
- Users can jump between headings to quickly find relevant content. Proper structure makes this navigation intuitive and efficient.
424
- </bd-p>
425
-
426
- <bd-h as="h2" style="margin-bottom: 1rem;">SEO Benefits</bd-h>
427
- <bd-p kind="regular" style="margin-bottom: 1.5rem;">
428
- Search engines use heading structure to understand content importance and relevance. Proper hierarchy improves search rankings.
429
- </bd-p>
430
-
431
- <bd-h as="h3" style="margin-bottom: 1rem;">Keyword Placement</bd-h>
432
- <bd-p kind="regular">
433
- Important keywords should appear in higher-level headings (h1, h2) while supporting keywords can go in lower levels (h3, h4).
434
- </bd-p>
435
- </div>
436
- `;
437
- AccessibilityGuidelines.parameters = {
438
- docs: {
439
- description: {
440
- story: 'Comprehensive guide to accessibility and SEO best practices for heading usage. Includes semantic structure requirements, screen reader considerations, and search engine optimization tips.'
441
- }
442
- }
443
- };
444
-
445
- export const ResponsiveBehavior = () => html`
446
- <div style="max-width: 100%; padding: 2rem;">
447
- <bd-h as="h2" style="margin-bottom: 1rem;">Responsive Heading Behavior</bd-h>
448
- <bd-p kind="regular" style="margin-bottom: 2rem;">
449
- Heading components automatically adjust based on viewport size and CSS custom properties. They maintain optimal readability across all device sizes.
450
- </bd-p>
451
-
452
- <div style="background: #f1f5f9; padding: 2rem; border-radius: 12px;">
453
- <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; margin-top: 1rem;">
454
- <div style="text-align: center; padding: 1.5rem; background: white; border-radius: 8px;">
455
- <bd-h as="h4" style="color: #3b82f6; margin-bottom: 1rem;">Mobile View</bd-h>
456
- <bd-h as="h3" style="color: #1e293b; margin-bottom: 1rem;">Optimized for Small Screens</bd-h>
457
- <bd-p kind="small" style="color: #64748b;">
458
- Compact yet readable on mobile devices with appropriate font sizes and spacing.
459
- </bd-p>
460
- </div>
461
-
462
- <div style="text-align: center; padding: 1.5rem; background: white; border-radius: 8px;">
463
- <bd-h as="h4" style="color: #3b82f6; margin-bottom: 1rem;">Tablet View</bd-h>
464
- <bd-h as="h3" style="color: #1e293b; margin-bottom: 1rem;">Balanced for Medium Devices</bd-h>
465
- <bd-p kind="small" style="color: #64748b;">
466
- Perfect balance of size and readability for tablet screens and medium breakpoints.
467
- </bd-p>
468
- </div>
469
-
470
- <div style="text-align: center; padding: 1.5rem; background: white; border-radius: 8px;">
471
- <bd-h as="h4" style="color: #3b82f6; margin-bottom: 1rem;">Desktop View</bd-h>
472
- <bd-h as="h3" style="color: #1e293b; margin-bottom: 1rem;">Maximum Impact on Large Screens</bd-h>
473
- <bd-p kind="small" style="color: #64748b;">
474
- Full visual impact and hierarchy on desktop displays and large viewports.
475
- </bd-p>
476
- </div>
477
- </div>
141
+ <div style="outline:1px solid #eee; display:inline-block; margin-top:16px;">
142
+ <bd-h as="h3" paddingBottom="32px">With Padding Bottom Only</bd-h>
478
143
  </div>
479
- </div>
480
- `;
481
- ResponsiveBehavior.parameters = {
482
- docs: {
483
- description: {
484
- story: 'Demonstrates how heading typography adapts responsively across different screen sizes while maintaining visual hierarchy, readability, and design consistency through CSS variables and responsive design principles.'
485
- }
486
- }
487
- };
488
-
489
- export const InteractivePlayground = Template.bind({});
490
- InteractivePlayground.args = {
491
- as : 'h2',
492
- content: 'Customize This Heading',
493
- color : '',
494
- align : 'left'
495
- };
496
- InteractivePlayground.parameters = {
497
- docs: {
498
- description: {
499
- story: 'Interactive playground where you can test all heading properties in real-time. Use the controls panel to modify the heading level, color, alignment, and content to see immediate results.'
500
- }
501
- }
144
+ `,
145
+ parameters: { docs: { description: { story: 'Demonstrates `padding` shorthand and `paddingBottom` applied inline.' } } }
146
+ };
147
+
148
+ export const AriaLevelOverride = {
149
+ name : 'ARIA Level Override',
150
+ render: () => html`
151
+ <p style="font-size:14px; margin-bottom:8px;">
152
+ Visually renders as <code>h4</code> but has <code>aria-level="2"</code>.
153
+ </p>
154
+ <bd-h as="h4" aria-level="2" color="#026DFF">
155
+ Visually h4, semantically level 2
156
+ </bd-h>
157
+ `,
158
+ parameters: { docs: { description: { story: '`ariaLevel` overrides the implicit ARIA heading level for accessibility without changing the visual rendering.' } } }
159
+ };
160
+
161
+ export const InvalidTag = {
162
+ name : 'Invalid Tag (fallback to h1)',
163
+ render: () => html`
164
+ <bd-h as="div">This falls back to h1</bd-h>
165
+ `,
166
+ parameters: { docs: { description: { story: '`as="div"` is not a valid heading tag — component falls back to rendering `<h1>`.' } } }
167
+ };
168
+
169
+ export const InvalidColor = {
170
+ name : 'Invalid Color (silently ignored)',
171
+ render: () => html`
172
+ <bd-h as="h3" color="blue">This uses the default color (blue is rejected)</bd-h>
173
+ <bd-h as="h3" color="#026DFF">This uses valid hex color</bd-h>
174
+ `,
175
+ parameters: { docs: { description: { story: 'Bare color name `"blue"` is rejected by `_getValidColor()` and falls back to the default color. `"#026DFF"` is accepted.' } } }
176
+ };
177
+
178
+ export const Combined = {
179
+ name : 'Combined Props',
180
+ render: () => html`
181
+ <bd-h as="h2" color="#026DFF" fontWeight="800" paddingBottom="16px">
182
+ World-class security software
183
+ </bd-h>
184
+ `,
185
+ parameters: { docs: { description: { story: 'h2 with color, bold font weight, and bottom padding combined.' } } }
186
+ };
187
+
188
+ export const Playground = {
189
+ name : '🛝 Playground',
190
+ args : { ...defaultArgs },
191
+ render,
192
+ parameters: { docs: { description: { story: 'Interactive playground. Adjust `as`, `color`, `fontWeight`, `padding`, and `paddingBottom` via Controls.' } } }
502
193
  };