@backgold/template-kit 0.0.0-stage → 0.1.1

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 (349) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +12 -2
  3. package/dist/chunk-RJAVFRC6.js +67 -0
  4. package/dist/constants-BAIo_Q5U.d-lQbj1e1-.d.ts +48 -0
  5. package/dist/content-api-Cox1-wz5.d.ts +1096 -0
  6. package/dist/contract/content-api-examples.d.ts +72 -0
  7. package/dist/contract/content-api-examples.js +926 -0
  8. package/dist/contract/content-api.d.ts +2 -0
  9. package/dist/contract/content-api.js +1 -0
  10. package/dist/contract/site-templates.d.ts +253 -0
  11. package/dist/contract/site-templates.js +185 -0
  12. package/package.json +70 -3
  13. package/src/components/EntryCard.astro +35 -0
  14. package/src/components/EventMap.astro +118 -0
  15. package/src/components/EventPage.astro +194 -0
  16. package/src/components/FieldValue.astro +41 -0
  17. package/src/components/LeadingHero.astro +21 -0
  18. package/src/components/NotFound.astro +20 -0
  19. package/src/components/PageSections.astro +47 -0
  20. package/src/components/Prose.astro +18 -0
  21. package/src/components/chrome/Brand.astro +61 -0
  22. package/src/components/chrome/ClosingCall.astro +94 -0
  23. package/src/components/chrome/DonateStrip.astro +61 -0
  24. package/src/components/chrome/FooterColumns.astro +32 -0
  25. package/src/components/chrome/FooterContact.astro +28 -0
  26. package/src/components/chrome/MenuList.astro +45 -0
  27. package/src/components/chrome/ModeToggle.astro +125 -0
  28. package/src/components/chrome/SignedInNotice.astro +53 -0
  29. package/src/components/chrome/SignupBand.astro +12 -0
  30. package/src/components/chrome/TakeoverBanner.astro +56 -0
  31. package/src/components/chrome/VisitorAccount.astro +82 -0
  32. package/src/components/entries/AuthorBox.astro +47 -0
  33. package/src/components/entries/EntryFields.astro +29 -0
  34. package/src/components/entries/EntryHeader.astro +77 -0
  35. package/src/components/entries/ListFrame.astro +126 -0
  36. package/src/components/entries/ListSearch.astro +24 -0
  37. package/src/components/entries/Share.astro +24 -0
  38. package/src/components/entries/course/classroom.astro +26 -0
  39. package/src/components/entries/course/lesson.astro +18 -0
  40. package/src/components/entries/course/section.ts +20 -0
  41. package/src/components/entries/course/syllabus.astro +15 -0
  42. package/src/components/entries/index.ts +77 -0
  43. package/src/components/entries/newsletter/issue.astro +41 -0
  44. package/src/components/entries/newsletter/list.astro +26 -0
  45. package/src/components/entries/podcast/episode.astro +42 -0
  46. package/src/components/entries/podcast/list.astro +36 -0
  47. package/src/components/entries/post/article.astro +31 -0
  48. package/src/components/entries/post/list.astro +85 -0
  49. package/src/components/entries/props.ts +61 -0
  50. package/src/components/entries/video/cards.astro +39 -0
  51. package/src/components/entries/video/grid.astro +15 -0
  52. package/src/components/entries/video/watch.astro +41 -0
  53. package/src/components/live/LivePage.astro +215 -0
  54. package/src/components/live/LocalTime.astro +29 -0
  55. package/src/components/sections/About/books.astro +188 -0
  56. package/src/components/sections/About/credentials.ts +80 -0
  57. package/src/components/sections/About/index.astro +60 -0
  58. package/src/components/sections/About/left.astro +57 -0
  59. package/src/components/sections/About/letter.astro +111 -0
  60. package/src/components/sections/About/portrait.astro +308 -0
  61. package/src/components/sections/Advocacy/compact.astro +14 -0
  62. package/src/components/sections/Advocacy/index.astro +14 -0
  63. package/src/components/sections/Band.astro +39 -0
  64. package/src/components/sections/Blog/feature.astro +176 -0
  65. package/src/components/sections/Blog/index.astro +37 -0
  66. package/src/components/sections/Blog/latest.ts +80 -0
  67. package/src/components/sections/Blog/list.astro +186 -0
  68. package/src/components/sections/Booking/index.astro +139 -0
  69. package/src/components/sections/Booking/list.astro +144 -0
  70. package/src/components/sections/Booking/types.ts +60 -0
  71. package/src/components/sections/Calendar/agenda.astro +14 -0
  72. package/src/components/sections/Calendar/index.astro +14 -0
  73. package/src/components/sections/CandidateRoster/ballot.astro +394 -0
  74. package/src/components/sections/CandidateRoster/candidates.ts +69 -0
  75. package/src/components/sections/CandidateRoster/compact.astro +115 -0
  76. package/src/components/sections/CandidateRoster/index.astro +57 -0
  77. package/src/components/sections/CaseStudies/beforeafter.astro +222 -0
  78. package/src/components/sections/CaseStudies/cases.ts +111 -0
  79. package/src/components/sections/CaseStudies/grid.astro +261 -0
  80. package/src/components/sections/CaseStudies/index.astro +333 -0
  81. package/src/components/sections/Classroom/CourseCard.astro +181 -0
  82. package/src/components/sections/Classroom/Courses.astro +88 -0
  83. package/src/components/sections/Classroom/classroom.ts +141 -0
  84. package/src/components/sections/Classroom/index.astro +20 -0
  85. package/src/components/sections/Classroom/list.astro +15 -0
  86. package/src/components/sections/Collection/compact.astro +7 -0
  87. package/src/components/sections/Collection/entries.ts +62 -0
  88. package/src/components/sections/Collection/feature.astro +180 -0
  89. package/src/components/sections/Collection/index.astro +46 -0
  90. package/src/components/sections/Collection/library.astro +271 -0
  91. package/src/components/sections/Collection/list.astro +7 -0
  92. package/src/components/sections/Collection/outline.astro +134 -0
  93. package/src/components/sections/Collection/shelves.astro +191 -0
  94. package/src/components/sections/Comparison/Unlisted.astro +6 -0
  95. package/src/components/sections/Comparison/cards.astro +171 -0
  96. package/src/components/sections/Comparison/index.astro +191 -0
  97. package/src/components/sections/Comparison/sides.ts +98 -0
  98. package/src/components/sections/Comparison/spectrum.astro +261 -0
  99. package/src/components/sections/ContentPost/banner.astro +152 -0
  100. package/src/components/sections/ContentPost/index.astro +35 -0
  101. package/src/components/sections/ContentPost/lesson.ts +126 -0
  102. package/src/components/sections/ContentPost/player.astro +254 -0
  103. package/src/components/sections/ContentPost/prose.astro +80 -0
  104. package/src/components/sections/ContentPost/theater.astro +329 -0
  105. package/src/components/sections/Countdown/index.astro +53 -0
  106. package/src/components/sections/Course/Bar.astro +46 -0
  107. package/src/components/sections/Course/CourseHead.astro +123 -0
  108. package/src/components/sections/Course/Crumbs.astro +44 -0
  109. package/src/components/sections/Course/Icon.astro +29 -0
  110. package/src/components/sections/Course/Ring.astro +62 -0
  111. package/src/components/sections/Course/Syllabus.astro +146 -0
  112. package/src/components/sections/Course/course.ts +146 -0
  113. package/src/components/sections/Course/index.astro +143 -0
  114. package/src/components/sections/Course/outline.astro +39 -0
  115. package/src/components/sections/Cta/banner.astro +64 -0
  116. package/src/components/sections/Cta/card.astro +88 -0
  117. package/src/components/sections/Cta/index.astro +31 -0
  118. package/src/components/sections/Cta/photo.astro +114 -0
  119. package/src/components/sections/Cta/strip.astro +91 -0
  120. package/src/components/sections/Donate/index.astro +136 -0
  121. package/src/components/sections/Donate/story.astro +7 -0
  122. package/src/components/sections/Event/card.astro +14 -0
  123. package/src/components/sections/Event/index.astro +14 -0
  124. package/src/components/sections/EventsList/AgendaMonths.astro +105 -0
  125. package/src/components/sections/EventsList/CalendarLine.astro +23 -0
  126. package/src/components/sections/EventsList/EventRows.astro +196 -0
  127. package/src/components/sections/EventsList/LiveCounts.astro +75 -0
  128. package/src/components/sections/EventsList/TypeTabs.astro +53 -0
  129. package/src/components/sections/EventsList/agenda.astro +55 -0
  130. package/src/components/sections/EventsList/calendar.astro +392 -0
  131. package/src/components/sections/EventsList/cards.astro +186 -0
  132. package/src/components/sections/EventsList/cohorts.astro +205 -0
  133. package/src/components/sections/EventsList/compact.astro +163 -0
  134. package/src/components/sections/EventsList/events.ts +168 -0
  135. package/src/components/sections/EventsList/index.astro +46 -0
  136. package/src/components/sections/EventsList/map.astro +436 -0
  137. package/src/components/sections/EventsList/shifts.astro +355 -0
  138. package/src/components/sections/EventsList/week.astro +361 -0
  139. package/src/components/sections/Faq/Contact.astro +63 -0
  140. package/src/components/sections/Faq/Questions.astro +98 -0
  141. package/src/components/sections/Faq/cards.astro +74 -0
  142. package/src/components/sections/Faq/faq.ts +101 -0
  143. package/src/components/sections/Faq/index.astro +49 -0
  144. package/src/components/sections/Faq/topics.astro +178 -0
  145. package/src/components/sections/Financials/Foot.astro +38 -0
  146. package/src/components/sections/Financials/Head.astro +47 -0
  147. package/src/components/sections/Financials/donut.astro +197 -0
  148. package/src/components/sections/Financials/financials.ts +52 -0
  149. package/src/components/sections/Financials/index.astro +148 -0
  150. package/src/components/sections/Financials/table.astro +157 -0
  151. package/src/components/sections/FormBlock/index.astro +33 -0
  152. package/src/components/sections/FormBlock/wide.astro +7 -0
  153. package/src/components/sections/Hero/cover.astro +176 -0
  154. package/src/components/sections/Hero/donate.astro +209 -0
  155. package/src/components/sections/Hero/field.astro +390 -0
  156. package/src/components/sections/Hero/index.astro +52 -0
  157. package/src/components/sections/Hero/overlap.astro +151 -0
  158. package/src/components/sections/Hero/rotating.astro +30 -0
  159. package/src/components/sections/Hero/split.astro +99 -0
  160. package/src/components/sections/Hero/statement.astro +55 -0
  161. package/src/components/sections/Hero/video.astro +399 -0
  162. package/src/components/sections/Issues/checklist.astro +204 -0
  163. package/src/components/sections/Issues/drawer.astro +237 -0
  164. package/src/components/sections/Issues/index.astro +115 -0
  165. package/src/components/sections/Issues/issues.ts +37 -0
  166. package/src/components/sections/Issues/numbered.astro +79 -0
  167. package/src/components/sections/Issues/rows.astro +137 -0
  168. package/src/components/sections/Issues/steps.astro +81 -0
  169. package/src/components/sections/Issues/tabs.astro +322 -0
  170. package/src/components/sections/Leaderboard/index.astro +29 -0
  171. package/src/components/sections/Lesson/Door.astro +121 -0
  172. package/src/components/sections/Lesson/LessonBody.astro +416 -0
  173. package/src/components/sections/Lesson/Rail.astro +182 -0
  174. package/src/components/sections/Lesson/Tracker.astro +137 -0
  175. package/src/components/sections/Lesson/index.astro +27 -0
  176. package/src/components/sections/Lesson/lesson.ts +233 -0
  177. package/src/components/sections/Lesson/reading.astro +21 -0
  178. package/src/components/sections/Map/CoverageLine.astro +19 -0
  179. package/src/components/sections/Map/RegionMap.astro +109 -0
  180. package/src/components/sections/Map/bar.astro +160 -0
  181. package/src/components/sections/Map/index.astro +192 -0
  182. package/src/components/sections/Map/map.astro +275 -0
  183. package/src/components/sections/MediaKit/BioCard.astro +108 -0
  184. package/src/components/sections/MediaKit/Downloads.astro +88 -0
  185. package/src/components/sections/MediaKit/index.astro +183 -0
  186. package/src/components/sections/MediaKit/kit.ts +140 -0
  187. package/src/components/sections/MediaKit/press.astro +189 -0
  188. package/src/components/sections/MediaKit/speaker.astro +205 -0
  189. package/src/components/sections/Membership/Benefits.astro +42 -0
  190. package/src/components/sections/Membership/Check.astro +12 -0
  191. package/src/components/sections/Membership/Price.astro +61 -0
  192. package/src/components/sections/Membership/compare.astro +312 -0
  193. package/src/components/sections/Membership/index.astro +281 -0
  194. package/src/components/sections/Membership/offers.ts +169 -0
  195. package/src/components/sections/Membership/tiers.astro +217 -0
  196. package/src/components/sections/MovementMap/index.astro +50 -0
  197. package/src/components/sections/MovementTicker/index.astro +43 -0
  198. package/src/components/sections/Pathways/Doors.astro +147 -0
  199. package/src/components/sections/Pathways/Head.astro +37 -0
  200. package/src/components/sections/Pathways/index.astro +27 -0
  201. package/src/components/sections/Pathways/pathways.ts +100 -0
  202. package/src/components/sections/Pathways/quiz.astro +286 -0
  203. package/src/components/sections/Pathways/tabs.astro +271 -0
  204. package/src/components/sections/PdfEmbed/card.astro +99 -0
  205. package/src/components/sections/PdfEmbed/index.astro +26 -0
  206. package/src/components/sections/PdfEmbed/medium.astro +7 -0
  207. package/src/components/sections/PdfEmbed/tall.astro +7 -0
  208. package/src/components/sections/Petition/coverage.astro +14 -0
  209. package/src/components/sections/Petition/image.astro +14 -0
  210. package/src/components/sections/Petition/index.astro +14 -0
  211. package/src/components/sections/Petition/map.astro +14 -0
  212. package/src/components/sections/PlatformPlanks/anchors.ts +66 -0
  213. package/src/components/sections/PlatformPlanks/columns.astro +171 -0
  214. package/src/components/sections/PlatformPlanks/index.astro +56 -0
  215. package/src/components/sections/PlatformPlanks/longread.astro +250 -0
  216. package/src/components/sections/PollBlock/index.astro +30 -0
  217. package/src/components/sections/Portfolio/featured.astro +343 -0
  218. package/src/components/sections/Portfolio/index.astro +571 -0
  219. package/src/components/sections/Portfolio/strip.astro +173 -0
  220. package/src/components/sections/Portfolio/work.ts +100 -0
  221. package/src/components/sections/Progress/MatchClock.astro +166 -0
  222. package/src/components/sections/Progress/compact.astro +150 -0
  223. package/src/components/sections/Progress/index.astro +32 -0
  224. package/src/components/sections/Progress/match.astro +126 -0
  225. package/src/components/sections/Progress/ring.astro +179 -0
  226. package/src/components/sections/QuickDonate/DonateCard.astro +149 -0
  227. package/src/components/sections/QuickDonate/Picker.astro +95 -0
  228. package/src/components/sections/QuickDonate/band.astro +164 -0
  229. package/src/components/sections/QuickDonate/bar.astro +208 -0
  230. package/src/components/sections/QuickDonate/donate.ts +126 -0
  231. package/src/components/sections/QuickDonate/hero.astro +143 -0
  232. package/src/components/sections/QuickDonate/index.astro +73 -0
  233. package/src/components/sections/QuickDonate/jar.astro +225 -0
  234. package/src/components/sections/QuickDonate/ladder.astro +248 -0
  235. package/src/components/sections/QuoteStrip/carousel.astro +340 -0
  236. package/src/components/sections/QuoteStrip/index.astro +58 -0
  237. package/src/components/sections/QuoteStrip/logos.astro +226 -0
  238. package/src/components/sections/QuoteStrip/quotes.ts +61 -0
  239. package/src/components/sections/QuoteStrip/single.astro +92 -0
  240. package/src/components/sections/QuoteStrip/ticker.astro +319 -0
  241. package/src/components/sections/QuoteStrip/wall.astro +113 -0
  242. package/src/components/sections/Resources/band.astro +93 -0
  243. package/src/components/sections/Resources/featured.astro +239 -0
  244. package/src/components/sections/Resources/index.astro +225 -0
  245. package/src/components/sections/Resources/resources.ts +92 -0
  246. package/src/components/sections/SampleBallot/Position.astro +39 -0
  247. package/src/components/sections/SampleBallot/ballot.ts +92 -0
  248. package/src/components/sections/SampleBallot/cards.astro +299 -0
  249. package/src/components/sections/SampleBallot/index.astro +326 -0
  250. package/src/components/sections/SampleBallot/measures.astro +172 -0
  251. package/src/components/sections/Scorecard/grades.astro +141 -0
  252. package/src/components/sections/Scorecard/index.astro +294 -0
  253. package/src/components/sections/Scorecard/promise.astro +167 -0
  254. package/src/components/sections/Scorecard/votes.ts +83 -0
  255. package/src/components/sections/SectionHead.astro +31 -0
  256. package/src/components/sections/Services/Button.astro +24 -0
  257. package/src/components/sections/Services/Check.astro +12 -0
  258. package/src/components/sections/Services/Includes.astro +42 -0
  259. package/src/components/sections/Services/compare.astro +328 -0
  260. package/src/components/sections/Services/index.astro +187 -0
  261. package/src/components/sections/Services/list.astro +181 -0
  262. package/src/components/sections/Services/services.ts +80 -0
  263. package/src/components/sections/ShareKit/Actions.astro +71 -0
  264. package/src/components/sections/ShareKit/Buttons.astro +62 -0
  265. package/src/components/sections/ShareKit/compact.astro +123 -0
  266. package/src/components/sections/ShareKit/index.astro +160 -0
  267. package/src/components/sections/ShareKit/share.ts +60 -0
  268. package/src/components/sections/ShareKit/strip.astro +173 -0
  269. package/src/components/sections/SignupCapture/band.astro +7 -0
  270. package/src/components/sections/SignupCapture/index.astro +103 -0
  271. package/src/components/sections/SignupCapture/inline.astro +7 -0
  272. package/src/components/sections/SocialFeed/index.astro +34 -0
  273. package/src/components/sections/StatCards/feature.astro +143 -0
  274. package/src/components/sections/StatCards/index.astro +51 -0
  275. package/src/components/sections/StatCards/ribbon.astro +113 -0
  276. package/src/components/sections/StatCards/wall.astro +177 -0
  277. package/src/components/sections/Store/featured.astro +14 -0
  278. package/src/components/sections/Store/index.astro +14 -0
  279. package/src/components/sections/Stories/Status.astro +42 -0
  280. package/src/components/sections/Stories/StoryCards.astro +171 -0
  281. package/src/components/sections/Stories/cards.astro +42 -0
  282. package/src/components/sections/Stories/index.astro +238 -0
  283. package/src/components/sections/Stories/stories.ts +97 -0
  284. package/src/components/sections/Stories/timeline.astro +135 -0
  285. package/src/components/sections/TeamGrid/board.astro +280 -0
  286. package/src/components/sections/TeamGrid/index.astro +71 -0
  287. package/src/components/sections/TeamGrid/list.astro +306 -0
  288. package/src/components/sections/TeamGrid/people.ts +178 -0
  289. package/src/components/sections/VideoEmbed/index.astro +52 -0
  290. package/src/components/sections/VideoEmbed/landscape.astro +7 -0
  291. package/src/components/sections/VideoEmbed/portrait.astro +7 -0
  292. package/src/components/sections/VideoEmbed/square.astro +7 -0
  293. package/src/components/sections/VoterTools/DaysLeft.astro +33 -0
  294. package/src/components/sections/VoterTools/Lookup.astro +43 -0
  295. package/src/components/sections/VoterTools/dates.astro +153 -0
  296. package/src/components/sections/VoterTools/index.astro +231 -0
  297. package/src/components/sections/VoterTools/polling.astro +144 -0
  298. package/src/components/sections/VoterTools/voter-tools.ts +71 -0
  299. package/src/components/sections/index.ts +373 -0
  300. package/src/components/sections/modules/Headed.astro +39 -0
  301. package/src/components/sections/modules/ModuleFrame.astro +181 -0
  302. package/src/components/store/CollectionPage.astro +40 -0
  303. package/src/components/store/ProductCard.astro +32 -0
  304. package/src/components/store/ProductGrid.astro +16 -0
  305. package/src/components/store/ProductPage.astro +146 -0
  306. package/src/components/store/StorePage.astro +137 -0
  307. package/src/components/store/StoreScript.astro +572 -0
  308. package/src/components/volunteer/ShiftLive.astro +90 -0
  309. package/src/components/volunteer/detail.astro +247 -0
  310. package/src/components/volunteer/list.astro +298 -0
  311. package/src/components/volunteer/props.ts +21 -0
  312. package/src/env.d.ts +22 -0
  313. package/src/index.d.ts +10 -0
  314. package/src/index.js +63 -0
  315. package/src/layouts/Site.astro +387 -0
  316. package/src/lib/academy.ts +146 -0
  317. package/src/lib/brand.ts +534 -0
  318. package/src/lib/chrome.ts +121 -0
  319. package/src/lib/donate-frame.ts +104 -0
  320. package/src/lib/entries.ts +190 -0
  321. package/src/lib/env.ts +34 -0
  322. package/src/lib/event-map-draw.ts +91 -0
  323. package/src/lib/events.ts +476 -0
  324. package/src/lib/fonts.ts +116 -0
  325. package/src/lib/footer.ts +24 -0
  326. package/src/lib/format.ts +160 -0
  327. package/src/lib/geo.ts +131 -0
  328. package/src/lib/live.ts +55 -0
  329. package/src/lib/menu.ts +48 -0
  330. package/src/lib/petition-text.ts +29 -0
  331. package/src/lib/reading.ts +17 -0
  332. package/src/lib/regions.ts +215 -0
  333. package/src/lib/section.ts +105 -0
  334. package/src/lib/shifts.ts +187 -0
  335. package/src/lib/store.ts +521 -0
  336. package/src/lib/stream-time.ts +20 -0
  337. package/src/lib/stream.ts +141 -0
  338. package/src/lib/visitor.ts +54 -0
  339. package/src/routes/catch-all.astro +435 -0
  340. package/src/routes/form.astro +30 -0
  341. package/src/routes/live.astro +49 -0
  342. package/src/routes/not-found.astro +18 -0
  343. package/src/routes/preview.astro +60 -0
  344. package/src/routes/setup.astro +62 -0
  345. package/src/routes/volunteer-shift.astro +61 -0
  346. package/src/styles/entries.css +784 -0
  347. package/src/styles/site.css +1910 -0
  348. package/src/styles/store.css +634 -0
  349. package/src/template.ts +182 -0
