@easy-web/content-blocks 1.3.3 → 1.4.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/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,78 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* @deprecated Import `@easy-web/core/components/Hero.astro` instead.
|
|
4
|
+
* Compatibility wrapper: renders the core component with the same props and slots.
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
subtitle?: string;
|
|
9
|
-
ctaLabel?: string;
|
|
10
|
-
ctaHref?: string;
|
|
11
|
-
variant?: 'centered' | 'left-aligned';
|
|
12
|
-
}
|
|
6
|
+
import type { ComponentProps } from 'astro/types';
|
|
7
|
+
import Hero from '@easy-web/core/components/Hero.astro';
|
|
13
8
|
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
<section class:list={['ew-hero', `ew-hero--${variant}`]}>
|
|
18
|
-
<div class="ew-hero__inner">
|
|
19
|
-
<h1 class="ew-hero__title">{title}</h1>
|
|
20
|
-
{subtitle && <p class="ew-hero__subtitle">{subtitle}</p>}
|
|
21
|
-
{ctaLabel && ctaHref && (
|
|
22
|
-
<a href={ctaHref} class="ew-hero__cta">{ctaLabel}</a>
|
|
23
|
-
)}
|
|
24
|
-
</div>
|
|
25
|
-
</section>
|
|
9
|
+
type Props = ComponentProps<typeof Hero>;
|
|
26
10
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
padding: var(--ew-space-9) var(--ew-space-5);
|
|
31
|
-
}
|
|
32
|
-
.ew-hero__inner {
|
|
33
|
-
max-width: 72rem;
|
|
34
|
-
margin: 0 auto;
|
|
35
|
-
}
|
|
36
|
-
.ew-hero--centered {
|
|
37
|
-
text-align: center;
|
|
38
|
-
}
|
|
39
|
-
.ew-hero--centered .ew-hero__inner {
|
|
40
|
-
display: flex;
|
|
41
|
-
flex-direction: column;
|
|
42
|
-
align-items: center;
|
|
43
|
-
}
|
|
44
|
-
.ew-hero--left-aligned {
|
|
45
|
-
text-align: left;
|
|
46
|
-
}
|
|
47
|
-
.ew-hero__title {
|
|
48
|
-
font-family: var(--ew-font-sans);
|
|
49
|
-
font-size: var(--ew-text-3xl);
|
|
50
|
-
font-weight: 800;
|
|
51
|
-
line-height: var(--ew-leading-tight);
|
|
52
|
-
color: var(--ew-on-surface);
|
|
53
|
-
margin: 0;
|
|
54
|
-
}
|
|
55
|
-
.ew-hero__subtitle {
|
|
56
|
-
font-family: var(--ew-font-sans);
|
|
57
|
-
font-size: var(--ew-text-xl);
|
|
58
|
-
line-height: var(--ew-leading-normal);
|
|
59
|
-
color: var(--ew-muted);
|
|
60
|
-
margin: var(--ew-space-4) 0 0;
|
|
61
|
-
max-width: 40rem;
|
|
62
|
-
}
|
|
63
|
-
.ew-hero__cta {
|
|
64
|
-
display: inline-block;
|
|
65
|
-
margin-top: var(--ew-space-6);
|
|
66
|
-
padding: var(--ew-space-3) var(--ew-space-6);
|
|
67
|
-
background: var(--ew-primary);
|
|
68
|
-
color: var(--ew-on-primary);
|
|
69
|
-
font-family: var(--ew-font-sans);
|
|
70
|
-
font-size: var(--ew-text-base);
|
|
71
|
-
font-weight: 600;
|
|
72
|
-
text-decoration: none;
|
|
73
|
-
border-radius: var(--ew-radius-md);
|
|
74
|
-
}
|
|
75
|
-
.ew-hero__cta:hover {
|
|
76
|
-
opacity: 0.9;
|
|
77
|
-
}
|
|
78
|
-
</style>
|
|
11
|
+
const props = Astro.props;
|
|
12
|
+
---
|
|
13
|
+
<Hero {...props} />
|
|
@@ -1,32 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* @deprecated Import `@easy-web/core/components/LanguageNotice.astro` instead.
|
|
4
|
+
* Compatibility wrapper: renders the core component with the same props and slots.
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
6
|
+
import type { ComponentProps } from 'astro/types';
|
|
7
|
+
import LanguageNotice from '@easy-web/core/components/LanguageNotice.astro';
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
<div class="ew-language-notice">
|
|
14
|
-
<p class="ew-language-notice__text">{message}</p>
|
|
15
|
-
</div>
|
|
9
|
+
type Props = ComponentProps<typeof LanguageNotice>;
|
|
16
10
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
border: 1px solid var(--ew-border);
|
|
21
|
-
border-radius: var(--ew-radius-md);
|
|
22
|
-
padding: var(--ew-space-3) var(--ew-space-4);
|
|
23
|
-
margin: 0 0 var(--ew-space-5);
|
|
24
|
-
}
|
|
25
|
-
.ew-language-notice__text {
|
|
26
|
-
font-family: var(--ew-font-sans);
|
|
27
|
-
font-size: var(--ew-text-sm);
|
|
28
|
-
color: var(--ew-muted);
|
|
29
|
-
margin: 0;
|
|
30
|
-
line-height: var(--ew-leading-normal);
|
|
31
|
-
}
|
|
32
|
-
</style>
|
|
11
|
+
const props = Astro.props;
|
|
12
|
+
---
|
|
13
|
+
<LanguageNotice {...props} />
|
|
@@ -1,71 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* @deprecated Import `@easy-web/core/components/LanguageSwitch.astro` instead.
|
|
4
|
+
* Compatibility wrapper: renders the core component with the same props and slots.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import type { ComponentProps } from 'astro/types';
|
|
7
|
+
import LanguageSwitch from '@easy-web/core/components/LanguageSwitch.astro';
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
/** Current page language, e.g. "de" or "en". */
|
|
10
|
-
currentLang: string;
|
|
11
|
-
/** Current page pathname, e.g. "/" or "/en/about". */
|
|
12
|
-
pathname: string;
|
|
13
|
-
/** The default locale that uses bare paths (no prefix). Defaults to "de". */
|
|
14
|
-
defaultLocale?: string;
|
|
15
|
-
/** Explicit alternate URL for translated slugs (e.g. /en/privacy for /datenschutz). Bypasses automatic derivation. */
|
|
16
|
-
alternateHref?: string;
|
|
17
|
-
/** Accessible label override. */
|
|
18
|
-
ariaLabel?: string;
|
|
19
|
-
}
|
|
9
|
+
type Props = ComponentProps<typeof LanguageSwitch>;
|
|
20
10
|
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
const isDefault = currentLang === defaultLocale;
|
|
24
|
-
const alternateLang = isDefault ? 'en' : defaultLocale;
|
|
25
|
-
const label = alternateLang.toUpperCase();
|
|
26
|
-
|
|
27
|
-
function deriveAlternateHref(): string {
|
|
28
|
-
if (isDefault) {
|
|
29
|
-
return `/en${pathname === '/' ? '/' : pathname}`;
|
|
30
|
-
}
|
|
31
|
-
const stripped = pathname.replace(/^\/en\/?/, '/');
|
|
32
|
-
return stripped || '/';
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Render in the form the site serves, so switching language is a direct hit
|
|
36
|
-
// rather than a redirect. Also normalises any alternateHref a page passes in.
|
|
37
|
-
const resolvedHref = toServedPath(explicitHref ?? deriveAlternateHref(), ambientTrailingSlash());
|
|
38
|
-
const resolvedAriaLabel = ariaLabel ?? `Switch to ${alternateLang}`;
|
|
11
|
+
const props = Astro.props;
|
|
39
12
|
---
|
|
40
|
-
|
|
41
|
-
<a href={resolvedHref} class="ew-lang-switch" aria-label={resolvedAriaLabel} hreflang={alternateLang}>
|
|
42
|
-
{label}
|
|
43
|
-
</a>
|
|
44
|
-
|
|
45
|
-
<style>
|
|
46
|
-
.ew-lang-switch {
|
|
47
|
-
display: inline-flex;
|
|
48
|
-
align-items: center;
|
|
49
|
-
justify-content: center;
|
|
50
|
-
box-sizing: border-box;
|
|
51
|
-
/* Same shared header-control height as ThemeToggle for a consistent utility row. */
|
|
52
|
-
height: 2.25rem;
|
|
53
|
-
min-width: 2.5rem;
|
|
54
|
-
padding: 0 var(--ew-space-2);
|
|
55
|
-
border: 1px solid var(--ew-border);
|
|
56
|
-
border-radius: var(--ew-radius-md);
|
|
57
|
-
color: var(--ew-on-surface);
|
|
58
|
-
font-family: var(--ew-font-sans);
|
|
59
|
-
font-size: var(--ew-text-sm);
|
|
60
|
-
font-weight: 600;
|
|
61
|
-
text-decoration: none;
|
|
62
|
-
letter-spacing: 0.04em;
|
|
63
|
-
}
|
|
64
|
-
.ew-lang-switch:hover {
|
|
65
|
-
background: var(--ew-surface-muted);
|
|
66
|
-
}
|
|
67
|
-
.ew-lang-switch:focus-visible {
|
|
68
|
-
outline: 2px solid var(--ew-primary);
|
|
69
|
-
outline-offset: 2px;
|
|
70
|
-
}
|
|
71
|
-
</style>
|
|
13
|
+
<LanguageSwitch {...props} />
|
|
@@ -1,62 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* @deprecated Import `@easy-web/core/components/LegalLayout.astro` instead.
|
|
4
|
+
* Compatibility wrapper: renders the core component with the same props and slots.
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
lastUpdated?: string;
|
|
9
|
-
}
|
|
6
|
+
import type { ComponentProps } from 'astro/types';
|
|
7
|
+
import LegalLayout from '@easy-web/core/components/LegalLayout.astro';
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
<article class="ew-legal">
|
|
15
|
-
<div class="ew-legal__inner">
|
|
16
|
-
<h1 class="ew-legal__title">{title}</h1>
|
|
17
|
-
{lastUpdated && <p class="ew-legal__updated">{lastUpdated}</p>}
|
|
18
|
-
<div class="ew-legal__content">
|
|
19
|
-
<slot />
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
</article>
|
|
9
|
+
type Props = ComponentProps<typeof LegalLayout>;
|
|
23
10
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
.ew-legal__inner {
|
|
29
|
-
max-width: 45rem;
|
|
30
|
-
margin: 0 auto;
|
|
31
|
-
}
|
|
32
|
-
.ew-legal__title {
|
|
33
|
-
font-family: var(--ew-font-sans);
|
|
34
|
-
font-size: var(--ew-text-3xl);
|
|
35
|
-
font-weight: 700;
|
|
36
|
-
color: var(--ew-on-surface);
|
|
37
|
-
margin: 0 0 var(--ew-space-4);
|
|
38
|
-
line-height: var(--ew-leading-tight);
|
|
39
|
-
}
|
|
40
|
-
.ew-legal__updated {
|
|
41
|
-
font-family: var(--ew-font-sans);
|
|
42
|
-
font-size: var(--ew-text-sm);
|
|
43
|
-
color: var(--ew-muted);
|
|
44
|
-
margin: 0 0 var(--ew-space-6);
|
|
45
|
-
line-height: var(--ew-leading-normal);
|
|
46
|
-
}
|
|
47
|
-
.ew-legal__content {
|
|
48
|
-
font-family: var(--ew-font-sans);
|
|
49
|
-
font-size: var(--ew-text-base);
|
|
50
|
-
color: var(--ew-on-surface);
|
|
51
|
-
line-height: var(--ew-leading-loose);
|
|
52
|
-
}
|
|
53
|
-
/* Slotted markdown carries no scope hash — :global() is required to match it. */
|
|
54
|
-
.ew-legal__content :global(a) {
|
|
55
|
-
color: var(--ew-link, var(--ew-primary));
|
|
56
|
-
text-decoration: underline;
|
|
57
|
-
text-underline-offset: 0.15em;
|
|
58
|
-
}
|
|
59
|
-
.ew-legal__content :global(a:hover) {
|
|
60
|
-
text-decoration-thickness: 2px;
|
|
61
|
-
}
|
|
62
|
-
</style>
|
|
11
|
+
const props = Astro.props;
|
|
12
|
+
---
|
|
13
|
+
<LegalLayout {...props}><slot /></LegalLayout>
|
|
@@ -1,124 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* Slotted body component (no `<html>`/`<head>`/`<body>`): consumers wrap it in
|
|
6
|
-
* their own layout. Public by design (never auth-gated per ADR 0010), so no
|
|
7
|
-
* `client:*` directives, `<script>` tags, or auth imports.
|
|
8
|
-
*
|
|
9
|
-
* `heading` / `message` are CMS overrides; when absent, the inline LABELS
|
|
10
|
-
* dictionary supplies DE/EN fallback copy (`easy-web-i18n` intentionally does
|
|
11
|
-
* not ship a UI-string dictionary — inline LABELS is the source of truth for
|
|
12
|
-
* uncustomised sites).
|
|
3
|
+
* @deprecated Import `@easy-web/core/components/NotFound.astro` instead.
|
|
4
|
+
* Compatibility wrapper: renders the core component with the same props and slots.
|
|
13
5
|
*/
|
|
6
|
+
import type { ComponentProps } from 'astro/types';
|
|
7
|
+
import NotFound from '@easy-web/core/components/NotFound.astro';
|
|
14
8
|
|
|
15
|
-
|
|
16
|
-
/** Current page locale (e.g. `"de"`, `"en"`). */
|
|
17
|
-
currentLang: string;
|
|
18
|
-
/** Site default locale — used for `rootHref` auto-compute and LABELS fallback. */
|
|
19
|
-
defaultLocale: string;
|
|
20
|
-
/** Explicit back-home link. Auto-computed from `currentLang` vs `defaultLocale` when omitted. */
|
|
21
|
-
rootHref?: string;
|
|
22
|
-
/** Alternate locale URL. When present, renders a language switcher link. */
|
|
23
|
-
alternateHref?: string;
|
|
24
|
-
/** CMS override for the `<h1>` heading (falls back to LABELS). */
|
|
25
|
-
heading?: string;
|
|
26
|
-
/** CMS override for the paragraph message (falls back to LABELS). */
|
|
27
|
-
message?: string;
|
|
28
|
-
/** Optional illustration URL. When present, renders `<img>` above the heading. */
|
|
29
|
-
image?: string;
|
|
30
|
-
}
|
|
9
|
+
type Props = ComponentProps<typeof NotFound>;
|
|
31
10
|
|
|
32
|
-
const
|
|
33
|
-
string,
|
|
34
|
-
{ backHome: string; notFoundHeading: string; notFoundMessage: string; switchLanguage: string }
|
|
35
|
-
> = {
|
|
36
|
-
de: {
|
|
37
|
-
backHome: 'Zur Startseite',
|
|
38
|
-
notFoundHeading: 'Seite nicht gefunden',
|
|
39
|
-
notFoundMessage: 'Die aufgerufene Seite existiert nicht.',
|
|
40
|
-
switchLanguage: 'English',
|
|
41
|
-
},
|
|
42
|
-
en: {
|
|
43
|
-
backHome: 'Home',
|
|
44
|
-
notFoundHeading: 'Page not found',
|
|
45
|
-
notFoundMessage: 'The requested page does not exist.',
|
|
46
|
-
switchLanguage: 'Deutsch',
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const { currentLang, defaultLocale, rootHref, alternateHref, heading, message, image } = Astro.props;
|
|
51
|
-
|
|
52
|
-
const t = LABELS[currentLang] ?? LABELS[defaultLocale] ?? LABELS.en;
|
|
53
|
-
const resolvedRootHref = rootHref ?? (currentLang === defaultLocale ? '/' : `/${currentLang}/`);
|
|
54
|
-
const resolvedHeading = heading ?? t.notFoundHeading;
|
|
55
|
-
const resolvedMessage = message ?? t.notFoundMessage;
|
|
11
|
+
const props = Astro.props;
|
|
56
12
|
---
|
|
57
|
-
|
|
58
|
-
<section class="ew-not-found" data-testid="not-found">
|
|
59
|
-
{image ? <img src={image} alt="" class="ew-not-found__image" loading="lazy" /> : null}
|
|
60
|
-
<h1 class="ew-not-found__heading">{resolvedHeading}</h1>
|
|
61
|
-
<p class="ew-not-found__message">{resolvedMessage}</p>
|
|
62
|
-
<p class="ew-not-found__actions">
|
|
63
|
-
<a href={resolvedRootHref} class="ew-not-found__link">{t.backHome}</a>
|
|
64
|
-
</p>
|
|
65
|
-
{alternateHref ? (
|
|
66
|
-
<p class="ew-not-found__alt">
|
|
67
|
-
<a href={alternateHref} class="ew-not-found__alt-link">{t.switchLanguage}</a>
|
|
68
|
-
</p>
|
|
69
|
-
) : null}
|
|
70
|
-
</section>
|
|
71
|
-
|
|
72
|
-
<style>
|
|
73
|
-
.ew-not-found {
|
|
74
|
-
max-width: 40rem;
|
|
75
|
-
margin: var(--ew-space-12) auto;
|
|
76
|
-
padding: 0 var(--ew-space-5);
|
|
77
|
-
text-align: center;
|
|
78
|
-
color: var(--ew-on-surface);
|
|
79
|
-
}
|
|
80
|
-
.ew-not-found__image {
|
|
81
|
-
display: block;
|
|
82
|
-
max-width: 12rem;
|
|
83
|
-
height: auto;
|
|
84
|
-
margin: 0 auto var(--ew-space-5);
|
|
85
|
-
}
|
|
86
|
-
.ew-not-found__heading {
|
|
87
|
-
font-family: var(--ew-font-sans);
|
|
88
|
-
font-size: clamp(1.75rem, 4vw, 2.5rem);
|
|
89
|
-
color: var(--ew-on-surface);
|
|
90
|
-
margin: 0 0 var(--ew-space-3);
|
|
91
|
-
letter-spacing: -0.01em;
|
|
92
|
-
}
|
|
93
|
-
.ew-not-found__message {
|
|
94
|
-
color: var(--ew-on-surface);
|
|
95
|
-
margin: 0 0 var(--ew-space-5);
|
|
96
|
-
}
|
|
97
|
-
.ew-not-found__actions {
|
|
98
|
-
margin: 0 0 var(--ew-space-3);
|
|
99
|
-
}
|
|
100
|
-
.ew-not-found__link {
|
|
101
|
-
display: inline-block;
|
|
102
|
-
padding: var(--ew-space-2) var(--ew-space-5);
|
|
103
|
-
background: var(--ew-primary);
|
|
104
|
-
color: var(--ew-on-primary);
|
|
105
|
-
border-radius: var(--ew-radius-md);
|
|
106
|
-
font-weight: 600;
|
|
107
|
-
text-decoration: none;
|
|
108
|
-
}
|
|
109
|
-
.ew-not-found__link:hover {
|
|
110
|
-
filter: brightness(0.95);
|
|
111
|
-
}
|
|
112
|
-
.ew-not-found__link:focus-visible {
|
|
113
|
-
outline: 2px solid var(--ew-primary);
|
|
114
|
-
outline-offset: 2px;
|
|
115
|
-
}
|
|
116
|
-
.ew-not-found__alt {
|
|
117
|
-
margin: 0;
|
|
118
|
-
}
|
|
119
|
-
.ew-not-found__alt-link {
|
|
120
|
-
color: var(--ew-primary);
|
|
121
|
-
text-decoration: underline;
|
|
122
|
-
font-size: var(--ew-text-sm);
|
|
123
|
-
}
|
|
124
|
-
</style>
|
|
13
|
+
<NotFound {...props} />
|
|
@@ -1,85 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* the
|
|
5
|
-
*
|
|
6
|
-
* Exists because a layout that renders `<Header /> <slot /> <Footer />` produces
|
|
7
|
-
* a document with no `<main>` landmark and no way to bypass the navigation. That
|
|
8
|
-
* fails WCAG 2.1 success criterion 2.4.1 "Bypass Blocks" (Level A), which is
|
|
9
|
-
* satisfied by a skip link, a heading, or a landmark region — and such a layout
|
|
10
|
-
* offers none of the three on any route whose content does not open with a
|
|
11
|
-
* heading. axe-core reports this as `bypass`, and because that rule carries
|
|
12
|
-
* `reviewOnFail`, it surfaces as *incomplete* rather than a violation, so a gate
|
|
13
|
-
* asserting `violations.length === 0` stays green while the failure ships.
|
|
14
|
-
*
|
|
15
|
-
* This component owns the DOM order on purpose: the skip link has to precede the
|
|
16
|
-
* header to be the first focusable element, which a layout cannot arrange if the
|
|
17
|
-
* header is rendered by the caller before the shell.
|
|
18
|
-
*
|
|
19
|
-
* Usage:
|
|
20
|
-
* <PageShell>
|
|
21
|
-
* <Header slot="header" ... />
|
|
22
|
-
* <slot />
|
|
23
|
-
* <Footer slot="footer" ... />
|
|
24
|
-
* </PageShell>
|
|
3
|
+
* @deprecated Import `@easy-web/core/components/PageShell.astro` instead.
|
|
4
|
+
* Compatibility wrapper: renders the core component with the same props and slots.
|
|
25
5
|
*/
|
|
6
|
+
import type { ComponentProps } from 'astro/types';
|
|
7
|
+
import PageShell from '@easy-web/core/components/PageShell.astro';
|
|
26
8
|
|
|
27
|
-
|
|
28
|
-
/** id of the <main> element and the skip link's target. */
|
|
29
|
-
mainId?: string;
|
|
30
|
-
/** Skip-link text. Set this per locale; the default is English. */
|
|
31
|
-
skipLabel?: string;
|
|
32
|
-
/** Extra class(es) for the <main> element. */
|
|
33
|
-
class?: string;
|
|
34
|
-
}
|
|
9
|
+
type Props = ComponentProps<typeof PageShell>;
|
|
35
10
|
|
|
36
|
-
const
|
|
11
|
+
const props = Astro.props;
|
|
37
12
|
---
|
|
38
|
-
|
|
39
|
-
<a class="ew-skip-link" href={`#${mainId}`}>{skipLabel}</a>
|
|
40
|
-
<slot name="header" />
|
|
41
|
-
<!--
|
|
42
|
-
tabindex="-1" makes <main> programmatically focusable so activating the skip
|
|
43
|
-
link moves focus as well as scroll position. Without it, some browsers scroll
|
|
44
|
-
the viewport but leave focus in the nav, so the next Tab returns to the menu —
|
|
45
|
-
the control appears to work while not actually bypassing anything.
|
|
46
|
-
-->
|
|
47
|
-
<main id={mainId} class:list={['ew-main', className]} tabindex="-1">
|
|
48
|
-
<slot />
|
|
49
|
-
</main>
|
|
50
|
-
<slot name="footer" />
|
|
51
|
-
|
|
52
|
-
<style>
|
|
53
|
-
/*
|
|
54
|
-
Off-screen until focused rather than `display: none` — a hidden element is
|
|
55
|
-
removed from the focus order entirely, which would make the skip link
|
|
56
|
-
unreachable by the keyboard users it exists for.
|
|
57
|
-
*/
|
|
58
|
-
.ew-skip-link {
|
|
59
|
-
position: absolute;
|
|
60
|
-
left: -9999px;
|
|
61
|
-
top: 0;
|
|
62
|
-
z-index: 100;
|
|
63
|
-
padding: var(--ew-space-2) var(--ew-space-4);
|
|
64
|
-
background: var(--ew-surface);
|
|
65
|
-
color: var(--ew-on-surface);
|
|
66
|
-
border: 1px solid var(--ew-border);
|
|
67
|
-
border-radius: var(--ew-radius-md);
|
|
68
|
-
font-family: var(--ew-font-sans);
|
|
69
|
-
font-size: var(--ew-text-base);
|
|
70
|
-
font-weight: 600;
|
|
71
|
-
text-decoration: none;
|
|
72
|
-
}
|
|
73
|
-
.ew-skip-link:focus-visible,
|
|
74
|
-
.ew-skip-link:focus {
|
|
75
|
-
left: var(--ew-space-3);
|
|
76
|
-
top: var(--ew-space-3);
|
|
77
|
-
outline: 2px solid var(--ew-primary);
|
|
78
|
-
outline-offset: 2px;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/* The landmark itself is layout-neutral; instances style it via `class`. */
|
|
82
|
-
.ew-main:focus {
|
|
83
|
-
outline: none;
|
|
84
|
-
}
|
|
85
|
-
</style>
|
|
13
|
+
<PageShell {...props}>{Astro.slots.has('header') && <Fragment slot="header"><slot name="header" /></Fragment>}<slot />{Astro.slots.has('footer') && <Fragment slot="footer"><slot name="footer" /></Fragment>}</PageShell>
|
|
@@ -1,156 +1,13 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
</div>
|
|
9
|
-
|
|
10
|
-
<style>
|
|
11
|
-
.ew-prose {
|
|
12
|
-
padding: var(--ew-space-8) var(--ew-space-5);
|
|
13
|
-
}
|
|
14
|
-
.ew-prose__inner {
|
|
15
|
-
font-family: var(--ew-font-sans);
|
|
16
|
-
font-size: var(--ew-text-base);
|
|
17
|
-
line-height: var(--ew-leading-loose);
|
|
18
|
-
color: var(--ew-on-surface);
|
|
19
|
-
max-width: 45rem;
|
|
20
|
-
margin: 0 auto;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.ew-prose__inner :global(h1) {
|
|
24
|
-
font-size: var(--ew-text-3xl);
|
|
25
|
-
font-weight: 700;
|
|
26
|
-
line-height: var(--ew-leading-tight);
|
|
27
|
-
margin: var(--ew-space-7) 0 var(--ew-space-4);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.ew-prose__inner :global(h2) {
|
|
31
|
-
font-size: var(--ew-text-xl);
|
|
32
|
-
font-weight: 700;
|
|
33
|
-
line-height: var(--ew-leading-tight);
|
|
34
|
-
margin: var(--ew-space-7) 0 var(--ew-space-3);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.ew-prose__inner :global(h3) {
|
|
38
|
-
font-size: var(--ew-text-lg);
|
|
39
|
-
font-weight: 600;
|
|
40
|
-
line-height: var(--ew-leading-tight);
|
|
41
|
-
margin: var(--ew-space-6) 0 var(--ew-space-3);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.ew-prose__inner :global(h4),
|
|
45
|
-
.ew-prose__inner :global(h5),
|
|
46
|
-
.ew-prose__inner :global(h6) {
|
|
47
|
-
font-size: var(--ew-text-base);
|
|
48
|
-
font-weight: 600;
|
|
49
|
-
line-height: var(--ew-leading-tight);
|
|
50
|
-
margin: var(--ew-space-5) 0 var(--ew-space-2);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.ew-prose__inner :global(p) {
|
|
54
|
-
margin: 0 0 var(--ew-space-4);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.ew-prose__inner :global(a) {
|
|
58
|
-
color: var(--ew-link, var(--ew-primary));
|
|
59
|
-
text-decoration: underline;
|
|
60
|
-
text-underline-offset: 0.15em;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.ew-prose__inner :global(a:hover) {
|
|
64
|
-
text-decoration-thickness: 2px;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.ew-prose__inner :global(ul),
|
|
68
|
-
.ew-prose__inner :global(ol) {
|
|
69
|
-
margin: 0 0 var(--ew-space-4);
|
|
70
|
-
padding-left: var(--ew-space-5);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.ew-prose__inner :global(li) {
|
|
74
|
-
margin-bottom: var(--ew-space-1);
|
|
75
|
-
}
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Import `@easy-web/core/components/Prose.astro` instead.
|
|
4
|
+
* Compatibility wrapper: renders the core component with the same props and slots.
|
|
5
|
+
*/
|
|
6
|
+
import type { ComponentProps } from 'astro/types';
|
|
7
|
+
import Prose from '@easy-web/core/components/Prose.astro';
|
|
76
8
|
|
|
77
|
-
|
|
78
|
-
.ew-prose__inner :global(li > ol) {
|
|
79
|
-
margin-top: var(--ew-space-1);
|
|
80
|
-
margin-bottom: 0;
|
|
81
|
-
}
|
|
9
|
+
type Props = ComponentProps<typeof Prose>;
|
|
82
10
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
padding: var(--ew-space-2) var(--ew-space-4);
|
|
87
|
-
color: var(--ew-muted);
|
|
88
|
-
font-style: italic;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.ew-prose__inner :global(blockquote p:last-child) {
|
|
92
|
-
margin-bottom: 0;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.ew-prose__inner :global(code) {
|
|
96
|
-
font-family: var(--ew-font-mono);
|
|
97
|
-
font-size: 0.9em;
|
|
98
|
-
background: var(--ew-surface-muted);
|
|
99
|
-
border-radius: var(--ew-radius-sm);
|
|
100
|
-
padding: 0.15em 0.35em;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.ew-prose__inner :global(pre) {
|
|
104
|
-
margin: 0 0 var(--ew-space-4);
|
|
105
|
-
padding: var(--ew-space-4);
|
|
106
|
-
background: var(--ew-surface-muted);
|
|
107
|
-
border-radius: var(--ew-radius-md);
|
|
108
|
-
overflow-x: auto;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.ew-prose__inner :global(pre code) {
|
|
112
|
-
background: none;
|
|
113
|
-
padding: 0;
|
|
114
|
-
border-radius: 0;
|
|
115
|
-
font-size: var(--ew-text-sm);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.ew-prose__inner :global(hr) {
|
|
119
|
-
border: none;
|
|
120
|
-
border-top: 1px solid var(--ew-border);
|
|
121
|
-
margin: var(--ew-space-6) 0;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.ew-prose__inner :global(img) {
|
|
125
|
-
max-width: 100%;
|
|
126
|
-
height: auto;
|
|
127
|
-
border-radius: var(--ew-radius-md);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.ew-prose__inner :global(table) {
|
|
131
|
-
width: 100%;
|
|
132
|
-
border-collapse: collapse;
|
|
133
|
-
margin: 0 0 var(--ew-space-4);
|
|
134
|
-
font-size: var(--ew-text-sm);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.ew-prose__inner :global(th),
|
|
138
|
-
.ew-prose__inner :global(td) {
|
|
139
|
-
border: 1px solid var(--ew-border);
|
|
140
|
-
padding: var(--ew-space-2) var(--ew-space-3);
|
|
141
|
-
text-align: left;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.ew-prose__inner :global(th) {
|
|
145
|
-
font-weight: 600;
|
|
146
|
-
background: var(--ew-surface-muted);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.ew-prose__inner :global(:first-child) {
|
|
150
|
-
margin-top: 0;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.ew-prose__inner :global(:last-child) {
|
|
154
|
-
margin-bottom: 0;
|
|
155
|
-
}
|
|
156
|
-
</style>
|
|
11
|
+
const props = Astro.props;
|
|
12
|
+
---
|
|
13
|
+
<Prose {...props}><slot /></Prose>
|