@repobit/dex-system-design 0.21.2 → 0.22.1
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 +19 -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.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 +77 -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 +49 -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 +353 -270
- 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,53 +1,81 @@
|
|
|
1
1
|
import { html } from 'lit';
|
|
2
2
|
import '../heading/heading.js';
|
|
3
|
+
import '../paragraph/paragraph.js';
|
|
3
4
|
import './back.js';
|
|
4
5
|
|
|
5
6
|
export default {
|
|
6
7
|
title : 'Components/Back',
|
|
7
8
|
component: 'bd-back',
|
|
9
|
+
tags : ['autodocs'],
|
|
8
10
|
argTypes : {
|
|
9
11
|
label: {
|
|
10
12
|
control : 'text',
|
|
11
|
-
description: '
|
|
13
|
+
description: 'Text label displayed on the back button',
|
|
14
|
+
table : {
|
|
15
|
+
type : { summary: 'string' },
|
|
16
|
+
defaultValue: { summary: 'Back' }
|
|
17
|
+
}
|
|
12
18
|
},
|
|
13
19
|
href: {
|
|
14
20
|
control : 'text',
|
|
15
|
-
description: 'Optional
|
|
21
|
+
description: 'Optional URL for specific navigation target',
|
|
22
|
+
table : {
|
|
23
|
+
type : { summary: 'string' },
|
|
24
|
+
defaultValue: { summary: '' }
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
color: {
|
|
28
|
+
control : 'color',
|
|
29
|
+
description: 'Custom text color for the back button',
|
|
30
|
+
table : {
|
|
31
|
+
type : { summary: 'string' },
|
|
32
|
+
defaultValue: { summary: 'var(--color-neutral-1000)' }
|
|
33
|
+
}
|
|
16
34
|
}
|
|
17
35
|
},
|
|
18
36
|
parameters: {
|
|
19
37
|
docs: {
|
|
20
38
|
description: {
|
|
21
|
-
component: 'A
|
|
39
|
+
component: 'A mobile-inspired back button component with bold black styling designed for intuitive navigation. Provides both browser history navigation and specific URL targeting with consistent visual hierarchy.'
|
|
22
40
|
}
|
|
23
41
|
}
|
|
24
42
|
}
|
|
25
43
|
};
|
|
26
44
|
|
|
27
|
-
const Template = ({ label, href }) => html`
|
|
28
|
-
<bd-back
|
|
45
|
+
const Template = ({ label, href, color }) => html`
|
|
46
|
+
<bd-back
|
|
47
|
+
label="${label}"
|
|
48
|
+
href="${href}"
|
|
49
|
+
style="${color ? `color: ${color};` : ''}"
|
|
50
|
+
></bd-back>
|
|
29
51
|
`;
|
|
30
52
|
|
|
53
|
+
// ============ STORIES ============
|
|
54
|
+
|
|
31
55
|
export const Default = Template.bind({});
|
|
32
56
|
Default.args = {
|
|
33
|
-
label: 'Back'
|
|
57
|
+
label: 'Back',
|
|
58
|
+
href : '',
|
|
59
|
+
color: ''
|
|
34
60
|
};
|
|
35
61
|
Default.parameters = {
|
|
36
62
|
docs: {
|
|
37
63
|
description: {
|
|
38
|
-
story: 'Default back button with bold black styling
|
|
64
|
+
story: 'Default back button with bold black styling. When clicked without an href, it uses the browser\'s history back() method to return to the previous page.'
|
|
39
65
|
}
|
|
40
66
|
}
|
|
41
67
|
};
|
|
42
68
|
|
|
43
69
|
export const CustomLabel = Template.bind({});
|
|
44
70
|
CustomLabel.args = {
|
|
45
|
-
label: 'Înapoi'
|
|
71
|
+
label: 'Înapoi',
|
|
72
|
+
href : '',
|
|
73
|
+
color: ''
|
|
46
74
|
};
|
|
47
75
|
CustomLabel.parameters = {
|
|
48
76
|
docs: {
|
|
49
77
|
description: {
|
|
50
|
-
story: 'Back button with custom label
|
|
78
|
+
story: 'Back button with localized or custom label text. Perfect for internationalization or specific application contexts where "Back" may not be appropriate.'
|
|
51
79
|
}
|
|
52
80
|
}
|
|
53
81
|
};
|
|
@@ -55,18 +83,94 @@ CustomLabel.parameters = {
|
|
|
55
83
|
export const WithHref = Template.bind({});
|
|
56
84
|
WithHref.args = {
|
|
57
85
|
label: 'Back to Home',
|
|
58
|
-
href : '/home'
|
|
86
|
+
href : '/home',
|
|
87
|
+
color: ''
|
|
59
88
|
};
|
|
60
89
|
WithHref.parameters = {
|
|
61
90
|
docs: {
|
|
62
91
|
description: {
|
|
63
|
-
story: 'Back button
|
|
92
|
+
story: 'Back button that navigates to a specific URL when provided with an href attribute. Useful for when you need to direct users to a specific page rather than using browser history.'
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export const ComponentShowcase = () => html`
|
|
98
|
+
<div style="display: flex; flex-direction: column; gap: 3rem; max-width: 1000px; margin: 0 auto; padding: 2rem;">
|
|
99
|
+
<bd-h as="h2" style="margin-bottom: 1rem;">Back Button Component Features</bd-h>
|
|
100
|
+
<bd-p kind="regular" style="margin-bottom: 2rem;">
|
|
101
|
+
Explore the versatile applications and design characteristics of the bold black back button component.
|
|
102
|
+
</bd-p>
|
|
103
|
+
|
|
104
|
+
<div style="border: 2px solid #e2e8f0; padding: 2rem; border-radius: 12px;">
|
|
105
|
+
<bd-h as="h3" style="color: #3b82f6; margin-bottom: 1rem;">Standard Usage Patterns</bd-h>
|
|
106
|
+
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem;">
|
|
107
|
+
<div>
|
|
108
|
+
<bd-h as="h4" style="margin-bottom: 0.5rem;">Browser History</bd-h>
|
|
109
|
+
<bd-back label="Back"></bd-back>
|
|
110
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 0.5rem;">
|
|
111
|
+
Uses <code>window.history.back()</code><br>
|
|
112
|
+
No href attribute needed
|
|
113
|
+
</bd-p>
|
|
114
|
+
</div>
|
|
115
|
+
|
|
116
|
+
<div>
|
|
117
|
+
<bd-h as="h4" style="margin-bottom: 0.5rem;">Specific Navigation</bd-h>
|
|
118
|
+
<bd-back label="Products" href="/products"></bd-back>
|
|
119
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 0.5rem;">
|
|
120
|
+
Directs to specific URL<br>
|
|
121
|
+
Uses anchor tag behavior
|
|
122
|
+
</bd-p>
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
<div>
|
|
126
|
+
<bd-h as="h4" style="margin-bottom: 0.5rem;">Localized</bd-h>
|
|
127
|
+
<bd-back label="Retour"></bd-back>
|
|
128
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 0.5rem;">
|
|
129
|
+
French localization example<br>
|
|
130
|
+
Adapts to user language
|
|
131
|
+
</bd-p>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
|
|
136
|
+
<div style="border: 2px solid #e2e8f0; padding: 2rem; border-radius: 12px;">
|
|
137
|
+
<bd-h as="h3" style="color: #3b82f6; margin-bottom: 1rem;">Design Characteristics</bd-h>
|
|
138
|
+
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;">
|
|
139
|
+
<div>
|
|
140
|
+
<bd-h as="h4" style="margin-bottom: 1rem;">Visual Properties</bd-h>
|
|
141
|
+
<bd-list type="unordered" spacing="sm" variant="default" orientation="vertical">
|
|
142
|
+
<bd-li kind="bullet" size="md"><strong>Color:</strong> Bold black (#000 or --color-neutral-1000)</bd-li>
|
|
143
|
+
<bd-li kind="bullet" size="md"><strong>Font Weight:</strong> Bold (600-700)</bd-li>
|
|
144
|
+
<bd-li kind="bullet" size="md"><strong>Typography:</strong> Clean, readable font stack</bd-li>
|
|
145
|
+
<bd-li kind="bullet" size="md"><strong>Spacing:</strong> Generous padding for touch targets</bd-li>
|
|
146
|
+
<bd-li kind="bullet" size="md"><strong>Hover:</strong> Subtle opacity changes</bd-li>
|
|
147
|
+
</bd-list>
|
|
148
|
+
</div>
|
|
149
|
+
|
|
150
|
+
<div>
|
|
151
|
+
<bd-h as="h4" style="margin-bottom: 1rem;">Interaction Patterns</bd-h>
|
|
152
|
+
<bd-list type="unordered" spacing="sm" variant="default" orientation="vertical">
|
|
153
|
+
<bd-li kind="bullet" size="md"><strong>Click:</strong> Navigates back or to href</bd-li>
|
|
154
|
+
<bd-li kind="bullet" size="md"><strong>Keyboard:</strong> Tab-accessible, Enter/Space activation</bd-li>
|
|
155
|
+
<bd-li kind="bullet" size="md"><strong>Focus:</strong> Clear visual focus indicator</bd-li>
|
|
156
|
+
<bd-li kind="bullet" size="md"><strong>Mobile:</strong> Large touch target (min 44px)</bd-li>
|
|
157
|
+
<bd-li kind="bullet" size="md"><strong>States:</strong> Normal, hover, active, focus</bd-li>
|
|
158
|
+
</bd-list>
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
`;
|
|
164
|
+
ComponentShowcase.parameters = {
|
|
165
|
+
docs: {
|
|
166
|
+
description: {
|
|
167
|
+
story: 'Comprehensive showcase of back button features including standard usage patterns, design characteristics, and interaction behaviors with detailed technical specifications.'
|
|
64
168
|
}
|
|
65
169
|
}
|
|
66
170
|
};
|
|
67
171
|
|
|
68
172
|
export const MobileContext = () => html`
|
|
69
|
-
<div style="max-width: 400px; margin: 0 auto; padding: 1rem; background: #f8fafc; min-height: 100vh;">
|
|
173
|
+
<div style="max-width: 400px; margin: 0 auto; padding: 1rem; background: #f8fafc; min-height: 100vh; border: 2px solid #e2e8f0; border-radius: 12px;">
|
|
70
174
|
<div style="margin-bottom: 2rem;">
|
|
71
175
|
<bd-back label="Back"></bd-back>
|
|
72
176
|
</div>
|
|
@@ -74,111 +178,245 @@ export const MobileContext = () => html`
|
|
|
74
178
|
<div style="background: white; padding: 2rem; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);">
|
|
75
179
|
<bd-h as="h2" style="margin-bottom: 1rem;">Product Details</bd-h>
|
|
76
180
|
<bd-p kind="regular" style="margin-bottom: 1rem;">
|
|
77
|
-
This
|
|
78
|
-
|
|
79
|
-
<bd-p kind="small" style="color: #64748b;">
|
|
80
|
-
Tap the back button to return to the previous screen.
|
|
181
|
+
This mobile-style layout demonstrates the back button in its natural context. The bold black styling
|
|
182
|
+
provides clear visual hierarchy and follows established mobile navigation patterns.
|
|
81
183
|
</bd-p>
|
|
184
|
+
|
|
185
|
+
<div style="background: #f0f9ff; padding: 1rem; border-radius: 8px; margin-top: 1.5rem;">
|
|
186
|
+
<bd-h as="h4" style="color: #0369a1; margin-bottom: 0.5rem;">Mobile Design Principles</bd-h>
|
|
187
|
+
<bd-list type="unordered" spacing="sm" variant="default" orientation="vertical">
|
|
188
|
+
<bd-li kind="bullet" size="md">Top-left positioning for thumb reachability</bd-li>
|
|
189
|
+
<bd-li kind="bullet" size="md">Bold color for immediate recognition</bd-li>
|
|
190
|
+
<bd-li kind="bullet" size="md">Clear label for intuitive interaction</bd-li>
|
|
191
|
+
<bd-li kind="bullet" size="md">Consistent with iOS/Android patterns</bd-li>
|
|
192
|
+
</bd-list>
|
|
193
|
+
</div>
|
|
82
194
|
</div>
|
|
83
195
|
</div>
|
|
84
196
|
`;
|
|
85
197
|
MobileContext.parameters = {
|
|
86
198
|
docs: {
|
|
87
199
|
description: {
|
|
88
|
-
story: '
|
|
200
|
+
story: 'Mobile-optimized context showing the back button in a typical mobile application layout with design principles and best practices for mobile navigation.'
|
|
89
201
|
}
|
|
90
202
|
}
|
|
91
203
|
};
|
|
92
204
|
|
|
93
205
|
export const MultipleVariants = () => html`
|
|
94
|
-
<div style="display: flex; flex-direction: column; gap:
|
|
95
|
-
<bd-
|
|
96
|
-
|
|
97
|
-
<
|
|
98
|
-
|
|
206
|
+
<div style="display: flex; flex-direction: column; gap: 2rem; max-width: 600px; margin: 0 auto; padding: 2rem;">
|
|
207
|
+
<bd-h as="h2" style="margin-bottom: 1rem;">Back Button Variants</bd-h>
|
|
208
|
+
|
|
209
|
+
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem;">
|
|
210
|
+
<div style="border: 1px solid #e2e8f0; padding: 1.5rem; border-radius: 8px;">
|
|
211
|
+
<bd-h as="h4" style="margin-bottom: 1rem;">Standard</bd-h>
|
|
212
|
+
<bd-back label="Back"></bd-back>
|
|
213
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 0.5rem;">
|
|
214
|
+
Default browser history navigation
|
|
215
|
+
</bd-p>
|
|
216
|
+
</div>
|
|
217
|
+
|
|
218
|
+
<div style="border: 1px solid #e2e8f0; padding: 1.5rem; border-radius: 8px;">
|
|
219
|
+
<bd-h as="h4" style="margin-bottom: 1rem;">Localized</bd-h>
|
|
220
|
+
<bd-back label="Înapoi"></bd-back>
|
|
221
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 0.5rem;">
|
|
222
|
+
Romanian localization example
|
|
223
|
+
</bd-p>
|
|
224
|
+
</div>
|
|
225
|
+
|
|
226
|
+
<div style="border: 1px solid #e2e8f0; padding: 1.5rem; border-radius: 8px;">
|
|
227
|
+
<bd-h as="h4" style="margin-bottom: 1rem;">Specific Target</bd-h>
|
|
228
|
+
<bd-back label="Back to Home" href="#home"></bd-back>
|
|
229
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 0.5rem;">
|
|
230
|
+
Direct navigation to home page
|
|
231
|
+
</bd-p>
|
|
232
|
+
</div>
|
|
233
|
+
|
|
234
|
+
<div style="border: 1px solid #e2e8f0; padding: 1.5rem; border-radius: 8px;">
|
|
235
|
+
<bd-h as="h4" style="margin-bottom: 1rem;">With Icon</bd-h>
|
|
236
|
+
<bd-back label="← Back" style="font-size: 0.9rem;"></bd-back>
|
|
237
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 0.5rem;">
|
|
238
|
+
Optional arrow icon prefix
|
|
239
|
+
</bd-p>
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
99
242
|
</div>
|
|
100
243
|
`;
|
|
101
244
|
MultipleVariants.parameters = {
|
|
102
245
|
docs: {
|
|
103
246
|
description: {
|
|
104
|
-
story: '
|
|
247
|
+
story: 'Collection of different back button variants demonstrating various use cases including localization, specific navigation targets, and optional icon integration.'
|
|
105
248
|
}
|
|
106
249
|
}
|
|
107
250
|
};
|
|
108
251
|
|
|
109
|
-
export const
|
|
110
|
-
<div style="
|
|
111
|
-
<bd-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
252
|
+
export const BackgroundContexts = () => html`
|
|
253
|
+
<div style="display: flex; flex-direction: column; gap: 2rem; max-width: 800px; margin: 0 auto; padding: 2rem;">
|
|
254
|
+
<bd-h as="h2" style="margin-bottom: 1rem;">Background Context Examples</bd-h>
|
|
255
|
+
|
|
256
|
+
<div style="background: white; padding: 2rem; border-radius: 12px; border: 2px solid #e2e8f0;">
|
|
257
|
+
<bd-h as="h3" style="margin-bottom: 1rem;">Light Background</bd-h>
|
|
258
|
+
<bd-back label="Back"></bd-back>
|
|
259
|
+
<bd-p kind="small" style="color: #64748b; margin-top: 1rem;">
|
|
260
|
+
The bold black color provides maximum contrast and visibility on light backgrounds,
|
|
261
|
+
ensuring the back button is immediately noticeable and accessible.
|
|
262
|
+
</bd-p>
|
|
263
|
+
</div>
|
|
264
|
+
|
|
265
|
+
<div style="background: #1e293b; padding: 2rem; border-radius: 12px; border: 2px solid #334155;">
|
|
266
|
+
<bd-h as="h3" style="color: white; margin-bottom: 1rem;">Dark Background</bd-h>
|
|
267
|
+
<bd-back label="Back"></bd-back>
|
|
268
|
+
<bd-p kind="small" style="color: #cbd5e1; margin-top: 1rem;">
|
|
269
|
+
On dark backgrounds, the bold black styling maintains its strong visual presence
|
|
270
|
+
while providing sufficient contrast for readability and accessibility.
|
|
271
|
+
</bd-p>
|
|
272
|
+
</div>
|
|
273
|
+
|
|
274
|
+
<div style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 2rem; border-radius: 12px;">
|
|
275
|
+
<bd-h as="h3" style="color: white; margin-bottom: 1rem;">Gradient Background</bd-h>
|
|
276
|
+
<bd-back label="Back"></bd-back>
|
|
277
|
+
<bd-p kind="small" style="color: rgba(255,255,255,0.8); margin-top: 1rem;">
|
|
278
|
+
Even on complex gradient backgrounds, the bold black back button remains clearly
|
|
279
|
+
visible and maintains its functional purpose as a navigation element.
|
|
280
|
+
</bd-p>
|
|
281
|
+
</div>
|
|
115
282
|
</div>
|
|
116
283
|
`;
|
|
117
|
-
|
|
284
|
+
BackgroundContexts.parameters = {
|
|
118
285
|
docs: {
|
|
119
286
|
description: {
|
|
120
|
-
story: 'Back button
|
|
287
|
+
story: 'Back button displayed across different background contexts demonstrating its versatility and consistent visibility on light, dark, and gradient backgrounds.'
|
|
121
288
|
}
|
|
122
289
|
}
|
|
123
290
|
};
|
|
124
291
|
|
|
125
|
-
export const
|
|
126
|
-
<div style="
|
|
127
|
-
<bd-
|
|
128
|
-
<bd-p kind="
|
|
129
|
-
|
|
292
|
+
export const AccessibilityFeatures = () => html`
|
|
293
|
+
<div style="max-width: 800px; margin: 0 auto; padding: 2rem;">
|
|
294
|
+
<bd-h as="h2" style="margin-bottom: 1rem;">Accessibility Implementation</bd-h>
|
|
295
|
+
<bd-p kind="regular" style="margin-bottom: 2rem;">
|
|
296
|
+
The back button component is built with accessibility as a core principle, ensuring
|
|
297
|
+
all users can effectively navigate regardless of their abilities or assistive technologies.
|
|
130
298
|
</bd-p>
|
|
299
|
+
|
|
300
|
+
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem;">
|
|
301
|
+
<div style="border: 2px solid #10b981; padding: 1.5rem; border-radius: 8px; background: #f0fdf4;">
|
|
302
|
+
<bd-h as="h3" style="color: #059669; margin-bottom: 1rem;">✅ Keyboard Navigation</bd-h>
|
|
303
|
+
<bd-list type="unordered" spacing="sm" variant="default" orientation="vertical">
|
|
304
|
+
<bd-li kind="bullet" size="md"><strong>Tab:</strong> Focusable in natural tab order</bd-li>
|
|
305
|
+
<bd-li kind="bullet" size="md"><strong>Enter/Space:</strong> Activates the button</bd-li>
|
|
306
|
+
<bd-li kind="bullet" size="md"><strong>Focus Indicator:</strong> Clear visual focus ring</bd-li>
|
|
307
|
+
<bd-li kind="bullet" size="md"><strong>Skip Links:</strong> Compatible with skip navigation</bd-li>
|
|
308
|
+
</bd-list>
|
|
309
|
+
</div>
|
|
310
|
+
|
|
311
|
+
<div style="border: 2px solid #3b82f6; padding: 1.5rem; border-radius: 8px; background: #eff6ff;">
|
|
312
|
+
<bd-h as="h3" style="color: #1d4ed8; margin-bottom: 1rem;">✅ Screen Reader Support</bd-h>
|
|
313
|
+
<bd-list type="unordered" spacing="sm" variant="default" orientation="vertical">
|
|
314
|
+
<bd-li kind="bullet" size="md"><strong>Semantic HTML:</strong> Proper button or anchor element</bd-li>
|
|
315
|
+
<bd-li kind="bullet" size="md"><strong>ARIA Labels:</strong> Descriptive accessible name</bd-li>
|
|
316
|
+
<bd-li kind="bullet" size="md"><strong>State Announcement:</strong> Clear action description</bd-li>
|
|
317
|
+
<bd-li kind="bullet" size="md"><strong>Role:</strong> Appropriate button or link role</bd-li>
|
|
318
|
+
</bd-list>
|
|
319
|
+
</div>
|
|
320
|
+
|
|
321
|
+
<div style="border: 2px solid #8b5cf6; padding: 1.5rem; border-radius: 8px; background: #faf5ff;">
|
|
322
|
+
<bd-h as="h3" style="color: #7c3aed; margin-bottom: 1rem;">✅ Visual Accessibility</bd-h>
|
|
323
|
+
<bd-list type="unordered" spacing="sm" variant="default" orientation="vertical">
|
|
324
|
+
<bd-li kind="bullet" size="md"><strong>Contrast Ratio:</strong> WCAG AA compliant (4.5:1+)</bd-li>
|
|
325
|
+
<bd-li kind="bullet" size="md"><strong>Text Size:</strong> Responsive and scalable</bd-li>
|
|
326
|
+
<bd-li kind="bullet" size="md"><strong>Touch Target:</strong> Minimum 44px for mobile</bd-li>
|
|
327
|
+
<bd-li kind="bullet" size="md"><strong>Color Independence:</strong> Not reliant on color alone</bd-li>
|
|
328
|
+
</bd-list>
|
|
329
|
+
</div>
|
|
330
|
+
</div>
|
|
331
|
+
|
|
332
|
+
<div style="margin-top: 2rem; padding: 1.5rem; background: #f8fafc; border-radius: 8px;">
|
|
333
|
+
<bd-h as="h3" style="margin-bottom: 1rem;">Testing Instructions</bd-h>
|
|
334
|
+
<bd-p kind="small" style="color: #64748b;">
|
|
335
|
+
<strong>Keyboard Test:</strong> Try tabbing to the back button and activating it with Enter/Space<br>
|
|
336
|
+
<strong>Screen Reader Test:</strong> Listen to how the button is announced with NVDA, JAWS, or VoiceOver<br>
|
|
337
|
+
<strong>Zoom Test:</strong> Increase browser zoom to 200% to verify text remains readable<br>
|
|
338
|
+
<strong>Color Test:</strong> Use grayscale mode to ensure the button remains distinguishable
|
|
339
|
+
</bd-p>
|
|
340
|
+
</div>
|
|
131
341
|
</div>
|
|
132
342
|
`;
|
|
133
|
-
|
|
343
|
+
AccessibilityFeatures.parameters = {
|
|
134
344
|
docs: {
|
|
135
345
|
description: {
|
|
136
|
-
story: '
|
|
346
|
+
story: 'Comprehensive accessibility documentation covering keyboard navigation, screen reader support, visual accessibility features, and testing procedures for the back button component.'
|
|
137
347
|
}
|
|
138
348
|
}
|
|
139
349
|
};
|
|
140
350
|
|
|
141
351
|
export const InteractiveDemo = () => {
|
|
142
352
|
return html`
|
|
143
|
-
<div style="max-width:
|
|
144
|
-
<bd-h as="h2" style="margin-bottom: 2rem;">
|
|
353
|
+
<div style="max-width: 800px; margin: 0 auto; padding: 2rem;">
|
|
354
|
+
<bd-h as="h2" style="margin-bottom: 2rem;">Interactive Back Button Demo</bd-h>
|
|
145
355
|
|
|
146
|
-
<div style="display: grid; grid-template-columns: 1fr 1fr; gap:
|
|
356
|
+
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-bottom: 3rem;">
|
|
147
357
|
<div>
|
|
148
|
-
<bd-h as="h3" style="margin-bottom: 1rem;">
|
|
149
|
-
<
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
358
|
+
<bd-h as="h3" style="margin-bottom: 1rem;">Navigation Behavior</bd-h>
|
|
359
|
+
<div style="display: flex; flex-direction: column; gap: 1rem;">
|
|
360
|
+
<bd-back label="Back (History)"></bd-back>
|
|
361
|
+
<bd-p kind="small" style="color: #64748b;">
|
|
362
|
+
Uses: <code>window.history.back()</code><br>
|
|
363
|
+
Returns to previous page in browser history
|
|
364
|
+
</bd-p>
|
|
365
|
+
|
|
366
|
+
<bd-back label="Go Home" href="#home-demo"></bd-back>
|
|
367
|
+
<bd-p kind="small" style="color: #64748b;">
|
|
368
|
+
Uses: Anchor tag with href<br>
|
|
369
|
+
Navigates to specific URL location
|
|
370
|
+
</bd-p>
|
|
371
|
+
</div>
|
|
155
372
|
</div>
|
|
156
373
|
|
|
157
374
|
<div>
|
|
158
|
-
<bd-h as="h3" style="margin-bottom: 1rem;">
|
|
159
|
-
<
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
375
|
+
<bd-h as="h3" style="margin-bottom: 1rem;">Design Specifications</bd-h>
|
|
376
|
+
<div style="background: #f8fafc; padding: 1.5rem; border-radius: 8px;">
|
|
377
|
+
<bd-list type="unordered" spacing="sm" variant="default" orientation="vertical">
|
|
378
|
+
<bd-li kind="bullet" size="md"><strong>Color:</strong> var(--color-neutral-1000)</bd-li>
|
|
379
|
+
<bd-li kind="bullet" size="md"><strong>Font Weight:</strong> var(--typography-fontWeight-bold)</bd-li>
|
|
380
|
+
<bd-li kind="bullet" size="md"><strong>Font Size:</strong> var(--typography-fontSize-base)</bd-li>
|
|
381
|
+
<bd-li kind="bullet" size="md"><strong>Padding:</strong> var(--spacing-12) var(--spacing-16)</bd-li>
|
|
382
|
+
<bd-li kind="bullet" size="md"><strong>Border Radius:</strong> var(--radius-sm)</bd-li>
|
|
383
|
+
<bd-li kind="bullet" size="md"><strong>Transition:</strong> opacity 0.2s ease</bd-li>
|
|
384
|
+
</bd-list>
|
|
385
|
+
</div>
|
|
164
386
|
</div>
|
|
165
387
|
</div>
|
|
166
388
|
|
|
167
|
-
<
|
|
168
|
-
<
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
389
|
+
<div style="background: #f0f9ff; padding: 1.5rem; border-radius: 8px;">
|
|
390
|
+
<bd-h as="h3" style="color: #0369a1; margin-bottom: 1rem;">Mobile-First Design Principles</bd-h>
|
|
391
|
+
<bd-list type="unordered" spacing="sm" variant="default" orientation="vertical">
|
|
392
|
+
<bd-li kind="bullet" size="md"><strong>Thumb-Friendly:</strong> Positioned in top-left for easy reach</bd-li>
|
|
393
|
+
<bd-li kind="bullet" size="md"><strong>Clear Hierarchy:</strong> Bold styling for immediate recognition</bd-li>
|
|
394
|
+
<bd-li kind="bullet" size="md"><strong>Consistent Patterns:</strong> Follows iOS/Android navigation standards</bd-li>
|
|
395
|
+
<bd-li kind="bullet" size="md"><strong>Touch Optimized:</strong> Minimum 44px touch target size</bd-li>
|
|
396
|
+
<bd-li kind="bullet" size="md"><strong>Performance:</strong> Fast, responsive interaction</bd-li>
|
|
397
|
+
</bd-list>
|
|
398
|
+
</div>
|
|
175
399
|
</div>
|
|
176
400
|
`;
|
|
177
401
|
};
|
|
178
402
|
InteractiveDemo.parameters = {
|
|
179
403
|
docs: {
|
|
180
404
|
description: {
|
|
181
|
-
story: 'Interactive demonstration
|
|
405
|
+
story: 'Interactive demonstration showcasing back button navigation behaviors, design specifications, and mobile-first design principles with detailed technical implementation.'
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
|
|
410
|
+
export const InteractivePlayground = Template.bind({});
|
|
411
|
+
InteractivePlayground.args = {
|
|
412
|
+
label: 'Back',
|
|
413
|
+
href : '',
|
|
414
|
+
color: ''
|
|
415
|
+
};
|
|
416
|
+
InteractivePlayground.parameters = {
|
|
417
|
+
docs: {
|
|
418
|
+
description: {
|
|
419
|
+
story: 'Interactive playground where you can test all back button properties in real-time. Use the controls panel to modify the label, href, and color properties.'
|
|
182
420
|
}
|
|
183
421
|
}
|
|
184
422
|
};
|
|
@@ -8,7 +8,7 @@ export class BdBadge extends LitElement {
|
|
|
8
8
|
variant : { type: String },
|
|
9
9
|
size : { type: String }, // sm, md, lg
|
|
10
10
|
fontsize: { type: String }, // 12, 14, 16
|
|
11
|
-
icon : { type: String } // individual, family
|
|
11
|
+
icon : { type: String } // individual, family
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
constructor() {
|
|
@@ -16,9 +16,9 @@ export class BdBadge extends LitElement {
|
|
|
16
16
|
this.text = 'Badge';
|
|
17
17
|
this.color = '#026DFF';
|
|
18
18
|
this.variant = '';
|
|
19
|
-
this.size = 'md';
|
|
20
|
-
this.fontsize = '14';
|
|
21
|
-
this.icon = '';
|
|
19
|
+
this.size = 'md';
|
|
20
|
+
this.fontsize = '14';
|
|
21
|
+
this.icon = '';
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
updated(changed) {
|
|
@@ -81,10 +81,8 @@ export class BdBadge extends LitElement {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
_updateIcon() {
|
|
84
|
-
// Elimină clasele de iconițe vechi
|
|
85
84
|
this.classList.remove('icon-individual', 'icon-family');
|
|
86
85
|
|
|
87
|
-
// Adaugă clasa corespunzătoare iconiței
|
|
88
86
|
if (this.icon === 'individual') {
|
|
89
87
|
this.classList.add('icon-individual');
|
|
90
88
|
} else if (this.icon === 'family') {
|
|
@@ -95,7 +93,6 @@ export class BdBadge extends LitElement {
|
|
|
95
93
|
_renderIcon() {
|
|
96
94
|
if (!this.icon) return '';
|
|
97
95
|
|
|
98
|
-
// Poți extinde acest switch cu mai multe iconițe în viitor
|
|
99
96
|
switch (this.icon) {
|
|
100
97
|
case 'individual':
|
|
101
98
|
return html`<span class="badge-icon icon-individual"></span>`;
|