@easy-web/content-blocks 1.3.3 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -395
- package/dist/schemas/galleries.d.ts +3 -316
- package/dist/schemas/galleries.d.ts.map +1 -1
- package/dist/schemas/galleries.js +3 -133
- package/dist/schemas/galleries.js.map +1 -1
- package/dist/schemas/notFound.d.ts +3 -32
- package/dist/schemas/notFound.d.ts.map +1 -1
- package/dist/schemas/notFound.js +3 -27
- package/dist/schemas/notFound.js.map +1 -1
- package/package.json +3 -4
- package/src/components/BlogPostCard.astro +8 -74
- package/src/components/Card.astro +8 -65
- package/src/components/CardGrid.astro +8 -24
- package/src/components/ContactSection.astro +8 -68
- package/src/components/CtaSection.astro +8 -77
- package/src/components/DraftBanner.astro +8 -28
- package/src/components/Footer.astro +8 -76
- package/src/components/GalleryCarousel.astro +9 -292
- package/src/components/GalleryFeatureHighlight.astro +9 -149
- package/src/components/GalleryHeroSlider.astro +9 -358
- package/src/components/GalleryImageGrid.astro +9 -139
- package/src/components/GalleryLightboxGrid.astro +9 -349
- package/src/components/GalleryMasonryGrid.astro +9 -123
- package/src/components/GallerySection.astro +9 -65
- package/src/components/Header.astro +13 -217
- package/src/components/HeaderCentered.astro +17 -242
- package/src/components/HeaderFlyout.astro +13 -380
- package/src/components/HeaderHideOnScroll.astro +17 -248
- package/src/components/Hero.astro +8 -73
- package/src/components/LanguageNotice.astro +8 -27
- package/src/components/LanguageSwitch.astro +7 -65
- package/src/components/LegalLayout.astro +8 -57
- package/src/components/NotFound.astro +7 -118
- package/src/components/PageShell.astro +7 -79
- package/src/components/Prose.astro +10 -153
- package/src/components/Section.astro +8 -32
- package/src/components/ThemeToggle.astro +8 -77
- package/src/components/UniversalMedia.astro +7 -96
- package/src/schemas/galleries.ts +3 -150
- package/src/schemas/notFound.ts +3 -31
- package/dist/__tests__/exports-resolution.test.d.ts +0 -2
- package/dist/__tests__/exports-resolution.test.d.ts.map +0 -1
- package/dist/__tests__/exports-resolution.test.js +0 -83
- package/dist/__tests__/exports-resolution.test.js.map +0 -1
- package/dist/components/__tests__/UniversalMedia.test.d.ts +0 -2
- package/dist/components/__tests__/UniversalMedia.test.d.ts.map +0 -1
- package/dist/components/__tests__/UniversalMedia.test.js +0 -46
- package/dist/components/__tests__/UniversalMedia.test.js.map +0 -1
- package/dist/schemas/__tests__/notFound.test.d.ts +0 -2
- package/dist/schemas/__tests__/notFound.test.d.ts.map +0 -1
- package/dist/schemas/__tests__/notFound.test.js +0 -29
- package/dist/schemas/__tests__/notFound.test.js.map +0 -1
- package/src/components/__tests__/UniversalMedia.test.ts +0 -65
- package/src/schemas/__tests__/notFound.test.ts +0 -32
|
@@ -1,223 +1,19 @@
|
|
|
1
1
|
---
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* @deprecated Import `@easy-web/core/components/Header.astro` instead.
|
|
4
|
+
* Compatibility wrapper: renders the core component with the same props and slots.
|
|
5
|
+
*
|
|
6
|
+
* The `actions` slot is forwarded only when the caller fills it. Astro registers
|
|
7
|
+
* a slot even when its `{cond && <Fragment slot>}` expression is false, which
|
|
8
|
+
* would replace the core fallback (theme toggle and language switch) with nothing.
|
|
5
9
|
*/
|
|
6
|
-
import
|
|
7
|
-
import
|
|
10
|
+
import type { ComponentProps } from 'astro/types';
|
|
11
|
+
import Header from '@easy-web/core/components/Header.astro';
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
siteName: string;
|
|
11
|
-
navItems: Array<{ label: string; href: string }>;
|
|
12
|
-
currentLang: string;
|
|
13
|
-
pathname: string;
|
|
14
|
-
/** Explicit brand link href. Falls back to `/` (de) or `/${currentLang}/` (other). */
|
|
15
|
-
brandHref?: string;
|
|
16
|
-
/** Explicit alternate locale URL to pass to LanguageSwitch. */
|
|
17
|
-
alternateHref?: string;
|
|
18
|
-
/** Accessible label for the mobile menu toggle button. */
|
|
19
|
-
menuLabel?: string;
|
|
20
|
-
/** Optional logo URL. When provided, renders an <img> in the brand area instead of site name text. */
|
|
21
|
-
logo?: string;
|
|
22
|
-
/**
|
|
23
|
-
* DOM id linking the menu button's `aria-controls` to the `<nav>`.
|
|
24
|
-
* Stable by default so builds are reproducible. Override only when rendering
|
|
25
|
-
* more than one of this header variant on a single page.
|
|
26
|
-
*/
|
|
27
|
-
navId?: string;
|
|
28
|
-
/**
|
|
29
|
-
* Locales this site actually serves. When it holds a single entry the
|
|
30
|
-
* language switch is omitted, because on a one-locale site it is a control
|
|
31
|
-
* that navigates to a route the site does not build. Omit the prop to keep
|
|
32
|
-
* the switch rendering unconditionally.
|
|
33
|
-
*/
|
|
34
|
-
locales?: readonly string[];
|
|
35
|
-
}
|
|
13
|
+
type Props = ComponentProps<typeof Header>;
|
|
36
14
|
|
|
37
|
-
const
|
|
38
|
-
const showLanguageSwitch = !locales || locales.length > 1;
|
|
15
|
+
const props = Astro.props;
|
|
39
16
|
---
|
|
40
|
-
|
|
41
|
-
<
|
|
42
|
-
<
|
|
43
|
-
<a href={brandHref ?? (currentLang === 'de' ? '/' : `/${currentLang}/`)} class="ew-header__brand">
|
|
44
|
-
{logo ? <img src={logo} alt={siteName} class="ew-header__logo" /> : siteName}
|
|
45
|
-
</a>
|
|
46
|
-
|
|
47
|
-
<button
|
|
48
|
-
type="button"
|
|
49
|
-
class="ew-header__menu-btn"
|
|
50
|
-
aria-label={menuLabel}
|
|
51
|
-
aria-expanded="false"
|
|
52
|
-
aria-controls={navId}
|
|
53
|
-
data-testid="mobile-menu-toggle"
|
|
54
|
-
>
|
|
55
|
-
<svg class="ew-header__menu-icon ew-header__menu-icon--open" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true">
|
|
56
|
-
<line x1="3" y1="6" x2="21" y2="6"></line>
|
|
57
|
-
<line x1="3" y1="12" x2="21" y2="12"></line>
|
|
58
|
-
<line x1="3" y1="18" x2="21" y2="18"></line>
|
|
59
|
-
</svg>
|
|
60
|
-
<svg class="ew-header__menu-icon ew-header__menu-icon--close" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true">
|
|
61
|
-
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
62
|
-
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
63
|
-
</svg>
|
|
64
|
-
</button>
|
|
65
|
-
|
|
66
|
-
<nav id={navId} class="ew-header__nav" aria-label="Main navigation">
|
|
67
|
-
<ul class="ew-header__links">
|
|
68
|
-
{navItems.map((item) => (
|
|
69
|
-
<li>
|
|
70
|
-
<a href={item.href} class:list={['ew-header__link', { 'ew-header__link--active': pathname === item.href }]}>
|
|
71
|
-
{item.label}
|
|
72
|
-
</a>
|
|
73
|
-
</li>
|
|
74
|
-
))}
|
|
75
|
-
</ul>
|
|
76
|
-
<div class="ew-header__actions">
|
|
77
|
-
<slot name="actions">
|
|
78
|
-
<ThemeToggle />
|
|
79
|
-
{showLanguageSwitch && <LanguageSwitch currentLang={currentLang} pathname={pathname} alternateHref={alternateHref} />}
|
|
80
|
-
</slot>
|
|
81
|
-
</div>
|
|
82
|
-
</nav>
|
|
83
|
-
</div>
|
|
84
|
-
</header>
|
|
85
|
-
|
|
86
|
-
<style>
|
|
87
|
-
.ew-header {
|
|
88
|
-
position: sticky;
|
|
89
|
-
top: 0;
|
|
90
|
-
z-index: 100;
|
|
91
|
-
background: var(--ew-surface);
|
|
92
|
-
border-bottom: 1px solid var(--ew-border);
|
|
93
|
-
}
|
|
94
|
-
.ew-header__inner {
|
|
95
|
-
display: flex;
|
|
96
|
-
align-items: center;
|
|
97
|
-
justify-content: space-between;
|
|
98
|
-
max-width: 72rem;
|
|
99
|
-
margin: 0 auto;
|
|
100
|
-
padding: var(--ew-space-3) var(--ew-space-5);
|
|
101
|
-
}
|
|
102
|
-
.ew-header__brand {
|
|
103
|
-
font-family: var(--ew-font-sans);
|
|
104
|
-
font-size: var(--ew-text-lg);
|
|
105
|
-
font-weight: 700;
|
|
106
|
-
color: var(--ew-on-surface);
|
|
107
|
-
text-decoration: none;
|
|
108
|
-
letter-spacing: -0.01em;
|
|
109
|
-
}
|
|
110
|
-
.ew-header__brand:hover {
|
|
111
|
-
color: var(--ew-primary);
|
|
112
|
-
}
|
|
113
|
-
.ew-header__logo {
|
|
114
|
-
height: 1.5rem;
|
|
115
|
-
width: auto;
|
|
116
|
-
display: block;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/* Mobile menu button */
|
|
120
|
-
.ew-header__menu-btn {
|
|
121
|
-
display: none;
|
|
122
|
-
background: transparent;
|
|
123
|
-
border: none;
|
|
124
|
-
color: var(--ew-on-surface);
|
|
125
|
-
cursor: pointer;
|
|
126
|
-
padding: var(--ew-space-1);
|
|
127
|
-
}
|
|
128
|
-
.ew-header__menu-btn:focus-visible {
|
|
129
|
-
outline: 2px solid var(--ew-primary);
|
|
130
|
-
outline-offset: 2px;
|
|
131
|
-
}
|
|
132
|
-
.ew-header__menu-icon--close { display: none; }
|
|
133
|
-
|
|
134
|
-
/* Nav */
|
|
135
|
-
.ew-header__nav {
|
|
136
|
-
display: flex;
|
|
137
|
-
align-items: center;
|
|
138
|
-
gap: var(--ew-space-5);
|
|
139
|
-
}
|
|
140
|
-
.ew-header__links {
|
|
141
|
-
display: flex;
|
|
142
|
-
list-style: none;
|
|
143
|
-
margin: 0;
|
|
144
|
-
padding: 0;
|
|
145
|
-
gap: var(--ew-space-1);
|
|
146
|
-
}
|
|
147
|
-
.ew-header__link {
|
|
148
|
-
display: block;
|
|
149
|
-
padding: var(--ew-space-2) var(--ew-space-3);
|
|
150
|
-
border-radius: var(--ew-radius-md);
|
|
151
|
-
color: var(--ew-muted);
|
|
152
|
-
font-family: var(--ew-font-sans);
|
|
153
|
-
font-size: var(--ew-text-sm);
|
|
154
|
-
font-weight: 500;
|
|
155
|
-
text-decoration: none;
|
|
156
|
-
}
|
|
157
|
-
.ew-header__link:hover {
|
|
158
|
-
color: var(--ew-on-surface);
|
|
159
|
-
background: var(--ew-surface-muted);
|
|
160
|
-
}
|
|
161
|
-
.ew-header__link--active {
|
|
162
|
-
color: var(--ew-on-surface);
|
|
163
|
-
background: var(--ew-surface-muted);
|
|
164
|
-
}
|
|
165
|
-
.ew-header__actions {
|
|
166
|
-
display: flex;
|
|
167
|
-
align-items: center;
|
|
168
|
-
gap: var(--ew-space-2);
|
|
169
|
-
border-left: 1px solid var(--ew-border);
|
|
170
|
-
padding-left: var(--ew-space-3);
|
|
171
|
-
margin-left: var(--ew-space-1);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/* Mobile: <=768px */
|
|
175
|
-
@media (max-width: 768px) {
|
|
176
|
-
.ew-header__menu-btn {
|
|
177
|
-
display: flex;
|
|
178
|
-
}
|
|
179
|
-
.ew-header__nav {
|
|
180
|
-
display: none;
|
|
181
|
-
position: absolute;
|
|
182
|
-
top: 100%;
|
|
183
|
-
left: 0;
|
|
184
|
-
right: 0;
|
|
185
|
-
flex-direction: column;
|
|
186
|
-
background: var(--ew-surface);
|
|
187
|
-
border-bottom: 1px solid var(--ew-border);
|
|
188
|
-
padding: var(--ew-space-4) var(--ew-space-5);
|
|
189
|
-
gap: var(--ew-space-4);
|
|
190
|
-
}
|
|
191
|
-
.ew-header__nav[data-open] {
|
|
192
|
-
display: flex;
|
|
193
|
-
}
|
|
194
|
-
.ew-header__links {
|
|
195
|
-
flex-direction: column;
|
|
196
|
-
gap: var(--ew-space-1);
|
|
197
|
-
}
|
|
198
|
-
.ew-header__actions {
|
|
199
|
-
border-left: none;
|
|
200
|
-
padding-left: 0;
|
|
201
|
-
margin-left: 0;
|
|
202
|
-
padding-top: var(--ew-space-3);
|
|
203
|
-
border-top: 1px solid var(--ew-border);
|
|
204
|
-
}
|
|
205
|
-
/* Toggle icon swap when open */
|
|
206
|
-
.ew-header__menu-btn[aria-expanded="true"] .ew-header__menu-icon--open { display: none; }
|
|
207
|
-
.ew-header__menu-btn[aria-expanded="true"] .ew-header__menu-icon--close { display: block; }
|
|
208
|
-
}
|
|
209
|
-
</style>
|
|
210
|
-
|
|
211
|
-
<script>
|
|
212
|
-
function initHeader(headerEl: Element) {
|
|
213
|
-
const btn = headerEl.querySelector('.ew-header__menu-btn') as HTMLButtonElement | null;
|
|
214
|
-
const nav = headerEl.querySelector('.ew-header__nav') as HTMLElement | null;
|
|
215
|
-
if (!btn || !nav) return;
|
|
216
|
-
btn.addEventListener('click', () => {
|
|
217
|
-
const isOpen = btn.getAttribute('aria-expanded') === 'true';
|
|
218
|
-
btn.setAttribute('aria-expanded', String(!isOpen));
|
|
219
|
-
isOpen ? nav.removeAttribute('data-open') : nav.setAttribute('data-open', '');
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
document.querySelectorAll('.ew-header').forEach(initHeader);
|
|
223
|
-
</script>
|
|
17
|
+
{Astro.slots.has('actions')
|
|
18
|
+
? <Header {...props}><Fragment slot="actions"><slot name="actions" /></Fragment></Header>
|
|
19
|
+
: <Header {...props} />}
|
|
@@ -1,244 +1,19 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
* Stable by default so builds are reproducible. Override only when rendering
|
|
17
|
-
* more than one of this header variant on a single page.
|
|
18
|
-
*/
|
|
19
|
-
navId?: string;
|
|
20
|
-
/**
|
|
21
|
-
* Locales this site actually serves. When it holds a single entry the
|
|
22
|
-
* language switch is omitted, because on a one-locale site it is a control
|
|
23
|
-
* that navigates to a route the site does not build. Omit the prop to keep
|
|
24
|
-
* the switch rendering unconditionally.
|
|
25
|
-
*/
|
|
26
|
-
locales?: readonly string[];
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const { siteName, navItems, currentLang, pathname, alternateHref, menuLabel = 'Toggle navigation menu', logo, navId = 'ew-header-centered-nav', locales } = Astro.props;
|
|
30
|
-
const showLanguageSwitch = !locales || locales.length > 1;
|
|
31
|
-
const mid = Math.ceil(navItems.length / 2);
|
|
32
|
-
const leftItems = navItems.slice(0, mid);
|
|
33
|
-
const rightItems = navItems.slice(mid);
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Import `@easy-web/core/components/HeaderCentered.astro` instead.
|
|
4
|
+
* Compatibility wrapper: renders the core component with the same props and slots.
|
|
5
|
+
*
|
|
6
|
+
* The `actions` slot is forwarded only when the caller fills it. Astro registers
|
|
7
|
+
* a slot even when its `{cond && <Fragment slot>}` expression is false, which
|
|
8
|
+
* would replace the core fallback (theme toggle and language switch) with nothing.
|
|
9
|
+
*/
|
|
10
|
+
import type { ComponentProps } from 'astro/types';
|
|
11
|
+
import HeaderCentered from '@easy-web/core/components/HeaderCentered.astro';
|
|
12
|
+
|
|
13
|
+
type Props = ComponentProps<typeof HeaderCentered>;
|
|
14
|
+
|
|
15
|
+
const props = Astro.props;
|
|
34
16
|
---
|
|
35
|
-
|
|
36
|
-
<
|
|
37
|
-
<
|
|
38
|
-
<nav id={navId} class="ew-header-centered__nav" aria-label="Main navigation">
|
|
39
|
-
<ul class="ew-header-centered__links ew-header-centered__links--left">
|
|
40
|
-
{leftItems.map((item) => (
|
|
41
|
-
<li>
|
|
42
|
-
<a href={item.href} class:list={['ew-header-centered__link', { 'ew-header-centered__link--active': pathname === item.href }]}>
|
|
43
|
-
{item.label}
|
|
44
|
-
</a>
|
|
45
|
-
</li>
|
|
46
|
-
))}
|
|
47
|
-
</ul>
|
|
48
|
-
|
|
49
|
-
<a href={currentLang === 'de' ? '/' : `/${currentLang}/`} class="ew-header-centered__brand">
|
|
50
|
-
{logo ? <img src={logo} alt={siteName} class="ew-header-centered__logo" /> : siteName}
|
|
51
|
-
</a>
|
|
52
|
-
|
|
53
|
-
<div class="ew-header-centered__right">
|
|
54
|
-
<ul class="ew-header-centered__links ew-header-centered__links--right">
|
|
55
|
-
{rightItems.map((item) => (
|
|
56
|
-
<li>
|
|
57
|
-
<a href={item.href} class:list={['ew-header-centered__link', { 'ew-header-centered__link--active': pathname === item.href }]}>
|
|
58
|
-
{item.label}
|
|
59
|
-
</a>
|
|
60
|
-
</li>
|
|
61
|
-
))}
|
|
62
|
-
</ul>
|
|
63
|
-
<div class="ew-header-centered__actions">
|
|
64
|
-
<slot name="actions">
|
|
65
|
-
<ThemeToggle />
|
|
66
|
-
{showLanguageSwitch && <LanguageSwitch currentLang={currentLang} pathname={pathname} alternateHref={alternateHref} />}
|
|
67
|
-
</slot>
|
|
68
|
-
</div>
|
|
69
|
-
</div>
|
|
70
|
-
</nav>
|
|
71
|
-
|
|
72
|
-
<button
|
|
73
|
-
type="button"
|
|
74
|
-
class="ew-header-centered__menu-btn"
|
|
75
|
-
aria-label={menuLabel}
|
|
76
|
-
aria-expanded="false"
|
|
77
|
-
aria-controls={navId}
|
|
78
|
-
data-testid="mobile-menu-toggle"
|
|
79
|
-
>
|
|
80
|
-
<svg class="ew-header-centered__menu-icon ew-header-centered__menu-icon--open" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true">
|
|
81
|
-
<line x1="3" y1="6" x2="21" y2="6"></line>
|
|
82
|
-
<line x1="3" y1="12" x2="21" y2="12"></line>
|
|
83
|
-
<line x1="3" y1="18" x2="21" y2="18"></line>
|
|
84
|
-
</svg>
|
|
85
|
-
<svg class="ew-header-centered__menu-icon ew-header-centered__menu-icon--close" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true">
|
|
86
|
-
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
87
|
-
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
88
|
-
</svg>
|
|
89
|
-
</button>
|
|
90
|
-
</div>
|
|
91
|
-
</header>
|
|
92
|
-
|
|
93
|
-
<style>
|
|
94
|
-
.ew-header-centered {
|
|
95
|
-
position: sticky;
|
|
96
|
-
top: 0;
|
|
97
|
-
z-index: 100;
|
|
98
|
-
background: var(--ew-surface);
|
|
99
|
-
border-bottom: 1px solid var(--ew-border);
|
|
100
|
-
}
|
|
101
|
-
.ew-header-centered__inner {
|
|
102
|
-
display: flex;
|
|
103
|
-
align-items: center;
|
|
104
|
-
max-width: 72rem;
|
|
105
|
-
margin: 0 auto;
|
|
106
|
-
padding: var(--ew-space-3) var(--ew-space-5);
|
|
107
|
-
position: relative;
|
|
108
|
-
}
|
|
109
|
-
.ew-header-centered__nav {
|
|
110
|
-
display: flex;
|
|
111
|
-
align-items: center;
|
|
112
|
-
justify-content: space-between;
|
|
113
|
-
width: 100%;
|
|
114
|
-
gap: var(--ew-space-3);
|
|
115
|
-
}
|
|
116
|
-
.ew-header-centered__brand {
|
|
117
|
-
font-family: var(--ew-font-sans);
|
|
118
|
-
font-size: var(--ew-text-lg);
|
|
119
|
-
font-weight: 700;
|
|
120
|
-
color: var(--ew-on-surface);
|
|
121
|
-
text-decoration: none;
|
|
122
|
-
letter-spacing: -0.01em;
|
|
123
|
-
white-space: nowrap;
|
|
124
|
-
}
|
|
125
|
-
.ew-header-centered__brand:hover {
|
|
126
|
-
color: var(--ew-primary);
|
|
127
|
-
}
|
|
128
|
-
.ew-header-centered__logo {
|
|
129
|
-
height: 1.5rem;
|
|
130
|
-
width: auto;
|
|
131
|
-
display: block;
|
|
132
|
-
}
|
|
133
|
-
.ew-header-centered__links {
|
|
134
|
-
display: flex;
|
|
135
|
-
list-style: none;
|
|
136
|
-
margin: 0;
|
|
137
|
-
padding: 0;
|
|
138
|
-
gap: var(--ew-space-1);
|
|
139
|
-
}
|
|
140
|
-
.ew-header-centered__link {
|
|
141
|
-
display: block;
|
|
142
|
-
padding: var(--ew-space-2) var(--ew-space-3);
|
|
143
|
-
border-radius: var(--ew-radius-md);
|
|
144
|
-
color: var(--ew-muted);
|
|
145
|
-
font-family: var(--ew-font-sans);
|
|
146
|
-
font-size: var(--ew-text-sm);
|
|
147
|
-
font-weight: 500;
|
|
148
|
-
text-decoration: none;
|
|
149
|
-
}
|
|
150
|
-
.ew-header-centered__link:hover {
|
|
151
|
-
color: var(--ew-on-surface);
|
|
152
|
-
background: var(--ew-surface-muted);
|
|
153
|
-
}
|
|
154
|
-
.ew-header-centered__link--active {
|
|
155
|
-
color: var(--ew-on-surface);
|
|
156
|
-
background: var(--ew-surface-muted);
|
|
157
|
-
}
|
|
158
|
-
.ew-header-centered__right {
|
|
159
|
-
display: flex;
|
|
160
|
-
align-items: center;
|
|
161
|
-
gap: var(--ew-space-3);
|
|
162
|
-
}
|
|
163
|
-
.ew-header-centered__actions {
|
|
164
|
-
display: flex;
|
|
165
|
-
align-items: center;
|
|
166
|
-
gap: var(--ew-space-2);
|
|
167
|
-
border-left: 1px solid var(--ew-border);
|
|
168
|
-
padding-left: var(--ew-space-3);
|
|
169
|
-
margin-left: var(--ew-space-1);
|
|
170
|
-
}
|
|
171
|
-
.ew-header-centered__menu-btn {
|
|
172
|
-
display: none;
|
|
173
|
-
background: transparent;
|
|
174
|
-
border: none;
|
|
175
|
-
color: var(--ew-on-surface);
|
|
176
|
-
cursor: pointer;
|
|
177
|
-
padding: var(--ew-space-1);
|
|
178
|
-
position: absolute;
|
|
179
|
-
right: var(--ew-space-5);
|
|
180
|
-
top: 50%;
|
|
181
|
-
transform: translateY(-50%);
|
|
182
|
-
}
|
|
183
|
-
.ew-header-centered__menu-btn:focus-visible {
|
|
184
|
-
outline: 2px solid var(--ew-primary);
|
|
185
|
-
outline-offset: 2px;
|
|
186
|
-
}
|
|
187
|
-
.ew-header-centered__menu-icon--close { display: none; }
|
|
188
|
-
|
|
189
|
-
@media (max-width: 768px) {
|
|
190
|
-
.ew-header-centered__menu-btn {
|
|
191
|
-
display: flex;
|
|
192
|
-
}
|
|
193
|
-
.ew-header-centered__nav {
|
|
194
|
-
display: none;
|
|
195
|
-
position: absolute;
|
|
196
|
-
top: 100%;
|
|
197
|
-
left: 0;
|
|
198
|
-
right: 0;
|
|
199
|
-
flex-direction: column;
|
|
200
|
-
align-items: flex-start;
|
|
201
|
-
background: var(--ew-surface);
|
|
202
|
-
border-bottom: 1px solid var(--ew-border);
|
|
203
|
-
padding: var(--ew-space-4) var(--ew-space-5);
|
|
204
|
-
gap: var(--ew-space-4);
|
|
205
|
-
}
|
|
206
|
-
.ew-header-centered__nav[data-open] {
|
|
207
|
-
display: flex;
|
|
208
|
-
}
|
|
209
|
-
.ew-header-centered__links {
|
|
210
|
-
flex-direction: column;
|
|
211
|
-
gap: var(--ew-space-1);
|
|
212
|
-
}
|
|
213
|
-
.ew-header-centered__right {
|
|
214
|
-
flex-direction: column;
|
|
215
|
-
align-items: flex-start;
|
|
216
|
-
gap: var(--ew-space-3);
|
|
217
|
-
width: 100%;
|
|
218
|
-
}
|
|
219
|
-
.ew-header-centered__actions {
|
|
220
|
-
border-left: none;
|
|
221
|
-
padding-left: 0;
|
|
222
|
-
margin-left: 0;
|
|
223
|
-
padding-top: var(--ew-space-3);
|
|
224
|
-
border-top: 1px solid var(--ew-border);
|
|
225
|
-
width: 100%;
|
|
226
|
-
}
|
|
227
|
-
.ew-header-centered__menu-btn[aria-expanded="true"] .ew-header-centered__menu-icon--open { display: none; }
|
|
228
|
-
.ew-header-centered__menu-btn[aria-expanded="true"] .ew-header-centered__menu-icon--close { display: block; }
|
|
229
|
-
}
|
|
230
|
-
</style>
|
|
231
|
-
|
|
232
|
-
<script>
|
|
233
|
-
function initHeader(headerEl: Element) {
|
|
234
|
-
const btn = headerEl.querySelector('.ew-header-centered__menu-btn') as HTMLButtonElement | null;
|
|
235
|
-
const nav = headerEl.querySelector('.ew-header-centered__nav') as HTMLElement | null;
|
|
236
|
-
if (!btn || !nav) return;
|
|
237
|
-
btn.addEventListener('click', () => {
|
|
238
|
-
const isOpen = btn.getAttribute('aria-expanded') === 'true';
|
|
239
|
-
btn.setAttribute('aria-expanded', String(!isOpen));
|
|
240
|
-
isOpen ? nav.removeAttribute('data-open') : nav.setAttribute('data-open', '');
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
document.querySelectorAll('.ew-header-centered').forEach(initHeader);
|
|
244
|
-
</script>
|
|
17
|
+
{Astro.slots.has('actions')
|
|
18
|
+
? <HeaderCentered {...props}><Fragment slot="actions"><slot name="actions" /></Fragment></HeaderCentered>
|
|
19
|
+
: <HeaderCentered {...props} />}
|