maverick-wave-astro 1.0.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.
Files changed (94) hide show
  1. package/README.md +83 -0
  2. package/bin/check.mjs +53 -0
  3. package/components/Accordion.astro +47 -0
  4. package/components/Address.astro +36 -0
  5. package/components/Announcement.astro +27 -0
  6. package/components/Avatar.astro +34 -0
  7. package/components/BaseLayout.astro +142 -0
  8. package/components/BlogPost.astro +144 -0
  9. package/components/Breadcrumbs.astro +69 -0
  10. package/components/Calendar.astro +104 -0
  11. package/components/CalendarLegend.astro +34 -0
  12. package/components/ComingSoon.astro +21 -0
  13. package/components/DateStamp.astro +24 -0
  14. package/components/EmptyState.astro +24 -0
  15. package/components/Favicons.astro +42 -0
  16. package/components/Feed.astro +85 -0
  17. package/components/Footer.astro +162 -0
  18. package/components/Gallery.astro +55 -0
  19. package/components/Header.astro +107 -0
  20. package/components/Hero.astro +158 -0
  21. package/components/Icon.astro +27 -0
  22. package/components/IconCard.astro +36 -0
  23. package/components/ImageSlider.astro +64 -0
  24. package/components/ImprintCard.astro +52 -0
  25. package/components/JsonLd.astro +11 -0
  26. package/components/LanguageSwitch.astro +53 -0
  27. package/components/LegalPage.astro +19 -0
  28. package/components/Media.astro +40 -0
  29. package/components/MetaInfo.astro +24 -0
  30. package/components/Modal.astro +47 -0
  31. package/components/Mosaic.astro +38 -0
  32. package/components/NotFound.astro +34 -0
  33. package/components/Offer.astro +79 -0
  34. package/components/OpeningHours.astro +14 -0
  35. package/components/PageHeader.astro +38 -0
  36. package/components/Picture.astro +50 -0
  37. package/components/PortraitGallery.astro +68 -0
  38. package/components/PostalAddress.astro +20 -0
  39. package/components/Price.astro +84 -0
  40. package/components/PrivacyCard.astro +65 -0
  41. package/components/Progress.astro +53 -0
  42. package/components/PromoBar.astro +25 -0
  43. package/components/Schedule.astro +60 -0
  44. package/components/SectionHead.astro +18 -0
  45. package/components/SocialLinks.astro +47 -0
  46. package/components/Stepper.astro +76 -0
  47. package/components/Stories.astro +80 -0
  48. package/components/TabPanel.astro +15 -0
  49. package/components/Table.astro +115 -0
  50. package/components/Tabs.astro +38 -0
  51. package/components/Testimonial.astro +61 -0
  52. package/components/ThemeToggle.astro +30 -0
  53. package/components/Tiles.astro +63 -0
  54. package/components/Timeline.astro +64 -0
  55. package/components/ValueList.astro +42 -0
  56. package/config/eslint.js +58 -0
  57. package/config/prettier.mjs +30 -0
  58. package/dist/config.d.ts +3 -0
  59. package/dist/config.js +6 -0
  60. package/dist/contact.d.ts +2 -0
  61. package/dist/contact.js +8 -0
  62. package/dist/date.d.ts +26 -0
  63. package/dist/date.js +72 -0
  64. package/dist/design.d.ts +166 -0
  65. package/dist/design.js +175 -0
  66. package/dist/icons.d.ts +13 -0
  67. package/dist/icons.js +15 -0
  68. package/dist/image-size.d.ts +10 -0
  69. package/dist/image-size.js +70 -0
  70. package/dist/integration.d.ts +13 -0
  71. package/dist/integration.js +90 -0
  72. package/dist/path.d.ts +1 -0
  73. package/dist/path.js +5 -0
  74. package/dist/schedule.d.ts +30 -0
  75. package/dist/schedule.js +117 -0
  76. package/dist/social.d.ts +35 -0
  77. package/dist/social.js +37 -0
  78. package/dist/structured-data.d.ts +1 -0
  79. package/dist/structured-data.js +2 -0
  80. package/dist/text.d.ts +3 -0
  81. package/dist/text.js +30 -0
  82. package/dist/types.d.ts +35 -0
  83. package/dist/types.js +1 -0
  84. package/dist/uploads.d.ts +7 -0
  85. package/dist/uploads.js +64 -0
  86. package/package.json +75 -0
  87. package/routes/design.css.ts +7 -0
  88. package/routes/theme.js.ts +28 -0
  89. package/routes/virtual.d.ts +6 -0
  90. package/schemas/design.schema.json +214 -0
  91. package/schemas/promo.schema.json +37 -0
  92. package/styles/schedule.css +17 -0
  93. package/styles/table.css +8 -0
  94. package/styles/theme-toggle.css +13 -0
