@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,450 @@
|
|
|
1
|
+
// Header component stories for Storybook
|
|
2
|
+
// Showcases header layouts, navigation patterns, and responsive behavior
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Core/Header',
|
|
6
|
+
parameters: {
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: 'CSS-only header component using IVDS design tokens. Provides flexible layout options for site navigation with proper semantic structure, accessibility features, and responsive behavior. Includes mixins for branding, layout, and theming.'
|
|
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: 'landmark-one-main',
|
|
25
|
+
enabled: false // Header is not main content
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// Basic header
|
|
34
|
+
export const Basic = () => `
|
|
35
|
+
<header class="ivds-header">
|
|
36
|
+
<div class="ivds-header__brand">
|
|
37
|
+
<a href="#" class="ivds-header__brand-text">IVDS</a>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<nav class="ivds-header__nav" aria-label="Main navigation">
|
|
41
|
+
<a href="#" style="color: #334155; text-decoration: none; font-weight: 500;">Home</a>
|
|
42
|
+
<a href="#" style="color: #334155; text-decoration: none; font-weight: 500;">About</a>
|
|
43
|
+
<a href="#" style="color: #334155; text-decoration: none; font-weight: 500;">Services</a>
|
|
44
|
+
<a href="#" style="color: #334155; text-decoration: none; font-weight: 500;">Contact</a>
|
|
45
|
+
</nav>
|
|
46
|
+
|
|
47
|
+
<div class="ivds-header__actions">
|
|
48
|
+
<button class="ivds-button ivds-button--secondary ivds-button--small">Sign In</button>
|
|
49
|
+
<button class="ivds-button ivds-button--primary ivds-button--small">Sign Up</button>
|
|
50
|
+
</div>
|
|
51
|
+
</header>
|
|
52
|
+
`;
|
|
53
|
+
|
|
54
|
+
// Header with logo
|
|
55
|
+
export const WithLogo = () => `
|
|
56
|
+
<header class="ivds-header">
|
|
57
|
+
<div class="ivds-header__brand">
|
|
58
|
+
<svg class="ivds-header__brand-logo" width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
59
|
+
<rect width="32" height="32" rx="8" fill="#0ea5e9"/>
|
|
60
|
+
<path d="M8 12h16v2H8v-2zm0 4h16v2H8v-2zm0 4h10v2H8v-2z" fill="white"/>
|
|
61
|
+
</svg>
|
|
62
|
+
<a href="#" class="ivds-header__brand-text">Design System</a>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<nav class="ivds-header__nav" aria-label="Main navigation">
|
|
66
|
+
<a href="#" style="color: #334155; text-decoration: none; font-weight: 500;">Components</a>
|
|
67
|
+
<a href="#" style="color: #334155; text-decoration: none; font-weight: 500;">Tokens</a>
|
|
68
|
+
<a href="#" style="color: #334155; text-decoration: none; font-weight: 500;">Documentation</a>
|
|
69
|
+
<a href="#" style="color: #334155; text-decoration: none; font-weight: 500;">Examples</a>
|
|
70
|
+
</nav>
|
|
71
|
+
|
|
72
|
+
<div class="ivds-header__actions">
|
|
73
|
+
<button class="ivds-button ivds-button--tertiary ivds-button--small" aria-label="Search">
|
|
74
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
75
|
+
<circle cx="11" cy="11" r="8" stroke="currentColor" stroke-width="2"/>
|
|
76
|
+
<path d="m21 21-4.35-4.35" stroke="currentColor" stroke-width="2"/>
|
|
77
|
+
</svg>
|
|
78
|
+
</button>
|
|
79
|
+
<button class="ivds-button ivds-button--primary ivds-button--small">Get Started</button>
|
|
80
|
+
</div>
|
|
81
|
+
</header>
|
|
82
|
+
`;
|
|
83
|
+
|
|
84
|
+
// Sticky header
|
|
85
|
+
export const Sticky = () => `
|
|
86
|
+
<div style="height: 200vh; background: linear-gradient(to bottom, #f8fafc, #e2e8f0);">
|
|
87
|
+
<header class="ivds-header ivds-header--sticky">
|
|
88
|
+
<div class="ivds-header__brand">
|
|
89
|
+
<a href="#" class="ivds-header__brand-text">Sticky Header</a>
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<nav class="ivds-header__nav" aria-label="Main navigation">
|
|
93
|
+
<a href="#" style="color: #334155; text-decoration: none; font-weight: 500;">Home</a>
|
|
94
|
+
<a href="#" style="color: #334155; text-decoration: none; font-weight: 500;">Products</a>
|
|
95
|
+
<a href="#" style="color: #334155; text-decoration: none; font-weight: 500;">About</a>
|
|
96
|
+
<a href="#" style="color: #334155; text-decoration: none; font-weight: 500;">Contact</a>
|
|
97
|
+
</nav>
|
|
98
|
+
|
|
99
|
+
<div class="ivds-header__actions">
|
|
100
|
+
<button class="ivds-button ivds-button--secondary ivds-button--small">Login</button>
|
|
101
|
+
</div>
|
|
102
|
+
</header>
|
|
103
|
+
|
|
104
|
+
<div style="padding: 2rem; text-align: center;">
|
|
105
|
+
<h1 style="margin-bottom: 1rem;">Scroll down to see sticky behavior</h1>
|
|
106
|
+
<p>This header will stick to the top of the viewport when scrolling.</p>
|
|
107
|
+
<div style="margin-top: 4rem; padding: 2rem; background: white; border-radius: 0.5rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1);">
|
|
108
|
+
<h2>Content Section 1</h2>
|
|
109
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
|
|
110
|
+
</div>
|
|
111
|
+
<div style="margin-top: 2rem; padding: 2rem; background: white; border-radius: 0.5rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1);">
|
|
112
|
+
<h2>Content Section 2</h2>
|
|
113
|
+
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
`;
|
|
118
|
+
|
|
119
|
+
// Header with search
|
|
120
|
+
export const WithSearch = () => `
|
|
121
|
+
<header class="ivds-header">
|
|
122
|
+
<div class="ivds-header__brand">
|
|
123
|
+
<a href="#" class="ivds-header__brand-text">IVDS</a>
|
|
124
|
+
</div>
|
|
125
|
+
|
|
126
|
+
<div style="flex: 1; max-width: 400px; margin: 0 2rem;">
|
|
127
|
+
<div style="position: relative;">
|
|
128
|
+
<input
|
|
129
|
+
type="search"
|
|
130
|
+
placeholder="Search components, tokens, docs..."
|
|
131
|
+
style="width: 100%; padding: 0.5rem 0.75rem 0.5rem 2.5rem; border: 1px solid #d1d5db; border-radius: 0.375rem; font-size: 0.875rem;"
|
|
132
|
+
aria-label="Search"
|
|
133
|
+
/>
|
|
134
|
+
<svg
|
|
135
|
+
style="position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: #6b7280;"
|
|
136
|
+
width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"
|
|
137
|
+
>
|
|
138
|
+
<circle cx="11" cy="11" r="8" stroke="currentColor" stroke-width="2"/>
|
|
139
|
+
<path d="m21 21-4.35-4.35" stroke="currentColor" stroke-width="2"/>
|
|
140
|
+
</svg>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
|
|
144
|
+
<nav class="ivds-header__nav" aria-label="Main navigation">
|
|
145
|
+
<a href="#" style="color: #334155; text-decoration: none; font-weight: 500;">Docs</a>
|
|
146
|
+
<a href="#" style="color: #334155; text-decoration: none; font-weight: 500;">Components</a>
|
|
147
|
+
<a href="#" style="color: #334155; text-decoration: none; font-weight: 500;">GitHub</a>
|
|
148
|
+
</nav>
|
|
149
|
+
|
|
150
|
+
<div class="ivds-header__actions">
|
|
151
|
+
<button class="ivds-button ivds-button--tertiary ivds-button--small" aria-label="Toggle theme">
|
|
152
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
153
|
+
<circle cx="12" cy="12" r="5" stroke="currentColor" stroke-width="2"/>
|
|
154
|
+
<line x1="12" y1="1" x2="12" y2="3" stroke="currentColor" stroke-width="2"/>
|
|
155
|
+
<line x1="12" y1="21" x2="12" y2="23" stroke="currentColor" stroke-width="2"/>
|
|
156
|
+
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64" stroke="currentColor" stroke-width="2"/>
|
|
157
|
+
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78" stroke="currentColor" stroke-width="2"/>
|
|
158
|
+
<line x1="1" y1="12" x2="3" y2="12" stroke="currentColor" stroke-width="2"/>
|
|
159
|
+
<line x1="21" y1="12" x2="23" y2="12" stroke="currentColor" stroke-width="2"/>
|
|
160
|
+
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36" stroke="currentColor" stroke-width="2"/>
|
|
161
|
+
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22" stroke="currentColor" stroke-width="2"/>
|
|
162
|
+
</svg>
|
|
163
|
+
</button>
|
|
164
|
+
<button class="ivds-button ivds-button--primary ivds-button--small">Get Started</button>
|
|
165
|
+
</div>
|
|
166
|
+
</header>
|
|
167
|
+
`;
|
|
168
|
+
|
|
169
|
+
// Simple header
|
|
170
|
+
export const Simple = () => `
|
|
171
|
+
<header class="ivds-header">
|
|
172
|
+
<div class="ivds-header__brand">
|
|
173
|
+
<a href="#" class="ivds-header__brand-text">Simple Site</a>
|
|
174
|
+
</div>
|
|
175
|
+
|
|
176
|
+
<nav class="ivds-header__nav" aria-label="Main navigation">
|
|
177
|
+
<a href="#" style="color: #334155; text-decoration: none; font-weight: 500;">Home</a>
|
|
178
|
+
<a href="#" style="color: #334155; text-decoration: none; font-weight: 500;">About</a>
|
|
179
|
+
<a href="#" style="color: #334155; text-decoration: none; font-weight: 500;">Contact</a>
|
|
180
|
+
</nav>
|
|
181
|
+
</header>
|
|
182
|
+
`;
|
|
183
|
+
|
|
184
|
+
// Header with user menu
|
|
185
|
+
export const WithUserMenu = () => `
|
|
186
|
+
<header class="ivds-header">
|
|
187
|
+
<div class="ivds-header__brand">
|
|
188
|
+
<svg class="ivds-header__brand-logo" width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
189
|
+
<rect width="32" height="32" rx="8" fill="#0ea5e9"/>
|
|
190
|
+
<path d="M8 12h16v2H8v-2zm0 4h16v2H8v-2zm0 4h10v2H8v-2z" fill="white"/>
|
|
191
|
+
</svg>
|
|
192
|
+
<a href="#" class="ivds-header__brand-text">Dashboard</a>
|
|
193
|
+
</div>
|
|
194
|
+
|
|
195
|
+
<nav class="ivds-header__nav" aria-label="Main navigation">
|
|
196
|
+
<a href="#" style="color: #334155; text-decoration: none; font-weight: 500;">Overview</a>
|
|
197
|
+
<a href="#" style="color: #334155; text-decoration: none; font-weight: 500;">Projects</a>
|
|
198
|
+
<a href="#" style="color: #334155; text-decoration: none; font-weight: 500;">Team</a>
|
|
199
|
+
<a href="#" style="color: #334155; text-decoration: none; font-weight: 500;">Settings</a>
|
|
200
|
+
</nav>
|
|
201
|
+
|
|
202
|
+
<div class="ivds-header__actions">
|
|
203
|
+
<button class="ivds-button ivds-button--tertiary ivds-button--small" aria-label="Notifications">
|
|
204
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
205
|
+
<path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9" stroke="currentColor" stroke-width="2"/>
|
|
206
|
+
<path d="M13.73 21a2 2 0 0 1-3.46 0" stroke="currentColor" stroke-width="2"/>
|
|
207
|
+
</svg>
|
|
208
|
+
</button>
|
|
209
|
+
|
|
210
|
+
<div style="display: flex; align-items: center; gap: 0.5rem;">
|
|
211
|
+
<img
|
|
212
|
+
src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='16' fill='%23e2e8f0'/%3E%3Ctext x='16' y='20' text-anchor='middle' font-family='system-ui' font-size='14' fill='%23475569'%3EJD%3C/text%3E%3C/svg%3E"
|
|
213
|
+
alt="User avatar"
|
|
214
|
+
style="width: 2rem; height: 2rem; border-radius: 50%;"
|
|
215
|
+
/>
|
|
216
|
+
<button
|
|
217
|
+
style="background: none; border: none; color: #334155; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 0.25rem;"
|
|
218
|
+
aria-label="User menu"
|
|
219
|
+
>
|
|
220
|
+
John Doe
|
|
221
|
+
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
222
|
+
<polyline points="6,9 12,15 18,9" stroke="currentColor" stroke-width="2"/>
|
|
223
|
+
</svg>
|
|
224
|
+
</button>
|
|
225
|
+
</div>
|
|
226
|
+
</div>
|
|
227
|
+
</header>
|
|
228
|
+
`;
|
|
229
|
+
|
|
230
|
+
// Responsive header with mobile menu
|
|
231
|
+
export const ResponsiveMobile = () => `
|
|
232
|
+
<div style="max-width: 375px; margin: 0 auto; border: 1px solid #e2e8f0; border-radius: 0.5rem; overflow: hidden;">
|
|
233
|
+
<header class="ivds-header ivds-header--mobile-nav-open">
|
|
234
|
+
<div class="ivds-header__brand">
|
|
235
|
+
<svg class="ivds-header__brand-logo" width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
236
|
+
<rect width="32" height="32" rx="8" fill="#0ea5e9"/>
|
|
237
|
+
<path d="M8 12h16v2H8v-2zm0 4h16v2H8v-2zm0 4h10v2H8v-2z" fill="white"/>
|
|
238
|
+
</svg>
|
|
239
|
+
<a href="#" class="ivds-header__brand-text">IVDS</a>
|
|
240
|
+
</div>
|
|
241
|
+
|
|
242
|
+
<button class="ivds-header__mobile-toggle" aria-label="Toggle navigation menu" aria-expanded="true">
|
|
243
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
244
|
+
<line x1="18" y1="6" x2="6" y2="18" stroke="currentColor" stroke-width="2"/>
|
|
245
|
+
<line x1="6" y1="6" x2="18" y2="18" stroke="currentColor" stroke-width="2"/>
|
|
246
|
+
</svg>
|
|
247
|
+
</button>
|
|
248
|
+
|
|
249
|
+
<div class="ivds-header__actions">
|
|
250
|
+
<button class="ivds-button ivds-button--primary ivds-button--small">Sign Up</button>
|
|
251
|
+
</div>
|
|
252
|
+
|
|
253
|
+
<div class="ivds-header__search ivds-header__search--mobile-visible">
|
|
254
|
+
<input
|
|
255
|
+
type="search"
|
|
256
|
+
placeholder="Search..."
|
|
257
|
+
style="width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #d1d5db; border-radius: 0.375rem; font-size: 0.875rem;"
|
|
258
|
+
aria-label="Search"
|
|
259
|
+
/>
|
|
260
|
+
</div>
|
|
261
|
+
|
|
262
|
+
<nav class="ivds-header__nav" aria-label="Main navigation">
|
|
263
|
+
<a href="#" aria-current="page">Home</a>
|
|
264
|
+
<a href="#">Components</a>
|
|
265
|
+
<a href="#">Documentation</a>
|
|
266
|
+
<a href="#">Support</a>
|
|
267
|
+
</nav>
|
|
268
|
+
</header>
|
|
269
|
+
|
|
270
|
+
<div style="padding: 1rem; background-color: #f8fafc; text-align: center;">
|
|
271
|
+
<p style="font-size: 0.875rem; color: #6b7280;">Mobile view (375px width)</p>
|
|
272
|
+
<p style="font-size: 0.875rem; color: #6b7280; margin-top: 0.5rem;">Navigation expands below on mobile</p>
|
|
273
|
+
</div>
|
|
274
|
+
</div>
|
|
275
|
+
`;
|
|
276
|
+
|
|
277
|
+
// Dark theme header
|
|
278
|
+
export const DarkTheme = () => `
|
|
279
|
+
<header class="ivds-header ivds-header--dark">
|
|
280
|
+
<div class="ivds-header__brand">
|
|
281
|
+
<svg class="ivds-header__brand-logo" width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
282
|
+
<rect width="32" height="32" rx="8" fill="#0ea5e9"/>
|
|
283
|
+
<path d="M8 12h16v2H8v-2zm0 4h16v2H8v-2zm0 4h10v2H8v-2z" fill="white"/>
|
|
284
|
+
</svg>
|
|
285
|
+
<a href="#" class="ivds-header__brand-text">Dark Theme</a>
|
|
286
|
+
</div>
|
|
287
|
+
|
|
288
|
+
<nav class="ivds-header__nav" aria-label="Main navigation">
|
|
289
|
+
<a href="#" aria-current="page">Home</a>
|
|
290
|
+
<a href="#">Products</a>
|
|
291
|
+
<a href="#">About</a>
|
|
292
|
+
<a href="#">Contact</a>
|
|
293
|
+
</nav>
|
|
294
|
+
|
|
295
|
+
<div class="ivds-header__actions">
|
|
296
|
+
<button class="ivds-button ivds-button--tertiary ivds-button--small" style="color: #f8fafc; border-color: #475569;">
|
|
297
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
298
|
+
<circle cx="12" cy="12" r="5" stroke="currentColor" stroke-width="2"/>
|
|
299
|
+
<line x1="12" y1="1" x2="12" y2="3" stroke="currentColor" stroke-width="2"/>
|
|
300
|
+
<line x1="12" y1="21" x2="12" y2="23" stroke="currentColor" stroke-width="2"/>
|
|
301
|
+
</svg>
|
|
302
|
+
</button>
|
|
303
|
+
<button class="ivds-button ivds-button--primary ivds-button--small">Get Started</button>
|
|
304
|
+
</div>
|
|
305
|
+
</header>
|
|
306
|
+
`;
|
|
307
|
+
|
|
308
|
+
// Compact header variant
|
|
309
|
+
export const Compact = () => `
|
|
310
|
+
<header class="ivds-header ivds-header--compact">
|
|
311
|
+
<div class="ivds-header__brand">
|
|
312
|
+
<svg class="ivds-header__brand-logo" width="24" height="24" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
313
|
+
<rect width="32" height="32" rx="8" fill="#0ea5e9"/>
|
|
314
|
+
<path d="M8 12h16v2H8v-2zm0 4h16v2H8v-2zm0 4h10v2H8v-2z" fill="white"/>
|
|
315
|
+
</svg>
|
|
316
|
+
<a href="#" class="ivds-header__brand-text">Compact</a>
|
|
317
|
+
</div>
|
|
318
|
+
|
|
319
|
+
<nav class="ivds-header__nav" aria-label="Main navigation">
|
|
320
|
+
<a href="#" aria-current="page">Dashboard</a>
|
|
321
|
+
<a href="#">Analytics</a>
|
|
322
|
+
<a href="#">Reports</a>
|
|
323
|
+
<a href="#">Settings</a>
|
|
324
|
+
</nav>
|
|
325
|
+
|
|
326
|
+
<div class="ivds-header__actions">
|
|
327
|
+
<button class="ivds-button ivds-button--tertiary ivds-button--small">
|
|
328
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
329
|
+
<path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9" stroke="currentColor" stroke-width="2"/>
|
|
330
|
+
</svg>
|
|
331
|
+
</button>
|
|
332
|
+
<button class="ivds-button ivds-button--primary ivds-button--small">Profile</button>
|
|
333
|
+
</div>
|
|
334
|
+
</header>
|
|
335
|
+
|
|
336
|
+
<div style="padding: 1rem; background-color: #f8fafc; text-align: center;">
|
|
337
|
+
<p style="font-size: 0.875rem; color: #6b7280;">Compact header variant with reduced height and spacing</p>
|
|
338
|
+
</div>
|
|
339
|
+
`;
|
|
340
|
+
|
|
341
|
+
// Transparent header
|
|
342
|
+
export const Transparent = () => `
|
|
343
|
+
<div style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); min-height: 100vh;">
|
|
344
|
+
<header class="ivds-header ivds-header--transparent">
|
|
345
|
+
<div class="ivds-header__brand">
|
|
346
|
+
<a href="#" class="ivds-header__brand-text" style="color: white;">Transparent</a>
|
|
347
|
+
</div>
|
|
348
|
+
|
|
349
|
+
<nav class="ivds-header__nav" aria-label="Main navigation">
|
|
350
|
+
<a href="#" style="color: rgba(255,255,255,0.9); text-decoration: none; font-weight: 500;" aria-current="page">Home</a>
|
|
351
|
+
<a href="#" style="color: rgba(255,255,255,0.9); text-decoration: none; font-weight: 500;">Features</a>
|
|
352
|
+
<a href="#" style="color: rgba(255,255,255,0.9); text-decoration: none; font-weight: 500;">Pricing</a>
|
|
353
|
+
<a href="#" style="color: rgba(255,255,255,0.9); text-decoration: none; font-weight: 500;">Contact</a>
|
|
354
|
+
</nav>
|
|
355
|
+
|
|
356
|
+
<div class="ivds-header__actions">
|
|
357
|
+
<button class="ivds-button ivds-button--secondary ivds-button--small" style="background: rgba(255,255,255,0.2); color: white; border-color: rgba(255,255,255,0.3);">Login</button>
|
|
358
|
+
<button class="ivds-button ivds-button--primary ivds-button--small">Sign Up</button>
|
|
359
|
+
</div>
|
|
360
|
+
</header>
|
|
361
|
+
|
|
362
|
+
<div style="padding: 4rem 2rem; text-align: center; color: white;">
|
|
363
|
+
<h1 style="font-size: 3rem; margin-bottom: 1rem; font-weight: 700;">Hero Section</h1>
|
|
364
|
+
<p style="font-size: 1.25rem; opacity: 0.9; max-width: 600px; margin: 0 auto;">Transparent header overlays content beautifully. Scroll to see sticky behavior with backdrop blur.</p>
|
|
365
|
+
<div style="margin-top: 8rem; padding: 2rem; background: rgba(255,255,255,0.1); border-radius: 1rem; backdrop-filter: blur(10px);">
|
|
366
|
+
<h2 style="margin-bottom: 1rem;">Content Section</h2>
|
|
367
|
+
<p>This demonstrates how the transparent header works with content below.</p>
|
|
368
|
+
</div>
|
|
369
|
+
</div>
|
|
370
|
+
</div>
|
|
371
|
+
`;
|
|
372
|
+
|
|
373
|
+
// Header with container wrapper
|
|
374
|
+
export const WithContainer = () => `
|
|
375
|
+
<header class="ivds-header">
|
|
376
|
+
<div class="ivds-header__container">
|
|
377
|
+
<div class="ivds-header__brand">
|
|
378
|
+
<svg class="ivds-header__brand-logo" width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
379
|
+
<rect width="32" height="32" rx="8" fill="#0ea5e9"/>
|
|
380
|
+
<path d="M8 12h16v2H8v-2zm0 4h16v2H8v-2zm0 4h10v2H8v-2z" fill="white"/>
|
|
381
|
+
</svg>
|
|
382
|
+
<a href="#" class="ivds-header__brand-text">Contained</a>
|
|
383
|
+
</div>
|
|
384
|
+
|
|
385
|
+
<nav class="ivds-header__nav" aria-label="Main navigation">
|
|
386
|
+
<a href="#" aria-current="page">Home</a>
|
|
387
|
+
<a href="#">Products</a>
|
|
388
|
+
<a href="#">Services</a>
|
|
389
|
+
<a href="#">About</a>
|
|
390
|
+
<a href="#">Contact</a>
|
|
391
|
+
</nav>
|
|
392
|
+
|
|
393
|
+
<div class="ivds-header__actions">
|
|
394
|
+
<button class="ivds-button ivds-button--secondary ivds-button--small">Login</button>
|
|
395
|
+
<button class="ivds-button ivds-button--primary ivds-button--small">Sign Up</button>
|
|
396
|
+
</div>
|
|
397
|
+
</div>
|
|
398
|
+
</header>
|
|
399
|
+
|
|
400
|
+
<div style="padding: 2rem; background-color: #f8fafc; text-align: center;">
|
|
401
|
+
<p style="font-size: 0.875rem; color: #6b7280;">Header content is contained within a max-width container (1200px)</p>
|
|
402
|
+
<p style="font-size: 0.875rem; color: #6b7280; margin-top: 0.5rem;">Useful for full-width header backgrounds with contained content</p>
|
|
403
|
+
</div>
|
|
404
|
+
`;
|
|
405
|
+
|
|
406
|
+
// Accessibility example
|
|
407
|
+
export const AccessibilityFeatures = () => `
|
|
408
|
+
<header class="ivds-header" role="banner">
|
|
409
|
+
<div class="ivds-header__brand">
|
|
410
|
+
<a href="#" class="ivds-header__brand-text" aria-label="IVDS Design System home">
|
|
411
|
+
<svg class="ivds-header__brand-logo" width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
412
|
+
<rect width="32" height="32" rx="8" fill="#0ea5e9"/>
|
|
413
|
+
<path d="M8 12h16v2H8v-2zm0 4h16v2H8v-2zm0 4h10v2H8v-2z" fill="white"/>
|
|
414
|
+
</svg>
|
|
415
|
+
IVDS
|
|
416
|
+
</a>
|
|
417
|
+
</div>
|
|
418
|
+
|
|
419
|
+
<nav class="ivds-header__nav" aria-label="Main navigation" role="navigation">
|
|
420
|
+
<a href="#" aria-current="page">Home</a>
|
|
421
|
+
<a href="#">Components</a>
|
|
422
|
+
<a href="#">Documentation</a>
|
|
423
|
+
<a href="#">Support</a>
|
|
424
|
+
</nav>
|
|
425
|
+
|
|
426
|
+
<div class="ivds-header__actions">
|
|
427
|
+
<button class="ivds-button ivds-button--tertiary ivds-button--small" aria-label="Search components and documentation">
|
|
428
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
429
|
+
<circle cx="11" cy="11" r="8" stroke="currentColor" stroke-width="2"/>
|
|
430
|
+
<path d="m21 21-4.35-4.35" stroke="currentColor" stroke-width="2"/>
|
|
431
|
+
</svg>
|
|
432
|
+
</button>
|
|
433
|
+
<button class="ivds-button ivds-button--secondary ivds-button--small">Sign In</button>
|
|
434
|
+
<button class="ivds-button ivds-button--primary ivds-button--small">Get Started</button>
|
|
435
|
+
</div>
|
|
436
|
+
</header>
|
|
437
|
+
|
|
438
|
+
<div style="padding: 2rem; background-color: #f8fafc;">
|
|
439
|
+
<h1>Accessibility Features</h1>
|
|
440
|
+
<ul style="margin-top: 1rem; line-height: 1.6;">
|
|
441
|
+
<li><strong>Semantic HTML:</strong> Uses proper header, nav, and role attributes</li>
|
|
442
|
+
<li><strong>ARIA Labels:</strong> Descriptive labels for interactive elements</li>
|
|
443
|
+
<li><strong>Current Page:</strong> aria-current="page" indicates active navigation item</li>
|
|
444
|
+
<li><strong>Focus Management:</strong> Proper focus indicators and keyboard navigation</li>
|
|
445
|
+
<li><strong>Screen Reader Support:</strong> aria-hidden for decorative icons</li>
|
|
446
|
+
<li><strong>Responsive Design:</strong> Mobile-friendly navigation patterns</li>
|
|
447
|
+
<li><strong>Color Contrast:</strong> Meets WCAG AA standards for text contrast</li>
|
|
448
|
+
</ul>
|
|
449
|
+
</div>
|
|
450
|
+
`;
|