maverick-wave-astro 1.33.0 → 1.34.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 +5 -4
- package/components/Checklist.astro +152 -0
- package/components/Footer.astro +38 -3
- package/package.json +3 -3
- package/styles/footer-nav.css +68 -0
package/README.md
CHANGED
|
@@ -74,16 +74,17 @@ The toggles come from the MaverickWave script.
|
|
|
74
74
|
|
|
75
75
|
## Components
|
|
76
76
|
|
|
77
|
-
- Frame: `Header`, `Footer` (
|
|
78
|
-
the `FormatwerkeMark` for `credit` and the
|
|
79
|
-
`
|
|
77
|
+
- Frame: `Header`, `Footer` (the site's pages as `navigation`, social links and
|
|
78
|
+
notes above a bar with copyright, the `FormatwerkeMark` for `credit` and the
|
|
79
|
+
legal `links`; `dark`, `compact`), `FormatwerkeMark`, `ThemeToggle`,
|
|
80
|
+
`LanguageSwitch`, `Announcement`, `PromoBar`
|
|
80
81
|
- Sections: `Hero` (`variant` start | fade), `SplitHero` (text beside a photo,
|
|
81
82
|
no parallax), `Parallax` (a picture band between sections), `SectionHead`,
|
|
82
83
|
`IconCard`, `ValueList`, `OpeningHours`, `Address`, `Accordion`, `Calendar`,
|
|
83
84
|
`CalendarLegend`, `EmptyState` (`inline`)
|
|
84
85
|
- Blocks: `Bento` with `BentoItem` (`size` wide | tall | lg | full), `ActionBar`
|
|
85
86
|
(call, route, booking), `Marquee`, `Compare`, `Stat` in a `StatGroup`,
|
|
86
|
-
`Meter`, `ProgressRing`, `Rating`, `Chat`, `Pagination`
|
|
87
|
+
`Meter`, `ProgressRing`, `Rating`, `Chat`, `Pagination`, `Checklist`
|
|
87
88
|
- Options: `Modal` `drawer` (end | start), `Progress` without `value` runs
|
|
88
89
|
indeterminate, `Timeline` `variant="compact"`, `Picture` `shape` (arch |
|
|
89
90
|
signature | leaf), `Table` `hover` and `stickyFirst`
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
---
|
|
2
|
+
// Points to tick off, one group per topic: what a customer prepares, a
|
|
3
|
+
// self-check. With storageKey the ticks survive a reload, in this browser only.
|
|
4
|
+
import { config } from '../dist/config.js';
|
|
5
|
+
|
|
6
|
+
interface Item {
|
|
7
|
+
title: string;
|
|
8
|
+
// Smaller line under the title
|
|
9
|
+
text?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface Props {
|
|
13
|
+
groups: readonly { title?: string; items: readonly Item[] }[];
|
|
14
|
+
// Remembers the ticks in localStorage under this key - the privacy page has
|
|
15
|
+
// to say so. They are stored by position: a reordered list needs a new key.
|
|
16
|
+
storageKey?: string;
|
|
17
|
+
// {done} and {total} are replaced: "{done} von {total} erledigt"
|
|
18
|
+
progress?: string;
|
|
19
|
+
size?: 'compact' | 'large';
|
|
20
|
+
level?: 'h2' | 'h3' | 'h4';
|
|
21
|
+
class?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const german = config.site.lang.startsWith('de');
|
|
25
|
+
|
|
26
|
+
const {
|
|
27
|
+
groups,
|
|
28
|
+
storageKey,
|
|
29
|
+
progress = german ? '{done} von {total} erledigt' : '{done} of {total} done',
|
|
30
|
+
size,
|
|
31
|
+
level = 'h3',
|
|
32
|
+
class: className,
|
|
33
|
+
} = Astro.props;
|
|
34
|
+
|
|
35
|
+
const Title = level;
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
<div
|
|
39
|
+
class:list={['mwa-checklist', className]}
|
|
40
|
+
data-mwa-checklist={storageKey ?? ''}
|
|
41
|
+
>
|
|
42
|
+
<p
|
|
43
|
+
class="mw-text-sm mw-text-muted mw-mb-4"
|
|
44
|
+
aria-live="polite"
|
|
45
|
+
data-mwa-checklist-progress={progress}
|
|
46
|
+
hidden
|
|
47
|
+
>
|
|
48
|
+
</p>
|
|
49
|
+
{
|
|
50
|
+
groups.map((group, g) => (
|
|
51
|
+
<>
|
|
52
|
+
{group.title && (
|
|
53
|
+
<Title class:list={['mw-mb-3', g > 0 && 'mw-mt-6']}>
|
|
54
|
+
{group.title}
|
|
55
|
+
</Title>
|
|
56
|
+
)}
|
|
57
|
+
<ul
|
|
58
|
+
class:list={[
|
|
59
|
+
'mw-item-list-checkbox',
|
|
60
|
+
size && `mw-item-list-checkbox-${size}`,
|
|
61
|
+
]}
|
|
62
|
+
>
|
|
63
|
+
{group.items.map((item, i) => (
|
|
64
|
+
<li>
|
|
65
|
+
<label class="mw-checkbox">
|
|
66
|
+
<input type="checkbox" value={`${g}-${i}`} />
|
|
67
|
+
<span class="mw-checkbox-box" />
|
|
68
|
+
<span class="mw-checkbox-content">
|
|
69
|
+
{item.text ? (
|
|
70
|
+
<>
|
|
71
|
+
<span class="mw-checkbox-header">{item.title}</span>
|
|
72
|
+
<span class="mw-checkbox-label">{item.text}</span>
|
|
73
|
+
</>
|
|
74
|
+
) : (
|
|
75
|
+
<span class="mw-checkbox-label">{item.title}</span>
|
|
76
|
+
)}
|
|
77
|
+
</span>
|
|
78
|
+
</label>
|
|
79
|
+
</li>
|
|
80
|
+
))}
|
|
81
|
+
</ul>
|
|
82
|
+
</>
|
|
83
|
+
))
|
|
84
|
+
}
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<script>
|
|
88
|
+
const read = (key: string): string[] => {
|
|
89
|
+
try {
|
|
90
|
+
const saved: unknown = JSON.parse(localStorage.getItem(key) ?? '[]');
|
|
91
|
+
return Array.isArray(saved) ? saved : [];
|
|
92
|
+
} catch {
|
|
93
|
+
return [];
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const write = (key: string, values: string[]) => {
|
|
98
|
+
try {
|
|
99
|
+
localStorage.setItem(key, JSON.stringify(values));
|
|
100
|
+
} catch {
|
|
101
|
+
// Private mode or blocked storage: the list works, it just forgets.
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
for (const list of document.querySelectorAll<HTMLElement>(
|
|
106
|
+
'[data-mwa-checklist]'
|
|
107
|
+
)) {
|
|
108
|
+
const key = list.dataset.mwaChecklist
|
|
109
|
+
? `mwa-checklist:${list.dataset.mwaChecklist}`
|
|
110
|
+
: undefined;
|
|
111
|
+
const boxes = [
|
|
112
|
+
...list.querySelectorAll<HTMLInputElement>('input[type="checkbox"]'),
|
|
113
|
+
];
|
|
114
|
+
const status = list.querySelector<HTMLElement>(
|
|
115
|
+
'[data-mwa-checklist-progress]'
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
if (key) {
|
|
119
|
+
const saved = read(key);
|
|
120
|
+
for (const box of boxes) {
|
|
121
|
+
box.checked = saved.includes(box.value);
|
|
122
|
+
box.closest('li')?.classList.toggle('mw-selected', box.checked);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const checked = () => boxes.filter(box => box.checked);
|
|
127
|
+
|
|
128
|
+
const show = () => {
|
|
129
|
+
if (!status) return;
|
|
130
|
+
status.textContent = (status.dataset.mwaChecklistProgress ?? '')
|
|
131
|
+
.replace('{done}', String(checked().length))
|
|
132
|
+
.replace('{total}', String(boxes.length));
|
|
133
|
+
status.hidden = false;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const save = () => {
|
|
137
|
+
show();
|
|
138
|
+
if (key) {
|
|
139
|
+
write(
|
|
140
|
+
key,
|
|
141
|
+
checked().map(box => box.value)
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
list.addEventListener('change', save);
|
|
147
|
+
// A tap on the row outside the label sends only this event, and it does
|
|
148
|
+
// not bubble.
|
|
149
|
+
list.addEventListener('checkboxToggle', save, { capture: true });
|
|
150
|
+
show();
|
|
151
|
+
}
|
|
152
|
+
</script>
|
package/components/Footer.astro
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
---
|
|
2
|
-
// Footer of every site: columns, social links, notes and what it is built
|
|
2
|
+
// Footer of every site: page links, columns, social links, notes and what it is built
|
|
3
3
|
// with on top, then the bar with the copyright line on one side and the legal links on the
|
|
4
4
|
// other. Texts come from the site, in its language.
|
|
5
5
|
|
|
6
|
+
import '../styles/footer-nav.css';
|
|
7
|
+
|
|
6
8
|
import { config } from '../dist/config.js';
|
|
7
|
-
import { linkTo, withBase } from '../dist/path.js';
|
|
9
|
+
import { linkTo, withBase, withoutTrailingSlash } from '../dist/path.js';
|
|
8
10
|
import FormatwerkeMark from './FormatwerkeMark.astro';
|
|
9
11
|
import SocialLinks, { type SocialLink } from './SocialLinks.astro';
|
|
10
12
|
|
|
11
13
|
interface Props {
|
|
14
|
+
// The site's own pages - the header mostly jumps to sections of the start page.
|
|
15
|
+
navigation?: readonly { label: string; href: string }[];
|
|
16
|
+
// Visible before the links and the landmark's name, so never "Navigation".
|
|
17
|
+
navLabel?: string;
|
|
12
18
|
// Two to four columns on top: who, where, when. Lines are paragraphs.
|
|
13
19
|
columns?: readonly {
|
|
14
20
|
title: string;
|
|
@@ -52,7 +58,11 @@ interface Props {
|
|
|
52
58
|
class?: string;
|
|
53
59
|
}
|
|
54
60
|
|
|
61
|
+
const german = config.site.lang.startsWith('de');
|
|
62
|
+
|
|
55
63
|
const {
|
|
64
|
+
navigation = [],
|
|
65
|
+
navLabel = german ? 'Seiten' : 'Pages',
|
|
56
66
|
columns = [],
|
|
57
67
|
social = [],
|
|
58
68
|
notes = [],
|
|
@@ -90,7 +100,11 @@ const legalLinks = [
|
|
|
90
100
|
: []),
|
|
91
101
|
...links.map(link => ({ ...link, href: linkTo(link.href) })),
|
|
92
102
|
];
|
|
93
|
-
const
|
|
103
|
+
const here = withoutTrailingSlash(Astro.url.pathname);
|
|
104
|
+
const pages = navigation.map(page => {
|
|
105
|
+
const href = linkTo(page.href);
|
|
106
|
+
return { ...page, href, current: withoutTrailingSlash(href) === here };
|
|
107
|
+
});
|
|
94
108
|
const linksLabel = legal?.title ?? (german ? 'Rechtliches' : 'Legal');
|
|
95
109
|
const Frame = container ? 'div' : Fragment;
|
|
96
110
|
const frame = container
|
|
@@ -110,6 +124,27 @@ const frame = container
|
|
|
110
124
|
{
|
|
111
125
|
!compact && (
|
|
112
126
|
<Fragment>
|
|
127
|
+
{pages.length > 0 && (
|
|
128
|
+
<nav class="mwa-footer-nav" aria-label={navLabel}>
|
|
129
|
+
<span class="mwa-footer-nav-label" aria-hidden="true">
|
|
130
|
+
{navLabel}
|
|
131
|
+
</span>
|
|
132
|
+
<ul class="mwa-footer-nav-list">
|
|
133
|
+
{pages.map(page => (
|
|
134
|
+
<li>
|
|
135
|
+
<a
|
|
136
|
+
class="mwa-footer-nav-link mw-link-arrow"
|
|
137
|
+
href={page.href}
|
|
138
|
+
aria-current={page.current ? 'page' : undefined}
|
|
139
|
+
>
|
|
140
|
+
{page.label}
|
|
141
|
+
</a>
|
|
142
|
+
</li>
|
|
143
|
+
))}
|
|
144
|
+
</ul>
|
|
145
|
+
</nav>
|
|
146
|
+
)}
|
|
147
|
+
|
|
113
148
|
{columns.length > 0 && (
|
|
114
149
|
<div class="mw-footer-top">
|
|
115
150
|
{columns.map(column => (
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "maverick-wave-astro",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.34.0",
|
|
4
4
|
"description": "Shared frame for static Astro homepages built with MaverickWave: layout, SEO, design variants, schedule, building blocks.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"astro": "^7.2.0",
|
|
56
|
-
"maverick-wave": "^6.
|
|
56
|
+
"maverick-wave": "^6.21.0",
|
|
57
57
|
"vite": "^8.0.0"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"eslint-plugin-astro": "^1.5.0",
|
|
70
70
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
71
71
|
"globals": "^16.5.0",
|
|
72
|
-
"maverick-wave": "^6.
|
|
72
|
+
"maverick-wave": "^6.21.0",
|
|
73
73
|
"playwright-core": "^1.64.0",
|
|
74
74
|
"prettier": "^3.6.2",
|
|
75
75
|
"prettier-plugin-astro": "^0.14.1",
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/* Left aligned like the bar, its rule repeating the one above the bar. */
|
|
2
|
+
.mwa-footer-nav {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-wrap: wrap;
|
|
5
|
+
align-items: center;
|
|
6
|
+
gap: var(--mw-space-1, 0.2rem) var(--mw-space-9, 2.5rem);
|
|
7
|
+
margin-bottom: var(--mw-space-7, 1.75rem);
|
|
8
|
+
padding-bottom: var(--mw-space-6, 1.35rem);
|
|
9
|
+
border-bottom: 1px solid var(--mw-border-accent);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.mwa-footer-nav-label {
|
|
13
|
+
color: var(--mw-text-muted-color);
|
|
14
|
+
font-size: 0.75rem;
|
|
15
|
+
letter-spacing: 0.14em;
|
|
16
|
+
text-transform: uppercase;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.mwa-footer-nav-list {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-wrap: wrap;
|
|
22
|
+
gap: 0 var(--mw-space-8, 2rem);
|
|
23
|
+
margin: 0;
|
|
24
|
+
padding: 0;
|
|
25
|
+
list-style: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.mwa-footer-nav-link {
|
|
29
|
+
display: inline-block;
|
|
30
|
+
align-content: center;
|
|
31
|
+
/* The framework's touch floor skips links inside a list item. */
|
|
32
|
+
min-height: 2.625rem;
|
|
33
|
+
color: var(--mw-text-muted-color);
|
|
34
|
+
text-decoration: underline 1px transparent;
|
|
35
|
+
text-underline-offset: 0.35em;
|
|
36
|
+
transition:
|
|
37
|
+
color var(--mw-duration-fast) var(--mw-ease-out),
|
|
38
|
+
text-decoration-color var(--mw-duration-fast) var(--mw-ease-out);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.mwa-footer-nav-link:hover {
|
|
42
|
+
color: var(--mw-text-color);
|
|
43
|
+
text-decoration-color: currentColor;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* The page you are on needs no way there. */
|
|
47
|
+
.mwa-footer-nav-link[aria-current='page'] {
|
|
48
|
+
color: var(--mw-text-color);
|
|
49
|
+
font-weight: 600;
|
|
50
|
+
text-decoration: none;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.mwa-footer-nav-link[aria-current='page']::after {
|
|
54
|
+
display: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@media (width < 576px) {
|
|
58
|
+
.mwa-footer-nav {
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
align-items: flex-start;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.mwa-footer-nav-list {
|
|
64
|
+
display: grid;
|
|
65
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
66
|
+
column-gap: var(--mw-space-6, 1.35rem);
|
|
67
|
+
}
|
|
68
|
+
}
|