@@ -0,0 +1,2 @@
1
+ export { A as Areas, w as CourseDetail, x as CourseLesson, y as CourseProgress, z as CourseSummary, B as EntryLock, L as LessonResponse, D as PRODUCT_ATTR_FILTERS_MAX, F as PRODUCT_ATTR_KEY_PATTERN, G as PRODUCT_ATTR_VALUE_MAX, H as VISITOR_PROGRESS_PATH, I as VISITOR_SIGN_IN_PATH, J as Visitor } from '../content-api-Cox1-wz5.js';
2
+ export { C as ContentAccessLevel } from '../constants-BAIo_Q5U.d-lQbj1e1-.js';
@@ -0,0 +1 @@
1
+ export { PRODUCT_ATTR_FILTERS_MAX, PRODUCT_ATTR_KEY_PATTERN, PRODUCT_ATTR_VALUE_MAX, VISITOR_PROGRESS_PATH, VISITOR_SIGN_IN_PATH } from '../chunk-RJAVFRC6.js';
@@ -0,0 +1,253 @@
1
+ import { z } from 'zod';
2
+ import { S as SiteNavItemType } from '../constants-BAIo_Q5U.d-lQbj1e1-.js';
3
+
4
+ /** A starter menu link's Shows on rule; the pages are starter page slugs. */
5
+ declare const starterShowsOnSchema: z.ZodUnion<readonly [z.ZodObject<{
6
+ rule: z.ZodEnum<{
7
+ every_page: "every_page";
8
+ donation_pages: "donation_pages";
9
+ }>;
10
+ }, z.core.$strip>, z.ZodObject<{
11
+ rule: z.ZodEnum<{
12
+ only_pages: "only_pages";
13
+ except_pages: "except_pages";
14
+ }>;
15
+ pages: z.ZodArray<z.ZodString>;
16
+ }, z.core.$strip>]>;
17
+ interface SiteTemplateMenuItem {
18
+ label: string;
19
+ kind: SiteNavItemType;
20
+ target: {
21
+ slug?: string;
22
+ url?: string;
23
+ anchor?: string;
24
+ type_key?: string;
25
+ entry_slug?: string;
26
+ taxonomy?: string;
27
+ term_slug?: string;
28
+ };
29
+ shows_on: z.infer<typeof starterShowsOnSchema>;
30
+ header_button: boolean;
31
+ children: SiteTemplateMenuItem[];
32
+ }
33
+ declare const siteTemplateManifestSchema: z.ZodObject<{
34
+ key: z.ZodString;
35
+ name: z.ZodString;
36
+ audience: z.ZodString;
37
+ version: z.ZodNumber;
38
+ variants: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
39
+ areas: z.ZodObject<{
40
+ unknown: z.ZodLiteral<"after_page">;
41
+ }, z.core.$catchall<z.ZodString>>;
42
+ entryLayouts: z.ZodRecord<z.ZodEnum<{
43
+ post: "post";
44
+ collection: "collection";
45
+ video: "video";
46
+ course: "course";
47
+ podcast: "podcast";
48
+ plank: "plank";
49
+ team_member: "team_member";
50
+ open_role: "open_role";
51
+ newsletter: "newsletter";
52
+ }> & z.core.$partial, z.ZodObject<{
53
+ entry: z.ZodString;
54
+ list: z.ZodString;
55
+ }, z.core.$strip>>;
56
+ chrome: z.ZodObject<{
57
+ header: z.ZodArray<z.ZodEnum<{
58
+ bar: "bar";
59
+ centered: "centered";
60
+ }>>;
61
+ footer: z.ZodArray<z.ZodEnum<{
62
+ columns: "columns";
63
+ closing: "closing";
64
+ compact: "compact";
65
+ giving: "giving";
66
+ }>>;
67
+ takeoverBanner: z.ZodBoolean;
68
+ legalLine: z.ZodBoolean;
69
+ }, z.core.$strip>;
70
+ starter: z.ZodObject<{
71
+ pages: z.ZodArray<z.ZodObject<{
72
+ slug: z.ZodString;
73
+ title: z.ZodString;
74
+ sections: z.ZodArray<z.ZodObject<{
75
+ id: z.ZodString;
76
+ type: z.ZodString;
77
+ band: z.ZodEnum<{
78
+ plain: "plain";
79
+ tint: "tint";
80
+ panel: "panel";
81
+ wash: "wash";
82
+ contrast: "contrast";
83
+ }>;
84
+ bleed: z.ZodEnum<{
85
+ full: "full";
86
+ contained: "contained";
87
+ }>;
88
+ variant: z.ZodNullable<z.ZodString>;
89
+ copy: z.ZodRecord<z.ZodString, z.ZodString>;
90
+ media: z.ZodRecord<z.ZodString, z.ZodObject<{
91
+ url: z.ZodString;
92
+ alt: z.ZodOptional<z.ZodString>;
93
+ }, z.core.$strip>>;
94
+ links: z.ZodArray<z.ZodObject<{
95
+ label: z.ZodString;
96
+ target: z.ZodObject<{
97
+ kind: z.ZodEnum<{
98
+ page: "page";
99
+ section: "section";
100
+ external: "external";
101
+ surface: "surface";
102
+ }>;
103
+ slug: z.ZodOptional<z.ZodString>;
104
+ anchor: z.ZodOptional<z.ZodString>;
105
+ url: z.ZodOptional<z.ZodString>;
106
+ path: z.ZodOptional<z.ZodString>;
107
+ }, z.core.$strip>;
108
+ url: z.ZodString;
109
+ style: z.ZodOptional<z.ZodString>;
110
+ }, z.core.$strip>>;
111
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
112
+ data: z.ZodOptional<z.ZodObject<{
113
+ source: z.ZodEnum<{
114
+ issues: "issues";
115
+ petition: "petition";
116
+ dates: "dates";
117
+ platform: "platform";
118
+ work: "work";
119
+ ladder: "ladder";
120
+ ballot: "ballot";
121
+ words: "words";
122
+ credentials: "credentials";
123
+ stats: "stats";
124
+ quotes: "quotes";
125
+ votes: "votes";
126
+ faq: "faq";
127
+ comparison: "comparison";
128
+ stories: "stories";
129
+ share: "share";
130
+ financials: "financials";
131
+ services: "services";
132
+ cases: "cases";
133
+ resources: "resources";
134
+ pathways: "pathways";
135
+ mediakit: "mediakit";
136
+ }>;
137
+ items: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
138
+ }, z.core.$strip>>;
139
+ }, z.core.$strip>>;
140
+ }, z.core.$strip>>;
141
+ menus: z.ZodObject<{
142
+ primary: z.ZodArray<z.ZodType<SiteTemplateMenuItem, unknown, z.core.$ZodTypeInternals<SiteTemplateMenuItem, unknown>>>;
143
+ footer: z.ZodArray<z.ZodType<SiteTemplateMenuItem, unknown, z.core.$ZodTypeInternals<SiteTemplateMenuItem, unknown>>>;
144
+ }, z.core.$strip>;
145
+ sections: z.ZodArray<z.ZodObject<{
146
+ key: z.ZodString;
147
+ label: z.ZodString;
148
+ kind: z.ZodEnum<{
149
+ sidebar: "sidebar";
150
+ custom: "custom";
151
+ announcement: "announcement";
152
+ pre_footer: "pre_footer";
153
+ }>;
154
+ document: z.ZodArray<z.ZodObject<{
155
+ id: z.ZodString;
156
+ type: z.ZodString;
157
+ band: z.ZodEnum<{
158
+ plain: "plain";
159
+ tint: "tint";
160
+ panel: "panel";
161
+ wash: "wash";
162
+ contrast: "contrast";
163
+ }>;
164
+ bleed: z.ZodEnum<{
165
+ full: "full";
166
+ contained: "contained";
167
+ }>;
168
+ variant: z.ZodNullable<z.ZodString>;
169
+ copy: z.ZodRecord<z.ZodString, z.ZodString>;
170
+ media: z.ZodRecord<z.ZodString, z.ZodObject<{
171
+ url: z.ZodString;
172
+ alt: z.ZodOptional<z.ZodString>;
173
+ }, z.core.$strip>>;
174
+ links: z.ZodArray<z.ZodObject<{
175
+ label: z.ZodString;
176
+ target: z.ZodObject<{
177
+ kind: z.ZodEnum<{
178
+ page: "page";
179
+ section: "section";
180
+ external: "external";
181
+ surface: "surface";
182
+ }>;
183
+ slug: z.ZodOptional<z.ZodString>;
184
+ anchor: z.ZodOptional<z.ZodString>;
185
+ url: z.ZodOptional<z.ZodString>;
186
+ path: z.ZodOptional<z.ZodString>;
187
+ }, z.core.$strip>;
188
+ url: z.ZodString;
189
+ style: z.ZodOptional<z.ZodString>;
190
+ }, z.core.$strip>>;
191
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
192
+ data: z.ZodOptional<z.ZodObject<{
193
+ source: z.ZodEnum<{
194
+ issues: "issues";
195
+ petition: "petition";
196
+ dates: "dates";
197
+ platform: "platform";
198
+ work: "work";
199
+ ladder: "ladder";
200
+ ballot: "ballot";
201
+ words: "words";
202
+ credentials: "credentials";
203
+ stats: "stats";
204
+ quotes: "quotes";
205
+ votes: "votes";
206
+ faq: "faq";
207
+ comparison: "comparison";
208
+ stories: "stories";
209
+ share: "share";
210
+ financials: "financials";
211
+ services: "services";
212
+ cases: "cases";
213
+ resources: "resources";
214
+ pathways: "pathways";
215
+ mediakit: "mediakit";
216
+ }>;
217
+ items: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
218
+ }, z.core.$strip>>;
219
+ }, z.core.$strip>>;
220
+ rules: z.ZodArray<z.ZodObject<{
221
+ area_key: z.ZodString;
222
+ shows_on: z.ZodEnum<{
223
+ events: "events";
224
+ store: "store";
225
+ every_page: "every_page";
226
+ pages: "pages";
227
+ entries: "entries";
228
+ every_page_except: "every_page_except";
229
+ pages_holding: "pages_holding";
230
+ entry_types: "entry_types";
231
+ type_lists: "type_lists";
232
+ }>;
233
+ pages: z.ZodOptional<z.ZodArray<z.ZodString>>;
234
+ content_types: z.ZodOptional<z.ZodArray<z.ZodString>>;
235
+ modules: z.ZodOptional<z.ZodArray<z.ZodObject<{
236
+ kind: z.ZodEnum<{
237
+ store: "store";
238
+ petition: "petition";
239
+ form: "form";
240
+ poll: "poll";
241
+ event: "event";
242
+ signup: "signup";
243
+ donation_form: "donation_form";
244
+ advocacy: "advocacy";
245
+ }>;
246
+ }, z.core.$strip>>>;
247
+ }, z.core.$strip>>;
248
+ }, z.core.$strip>>;
249
+ }, z.core.$strip>;
250
+ }, z.core.$strip>;
251
+ type SiteTemplateManifest = z.infer<typeof siteTemplateManifestSchema>;
252
+
253
+ export { type SiteTemplateManifest, siteTemplateManifestSchema };
@@ -0,0 +1,185 @@
1
+ import { SITE_AREA_KEY_RE, SECTION_BLEEDS, SECTION_BANDS, SITE_NAV_SHOWS_ON, SITE_NAV_ITEM_TYPES, SITE_PAGE_MODULE_KINDS, SITE_SECTION_RULE_SHOWS_ON, SITE_SECTION_KINDS, SITE_CHROME_LAYOUTS, BUILT_IN_CONTENT_TYPE_KEYS, TEMPLATE_KEY_PATTERN } from '../chunk-RJAVFRC6.js';
2
+ import { z } from 'zod';
3
+
4
+ var name = z.string().trim().min(1).max(120);
5
+ var layoutName = z.string().regex(/^[a-z][a-z0-9_]{0,39}$/);
6
+ var slug = z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$|^$/, "a page slug (lower case, words joined by -; empty for home)");
7
+ var areaKey = z.string().regex(SITE_AREA_KEY_RE);
8
+ var SITE_TEMPLATE_AUTHORED_DATA_SOURCES = [
9
+ "issues",
10
+ "stats",
11
+ "quotes",
12
+ "platform",
13
+ "dates",
14
+ "ballot",
15
+ "votes",
16
+ "faq",
17
+ "comparison",
18
+ "stories",
19
+ "services",
20
+ "cases",
21
+ "resources",
22
+ "pathways",
23
+ "work",
24
+ "mediakit",
25
+ "credentials",
26
+ // Sections batch 3 (2026-10-14): the Hero's rotating words, QuickDonate's
27
+ // impact ladder, ShareKit's posts and Financials' figures.
28
+ "words",
29
+ "ladder",
30
+ "share",
31
+ "financials",
32
+ // The petition-drive template (2026-10-15): the asks and the typed stat tiles.
33
+ "petition"
34
+ ];
35
+ var SITE_TEMPLATE_AUTHORED_DATA = {
36
+ Issues: "issues",
37
+ StatCards: "stats",
38
+ QuoteStrip: "quotes",
39
+ PlatformPlanks: "platform",
40
+ VoterTools: "dates",
41
+ SampleBallot: "ballot",
42
+ Scorecard: "votes",
43
+ Faq: "faq",
44
+ Comparison: "comparison",
45
+ Stories: "stories",
46
+ Services: "services",
47
+ CaseStudies: "cases",
48
+ Resources: "resources",
49
+ Pathways: "pathways",
50
+ Portfolio: "work",
51
+ MediaKit: "mediakit",
52
+ About: "credentials",
53
+ Hero: "words",
54
+ QuickDonate: "ladder",
55
+ ShareKit: "share",
56
+ Financials: "financials",
57
+ Petition: "petition"
58
+ };
59
+ var starterSectionSchema = z.object({
60
+ id: z.string().min(1).max(64),
61
+ type: z.string().regex(/^[A-Z][A-Za-z]{0,39}$/),
62
+ band: z.enum(SECTION_BANDS),
63
+ bleed: z.enum(SECTION_BLEEDS),
64
+ variant: layoutName.nullable(),
65
+ copy: z.record(z.string(), z.string()),
66
+ media: z.record(z.string(), z.object({ url: z.string(), alt: z.string().optional() })),
67
+ links: z.array(
68
+ z.object({
69
+ label: z.string(),
70
+ target: z.object({
71
+ kind: z.enum(["page", "section", "external", "surface"]),
72
+ slug: z.string().optional(),
73
+ anchor: z.string().optional(),
74
+ url: z.string().optional(),
75
+ path: z.string().optional()
76
+ }),
77
+ url: z.string(),
78
+ style: z.string().optional()
79
+ })
80
+ ),
81
+ options: z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])).optional(),
82
+ data: z.object({
83
+ source: z.enum(SITE_TEMPLATE_AUTHORED_DATA_SOURCES),
84
+ items: z.array(z.record(z.string(), z.unknown())).min(1).max(20)
85
+ }).optional()
86
+ }).superRefine((section, ctx) => {
87
+ if (!section.data) return;
88
+ const own = Object.hasOwn(SITE_TEMPLATE_AUTHORED_DATA, section.type) ? SITE_TEMPLATE_AUTHORED_DATA[section.type] : void 0;
89
+ if (section.data.source !== own) {
90
+ ctx.addIssue({
91
+ code: "custom",
92
+ path: ["data", "source"],
93
+ message: own ? `a ${section.type} section's rows are '${own}'` : `a ${section.type} section's rows are BackGold's to fill, never starter content`
94
+ });
95
+ }
96
+ });
97
+ var starterPageSchema = z.object({
98
+ slug,
99
+ title: name,
100
+ sections: z.array(starterSectionSchema)
101
+ });
102
+ var starterShowsOnSchema = z.union([
103
+ z.object({ rule: z.enum(SITE_NAV_SHOWS_ON).extract(["every_page", "donation_pages"]) }),
104
+ z.object({ rule: z.enum(SITE_NAV_SHOWS_ON).extract(["only_pages", "except_pages"]), pages: z.array(slug).min(1) })
105
+ ]);
106
+ var starterMenuItemSchema = z.lazy(
107
+ () => z.object({
108
+ label: name,
109
+ kind: z.enum(SITE_NAV_ITEM_TYPES),
110
+ target: z.object({
111
+ slug: slug.optional(),
112
+ url: z.string().optional(),
113
+ anchor: z.string().optional(),
114
+ type_key: z.string().optional(),
115
+ entry_slug: z.string().optional(),
116
+ taxonomy: z.string().optional(),
117
+ term_slug: z.string().optional()
118
+ }),
119
+ shows_on: starterShowsOnSchema,
120
+ header_button: z.boolean(),
121
+ children: z.array(starterMenuItemSchema)
122
+ })
123
+ );
124
+ var starterRuleSchema = z.object({
125
+ area_key: areaKey,
126
+ shows_on: z.enum(SITE_SECTION_RULE_SHOWS_ON),
127
+ pages: z.array(slug).optional(),
128
+ content_types: z.array(z.string()).optional(),
129
+ modules: z.array(z.object({ kind: z.enum(SITE_PAGE_MODULE_KINDS) })).optional()
130
+ });
131
+ var starterReusableSectionSchema = z.object({
132
+ key: z.string().regex(/^[a-z][a-z0-9-]{0,63}$/),
133
+ label: name,
134
+ kind: z.enum(SITE_SECTION_KINDS),
135
+ document: z.array(starterSectionSchema),
136
+ rules: z.array(starterRuleSchema)
137
+ });
138
+ var entryLayoutSchema = z.object({ entry: layoutName, list: layoutName });
139
+ var siteTemplateManifestSchema = z.object({
140
+ /**
141
+ * The template's key, by shape: a template is written in the sites
142
+ * repository before the platform registers it, so the schema cannot know
143
+ * the registry. The platform's own copies are held to SITE_TEMPLATE_KEYS by
144
+ * site-template-manifests.ts, which refuses a copy whose key is not the one
145
+ * it was filed under.
146
+ */
147
+ key: z.string().regex(TEMPLATE_KEY_PATTERN),
148
+ name,
149
+ audience: z.string().regex(/^[a-z][a-z_]{0,39}$/),
150
+ version: z.number().int().min(1),
151
+ /** Section type → the layouts the template draws, the default first. */
152
+ variants: z.record(z.string(), z.array(layoutName).min(1)),
153
+ /**
154
+ * Area key → where the layout places it, in words. `unknown` is what the
155
+ * template does with an area it does not name: `after_page` draws it after
156
+ * the page, full width, in the order the site lists its areas.
157
+ */
158
+ areas: z.object({ unknown: z.literal("after_page") }).catchall(name).superRefine((areas, ctx) => {
159
+ for (const key of Object.keys(areas)) {
160
+ if (!areaKey.safeParse(key).success) ctx.addIssue({ code: "custom", path: [key], message: "not an area key" });
161
+ }
162
+ }),
163
+ /** Routable built-in content type key → its entry layout and its list layout. */
164
+ entryLayouts: z.partialRecord(z.enum(BUILT_IN_CONTENT_TYPE_KEYS), entryLayoutSchema),
165
+ /**
166
+ * The site parts the template draws around every page: the header and
167
+ * footer layouts it draws (SITE_CHROME_LAYOUTS, its default first; the
168
+ * site's choice is `/site`'s `chrome`), the takeover banner and the legal
169
+ * line.
170
+ */
171
+ chrome: z.object({
172
+ header: z.array(z.enum(SITE_CHROME_LAYOUTS.header)).min(1),
173
+ footer: z.array(z.enum(SITE_CHROME_LAYOUTS.footer)).min(1),
174
+ takeoverBanner: z.boolean(),
175
+ legalLine: z.boolean()
176
+ }),
177
+ starter: z.object({
178
+ pages: z.array(starterPageSchema),
179
+ menus: z.object({ primary: z.array(starterMenuItemSchema), footer: z.array(starterMenuItemSchema) }),
180
+ sections: z.array(starterReusableSectionSchema)
181
+ })
182
+ });
183
+ siteTemplateManifestSchema.omit({ audience: true });
184
+
185
+ export { siteTemplateManifestSchema };
package/package.json CHANGED
@@ -1,6 +1,73 @@
1
1
  {
2
2
  "name": "@backgold/template-kit",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.1",
4
+ "license": "MIT",
5
+ "description": "What every BackGold Astro template draws the same way: the section, entry and chrome components, the Site layout, the routes, lib and the stylesheets, shipped as source, with the Content API contract names they use.",
6
+ "type": "module",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./src/index.d.ts",
10
+ "import": "./src/index.js"
11
+ },
12
+ "./template": "./src/template.ts",
13
+ "./contract/*": {
14
+ "types": "./dist/contract/*.d.ts",
15
+ "import": "./dist/contract/*.js"
16
+ },
17
+ "./routes/*": "./src/routes/*",
18
+ "./layouts/*": "./src/layouts/*",
19
+ "./components/*": "./src/components/*",
20
+ "./lib/*": "./src/lib/*.ts",
21
+ "./styles/*": "./src/styles/*"
22
+ },
23
+ "imports": {
24
+ "#contract/*": {
25
+ "types": "./dist/contract/*.d.ts",
26
+ "import": "./dist/contract/*.js"
27
+ }
28
+ },
29
+ "files": [
30
+ "src",
31
+ "!src/contract",
32
+ "dist",
33
+ "README.md"
34
+ ],
35
+ "dependencies": {
36
+ "maplibre-gl": "^6.14.0",
37
+ "zod": "^4.6.7"
38
+ },
39
+ "peerDependencies": {
40
+ "astro": "^7",
41
+ "@backgold/astro": "^0.4.3",
42
+ "@backgold/content": "^0.7.0"
43
+ },
44
+ "devDependencies": {
45
+ "@astrojs/check": "^0.9.10",
46
+ "astro": "^7.3.5",
47
+ "typescript": "^6.0.3",
48
+ "tsup": "^8.5.1",
49
+ "@backgold/astro": "^0.4.3",
50
+ "@backgold/content": "^0.7.0",
51
+ "@backgold/contract": "0.0.0"
52
+ },
53
+ "engines": {
54
+ "node": ">= 22.12"
55
+ },
56
+ "repository": {
57
+ "type": "git",
58
+ "url": "git+https://github.com/BackGoldHQ/sites.git",
59
+ "directory": "packages/template-kit"
60
+ },
61
+ "keywords": [
62
+ "backgold",
63
+ "astro",
64
+ "astro-integration",
65
+ "withastro",
66
+ "cloudflare-workers",
67
+ "template"
68
+ ],
69
+ "scripts": {
70
+ "build": "tsup",
71
+ "lint": "astro check && tsc --noEmit"
72
+ }
6
73
  }