@@ -0,0 +1,80 @@
1
+ ---
2
+ // Stories that stay: a row of circles, each opens its reel full screen on a
3
+ // phone. The stylesheet plays the frames, the script adds tapping, video on
4
+ // its turn and closing at the end.
5
+ import { config } from '../dist/config.js';
6
+ import { publicImage } from '../dist/image-size.js';
7
+ import { withBase } from '../dist/path.js';
8
+
9
+ interface Props {
10
+ stories: readonly {
11
+ // Unique on the page, it connects circle and reel.
12
+ id: string;
13
+ label: string;
14
+ // From public/, the first frame is the cover. A video frame uses src as
15
+ // its poster.
16
+ frames: readonly { src: string; video?: string; alt: string }[];
17
+ }[];
18
+ label: string;
19
+ pauseLabel?: string;
20
+ closeLabel?: string;
21
+ class?: string;
22
+ }
23
+
24
+ const german = config.site.lang.startsWith('de');
25
+
26
+ const {
27
+ stories,
28
+ label,
29
+ pauseLabel = german ? 'Anhalten' : 'Pause',
30
+ closeLabel = german ? 'Schließen' : 'Close',
31
+ class: className,
32
+ } = Astro.props;
33
+ ---
34
+
35
+ <div class:list={['mw-stories', className]} aria-label={label}>
36
+ {
37
+ stories.map(story => (
38
+ <>
39
+ <button type="button" class="mw-story" popovertarget={story.id}>
40
+ <span class="mw-story-cover">
41
+ <img {...publicImage(story.frames[0].src)} alt="" loading="lazy" />
42
+ </span>
43
+ <span class="mw-story-label">{story.label}</span>
44
+ </button>
45
+ <div class="mw-story-reel" id={story.id} popover>
46
+ <div class="mw-story-reel-head">
47
+ <span>{story.label}</span>
48
+ <label class="mw-overlay-btn mw-story-reel-pause">
49
+ <input type="checkbox" aria-label={pauseLabel} />
50
+ </label>
51
+ <button
52
+ type="button"
53
+ class="mw-overlay-btn"
54
+ popovertarget={story.id}
55
+ popovertargetaction="hide"
56
+ aria-label={closeLabel}
57
+ >
58
+ &#120299;
59
+ </button>
60
+ </div>
61
+ {story.frames.map(frame =>
62
+ frame.video ? (
63
+ <video
64
+ src={withBase(frame.video)}
65
+ poster={withBase(frame.src)}
66
+ aria-label={frame.alt}
67
+ autoplay
68
+ muted
69
+ loop
70
+ playsinline
71
+ />
72
+ ) : (
73
+ <img src={withBase(frame.src)} alt={frame.alt} loading="lazy" />
74
+ )
75
+ )}
76
+ </div>
77
+ </>
78
+ ))
79
+ }
80
+ </div>
@@ -0,0 +1,15 @@
1
+ ---
2
+ // One panel inside Tabs. The id is the one of its tab, active belongs on the
3
+ // first panel.
4
+ interface Props {
5
+ id: string;
6
+ active?: boolean;
7
+ class?: string;
8
+ }
9
+
10
+ const { id, active = false, class: className } = Astro.props;
11
+ ---
12
+
13
+ <div class:list={['mw-tabs-panel', active && 'mw-active', className]} id={id}>
14
+ <slot />
15
+ </div>
@@ -0,0 +1,115 @@
1
+ ---
2
+ // A data table that stays readable on a phone. "scroll" keeps the table and
3
+ // lets it scroll sideways inside its frame, "cards" turns every row into a card
4
+ // with the column names as labels below md. With rowHeader the first cell of
5
+ // each row is its header - in the card view the title of the card.
6
+ import '../styles/table.css';
7
+
8
+ type Cell = string | number | { text: string | number; note?: string };
9
+
10
+ interface Props {
11
+ columns: readonly (string | { label: string; numeric?: boolean })[];
12
+ rows: readonly (readonly Cell[])[];
13
+ rowHeader?: boolean;
14
+ mobile?: 'scroll' | 'cards';
15
+ // Names the table for screen readers, the section heading shows it.
16
+ caption?: string;
17
+ subtle?: boolean;
18
+ compact?: boolean;
19
+ // Fades the right edge. Only for a table that really is wider than a phone.
20
+ hint?: boolean;
21
+ class?: string;
22
+ }
23
+
24
+ const {
25
+ columns,
26
+ rows,
27
+ rowHeader = false,
28
+ mobile = 'scroll',
29
+ caption,
30
+ subtle = false,
31
+ compact = false,
32
+ hint = false,
33
+ class: className,
34
+ } = Astro.props;
35
+
36
+ const cards = mobile === 'cards';
37
+ const heads = columns.map(column =>
38
+ typeof column === 'string' ? { label: column, numeric: false } : column
39
+ );
40
+ const cellOf = (cell: Cell) =>
41
+ typeof cell === 'object' ? cell : { text: cell, note: undefined };
42
+ const numeric = (index: number) => heads[index]?.numeric && 'mw-text-currency';
43
+ const Frame = cards ? Fragment : 'div';
44
+ const frame = cards
45
+ ? {}
46
+ : {
47
+ class: ['mw-table-responsive', hint && 'mw-table-responsive-hint']
48
+ .filter(Boolean)
49
+ .join(' '),
50
+ };
51
+ ---
52
+
53
+ <Frame {...frame}>
54
+ <table
55
+ class:list={[
56
+ 'mw-table',
57
+ cards && 'mw-table-cards',
58
+ subtle && 'mw-table-subtle',
59
+ compact && 'mw-table-compact',
60
+ className,
61
+ ]}
62
+ >
63
+ {caption && <caption class="mw-sr-only">{caption}</caption>}
64
+ <thead>
65
+ <tr>
66
+ {
67
+ heads.map((head, index) => (
68
+ <th scope="col" class:list={[numeric(index)]}>
69
+ {head.label}
70
+ </th>
71
+ ))
72
+ }
73
+ </tr>
74
+ </thead>
75
+ <tbody>
76
+ {
77
+ rows.map(row => (
78
+ <tr>
79
+ {row.map((raw, index) => {
80
+ const { text, note } = cellOf(raw);
81
+ return rowHeader && index === 0 ? (
82
+ <th
83
+ scope="row"
84
+ class:list={['mwa-table-row-head', numeric(index)]}
85
+ >
86
+ {text}
87
+ {note && (
88
+ <span class="mw-d-block mw-text-sm mw-text-muted">
89
+ {note}
90
+ </span>
91
+ )}
92
+ </th>
93
+ ) : (
94
+ <td
95
+ class:list={[numeric(index)]}
96
+ data-label={cards ? heads[index]?.label : undefined}
97
+ >
98
+ {/* The card view aligns the value by its wrapper. */}
99
+ <span>
100
+ {text}
101
+ {note && (
102
+ <span class="mw-d-block mw-text-sm mw-text-muted">
103
+ {note}
104
+ </span>
105
+ )}
106
+ </span>
107
+ </td>
108
+ );
109
+ })}
110
+ </tr>
111
+ ))
112
+ }
113
+ </tbody>
114
+ </table>
115
+ </Frame>
@@ -0,0 +1,38 @@
1
+ ---
2
+ // The tab bar, the panels come as TabPanel in the same order. Switching, arrow
3
+ // keys and the ARIA roles come from the MaverickWave script - without it the
4
+ // first panel stays visible. Panels are components and not named slots,
5
+ // because Astro cannot name a slot inside a map.
6
+ interface Props {
7
+ tabs: readonly { id: string; label: string }[];
8
+ variant?: 'line' | 'pills' | 'vertical';
9
+ class?: string;
10
+ }
11
+
12
+ const { tabs, variant = 'line', class: className } = Astro.props;
13
+ ---
14
+
15
+ <div
16
+ class:list={[
17
+ 'mw-tabs',
18
+ variant !== 'line' && `mw-tabs-${variant}`,
19
+ className,
20
+ ]}
21
+ >
22
+ <div class="mw-tabs-nav">
23
+ {
24
+ tabs.map((tab, index) => (
25
+ <button
26
+ type="button"
27
+ class:list={['mw-tabs-nav-item', index === 0 && 'mw-active']}
28
+ data-tab={tab.id}
29
+ >
30
+ {tab.label}
31
+ </button>
32
+ ))
33
+ }
34
+ </div>
35
+ <div class="mw-tabs-content">
36
+ <slot />
37
+ </div>
38
+ </div>
@@ -0,0 +1,61 @@
1
+ ---
2
+ // A quote with its source. featured stands above the grid, the rest go into
3
+ // mw-columns-3. A date ages the quote - only where the voices stay fresh.
4
+ interface Props {
5
+ quote: string;
6
+ name: string;
7
+ detail?: string;
8
+ // YYYY-MM, shown as month and year
9
+ date?: string;
10
+ locale?: string;
11
+ featured?: boolean;
12
+ class?: string;
13
+ }
14
+
15
+ const {
16
+ quote,
17
+ name,
18
+ detail,
19
+ date,
20
+ locale = 'de-DE',
21
+ featured = false,
22
+ class: className,
23
+ } = Astro.props;
24
+
25
+ const [year, month] = (date ?? '').split('-').map(Number);
26
+ const dateText = date
27
+ ? new Date(year, month - 1, 1).toLocaleDateString(locale, {
28
+ month: 'long',
29
+ year: 'numeric',
30
+ })
31
+ : null;
32
+ ---
33
+
34
+ <figure
35
+ class:list={[
36
+ 'mw-testimonial',
37
+ featured && 'mw-testimonial-featured',
38
+ className,
39
+ ]}
40
+ >
41
+ <blockquote>{quote}</blockquote>
42
+ <figcaption class="mw-testimonial-source">
43
+ {name}{
44
+ detail && (
45
+ <>
46
+ {' '}
47
+ <span class="mw-testimonial-detail">&middot; {detail}</span>
48
+ </>
49
+ )
50
+ }{
51
+ dateText && (
52
+ <>
53
+ {' '}
54
+ <time class="mw-testimonial-date" datetime={date}>
55
+ {dateText}
56
+ </time>
57
+ </>
58
+ )
59
+ }
60
+ </figcaption>
61
+ </figure>
@@ -0,0 +1,30 @@
1
+ ---
2
+ import '../styles/theme-toggle.css';
3
+
4
+ import { PACKAGE_ICONS } from '../dist/icons.js';
5
+ import Icon from './Icon.astro';
6
+
7
+ interface Props {
8
+ label: string;
9
+ class?: string;
10
+ }
11
+
12
+ const { label, class: className = 'mw-header-keep mw-ml-5' } = Astro.props;
13
+ ---
14
+
15
+ <button
16
+ type="button"
17
+ class:list={['mw-theme-toggle', className]}
18
+ aria-label={label}
19
+ >
20
+ <span class="mw-theme-toggle-slider">
21
+ <span class="mw-theme-toggle-icon">
22
+ <span class="mwa-theme-moon"
23
+ ><Icon svg={PACKAGE_ICONS.moon} size={13} /></span
24
+ >
25
+ <span class="mwa-theme-sun"
26
+ ><Icon svg={PACKAGE_ICONS.sun} size={13} /></span
27
+ >
28
+ </span>
29
+ </span>
30
+ </button>
@@ -0,0 +1,63 @@
1
+ ---
2
+ // Clickable tiles: optional picture, title, a few lines, a footer line. Three
3
+ // per row by default.
4
+ import { publicImage } from '../dist/image-size.js';
5
+
6
+ interface Props {
7
+ tiles: readonly {
8
+ title: string;
9
+ href: string;
10
+ lines?: readonly string[];
11
+ footer?: string;
12
+ // From public/
13
+ image?: { src: string; alt: string };
14
+ }[];
15
+ columns?: 2 | 3 | 4;
16
+ small?: boolean;
17
+ level?: 'h2' | 'h3' | 'h4';
18
+ class?: string;
19
+ }
20
+
21
+ const {
22
+ tiles,
23
+ columns = 3,
24
+ small = false,
25
+ level = 'h3',
26
+ class: className,
27
+ } = Astro.props;
28
+ const Title = level;
29
+ ---
30
+
31
+ <div
32
+ class:list={[
33
+ 'mw-tiles',
34
+ columns !== 3 && `mw-tiles-${columns}col`,
35
+ className,
36
+ ]}
37
+ >
38
+ {
39
+ tiles.map(tile => (
40
+ <a href={tile.href} class:list={['mw-tile', small && 'mw-tile-sm']}>
41
+ {tile.image && (
42
+ <div class="mw-tile-img">
43
+ <img
44
+ {...publicImage(tile.image.src)}
45
+ alt={tile.image.alt}
46
+ loading="lazy"
47
+ decoding="async"
48
+ />
49
+ </div>
50
+ )}
51
+ <Title class="mw-tile-header">{tile.title}</Title>
52
+ {tile.lines && (
53
+ <div class="mw-tile-body">
54
+ {tile.lines.map(line => (
55
+ <p>{line}</p>
56
+ ))}
57
+ </div>
58
+ )}
59
+ {tile.footer && <div class="mw-tile-footer">{tile.footer}</div>}
60
+ </a>
61
+ ))
62
+ }
63
+ </div>
@@ -0,0 +1,64 @@
1
+ ---
2
+ // A career or a club history. "big" alternates the cards left and right of the
3
+ // line, the period in the middle and milestones below each card. "simple" is a
4
+ // narrow list with the date on the left - sub and events do not show there.
5
+ interface Props {
6
+ steps: readonly {
7
+ date: string;
8
+ sub?: string;
9
+ title: string;
10
+ text?: string;
11
+ events?: readonly { date: string; title: string }[];
12
+ active?: boolean;
13
+ }[];
14
+ variant?: 'big' | 'simple';
15
+ class?: string;
16
+ }
17
+
18
+ const { steps, variant = 'big', class: className } = Astro.props;
19
+ ---
20
+
21
+ {
22
+ variant === 'big' ? (
23
+ <div class:list={['mw-timeline-big', className]}>
24
+ {steps.map(step => (
25
+ <div class:list={['mw-timeline-big-step', step.active && 'mw-active']}>
26
+ <div class="mw-timeline-big-date-container">
27
+ <div class="mw-timeline-big-date-main">{step.date}</div>
28
+ {step.sub && <div class="mw-timeline-big-date-sub">{step.sub}</div>}
29
+ </div>
30
+ <div class="mw-timeline-big-content">
31
+ <article class="mw-card">
32
+ <div class="mw-card-body">
33
+ <h3 class="mw-card-title">{step.title}</h3>
34
+ {step.text && <p class="mw-card-text mw-mb-0">{step.text}</p>}
35
+ </div>
36
+ </article>
37
+ {step.events?.map(event => (
38
+ <div class="mw-timeline-big-event">
39
+ <span class="mw-timeline-big-event-date">{event.date}</span>
40
+ <span class="mw-timeline-big-event-title">{event.title}</span>
41
+ </div>
42
+ ))}
43
+ </div>
44
+ </div>
45
+ ))}
46
+ </div>
47
+ ) : (
48
+ <div class:list={['mw-timeline-simple', className]}>
49
+ {steps.map(step => (
50
+ <div
51
+ class:list={['mw-timeline-simple-step', step.active && 'mw-active']}
52
+ >
53
+ <div class="mw-timeline-simple-date">{step.date}</div>
54
+ <div class="mw-timeline-simple-content">
55
+ <div class="mw-card mw-card-simple">
56
+ <strong>{step.title}</strong>
57
+ {step.text && <p class="mw-card-text">{step.text}</p>}
58
+ </div>
59
+ </div>
60
+ </div>
61
+ ))}
62
+ </div>
63
+ )
64
+ }
@@ -0,0 +1,42 @@
1
+ ---
2
+ // Label on the left, value on the right, a line in between - exactly the row
3
+ // mw-leader-row already is. Several values stack.
4
+ interface Props {
5
+ items: readonly {
6
+ label: string;
7
+ // A small line below the label, e.g. "ab 3 Nächte".
8
+ note?: string;
9
+ value: string | number | readonly (string | number)[];
10
+ }[];
11
+ // Label at the top instead of centred, for values spanning several lines.
12
+ top?: boolean;
13
+ line?: 'dashed' | 'solid';
14
+ class?: string;
15
+ }
16
+
17
+ const { items, top = false, line, class: className } = Astro.props;
18
+ ---
19
+
20
+ <dl class:list={['mw-item-list', className]}>
21
+ {
22
+ items.map(item => (
23
+ <div
24
+ class:list={[
25
+ 'mw-leader-row',
26
+ top && 'mw-leader-row-top',
27
+ line && `mw-leader-row-${line}`,
28
+ ]}
29
+ >
30
+ <dt class="mw-leader-row-label">
31
+ {item.label}
32
+ {item.note && (
33
+ <span class="mw-d-block mw-text-sm mw-text-muted">{item.note}</span>
34
+ )}
35
+ </dt>
36
+ {(Array.isArray(item.value) ? item.value : [item.value]).map(value => (
37
+ <dd class="mw-leader-row-value">{value}</dd>
38
+ ))}
39
+ </div>
40
+ ))
41
+ }
42
+ </dl>
@@ -0,0 +1,58 @@
1
+ import js from '@eslint/js';
2
+ import eslintPluginAstro from 'eslint-plugin-astro';
3
+ import sortPlugin from 'eslint-plugin-simple-import-sort';
4
+ import globals from 'globals';
5
+ import tseslint from 'typescript-eslint';
6
+
7
+ export default [
8
+ js.configs.recommended,
9
+ ...tseslint.configs.recommended,
10
+ ...eslintPluginAstro.configs.recommended,
11
+
12
+ {
13
+ files: ['**/*.{js,ts,mjs,cjs}'],
14
+ plugins: {
15
+ 'simple-import-sort': sortPlugin,
16
+ },
17
+ rules: {
18
+ '@typescript-eslint/no-unused-vars': 'warn',
19
+ 'simple-import-sort/imports': 'error',
20
+ 'simple-import-sort/exports': 'error',
21
+ },
22
+ },
23
+
24
+ {
25
+ files: ['**/*.astro'],
26
+ plugins: {
27
+ 'simple-import-sort': sortPlugin,
28
+ },
29
+ rules: {
30
+ 'astro/no-conflict-set-directives': 'error',
31
+ 'astro/no-unused-define-vars-in-style': 'error',
32
+ 'simple-import-sort/imports': 'error',
33
+ 'simple-import-sort/exports': 'error',
34
+ },
35
+ },
36
+
37
+ {
38
+ files: ['src/**/*.{js,ts}', 'public/**/*.js'],
39
+ languageOptions: {
40
+ globals: globals.browser,
41
+ },
42
+ },
43
+
44
+ {
45
+ files: [
46
+ '*.config.{js,mjs}',
47
+ 'tools/**/*.{js,mjs}',
48
+ 'contentmanager/**/*.mjs',
49
+ ],
50
+ languageOptions: {
51
+ globals: globals.node,
52
+ },
53
+ },
54
+
55
+ {
56
+ ignores: ['dist/', '.astro/', 'node_modules/', 'temp/'],
57
+ },
58
+ ];
@@ -0,0 +1,30 @@
1
+ export default {
2
+ plugins: ['prettier-plugin-astro'],
3
+ overrides: [
4
+ {
5
+ files: '*.astro',
6
+ options: {
7
+ parser: 'astro',
8
+ },
9
+ },
10
+ {
11
+ files: ['*.md', '*.mdx'],
12
+ options: {
13
+ parser: 'markdown',
14
+ printWidth: 80,
15
+ proseWrap: 'always',
16
+ singleQuote: false,
17
+ tabWidth: 2,
18
+ },
19
+ },
20
+ ],
21
+ printWidth: 80,
22
+ tabWidth: 2,
23
+ useTabs: false,
24
+ semi: true,
25
+ singleQuote: true,
26
+ quoteProps: 'as-needed',
27
+ trailingComma: 'es5',
28
+ bracketSpacing: true,
29
+ arrowParens: 'avoid',
30
+ };
@@ -0,0 +1,3 @@
1
+ import config from 'virtual:maverick-wave-astro/config';
2
+ export { config };
3
+ export declare const headerReveals: () => boolean;
package/dist/config.js ADDED
@@ -0,0 +1,6 @@
1
+ // For site components that need to know how the integration set up the
2
+ // site - for instance whether the header slides in.
3
+ import config from 'virtual:maverick-wave-astro/config';
4
+ import { headerReveals as reveals } from "./design.js";
5
+ export { config };
6
+ export const headerReveals = () => reveals(config.design);
@@ -0,0 +1,2 @@
1
+ export declare const mailto: (address: string, subject?: string, body?: string) => string;
2
+ export declare const instagramUrl: (handle: string) => string;
@@ -0,0 +1,8 @@
1
+ export const mailto = (address, subject, body) => {
2
+ const parameters = [
3
+ subject && `subject=${encodeURIComponent(subject)}`,
4
+ body && `body=${encodeURIComponent(body)}`,
5
+ ].filter(Boolean);
6
+ return `mailto:${address}${parameters.length ? `?${parameters.join('&')}` : ''}`;
7
+ };
8
+ export const instagramUrl = (handle) => `https://www.instagram.com/${handle}/`;
package/dist/date.d.ts ADDED
@@ -0,0 +1,26 @@
1
+ export declare const pad2: (value: number) => string;
2
+ export declare const parseIsoDate: (value: string) => Date;
3
+ export declare const isoDate: (date: Date) => string;
4
+ export declare const addDays: (date: Date, days: number) => Date;
5
+ export declare const dateStamp: (date: Date, locale?: string) => {
6
+ weekday: string;
7
+ short: string;
8
+ iso: string;
9
+ };
10
+ export declare const longDate: (date: Date, locale?: string) => string;
11
+ export declare const yearsSince: (date: string, now?: Date) => number;
12
+ export type CalendarDay = {
13
+ iso: string;
14
+ day: number;
15
+ inMonth: boolean;
16
+ weekend: boolean;
17
+ past: boolean;
18
+ today: boolean;
19
+ };
20
+ export type CalendarMonth<T> = {
21
+ year: number;
22
+ month: number;
23
+ days: (CalendarDay & T)[];
24
+ };
25
+ export declare const monthGrid: <T extends object = object>(from: Date, count: number, extra?: (iso: string) => T, now?: Date) => CalendarMonth<T>[];
26
+ export declare const fullDate: (iso: string, locale?: string) => string;