@repobit/dex-system-design 0.21.1 → 0.22.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.
- package/CHANGELOG.md +20 -0
- package/package.json +4 -2
- package/src/components/Button/Button.js +7 -2
- package/src/components/Button/button.css.js +30 -0
- package/src/components/accordion/accordion-bg.stories.js +341 -171
- package/src/components/accordion/accordion.stories.js +345 -0
- package/src/components/anchor/anchor-nav.js +1 -0
- package/src/components/anchor/anchor.stories.js +134 -76
- package/src/components/back/back.css.js +1 -1
- package/src/components/back/back.stories.js +301 -63
- package/src/components/badge/badge.js +4 -7
- package/src/components/badge/badge.stories.js +89 -96
- package/src/components/breadcrumb/breadcrumb.stories.js +167 -3
- package/src/components/cards/card.stories.js +153 -3
- package/src/components/display/display.css.js +7 -10
- package/src/components/display/display.js +14 -2
- package/src/components/display/display.stories.js +213 -219
- package/src/components/divider/divider.stories.js +337 -30
- package/src/components/footer/footer-lp.stories.js +346 -3
- package/src/components/footer/footer.js +0 -3
- package/src/components/footer/footer.stories.js +267 -4
- package/src/components/header/header.css.js +1 -1
- package/src/components/header/header.js +81 -56
- package/src/components/header/header.stories.js +298 -22
- package/src/components/heading/heading.css.js +1 -1
- package/src/components/heading/heading.stories.js +355 -113
- package/src/components/image/image.css.js +146 -98
- package/src/components/image/image.js +13 -2
- package/src/components/image/image.stories.js +546 -160
- package/src/components/input/custom-form.stories.js +209 -12
- package/src/components/link/link.css.js +2 -2
- package/src/components/link/link.stories.js +383 -53
- package/src/components/paragraph/paragraph.css.js +1 -1
- package/src/components/paragraph/paragraph.stories.js +365 -157
- package/src/components/picture/picture.css.js +209 -0
- package/src/components/picture/picture.js +16 -2
- package/src/components/picture/picture.stories.js +525 -180
- package/src/components/pricing-cards/new-pricing-card.js +19 -4
- package/src/components/pricing-cards/new-pricing-card.stories.js +422 -0
- package/src/components/pricing-cards/new-pricing.css.js +8 -0
- package/src/components/pricing-cards/pricing-card-actions.js +50 -9
- package/src/components/pricing-cards/pricing-card-container.css.js +1 -1
- package/src/components/pricing-cards/pricing-card-header.css.js +73 -63
- package/src/components/pricing-cards/pricing-card-header.js +44 -10
- package/src/components/pricing-cards/pricing-card-pricing.js +63 -64
- package/src/components/pricing-cards/pricing-card.css.js +7 -15
- package/src/components/pricing-cards/pricing-card.js +354 -271
- package/src/components/pricing-cards/pricing-card.stories.js +3 -3
- package/src/tokens/fonts.stories.js +335 -8
- package/src/tokens/spacing.stories.js +701 -34
- package/src/tokens/tokens-grid.stories.js +897 -48
- package/src/tokens/typography.stories.js +980 -38
- package/src/components/accordion/accordion-light.stories.js +0 -241
|
@@ -1,42 +1,86 @@
|
|
|
1
1
|
import { html } from 'lit';
|
|
2
2
|
import '../heading/heading.js';
|
|
3
|
+
import '../paragraph/paragraph.js';
|
|
3
4
|
import './image.js';
|
|
4
5
|
|
|
5
6
|
export default {
|
|
6
7
|
title : 'Atoms/Image',
|
|
7
8
|
component: 'bd-img',
|
|
9
|
+
tags : ['autodocs'],
|
|
8
10
|
argTypes : {
|
|
9
11
|
src: {
|
|
10
12
|
control : 'text',
|
|
11
|
-
description: 'Image source URL'
|
|
13
|
+
description: 'Image source URL or path',
|
|
14
|
+
table : {
|
|
15
|
+
type : { summary: 'string' },
|
|
16
|
+
defaultValue: { summary: '' }
|
|
17
|
+
}
|
|
12
18
|
},
|
|
13
19
|
alt: {
|
|
14
20
|
control : 'text',
|
|
15
|
-
description: '
|
|
21
|
+
description: 'Alternative text for accessibility and SEO',
|
|
22
|
+
table : {
|
|
23
|
+
type : { summary: 'string' },
|
|
24
|
+
defaultValue: { summary: '' }
|
|
25
|
+
}
|
|
16
26
|
},
|
|
17
27
|
width: {
|
|
18
28
|
control : 'number',
|
|
19
|
-
description: 'Image width'
|
|
29
|
+
description: 'Image width in pixels',
|
|
30
|
+
table : {
|
|
31
|
+
type : { summary: 'number' },
|
|
32
|
+
defaultValue: { summary: 'auto' }
|
|
33
|
+
}
|
|
20
34
|
},
|
|
21
35
|
height: {
|
|
22
36
|
control : 'number',
|
|
23
|
-
description: 'Image height'
|
|
37
|
+
description: 'Image height in pixels',
|
|
38
|
+
table : {
|
|
39
|
+
type : { summary: 'number' },
|
|
40
|
+
defaultValue: { summary: 'auto' }
|
|
41
|
+
}
|
|
24
42
|
},
|
|
25
43
|
loading: {
|
|
26
44
|
control : { type: 'select' },
|
|
27
45
|
options : ['lazy', 'eager'],
|
|
28
|
-
description: '
|
|
46
|
+
description: 'Image loading strategy',
|
|
47
|
+
table : {
|
|
48
|
+
type : { summary: 'string' },
|
|
49
|
+
defaultValue: { summary: 'lazy' }
|
|
50
|
+
}
|
|
29
51
|
},
|
|
30
52
|
fit: {
|
|
31
53
|
control : { type: 'select' },
|
|
32
54
|
options : ['cover', 'contain', 'fill', 'none', 'scale-down'],
|
|
33
|
-
description: '
|
|
55
|
+
description: 'How the image should be resized to fit its container',
|
|
56
|
+
table : {
|
|
57
|
+
type : { summary: 'string' },
|
|
58
|
+
defaultValue: { summary: 'cover' }
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
radius: {
|
|
62
|
+
control : { type: 'select' },
|
|
63
|
+
options : ['none', 'sm', 'md', 'lg', 'full'],
|
|
64
|
+
description: 'Border radius for rounded corners',
|
|
65
|
+
table : {
|
|
66
|
+
type : { summary: 'string' },
|
|
67
|
+
defaultValue: { summary: 'none' }
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
shadow: {
|
|
71
|
+
control : { type: 'select' },
|
|
72
|
+
options : ['none', 'sm', 'md', 'lg'],
|
|
73
|
+
description: 'Box shadow for depth effect',
|
|
74
|
+
table : {
|
|
75
|
+
type : { summary: 'string' },
|
|
76
|
+
defaultValue: { summary: 'none' }
|
|
77
|
+
}
|
|
34
78
|
}
|
|
35
79
|
},
|
|
36
80
|
parameters: {
|
|
37
81
|
docs: {
|
|
38
82
|
description: {
|
|
39
|
-
component: '
|
|
83
|
+
component: 'An enhanced image component with built-in styling options, loading strategies, and accessibility features. Provides consistent image handling across the application with performance optimizations.'
|
|
40
84
|
}
|
|
41
85
|
}
|
|
42
86
|
}
|
|
@@ -50,196 +94,538 @@ const Template = (args) => html`
|
|
|
50
94
|
height="${args.height}"
|
|
51
95
|
loading="${args.loading}"
|
|
52
96
|
fit="${args.fit}"
|
|
97
|
+
radius="${args.radius}"
|
|
98
|
+
shadow="${args.shadow}"
|
|
53
99
|
></bd-img>
|
|
54
100
|
`;
|
|
55
101
|
|
|
102
|
+
// ============ STORIES ============
|
|
103
|
+
|
|
56
104
|
export const Default = Template.bind({});
|
|
57
105
|
Default.args = {
|
|
58
106
|
src : '/assets/bd-header-us.jpg',
|
|
59
107
|
alt : 'Bitdefender Security Illustration',
|
|
60
|
-
width :
|
|
61
|
-
height :
|
|
108
|
+
width : 400,
|
|
109
|
+
height : 250,
|
|
62
110
|
loading: 'lazy',
|
|
63
|
-
fit : 'cover'
|
|
111
|
+
fit : 'cover',
|
|
112
|
+
radius : 'none',
|
|
113
|
+
shadow : 'none'
|
|
64
114
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
height : 500,
|
|
72
|
-
loading: 'eager',
|
|
73
|
-
fit : 'cover'
|
|
115
|
+
Default.parameters = {
|
|
116
|
+
docs: {
|
|
117
|
+
description: {
|
|
118
|
+
story: 'Default image component with standard configuration. Uses lazy loading and cover fit for optimal performance and appearance.'
|
|
119
|
+
}
|
|
120
|
+
}
|
|
74
121
|
};
|
|
75
122
|
|
|
76
|
-
export const
|
|
77
|
-
<div style="display:
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
alt="Cover fit example"
|
|
83
|
-
width="200"
|
|
84
|
-
height="200"
|
|
85
|
-
fit="cover"
|
|
86
|
-
></bd-img>
|
|
87
|
-
<p style="font-size: 0.875rem; color: #666; margin-top: 0.5rem;">
|
|
88
|
-
Fills container, may crop - perfect for headers
|
|
89
|
-
</p>
|
|
90
|
-
</div>
|
|
91
|
-
|
|
92
|
-
<div>
|
|
93
|
-
<bd-h as="h4">Contain</bd-h>
|
|
94
|
-
<bd-img
|
|
95
|
-
src="/assets/bd-header-us.jpg"
|
|
96
|
-
alt="Contain fit example"
|
|
97
|
-
width="200"
|
|
98
|
-
height="200"
|
|
99
|
-
fit="contain"
|
|
100
|
-
></bd-img>
|
|
101
|
-
<p style="font-size: 0.875rem; color: #666; margin-top: 0.5rem;">
|
|
102
|
-
Fits entirely, may have empty space
|
|
103
|
-
</p>
|
|
104
|
-
</div>
|
|
123
|
+
export const AllObjectFitOptions = () => html`
|
|
124
|
+
<div style="display: flex; flex-direction: column; gap: 3rem; max-width: 900px; margin: 0 auto; padding: 2rem;">
|
|
125
|
+
<bd-h as="h2" style="margin-bottom: 1rem;">Object Fit Property Examples</bd-h>
|
|
126
|
+
<bd-p kind="regular" style="margin-bottom: 2rem;">
|
|
127
|
+
The object-fit property defines how an image should be resized to fit its container. Each option has specific use cases and behaviors.
|
|
128
|
+
</bd-p>
|
|
105
129
|
|
|
106
|
-
<div>
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
130
|
+
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem;">
|
|
131
|
+
<div style="text-align: center;">
|
|
132
|
+
<bd-h as="h4" style="margin-bottom: 1rem;">Cover</bd-h>
|
|
133
|
+
<div style="width: 250px; height: 200px; margin: 0 auto; border: 2px solid #e2e8f0; border-radius: 8px; overflow: hidden;">
|
|
134
|
+
<bd-img
|
|
135
|
+
src="/assets/bd-header-us.jpg"
|
|
136
|
+
alt="Cover fit example"
|
|
137
|
+
width="250"
|
|
138
|
+
height="200"
|
|
139
|
+
fit="cover"
|
|
140
|
+
></bd-img>
|
|
141
|
+
</div>
|
|
142
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 1rem;">
|
|
143
|
+
<strong>Use case:</strong> Hero images, profile pictures<br>
|
|
144
|
+
<strong>Behavior:</strong> Fills entire container, may crop edges<br>
|
|
145
|
+
<strong>Best for:</strong> Maintaining aspect ratio while filling space
|
|
146
|
+
</bd-p>
|
|
147
|
+
</div>
|
|
148
|
+
|
|
149
|
+
<div style="text-align: center;">
|
|
150
|
+
<bd-h as="h4" style="margin-bottom: 1rem;">Contain</bd-h>
|
|
151
|
+
<div style="width: 250px; height: 200px; margin: 0 auto; border: 2px solid #e2e8f0; border-radius: 8px; overflow: hidden; background: #f8fafc;">
|
|
152
|
+
<bd-img
|
|
153
|
+
src="/assets/bd-header-us.jpg"
|
|
154
|
+
alt="Contain fit example"
|
|
155
|
+
width="250"
|
|
156
|
+
height="200"
|
|
157
|
+
fit="contain"
|
|
158
|
+
></bd-img>
|
|
159
|
+
</div>
|
|
160
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 1rem;">
|
|
161
|
+
<strong>Use case:</strong> Product images, logos<br>
|
|
162
|
+
<strong>Behavior:</strong> Fits entirely within container, may have empty space<br>
|
|
163
|
+
<strong>Best for:</strong> Showing complete image without cropping
|
|
164
|
+
</bd-p>
|
|
165
|
+
</div>
|
|
166
|
+
|
|
167
|
+
<div style="text-align: center;">
|
|
168
|
+
<bd-h as="h4" style="margin-bottom: 1rem;">Fill</bd-h>
|
|
169
|
+
<div style="width: 250px; height: 200px; margin: 0 auto; border: 2px solid #e2e8f0; border-radius: 8px; overflow: hidden;">
|
|
170
|
+
<bd-img
|
|
171
|
+
src="/assets/bd-header-us.jpg"
|
|
172
|
+
alt="Fill fit example"
|
|
173
|
+
width="250"
|
|
174
|
+
height="200"
|
|
175
|
+
fit="fill"
|
|
176
|
+
></bd-img>
|
|
177
|
+
</div>
|
|
178
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 1rem;">
|
|
179
|
+
<strong>Use case:</strong> Background patterns, decorative images<br>
|
|
180
|
+
<strong>Behavior:</strong> Stretches to fill container, may distort<br>
|
|
181
|
+
<strong>Best for:</strong> When aspect ratio preservation isn't important
|
|
182
|
+
</bd-p>
|
|
183
|
+
</div>
|
|
184
|
+
|
|
185
|
+
<div style="text-align: center;">
|
|
186
|
+
<bd-h as="h4" style="margin-bottom: 1rem;">None</bd-h>
|
|
187
|
+
<div style="width: 250px; height: 200px; margin: 0 auto; border: 2px solid #e2e8f0; border-radius: 8px; overflow: hidden;">
|
|
188
|
+
<bd-img
|
|
189
|
+
src="/assets/bd-header-us.jpg"
|
|
190
|
+
alt="None fit example"
|
|
191
|
+
width="250"
|
|
192
|
+
height="200"
|
|
193
|
+
fit="none"
|
|
194
|
+
></bd-img>
|
|
195
|
+
</div>
|
|
196
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 1rem;">
|
|
197
|
+
<strong>Use case:</strong> Icons, small graphics<br>
|
|
198
|
+
<strong>Behavior:</strong> Original size, may overflow container<br>
|
|
199
|
+
<strong>Best for:</strong> When you need the original image dimensions
|
|
200
|
+
</bd-p>
|
|
201
|
+
</div>
|
|
202
|
+
|
|
203
|
+
<div style="text-align: center;">
|
|
204
|
+
<bd-h as="h4" style="margin-bottom: 1rem;">Scale Down</bd-h>
|
|
205
|
+
<div style="width: 250px; height: 200px; margin: 0 auto; border: 2px solid #e2e8f0; border-radius: 8px; overflow: hidden; background: #f8fafc;">
|
|
206
|
+
<bd-img
|
|
207
|
+
src="/assets/bd-header-us.jpg"
|
|
208
|
+
alt="Scale down fit example"
|
|
209
|
+
width="250"
|
|
210
|
+
height="200"
|
|
211
|
+
fit="scale-down"
|
|
212
|
+
></bd-img>
|
|
213
|
+
</div>
|
|
214
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 1rem;">
|
|
215
|
+
<strong>Use case:</strong> Responsive images, variable content<br>
|
|
216
|
+
<strong>Behavior:</strong> Like contain, but never scales up<br>
|
|
217
|
+
<strong>Best for:</strong> Preventing pixelation on large containers
|
|
218
|
+
</bd-p>
|
|
219
|
+
</div>
|
|
118
220
|
</div>
|
|
221
|
+
</div>
|
|
222
|
+
`;
|
|
223
|
+
AllObjectFitOptions.parameters = {
|
|
224
|
+
docs: {
|
|
225
|
+
description: {
|
|
226
|
+
story: 'Comprehensive demonstration of all object-fit property options with detailed explanations of when to use each option and their specific behaviors in different layout scenarios.'
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
export const LoadingStrategies = () => html`
|
|
232
|
+
<div style="display: flex; flex-direction: column; gap: 3rem; max-width: 800px; margin: 0 auto; padding: 2rem;">
|
|
233
|
+
<bd-h as="h2" style="margin-bottom: 1rem;">Image Loading Strategies</bd-h>
|
|
234
|
+
<bd-p kind="regular" style="margin-bottom: 2rem;">
|
|
235
|
+
Choose the right loading strategy based on image importance and position on the page to optimize performance and user experience.
|
|
236
|
+
</bd-p>
|
|
119
237
|
|
|
120
|
-
<div>
|
|
121
|
-
<
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
238
|
+
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 2rem;">
|
|
239
|
+
<div style="border: 2px solid #e2e8f0; padding: 2rem; border-radius: 12px;">
|
|
240
|
+
<bd-h as="h3" style="color: #3b82f6; margin-bottom: 1rem;">Lazy Loading</bd-h>
|
|
241
|
+
<bd-img
|
|
242
|
+
src="/assets/bd-header-us.jpg"
|
|
243
|
+
alt="Lazy loaded security image"
|
|
244
|
+
width="300"
|
|
245
|
+
height="200"
|
|
246
|
+
loading="lazy"
|
|
247
|
+
fit="cover"
|
|
248
|
+
radius="md"
|
|
249
|
+
></bd-img>
|
|
250
|
+
<bd-p kind="regular" style="margin-top: 1.5rem;">
|
|
251
|
+
<strong>When to use:</strong> Images below the fold, gallery items, non-critical content<br>
|
|
252
|
+
<strong>Performance:</strong> Improves page load time by deferring off-screen images<br>
|
|
253
|
+
<strong>User experience:</strong> Smooth scrolling with images loading as needed
|
|
254
|
+
</bd-p>
|
|
255
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 1rem;">
|
|
256
|
+
💡 <strong>Best practice:</strong> Use for all images that aren't immediately visible
|
|
257
|
+
</bd-p>
|
|
258
|
+
</div>
|
|
259
|
+
|
|
260
|
+
<div style="border: 2px solid #e2e8f0; padding: 2rem; border-radius: 12px;">
|
|
261
|
+
<bd-h as="h3" style="color: #3b82f6; margin-bottom: 1rem;">Eager Loading</bd-h>
|
|
262
|
+
<bd-img
|
|
263
|
+
src="/assets/bd-header-us.jpg"
|
|
264
|
+
alt="Eager loaded security image"
|
|
265
|
+
width="300"
|
|
266
|
+
height="200"
|
|
267
|
+
loading="eager"
|
|
268
|
+
fit="cover"
|
|
269
|
+
radius="md"
|
|
270
|
+
></bd-img>
|
|
271
|
+
<bd-p kind="regular" style="margin-top: 1.5rem;">
|
|
272
|
+
<strong>When to use:</strong> Hero images, above-the-fold content, critical visuals<br>
|
|
273
|
+
<strong>Performance:</strong> Loads immediately, may impact initial page load<br>
|
|
274
|
+
<strong>User experience:</strong> Important images are ready when page renders
|
|
275
|
+
</bd-p>
|
|
276
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 1rem;">
|
|
277
|
+
⚠️ <strong>Use sparingly:</strong> Only for images essential to initial page rendering
|
|
278
|
+
</bd-p>
|
|
279
|
+
</div>
|
|
132
280
|
</div>
|
|
133
281
|
</div>
|
|
134
282
|
`;
|
|
283
|
+
LoadingStrategies.parameters = {
|
|
284
|
+
docs: {
|
|
285
|
+
description: {
|
|
286
|
+
story: 'Comparison of lazy vs eager loading strategies with performance implications and guidelines for when to use each approach based on image importance and page position.'
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
};
|
|
135
290
|
|
|
136
291
|
export const StylingVariants = () => html`
|
|
137
|
-
<div style="display: flex; flex-
|
|
138
|
-
<
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
alt="Rounded security image"
|
|
143
|
-
width="150"
|
|
144
|
-
height="100"
|
|
145
|
-
fit="cover"
|
|
146
|
-
class="rounded"
|
|
147
|
-
></bd-img>
|
|
148
|
-
</div>
|
|
292
|
+
<div style="display: flex; flex-direction: column; gap: 3rem; max-width: 1000px; margin: 0 auto; padding: 2rem;">
|
|
293
|
+
<bd-h as="h2" style="margin-bottom: 1rem;">Styling and Appearance Variants</bd-h>
|
|
294
|
+
<bd-p kind="regular" style="margin-bottom: 2rem;">
|
|
295
|
+
Customize the appearance of images with border radius and shadow options to match your design system and create visual hierarchy.
|
|
296
|
+
</bd-p>
|
|
149
297
|
|
|
150
|
-
<div
|
|
151
|
-
<bd-h as="
|
|
152
|
-
<
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
298
|
+
<div>
|
|
299
|
+
<bd-h as="h3" style="margin-bottom: 2rem; color: #3b82f6;">Border Radius Options</bd-h>
|
|
300
|
+
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem;">
|
|
301
|
+
<div style="text-align: center;">
|
|
302
|
+
<bd-img
|
|
303
|
+
src="/assets/bd-header-us.jpg"
|
|
304
|
+
alt="No border radius"
|
|
305
|
+
width="150"
|
|
306
|
+
height="100"
|
|
307
|
+
fit="cover"
|
|
308
|
+
radius="none"
|
|
309
|
+
></bd-img>
|
|
310
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 1rem;">
|
|
311
|
+
<strong>None</strong><br>
|
|
312
|
+
Square corners
|
|
313
|
+
</bd-p>
|
|
314
|
+
</div>
|
|
315
|
+
|
|
316
|
+
<div style="text-align: center;">
|
|
317
|
+
<bd-img
|
|
318
|
+
src="/assets/bd-header-us.jpg"
|
|
319
|
+
alt="Small border radius"
|
|
320
|
+
width="150"
|
|
321
|
+
height="100"
|
|
322
|
+
fit="cover"
|
|
323
|
+
radius="sm"
|
|
324
|
+
></bd-img>
|
|
325
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 1rem;">
|
|
326
|
+
<strong>Small</strong><br>
|
|
327
|
+
Subtle rounding
|
|
328
|
+
</bd-p>
|
|
329
|
+
</div>
|
|
330
|
+
|
|
331
|
+
<div style="text-align: center;">
|
|
332
|
+
<bd-img
|
|
333
|
+
src="/assets/bd-header-us.jpg"
|
|
334
|
+
alt="Medium border radius"
|
|
335
|
+
width="150"
|
|
336
|
+
height="100"
|
|
337
|
+
fit="cover"
|
|
338
|
+
radius="md"
|
|
339
|
+
></bd-img>
|
|
340
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 1rem;">
|
|
341
|
+
<strong>Medium</strong><br>
|
|
342
|
+
Balanced rounding
|
|
343
|
+
</bd-p>
|
|
344
|
+
</div>
|
|
345
|
+
|
|
346
|
+
<div style="text-align: center;">
|
|
347
|
+
<bd-img
|
|
348
|
+
src="/assets/bd-header-us.jpg"
|
|
349
|
+
alt="Large border radius"
|
|
350
|
+
width="150"
|
|
351
|
+
height="100"
|
|
352
|
+
fit="cover"
|
|
353
|
+
radius="lg"
|
|
354
|
+
></bd-img>
|
|
355
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 1rem;">
|
|
356
|
+
<strong>Large</strong><br>
|
|
357
|
+
Prominent rounding
|
|
358
|
+
</bd-p>
|
|
359
|
+
</div>
|
|
360
|
+
|
|
361
|
+
<div style="text-align: center;">
|
|
362
|
+
<bd-img
|
|
363
|
+
src="/assets/bd-header-us.jpg"
|
|
364
|
+
alt="Full border radius"
|
|
365
|
+
width="150"
|
|
366
|
+
height="100"
|
|
367
|
+
fit="cover"
|
|
368
|
+
radius="full"
|
|
369
|
+
></bd-img>
|
|
370
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 1rem;">
|
|
371
|
+
<strong>Full</strong><br>
|
|
372
|
+
Circular/oval shape
|
|
373
|
+
</bd-p>
|
|
374
|
+
</div>
|
|
375
|
+
</div>
|
|
160
376
|
</div>
|
|
161
377
|
|
|
162
|
-
<div
|
|
163
|
-
<bd-h as="
|
|
164
|
-
<
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
378
|
+
<div>
|
|
379
|
+
<bd-h as="h3" style="margin-bottom: 2rem; color: #3b82f6;">Shadow Options</bd-h>
|
|
380
|
+
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem;">
|
|
381
|
+
<div style="text-align: center;">
|
|
382
|
+
<bd-img
|
|
383
|
+
src="/assets/bd-header-us.jpg"
|
|
384
|
+
alt="No shadow"
|
|
385
|
+
width="150"
|
|
386
|
+
height="100"
|
|
387
|
+
fit="cover"
|
|
388
|
+
radius="md"
|
|
389
|
+
shadow="none"
|
|
390
|
+
></bd-img>
|
|
391
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 1rem;">
|
|
392
|
+
<strong>None</strong><br>
|
|
393
|
+
Flat appearance
|
|
394
|
+
</bd-p>
|
|
395
|
+
</div>
|
|
396
|
+
|
|
397
|
+
<div style="text-align: center;">
|
|
398
|
+
<bd-img
|
|
399
|
+
src="/assets/bd-header-us.jpg"
|
|
400
|
+
alt="Small shadow"
|
|
401
|
+
width="150"
|
|
402
|
+
height="100"
|
|
403
|
+
fit="cover"
|
|
404
|
+
radius="md"
|
|
405
|
+
shadow="sm"
|
|
406
|
+
></bd-img>
|
|
407
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 1rem;">
|
|
408
|
+
<strong>Small</strong><br>
|
|
409
|
+
Subtle elevation
|
|
410
|
+
</bd-p>
|
|
411
|
+
</div>
|
|
412
|
+
|
|
413
|
+
<div style="text-align: center;">
|
|
414
|
+
<bd-img
|
|
415
|
+
src="/assets/bd-header-us.jpg"
|
|
416
|
+
alt="Medium shadow"
|
|
417
|
+
width="150"
|
|
418
|
+
height="100"
|
|
419
|
+
fit="cover"
|
|
420
|
+
radius="md"
|
|
421
|
+
shadow="md"
|
|
422
|
+
></bd-img>
|
|
423
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 1rem;">
|
|
424
|
+
<strong>Medium</strong><br>
|
|
425
|
+
Noticeable depth
|
|
426
|
+
</bd-p>
|
|
427
|
+
</div>
|
|
428
|
+
|
|
429
|
+
<div style="text-align: center;">
|
|
430
|
+
<bd-img
|
|
431
|
+
src="/assets/bd-header-us.jpg"
|
|
432
|
+
alt="Large shadow"
|
|
433
|
+
width="150"
|
|
434
|
+
height="100"
|
|
435
|
+
fit="cover"
|
|
436
|
+
radius="md"
|
|
437
|
+
shadow="lg"
|
|
438
|
+
></bd-img>
|
|
439
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 1rem;">
|
|
440
|
+
<strong>Large</strong><br>
|
|
441
|
+
Prominent elevation
|
|
442
|
+
</bd-p>
|
|
443
|
+
</div>
|
|
444
|
+
</div>
|
|
172
445
|
</div>
|
|
173
446
|
</div>
|
|
174
447
|
`;
|
|
448
|
+
StylingVariants.parameters = {
|
|
449
|
+
docs: {
|
|
450
|
+
description: {
|
|
451
|
+
story: 'Comprehensive showcase of styling options including border radius variations (none, small, medium, large, full) and shadow effects (none, small, medium, large) to create different visual appearances and depth effects.'
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
};
|
|
175
455
|
|
|
176
|
-
export const
|
|
177
|
-
<div style="display: flex; flex-direction: column; gap:
|
|
178
|
-
<
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
456
|
+
export const AccessibilityExamples = () => html`
|
|
457
|
+
<div style="display: flex; flex-direction: column; gap: 3rem; max-width: 800px; margin: 0 auto; padding: 2rem;">
|
|
458
|
+
<bd-h as="h2" style="margin-bottom: 1rem;">Accessibility Best Practices</bd-h>
|
|
459
|
+
<bd-p kind="regular" style="margin-bottom: 2rem;">
|
|
460
|
+
Proper image accessibility ensures that all users, including those using screen readers, can understand and interact with your content effectively.
|
|
461
|
+
</bd-p>
|
|
462
|
+
|
|
463
|
+
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 2rem;">
|
|
464
|
+
<div style="border: 2px solid #10b981; padding: 2rem; border-radius: 12px; background: #f0fdf4;">
|
|
465
|
+
<bd-h as="h3" style="color: #059669; margin-bottom: 1rem;">✅ Good Alt Text</bd-h>
|
|
466
|
+
<bd-img
|
|
467
|
+
src="/assets/bd-header-us.jpg"
|
|
468
|
+
alt="Bitdefender security software interface showing real-time threat protection dashboard"
|
|
469
|
+
width="300"
|
|
470
|
+
height="200"
|
|
471
|
+
fit="cover"
|
|
472
|
+
radius="md"
|
|
473
|
+
></bd-img>
|
|
474
|
+
<bd-p kind="regular" style="margin-top: 1.5rem;">
|
|
475
|
+
<strong>Descriptive:</strong> Clearly describes the image content and context<br>
|
|
476
|
+
<strong>Concise:</strong> Brief but meaningful (125 characters or less)<br>
|
|
477
|
+
<strong>Relevant:</strong> Relates to the surrounding content
|
|
478
|
+
</bd-p>
|
|
479
|
+
<bd-p kind="small" style="color: #059669; margin-top: 1rem;">
|
|
480
|
+
✅ Screen readers will read: "Bitdefender security software interface showing real-time threat protection dashboard"
|
|
481
|
+
</bd-p>
|
|
482
|
+
</div>
|
|
483
|
+
|
|
484
|
+
<div style="border: 2px solid #ef4444; padding: 2rem; border-radius: 12px; background: #fef2f2;">
|
|
485
|
+
<bd-h as="h3" style="color: #dc2626; margin-bottom: 1rem;">❌ Poor Alt Text</bd-h>
|
|
486
|
+
<bd-img
|
|
487
|
+
src="/assets/bd-header-us.jpg"
|
|
488
|
+
alt="image123.jpg"
|
|
489
|
+
width="300"
|
|
490
|
+
height="200"
|
|
491
|
+
fit="cover"
|
|
492
|
+
radius="md"
|
|
493
|
+
></bd-img>
|
|
494
|
+
<bd-p kind="regular" style="margin-top: 1.5rem;">
|
|
495
|
+
<strong>File names:</strong> Never use file names as alt text<br>
|
|
496
|
+
<strong>Placeholders:</strong> Avoid generic text like "image" or "photo"<br>
|
|
497
|
+
<strong>Redundancy:</strong> Don't start with "image of" or "picture of"
|
|
498
|
+
</bd-p>
|
|
499
|
+
<bd-p kind="small" style="color: #dc2626; margin-top: 1rem;">
|
|
500
|
+
❌ Screen readers will read: "image123.jpg" - meaningless to users
|
|
501
|
+
</bd-p>
|
|
502
|
+
</div>
|
|
191
503
|
</div>
|
|
192
504
|
|
|
193
|
-
<div>
|
|
194
|
-
<bd-h as="
|
|
505
|
+
<div style="border: 2px solid #e2e8f0; padding: 2rem; border-radius: 12px;">
|
|
506
|
+
<bd-h as="h3" style="color: #3b82f6; margin-bottom: 1rem;">Decorative Images</bd-h>
|
|
507
|
+
<bd-p kind="regular" style="margin-bottom: 1.5rem;">
|
|
508
|
+
For purely decorative images that don't convey meaningful content, use empty alt text to prevent screen readers from announcing them.
|
|
509
|
+
</bd-p>
|
|
195
510
|
<bd-img
|
|
196
511
|
src="/assets/bd-header-us.jpg"
|
|
197
|
-
alt="
|
|
198
|
-
width="
|
|
199
|
-
height="
|
|
200
|
-
loading="eager"
|
|
512
|
+
alt=""
|
|
513
|
+
width="300"
|
|
514
|
+
height="100"
|
|
201
515
|
fit="cover"
|
|
516
|
+
radius="md"
|
|
202
517
|
></bd-img>
|
|
203
|
-
<p style="
|
|
204
|
-
|
|
205
|
-
</p>
|
|
518
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 1rem;">
|
|
519
|
+
✅ Empty alt attribute: <code>alt=""</code> - Screen readers will skip this image entirely
|
|
520
|
+
</bd-p>
|
|
206
521
|
</div>
|
|
207
522
|
</div>
|
|
208
523
|
`;
|
|
524
|
+
AccessibilityExamples.parameters = {
|
|
525
|
+
docs: {
|
|
526
|
+
description: {
|
|
527
|
+
story: 'Accessibility guidelines and examples showing proper alt text usage, common mistakes to avoid, and how to handle decorative images. Essential for creating inclusive experiences for screen reader users.'
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
};
|
|
209
531
|
|
|
210
532
|
export const ResponsiveSizes = () => html`
|
|
211
|
-
<div style="display: flex; flex-direction: column; gap:
|
|
212
|
-
<
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
alt="Small security image"
|
|
217
|
-
width="400"
|
|
218
|
-
height="250"
|
|
219
|
-
fit="cover"
|
|
220
|
-
></bd-img>
|
|
221
|
-
</div>
|
|
222
|
-
|
|
223
|
-
<div>
|
|
224
|
-
<bd-h as="h4">Medium (600px)</bd-h>
|
|
225
|
-
<bd-img
|
|
226
|
-
src="/assets/bd-header-us.jpg"
|
|
227
|
-
alt="Medium security image"
|
|
228
|
-
width="600"
|
|
229
|
-
height="375"
|
|
230
|
-
fit="cover"
|
|
231
|
-
></bd-img>
|
|
232
|
-
</div>
|
|
533
|
+
<div style="display: flex; flex-direction: column; gap: 3rem; max-width: 800px; margin: 0 auto; padding: 2rem;">
|
|
534
|
+
<bd-h as="h2" style="margin-bottom: 1rem;">Responsive Size Examples</bd-h>
|
|
535
|
+
<bd-p kind="regular" style="margin-bottom: 2rem;">
|
|
536
|
+
Images should adapt to different screen sizes and layout requirements. Here are common size patterns for various use cases.
|
|
537
|
+
</bd-p>
|
|
233
538
|
|
|
234
|
-
<div>
|
|
235
|
-
<
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
539
|
+
<div style="display: flex; flex-direction: column; gap: 2rem;">
|
|
540
|
+
<div>
|
|
541
|
+
<bd-h as="h4" style="margin-bottom: 1rem;">Small (400px) - Thumbnails & Icons</bd-h>
|
|
542
|
+
<bd-img
|
|
543
|
+
src="/assets/bd-header-us.jpg"
|
|
544
|
+
alt="Small security image for thumbnails"
|
|
545
|
+
width="400"
|
|
546
|
+
height="250"
|
|
547
|
+
fit="cover"
|
|
548
|
+
radius="md"
|
|
549
|
+
></bd-img>
|
|
550
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 1rem;">
|
|
551
|
+
Ideal for product thumbnails, user avatars, and icon-sized images in lists and grids.
|
|
552
|
+
</bd-p>
|
|
553
|
+
</div>
|
|
554
|
+
|
|
555
|
+
<div>
|
|
556
|
+
<bd-h as="h4" style="margin-bottom: 1rem;">Medium (600px) - Content Images</bd-h>
|
|
557
|
+
<bd-img
|
|
558
|
+
src="/assets/bd-header-us.jpg"
|
|
559
|
+
alt="Medium security image for content"
|
|
560
|
+
width="600"
|
|
561
|
+
height="375"
|
|
562
|
+
fit="cover"
|
|
563
|
+
radius="md"
|
|
564
|
+
></bd-img>
|
|
565
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 1rem;">
|
|
566
|
+
Perfect for blog posts, article content, and feature sections within page layouts.
|
|
567
|
+
</bd-p>
|
|
568
|
+
</div>
|
|
569
|
+
|
|
570
|
+
<div>
|
|
571
|
+
<bd-h as="h4" style="margin-bottom: 1rem;">Large (750px) - Hero & Header Images</bd-h>
|
|
572
|
+
<bd-img
|
|
573
|
+
src="/assets/bd-header-us.jpg"
|
|
574
|
+
alt="Large security image for hero sections"
|
|
575
|
+
width="750"
|
|
576
|
+
height="500"
|
|
577
|
+
fit="cover"
|
|
578
|
+
radius="none"
|
|
579
|
+
></bd-img>
|
|
580
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 1rem;">
|
|
581
|
+
Designed for hero sections, header images, and prominent visual elements that need maximum impact.
|
|
582
|
+
</bd-p>
|
|
583
|
+
</div>
|
|
243
584
|
</div>
|
|
244
585
|
</div>
|
|
245
|
-
`;
|
|
586
|
+
`;
|
|
587
|
+
ResponsiveSizes.parameters = {
|
|
588
|
+
docs: {
|
|
589
|
+
description: {
|
|
590
|
+
story: 'Common image size patterns for different use cases including thumbnails (small), content images (medium), and hero images (large) with recommendations for when to use each size category.'
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
};
|
|
594
|
+
|
|
595
|
+
export const HeaderImageExample = Template.bind({});
|
|
596
|
+
HeaderImageExample.args = {
|
|
597
|
+
src : '/assets/bd-header-us.jpg',
|
|
598
|
+
alt : 'Bitdefender Ultimate Security Header - Advanced threat protection dashboard with real-time monitoring',
|
|
599
|
+
width : 750,
|
|
600
|
+
height : 500,
|
|
601
|
+
loading: 'eager',
|
|
602
|
+
fit : 'cover',
|
|
603
|
+
radius : 'none',
|
|
604
|
+
shadow : 'none'
|
|
605
|
+
};
|
|
606
|
+
HeaderImageExample.parameters = {
|
|
607
|
+
docs: {
|
|
608
|
+
description: {
|
|
609
|
+
story: 'Example of a header image configuration with eager loading (for above-the-fold content), cover fit to fill the container, and descriptive alt text for accessibility.'
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
};
|
|
613
|
+
|
|
614
|
+
export const InteractivePlayground = Template.bind({});
|
|
615
|
+
InteractivePlayground.args = {
|
|
616
|
+
src : '/assets/bd-header-us.jpg',
|
|
617
|
+
alt : 'Customizable image example',
|
|
618
|
+
width : 400,
|
|
619
|
+
height : 250,
|
|
620
|
+
loading: 'lazy',
|
|
621
|
+
fit : 'cover',
|
|
622
|
+
radius : 'none',
|
|
623
|
+
shadow : 'none'
|
|
624
|
+
};
|
|
625
|
+
InteractivePlayground.parameters = {
|
|
626
|
+
docs: {
|
|
627
|
+
description: {
|
|
628
|
+
story: 'Interactive playground where you can test all image properties in real-time. Use the controls panel to modify the image source, dimensions, loading strategy, fit behavior, and styling options.'
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
};
|