@@ -0,0 +1,35 @@
1
+ ---
2
+ // One entry in a list: indexes, term pages, the Blog and Collection sections.
3
+ // A raised card (boards A1 and C1): the cover, the entry's category as a
4
+ // chip, its title, its summary, and its line under them: the card's `meta`
5
+ // (what the section that made it says there) and the day it was published.
6
+ import type { Card } from '../lib/section'
7
+ import { formatShortDay } from '../lib/format'
8
+
9
+ interface Props {
10
+ card: Card
11
+ /** The card title's level: 2 on an index page (under its h1), 3 inside a section (under its h2). */
12
+ level?: 2 | 3
13
+ }
14
+
15
+ const { card, level = 2 } = Astro.props
16
+ const Heading = level === 2 ? 'h2' : 'h3'
17
+ const day = formatShortDay(card.date)
18
+ ---
19
+ <article class="card">
20
+ {card.image && <img class="card-image" src={card.image.url} alt={card.image.alt} loading="lazy" decoding="async" />}
21
+ <div class="card-body">
22
+ {card.category && <p class="card-chips"><span class="chip chip-wash">{card.category}</span></p>}
23
+ <Heading class="card-title">
24
+ {card.href ? <a href={card.href}>{card.title}</a> : card.title}
25
+ </Heading>
26
+ {card.summary && <p class="card-summary">{card.summary}</p>}
27
+ {(card.meta || day) && (
28
+ <p class="card-meta">
29
+ {card.meta}
30
+ {card.meta && day && ' · '}
31
+ {day && card.date && <time datetime={card.date}>{day}</time>}
32
+ </p>
33
+ )}
34
+ </div>
35
+ </article>
@@ -0,0 +1,118 @@
1
+ ---
2
+ // An event's map on its page (board C6), the main column's full width: the
3
+ // kit's own, drawn in the browser by MapLibre GL over OpenFreeMap's tiles
4
+ // (src/lib/event-map-draw.ts: the venue's pin in the brand's accent, page
5
+ // scrolling never caught, the OpenStreetMap credit folding to ⓘ). MapLibre
6
+ // loads only when the map comes near the screen, so the page above it costs
7
+ // nothing. Until it draws (with scripts off, without WebGL, before it loads)
8
+ // the frame shows the place and a link to it on OpenStreetMap.
9
+ interface Props {
10
+ lat: number
11
+ lng: number
12
+ /** The place as the page names it: the venue, else the location. */
13
+ place: string | null
14
+ /** The venue's street address, or null. */
15
+ address: string | null
16
+ /** What the event is, for the map's name when it has no place. */
17
+ title: string
18
+ }
19
+
20
+ const { lat, lng, place, address, title } = Astro.props
21
+ const label = `Map: ${place ?? title}`
22
+ const at = `${lat.toFixed(5)}/${lng.toFixed(5)}`
23
+ const osm = `https://www.openstreetmap.org/?mlat=${lat.toFixed(5)}&mlon=${lng.toFixed(5)}#map=17/${at}`
24
+ ---
25
+ <div class="event-map" role="region" aria-label={label} data-event-map data-lat={lat} data-lng={lng} data-label={label}>
26
+ <div class="event-map-canvas" data-event-map-canvas></div>
27
+ <div class="event-map-fallback" data-event-map-fallback>
28
+ <svg viewBox="0 0 32 42" aria-hidden="true"><path d="M16 41s14-13.2 14-24.5A14 14 0 0 0 2 16.5C2 27.8 16 41 16 41z" /><circle cx="16" cy="16.5" r="5.5" /></svg>
29
+ {(place || address) && <p>{[place, address].filter(Boolean).join(', ')}</p>}
30
+ <a class="text-link" href={osm} rel="noopener">Open in OpenStreetMap</a>
31
+ </div>
32
+ </div>
33
+
34
+ <script>
35
+ // Load the map's code when it is within a screen of view; once per map.
36
+ const maps = document.querySelectorAll<HTMLElement>('[data-event-map]')
37
+ const draw = (figure: HTMLElement) =>
38
+ import('../lib/event-map-draw')
39
+ .then((m) => m.drawEventMap(figure))
40
+ .catch(() => {})
41
+ if (maps.length > 0 && 'IntersectionObserver' in window) {
42
+ const near = new IntersectionObserver(
43
+ (entries) => {
44
+ for (const entry of entries) {
45
+ if (!entry.isIntersecting) continue
46
+ near.unobserve(entry.target)
47
+ draw(entry.target as HTMLElement)
48
+ }
49
+ },
50
+ { rootMargin: '100% 0px' },
51
+ )
52
+ maps.forEach((figure) => near.observe(figure))
53
+ } else {
54
+ maps.forEach(draw)
55
+ }
56
+ </script>
57
+
58
+ <style>
59
+ .event-map {
60
+ position: relative;
61
+ overflow: hidden;
62
+ aspect-ratio: 3 / 2;
63
+ margin-top: 1.625rem;
64
+ border: 1px solid var(--line);
65
+ border-radius: var(--radius-card);
66
+ /* C6's ground under the map: the band's tint, ruled in a faint grid. */
67
+ background:
68
+ repeating-linear-gradient(0deg, transparent 0 38px, var(--line) 38px 39px),
69
+ repeating-linear-gradient(90deg, transparent 0 38px, var(--line) 38px 39px),
70
+ var(--band-tint);
71
+ }
72
+ .event-map-canvas {
73
+ position: absolute;
74
+ inset: 0;
75
+ }
76
+ .event-map-fallback {
77
+ position: absolute;
78
+ inset: 0;
79
+ display: grid;
80
+ place-content: center;
81
+ justify-items: center;
82
+ gap: 0.375rem;
83
+ padding: 1rem;
84
+ text-align: center;
85
+ }
86
+ .event-map-fallback[hidden] {
87
+ display: none;
88
+ }
89
+ .event-map-fallback svg,
90
+ .event-map :global(.event-map-pin svg) {
91
+ display: block;
92
+ width: 2rem;
93
+ height: 2.625rem;
94
+ fill: var(--bg-brand-accent, var(--accent));
95
+ stroke: color-mix(in srgb, var(--bg-brand-accent, var(--accent)) 55%, #000);
96
+ stroke-width: 1.25;
97
+ }
98
+ .event-map :global(.event-map-pin circle) {
99
+ fill: #fff;
100
+ stroke: none;
101
+ }
102
+ .event-map-fallback circle {
103
+ fill: #fff;
104
+ stroke: none;
105
+ }
106
+ .event-map-fallback p {
107
+ margin: 0;
108
+ font-weight: 700;
109
+ }
110
+ .event-map-fallback a {
111
+ font-size: var(--text-sm);
112
+ }
113
+ @media (min-width: 40rem) {
114
+ .event-map {
115
+ aspect-ratio: 2 / 1;
116
+ }
117
+ }
118
+ </style>