@ivds/core 0.1.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 +45 -0
- package/README.md +215 -0
- package/lib/all.css +6802 -0
- package/lib/all.min.css +1 -0
- package/lib/base/base.css +215 -0
- package/lib/base/base.min.css +1 -0
- package/lib/components/_breadcrumb-mixins.scss +173 -0
- package/lib/components/_button-mixin.scss +120 -0
- package/lib/components/_card-mixin.scss +196 -0
- package/lib/components/_checkbox-mixin.scss +208 -0
- package/lib/components/_footer-mixin.scss +385 -0
- package/lib/components/_header-mixin.scss +275 -0
- package/lib/components/_navigation-mixins.scss +270 -0
- package/lib/components/_notification-mixin.scss +239 -0
- package/lib/components/_pagination-mixins.scss +280 -0
- package/lib/components/_radio-button-mixin.scss +207 -0
- package/lib/components/_tag-mixin.scss +261 -0
- package/lib/components/_text-input-mixin.scss +203 -0
- package/lib/components/all.css +3005 -0
- package/lib/components/all.min.css +1 -0
- package/lib/components/breadcrumb/breadcrumb.css +141 -0
- package/lib/components/breadcrumb/breadcrumb.min.css +1 -0
- package/lib/components/button/button.css +221 -0
- package/lib/components/button/button.min.css +1 -0
- package/lib/components/card/card.css +236 -0
- package/lib/components/card/card.min.css +1 -0
- package/lib/components/checkbox/checkbox.css +305 -0
- package/lib/components/checkbox/checkbox.min.css +1 -0
- package/lib/components/footer/footer.css +466 -0
- package/lib/components/footer/footer.min.css +1 -0
- package/lib/components/header/header.css +274 -0
- package/lib/components/header/header.min.css +1 -0
- package/lib/components/navigation/navigation.css +214 -0
- package/lib/components/navigation/navigation.min.css +1 -0
- package/lib/components/notification/notification.css +253 -0
- package/lib/components/notification/notification.min.css +1 -0
- package/lib/components/pagination/pagination.css +221 -0
- package/lib/components/pagination/pagination.min.css +1 -0
- package/lib/components/radio-button/radio-button.css +326 -0
- package/lib/components/radio-button/radio-button.min.css +1 -0
- package/lib/components/tag/tag.css +367 -0
- package/lib/components/tag/tag.min.css +1 -0
- package/lib/components/text-input/text-input.css +243 -0
- package/lib/components/text-input/text-input.min.css +1 -0
- package/lib/icons/icon-arrow-left.css +139 -0
- package/lib/icons/icon-arrow-left.min.css +1 -0
- package/lib/icons/icon-arrow-right.css +139 -0
- package/lib/icons/icon-arrow-right.min.css +1 -0
- package/lib/icons/icon-check.css +139 -0
- package/lib/icons/icon-check.min.css +1 -0
- package/lib/icons/icon-close.css +140 -0
- package/lib/icons/icon-close.min.css +1 -0
- package/lib/icons/icon-error.css +140 -0
- package/lib/icons/icon-error.min.css +1 -0
- package/lib/icons/icon-info.css +140 -0
- package/lib/icons/icon-info.min.css +1 -0
- package/lib/icons/icon-success.css +139 -0
- package/lib/icons/icon-success.min.css +1 -0
- package/lib/icons/icon-warning.css +139 -0
- package/lib/icons/icon-warning.min.css +1 -0
- package/lib/icons/icons.css +1158 -0
- package/lib/icons/icons.min.css +1 -0
- package/lib/utils/_flex.scss +200 -0
- package/lib/utils/_grid.scss +211 -0
- package/lib/utils/_layout.scss +253 -0
- package/lib/utils/_spacing.scss +260 -0
- package/lib/utils/_typography.scss +111 -0
- package/lib/utils/utils.css +2434 -0
- package/lib/utils/utils.min.css +1 -0
- package/lib/utils-only.css +2801 -0
- package/lib/utils-only.min.css +1 -0
- package/lib/variables/variables.css +2 -0
- package/lib/variables/variables.min.css +0 -0
- package/package.json +194 -0
- package/src/__tests__/example.test.scss +12 -0
- package/src/accessibility.stories.js +416 -0
- package/src/all.scss +9 -0
- package/src/base/_layout.scss +97 -0
- package/src/base/_reset.scss +85 -0
- package/src/base/_typography.scss +105 -0
- package/src/base/base.scss +6 -0
- package/src/components/all.scss +22 -0
- package/src/components/breadcrumb/_breadcrumb-mixins.scss +173 -0
- package/src/components/breadcrumb/breadcrumb.scss +68 -0
- package/src/components/breadcrumb/breadcrumb.stories.js +483 -0
- package/src/components/button/__tests__/button-mixins.test.scss +35 -0
- package/src/components/button/_button-mixin.scss +120 -0
- package/src/components/button/button.scss +126 -0
- package/src/components/button/button.stories.js +364 -0
- package/src/components/card/__tests__/card-mixins.test.scss +36 -0
- package/src/components/card/_card-mixin.scss +196 -0
- package/src/components/card/card.scss +193 -0
- package/src/components/card/card.stories.js +635 -0
- package/src/components/checkbox/_checkbox-mixin.scss +208 -0
- package/src/components/checkbox/checkbox.scss +141 -0
- package/src/components/checkbox/checkbox.stories.js +303 -0
- package/src/components/footer/_footer-mixin.scss +385 -0
- package/src/components/footer/footer.scss +86 -0
- package/src/components/footer/footer.stories.js +740 -0
- package/src/components/header/_header-mixin.scss +275 -0
- package/src/components/header/header.scss +84 -0
- package/src/components/header/header.stories.js +450 -0
- package/src/components/navigation/_navigation-mixins.scss +270 -0
- package/src/components/navigation/navigation.scss +64 -0
- package/src/components/navigation/navigation.stories.js +410 -0
- package/src/components/notification/_notification-mixin.scss +239 -0
- package/src/components/notification/notification.scss +118 -0
- package/src/components/notification/notification.stories.js +378 -0
- package/src/components/overview.stories.js +473 -0
- package/src/components/pagination/_pagination-mixins.scss +280 -0
- package/src/components/pagination/pagination.scss +76 -0
- package/src/components/pagination/pagination.stories.js +729 -0
- package/src/components/radio-button/_radio-button-mixin.scss +207 -0
- package/src/components/radio-button/radio-button.scss +178 -0
- package/src/components/radio-button/radio-button.stories.js +379 -0
- package/src/components/tag/_tag-mixin.scss +261 -0
- package/src/components/tag/tag.scss +244 -0
- package/src/components/tag/tag.stories.js +482 -0
- package/src/components/text-input/_text-input-mixin.scss +203 -0
- package/src/components/text-input/text-input.scss +150 -0
- package/src/components/text-input/text-input.stories.js +723 -0
- package/src/icons/_icon.scss +121 -0
- package/src/icons/icon-arrow-left.scss +23 -0
- package/src/icons/icon-arrow-right.scss +23 -0
- package/src/icons/icon-check.scss +23 -0
- package/src/icons/icon-close.scss +24 -0
- package/src/icons/icon-error.scss +24 -0
- package/src/icons/icon-info.scss +24 -0
- package/src/icons/icon-success.scss +23 -0
- package/src/icons/icon-warning.scss +23 -0
- package/src/icons/icons.scss +12 -0
- package/src/icons/icons.stories.js +249 -0
- package/src/icons/svg/arrow-left.svg +3 -0
- package/src/icons/svg/arrow-right.svg +3 -0
- package/src/icons/svg/check.svg +3 -0
- package/src/icons/svg/close.svg +4 -0
- package/src/icons/svg/error.svg +5 -0
- package/src/icons/svg/info.svg +5 -0
- package/src/icons/svg/success.svg +4 -0
- package/src/icons/svg/warning.svg +5 -0
- package/src/utils/__tests__/utilities.test.scss +37 -0
- package/src/utils/_flex.scss +200 -0
- package/src/utils/_grid.scss +211 -0
- package/src/utils/_layout.scss +253 -0
- package/src/utils/_spacing.scss +260 -0
- package/src/utils/_typography.scss +111 -0
- package/src/utils/utils.scss +8 -0
- package/src/variables/_borders.scss +15 -0
- package/src/variables/_breakpoints.scss +11 -0
- package/src/variables/_colors.scss +97 -0
- package/src/variables/_shadows.scss +14 -0
- package/src/variables/_spacing.scss +24 -0
- package/src/variables/_typography.scss +47 -0
- package/src/variables/variables.scss +9 -0
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
// IVDS Core Accessibility Features
|
|
2
|
+
// Comprehensive showcase of accessibility features across all components
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Core/Accessibility',
|
|
6
|
+
parameters: {
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: 'Comprehensive accessibility showcase demonstrating WCAG compliance, proper ARIA usage, keyboard navigation, and color contrast validation across all IVDS Core components.'
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
a11y: {
|
|
13
|
+
config: {
|
|
14
|
+
rules: [
|
|
15
|
+
{
|
|
16
|
+
id: 'color-contrast',
|
|
17
|
+
enabled: true
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: 'focus-order-semantics',
|
|
21
|
+
enabled: true
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: 'aria-allowed-attr',
|
|
25
|
+
enabled: true
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: 'aria-required-attr',
|
|
29
|
+
enabled: true
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 'button-name',
|
|
33
|
+
enabled: true
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: 'form-field-multiple-labels',
|
|
37
|
+
enabled: true
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: 'label',
|
|
41
|
+
enabled: true
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: 'keyboard-navigation',
|
|
45
|
+
enabled: true
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
options: {
|
|
50
|
+
runOnly: {
|
|
51
|
+
type: 'tag',
|
|
52
|
+
values: ['wcag2a', 'wcag2aa', 'wcag21aa']
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// Comprehensive accessibility demonstration
|
|
60
|
+
export const AccessibilityShowcase = () => `
|
|
61
|
+
<div style="max-width: 800px; margin: 0 auto; padding: 2rem;">
|
|
62
|
+
<h1 style="margin-bottom: 2rem; font-size: 2rem; font-weight: 700;">IVDS Core Accessibility Features</h1>
|
|
63
|
+
|
|
64
|
+
<!-- Keyboard Navigation -->
|
|
65
|
+
<section style="margin-bottom: 3rem;">
|
|
66
|
+
<h2 style="margin-bottom: 1rem; font-size: 1.5rem; font-weight: 600;">Keyboard Navigation</h2>
|
|
67
|
+
<p style="margin-bottom: 1.5rem; color: var(--color-semantic-neutral-700, #374151);">
|
|
68
|
+
All interactive elements support keyboard navigation with proper focus management and visual indicators.
|
|
69
|
+
</p>
|
|
70
|
+
|
|
71
|
+
<div style="display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem;">
|
|
72
|
+
<button class="ivds-button ivds-button--primary">Tab to me (1)</button>
|
|
73
|
+
<button class="ivds-button ivds-button--secondary">Then to me (2)</button>
|
|
74
|
+
<button class="ivds-button ivds-button--tertiary">Finally here (3)</button>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<div class="ivds-card">
|
|
78
|
+
<div class="ivds-card__body">
|
|
79
|
+
<p style="font-size: 0.875rem; color: var(--color-semantic-neutral-600, #6b7280);">
|
|
80
|
+
<strong>Try this:</strong> Use Tab to navigate between buttons, Enter/Space to activate them, and Shift+Tab to go backwards.
|
|
81
|
+
</p>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
</section>
|
|
85
|
+
|
|
86
|
+
<!-- Form Accessibility -->
|
|
87
|
+
<section style="margin-bottom: 3rem;">
|
|
88
|
+
<h2 style="margin-bottom: 1rem; font-size: 1.5rem; font-weight: 600;">Form Accessibility</h2>
|
|
89
|
+
<p style="margin-bottom: 1.5rem; color: var(--color-semantic-neutral-700, #374151);">
|
|
90
|
+
Forms include proper labeling, error handling, and assistive technology support.
|
|
91
|
+
</p>
|
|
92
|
+
|
|
93
|
+
<form style="display: flex; flex-direction: column; gap: 1.5rem;">
|
|
94
|
+
<div class="ivds-text-input-wrapper">
|
|
95
|
+
<label class="ivds-text-input__label ivds-text-input__label--required" for="a11y-name">
|
|
96
|
+
Full Name
|
|
97
|
+
</label>
|
|
98
|
+
<input
|
|
99
|
+
type="text"
|
|
100
|
+
id="a11y-name"
|
|
101
|
+
class="ivds-text-input"
|
|
102
|
+
placeholder="Enter your full name"
|
|
103
|
+
aria-describedby="name-help"
|
|
104
|
+
aria-required="true"
|
|
105
|
+
required
|
|
106
|
+
/>
|
|
107
|
+
<div id="name-help" class="ivds-text-input__helper">
|
|
108
|
+
Enter your first and last name as they appear on official documents.
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
<div class="ivds-text-input-wrapper">
|
|
113
|
+
<label class="ivds-text-input__label" for="a11y-email-error">
|
|
114
|
+
Email Address
|
|
115
|
+
</label>
|
|
116
|
+
<input
|
|
117
|
+
type="email"
|
|
118
|
+
id="a11y-email-error"
|
|
119
|
+
class="ivds-text-input ivds-text-input--error"
|
|
120
|
+
value="invalid-email"
|
|
121
|
+
aria-describedby="email-error"
|
|
122
|
+
aria-invalid="true"
|
|
123
|
+
/>
|
|
124
|
+
<div id="email-error" class="ivds-text-input__error" role="alert">
|
|
125
|
+
Please enter a valid email address.
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
|
|
129
|
+
<fieldset class="ivds-radio-button-group" style="border: none; padding: 0; margin: 0;">
|
|
130
|
+
<legend class="ivds-radio-button-group__label">
|
|
131
|
+
Preferred Contact Method
|
|
132
|
+
</legend>
|
|
133
|
+
<div class="ivds-radio-button-group__description">
|
|
134
|
+
Choose how you'd like us to contact you.
|
|
135
|
+
</div>
|
|
136
|
+
|
|
137
|
+
<label class="ivds-radio-button">
|
|
138
|
+
<input
|
|
139
|
+
type="radio"
|
|
140
|
+
class="ivds-radio-button__input"
|
|
141
|
+
name="a11y-contact"
|
|
142
|
+
value="email"
|
|
143
|
+
id="contact-email"
|
|
144
|
+
aria-describedby="contact-email-desc"
|
|
145
|
+
/>
|
|
146
|
+
<div class="ivds-radio-button__circle"></div>
|
|
147
|
+
<div>
|
|
148
|
+
<span class="ivds-radio-button__label">Email</span>
|
|
149
|
+
<div id="contact-email-desc" class="ivds-radio-button__description">
|
|
150
|
+
Receive updates via email notifications.
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
</label>
|
|
154
|
+
|
|
155
|
+
<label class="ivds-radio-button">
|
|
156
|
+
<input
|
|
157
|
+
type="radio"
|
|
158
|
+
class="ivds-radio-button__input"
|
|
159
|
+
name="a11y-contact"
|
|
160
|
+
value="phone"
|
|
161
|
+
id="contact-phone"
|
|
162
|
+
aria-describedby="contact-phone-desc"
|
|
163
|
+
checked
|
|
164
|
+
/>
|
|
165
|
+
<div class="ivds-radio-button__circle"></div>
|
|
166
|
+
<div>
|
|
167
|
+
<span class="ivds-radio-button__label">Phone</span>
|
|
168
|
+
<div id="contact-phone-desc" class="ivds-radio-button__description">
|
|
169
|
+
Receive updates via phone calls.
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
</label>
|
|
173
|
+
</fieldset>
|
|
174
|
+
|
|
175
|
+
<div class="ivds-checkbox-group" role="group" aria-labelledby="preferences-legend">
|
|
176
|
+
<div id="preferences-legend" class="ivds-checkbox-group__label">
|
|
177
|
+
Communication Preferences
|
|
178
|
+
</div>
|
|
179
|
+
|
|
180
|
+
<label class="ivds-checkbox">
|
|
181
|
+
<input
|
|
182
|
+
type="checkbox"
|
|
183
|
+
class="ivds-checkbox__input"
|
|
184
|
+
id="newsletter-checkbox"
|
|
185
|
+
aria-describedby="newsletter-desc"
|
|
186
|
+
/>
|
|
187
|
+
<div class="ivds-checkbox__box"></div>
|
|
188
|
+
<div>
|
|
189
|
+
<span class="ivds-checkbox__label">Newsletter Subscription</span>
|
|
190
|
+
<div id="newsletter-desc" class="ivds-checkbox__description">
|
|
191
|
+
Receive our monthly newsletter with updates and tips.
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
</label>
|
|
195
|
+
|
|
196
|
+
<label class="ivds-checkbox">
|
|
197
|
+
<input
|
|
198
|
+
type="checkbox"
|
|
199
|
+
class="ivds-checkbox__input"
|
|
200
|
+
id="terms-checkbox"
|
|
201
|
+
aria-describedby="terms-desc"
|
|
202
|
+
required
|
|
203
|
+
/>
|
|
204
|
+
<div class="ivds-checkbox__box"></div>
|
|
205
|
+
<div>
|
|
206
|
+
<span class="ivds-checkbox__label">Terms and Conditions</span>
|
|
207
|
+
<div id="terms-desc" class="ivds-checkbox__description">
|
|
208
|
+
I agree to the terms of service and privacy policy.
|
|
209
|
+
</div>
|
|
210
|
+
</div>
|
|
211
|
+
</label>
|
|
212
|
+
</div>
|
|
213
|
+
</form>
|
|
214
|
+
</section>
|
|
215
|
+
<
|
|
216
|
+
!-- ARIA and Screen Reader Support -->
|
|
217
|
+
<section style="margin-bottom: 3rem;">
|
|
218
|
+
<h2 style="margin-bottom: 1rem; font-size: 1.5rem; font-weight: 600;">ARIA and Screen Reader Support</h2>
|
|
219
|
+
<p style="margin-bottom: 1.5rem; color: var(--color-semantic-neutral-700, #374151);">
|
|
220
|
+
Components include proper ARIA attributes, roles, and live regions for screen reader compatibility.
|
|
221
|
+
</p>
|
|
222
|
+
|
|
223
|
+
<div style="display: flex; flex-direction: column; gap: 1rem;">
|
|
224
|
+
<div class="ivds-notification ivds-notification--success" role="alert" aria-live="polite">
|
|
225
|
+
<div class="ivds-notification__icon" aria-hidden="true">
|
|
226
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
227
|
+
<path d="M9 12L11 14L15 10M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
228
|
+
</svg>
|
|
229
|
+
</div>
|
|
230
|
+
<div class="ivds-notification__content">
|
|
231
|
+
<div class="ivds-notification__title">Success Notification</div>
|
|
232
|
+
<div class="ivds-notification__message">This notification uses role="alert" and aria-live="polite" for screen readers.</div>
|
|
233
|
+
</div>
|
|
234
|
+
</div>
|
|
235
|
+
|
|
236
|
+
<div class="ivds-notification ivds-notification--error ivds-notification--dismissible" role="alert" aria-live="assertive">
|
|
237
|
+
<div class="ivds-notification__icon" aria-hidden="true">
|
|
238
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
239
|
+
<path d="M12 8V12M12 16H12.01M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
240
|
+
</svg>
|
|
241
|
+
</div>
|
|
242
|
+
<div class="ivds-notification__content">
|
|
243
|
+
<div class="ivds-notification__title">Critical Error</div>
|
|
244
|
+
<div class="ivds-notification__message">This error uses aria-live="assertive" for immediate attention.</div>
|
|
245
|
+
</div>
|
|
246
|
+
<button class="ivds-notification__dismiss" aria-label="Dismiss critical error notification">
|
|
247
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
248
|
+
<path d="M18 6L6 18M6 6L18 18" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
249
|
+
</svg>
|
|
250
|
+
</button>
|
|
251
|
+
</div>
|
|
252
|
+
</div>
|
|
253
|
+
</section>
|
|
254
|
+
|
|
255
|
+
<!-- Interactive Elements -->
|
|
256
|
+
<section style="margin-bottom: 3rem;">
|
|
257
|
+
<h2 style="margin-bottom: 1rem; font-size: 1.5rem; font-weight: 600;">Interactive Elements</h2>
|
|
258
|
+
<p style="margin-bottom: 1.5rem; color: var(--color-semantic-neutral-700, #374151);">
|
|
259
|
+
All interactive elements provide clear focus indicators and appropriate labels.
|
|
260
|
+
</p>
|
|
261
|
+
|
|
262
|
+
<div style="display: flex; flex-direction: column; gap: 1.5rem;">
|
|
263
|
+
<div>
|
|
264
|
+
<h3 style="margin-bottom: 0.5rem; font-weight: 500;">Buttons with Descriptive Labels</h3>
|
|
265
|
+
<div style="display: flex; gap: 1rem; flex-wrap: wrap;">
|
|
266
|
+
<button class="ivds-button ivds-button--primary" aria-describedby="save-help">
|
|
267
|
+
Save Changes
|
|
268
|
+
</button>
|
|
269
|
+
<button class="ivds-button ivds-button--danger" aria-label="Delete user account permanently">
|
|
270
|
+
<span class="ivds-button__icon">
|
|
271
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
272
|
+
<path d="M3 6H5H21M8 6V4A2 2 0 0 1 10 2H14A2 2 0 0 1 16 4V6M19 6V20A2 2 0 0 1 17 22H7A2 2 0 0 1 5 20V6H19ZM10 11V17M14 11V17" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
273
|
+
</svg>
|
|
274
|
+
</span>
|
|
275
|
+
<span class="ivds-button__text">Delete</span>
|
|
276
|
+
</button>
|
|
277
|
+
</div>
|
|
278
|
+
<p id="save-help" style="font-size: 0.875rem; color: var(--color-semantic-neutral-600, #6b7280); margin-top: 0.5rem;">
|
|
279
|
+
This will save all your changes and redirect you to the dashboard.
|
|
280
|
+
</p>
|
|
281
|
+
</div>
|
|
282
|
+
|
|
283
|
+
<div>
|
|
284
|
+
<h3 style="margin-bottom: 0.5rem; font-weight: 500;">Tags with Proper Roles</h3>
|
|
285
|
+
<div class="ivds-tag-group" role="list">
|
|
286
|
+
<span class="ivds-tag ivds-tag--primary ivds-tag--removable" role="listitem">
|
|
287
|
+
<span class="ivds-tag__text">React</span>
|
|
288
|
+
<button class="ivds-tag__remove" aria-label="Remove React tag from list">
|
|
289
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
290
|
+
<path d="M18 6L6 18M6 6L18 18" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
291
|
+
</svg>
|
|
292
|
+
</button>
|
|
293
|
+
</span>
|
|
294
|
+
|
|
295
|
+
<a href="#" class="ivds-tag ivds-tag--success ivds-tag--link" role="listitem" aria-describedby="tag-help">
|
|
296
|
+
<span class="ivds-tag__text">JavaScript</span>
|
|
297
|
+
</a>
|
|
298
|
+
|
|
299
|
+
<span class="ivds-tag ivds-tag--info" role="listitem" title="This tag provides additional context">
|
|
300
|
+
<span class="ivds-tag__icon" aria-hidden="true">
|
|
301
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
302
|
+
<path d="M13 16H12V12H11M12 8H12.01M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
303
|
+
</svg>
|
|
304
|
+
</span>
|
|
305
|
+
<span class="ivds-tag__text">TypeScript</span>
|
|
306
|
+
</span>
|
|
307
|
+
</div>
|
|
308
|
+
<p id="tag-help" style="font-size: 0.875rem; color: var(--color-semantic-neutral-600, #6b7280); margin-top: 0.5rem;">
|
|
309
|
+
Tags can be interactive elements with proper ARIA labels and keyboard navigation support.
|
|
310
|
+
</p>
|
|
311
|
+
</div>
|
|
312
|
+
|
|
313
|
+
<div>
|
|
314
|
+
<h3 style="margin-bottom: 0.5rem; font-weight: 500;">Interactive Cards</h3>
|
|
315
|
+
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem;">
|
|
316
|
+
<article class="ivds-card" role="article" aria-labelledby="article-title">
|
|
317
|
+
<header class="ivds-card__header">
|
|
318
|
+
<h4 id="article-title" class="ivds-card__title">Accessible Article</h4>
|
|
319
|
+
<p class="ivds-card__subtitle">Published March 15, 2024</p>
|
|
320
|
+
</header>
|
|
321
|
+
<div class="ivds-card__body">
|
|
322
|
+
<p class="ivds-card__content">
|
|
323
|
+
This card uses proper semantic HTML with article and header elements.
|
|
324
|
+
</p>
|
|
325
|
+
<div class="ivds-card__actions">
|
|
326
|
+
<a href="#" class="ivds-button ivds-button--primary ivds-button--small" aria-describedby="article-title">
|
|
327
|
+
Read Article
|
|
328
|
+
</a>
|
|
329
|
+
</div>
|
|
330
|
+
</div>
|
|
331
|
+
</article>
|
|
332
|
+
|
|
333
|
+
<div class="ivds-card ivds-card--interactive" tabindex="0" role="button" aria-label="Interactive card with keyboard support" aria-describedby="card-content">
|
|
334
|
+
<div class="ivds-card__header">
|
|
335
|
+
<h4 class="ivds-card__title">Interactive Card</h4>
|
|
336
|
+
</div>
|
|
337
|
+
<div class="ivds-card__body">
|
|
338
|
+
<p id="card-content" class="ivds-card__content">
|
|
339
|
+
This card is keyboard accessible with proper focus management.
|
|
340
|
+
</p>
|
|
341
|
+
</div>
|
|
342
|
+
</div>
|
|
343
|
+
</div>
|
|
344
|
+
</div>
|
|
345
|
+
</div>
|
|
346
|
+
</section>
|
|
347
|
+
|
|
348
|
+
<!-- Color Contrast -->
|
|
349
|
+
<section style="margin-bottom: 3rem;">
|
|
350
|
+
<h2 style="margin-bottom: 1rem; font-size: 1.5rem; font-weight: 600;">Color Contrast Compliance</h2>
|
|
351
|
+
<p style="margin-bottom: 1.5rem; color: var(--color-semantic-neutral-700, #374151);">
|
|
352
|
+
All color combinations meet WCAG AA standards for color contrast ratios.
|
|
353
|
+
</p>
|
|
354
|
+
|
|
355
|
+
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem;">
|
|
356
|
+
<div class="ivds-card">
|
|
357
|
+
<div class="ivds-card__body" style="text-align: center;">
|
|
358
|
+
<h4 style="margin-bottom: 0.5rem;">Primary Colors</h4>
|
|
359
|
+
<div style="display: flex; flex-direction: column; gap: 0.5rem;">
|
|
360
|
+
<button class="ivds-button ivds-button--primary ivds-button--small">Primary Button</button>
|
|
361
|
+
<span class="ivds-tag ivds-tag--primary">Primary Tag</span>
|
|
362
|
+
</div>
|
|
363
|
+
</div>
|
|
364
|
+
</div>
|
|
365
|
+
|
|
366
|
+
<div class="ivds-card">
|
|
367
|
+
<div class="ivds-card__body" style="text-align: center;">
|
|
368
|
+
<h4 style="margin-bottom: 0.5rem;">Success Colors</h4>
|
|
369
|
+
<div style="display: flex; flex-direction: column; gap: 0.5rem;">
|
|
370
|
+
<button class="ivds-button ivds-button--success ivds-button--small">Success Button</button>
|
|
371
|
+
<span class="ivds-tag ivds-tag--success">Success Tag</span>
|
|
372
|
+
</div>
|
|
373
|
+
</div>
|
|
374
|
+
</div>
|
|
375
|
+
|
|
376
|
+
<div class="ivds-card">
|
|
377
|
+
<div class="ivds-card__body" style="text-align: center;">
|
|
378
|
+
<h4 style="margin-bottom: 0.5rem;">Warning Colors</h4>
|
|
379
|
+
<div style="display: flex; flex-direction: column; gap: 0.5rem;">
|
|
380
|
+
<button class="ivds-button ivds-button--warning ivds-button--small">Warning Button</button>
|
|
381
|
+
<span class="ivds-tag ivds-tag--warning">Warning Tag</span>
|
|
382
|
+
</div>
|
|
383
|
+
</div>
|
|
384
|
+
</div>
|
|
385
|
+
|
|
386
|
+
<div class="ivds-card">
|
|
387
|
+
<div class="ivds-card__body" style="text-align: center;">
|
|
388
|
+
<h4 style="margin-bottom: 0.5rem;">Error Colors</h4>
|
|
389
|
+
<div style="display: flex; flex-direction: column; gap: 0.5rem;">
|
|
390
|
+
<button class="ivds-button ivds-button--danger ivds-button--small">Error Button</button>
|
|
391
|
+
<span class="ivds-tag ivds-tag--error">Error Tag</span>
|
|
392
|
+
</div>
|
|
393
|
+
</div>
|
|
394
|
+
</div>
|
|
395
|
+
</div>
|
|
396
|
+
</section>
|
|
397
|
+
|
|
398
|
+
<!-- Best Practices -->
|
|
399
|
+
<section>
|
|
400
|
+
<h2 style="margin-bottom: 1rem; font-size: 1.5rem; font-weight: 600;">Accessibility Best Practices</h2>
|
|
401
|
+
<div class="ivds-card">
|
|
402
|
+
<div class="ivds-card__body">
|
|
403
|
+
<ul style="margin: 0; padding-left: 1.5rem; line-height: 1.6;">
|
|
404
|
+
<li><strong>Keyboard Navigation:</strong> All interactive elements are keyboard accessible with visible focus indicators</li>
|
|
405
|
+
<li><strong>Screen Readers:</strong> Proper ARIA labels, roles, and live regions provide context for assistive technologies</li>
|
|
406
|
+
<li><strong>Color Contrast:</strong> All text and interactive elements meet WCAG AA contrast requirements (4.5:1 for normal text, 3:1 for large text)</li>
|
|
407
|
+
<li><strong>Form Labels:</strong> All form inputs have associated labels and helpful descriptions</li>
|
|
408
|
+
<li><strong>Error Handling:</strong> Error messages are announced to screen readers and clearly associated with form fields</li>
|
|
409
|
+
<li><strong>Semantic HTML:</strong> Components use appropriate HTML elements and landmarks for better structure</li>
|
|
410
|
+
<li><strong>Focus Management:</strong> Focus is properly managed in interactive components and modal dialogs</li>
|
|
411
|
+
</ul>
|
|
412
|
+
</div>
|
|
413
|
+
</div>
|
|
414
|
+
</section>
|
|
415
|
+
</div>
|
|
416
|
+
`;
|
package/src/all.scss
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Complete IVDS Core bundle
|
|
2
|
+
// This file imports all styles for the IVDS Core package
|
|
3
|
+
|
|
4
|
+
// Use statements must come first
|
|
5
|
+
@use './variables/variables.scss';
|
|
6
|
+
@use './base/base.scss';
|
|
7
|
+
@use './utils/utils.scss';
|
|
8
|
+
@use './icons/icons.scss';
|
|
9
|
+
@use './components/all.scss';
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// Base layout styles for IVDS Core
|
|
2
|
+
// Provides foundational layout utilities and container styles
|
|
3
|
+
|
|
4
|
+
@use '../variables/variables' as vars;
|
|
5
|
+
|
|
6
|
+
// Global layout defaults
|
|
7
|
+
html {
|
|
8
|
+
height: 100%;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
body {
|
|
12
|
+
min-height: 100%;
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Main content area
|
|
18
|
+
main {
|
|
19
|
+
flex: 1;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Container system
|
|
23
|
+
.ivds-container {
|
|
24
|
+
width: 100%;
|
|
25
|
+
margin-left: auto;
|
|
26
|
+
margin-right: auto;
|
|
27
|
+
padding-left: vars.$spacing-4;
|
|
28
|
+
padding-right: vars.$spacing-4;
|
|
29
|
+
|
|
30
|
+
// Size variations based on design token breakpoints
|
|
31
|
+
&--xs {
|
|
32
|
+
max-width: calc(#{vars.$breakpoint-xs} - #{vars.$spacing-8});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&--sm {
|
|
36
|
+
max-width: calc(#{vars.$breakpoint-sm} - #{vars.$spacing-8});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&--md {
|
|
40
|
+
max-width: calc(#{vars.$breakpoint-md} - #{vars.$spacing-8});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&--lg {
|
|
44
|
+
max-width: calc(#{vars.$breakpoint-lg} - #{vars.$spacing-8});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&--xl {
|
|
48
|
+
max-width: calc(#{vars.$breakpoint-xl} - #{vars.$spacing-8});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Responsive padding
|
|
52
|
+
@media (min-width: #{vars.$breakpoint-sm}) {
|
|
53
|
+
padding-left: vars.$spacing-6;
|
|
54
|
+
padding-right: vars.$spacing-6;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@media (min-width: #{vars.$breakpoint-lg}) {
|
|
58
|
+
padding-left: vars.$spacing-8;
|
|
59
|
+
padding-right: vars.$spacing-8;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Layout utility classes
|
|
64
|
+
.ivds-layout {
|
|
65
|
+
width: 100%;
|
|
66
|
+
min-height: 100vh;
|
|
67
|
+
|
|
68
|
+
&--flex {
|
|
69
|
+
display: flex;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&--grid {
|
|
73
|
+
display: grid;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&--centered {
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Section spacing
|
|
84
|
+
.ivds-section {
|
|
85
|
+
padding-top: vars.$spacing-12;
|
|
86
|
+
padding-bottom: vars.$spacing-12;
|
|
87
|
+
|
|
88
|
+
@media (min-width: #{vars.$breakpoint-md}) {
|
|
89
|
+
padding-top: vars.$spacing-16;
|
|
90
|
+
padding-bottom: vars.$spacing-16;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@media (min-width: #{vars.$breakpoint-lg}) {
|
|
94
|
+
padding-top: vars.$spacing-20;
|
|
95
|
+
padding-bottom: vars.$spacing-20;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// Modern CSS Reset for IVDS Core
|
|
2
|
+
// Provides a consistent baseline across browsers based on modern reset practices
|
|
3
|
+
|
|
4
|
+
// Import design tokens
|
|
5
|
+
@use '../variables/variables' as vars;
|
|
6
|
+
|
|
7
|
+
// Box sizing rules
|
|
8
|
+
*,
|
|
9
|
+
*::before,
|
|
10
|
+
*::after {
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Remove default margin and padding
|
|
15
|
+
* {
|
|
16
|
+
margin: 0;
|
|
17
|
+
padding: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Remove list styles on ul, ol elements with a list role
|
|
21
|
+
ul[role='list'],
|
|
22
|
+
ol[role='list'] {
|
|
23
|
+
list-style: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Set core root defaults
|
|
27
|
+
html:focus-within {
|
|
28
|
+
scroll-behavior: smooth;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Set core body defaults
|
|
32
|
+
body {
|
|
33
|
+
min-height: 100vh;
|
|
34
|
+
text-rendering: optimizespeed;
|
|
35
|
+
line-height: 1.5;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// A elements that don't have a class get default styles
|
|
39
|
+
a:not([class]) {
|
|
40
|
+
text-decoration-skip-ink: auto;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Make images easier to work with
|
|
44
|
+
img,
|
|
45
|
+
picture {
|
|
46
|
+
max-width: 100%;
|
|
47
|
+
display: block;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Inherit fonts for inputs and buttons
|
|
51
|
+
input,
|
|
52
|
+
button,
|
|
53
|
+
textarea,
|
|
54
|
+
select {
|
|
55
|
+
font: inherit;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Remove all animations, transitions and smooth scroll for people that prefer not to see them
|
|
59
|
+
@media (prefers-reduced-motion: reduce) {
|
|
60
|
+
html:focus-within {
|
|
61
|
+
scroll-behavior: auto;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
*,
|
|
65
|
+
*::before,
|
|
66
|
+
*::after {
|
|
67
|
+
animation-duration: 0.01ms !important;
|
|
68
|
+
animation-iteration-count: 1 !important;
|
|
69
|
+
transition-duration: 0.01ms !important;
|
|
70
|
+
scroll-behavior: auto !important;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// IVDS specific reset class for scoped usage
|
|
75
|
+
.ivds-reset {
|
|
76
|
+
box-sizing: border-box;
|
|
77
|
+
margin: 0;
|
|
78
|
+
padding: 0;
|
|
79
|
+
|
|
80
|
+
*,
|
|
81
|
+
*::before,
|
|
82
|
+
*::after {
|
|
83
|
+
box-sizing: inherit;
|
|
84
|
+
}
|
|
85
|
+
}
|