@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,205 @@
1
+ ---
2
+ // EventsList · Cohorts (board 03, B, "Cohort picker"): the section head (the
3
+ // kicker, the heading, "Choose a start date" as the operator words it, and
4
+ // the "All events" link), then a card per event on the band's surface,
5
+ // three across on a wide screen, two on a tablet and one on a phone. Each
6
+ // card leads with its start: "Starts" in small capitals over the day large
7
+ // in the display face ("Oct 15", and the year under it when the events
8
+ // span more than one), all in the event's own time zone. Then the title
9
+ // (linking to the event's page on this site), the weekday, time and place,
10
+ // the type as a chip, the live counts ("12 going · 9 seats left", filled in
11
+ // by LiveCounts after the page loads; empty without scripts), and the
12
+ // card's one button to the event's page, which frames BackGold's RSVP and
13
+ // tickets: "RSVP", "Get tickets" when the event sells tickets. An event
14
+ // that has stopped taking registrations says "Registration closed", its
15
+ // start in the muted ink, and its button reads "Details" in the outline.
16
+ // Every card has its button, whatever `options.actions` says; `options.max`
17
+ // caps the cards. No card is "selected": the choice is made on the event's
18
+ // page.
19
+ //
20
+ // With no events the head stands over the section's empty-events line ("No
21
+ // upcoming events right now." when it has none); with neither events nor a
22
+ // heading nothing is drawn.
23
+ import type { ComponentProps } from 'astro/types'
24
+ import type Default from './index.astro'
25
+ import Band from '../Band.astro'
26
+ import LiveCounts from './LiveCounts.astro'
27
+ import SectionHead from '../SectionHead.astro'
28
+ import { eventsOf } from './events'
29
+ import { links } from '../../../lib/section'
30
+ import { text } from '../../../lib/format'
31
+
32
+ type Props = ComponentProps<typeof Default>
33
+
34
+ const { section } = Astro.props
35
+ const heading = text(section.copy.heading)
36
+ const invitation = text(section.copy.eventsEmptyCta)
37
+ const events = eventsOf(section)
38
+ const years = new Set(events.map((e) => e.when?.year).filter((y): y is number => y !== undefined))
39
+ const showYear = years.size > 1
40
+ ---
41
+ {(heading || events.length > 0) && (
42
+ <Band section={section} class="events events-cohorts">
43
+ <SectionHead kicker={text(section.copy.kicker)} heading={heading} more={links(section)} />
44
+ {events.length > 0 ? (
45
+ <ul class="co-cards" role="list">
46
+ {events.map((event) => (
47
+ <li class:list={['co-card', event.closed && 'co-card-closed']}>
48
+ {event.when && event.startsAt && (
49
+ <p class="co-start">
50
+ <span class="co-starts" aria-hidden="true">Starts</span>
51
+ <time class="co-day" datetime={event.startsAt}>
52
+ <span aria-hidden="true">{event.when.monthShort} {event.when.day}</span>
53
+ <span class="visually-hidden">Starts {event.when.full}</span>
54
+ </time>
55
+ {showYear && <span class="co-year" aria-hidden="true">{event.when.year}</span>}
56
+ </p>
57
+ )}
58
+ <h3 class="co-title">{event.link ? <a href={event.link.href} rel={event.link.rel}>{event.title}</a> : event.title}</h3>
59
+ {(event.when?.time || event.place) && (
60
+ <p class="co-meta">{[event.when?.weekday && event.when.time ? `${event.when.weekday} ${event.when.time}` : event.when?.time, event.place].filter(Boolean).join(' · ')}</p>
61
+ )}
62
+ {(event.type || event.id || event.closed) && (
63
+ <p class="co-facts">
64
+ {event.type && <span class="chip chip-wash">{event.type}</span>}
65
+ {event.id && <span class="co-live" data-bg-live={event.id}></span>}
66
+ {event.closed && <span class="co-closed">Registration closed</span>}
67
+ </p>
68
+ )}
69
+ {event.action && (
70
+ <p class="co-action">
71
+ <a class:list={['button', 'button-small', event.closed ? 'button-quiet' : 'button-2']} href={event.action.href} rel={event.action.rel}>
72
+ {event.action.label}<span class="visually-hidden">: {event.title}</span>
73
+ </a>
74
+ </p>
75
+ )}
76
+ </li>
77
+ ))}
78
+ </ul>
79
+ ) : (
80
+ <p class="co-empty">{invitation ?? 'No upcoming events right now.'}</p>
81
+ )}
82
+ <LiveCounts />
83
+ </Band>
84
+ )}
85
+
86
+ <style>
87
+ .co-cards {
88
+ display: grid;
89
+ grid-template-columns: minmax(0, 1fr);
90
+ gap: 1rem;
91
+ margin: 0;
92
+ padding: 0;
93
+ list-style: none;
94
+ }
95
+ .co-card {
96
+ display: flex;
97
+ flex-direction: column;
98
+ gap: 0.5rem;
99
+ min-width: 0;
100
+ padding: 1.375rem 1.375rem 1.25rem;
101
+ border: 1px solid var(--line);
102
+ border-radius: var(--radius-card);
103
+ background: var(--surface);
104
+ }
105
+ .co-card > * {
106
+ margin: 0;
107
+ }
108
+ .co-start {
109
+ display: grid;
110
+ justify-items: start;
111
+ margin-bottom: 0.25rem;
112
+ line-height: 1;
113
+ }
114
+ .co-starts {
115
+ margin-bottom: 0.375rem;
116
+ color: var(--muted);
117
+ font-size: var(--text-xs);
118
+ font-weight: 700;
119
+ letter-spacing: 0.14em;
120
+ line-height: 1.3;
121
+ text-transform: uppercase;
122
+ }
123
+ .co-day {
124
+ font-family: var(--font-display);
125
+ font-size: clamp(2.25rem, 1.9rem + 1.2vw, 2.75rem);
126
+ font-weight: 800;
127
+ line-height: 1;
128
+ letter-spacing: -0.025em;
129
+ }
130
+ .co-year {
131
+ margin-top: 0.25rem;
132
+ color: var(--muted);
133
+ font-size: var(--text-sm);
134
+ font-weight: 700;
135
+ }
136
+ .co-card-closed .co-day {
137
+ color: var(--muted);
138
+ }
139
+ .co-card .co-title {
140
+ font-family: var(--font-display);
141
+ font-size: var(--text-lg);
142
+ font-weight: 700;
143
+ line-height: 1.25;
144
+ letter-spacing: -0.01em;
145
+ }
146
+ .co-title a {
147
+ color: var(--ink);
148
+ text-decoration: none;
149
+ }
150
+ .co-title a:hover {
151
+ text-decoration: underline;
152
+ }
153
+ .co-meta {
154
+ color: var(--muted);
155
+ font-size: var(--text-sm);
156
+ line-height: 1.45;
157
+ }
158
+ .co-facts {
159
+ display: flex;
160
+ flex-wrap: wrap;
161
+ align-items: center;
162
+ gap: 0.375rem 0.75rem;
163
+ font-size: var(--text-sm);
164
+ }
165
+ .co-live {
166
+ color: var(--ink);
167
+ font-weight: 700;
168
+ }
169
+ .co-live:empty {
170
+ display: none;
171
+ }
172
+ .co-closed {
173
+ color: var(--muted);
174
+ font-weight: 700;
175
+ }
176
+ .co-card > .co-action {
177
+ margin-top: auto;
178
+ padding-top: 0.5rem;
179
+ }
180
+ .co-action .button {
181
+ width: 100%;
182
+ }
183
+ .co-empty {
184
+ margin: 0;
185
+ padding: 1.125rem 1.25rem;
186
+ border: 2px dashed color-mix(in srgb, var(--ink) 22%, transparent);
187
+ border-radius: var(--radius);
188
+ color: var(--muted);
189
+ }
190
+ @media (min-width: 40rem) {
191
+ .co-cards {
192
+ grid-template-columns: repeat(2, minmax(0, 1fr));
193
+ gap: 1.25rem;
194
+ }
195
+ .co-action .button {
196
+ width: auto;
197
+ min-width: 7.5rem;
198
+ }
199
+ }
200
+ @media (min-width: 60rem) {
201
+ .co-cards {
202
+ grid-template-columns: repeat(3, minmax(0, 1fr));
203
+ }
204
+ }
205
+ </style>
@@ -0,0 +1,163 @@
1
+ ---
2
+ // EventsList · Compact: the next few events in little. In a sidebar (boards
3
+ // A4 and A6, "Coming up") it is a card (site.css draws every sidebar section
4
+ // as one): the heading, a row per event with its day as a numeral over its
5
+ // month in the accent, its title linking to the event's page on this site,
6
+ // and its place and time on one line, then the section's "All events" link
7
+ // under the rows. In the page's column (board C6, "More chances to meet …"
8
+ // under an event) the heading and the link share a head, as a section head
9
+ // does, and the rows run three across, each under a rule. With no events it
10
+ // draws nothing.
11
+ import type { ComponentProps } from 'astro/types'
12
+ import type Default from './index.astro'
13
+ import Band from '../Band.astro'
14
+ import { eventsOf } from './events'
15
+ import { links } from '../../../lib/section'
16
+ import { text } from '../../../lib/format'
17
+
18
+ type Props = ComponentProps<typeof Default>
19
+
20
+ const { section } = Astro.props
21
+ const heading = text(section.copy.heading)
22
+ const events = eventsOf(section)
23
+ const more = links(section)
24
+ ---
25
+ {events.length > 0 && (
26
+ <Band section={section} class="events events-compact">
27
+ <div class="compact">
28
+ {heading && <h2 class="compact-heading">{heading}</h2>}
29
+ <ul class="compact-events" role="list">
30
+ {events.map((event) => (
31
+ <li>
32
+ {event.when && event.startsAt && (
33
+ <time class="compact-day" datetime={event.startsAt}>
34
+ <b aria-hidden="true">{event.when.day}</b>
35
+ <span aria-hidden="true">{event.when.monthShort}</span>
36
+ <span class="visually-hidden">{event.when.full}</span>
37
+ </time>
38
+ )}
39
+ <div>
40
+ <h3>{event.link ? <a href={event.link.href} rel={event.link.rel}>{event.title}</a> : event.title}</h3>
41
+ {(event.place || event.when?.time) && <p>{[event.when?.time, event.place].filter(Boolean).join(' · ')}</p>}
42
+ </div>
43
+ </li>
44
+ ))}
45
+ </ul>
46
+ {more.length > 0 && <p class="compact-more">{more.map((link) => <a href={link.href} rel={link.rel}>{link.label}</a>)}</p>}
47
+ </div>
48
+ </Band>
49
+ )}
50
+
51
+ <style>
52
+ /* In the page's column (C6): the heading and the link on one line over three rows across. */
53
+ .compact {
54
+ display: grid;
55
+ grid-template-columns: minmax(0, 1fr) auto;
56
+ grid-template-areas:
57
+ 'head more'
58
+ 'list list';
59
+ gap: 0 1.5rem;
60
+ align-items: end;
61
+ }
62
+ .compact-heading {
63
+ grid-area: head;
64
+ margin: 0 0 1.5rem;
65
+ }
66
+ .compact-more {
67
+ grid-area: more;
68
+ margin: 0 0 1.5rem;
69
+ font-size: var(--text-sm);
70
+ font-weight: 700;
71
+ }
72
+ .compact-more a {
73
+ color: var(--link);
74
+ text-decoration: underline;
75
+ text-decoration-thickness: 1.5px;
76
+ text-underline-offset: 0.25em;
77
+ }
78
+ .compact-events {
79
+ grid-area: list;
80
+ display: grid;
81
+ gap: 1rem;
82
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
83
+ margin: 0;
84
+ padding: 0;
85
+ list-style: none;
86
+ }
87
+ .compact-events li {
88
+ display: grid;
89
+ grid-template-columns: 3.25rem minmax(0, 1fr);
90
+ gap: 0.75rem;
91
+ align-items: center;
92
+ padding-top: 0.75rem;
93
+ border-top: 2px solid var(--ink);
94
+ }
95
+ .compact-day {
96
+ display: grid;
97
+ justify-items: center;
98
+ line-height: 1;
99
+ }
100
+ .compact-day b {
101
+ font-family: var(--font-display);
102
+ font-size: 1.875rem;
103
+ font-weight: 800;
104
+ }
105
+ .compact-day span[aria-hidden] {
106
+ margin-top: 0.25rem;
107
+ color: var(--accent);
108
+ font-size: 0.6875rem;
109
+ font-weight: 700;
110
+ letter-spacing: 0.14em;
111
+ text-transform: uppercase;
112
+ }
113
+ .compact-events h3 {
114
+ margin: 0;
115
+ font-family: var(--font);
116
+ font-size: var(--text);
117
+ font-weight: 700;
118
+ line-height: 1.3;
119
+ }
120
+ .compact-events h3 a {
121
+ color: inherit;
122
+ text-decoration: none;
123
+ }
124
+ .compact-events h3 a:hover {
125
+ text-decoration: underline;
126
+ }
127
+ .compact-events p {
128
+ margin: 0.125rem 0 0;
129
+ color: var(--muted);
130
+ font-size: var(--text-sm);
131
+ }
132
+ /* In a sidebar (A4, A6): one column, the rows between rules, the link under them. */
133
+ :global(.rail) .compact {
134
+ grid-template-columns: minmax(0, 1fr);
135
+ grid-template-areas:
136
+ 'head'
137
+ 'list'
138
+ 'more';
139
+ }
140
+ :global(.rail) .compact-heading {
141
+ margin-bottom: 0.75rem;
142
+ }
143
+ :global(.rail) .compact-events {
144
+ grid-template-columns: minmax(0, 1fr);
145
+ gap: 0;
146
+ }
147
+ :global(.rail) .compact-events li {
148
+ grid-template-columns: 2.5rem minmax(0, 1fr);
149
+ align-items: start;
150
+ padding: 0.75rem 0;
151
+ border-top: 1px solid var(--line);
152
+ }
153
+ :global(.rail) .compact-events li:first-child {
154
+ padding-top: 0.25rem;
155
+ border-top: 0;
156
+ }
157
+ :global(.rail) .compact-day b {
158
+ font-size: 1.375rem;
159
+ }
160
+ :global(.rail) .compact-more {
161
+ margin: 0.5rem 0 0;
162
+ }
163
+ </style>
@@ -0,0 +1,168 @@
1
+ // An EventsList's rows as its layouts draw them: each event's id (for its
2
+ // live counts), title, start, place, type, whether it still takes
3
+ // registrations, its page on this site (`/events/<slug>`, lib/events.ts), the
4
+ // action a button offers on it, its calendar file (`/events/<slug>.ics`, which
5
+ // the event page's route serves) and its pinned location, at most the
6
+ // section's `max` of them. Dates are lib/format.ts's, in the event's own time
7
+ // zone: the parts below are read off the string formatWhen writes, so every
8
+ // layout shows (and the agenda groups by) the same day and time the list
9
+ // layout does. A row's time carries its zone's short name ("7:00 PM CDT");
10
+ // `clock` is the time alone, for rows under a line that names the zone once
11
+ // (sharedZone).
12
+
13
+ import type { Section } from '@backgold/content'
14
+ import { linkOf, rows, type Link } from '../../../lib/section'
15
+ import { formatWhen, text, zoneName } from '../../../lib/format'
16
+ import { eventPagePath } from '../../../lib/events'
17
+
18
+ export interface When {
19
+ /** "Tuesday, October 14, 2026 at 7:00 PM CDT", as formatWhen writes it. */
20
+ full: string
21
+ /** "Tue", or null for a date with no time (formatWhen leaves the weekday out). */
22
+ weekday: string | null
23
+ /** "October" */
24
+ month: string
25
+ /** "Oct" */
26
+ monthShort: string
27
+ /** "14" */
28
+ day: string
29
+ year: number
30
+ /** 0 for January. */
31
+ monthIndex: number
32
+ /** "7:00 PM CDT", or null when the value has no time. */
33
+ time: string | null
34
+ /** "7:00 PM", the time without its zone's name; null when the value has no time. */
35
+ clock: string | null
36
+ }
37
+
38
+ export interface EventRow {
39
+ /** The event's id, which names its live counts' slot; null when the row has none. */
40
+ id: string | null
41
+ title: string
42
+ /** The row's own value, for `<time datetime>`. */
43
+ startsAt: string | null
44
+ when: When | null
45
+ /** The location, or "Online" for a virtual event with none. */
46
+ place: string | null
47
+ /** The event's type as a label ("Rally"), or null when it has none. */
48
+ type: string | null
49
+ /** The event has stopped taking registrations. */
50
+ closed: boolean
51
+ /** The event's IANA zone, or null when it has none. */
52
+ zone: string | null
53
+ /** The event's own page on this site, labelled with its title. */
54
+ link: Link | null
55
+ /**
56
+ * The button's link to the event's page: "Details" once registration has
57
+ * closed, else "Get tickets" when the event sells tickets, else "RSVP".
58
+ */
59
+ action: Link | null
60
+ /**
61
+ * "Add to calendar": the event's calendar file on this site, the event
62
+ * page's `.ics`. Null without a page or a start that parses, since the
63
+ * route has no file to serve then.
64
+ */
65
+ calendar: Link | null
66
+ /** The pinned location's latitude, or null when the event has no pin. */
67
+ lat: number | null
68
+ /** The pinned location's longitude, or null when the event has no pin. */
69
+ lng: number | null
70
+ }
71
+
72
+ const MONTHS = Array.from({ length: 12 }, (_, i) =>
73
+ new Intl.DateTimeFormat('en-US', { month: 'long', timeZone: 'UTC' }).format(Date.UTC(2000, i, 1)),
74
+ )
75
+
76
+ // formatWhen writes "Tuesday, October 14, 2026 at 7:00 PM CDT" (", 7:00 PM
77
+ // CDT" on an older ICU), or "October 14, 2026" for a value with no time.
78
+ const WHEN = /^(?:(\p{L}+), )?(\p{L}+) (\d{1,2}), (\d{4})(?:(?:,| at) (.+))?$/u
79
+
80
+ /** A start as the rows show it, in its own zone (formatWhen's parts); null when it does not parse. */
81
+ export function whenOf(value: unknown, timeZone: unknown): When | null {
82
+ const full = formatWhen(value, timeZone)
83
+ const m = full ? WHEN.exec(full) : null
84
+ if (!full || !m) return null
85
+ const [, weekday, month, day, year, time] = m
86
+ const bare = formatWhen(value, timeZone, false)
87
+ const monthIndex = MONTHS.indexOf(month!)
88
+ if (monthIndex < 0) return null
89
+ return {
90
+ full,
91
+ weekday: weekday ? weekday.slice(0, 3) : null,
92
+ month: month!,
93
+ monthShort: month!.slice(0, 3),
94
+ day: day!,
95
+ year: Number(year),
96
+ monthIndex,
97
+ time: time ?? null,
98
+ clock: (bare ? WHEN.exec(bare)?.[5] : undefined) ?? time ?? null,
99
+ }
100
+ }
101
+
102
+ export function monthName(monthIndex: number): string {
103
+ return MONTHS[monthIndex] ?? ''
104
+ }
105
+
106
+ /** 'buttons' puts a button under each event; 'link' (or none) makes the title the link. */
107
+ export function actionsOf(section: Section): 'buttons' | 'link' {
108
+ return section.options?.actions === 'buttons' ? 'buttons' : 'link'
109
+ }
110
+
111
+ /** An event type as a label ("Rally"), or null for none or `blank`. */
112
+ export function typeLabel(value: unknown): string | null {
113
+ const raw = text(value)?.trim().replace(/[_-]+/g, ' ')
114
+ if (!raw || raw === 'blank') return null
115
+ return raw[0]!.toUpperCase() + raw.slice(1)
116
+ }
117
+
118
+ /** A finite number within ±`limit`, or null. */
119
+ function degrees(value: unknown, limit: number): number | null {
120
+ return typeof value === 'number' && Number.isFinite(value) && Math.abs(value) <= limit ? value : null
121
+ }
122
+
123
+ export function eventsOf(section: Section): EventRow[] {
124
+ const max = section.options?.max
125
+ const cap = typeof max === 'number' && Number.isFinite(max) && max > 0 ? Math.floor(max) : Infinity
126
+ return rows(section)
127
+ .flatMap((row) => {
128
+ const title = text(row.title)
129
+ if (!title) return []
130
+ const startsAt = text(row.starts_at)
131
+ const closed = row.registration_closed === true
132
+ const tickets = !closed && row.sells_tickets === true
133
+ const page = eventPagePath(row.url)
134
+ const lat = degrees(row.lat, 90)
135
+ const lng = degrees(row.lng, 180)
136
+ const dated = startsAt !== null && !Number.isNaN(Date.parse(startsAt))
137
+ return [
138
+ {
139
+ id: text(row.id),
140
+ title,
141
+ startsAt,
142
+ when: whenOf(startsAt, row.timezone),
143
+ place: text(row.location) ?? (row.is_virtual === true ? 'Online' : null),
144
+ type: typeLabel(row.type),
145
+ closed,
146
+ zone: text(row.timezone)?.trim() || null,
147
+ link: linkOf(title, page),
148
+ action: linkOf(closed ? 'Details' : tickets ? 'Get tickets' : 'RSVP', page),
149
+ calendar: page && dated ? linkOf('Add to calendar', `${page}.ics`) : null,
150
+ // A pin needs both halves.
151
+ lat: lat !== null && lng !== null ? lat : null,
152
+ lng: lat !== null && lng !== null ? lng : null,
153
+ },
154
+ ]
155
+ })
156
+ .slice(0, cap)
157
+ }
158
+
159
+ /**
160
+ * The zone a list of events names once under its rows (boards A6 and C5,
161
+ * "Times are Mountain Time."), so the rows drop it from their times: the
162
+ * name of the one zone every timed row is in, or null when the rows span
163
+ * zones or name none Intl knows.
164
+ */
165
+ export function sharedZone(events: EventRow[]): string | null {
166
+ const zones = new Set(events.filter((e) => e.when?.time).map((e) => e.zone))
167
+ return zones.size === 1 ? zoneName([...zones][0]) : null
168
+ }
@@ -0,0 +1,46 @@
1
+ ---
2
+ // EventsList (List, the default; board C1's "Upcoming events · List", A12
3
+ // shows it beside Cards and Agenda): the section head (the kicker when one
4
+ // is set, the heading, and the section's links at the right, C1's "All
5
+ // events"), then the events as rows (EventRows: a card per event with its
6
+ // day, its type, its title, its time and place and its live counts). Each
7
+ // event links to its page on this site (/events/<slug>), which frames
8
+ // BackGold's RSVP and tickets (never build an RSVP form here):
9
+ // `options.actions` 'buttons' puts the event's button on each row, 'link'
10
+ // (or none) makes the title the link; either way the whole row opens it. On
11
+ // the events page (/events, /events/<type>) a line under the rows names their
12
+ // one zone and offers every event as one calendar file (CalendarLine, as the
13
+ // Agenda draws it). With no events listed, the section places BackGold's own
14
+ // events-list frame instead, when it has one, else says so.
15
+ import type { Section } from '@backgold/content'
16
+ import { Embed } from '@backgold/astro/components'
17
+ import Band from '../Band.astro'
18
+ import EventRows from './EventRows.astro'
19
+ import LiveCounts from './LiveCounts.astro'
20
+ import CalendarLine from './CalendarLine.astro'
21
+ import SectionHead from '../SectionHead.astro'
22
+ import { actionsOf, eventsOf, sharedZone } from './events'
23
+ import { onEventsPage } from '../../../lib/events'
24
+ import { links } from '../../../lib/section'
25
+ import { text } from '../../../lib/format'
26
+
27
+ interface Props {
28
+ section: Section
29
+ variant?: string
30
+ }
31
+
32
+ const { section } = Astro.props
33
+ const heading = text(section.copy.heading)
34
+ const buttons = actionsOf(section) === 'buttons'
35
+ const events = eventsOf(section)
36
+ const calendarLine = events.length > 0 && onEventsPage(Astro.url.pathname)
37
+ const zone = calendarLine ? sharedZone(events) : null
38
+ ---
39
+ <Band section={section} class="events events-list">
40
+ <SectionHead kicker={text(section.copy.kicker)} heading={heading} more={links(section)} />
41
+ {events.length > 0 && <EventRows events={events} buttons={buttons} level={3} zoneless={zone !== null} />}
42
+ {calendarLine && <CalendarLine zone={zone} />}
43
+ {events.length > 0 && <LiveCounts />}
44
+ {events.length === 0 && section.embed && <Embed embed={section.embed} title={heading ?? 'Upcoming events'} />}
45
+ {events.length === 0 && !section.embed && <p class="empty">No upcoming events right now.</p>}
46
+ </Band>