@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,483 @@
|
|
|
1
|
+
// Breadcrumb component stories for Storybook
|
|
2
|
+
// Showcases breadcrumb navigation patterns and accessibility features following Helsinki Design System patterns
|
|
3
|
+
|
|
4
|
+
import './breadcrumb.scss';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Core/Breadcrumb',
|
|
8
|
+
decorators: [(storyFn) => `<div style="padding: 1rem;">${storyFn()}</div>`],
|
|
9
|
+
parameters: {
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component: 'CSS-only breadcrumb navigation component using IVDS design tokens. Provides accessible navigation hierarchy with proper ARIA attributes, following Helsinki Design System patterns with CSS custom properties for theming.'
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
a11y: {
|
|
16
|
+
config: {
|
|
17
|
+
rules: [
|
|
18
|
+
{
|
|
19
|
+
id: 'color-contrast',
|
|
20
|
+
enabled: true
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: 'focus-order-semantics',
|
|
24
|
+
enabled: true
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: 'aria-allowed-attr',
|
|
28
|
+
enabled: true
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// Basic breadcrumb
|
|
37
|
+
export const Primary = () => `
|
|
38
|
+
<nav class="ivds-breadcrumb" aria-label="Breadcrumb">
|
|
39
|
+
<ol class="ivds-breadcrumb__list">
|
|
40
|
+
<li class="ivds-breadcrumb__item">
|
|
41
|
+
<a href="#" class="ivds-breadcrumb__link">Home</a>
|
|
42
|
+
</li>
|
|
43
|
+
<li class="ivds-breadcrumb__item">
|
|
44
|
+
<a href="#" class="ivds-breadcrumb__link">Products</a>
|
|
45
|
+
</li>
|
|
46
|
+
<li class="ivds-breadcrumb__item">
|
|
47
|
+
<span class="ivds-breadcrumb__current" aria-current="page">Laptops</span>
|
|
48
|
+
</li>
|
|
49
|
+
</ol>
|
|
50
|
+
</nav>
|
|
51
|
+
`;
|
|
52
|
+
|
|
53
|
+
// Size variants
|
|
54
|
+
export const Sizes = () => `
|
|
55
|
+
<div style="display: flex; flex-direction: column; gap: 2rem;">
|
|
56
|
+
<div>
|
|
57
|
+
<h4 style="margin-bottom: 0.5rem; font-size: 0.875rem; color: #6b7280;">Small</h4>
|
|
58
|
+
<nav class="ivds-breadcrumb ivds-breadcrumb--small" aria-label="Small breadcrumb">
|
|
59
|
+
<ol class="ivds-breadcrumb__list">
|
|
60
|
+
<li class="ivds-breadcrumb__item">
|
|
61
|
+
<a href="#" class="ivds-breadcrumb__link">Home</a>
|
|
62
|
+
</li>
|
|
63
|
+
<li class="ivds-breadcrumb__item">
|
|
64
|
+
<a href="#" class="ivds-breadcrumb__link">Products</a>
|
|
65
|
+
</li>
|
|
66
|
+
<li class="ivds-breadcrumb__item">
|
|
67
|
+
<span class="ivds-breadcrumb__current" aria-current="page">Laptops</span>
|
|
68
|
+
</li>
|
|
69
|
+
</ol>
|
|
70
|
+
</nav>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<div>
|
|
74
|
+
<h4 style="margin-bottom: 0.5rem; font-size: 0.875rem; color: #6b7280;">Default</h4>
|
|
75
|
+
<nav class="ivds-breadcrumb" aria-label="Default breadcrumb">
|
|
76
|
+
<ol class="ivds-breadcrumb__list">
|
|
77
|
+
<li class="ivds-breadcrumb__item">
|
|
78
|
+
<a href="#" class="ivds-breadcrumb__link">Home</a>
|
|
79
|
+
</li>
|
|
80
|
+
<li class="ivds-breadcrumb__item">
|
|
81
|
+
<a href="#" class="ivds-breadcrumb__link">Products</a>
|
|
82
|
+
</li>
|
|
83
|
+
<li class="ivds-breadcrumb__item">
|
|
84
|
+
<span class="ivds-breadcrumb__current" aria-current="page">Laptops</span>
|
|
85
|
+
</li>
|
|
86
|
+
</ol>
|
|
87
|
+
</nav>
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
<div>
|
|
91
|
+
<h4 style="margin-bottom: 0.5rem; font-size: 0.875rem; color: #6b7280;">Large</h4>
|
|
92
|
+
<nav class="ivds-breadcrumb ivds-breadcrumb--large" aria-label="Large breadcrumb">
|
|
93
|
+
<ol class="ivds-breadcrumb__list">
|
|
94
|
+
<li class="ivds-breadcrumb__item">
|
|
95
|
+
<a href="#" class="ivds-breadcrumb__link">Home</a>
|
|
96
|
+
</li>
|
|
97
|
+
<li class="ivds-breadcrumb__item">
|
|
98
|
+
<a href="#" class="ivds-breadcrumb__link">Products</a>
|
|
99
|
+
</li>
|
|
100
|
+
<li class="ivds-breadcrumb__item">
|
|
101
|
+
<span class="ivds-breadcrumb__current" aria-current="page">Laptops</span>
|
|
102
|
+
</li>
|
|
103
|
+
</ol>
|
|
104
|
+
</nav>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
`;
|
|
108
|
+
|
|
109
|
+
// Separator variants
|
|
110
|
+
export const Separators = () => `
|
|
111
|
+
<div style="display: flex; flex-direction: column; gap: 2rem;">
|
|
112
|
+
<div>
|
|
113
|
+
<h4 style="margin-bottom: 0.5rem; font-size: 0.875rem; color: #6b7280;">Default (Slash)</h4>
|
|
114
|
+
<nav class="ivds-breadcrumb" aria-label="Default separator breadcrumb">
|
|
115
|
+
<ol class="ivds-breadcrumb__list">
|
|
116
|
+
<li class="ivds-breadcrumb__item">
|
|
117
|
+
<a href="#" class="ivds-breadcrumb__link">Home</a>
|
|
118
|
+
</li>
|
|
119
|
+
<li class="ivds-breadcrumb__item">
|
|
120
|
+
<a href="#" class="ivds-breadcrumb__link">Products</a>
|
|
121
|
+
</li>
|
|
122
|
+
<li class="ivds-breadcrumb__item">
|
|
123
|
+
<span class="ivds-breadcrumb__current" aria-current="page">Laptops</span>
|
|
124
|
+
</li>
|
|
125
|
+
</ol>
|
|
126
|
+
</nav>
|
|
127
|
+
</div>
|
|
128
|
+
|
|
129
|
+
<div>
|
|
130
|
+
<h4 style="margin-bottom: 0.5rem; font-size: 0.875rem; color: #6b7280;">Arrow</h4>
|
|
131
|
+
<nav class="ivds-breadcrumb ivds-breadcrumb--separator-arrow" aria-label="Arrow separator breadcrumb">
|
|
132
|
+
<ol class="ivds-breadcrumb__list">
|
|
133
|
+
<li class="ivds-breadcrumb__item">
|
|
134
|
+
<a href="#" class="ivds-breadcrumb__link">Home</a>
|
|
135
|
+
</li>
|
|
136
|
+
<li class="ivds-breadcrumb__item">
|
|
137
|
+
<a href="#" class="ivds-breadcrumb__link">Products</a>
|
|
138
|
+
</li>
|
|
139
|
+
<li class="ivds-breadcrumb__item">
|
|
140
|
+
<span class="ivds-breadcrumb__current" aria-current="page">Laptops</span>
|
|
141
|
+
</li>
|
|
142
|
+
</ol>
|
|
143
|
+
</nav>
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<div>
|
|
147
|
+
<h4 style="margin-bottom: 0.5rem; font-size: 0.875rem; color: #6b7280;">Chevron</h4>
|
|
148
|
+
<nav class="ivds-breadcrumb ivds-breadcrumb--separator-chevron" aria-label="Chevron separator breadcrumb">
|
|
149
|
+
<ol class="ivds-breadcrumb__list">
|
|
150
|
+
<li class="ivds-breadcrumb__item">
|
|
151
|
+
<a href="#" class="ivds-breadcrumb__link">Home</a>
|
|
152
|
+
</li>
|
|
153
|
+
<li class="ivds-breadcrumb__item">
|
|
154
|
+
<a href="#" class="ivds-breadcrumb__link">Products</a>
|
|
155
|
+
</li>
|
|
156
|
+
<li class="ivds-breadcrumb__item">
|
|
157
|
+
<span class="ivds-breadcrumb__current" aria-current="page">Laptops</span>
|
|
158
|
+
</li>
|
|
159
|
+
</ol>
|
|
160
|
+
</nav>
|
|
161
|
+
</div>
|
|
162
|
+
|
|
163
|
+
<div>
|
|
164
|
+
<h4 style="margin-bottom: 0.5rem; font-size: 0.875rem; color: #6b7280;">Bullet</h4>
|
|
165
|
+
<nav class="ivds-breadcrumb ivds-breadcrumb--separator-bullet" aria-label="Bullet separator breadcrumb">
|
|
166
|
+
<ol class="ivds-breadcrumb__list">
|
|
167
|
+
<li class="ivds-breadcrumb__item">
|
|
168
|
+
<a href="#" class="ivds-breadcrumb__link">Home</a>
|
|
169
|
+
</li>
|
|
170
|
+
<li class="ivds-breadcrumb__item">
|
|
171
|
+
<a href="#" class="ivds-breadcrumb__link">Products</a>
|
|
172
|
+
</li>
|
|
173
|
+
<li class="ivds-breadcrumb__item">
|
|
174
|
+
<span class="ivds-breadcrumb__current" aria-current="page">Laptops</span>
|
|
175
|
+
</li>
|
|
176
|
+
</ol>
|
|
177
|
+
</nav>
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
`;
|
|
181
|
+
|
|
182
|
+
// Theme variants
|
|
183
|
+
export const Themes = () => `
|
|
184
|
+
<div style="display: flex; flex-direction: column; gap: 2rem;">
|
|
185
|
+
<div>
|
|
186
|
+
<h4 style="margin-bottom: 0.5rem; font-size: 0.875rem; color: #6b7280;">Default Theme</h4>
|
|
187
|
+
<nav class="ivds-breadcrumb" aria-label="Default theme breadcrumb">
|
|
188
|
+
<ol class="ivds-breadcrumb__list">
|
|
189
|
+
<li class="ivds-breadcrumb__item">
|
|
190
|
+
<a href="#" class="ivds-breadcrumb__link">Home</a>
|
|
191
|
+
</li>
|
|
192
|
+
<li class="ivds-breadcrumb__item">
|
|
193
|
+
<a href="#" class="ivds-breadcrumb__link">Products</a>
|
|
194
|
+
</li>
|
|
195
|
+
<li class="ivds-breadcrumb__item">
|
|
196
|
+
<span class="ivds-breadcrumb__current" aria-current="page">Laptops</span>
|
|
197
|
+
</li>
|
|
198
|
+
</ol>
|
|
199
|
+
</nav>
|
|
200
|
+
</div>
|
|
201
|
+
|
|
202
|
+
<div style="background-color: #1e293b; padding: 1rem; border-radius: 0.5rem;">
|
|
203
|
+
<h4 style="margin-bottom: 0.5rem; font-size: 0.875rem; color: #e2e8f0;">Dark Theme</h4>
|
|
204
|
+
<nav class="ivds-breadcrumb ivds-breadcrumb--theme-dark" aria-label="Dark theme breadcrumb">
|
|
205
|
+
<ol class="ivds-breadcrumb__list">
|
|
206
|
+
<li class="ivds-breadcrumb__item">
|
|
207
|
+
<a href="#" class="ivds-breadcrumb__link">Home</a>
|
|
208
|
+
</li>
|
|
209
|
+
<li class="ivds-breadcrumb__item">
|
|
210
|
+
<a href="#" class="ivds-breadcrumb__link">Products</a>
|
|
211
|
+
</li>
|
|
212
|
+
<li class="ivds-breadcrumb__item">
|
|
213
|
+
<span class="ivds-breadcrumb__current" aria-current="page">Laptops</span>
|
|
214
|
+
</li>
|
|
215
|
+
</ol>
|
|
216
|
+
</nav>
|
|
217
|
+
</div>
|
|
218
|
+
|
|
219
|
+
<div>
|
|
220
|
+
<h4 style="margin-bottom: 0.5rem; font-size: 0.875rem; color: #6b7280;">Muted Theme</h4>
|
|
221
|
+
<nav class="ivds-breadcrumb ivds-breadcrumb--theme-muted" aria-label="Muted theme breadcrumb">
|
|
222
|
+
<ol class="ivds-breadcrumb__list">
|
|
223
|
+
<li class="ivds-breadcrumb__item">
|
|
224
|
+
<a href="#" class="ivds-breadcrumb__link">Home</a>
|
|
225
|
+
</li>
|
|
226
|
+
<li class="ivds-breadcrumb__item">
|
|
227
|
+
<a href="#" class="ivds-breadcrumb__link">Products</a>
|
|
228
|
+
</li>
|
|
229
|
+
<li class="ivds-breadcrumb__item">
|
|
230
|
+
<span class="ivds-breadcrumb__current" aria-current="page">Laptops</span>
|
|
231
|
+
</li>
|
|
232
|
+
</ol>
|
|
233
|
+
</nav>
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
236
|
+
`;
|
|
237
|
+
|
|
238
|
+
// Long breadcrumb path
|
|
239
|
+
export const LongPath = () => `
|
|
240
|
+
<nav class="ivds-breadcrumb" aria-label="Long path breadcrumb">
|
|
241
|
+
<ol class="ivds-breadcrumb__list">
|
|
242
|
+
<li class="ivds-breadcrumb__item">
|
|
243
|
+
<a href="#" class="ivds-breadcrumb__link">Home</a>
|
|
244
|
+
</li>
|
|
245
|
+
<li class="ivds-breadcrumb__item">
|
|
246
|
+
<a href="#" class="ivds-breadcrumb__link">Electronics</a>
|
|
247
|
+
</li>
|
|
248
|
+
<li class="ivds-breadcrumb__item">
|
|
249
|
+
<a href="#" class="ivds-breadcrumb__link">Computers</a>
|
|
250
|
+
</li>
|
|
251
|
+
<li class="ivds-breadcrumb__item">
|
|
252
|
+
<a href="#" class="ivds-breadcrumb__link">Laptops</a>
|
|
253
|
+
</li>
|
|
254
|
+
<li class="ivds-breadcrumb__item">
|
|
255
|
+
<a href="#" class="ivds-breadcrumb__link">Gaming Laptops</a>
|
|
256
|
+
</li>
|
|
257
|
+
<li class="ivds-breadcrumb__item">
|
|
258
|
+
<span class="ivds-breadcrumb__current" aria-current="page">High Performance Gaming Laptop</span>
|
|
259
|
+
</li>
|
|
260
|
+
</ol>
|
|
261
|
+
</nav>
|
|
262
|
+
`;
|
|
263
|
+
|
|
264
|
+
// Single level breadcrumb
|
|
265
|
+
export const SingleLevel = () => `
|
|
266
|
+
<nav class="ivds-breadcrumb" aria-label="Breadcrumb">
|
|
267
|
+
<ol class="ivds-breadcrumb__list">
|
|
268
|
+
<li class="ivds-breadcrumb__item">
|
|
269
|
+
<a href="#" class="ivds-breadcrumb__link">Home</a>
|
|
270
|
+
</li>
|
|
271
|
+
<li class="ivds-breadcrumb__item">
|
|
272
|
+
<span class="ivds-breadcrumb__current" aria-current="page">About</span>
|
|
273
|
+
</li>
|
|
274
|
+
</ol>
|
|
275
|
+
</nav>
|
|
276
|
+
`;
|
|
277
|
+
|
|
278
|
+
// Breadcrumb with icons
|
|
279
|
+
export const WithIcons = () => `
|
|
280
|
+
<nav class="ivds-breadcrumb ivds-breadcrumb--with-icons" aria-label="Breadcrumb with icons">
|
|
281
|
+
<ol class="ivds-breadcrumb__list">
|
|
282
|
+
<li class="ivds-breadcrumb__item">
|
|
283
|
+
<a href="#" class="ivds-breadcrumb__link">
|
|
284
|
+
<svg class="ivds-breadcrumb__icon" width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
285
|
+
<path d="M3 9L12 2L21 9V20A2 2 0 0 1 19 22H5A2 2 0 0 1 3 20V9Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
286
|
+
<polyline points="9,22 9,12 15,12 15,22" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
287
|
+
</svg>
|
|
288
|
+
Home
|
|
289
|
+
</a>
|
|
290
|
+
</li>
|
|
291
|
+
<li class="ivds-breadcrumb__item">
|
|
292
|
+
<a href="#" class="ivds-breadcrumb__link">
|
|
293
|
+
<svg class="ivds-breadcrumb__icon" width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
294
|
+
<rect x="2" y="3" width="20" height="14" rx="2" ry="2" stroke="currentColor" stroke-width="2" fill="none"/>
|
|
295
|
+
<line x1="8" y1="21" x2="16" y2="21" stroke="currentColor" stroke-width="2"/>
|
|
296
|
+
<line x1="12" y1="17" x2="12" y2="21" stroke="currentColor" stroke-width="2"/>
|
|
297
|
+
</svg>
|
|
298
|
+
Products
|
|
299
|
+
</a>
|
|
300
|
+
</li>
|
|
301
|
+
<li class="ivds-breadcrumb__item">
|
|
302
|
+
<span class="ivds-breadcrumb__current" aria-current="page">
|
|
303
|
+
<svg class="ivds-breadcrumb__icon" width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
304
|
+
<rect x="2" y="3" width="20" height="14" rx="2" ry="2" stroke="currentColor" stroke-width="2" fill="none"/>
|
|
305
|
+
<line x1="8" y1="21" x2="16" y2="21" stroke="currentColor" stroke-width="2"/>
|
|
306
|
+
<line x1="12" y1="17" x2="12" y2="21" stroke="currentColor" stroke-width="2"/>
|
|
307
|
+
</svg>
|
|
308
|
+
Laptops
|
|
309
|
+
</span>
|
|
310
|
+
</li>
|
|
311
|
+
</ol>
|
|
312
|
+
</nav>
|
|
313
|
+
`;
|
|
314
|
+
|
|
315
|
+
// All variants showcase
|
|
316
|
+
export const AllVariants = () => `
|
|
317
|
+
<div style="display: flex; flex-direction: column; gap: 3rem;">
|
|
318
|
+
<div>
|
|
319
|
+
<h4 style="margin-bottom: 1rem; font-size: 1rem; font-weight: 600;">Small with Arrow Separator</h4>
|
|
320
|
+
<nav class="ivds-breadcrumb ivds-breadcrumb--small ivds-breadcrumb--separator-arrow" aria-label="Small arrow breadcrumb">
|
|
321
|
+
<ol class="ivds-breadcrumb__list">
|
|
322
|
+
<li class="ivds-breadcrumb__item">
|
|
323
|
+
<a href="#" class="ivds-breadcrumb__link">Home</a>
|
|
324
|
+
</li>
|
|
325
|
+
<li class="ivds-breadcrumb__item">
|
|
326
|
+
<a href="#" class="ivds-breadcrumb__link">Products</a>
|
|
327
|
+
</li>
|
|
328
|
+
<li class="ivds-breadcrumb__item">
|
|
329
|
+
<span class="ivds-breadcrumb__current" aria-current="page">Laptops</span>
|
|
330
|
+
</li>
|
|
331
|
+
</ol>
|
|
332
|
+
</nav>
|
|
333
|
+
</div>
|
|
334
|
+
|
|
335
|
+
<div>
|
|
336
|
+
<h4 style="margin-bottom: 1rem; font-size: 1rem; font-weight: 600;">Large with Icons and Chevron</h4>
|
|
337
|
+
<nav class="ivds-breadcrumb ivds-breadcrumb--large ivds-breadcrumb--with-icons ivds-breadcrumb--separator-chevron" aria-label="Large icon chevron breadcrumb">
|
|
338
|
+
<ol class="ivds-breadcrumb__list">
|
|
339
|
+
<li class="ivds-breadcrumb__item">
|
|
340
|
+
<a href="#" class="ivds-breadcrumb__link">
|
|
341
|
+
<svg class="ivds-breadcrumb__icon" width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
342
|
+
<path d="M3 9L12 2L21 9V20A2 2 0 0 1 19 22H5A2 2 0 0 1 3 20V9Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
343
|
+
</svg>
|
|
344
|
+
Home
|
|
345
|
+
</a>
|
|
346
|
+
</li>
|
|
347
|
+
<li class="ivds-breadcrumb__item">
|
|
348
|
+
<a href="#" class="ivds-breadcrumb__link">
|
|
349
|
+
<svg class="ivds-breadcrumb__icon" width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
350
|
+
<rect x="2" y="3" width="20" height="14" rx="2" ry="2" stroke="currentColor" stroke-width="2" fill="none"/>
|
|
351
|
+
</svg>
|
|
352
|
+
Products
|
|
353
|
+
</a>
|
|
354
|
+
</li>
|
|
355
|
+
<li class="ivds-breadcrumb__item">
|
|
356
|
+
<span class="ivds-breadcrumb__current" aria-current="page">
|
|
357
|
+
<svg class="ivds-breadcrumb__icon" width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
358
|
+
<rect x="2" y="3" width="20" height="14" rx="2" ry="2" stroke="currentColor" stroke-width="2" fill="none"/>
|
|
359
|
+
</svg>
|
|
360
|
+
Laptops
|
|
361
|
+
</span>
|
|
362
|
+
</li>
|
|
363
|
+
</ol>
|
|
364
|
+
</nav>
|
|
365
|
+
</div>
|
|
366
|
+
|
|
367
|
+
<div style="background-color: #1e293b; padding: 1.5rem; border-radius: 0.5rem;">
|
|
368
|
+
<h4 style="margin-bottom: 1rem; font-size: 1rem; font-weight: 600; color: #e2e8f0;">Dark Theme with Bullet Separator</h4>
|
|
369
|
+
<nav class="ivds-breadcrumb ivds-breadcrumb--theme-dark ivds-breadcrumb--separator-bullet" aria-label="Dark theme bullet breadcrumb">
|
|
370
|
+
<ol class="ivds-breadcrumb__list">
|
|
371
|
+
<li class="ivds-breadcrumb__item">
|
|
372
|
+
<a href="#" class="ivds-breadcrumb__link">Dashboard</a>
|
|
373
|
+
</li>
|
|
374
|
+
<li class="ivds-breadcrumb__item">
|
|
375
|
+
<a href="#" class="ivds-breadcrumb__link">Analytics</a>
|
|
376
|
+
</li>
|
|
377
|
+
<li class="ivds-breadcrumb__item">
|
|
378
|
+
<a href="#" class="ivds-breadcrumb__link">Reports</a>
|
|
379
|
+
</li>
|
|
380
|
+
<li class="ivds-breadcrumb__item">
|
|
381
|
+
<span class="ivds-breadcrumb__current" aria-current="page">Monthly Summary</span>
|
|
382
|
+
</li>
|
|
383
|
+
</ol>
|
|
384
|
+
</nav>
|
|
385
|
+
</div>
|
|
386
|
+
</div>
|
|
387
|
+
`;
|
|
388
|
+
|
|
389
|
+
// Accessibility example
|
|
390
|
+
export const AccessibilityFeatures = () => `
|
|
391
|
+
<div style="display: flex; flex-direction: column; gap: 2rem;">
|
|
392
|
+
<div>
|
|
393
|
+
<h4 style="margin-bottom: 1rem;">Standard Breadcrumb with ARIA</h4>
|
|
394
|
+
<nav class="ivds-breadcrumb" aria-label="Breadcrumb navigation">
|
|
395
|
+
<ol class="ivds-breadcrumb__list">
|
|
396
|
+
<li class="ivds-breadcrumb__item">
|
|
397
|
+
<a href="#" class="ivds-breadcrumb__link" aria-describedby="breadcrumb-help">Home</a>
|
|
398
|
+
</li>
|
|
399
|
+
<li class="ivds-breadcrumb__item">
|
|
400
|
+
<a href="#" class="ivds-breadcrumb__link">Documentation</a>
|
|
401
|
+
</li>
|
|
402
|
+
<li class="ivds-breadcrumb__item">
|
|
403
|
+
<a href="#" class="ivds-breadcrumb__link">Components</a>
|
|
404
|
+
</li>
|
|
405
|
+
<li class="ivds-breadcrumb__item">
|
|
406
|
+
<span class="ivds-breadcrumb__current" aria-current="page">Breadcrumb</span>
|
|
407
|
+
</li>
|
|
408
|
+
</ol>
|
|
409
|
+
</nav>
|
|
410
|
+
<p id="breadcrumb-help" style="font-size: 0.875rem; color: #6b7280; margin-top: 0.5rem;">
|
|
411
|
+
Use breadcrumb navigation to understand your current location within the site hierarchy.
|
|
412
|
+
</p>
|
|
413
|
+
</div>
|
|
414
|
+
|
|
415
|
+
<div>
|
|
416
|
+
<h4 style="margin-bottom: 1rem;">Breadcrumb in Container</h4>
|
|
417
|
+
<div style="background-color: #f8fafc; padding: 1rem; border-radius: 0.5rem;">
|
|
418
|
+
<nav class="ivds-breadcrumb" aria-label="Page location">
|
|
419
|
+
<ol class="ivds-breadcrumb__list">
|
|
420
|
+
<li class="ivds-breadcrumb__item">
|
|
421
|
+
<a href="#" class="ivds-breadcrumb__link">Dashboard</a>
|
|
422
|
+
</li>
|
|
423
|
+
<li class="ivds-breadcrumb__item">
|
|
424
|
+
<a href="#" class="ivds-breadcrumb__link">Settings</a>
|
|
425
|
+
</li>
|
|
426
|
+
<li class="ivds-breadcrumb__item">
|
|
427
|
+
<span class="ivds-breadcrumb__current" aria-current="page">Profile</span>
|
|
428
|
+
</li>
|
|
429
|
+
</ol>
|
|
430
|
+
</nav>
|
|
431
|
+
</div>
|
|
432
|
+
</div>
|
|
433
|
+
</div>
|
|
434
|
+
`;
|
|
435
|
+
|
|
436
|
+
// Responsive behavior
|
|
437
|
+
export const ResponsiveBehavior = () => `
|
|
438
|
+
<div style="max-width: 300px; border: 1px solid #e2e8f0; padding: 1rem; border-radius: 0.5rem;">
|
|
439
|
+
<h4 style="margin-bottom: 1rem; font-size: 0.875rem;">Responsive (resize to see effect)</h4>
|
|
440
|
+
<nav class="ivds-breadcrumb ivds-breadcrumb--responsive" aria-label="Responsive breadcrumb">
|
|
441
|
+
<ol class="ivds-breadcrumb__list">
|
|
442
|
+
<li class="ivds-breadcrumb__item">
|
|
443
|
+
<a href="#" class="ivds-breadcrumb__link">Home</a>
|
|
444
|
+
</li>
|
|
445
|
+
<li class="ivds-breadcrumb__item">
|
|
446
|
+
<a href="#" class="ivds-breadcrumb__link">Very Long Category Name</a>
|
|
447
|
+
</li>
|
|
448
|
+
<li class="ivds-breadcrumb__item">
|
|
449
|
+
<a href="#" class="ivds-breadcrumb__link">Subcategory</a>
|
|
450
|
+
</li>
|
|
451
|
+
<li class="ivds-breadcrumb__item">
|
|
452
|
+
<a href="#" class="ivds-breadcrumb__link">Products</a>
|
|
453
|
+
</li>
|
|
454
|
+
<li class="ivds-breadcrumb__item">
|
|
455
|
+
<span class="ivds-breadcrumb__current" aria-current="page">Current Page with Long Title</span>
|
|
456
|
+
</li>
|
|
457
|
+
</ol>
|
|
458
|
+
</nav>
|
|
459
|
+
</div>
|
|
460
|
+
`;
|
|
461
|
+
|
|
462
|
+
// Truncation behavior
|
|
463
|
+
export const Truncation = () => `
|
|
464
|
+
<div style="max-width: 400px; border: 1px solid #e2e8f0; padding: 1rem; border-radius: 0.5rem;">
|
|
465
|
+
<h4 style="margin-bottom: 1rem; font-size: 0.875rem;">Truncated Long Text</h4>
|
|
466
|
+
<nav class="ivds-breadcrumb ivds-breadcrumb--truncate" aria-label="Truncated breadcrumb">
|
|
467
|
+
<ol class="ivds-breadcrumb__list">
|
|
468
|
+
<li class="ivds-breadcrumb__item">
|
|
469
|
+
<a href="#" class="ivds-breadcrumb__link">Home</a>
|
|
470
|
+
</li>
|
|
471
|
+
<li class="ivds-breadcrumb__item">
|
|
472
|
+
<a href="#" class="ivds-breadcrumb__link">This is a very long category name that will be truncated</a>
|
|
473
|
+
</li>
|
|
474
|
+
<li class="ivds-breadcrumb__item">
|
|
475
|
+
<a href="#" class="ivds-breadcrumb__link">Another long subcategory name</a>
|
|
476
|
+
</li>
|
|
477
|
+
<li class="ivds-breadcrumb__item">
|
|
478
|
+
<span class="ivds-breadcrumb__current" aria-current="page">Current page with an extremely long title that exceeds normal length</span>
|
|
479
|
+
</li>
|
|
480
|
+
</ol>
|
|
481
|
+
</nav>
|
|
482
|
+
</div>
|
|
483
|
+
`;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// SCSS compilation test for button mixins
|
|
2
|
+
|
|
3
|
+
// Base button mixin with common styles
|
|
4
|
+
@mixin button-base {
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
border: var(--borderWidth-1, 1px) solid transparent;
|
|
9
|
+
border-radius: var(--borderRadius-md, 0.375rem);
|
|
10
|
+
font-family: var(--fontFamily-sans, system-ui, -apple-system, sans-serif);
|
|
11
|
+
font-weight: var(--fontWeight-medium, 500);
|
|
12
|
+
line-height: var(--lineHeight-tight, 1.25);
|
|
13
|
+
text-decoration: none;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
transition: all 0.15s ease-in-out;
|
|
16
|
+
user-select: none;
|
|
17
|
+
white-space: nowrap;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Test compilation by using the mixins
|
|
21
|
+
.test-button-base {
|
|
22
|
+
@include button-base;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.test-button-variant {
|
|
26
|
+
background-color: #0ea5e9;
|
|
27
|
+
color: #ffffff;
|
|
28
|
+
border-color: transparent;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.test-button-size {
|
|
32
|
+
padding: 0.75rem 1.5rem;
|
|
33
|
+
font-size: 0.875rem;
|
|
34
|
+
min-height: 44px;
|
|
35
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// Button component mixins and private styles
|
|
2
|
+
// This file contains mixins for button variants, sizes, and internal utilities
|
|
3
|
+
|
|
4
|
+
@use '../../variables/variables' as vars;
|
|
5
|
+
|
|
6
|
+
// Base button mixin with common styles
|
|
7
|
+
@mixin button-base {
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
border: var(--borderWidth-1, 1px) solid transparent;
|
|
12
|
+
border-radius: var(--borderRadius-md, 0.375rem);
|
|
13
|
+
font-family: var(--fontFamily-sans, system-ui, -apple-system, sans-serif);
|
|
14
|
+
font-weight: var(--fontWeight-medium, 500);
|
|
15
|
+
line-height: var(--lineHeight-tight, 1.25);
|
|
16
|
+
text-decoration: none;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
transition: all 0.15s ease-in-out;
|
|
19
|
+
user-select: none;
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
|
|
22
|
+
&:focus {
|
|
23
|
+
outline: 2px solid var(--color-brand-primary-500, #f97316);
|
|
24
|
+
outline-offset: 2px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&:disabled,
|
|
28
|
+
&[aria-disabled="true"] {
|
|
29
|
+
opacity: 0.5;
|
|
30
|
+
cursor: not-allowed;
|
|
31
|
+
pointer-events: none;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Button variant mixin
|
|
36
|
+
@mixin button-variant($bg-color, $text-color, $border-color: transparent, $hover-bg: null, $hover-border: null) {
|
|
37
|
+
background-color: $bg-color;
|
|
38
|
+
color: $text-color;
|
|
39
|
+
border-color: $border-color;
|
|
40
|
+
|
|
41
|
+
@if $hover-bg {
|
|
42
|
+
&:hover:not(:disabled, [aria-disabled="true"]) {
|
|
43
|
+
background-color: $hover-bg;
|
|
44
|
+
|
|
45
|
+
@if $hover-border {
|
|
46
|
+
border-color: $hover-border;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&:active:not(:disabled, [aria-disabled="true"]) {
|
|
52
|
+
transform: translateY(1px);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Button size mixin
|
|
57
|
+
@mixin button-size($padding-y, $padding-x, $font-size, $min-height: null) {
|
|
58
|
+
padding: $padding-y $padding-x;
|
|
59
|
+
font-size: $font-size;
|
|
60
|
+
|
|
61
|
+
@if $min-height {
|
|
62
|
+
min-height: $min-height;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Icon spacing
|
|
67
|
+
@mixin button-icon-spacing($gap: var(--spacing-2, 0.5rem)) {
|
|
68
|
+
gap: $gap;
|
|
69
|
+
|
|
70
|
+
.ivds-button__icon {
|
|
71
|
+
display: inline-flex;
|
|
72
|
+
align-items: center;
|
|
73
|
+
justify-content: center;
|
|
74
|
+
flex-shrink: 0;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Loading state
|
|
79
|
+
@mixin button-loading {
|
|
80
|
+
position: relative;
|
|
81
|
+
color: transparent !important;
|
|
82
|
+
|
|
83
|
+
&::after {
|
|
84
|
+
content: '';
|
|
85
|
+
position: absolute;
|
|
86
|
+
top: 50%;
|
|
87
|
+
left: 50%;
|
|
88
|
+
transform: translate(-50%, -50%);
|
|
89
|
+
width: 16px;
|
|
90
|
+
height: 16px;
|
|
91
|
+
border: 2px solid currentcolor;
|
|
92
|
+
border-radius: 50%;
|
|
93
|
+
border-top-color: transparent;
|
|
94
|
+
animation: ivds-button-spin 0.8s linear infinite;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Keyframes for loading animation
|
|
99
|
+
@keyframes ivds-button-spin {
|
|
100
|
+
to {
|
|
101
|
+
transform: translate(-50%, -50%) rotate(360deg);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Full width button mixin
|
|
106
|
+
@mixin button-full-width {
|
|
107
|
+
width: 100%;
|
|
108
|
+
justify-content: center;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Icon-only button mixin
|
|
112
|
+
@mixin button-icon-only($size: 44px) {
|
|
113
|
+
width: $size;
|
|
114
|
+
height: $size;
|
|
115
|
+
padding: 0;
|
|
116
|
+
|
|
117
|
+
.ivds-button__icon {
|
|
118
|
+
margin: 0;
|
|
119
|
+
}
|
|
120
|
+
}
|