@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.
Files changed (251) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/cli/common.mjs +2 -2
  3. package/cli/legacy.mjs +1 -1
  4. package/cli/main.mjs +82 -8
  5. package/cli/mobile-doctor.mjs +430 -0
  6. package/cli/mobile.mjs +315 -0
  7. package/cli/native-sections.mjs +168 -0
  8. package/cli/sections.mjs +186 -0
  9. package/cli/themes.mjs +52 -8
  10. package/docs/mobile.md +527 -0
  11. package/docs/sections.md +203 -0
  12. package/docs/theme-authoring.md +1 -1
  13. package/integration.mjs +55 -1
  14. package/mobile-template/client/AGENTS.md +97 -0
  15. package/mobile-template/client/README.md +65 -0
  16. package/mobile-template/client/app/_layout.tsx +56 -0
  17. package/mobile-template/client/app/index.tsx +21 -0
  18. package/mobile-template/client/app.json +21 -0
  19. package/mobile-template/client/components/LanguageSwitch.tsx +31 -0
  20. package/mobile-template/client/eas.json +21 -0
  21. package/mobile-template/client/env.example +3 -0
  22. package/mobile-template/client/gitignore +42 -0
  23. package/mobile-template/client/package.json +38 -0
  24. package/mobile-template/client/sections/index.ts +11 -0
  25. package/mobile-template/client/tsconfig.json +7 -0
  26. package/mobile-template/editor/AGENTS.md +66 -0
  27. package/mobile-template/editor/README.md +73 -0
  28. package/mobile-template/editor/app/_layout.tsx +76 -0
  29. package/mobile-template/editor/app/auth.tsx +13 -0
  30. package/mobile-template/editor/app/index.tsx +55 -0
  31. package/mobile-template/editor/app.json +21 -0
  32. package/mobile-template/editor/components/Screen.tsx +51 -0
  33. package/mobile-template/editor/components/SignIn.tsx +36 -0
  34. package/mobile-template/editor/components/TextTabs.tsx +27 -0
  35. package/mobile-template/editor/eas.json +21 -0
  36. package/mobile-template/editor/env.example +5 -0
  37. package/mobile-template/editor/gitignore +42 -0
  38. package/mobile-template/editor/lib/appearance.tsx +12 -0
  39. package/mobile-template/editor/lib/config.ts +17 -0
  40. package/mobile-template/editor/lib/format.ts +24 -0
  41. package/mobile-template/editor/lib/tools.ts +16 -0
  42. package/mobile-template/editor/package.json +40 -0
  43. package/mobile-template/editor/tools/README.md +2 -0
  44. package/mobile-template/editor/tsconfig.json +7 -0
  45. package/mobile-template/recipes/booking/files/app/book/[resource].tsx +57 -0
  46. package/mobile-template/recipes/booking/files/app/book/details.tsx +105 -0
  47. package/mobile-template/recipes/booking/files/app/book/index.tsx +38 -0
  48. package/mobile-template/recipes/booking/recipe.json +17 -0
  49. package/mobile-template/recipes/editor-bookings/files/app/bookings/index.tsx +113 -0
  50. package/mobile-template/recipes/editor-bookings/files/tools/bookings.ts +1 -0
  51. package/mobile-template/recipes/editor-bookings/recipe.json +8 -0
  52. package/mobile-template/recipes/editor-content/files/app/content/[kind]/[id].tsx +13 -0
  53. package/mobile-template/recipes/editor-content/files/app/content/index.tsx +76 -0
  54. package/mobile-template/recipes/editor-content/files/components/DocumentDetail.tsx +55 -0
  55. package/mobile-template/recipes/editor-content/files/tools/content.ts +1 -0
  56. package/mobile-template/recipes/editor-content/recipe.json +8 -0
  57. package/mobile-template/recipes/editor-media/files/app/media/index.tsx +73 -0
  58. package/mobile-template/recipes/editor-media/files/tools/media.ts +1 -0
  59. package/mobile-template/recipes/editor-media/recipe.json +8 -0
  60. package/mobile-template/recipes/editor-sections/files/app/sections/[pageId]/[sectionId].tsx +12 -0
  61. package/mobile-template/recipes/editor-sections/files/app/sections/index.tsx +48 -0
  62. package/mobile-template/recipes/editor-sections/files/components/SectionEditorPane.tsx +77 -0
  63. package/mobile-template/recipes/editor-sections/files/tools/sections.ts +1 -0
  64. package/mobile-template/recipes/editor-sections/recipe.json +8 -0
  65. package/mobile-template/recipes/editor-translations/files/app/translations/index.tsx +63 -0
  66. package/mobile-template/recipes/editor-translations/files/app/translations/review.tsx +14 -0
  67. package/mobile-template/recipes/editor-translations/files/components/ReviewPane.tsx +72 -0
  68. package/mobile-template/recipes/editor-translations/files/tools/translations.ts +1 -0
  69. package/mobile-template/recipes/editor-translations/recipe.json +8 -0
  70. package/mobile-template/recipes/editor-writer/files/app/write/[kind]/[id].tsx +132 -0
  71. package/mobile-template/recipes/editor-writer/files/app/write/new.tsx +61 -0
  72. package/mobile-template/recipes/editor-writer/files/tools/writer.ts +1 -0
  73. package/mobile-template/recipes/editor-writer/recipe.json +8 -0
  74. package/mobile-template/recipes/events/files/app/events/[slug].tsx +41 -0
  75. package/mobile-template/recipes/events/files/app/events/index.tsx +50 -0
  76. package/mobile-template/recipes/events/files/lib/addToCalendar.ts +27 -0
  77. package/mobile-template/recipes/events/recipe.json +15 -0
  78. package/mobile-template/recipes/news/files/app/news/[slug].tsx +25 -0
  79. package/mobile-template/recipes/news/files/app/news/index.tsx +50 -0
  80. package/mobile-template/recipes/news/recipe.json +13 -0
  81. package/mobile-template/recipes/push/files/app/notifications.tsx +64 -0
  82. package/mobile-template/recipes/push/files/components/PushSetup.tsx +15 -0
  83. package/mobile-template/recipes/push/files/lib/push.ts +15 -0
  84. package/mobile-template/recipes/push/recipe.json +20 -0
  85. package/package.json +4 -2
  86. package/section-library/README.md +16 -0
  87. package/section-library/contact/Contact.astro +49 -0
  88. package/section-library/contact/section.json +106 -0
  89. package/section-library/cta-band/CtaBand.astro +28 -0
  90. package/section-library/cta-band/section.json +51 -0
  91. package/section-library/feature-grid/FeatureGrid.astro +54 -0
  92. package/section-library/feature-grid/section.json +107 -0
  93. package/section-library/gallery/Gallery.astro +29 -0
  94. package/section-library/gallery/section.json +51 -0
  95. package/section-library/hero-banner/HeroBanner.astro +42 -0
  96. package/section-library/hero-banner/section.json +81 -0
  97. package/section-library/latest-posts/LatestPosts.astro +22 -0
  98. package/section-library/latest-posts/section.json +37 -0
  99. package/section-library/pricing/Pricing.astro +40 -0
  100. package/section-library/pricing/section.json +117 -0
  101. package/section-library/questions/Questions.astro +38 -0
  102. package/section-library/questions/section.json +69 -0
  103. package/section-library/service-times/ServiceTimes.astro +42 -0
  104. package/section-library/service-times/section.json +127 -0
  105. package/section-library/team/Team.astro +45 -0
  106. package/section-library/team/section.json +88 -0
  107. package/section-library/upcoming-events/UpcomingEvents.astro +54 -0
  108. package/section-library/upcoming-events/section.json +51 -0
  109. package/src/actions/index.ts +19 -171
  110. package/src/components/AiSettings.tsx +45 -5
  111. package/src/components/DesignManager.tsx +112 -16
  112. package/src/components/MobileApp.tsx +392 -0
  113. package/src/components/ThemeSections.astro +40 -21
  114. package/src/components/ThemeSectionsEditor.tsx +757 -229
  115. package/src/components/editor/PostEditor.tsx +174 -10
  116. package/src/components/import/ImportExport.tsx +4 -1
  117. package/src/components/import/runner.ts +1 -0
  118. package/src/components/sections/SectionFields.tsx +560 -0
  119. package/src/components/sections/SectionPicker.tsx +120 -0
  120. package/src/components/sections/TranslationPanel.tsx +143 -0
  121. package/src/components/sections/checks.ts +64 -0
  122. package/src/layouts/Admin.astro +6 -1
  123. package/src/layouts/Site.astro +107 -19
  124. package/src/lib/agent-discovery.ts +11 -7
  125. package/src/lib/agent.ts +35 -2
  126. package/src/lib/ai-schema.ts +5 -0
  127. package/src/lib/ai.ts +5 -0
  128. package/src/lib/api.ts +12 -0
  129. package/src/lib/content-service.ts +198 -0
  130. package/src/lib/design-service.ts +153 -5
  131. package/src/lib/drafts.ts +3 -3
  132. package/src/lib/editor/auth.ts +264 -0
  133. package/src/lib/editor/bookings.ts +60 -0
  134. package/src/lib/editor/config.ts +25 -0
  135. package/src/lib/editor/documents.ts +227 -0
  136. package/src/lib/editor/http.ts +48 -0
  137. package/src/lib/editor/me.ts +30 -0
  138. package/src/lib/editor/migration.ts +57 -0
  139. package/src/lib/editor/next.ts +11 -0
  140. package/src/lib/editor/openapi.ts +124 -0
  141. package/src/lib/editor/schemas.ts +91 -0
  142. package/src/lib/editor/sections.ts +96 -0
  143. package/src/lib/editor/store.ts +184 -0
  144. package/src/lib/editor/token-route.ts +74 -0
  145. package/src/lib/editor/translations.ts +163 -0
  146. package/src/lib/email/accounts.ts +2 -1
  147. package/src/lib/email/types.ts +2 -1
  148. package/src/lib/home-source.ts +34 -0
  149. package/src/lib/i18n.ts +34 -0
  150. package/src/lib/import/apply.ts +31 -2
  151. package/src/lib/import/bundle.ts +4 -0
  152. package/src/lib/import/export.ts +1 -0
  153. package/src/lib/import/ghost.ts +1 -0
  154. package/src/lib/media/upload.ts +83 -0
  155. package/src/lib/mobile/associations.ts +25 -0
  156. package/src/lib/mobile/calendar.ts +19 -11
  157. package/src/lib/mobile/config.mjs +59 -0
  158. package/src/lib/mobile/content.ts +18 -13
  159. package/src/lib/mobile/embed.ts +83 -0
  160. package/src/lib/mobile/http.ts +8 -6
  161. package/src/lib/mobile/locale.ts +18 -0
  162. package/src/lib/mobile/openapi.ts +111 -0
  163. package/src/lib/mobile/pages.ts +71 -0
  164. package/src/lib/mobile/route.ts +3 -3
  165. package/src/lib/mobile/schemas.ts +60 -0
  166. package/src/lib/mobile/site.ts +41 -0
  167. package/src/lib/push/api.ts +158 -0
  168. package/src/lib/push/config.ts +20 -0
  169. package/src/lib/push/expo.ts +76 -0
  170. package/src/lib/push/migration.ts +60 -0
  171. package/src/lib/push/service.ts +302 -0
  172. package/src/lib/push/store.ts +144 -0
  173. package/src/lib/push/types.ts +43 -0
  174. package/src/lib/repo/migrations.ts +11 -0
  175. package/src/lib/repo/sql.ts +40 -7
  176. package/src/lib/repo/types.ts +9 -3
  177. package/src/lib/roles.ts +5 -0
  178. package/src/lib/scheduler.ts +3 -0
  179. package/src/lib/schema.ts +27 -1
  180. package/src/lib/section-ai.ts +55 -0
  181. package/src/lib/section-targets.ts +62 -0
  182. package/src/lib/sections-agent.ts +146 -0
  183. package/src/lib/sections.ts +217 -0
  184. package/src/lib/theme.ts +16 -1
  185. package/src/lib/translate.ts +97 -0
  186. package/src/lib/translations.ts +39 -0
  187. package/src/middleware.ts +32 -0
  188. package/src/pages/.well-known/apple-app-site-association.ts +6 -0
  189. package/src/pages/.well-known/assetlinks.json.ts +6 -0
  190. package/src/pages/[...slug].astro +8 -3
  191. package/src/pages/admin/app-auth.astro +159 -0
  192. package/src/pages/admin/c/[collection]/[id].astro +9 -0
  193. package/src/pages/admin/calendar/events/[id].astro +9 -0
  194. package/src/pages/admin/login.astro +6 -2
  195. package/src/pages/admin/logout.ts +5 -2
  196. package/src/pages/admin/mobile.astro +18 -0
  197. package/src/pages/admin/pages/[id].astro +62 -0
  198. package/src/pages/admin/section-preview.astro +61 -0
  199. package/src/pages/admin/users.astro +107 -11
  200. package/src/pages/api/agent/docs.ts +6 -2
  201. package/src/pages/api/agent/index.ts +1 -1
  202. package/src/pages/api/ai/settings.ts +7 -4
  203. package/src/pages/api/design/ai.ts +15 -0
  204. package/src/pages/api/design/index.ts +12 -42
  205. package/src/pages/api/design/translate.ts +15 -0
  206. package/src/pages/api/live/thumb.ts +1 -1
  207. package/src/pages/api/mcp.ts +2 -2
  208. package/src/pages/api/media/upload.ts +10 -78
  209. package/src/pages/api/push/admin.ts +27 -0
  210. package/src/pages/api/v1/admin/bookings/[id]/[action].ts +14 -0
  211. package/src/pages/api/v1/admin/bookings/index.ts +6 -0
  212. package/src/pages/api/v1/admin/documents/[kind]/[id]/[action].ts +17 -0
  213. package/src/pages/api/v1/admin/documents/[kind]/[id]/index.ts +20 -0
  214. package/src/pages/api/v1/admin/documents/[kind]/[id]/translations/[locale]/[action].ts +26 -0
  215. package/src/pages/api/v1/admin/documents/[kind]/[id]/translations/[locale]/index.ts +18 -0
  216. package/src/pages/api/v1/admin/documents/index.ts +13 -0
  217. package/src/pages/api/v1/admin/me.ts +6 -0
  218. package/src/pages/api/v1/admin/media/index.ts +32 -0
  219. package/src/pages/api/v1/admin/sections/[pageId]/[sectionId]/index.ts +14 -0
  220. package/src/pages/api/v1/admin/sections/[pageId]/[sectionId]/publish.ts +14 -0
  221. package/src/pages/api/v1/admin/sections/[pageId]/[sectionId]/translations/[locale]/[action].ts +22 -0
  222. package/src/pages/api/v1/admin/sections/[pageId]/[sectionId]/translations/[locale]/index.ts +14 -0
  223. package/src/pages/api/v1/admin/sections/index.ts +6 -0
  224. package/src/pages/api/v1/auth/revoke.ts +5 -0
  225. package/src/pages/api/v1/auth/token.ts +5 -0
  226. package/src/pages/api/v1/devices/[token].ts +20 -0
  227. package/src/pages/api/v1/devices/index.ts +17 -0
  228. package/src/pages/api/v1/openapi.json.ts +7 -0
  229. package/src/pages/api/v1/pages/[...slug].ts +7 -0
  230. package/src/pages/api/v1/pages/home.ts +7 -0
  231. package/src/pages/api/v1/push/topics.ts +7 -0
  232. package/src/pages/api/v1/site.ts +7 -0
  233. package/src/pages/api/v1/theme.ts +7 -0
  234. package/src/pages/blog/[slug].astro +8 -2
  235. package/src/pages/blog/index.astro +11 -4
  236. package/src/pages/embed/section/[...path].astro +42 -0
  237. package/src/pages/events/[slug].astro +7 -2
  238. package/src/pages/index.astro +11 -5
  239. package/src/pages/sitemap.xml.ts +8 -0
  240. package/src/styles/admin.css +69 -0
  241. package/src/styles/editor.css +21 -0
  242. package/src/styles/mobile-app.css +151 -0
  243. package/src/styles/sections.css +7 -1
  244. package/src/styles/theme-editor.css +255 -0
  245. package/src/theme-sdk/contract.d.mts +2193 -89
  246. package/src/theme-sdk/contract.mjs +77 -20
  247. package/src/theme-sdk/fields.d.mts +88 -0
  248. package/src/theme-sdk/fields.mjs +326 -0
  249. package/src/theme-sdk/index.ts +10 -2
  250. package/src/theme-sdk/tokens.d.mts +11 -0
  251. 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>