@acms-subir/core 0.3.3-next.20260929113209 → 0.3.3
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 +69 -0
- package/cli/common.mjs +2 -2
- package/cli/legacy.mjs +1 -1
- package/cli/main.mjs +82 -8
- package/cli/mobile-doctor.mjs +430 -0
- package/cli/mobile.mjs +315 -0
- package/cli/native-sections.mjs +168 -0
- package/cli/sections.mjs +186 -0
- package/cli/themes.mjs +52 -8
- package/docs/mobile.md +527 -0
- package/docs/sections.md +203 -0
- package/docs/theme-authoring.md +1 -1
- package/integration.mjs +55 -1
- package/mobile-template/client/AGENTS.md +97 -0
- package/mobile-template/client/README.md +65 -0
- package/mobile-template/client/app/_layout.tsx +56 -0
- package/mobile-template/client/app/index.tsx +21 -0
- package/mobile-template/client/app.json +21 -0
- package/mobile-template/client/components/LanguageSwitch.tsx +31 -0
- package/mobile-template/client/eas.json +21 -0
- package/mobile-template/client/env.example +3 -0
- package/mobile-template/client/gitignore +42 -0
- package/mobile-template/client/package.json +38 -0
- package/mobile-template/client/sections/index.ts +11 -0
- package/mobile-template/client/tsconfig.json +7 -0
- package/mobile-template/editor/AGENTS.md +66 -0
- package/mobile-template/editor/README.md +73 -0
- package/mobile-template/editor/app/_layout.tsx +76 -0
- package/mobile-template/editor/app/auth.tsx +13 -0
- package/mobile-template/editor/app/index.tsx +55 -0
- package/mobile-template/editor/app.json +21 -0
- package/mobile-template/editor/components/Screen.tsx +51 -0
- package/mobile-template/editor/components/SignIn.tsx +36 -0
- package/mobile-template/editor/components/TextTabs.tsx +27 -0
- package/mobile-template/editor/eas.json +21 -0
- package/mobile-template/editor/env.example +5 -0
- package/mobile-template/editor/gitignore +42 -0
- package/mobile-template/editor/lib/appearance.tsx +12 -0
- package/mobile-template/editor/lib/config.ts +17 -0
- package/mobile-template/editor/lib/format.ts +24 -0
- package/mobile-template/editor/lib/tools.ts +16 -0
- package/mobile-template/editor/package.json +40 -0
- package/mobile-template/editor/tools/README.md +2 -0
- package/mobile-template/editor/tsconfig.json +7 -0
- package/mobile-template/recipes/booking/files/app/book/[resource].tsx +57 -0
- package/mobile-template/recipes/booking/files/app/book/details.tsx +105 -0
- package/mobile-template/recipes/booking/files/app/book/index.tsx +38 -0
- package/mobile-template/recipes/booking/recipe.json +17 -0
- package/mobile-template/recipes/editor-bookings/files/app/bookings/index.tsx +113 -0
- package/mobile-template/recipes/editor-bookings/files/tools/bookings.ts +1 -0
- package/mobile-template/recipes/editor-bookings/recipe.json +8 -0
- package/mobile-template/recipes/editor-content/files/app/content/[kind]/[id].tsx +13 -0
- package/mobile-template/recipes/editor-content/files/app/content/index.tsx +76 -0
- package/mobile-template/recipes/editor-content/files/components/DocumentDetail.tsx +55 -0
- package/mobile-template/recipes/editor-content/files/tools/content.ts +1 -0
- package/mobile-template/recipes/editor-content/recipe.json +8 -0
- package/mobile-template/recipes/editor-media/files/app/media/index.tsx +73 -0
- package/mobile-template/recipes/editor-media/files/tools/media.ts +1 -0
- package/mobile-template/recipes/editor-media/recipe.json +8 -0
- package/mobile-template/recipes/editor-sections/files/app/sections/[pageId]/[sectionId].tsx +12 -0
- package/mobile-template/recipes/editor-sections/files/app/sections/index.tsx +48 -0
- package/mobile-template/recipes/editor-sections/files/components/SectionEditorPane.tsx +77 -0
- package/mobile-template/recipes/editor-sections/files/tools/sections.ts +1 -0
- package/mobile-template/recipes/editor-sections/recipe.json +8 -0
- package/mobile-template/recipes/editor-translations/files/app/translations/index.tsx +63 -0
- package/mobile-template/recipes/editor-translations/files/app/translations/review.tsx +14 -0
- package/mobile-template/recipes/editor-translations/files/components/ReviewPane.tsx +72 -0
- package/mobile-template/recipes/editor-translations/files/tools/translations.ts +1 -0
- package/mobile-template/recipes/editor-translations/recipe.json +8 -0
- package/mobile-template/recipes/editor-writer/files/app/write/[kind]/[id].tsx +132 -0
- package/mobile-template/recipes/editor-writer/files/app/write/new.tsx +61 -0
- package/mobile-template/recipes/editor-writer/files/tools/writer.ts +1 -0
- package/mobile-template/recipes/editor-writer/recipe.json +8 -0
- package/mobile-template/recipes/events/files/app/events/[slug].tsx +41 -0
- package/mobile-template/recipes/events/files/app/events/index.tsx +50 -0
- package/mobile-template/recipes/events/files/lib/addToCalendar.ts +27 -0
- package/mobile-template/recipes/events/recipe.json +15 -0
- package/mobile-template/recipes/news/files/app/news/[slug].tsx +25 -0
- package/mobile-template/recipes/news/files/app/news/index.tsx +50 -0
- package/mobile-template/recipes/news/recipe.json +13 -0
- package/mobile-template/recipes/push/files/app/notifications.tsx +64 -0
- package/mobile-template/recipes/push/files/components/PushSetup.tsx +15 -0
- package/mobile-template/recipes/push/files/lib/push.ts +15 -0
- package/mobile-template/recipes/push/recipe.json +20 -0
- package/package.json +4 -2
- package/section-library/README.md +16 -0
- package/section-library/contact/Contact.astro +49 -0
- package/section-library/contact/section.json +106 -0
- package/section-library/cta-band/CtaBand.astro +28 -0
- package/section-library/cta-band/section.json +51 -0
- package/section-library/feature-grid/FeatureGrid.astro +54 -0
- package/section-library/feature-grid/section.json +107 -0
- package/section-library/gallery/Gallery.astro +29 -0
- package/section-library/gallery/section.json +51 -0
- package/section-library/hero-banner/HeroBanner.astro +42 -0
- package/section-library/hero-banner/section.json +81 -0
- package/section-library/latest-posts/LatestPosts.astro +22 -0
- package/section-library/latest-posts/section.json +37 -0
- package/section-library/pricing/Pricing.astro +40 -0
- package/section-library/pricing/section.json +117 -0
- package/section-library/questions/Questions.astro +38 -0
- package/section-library/questions/section.json +69 -0
- package/section-library/service-times/ServiceTimes.astro +42 -0
- package/section-library/service-times/section.json +127 -0
- package/section-library/team/Team.astro +45 -0
- package/section-library/team/section.json +88 -0
- package/section-library/upcoming-events/UpcomingEvents.astro +54 -0
- package/section-library/upcoming-events/section.json +51 -0
- package/src/actions/index.ts +19 -171
- package/src/components/AiSettings.tsx +45 -5
- package/src/components/DesignManager.tsx +112 -16
- package/src/components/MobileApp.tsx +392 -0
- package/src/components/ThemeSections.astro +40 -21
- package/src/components/ThemeSectionsEditor.tsx +757 -229
- package/src/components/editor/PostEditor.tsx +174 -10
- package/src/components/import/ImportExport.tsx +4 -1
- package/src/components/import/runner.ts +1 -0
- package/src/components/sections/SectionFields.tsx +560 -0
- package/src/components/sections/SectionPicker.tsx +120 -0
- package/src/components/sections/TranslationPanel.tsx +143 -0
- package/src/components/sections/checks.ts +64 -0
- package/src/layouts/Admin.astro +6 -1
- package/src/layouts/Site.astro +107 -19
- package/src/lib/agent-discovery.ts +11 -7
- package/src/lib/agent.ts +35 -2
- package/src/lib/ai-schema.ts +5 -0
- package/src/lib/ai.ts +5 -0
- package/src/lib/api.ts +12 -0
- package/src/lib/content-service.ts +198 -0
- package/src/lib/design-service.ts +153 -5
- package/src/lib/drafts.ts +3 -3
- package/src/lib/editor/auth.ts +264 -0
- package/src/lib/editor/bookings.ts +60 -0
- package/src/lib/editor/config.ts +25 -0
- package/src/lib/editor/documents.ts +227 -0
- package/src/lib/editor/http.ts +48 -0
- package/src/lib/editor/me.ts +30 -0
- package/src/lib/editor/migration.ts +57 -0
- package/src/lib/editor/next.ts +11 -0
- package/src/lib/editor/openapi.ts +124 -0
- package/src/lib/editor/schemas.ts +91 -0
- package/src/lib/editor/sections.ts +96 -0
- package/src/lib/editor/store.ts +184 -0
- package/src/lib/editor/token-route.ts +74 -0
- package/src/lib/editor/translations.ts +163 -0
- package/src/lib/email/accounts.ts +2 -1
- package/src/lib/email/types.ts +2 -1
- package/src/lib/home-source.ts +34 -0
- package/src/lib/i18n.ts +34 -0
- package/src/lib/import/apply.ts +31 -2
- package/src/lib/import/bundle.ts +4 -0
- package/src/lib/import/export.ts +1 -0
- package/src/lib/import/ghost.ts +1 -0
- package/src/lib/media/upload.ts +83 -0
- package/src/lib/mobile/associations.ts +25 -0
- package/src/lib/mobile/calendar.ts +19 -11
- package/src/lib/mobile/config.mjs +59 -0
- package/src/lib/mobile/content.ts +18 -13
- package/src/lib/mobile/embed.ts +83 -0
- package/src/lib/mobile/http.ts +8 -6
- package/src/lib/mobile/locale.ts +18 -0
- package/src/lib/mobile/openapi.ts +111 -0
- package/src/lib/mobile/pages.ts +71 -0
- package/src/lib/mobile/route.ts +3 -3
- package/src/lib/mobile/schemas.ts +60 -0
- package/src/lib/mobile/site.ts +41 -0
- package/src/lib/push/api.ts +158 -0
- package/src/lib/push/config.ts +20 -0
- package/src/lib/push/expo.ts +76 -0
- package/src/lib/push/migration.ts +60 -0
- package/src/lib/push/service.ts +302 -0
- package/src/lib/push/store.ts +144 -0
- package/src/lib/push/types.ts +43 -0
- package/src/lib/repo/migrations.ts +11 -0
- package/src/lib/repo/sql.ts +40 -7
- package/src/lib/repo/types.ts +9 -3
- package/src/lib/roles.ts +5 -0
- package/src/lib/scheduler.ts +3 -0
- package/src/lib/schema.ts +27 -1
- package/src/lib/section-ai.ts +55 -0
- package/src/lib/section-targets.ts +62 -0
- package/src/lib/sections-agent.ts +146 -0
- package/src/lib/sections.ts +217 -0
- package/src/lib/theme.ts +16 -1
- package/src/lib/translate.ts +97 -0
- package/src/lib/translations.ts +39 -0
- package/src/middleware.ts +32 -0
- package/src/pages/.well-known/apple-app-site-association.ts +6 -0
- package/src/pages/.well-known/assetlinks.json.ts +6 -0
- package/src/pages/[...slug].astro +8 -3
- package/src/pages/admin/app-auth.astro +159 -0
- package/src/pages/admin/c/[collection]/[id].astro +9 -0
- package/src/pages/admin/calendar/events/[id].astro +9 -0
- package/src/pages/admin/login.astro +6 -2
- package/src/pages/admin/logout.ts +5 -2
- package/src/pages/admin/mobile.astro +18 -0
- package/src/pages/admin/pages/[id].astro +62 -0
- package/src/pages/admin/section-preview.astro +61 -0
- package/src/pages/admin/users.astro +107 -11
- package/src/pages/api/agent/docs.ts +6 -2
- package/src/pages/api/agent/index.ts +1 -1
- package/src/pages/api/ai/settings.ts +7 -4
- package/src/pages/api/design/ai.ts +15 -0
- package/src/pages/api/design/index.ts +12 -42
- package/src/pages/api/design/translate.ts +15 -0
- package/src/pages/api/live/thumb.ts +1 -1
- package/src/pages/api/mcp.ts +2 -2
- package/src/pages/api/media/upload.ts +10 -78
- package/src/pages/api/push/admin.ts +27 -0
- package/src/pages/api/v1/admin/bookings/[id]/[action].ts +14 -0
- package/src/pages/api/v1/admin/bookings/index.ts +6 -0
- package/src/pages/api/v1/admin/documents/[kind]/[id]/[action].ts +17 -0
- package/src/pages/api/v1/admin/documents/[kind]/[id]/index.ts +20 -0
- package/src/pages/api/v1/admin/documents/[kind]/[id]/translations/[locale]/[action].ts +26 -0
- package/src/pages/api/v1/admin/documents/[kind]/[id]/translations/[locale]/index.ts +18 -0
- package/src/pages/api/v1/admin/documents/index.ts +13 -0
- package/src/pages/api/v1/admin/me.ts +6 -0
- package/src/pages/api/v1/admin/media/index.ts +32 -0
- package/src/pages/api/v1/admin/sections/[pageId]/[sectionId]/index.ts +14 -0
- package/src/pages/api/v1/admin/sections/[pageId]/[sectionId]/publish.ts +14 -0
- package/src/pages/api/v1/admin/sections/[pageId]/[sectionId]/translations/[locale]/[action].ts +22 -0
- package/src/pages/api/v1/admin/sections/[pageId]/[sectionId]/translations/[locale]/index.ts +14 -0
- package/src/pages/api/v1/admin/sections/index.ts +6 -0
- package/src/pages/api/v1/auth/revoke.ts +5 -0
- package/src/pages/api/v1/auth/token.ts +5 -0
- package/src/pages/api/v1/devices/[token].ts +20 -0
- package/src/pages/api/v1/devices/index.ts +17 -0
- package/src/pages/api/v1/openapi.json.ts +7 -0
- package/src/pages/api/v1/pages/[...slug].ts +7 -0
- package/src/pages/api/v1/pages/home.ts +7 -0
- package/src/pages/api/v1/push/topics.ts +7 -0
- package/src/pages/api/v1/site.ts +7 -0
- package/src/pages/api/v1/theme.ts +7 -0
- package/src/pages/blog/[slug].astro +8 -2
- package/src/pages/blog/index.astro +11 -4
- package/src/pages/embed/section/[...path].astro +42 -0
- package/src/pages/events/[slug].astro +7 -2
- package/src/pages/index.astro +11 -5
- package/src/pages/sitemap.xml.ts +8 -0
- package/src/styles/admin.css +69 -0
- package/src/styles/editor.css +21 -0
- package/src/styles/mobile-app.css +151 -0
- package/src/styles/sections.css +7 -1
- package/src/styles/theme-editor.css +255 -0
- package/src/theme-sdk/contract.d.mts +2193 -89
- package/src/theme-sdk/contract.mjs +77 -20
- package/src/theme-sdk/fields.d.mts +88 -0
- package/src/theme-sdk/fields.mjs +326 -0
- package/src/theme-sdk/index.ts +10 -2
- package/src/theme-sdk/tokens.d.mts +11 -0
- package/src/virtual.d.ts +1 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { SectionProps, LinkValue } from '@acms-subir/core/theme';
|
|
3
|
+
interface Item { icon: string; title: string; text: string; link: LinkValue }
|
|
4
|
+
interface Data { heading: string; intro: string; items: Item[] }
|
|
5
|
+
const { data, variant } = Astro.props as SectionProps<Data>;
|
|
6
|
+
// 24px stroked paths; add your own here
|
|
7
|
+
const ICONS: Record<string, string> = {
|
|
8
|
+
heart: 'M12 20s-7-4.4-7-10a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.6-7 10-7 10z',
|
|
9
|
+
users: 'M16 20v-1.5a3.5 3.5 0 0 0-3.5-3.5h-5A3.5 3.5 0 0 0 4 18.5V20M10 11a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7zM20 20v-1.5a3.5 3.5 0 0 0-2.5-3.35M15.5 4.15a3.5 3.5 0 0 1 0 6.7',
|
|
10
|
+
calendar: 'M4 6h16v14H4zM4 10h16M8 3v4M16 3v4',
|
|
11
|
+
'map-pin': 'M12 21s-6-5.4-6-11a6 6 0 0 1 12 0c0 5.6-6 11-6 11zM12 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z',
|
|
12
|
+
clock: 'M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 7v5l3 2',
|
|
13
|
+
book: 'M5 4h9a4 4 0 0 1 4 4v12H9a4 4 0 0 1-4-4zM5 16a4 4 0 0 1 4-4h9',
|
|
14
|
+
music: 'M9 18V6l11-2v12M9 18a3 3 0 1 1-6 0 3 3 0 0 1 6 0zM20 16a3 3 0 1 1-6 0 3 3 0 0 1 6 0z',
|
|
15
|
+
coffee: 'M4 9h13v5a6 6 0 0 1-6 6h-1a6 6 0 0 1-6-6zM17 11h1.5a2.5 2.5 0 0 1 0 5H17M8 3v3M12 3v3',
|
|
16
|
+
star: 'M12 3.5l2.6 5.3 5.9.9-4.3 4.1 1 5.8-5.2-2.7-5.2 2.7 1-5.8L3.5 9.7l5.9-.9z',
|
|
17
|
+
check: 'M4 12.5l5 5L20 6.5',
|
|
18
|
+
};
|
|
19
|
+
const items = data.items.filter((i) => i.title || i.text);
|
|
20
|
+
---
|
|
21
|
+
<div class:list={['feat', `is-${variant}`]}>
|
|
22
|
+
{(data.heading || data.intro) && (
|
|
23
|
+
<header class="feat-head">
|
|
24
|
+
{data.heading && <h2>{data.heading}</h2>}
|
|
25
|
+
{data.intro && <p>{data.intro}</p>}
|
|
26
|
+
</header>
|
|
27
|
+
)}
|
|
28
|
+
<ul class="feat-list">
|
|
29
|
+
{items.map((item) => (
|
|
30
|
+
<li class="feat-item">
|
|
31
|
+
{ICONS[item.icon] && <svg class="feat-icon" viewBox="0 0 24 24" aria-hidden="true"><path d={ICONS[item.icon]} /></svg>}
|
|
32
|
+
<h3>{item.link?.href ? <a href={item.link.href}>{item.title}</a> : item.title}</h3>
|
|
33
|
+
{item.text && <p>{item.text}</p>}
|
|
34
|
+
{item.link?.href && item.link.label && <a class="feat-link" href={item.link.href}>{item.link.label} →</a>}
|
|
35
|
+
</li>
|
|
36
|
+
))}
|
|
37
|
+
</ul>
|
|
38
|
+
</div>
|
|
39
|
+
<style>
|
|
40
|
+
.feat-head { margin-bottom: 1.75rem; }
|
|
41
|
+
.feat-head h2 { margin: 0; }
|
|
42
|
+
.feat-head p { margin: 0.5rem 0 0; color: var(--muted); max-width: 60ch; }
|
|
43
|
+
.feat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(1rem, 3vw, 2rem); grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
44
|
+
.is-two-up .feat-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
45
|
+
.feat-item { display: flex; flex-direction: column; gap: 0.4rem; }
|
|
46
|
+
.feat-icon { width: 2.5rem; height: 2.5rem; padding: 0.55rem; margin-bottom: 0.35rem; border-radius: var(--r-sm); background: var(--soft); color: var(--accent-text, var(--accent)); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
|
|
47
|
+
.feat-item h3 { margin: 0; font-size: 1.15rem; }
|
|
48
|
+
.feat-item h3 a { color: inherit; text-decoration: none; }
|
|
49
|
+
.feat-item h3 a:hover { text-decoration: underline; }
|
|
50
|
+
.feat-item p { margin: 0; color: var(--muted); }
|
|
51
|
+
.feat-link { margin-top: 0.25rem; font-weight: 600; font-size: 0.95rem; color: var(--accent-text, var(--accent)); text-decoration: none; }
|
|
52
|
+
@media (max-width: 860px) { .feat-list, .is-two-up .feat-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|
|
53
|
+
@media (max-width: 560px) { .feat-list, .is-two-up .feat-list { grid-template-columns: 1fr; } }
|
|
54
|
+
</style>
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "feature-grid",
|
|
3
|
+
"definition": {
|
|
4
|
+
"name": "Feature grid",
|
|
5
|
+
"version": 1,
|
|
6
|
+
"component": "sections/FeatureGrid.astro",
|
|
7
|
+
"description": "Short points with an icon: ministries, services, reasons to visit.",
|
|
8
|
+
"variants": [
|
|
9
|
+
"three-up",
|
|
10
|
+
"two-up"
|
|
11
|
+
],
|
|
12
|
+
"fields": {
|
|
13
|
+
"heading": {
|
|
14
|
+
"label": "Heading",
|
|
15
|
+
"type": "text",
|
|
16
|
+
"default": ""
|
|
17
|
+
},
|
|
18
|
+
"intro": {
|
|
19
|
+
"label": "Intro",
|
|
20
|
+
"type": "textarea",
|
|
21
|
+
"default": ""
|
|
22
|
+
},
|
|
23
|
+
"items": {
|
|
24
|
+
"label": "Items",
|
|
25
|
+
"type": "list",
|
|
26
|
+
"itemLabel": "title",
|
|
27
|
+
"max": 12,
|
|
28
|
+
"fields": {
|
|
29
|
+
"icon": {
|
|
30
|
+
"label": "Icon",
|
|
31
|
+
"type": "select",
|
|
32
|
+
"options": [
|
|
33
|
+
"none",
|
|
34
|
+
"heart",
|
|
35
|
+
"users",
|
|
36
|
+
"calendar",
|
|
37
|
+
"map-pin",
|
|
38
|
+
"clock",
|
|
39
|
+
"book",
|
|
40
|
+
"music",
|
|
41
|
+
"coffee",
|
|
42
|
+
"star",
|
|
43
|
+
"check"
|
|
44
|
+
],
|
|
45
|
+
"default": "none"
|
|
46
|
+
},
|
|
47
|
+
"title": {
|
|
48
|
+
"label": "Title",
|
|
49
|
+
"type": "text"
|
|
50
|
+
},
|
|
51
|
+
"text": {
|
|
52
|
+
"label": "Description",
|
|
53
|
+
"type": "textarea"
|
|
54
|
+
},
|
|
55
|
+
"link": {
|
|
56
|
+
"label": "Link",
|
|
57
|
+
"type": "link"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"category": "Info",
|
|
63
|
+
"example": {
|
|
64
|
+
"heading": "Find your place",
|
|
65
|
+
"items": [
|
|
66
|
+
{
|
|
67
|
+
"icon": "users",
|
|
68
|
+
"title": "Small groups",
|
|
69
|
+
"text": "Meet in homes across the city during the week."
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"icon": "heart",
|
|
73
|
+
"title": "Serve",
|
|
74
|
+
"text": "Food bank, kids’ ministry and the welcome team."
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"icon": "music",
|
|
78
|
+
"title": "Worship team",
|
|
79
|
+
"text": "Musicians and singers of every level."
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"example": {
|
|
85
|
+
"variant": "three-up",
|
|
86
|
+
"data": {
|
|
87
|
+
"heading": "Find your place",
|
|
88
|
+
"items": [
|
|
89
|
+
{
|
|
90
|
+
"icon": "users",
|
|
91
|
+
"title": "Small groups",
|
|
92
|
+
"text": "Meet in homes across the city during the week."
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"icon": "heart",
|
|
96
|
+
"title": "Serve",
|
|
97
|
+
"text": "Food bank, kids’ ministry and the welcome team."
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"icon": "music",
|
|
101
|
+
"title": "Worship team",
|
|
102
|
+
"text": "Musicians and singers of every level."
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { SectionProps } from '@acms-subir/core/theme';
|
|
3
|
+
interface Photo { image: string; imageFocus: string; alt: string; caption: string }
|
|
4
|
+
interface Data { heading: string; images: Photo[] }
|
|
5
|
+
const { data, variant } = Astro.props as SectionProps<Data>;
|
|
6
|
+
const photos = data.images.filter((p) => p.image);
|
|
7
|
+
---
|
|
8
|
+
<div class:list={['gal', `is-${variant}`]}>
|
|
9
|
+
{data.heading && <h2>{data.heading}</h2>}
|
|
10
|
+
<ul class="gal-list">
|
|
11
|
+
{photos.map((p) => (
|
|
12
|
+
<li>
|
|
13
|
+
<figure>
|
|
14
|
+
<img src={p.image} alt={p.alt} loading="lazy" style={`object-position:${p.imageFocus}`} />
|
|
15
|
+
{p.caption && <figcaption>{p.caption}</figcaption>}
|
|
16
|
+
</figure>
|
|
17
|
+
</li>
|
|
18
|
+
))}
|
|
19
|
+
</ul>
|
|
20
|
+
</div>
|
|
21
|
+
<style>
|
|
22
|
+
.gal h2 { margin: 0 0 1.25rem; }
|
|
23
|
+
.gal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
|
|
24
|
+
.is-strip .gal-list { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 0.5rem; }
|
|
25
|
+
.is-strip .gal-list > li { flex: 0 0 min(80%, 22rem); scroll-snap-align: start; }
|
|
26
|
+
figure { margin: 0; }
|
|
27
|
+
img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r); background: var(--soft); display: block; }
|
|
28
|
+
figcaption { margin-top: 0.4rem; font-size: 0.88rem; color: var(--muted); }
|
|
29
|
+
</style>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "gallery",
|
|
3
|
+
"definition": {
|
|
4
|
+
"name": "Gallery",
|
|
5
|
+
"version": 1,
|
|
6
|
+
"component": "sections/Gallery.astro",
|
|
7
|
+
"description": "A grid or strip of photos with optional captions.",
|
|
8
|
+
"variants": [
|
|
9
|
+
"grid",
|
|
10
|
+
"strip"
|
|
11
|
+
],
|
|
12
|
+
"fields": {
|
|
13
|
+
"heading": {
|
|
14
|
+
"label": "Heading",
|
|
15
|
+
"type": "text",
|
|
16
|
+
"default": ""
|
|
17
|
+
},
|
|
18
|
+
"images": {
|
|
19
|
+
"label": "Photos",
|
|
20
|
+
"type": "list",
|
|
21
|
+
"itemLabel": "caption",
|
|
22
|
+
"max": 30,
|
|
23
|
+
"fields": {
|
|
24
|
+
"image": {
|
|
25
|
+
"label": "Photo",
|
|
26
|
+
"type": "image"
|
|
27
|
+
},
|
|
28
|
+
"alt": {
|
|
29
|
+
"label": "Description",
|
|
30
|
+
"type": "text",
|
|
31
|
+
"help": "What’s in the photo, for screen readers."
|
|
32
|
+
},
|
|
33
|
+
"caption": {
|
|
34
|
+
"label": "Caption",
|
|
35
|
+
"type": "text"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"category": "Media",
|
|
41
|
+
"example": {
|
|
42
|
+
"images": []
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"example": {
|
|
46
|
+
"variant": "grid",
|
|
47
|
+
"data": {
|
|
48
|
+
"images": []
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { SectionProps, LinkValue } from '@acms-subir/core/theme';
|
|
3
|
+
interface Data { eyebrow: string; heading: string; text: string; primary: LinkValue; secondary: LinkValue; image: string; imageFocus: string; alt: string }
|
|
4
|
+
const { data, variant } = Astro.props as SectionProps<Data>;
|
|
5
|
+
const buttons = [data.primary, data.secondary].filter((b) => b?.label && b.href);
|
|
6
|
+
---
|
|
7
|
+
<div class:list={['hero', `is-${variant}`, { 'has-image': data.image }]} style={variant === 'cover' && data.image ? `--hero-img:url("${data.image}");--hero-focus:${data.imageFocus}` : undefined}>
|
|
8
|
+
<div class="hero-copy">
|
|
9
|
+
{data.eyebrow && <p class="hero-eyebrow">{data.eyebrow}</p>}
|
|
10
|
+
<h1 class="hero-title">{data.heading}</h1>
|
|
11
|
+
{data.text && <p class="hero-text">{data.text}</p>}
|
|
12
|
+
{buttons.length > 0 && (
|
|
13
|
+
<div class="hero-actions">
|
|
14
|
+
{buttons.map((b, i) => <a class:list={['w-btn', i === 0 ? 'primary' : 'outline']} href={b.href} rel={b.external ? 'noopener' : undefined}>{b.label}</a>)}
|
|
15
|
+
</div>
|
|
16
|
+
)}
|
|
17
|
+
</div>
|
|
18
|
+
{variant === 'split' && data.image && <img class="hero-media" src={data.image} alt={data.alt} loading="eager" style={`object-position:${data.imageFocus}`} />}
|
|
19
|
+
</div>
|
|
20
|
+
<style>
|
|
21
|
+
.hero { display: grid; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
|
|
22
|
+
.hero.is-split.has-image { grid-template-columns: 1.1fr 1fr; }
|
|
23
|
+
.hero.is-centered, .hero.is-cover { text-align: center; justify-items: center; }
|
|
24
|
+
.hero.is-cover {
|
|
25
|
+
padding: clamp(3rem, 10vw, 7rem) clamp(1.25rem, 5vw, 4rem); border-radius: var(--r-lg);
|
|
26
|
+
background: var(--soft); color: var(--ink);
|
|
27
|
+
}
|
|
28
|
+
.hero.is-cover.has-image {
|
|
29
|
+
background: linear-gradient(rgb(0 0 0 / 0.45), rgb(0 0 0 / 0.55)), var(--hero-img) var(--hero-focus, center) / cover no-repeat;
|
|
30
|
+
color: #fff;
|
|
31
|
+
}
|
|
32
|
+
.hero-copy { max-width: 42rem; }
|
|
33
|
+
.hero-eyebrow { margin: 0 0 0.75rem; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-text, var(--accent)); }
|
|
34
|
+
.hero.is-cover.has-image .hero-eyebrow { color: inherit; opacity: 0.85; }
|
|
35
|
+
.hero-title { margin: 0; font-family: var(--font-heading); font-weight: var(--display-weight, 700); font-size: clamp(2.2rem, 6vw, 4.2rem); line-height: 1.05; letter-spacing: -0.02em; }
|
|
36
|
+
.hero-text { margin: 1rem 0 0; font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--muted); white-space: pre-line; }
|
|
37
|
+
.hero.is-cover.has-image .hero-text { color: inherit; opacity: 0.85; }
|
|
38
|
+
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
|
|
39
|
+
.hero.is-centered .hero-actions, .hero.is-cover .hero-actions { justify-content: center; }
|
|
40
|
+
.hero-media { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-lg); }
|
|
41
|
+
@media (max-width: 760px) { .hero.is-split.has-image { grid-template-columns: 1fr; } }
|
|
42
|
+
</style>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "hero-banner",
|
|
3
|
+
"definition": {
|
|
4
|
+
"name": "Hero banner",
|
|
5
|
+
"version": 1,
|
|
6
|
+
"component": "sections/HeroBanner.astro",
|
|
7
|
+
"description": "Big opening statement with up to two buttons and an optional image.",
|
|
8
|
+
"variants": [
|
|
9
|
+
"split",
|
|
10
|
+
"centered",
|
|
11
|
+
"cover"
|
|
12
|
+
],
|
|
13
|
+
"fields": {
|
|
14
|
+
"eyebrow": {
|
|
15
|
+
"label": "Small line above the heading",
|
|
16
|
+
"type": "text",
|
|
17
|
+
"default": ""
|
|
18
|
+
},
|
|
19
|
+
"heading": {
|
|
20
|
+
"label": "Heading",
|
|
21
|
+
"type": "text",
|
|
22
|
+
"default": "Welcome home."
|
|
23
|
+
},
|
|
24
|
+
"text": {
|
|
25
|
+
"label": "Supporting text",
|
|
26
|
+
"type": "textarea",
|
|
27
|
+
"default": ""
|
|
28
|
+
},
|
|
29
|
+
"primary": {
|
|
30
|
+
"label": "Main button",
|
|
31
|
+
"type": "link"
|
|
32
|
+
},
|
|
33
|
+
"secondary": {
|
|
34
|
+
"label": "Second button",
|
|
35
|
+
"type": "link"
|
|
36
|
+
},
|
|
37
|
+
"image": {
|
|
38
|
+
"label": "Image",
|
|
39
|
+
"type": "image",
|
|
40
|
+
"default": ""
|
|
41
|
+
},
|
|
42
|
+
"alt": {
|
|
43
|
+
"label": "Image description",
|
|
44
|
+
"type": "text",
|
|
45
|
+
"default": "",
|
|
46
|
+
"help": "Describe the image for people using screen readers."
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"category": "Intro",
|
|
50
|
+
"example": {
|
|
51
|
+
"eyebrow": "Sundays at 10:00",
|
|
52
|
+
"heading": "A church for the whole city.",
|
|
53
|
+
"text": "Come as you are. Coffee is on from 9:30.",
|
|
54
|
+
"primary": {
|
|
55
|
+
"label": "Plan a visit",
|
|
56
|
+
"href": "/visit"
|
|
57
|
+
},
|
|
58
|
+
"secondary": {
|
|
59
|
+
"label": "Watch online",
|
|
60
|
+
"href": "/live"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"limit": 1
|
|
64
|
+
},
|
|
65
|
+
"example": {
|
|
66
|
+
"variant": "cover",
|
|
67
|
+
"data": {
|
|
68
|
+
"eyebrow": "Sundays at 10:00",
|
|
69
|
+
"heading": "A church for the whole city.",
|
|
70
|
+
"text": "Come as you are. Coffee is on from 9:30.",
|
|
71
|
+
"primary": {
|
|
72
|
+
"label": "Plan a visit",
|
|
73
|
+
"href": "/visit"
|
|
74
|
+
},
|
|
75
|
+
"secondary": {
|
|
76
|
+
"label": "Watch online",
|
|
77
|
+
"href": "/live"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { SectionProps, PostItem, LinkValue } from '@acms-subir/core/theme';
|
|
3
|
+
import PostCard from '@acms-subir/core/theme/components/PostCard.astro';
|
|
4
|
+
interface Data { heading: string; posts: PostItem[]; more: LinkValue }
|
|
5
|
+
const { data, variant } = Astro.props as SectionProps<Data>;
|
|
6
|
+
---
|
|
7
|
+
<div class="latest">
|
|
8
|
+
<header class="latest-head">
|
|
9
|
+
<h2>{data.heading}</h2>
|
|
10
|
+
{data.more?.label && data.more.href && <a href={data.more.href}>{data.more.label} →</a>}
|
|
11
|
+
</header>
|
|
12
|
+
<div class:list={['latest-list', `is-${variant}`]}>
|
|
13
|
+
{data.posts.map((p) => <PostCard variant={variant === 'list' ? 'row' : 'card'} href={p.url} title={p.title} excerpt={p.excerpt} cover={p.image} coverAlt={p.imageAlt} />)}
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
<style>
|
|
17
|
+
.latest-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.5rem 2rem; margin-bottom: 1.25rem; }
|
|
18
|
+
.latest-head h2 { margin: 0; }
|
|
19
|
+
.latest-head a { font-weight: 600; color: var(--accent-text, var(--accent)); text-decoration: none; }
|
|
20
|
+
.latest-list.is-cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
|
|
21
|
+
.latest-list.is-list { display: grid; gap: 0.5rem; }
|
|
22
|
+
</style>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "latest-posts",
|
|
3
|
+
"definition": {
|
|
4
|
+
"name": "Latest posts",
|
|
5
|
+
"version": 1,
|
|
6
|
+
"component": "sections/LatestPosts.astro",
|
|
7
|
+
"description": "Recent posts from a collection or tag. Updates on its own.",
|
|
8
|
+
"variants": [
|
|
9
|
+
"cards",
|
|
10
|
+
"list"
|
|
11
|
+
],
|
|
12
|
+
"fields": {
|
|
13
|
+
"heading": {
|
|
14
|
+
"label": "Heading",
|
|
15
|
+
"type": "text",
|
|
16
|
+
"default": "Latest"
|
|
17
|
+
},
|
|
18
|
+
"posts": {
|
|
19
|
+
"label": "Posts",
|
|
20
|
+
"type": "source",
|
|
21
|
+
"source": "posts",
|
|
22
|
+
"default": {
|
|
23
|
+
"limit": 3
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"more": {
|
|
27
|
+
"label": "“See all” link",
|
|
28
|
+
"type": "link"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"category": "Posts & news"
|
|
32
|
+
},
|
|
33
|
+
"example": {
|
|
34
|
+
"variant": "cards",
|
|
35
|
+
"data": {}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { SectionProps, LinkValue } from '@acms-subir/core/theme';
|
|
3
|
+
interface Plan { name: string; price: string; period: string; description: string; features: string; cta: LinkValue; featured: boolean }
|
|
4
|
+
interface Data { heading: string; intro: string; plans: Plan[] }
|
|
5
|
+
const { data } = Astro.props as SectionProps<Data>;
|
|
6
|
+
const plans = data.plans.filter((p) => p.name);
|
|
7
|
+
---
|
|
8
|
+
<div class="price">
|
|
9
|
+
<header class="price-head">
|
|
10
|
+
<h2>{data.heading}</h2>
|
|
11
|
+
{data.intro && <p>{data.intro}</p>}
|
|
12
|
+
</header>
|
|
13
|
+
<ul class="price-list">
|
|
14
|
+
{plans.map((p) => (
|
|
15
|
+
<li class:list={['price-plan', { 'is-featured': p.featured }]}>
|
|
16
|
+
<b class="price-name">{p.name}</b>
|
|
17
|
+
{p.price && <span class="price-amount">{p.price}{p.period && <small> / {p.period}</small>}</span>}
|
|
18
|
+
{p.description && <p class="price-desc">{p.description}</p>}
|
|
19
|
+
{p.features && <ul class="price-features">{p.features.split('\n').map((f) => f.trim()).filter(Boolean).map((f) => <li>{f}</li>)}</ul>}
|
|
20
|
+
{p.cta?.label && p.cta.href && <a class:list={['w-btn', p.featured ? 'primary' : 'outline']} href={p.cta.href}>{p.cta.label}</a>}
|
|
21
|
+
</li>
|
|
22
|
+
))}
|
|
23
|
+
</ul>
|
|
24
|
+
</div>
|
|
25
|
+
<style>
|
|
26
|
+
.price-head { text-align: center; max-width: 40rem; margin: 0 auto; }
|
|
27
|
+
.price-head h2 { margin: 0; }
|
|
28
|
+
.price-head p { margin: 0.5rem 0 0; color: var(--muted); }
|
|
29
|
+
.price-list { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); align-items: stretch; }
|
|
30
|
+
.price-plan { display: flex; flex-direction: column; gap: 0.6rem; padding: 1.5rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
|
|
31
|
+
.price-plan.is-featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--sh-2); }
|
|
32
|
+
.price-name { font-size: 1rem; }
|
|
33
|
+
.price-amount { font-family: var(--font-heading); font-size: 2.2rem; line-height: 1.1; }
|
|
34
|
+
.price-amount small { font-family: var(--font-body); font-size: 0.95rem; color: var(--muted); }
|
|
35
|
+
.price-desc { margin: 0; color: var(--muted); }
|
|
36
|
+
.price-features { list-style: none; margin: 0.25rem 0 0.5rem; padding: 0; display: grid; gap: 0.35rem; flex: 1; }
|
|
37
|
+
.price-features li { display: flex; gap: 0.5rem; font-size: 0.95rem; }
|
|
38
|
+
.price-features li::before { content: '✓'; color: var(--accent-text, var(--accent)); font-weight: 700; }
|
|
39
|
+
.price-plan .w-btn { align-self: flex-start; }
|
|
40
|
+
</style>
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "pricing",
|
|
3
|
+
"definition": {
|
|
4
|
+
"name": "Pricing",
|
|
5
|
+
"version": 1,
|
|
6
|
+
"component": "sections/Pricing.astro",
|
|
7
|
+
"description": "Plans or tiers side by side, one can be highlighted.",
|
|
8
|
+
"variants": [
|
|
9
|
+
"default"
|
|
10
|
+
],
|
|
11
|
+
"fields": {
|
|
12
|
+
"heading": {
|
|
13
|
+
"label": "Heading",
|
|
14
|
+
"type": "text",
|
|
15
|
+
"default": "Plans"
|
|
16
|
+
},
|
|
17
|
+
"intro": {
|
|
18
|
+
"label": "Intro",
|
|
19
|
+
"type": "textarea",
|
|
20
|
+
"default": ""
|
|
21
|
+
},
|
|
22
|
+
"plans": {
|
|
23
|
+
"label": "Plans",
|
|
24
|
+
"type": "list",
|
|
25
|
+
"itemLabel": "name",
|
|
26
|
+
"max": 6,
|
|
27
|
+
"fields": {
|
|
28
|
+
"name": {
|
|
29
|
+
"label": "Name",
|
|
30
|
+
"type": "text"
|
|
31
|
+
},
|
|
32
|
+
"price": {
|
|
33
|
+
"label": "Price",
|
|
34
|
+
"type": "text",
|
|
35
|
+
"placeholder": "$20",
|
|
36
|
+
"translatable": false
|
|
37
|
+
},
|
|
38
|
+
"period": {
|
|
39
|
+
"label": "Per",
|
|
40
|
+
"type": "text",
|
|
41
|
+
"placeholder": "month"
|
|
42
|
+
},
|
|
43
|
+
"description": {
|
|
44
|
+
"label": "Description",
|
|
45
|
+
"type": "textarea"
|
|
46
|
+
},
|
|
47
|
+
"features": {
|
|
48
|
+
"label": "Included (one per line)",
|
|
49
|
+
"type": "textarea"
|
|
50
|
+
},
|
|
51
|
+
"cta": {
|
|
52
|
+
"label": "Button",
|
|
53
|
+
"type": "link"
|
|
54
|
+
},
|
|
55
|
+
"featured": {
|
|
56
|
+
"label": "Highlight this plan",
|
|
57
|
+
"type": "toggle"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"category": "Info",
|
|
63
|
+
"example": {
|
|
64
|
+
"plans": [
|
|
65
|
+
{
|
|
66
|
+
"name": "Drop-in",
|
|
67
|
+
"price": "$15",
|
|
68
|
+
"period": "class",
|
|
69
|
+
"features": "Any class\nMat included",
|
|
70
|
+
"cta": {
|
|
71
|
+
"label": "Book a class",
|
|
72
|
+
"href": "/book"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"name": "Monthly",
|
|
77
|
+
"price": "$90",
|
|
78
|
+
"period": "month",
|
|
79
|
+
"features": "Unlimited classes\nFree workshop",
|
|
80
|
+
"cta": {
|
|
81
|
+
"label": "Join",
|
|
82
|
+
"href": "/join"
|
|
83
|
+
},
|
|
84
|
+
"featured": true
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"example": {
|
|
90
|
+
"variant": "default",
|
|
91
|
+
"data": {
|
|
92
|
+
"plans": [
|
|
93
|
+
{
|
|
94
|
+
"name": "Drop-in",
|
|
95
|
+
"price": "$15",
|
|
96
|
+
"period": "class",
|
|
97
|
+
"features": "Any class\nMat included",
|
|
98
|
+
"cta": {
|
|
99
|
+
"label": "Book a class",
|
|
100
|
+
"href": "/book"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "Monthly",
|
|
105
|
+
"price": "$90",
|
|
106
|
+
"period": "month",
|
|
107
|
+
"features": "Unlimited classes\nFree workshop",
|
|
108
|
+
"cta": {
|
|
109
|
+
"label": "Join",
|
|
110
|
+
"href": "/join"
|
|
111
|
+
},
|
|
112
|
+
"featured": true
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { SectionProps } from '@acms-subir/core/theme';
|
|
3
|
+
interface Q { question: string; answer: string }
|
|
4
|
+
interface Data { heading: string; intro: string; questions: Q[] }
|
|
5
|
+
const { data, variant } = Astro.props as SectionProps<Data>;
|
|
6
|
+
const questions = data.questions.filter((q) => q.question);
|
|
7
|
+
---
|
|
8
|
+
<div class:list={['faq', `is-${variant}`]}>
|
|
9
|
+
<header class="faq-head">
|
|
10
|
+
<h2>{data.heading}</h2>
|
|
11
|
+
{data.intro && <p>{data.intro}</p>}
|
|
12
|
+
</header>
|
|
13
|
+
<div class="faq-list">
|
|
14
|
+
{questions.map((q) => (
|
|
15
|
+
<details class="faq-item">
|
|
16
|
+
<summary>{q.question}</summary>
|
|
17
|
+
<!-- answer is sanitized rich text from the core -->
|
|
18
|
+
<div class="faq-answer" set:html={q.answer} />
|
|
19
|
+
</details>
|
|
20
|
+
))}
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<style>
|
|
24
|
+
.faq-head h2 { margin: 0; }
|
|
25
|
+
.faq-head p { margin: 0.5rem 0 0; color: var(--muted); max-width: 60ch; }
|
|
26
|
+
.faq-list { margin-top: 1.5rem; border-top: 1px solid var(--line); }
|
|
27
|
+
.is-two-column { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 2rem; }
|
|
28
|
+
.is-two-column .faq-list { margin-top: 0; }
|
|
29
|
+
.faq-item { border-bottom: 1px solid var(--line); }
|
|
30
|
+
summary { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 0; cursor: pointer; font-weight: 600; font-size: 1.05rem; list-style: none; }
|
|
31
|
+
summary::-webkit-details-marker { display: none; }
|
|
32
|
+
summary::after { content: '+'; color: var(--muted); font-weight: 400; font-size: 1.3rem; line-height: 1; transition: transform 0.15s; }
|
|
33
|
+
details[open] summary::after { transform: rotate(45deg); }
|
|
34
|
+
.faq-answer { padding: 0 0 1rem; color: var(--muted); }
|
|
35
|
+
.faq-answer :global(p) { margin: 0 0 0.6rem; }
|
|
36
|
+
.faq-answer :global(a) { color: var(--accent-text, var(--accent)); }
|
|
37
|
+
@media (max-width: 760px) { .is-two-column { grid-template-columns: 1fr; gap: 1rem; } }
|
|
38
|
+
</style>
|