@acms-subir/core 0.3.3-next.20260929113209 → 0.3.4

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 (289) hide show
  1. package/CHANGELOG.md +105 -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/preview.mjs +8 -4
  9. package/cli/sections.mjs +188 -0
  10. package/cli/themes.mjs +52 -8
  11. package/docs/mobile.md +527 -0
  12. package/docs/sections.md +203 -0
  13. package/docs/theme-authoring.md +19 -3
  14. package/integration.mjs +76 -5
  15. package/mobile-template/client/AGENTS.md +97 -0
  16. package/mobile-template/client/README.md +65 -0
  17. package/mobile-template/client/app/_layout.tsx +56 -0
  18. package/mobile-template/client/app/index.tsx +21 -0
  19. package/mobile-template/client/app.json +21 -0
  20. package/mobile-template/client/components/LanguageSwitch.tsx +31 -0
  21. package/mobile-template/client/eas.json +21 -0
  22. package/mobile-template/client/env.example +3 -0
  23. package/mobile-template/client/gitignore +42 -0
  24. package/mobile-template/client/package.json +38 -0
  25. package/mobile-template/client/sections/index.ts +11 -0
  26. package/mobile-template/client/tsconfig.json +7 -0
  27. package/mobile-template/editor/AGENTS.md +66 -0
  28. package/mobile-template/editor/README.md +73 -0
  29. package/mobile-template/editor/app/_layout.tsx +76 -0
  30. package/mobile-template/editor/app/auth.tsx +13 -0
  31. package/mobile-template/editor/app/index.tsx +55 -0
  32. package/mobile-template/editor/app.json +21 -0
  33. package/mobile-template/editor/components/Screen.tsx +51 -0
  34. package/mobile-template/editor/components/SignIn.tsx +36 -0
  35. package/mobile-template/editor/components/TextTabs.tsx +27 -0
  36. package/mobile-template/editor/eas.json +21 -0
  37. package/mobile-template/editor/env.example +5 -0
  38. package/mobile-template/editor/gitignore +42 -0
  39. package/mobile-template/editor/lib/appearance.tsx +12 -0
  40. package/mobile-template/editor/lib/config.ts +17 -0
  41. package/mobile-template/editor/lib/format.ts +24 -0
  42. package/mobile-template/editor/lib/tools.ts +16 -0
  43. package/mobile-template/editor/package.json +40 -0
  44. package/mobile-template/editor/tools/README.md +2 -0
  45. package/mobile-template/editor/tsconfig.json +7 -0
  46. package/mobile-template/recipes/booking/files/app/book/[resource].tsx +57 -0
  47. package/mobile-template/recipes/booking/files/app/book/details.tsx +105 -0
  48. package/mobile-template/recipes/booking/files/app/book/index.tsx +38 -0
  49. package/mobile-template/recipes/booking/recipe.json +17 -0
  50. package/mobile-template/recipes/editor-bookings/files/app/bookings/index.tsx +113 -0
  51. package/mobile-template/recipes/editor-bookings/files/tools/bookings.ts +1 -0
  52. package/mobile-template/recipes/editor-bookings/recipe.json +8 -0
  53. package/mobile-template/recipes/editor-content/files/app/content/[kind]/[id].tsx +13 -0
  54. package/mobile-template/recipes/editor-content/files/app/content/index.tsx +76 -0
  55. package/mobile-template/recipes/editor-content/files/components/DocumentDetail.tsx +55 -0
  56. package/mobile-template/recipes/editor-content/files/tools/content.ts +1 -0
  57. package/mobile-template/recipes/editor-content/recipe.json +8 -0
  58. package/mobile-template/recipes/editor-media/files/app/media/index.tsx +73 -0
  59. package/mobile-template/recipes/editor-media/files/tools/media.ts +1 -0
  60. package/mobile-template/recipes/editor-media/recipe.json +8 -0
  61. package/mobile-template/recipes/editor-sections/files/app/sections/[pageId]/[sectionId].tsx +12 -0
  62. package/mobile-template/recipes/editor-sections/files/app/sections/index.tsx +48 -0
  63. package/mobile-template/recipes/editor-sections/files/components/SectionEditorPane.tsx +77 -0
  64. package/mobile-template/recipes/editor-sections/files/tools/sections.ts +1 -0
  65. package/mobile-template/recipes/editor-sections/recipe.json +8 -0
  66. package/mobile-template/recipes/editor-translations/files/app/translations/index.tsx +63 -0
  67. package/mobile-template/recipes/editor-translations/files/app/translations/review.tsx +14 -0
  68. package/mobile-template/recipes/editor-translations/files/components/ReviewPane.tsx +72 -0
  69. package/mobile-template/recipes/editor-translations/files/tools/translations.ts +1 -0
  70. package/mobile-template/recipes/editor-translations/recipe.json +8 -0
  71. package/mobile-template/recipes/editor-writer/files/app/write/[kind]/[id].tsx +132 -0
  72. package/mobile-template/recipes/editor-writer/files/app/write/new.tsx +61 -0
  73. package/mobile-template/recipes/editor-writer/files/tools/writer.ts +1 -0
  74. package/mobile-template/recipes/editor-writer/recipe.json +8 -0
  75. package/mobile-template/recipes/events/files/app/events/[slug].tsx +41 -0
  76. package/mobile-template/recipes/events/files/app/events/index.tsx +50 -0
  77. package/mobile-template/recipes/events/files/lib/addToCalendar.ts +27 -0
  78. package/mobile-template/recipes/events/recipe.json +15 -0
  79. package/mobile-template/recipes/news/files/app/news/[slug].tsx +25 -0
  80. package/mobile-template/recipes/news/files/app/news/index.tsx +50 -0
  81. package/mobile-template/recipes/news/recipe.json +13 -0
  82. package/mobile-template/recipes/push/files/app/notifications.tsx +64 -0
  83. package/mobile-template/recipes/push/files/components/PushSetup.tsx +15 -0
  84. package/mobile-template/recipes/push/files/lib/push.ts +15 -0
  85. package/mobile-template/recipes/push/recipe.json +20 -0
  86. package/package.json +17 -13
  87. package/section-library/README.md +16 -0
  88. package/section-library/contact/Contact.astro +49 -0
  89. package/section-library/contact/section.json +106 -0
  90. package/section-library/cta-band/CtaBand.astro +28 -0
  91. package/section-library/cta-band/section.json +51 -0
  92. package/section-library/feature-grid/FeatureGrid.astro +54 -0
  93. package/section-library/feature-grid/section.json +107 -0
  94. package/section-library/gallery/Gallery.astro +29 -0
  95. package/section-library/gallery/section.json +51 -0
  96. package/section-library/hero-banner/HeroBanner.astro +42 -0
  97. package/section-library/hero-banner/section.json +81 -0
  98. package/section-library/latest-posts/LatestPosts.astro +22 -0
  99. package/section-library/latest-posts/section.json +37 -0
  100. package/section-library/pricing/Pricing.astro +40 -0
  101. package/section-library/pricing/section.json +117 -0
  102. package/section-library/questions/Questions.astro +38 -0
  103. package/section-library/questions/section.json +69 -0
  104. package/section-library/service-times/ServiceTimes.astro +42 -0
  105. package/section-library/service-times/section.json +127 -0
  106. package/section-library/team/Team.astro +45 -0
  107. package/section-library/team/section.json +88 -0
  108. package/section-library/upcoming-events/UpcomingEvents.astro +54 -0
  109. package/section-library/upcoming-events/section.json +51 -0
  110. package/src/actions/index.ts +205 -174
  111. package/src/components/AiSettings.tsx +45 -5
  112. package/src/components/DesignManager.tsx +112 -16
  113. package/src/components/MobileApp.tsx +392 -0
  114. package/src/components/ThemeSections.astro +40 -21
  115. package/src/components/ThemeSectionsEditor.tsx +757 -229
  116. package/src/components/booking/BookingFlow.astro +6 -3
  117. package/src/components/calendar/BookingsHead.astro +51 -0
  118. package/src/components/calendar/CalendarBoard.tsx +618 -0
  119. package/src/components/calendar/MiniMonth.tsx +54 -0
  120. package/src/components/calendar/NewEventDialog.tsx +44 -0
  121. package/src/components/calendar/QuickAdd.tsx +263 -0
  122. package/src/components/calendar/RoomHolds.tsx +203 -0
  123. package/src/components/calendar/WhereItLands.tsx +51 -0
  124. package/src/components/editor/EventPanel.tsx +23 -2
  125. package/src/components/editor/PostEditor.tsx +206 -14
  126. package/src/components/import/ImportExport.tsx +4 -1
  127. package/src/components/import/runner.ts +1 -0
  128. package/src/components/sections/SectionFields.tsx +560 -0
  129. package/src/components/sections/SectionPicker.tsx +120 -0
  130. package/src/components/sections/TranslationPanel.tsx +143 -0
  131. package/src/components/sections/checks.ts +64 -0
  132. package/src/layouts/Admin.astro +11 -7
  133. package/src/layouts/Site.astro +136 -21
  134. package/src/lib/agent-discovery.ts +11 -7
  135. package/src/lib/agent.ts +35 -2
  136. package/src/lib/ai-schema.ts +5 -0
  137. package/src/lib/ai.ts +5 -0
  138. package/src/lib/api.ts +12 -0
  139. package/src/lib/backup/content.ts +6 -1
  140. package/src/lib/booking/agent.ts +3 -2
  141. package/src/lib/booking/approval.ts +70 -0
  142. package/src/lib/booking/holds.ts +120 -0
  143. package/src/lib/booking/service.ts +37 -3
  144. package/src/lib/calendar/agent-schema.ts +9 -1
  145. package/src/lib/calendar/agent.ts +16 -1
  146. package/src/lib/calendar/board.ts +171 -0
  147. package/src/lib/calendar/config.ts +3 -0
  148. package/src/lib/calendar/grid.ts +169 -0
  149. package/src/lib/calendar/migration.ts +16 -0
  150. package/src/lib/calendar/render.ts +9 -7
  151. package/src/lib/calendar/schedule.ts +166 -0
  152. package/src/lib/content-service.ts +203 -0
  153. package/src/lib/design-service.ts +153 -5
  154. package/src/lib/drafts.ts +3 -3
  155. package/src/lib/editor/auth.ts +264 -0
  156. package/src/lib/editor/bookings.ts +60 -0
  157. package/src/lib/editor/config.ts +25 -0
  158. package/src/lib/editor/documents.ts +227 -0
  159. package/src/lib/editor/http.ts +48 -0
  160. package/src/lib/editor/me.ts +30 -0
  161. package/src/lib/editor/migration.ts +57 -0
  162. package/src/lib/editor/next.ts +11 -0
  163. package/src/lib/editor/openapi.ts +124 -0
  164. package/src/lib/editor/schemas.ts +91 -0
  165. package/src/lib/editor/sections.ts +96 -0
  166. package/src/lib/editor/store.ts +184 -0
  167. package/src/lib/editor/token-route.ts +74 -0
  168. package/src/lib/editor/translations.ts +163 -0
  169. package/src/lib/email/accounts.ts +2 -1
  170. package/src/lib/email/types.ts +2 -1
  171. package/src/lib/home-source.ts +34 -0
  172. package/src/lib/i18n.ts +34 -0
  173. package/src/lib/import/apply.ts +31 -2
  174. package/src/lib/import/bundle.ts +4 -0
  175. package/src/lib/import/export.ts +1 -0
  176. package/src/lib/import/ghost.ts +1 -0
  177. package/src/lib/media/upload.ts +83 -0
  178. package/src/lib/mobile/associations.ts +25 -0
  179. package/src/lib/mobile/calendar.ts +26 -14
  180. package/src/lib/mobile/config.mjs +59 -0
  181. package/src/lib/mobile/content.ts +18 -13
  182. package/src/lib/mobile/embed.ts +83 -0
  183. package/src/lib/mobile/http.ts +14 -6
  184. package/src/lib/mobile/locale.ts +18 -0
  185. package/src/lib/mobile/openapi.ts +111 -0
  186. package/src/lib/mobile/pages.ts +71 -0
  187. package/src/lib/mobile/route.ts +3 -3
  188. package/src/lib/mobile/schemas.ts +60 -0
  189. package/src/lib/mobile/site.ts +41 -0
  190. package/src/lib/push/api.ts +158 -0
  191. package/src/lib/push/config.ts +20 -0
  192. package/src/lib/push/expo.ts +76 -0
  193. package/src/lib/push/migration.ts +60 -0
  194. package/src/lib/push/service.ts +302 -0
  195. package/src/lib/push/store.ts +144 -0
  196. package/src/lib/push/types.ts +43 -0
  197. package/src/lib/repo/migrations.ts +14 -0
  198. package/src/lib/repo/sql.ts +65 -20
  199. package/src/lib/repo/types.ts +10 -4
  200. package/src/lib/roles.ts +5 -0
  201. package/src/lib/scheduler.ts +6 -1
  202. package/src/lib/schema.ts +76 -1
  203. package/src/lib/section-ai.ts +55 -0
  204. package/src/lib/section-targets.ts +62 -0
  205. package/src/lib/sections-agent.ts +146 -0
  206. package/src/lib/sections.ts +242 -0
  207. package/src/lib/site-chrome.ts +34 -0
  208. package/src/lib/theme-assets.ts +16 -0
  209. package/src/lib/theme.ts +33 -4
  210. package/src/lib/translate.ts +97 -0
  211. package/src/lib/translations.ts +39 -0
  212. package/src/middleware.ts +38 -2
  213. package/src/pages/.well-known/apple-app-site-association.ts +6 -0
  214. package/src/pages/.well-known/assetlinks.json.ts +6 -0
  215. package/src/pages/[...slug].astro +8 -3
  216. package/src/pages/admin/app-auth.astro +159 -0
  217. package/src/pages/admin/c/[collection]/[id].astro +9 -0
  218. package/src/pages/admin/calendar/bookings.astro +32 -26
  219. package/src/pages/admin/calendar/calendars.astro +4 -263
  220. package/src/pages/admin/calendar/events/[id].astro +9 -0
  221. package/src/pages/admin/calendar/events/index.astro +41 -83
  222. package/src/pages/admin/calendar/index.astro +43 -0
  223. package/src/pages/admin/calendar/resources/[id].astro +27 -5
  224. package/src/pages/admin/calendar/resources/index.astro +16 -17
  225. package/src/pages/admin/calendar/resources/link.astro +52 -12
  226. package/src/pages/admin/calendar/settings.astro +458 -0
  227. package/src/pages/admin/integrations.astro +5 -11
  228. package/src/pages/admin/login.astro +6 -2
  229. package/src/pages/admin/logout.ts +5 -2
  230. package/src/pages/admin/mobile.astro +18 -0
  231. package/src/pages/admin/pages/[id].astro +62 -0
  232. package/src/pages/admin/section-preview.astro +61 -0
  233. package/src/pages/admin/users.astro +107 -11
  234. package/src/pages/api/agent/docs.ts +6 -2
  235. package/src/pages/api/agent/index.ts +1 -1
  236. package/src/pages/api/ai/settings.ts +7 -4
  237. package/src/pages/api/design/ai.ts +15 -0
  238. package/src/pages/api/design/index.ts +12 -42
  239. package/src/pages/api/design/translate.ts +15 -0
  240. package/src/pages/api/live/thumb.ts +1 -1
  241. package/src/pages/api/mcp.ts +2 -2
  242. package/src/pages/api/media/upload.ts +10 -78
  243. package/src/pages/api/push/admin.ts +27 -0
  244. package/src/pages/api/v1/admin/bookings/[id]/[action].ts +14 -0
  245. package/src/pages/api/v1/admin/bookings/index.ts +6 -0
  246. package/src/pages/api/v1/admin/documents/[kind]/[id]/[action].ts +17 -0
  247. package/src/pages/api/v1/admin/documents/[kind]/[id]/index.ts +20 -0
  248. package/src/pages/api/v1/admin/documents/[kind]/[id]/translations/[locale]/[action].ts +26 -0
  249. package/src/pages/api/v1/admin/documents/[kind]/[id]/translations/[locale]/index.ts +18 -0
  250. package/src/pages/api/v1/admin/documents/index.ts +13 -0
  251. package/src/pages/api/v1/admin/me.ts +6 -0
  252. package/src/pages/api/v1/admin/media/index.ts +32 -0
  253. package/src/pages/api/v1/admin/sections/[pageId]/[sectionId]/index.ts +14 -0
  254. package/src/pages/api/v1/admin/sections/[pageId]/[sectionId]/publish.ts +14 -0
  255. package/src/pages/api/v1/admin/sections/[pageId]/[sectionId]/translations/[locale]/[action].ts +22 -0
  256. package/src/pages/api/v1/admin/sections/[pageId]/[sectionId]/translations/[locale]/index.ts +14 -0
  257. package/src/pages/api/v1/admin/sections/index.ts +6 -0
  258. package/src/pages/api/v1/auth/revoke.ts +5 -0
  259. package/src/pages/api/v1/auth/token.ts +5 -0
  260. package/src/pages/api/v1/devices/[token].ts +20 -0
  261. package/src/pages/api/v1/devices/index.ts +17 -0
  262. package/src/pages/api/v1/openapi.json.ts +7 -0
  263. package/src/pages/api/v1/pages/[...slug].ts +7 -0
  264. package/src/pages/api/v1/pages/home.ts +7 -0
  265. package/src/pages/api/v1/push/topics.ts +7 -0
  266. package/src/pages/api/v1/site.ts +7 -0
  267. package/src/pages/api/v1/theme.ts +7 -0
  268. package/src/pages/blog/[slug].astro +8 -2
  269. package/src/pages/blog/index.astro +11 -4
  270. package/src/pages/book/[resource].ics.ts +7 -1
  271. package/src/pages/embed/section/[...path].astro +42 -0
  272. package/src/pages/events/[slug].astro +7 -2
  273. package/src/pages/index.astro +11 -5
  274. package/src/pages/sitemap.xml.ts +8 -0
  275. package/src/styles/admin.css +117 -0
  276. package/src/styles/cards.css +5 -1
  277. package/src/styles/editor.css +57 -0
  278. package/src/styles/mobile-app.css +151 -0
  279. package/src/styles/schedule.css +325 -0
  280. package/src/styles/sections.css +21 -12
  281. package/src/styles/theme-editor.css +255 -0
  282. package/src/theme-sdk/contract.d.mts +2193 -89
  283. package/src/theme-sdk/contract.mjs +77 -20
  284. package/src/theme-sdk/fields.d.mts +88 -0
  285. package/src/theme-sdk/fields.mjs +330 -0
  286. package/src/theme-sdk/index.ts +14 -2
  287. package/src/theme-sdk/tokens.d.mts +11 -0
  288. package/src/virtual.d.ts +4 -0
  289. package/src/pages/admin/calendar/index.ts +0 -4
@@ -0,0 +1,106 @@
1
+ {
2
+ "type": "contact",
3
+ "definition": {
4
+ "name": "Visit us",
5
+ "version": 1,
6
+ "component": "sections/Contact.astro",
7
+ "description": "Address, opening hours, phone and email, with a directions link.",
8
+ "variants": [
9
+ "split",
10
+ "stacked"
11
+ ],
12
+ "fields": {
13
+ "heading": {
14
+ "label": "Heading",
15
+ "type": "text",
16
+ "default": "Visit us"
17
+ },
18
+ "address": {
19
+ "label": "Address",
20
+ "type": "textarea",
21
+ "default": "",
22
+ "translatable": false
23
+ },
24
+ "directions": {
25
+ "label": "Directions link",
26
+ "type": "link",
27
+ "help": "A Google or Apple Maps link to the address."
28
+ },
29
+ "hours": {
30
+ "label": "Opening hours",
31
+ "type": "list",
32
+ "itemLabel": "days",
33
+ "max": 14,
34
+ "fields": {
35
+ "days": {
36
+ "label": "Days",
37
+ "type": "text",
38
+ "placeholder": "Mon – Fri"
39
+ },
40
+ "hours": {
41
+ "label": "Hours",
42
+ "type": "text",
43
+ "placeholder": "9:00 – 17:00",
44
+ "translatable": false
45
+ }
46
+ }
47
+ },
48
+ "phone": {
49
+ "label": "Phone",
50
+ "type": "text",
51
+ "default": "",
52
+ "translatable": false
53
+ },
54
+ "email": {
55
+ "label": "Email",
56
+ "type": "text",
57
+ "default": "",
58
+ "translatable": false
59
+ },
60
+ "image": {
61
+ "label": "Photo of the building",
62
+ "type": "image",
63
+ "default": ""
64
+ },
65
+ "alt": {
66
+ "label": "Photo description",
67
+ "type": "text",
68
+ "default": ""
69
+ }
70
+ },
71
+ "category": "Info",
72
+ "example": {
73
+ "address": "120 Elm Street\nSpringfield",
74
+ "directions": {
75
+ "label": "Get directions",
76
+ "href": "https://maps.google.com/?q=120+Elm+Street"
77
+ },
78
+ "hours": [
79
+ {
80
+ "days": "Office · Mon – Thu",
81
+ "hours": "9:00 – 16:00"
82
+ }
83
+ ],
84
+ "phone": "(555) 010-2030",
85
+ "email": "hello@example.org"
86
+ }
87
+ },
88
+ "example": {
89
+ "variant": "split",
90
+ "data": {
91
+ "address": "120 Elm Street\nSpringfield",
92
+ "directions": {
93
+ "label": "Get directions",
94
+ "href": "https://maps.google.com/?q=120+Elm+Street"
95
+ },
96
+ "hours": [
97
+ {
98
+ "days": "Office · Mon – Thu",
99
+ "hours": "9:00 – 16:00"
100
+ }
101
+ ],
102
+ "phone": "(555) 010-2030",
103
+ "email": "hello@example.org"
104
+ }
105
+ }
106
+ }
@@ -0,0 +1,28 @@
1
+ ---
2
+ import type { SectionProps, LinkValue } from '@acms-subir/core/theme';
3
+ interface Data { heading: string; text: string; primary: LinkValue; secondary: LinkValue }
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={['cta', `is-${variant}`]}>
8
+ <div class="cta-copy">
9
+ <h2>{data.heading}</h2>
10
+ {data.text && <p>{data.text}</p>}
11
+ </div>
12
+ {buttons.length > 0 && (
13
+ <div class="cta-actions">
14
+ {buttons.map((b, i) => <a class:list={['w-btn', i === 0 ? 'primary' : 'outline']} href={b.href}>{b.label}</a>)}
15
+ </div>
16
+ )}
17
+ </div>
18
+ <style>
19
+ .cta { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; align-items: center; justify-content: space-between; padding: clamp(1.75rem, 5vw, 3rem); border-radius: var(--r-lg); }
20
+ .cta.is-accent { background: var(--accent); color: var(--btn-ink, #fff); }
21
+ .cta.is-quiet { background: var(--soft); }
22
+ .cta-copy { max-width: 40rem; }
23
+ .cta h2 { margin: 0; }
24
+ .cta p { margin: 0.5rem 0 0; opacity: 0.85; }
25
+ .cta-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
26
+ .cta.is-accent :global(.w-btn.primary) { background: var(--bg); color: var(--ink); }
27
+ .cta.is-accent :global(.w-btn.outline) { background: transparent; color: inherit; border-color: currentColor; }
28
+ </style>
@@ -0,0 +1,51 @@
1
+ {
2
+ "type": "cta-band",
3
+ "definition": {
4
+ "name": "Call-to-action band",
5
+ "version": 1,
6
+ "component": "sections/CtaBand.astro",
7
+ "description": "A bold band that asks people to do one thing.",
8
+ "variants": [
9
+ "accent",
10
+ "quiet"
11
+ ],
12
+ "fields": {
13
+ "heading": {
14
+ "label": "Heading",
15
+ "type": "text",
16
+ "default": "New here?"
17
+ },
18
+ "text": {
19
+ "label": "Text",
20
+ "type": "textarea",
21
+ "default": ""
22
+ },
23
+ "primary": {
24
+ "label": "Main button",
25
+ "type": "link"
26
+ },
27
+ "secondary": {
28
+ "label": "Second button",
29
+ "type": "link"
30
+ }
31
+ },
32
+ "category": "Calls to action",
33
+ "example": {
34
+ "text": "We’d love to meet you. Tell us you’re coming and we’ll save you a seat.",
35
+ "primary": {
36
+ "label": "Plan a visit",
37
+ "href": "/visit"
38
+ }
39
+ }
40
+ },
41
+ "example": {
42
+ "variant": "accent",
43
+ "data": {
44
+ "text": "We’d love to meet you. Tell us you’re coming and we’ll save you a seat.",
45
+ "primary": {
46
+ "label": "Plan a visit",
47
+ "href": "/visit"
48
+ }
49
+ }
50
+ }
51
+ }
@@ -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>