@backgold/template-kit 0.0.0-stage → 0.1.0

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 (340) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +12 -2
  3. package/dist/chunk-KOB36GSF.js +62 -0
  4. package/dist/constants-DvTNj4JI.d-Batjcj3Z.d.ts +38 -0
  5. package/dist/content-api-CYeY0vU8.d.ts +849 -0
  6. package/dist/contract/content-api-examples.d.ts +58 -0
  7. package/dist/contract/content-api-examples.js +783 -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 +252 -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 +54 -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 +90 -0
  57. package/src/components/sections/About/index.astro +57 -0
  58. package/src/components/sections/About/left.astro +54 -0
  59. package/src/components/sections/About/letter.astro +108 -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 +119 -0
  102. package/src/components/sections/ContentPost/player.astro +254 -0
  103. package/src/components/sections/ContentPost/theater.astro +329 -0
  104. package/src/components/sections/Countdown/index.astro +53 -0
  105. package/src/components/sections/Course/Bar.astro +46 -0
  106. package/src/components/sections/Course/CourseHead.astro +123 -0
  107. package/src/components/sections/Course/Crumbs.astro +44 -0
  108. package/src/components/sections/Course/Icon.astro +29 -0
  109. package/src/components/sections/Course/Ring.astro +62 -0
  110. package/src/components/sections/Course/Syllabus.astro +146 -0
  111. package/src/components/sections/Course/course.ts +146 -0
  112. package/src/components/sections/Course/index.astro +143 -0
  113. package/src/components/sections/Course/outline.astro +39 -0
  114. package/src/components/sections/Cta/banner.astro +64 -0
  115. package/src/components/sections/Cta/card.astro +88 -0
  116. package/src/components/sections/Cta/index.astro +31 -0
  117. package/src/components/sections/Cta/photo.astro +114 -0
  118. package/src/components/sections/Cta/strip.astro +91 -0
  119. package/src/components/sections/Donate/index.astro +136 -0
  120. package/src/components/sections/Donate/story.astro +7 -0
  121. package/src/components/sections/Event/card.astro +14 -0
  122. package/src/components/sections/Event/index.astro +14 -0
  123. package/src/components/sections/EventsList/AgendaMonths.astro +105 -0
  124. package/src/components/sections/EventsList/CalendarLine.astro +23 -0
  125. package/src/components/sections/EventsList/EventRows.astro +196 -0
  126. package/src/components/sections/EventsList/LiveCounts.astro +75 -0
  127. package/src/components/sections/EventsList/TypeTabs.astro +53 -0
  128. package/src/components/sections/EventsList/agenda.astro +55 -0
  129. package/src/components/sections/EventsList/calendar.astro +392 -0
  130. package/src/components/sections/EventsList/cards.astro +186 -0
  131. package/src/components/sections/EventsList/cohorts.astro +205 -0
  132. package/src/components/sections/EventsList/compact.astro +163 -0
  133. package/src/components/sections/EventsList/events.ts +168 -0
  134. package/src/components/sections/EventsList/index.astro +46 -0
  135. package/src/components/sections/EventsList/map.astro +436 -0
  136. package/src/components/sections/EventsList/shifts.astro +355 -0
  137. package/src/components/sections/EventsList/week.astro +361 -0
  138. package/src/components/sections/Faq/Contact.astro +63 -0
  139. package/src/components/sections/Faq/Questions.astro +98 -0
  140. package/src/components/sections/Faq/cards.astro +74 -0
  141. package/src/components/sections/Faq/faq.ts +101 -0
  142. package/src/components/sections/Faq/index.astro +49 -0
  143. package/src/components/sections/Faq/topics.astro +178 -0
  144. package/src/components/sections/Financials/Foot.astro +38 -0
  145. package/src/components/sections/Financials/Head.astro +47 -0
  146. package/src/components/sections/Financials/donut.astro +197 -0
  147. package/src/components/sections/Financials/financials.ts +52 -0
  148. package/src/components/sections/Financials/index.astro +148 -0
  149. package/src/components/sections/Financials/table.astro +157 -0
  150. package/src/components/sections/FormBlock/index.astro +33 -0
  151. package/src/components/sections/FormBlock/wide.astro +7 -0
  152. package/src/components/sections/Hero/cover.astro +170 -0
  153. package/src/components/sections/Hero/donate.astro +209 -0
  154. package/src/components/sections/Hero/field.astro +390 -0
  155. package/src/components/sections/Hero/index.astro +52 -0
  156. package/src/components/sections/Hero/overlap.astro +151 -0
  157. package/src/components/sections/Hero/rotating.astro +30 -0
  158. package/src/components/sections/Hero/split.astro +96 -0
  159. package/src/components/sections/Hero/statement.astro +55 -0
  160. package/src/components/sections/Hero/video.astro +399 -0
  161. package/src/components/sections/Issues/checklist.astro +204 -0
  162. package/src/components/sections/Issues/drawer.astro +237 -0
  163. package/src/components/sections/Issues/index.astro +115 -0
  164. package/src/components/sections/Issues/issues.ts +37 -0
  165. package/src/components/sections/Issues/numbered.astro +79 -0
  166. package/src/components/sections/Issues/rows.astro +137 -0
  167. package/src/components/sections/Issues/steps.astro +81 -0
  168. package/src/components/sections/Issues/tabs.astro +322 -0
  169. package/src/components/sections/Leaderboard/index.astro +29 -0
  170. package/src/components/sections/Lesson/Door.astro +121 -0
  171. package/src/components/sections/Lesson/LessonBody.astro +416 -0
  172. package/src/components/sections/Lesson/Rail.astro +182 -0
  173. package/src/components/sections/Lesson/Tracker.astro +137 -0
  174. package/src/components/sections/Lesson/index.astro +27 -0
  175. package/src/components/sections/Lesson/lesson.ts +233 -0
  176. package/src/components/sections/Lesson/reading.astro +21 -0
  177. package/src/components/sections/Map/CoverageLine.astro +19 -0
  178. package/src/components/sections/Map/RegionMap.astro +109 -0
  179. package/src/components/sections/Map/bar.astro +160 -0
  180. package/src/components/sections/Map/index.astro +192 -0
  181. package/src/components/sections/Map/map.astro +275 -0
  182. package/src/components/sections/MediaKit/BioCard.astro +108 -0
  183. package/src/components/sections/MediaKit/Downloads.astro +88 -0
  184. package/src/components/sections/MediaKit/index.astro +183 -0
  185. package/src/components/sections/MediaKit/kit.ts +140 -0
  186. package/src/components/sections/MediaKit/press.astro +189 -0
  187. package/src/components/sections/MediaKit/speaker.astro +205 -0
  188. package/src/components/sections/Membership/Benefits.astro +42 -0
  189. package/src/components/sections/Membership/Check.astro +12 -0
  190. package/src/components/sections/Membership/Price.astro +61 -0
  191. package/src/components/sections/Membership/compare.astro +312 -0
  192. package/src/components/sections/Membership/index.astro +281 -0
  193. package/src/components/sections/Membership/offers.ts +169 -0
  194. package/src/components/sections/Membership/tiers.astro +217 -0
  195. package/src/components/sections/MovementMap/index.astro +50 -0
  196. package/src/components/sections/MovementTicker/index.astro +43 -0
  197. package/src/components/sections/Pathways/Doors.astro +147 -0
  198. package/src/components/sections/Pathways/Head.astro +37 -0
  199. package/src/components/sections/Pathways/index.astro +27 -0
  200. package/src/components/sections/Pathways/pathways.ts +100 -0
  201. package/src/components/sections/Pathways/quiz.astro +286 -0
  202. package/src/components/sections/Pathways/tabs.astro +271 -0
  203. package/src/components/sections/PdfEmbed/card.astro +99 -0
  204. package/src/components/sections/PdfEmbed/index.astro +26 -0
  205. package/src/components/sections/PdfEmbed/medium.astro +7 -0
  206. package/src/components/sections/PdfEmbed/tall.astro +7 -0
  207. package/src/components/sections/Petition/coverage.astro +14 -0
  208. package/src/components/sections/Petition/image.astro +14 -0
  209. package/src/components/sections/Petition/index.astro +14 -0
  210. package/src/components/sections/Petition/map.astro +14 -0
  211. package/src/components/sections/PlatformPlanks/anchors.ts +66 -0
  212. package/src/components/sections/PlatformPlanks/columns.astro +171 -0
  213. package/src/components/sections/PlatformPlanks/index.astro +56 -0
  214. package/src/components/sections/PlatformPlanks/longread.astro +250 -0
  215. package/src/components/sections/PollBlock/index.astro +30 -0
  216. package/src/components/sections/Portfolio/featured.astro +343 -0
  217. package/src/components/sections/Portfolio/index.astro +571 -0
  218. package/src/components/sections/Portfolio/strip.astro +173 -0
  219. package/src/components/sections/Portfolio/work.ts +100 -0
  220. package/src/components/sections/Progress/MatchClock.astro +166 -0
  221. package/src/components/sections/Progress/compact.astro +150 -0
  222. package/src/components/sections/Progress/index.astro +32 -0
  223. package/src/components/sections/Progress/match.astro +126 -0
  224. package/src/components/sections/Progress/ring.astro +179 -0
  225. package/src/components/sections/QuickDonate/DonateCard.astro +149 -0
  226. package/src/components/sections/QuickDonate/Picker.astro +95 -0
  227. package/src/components/sections/QuickDonate/band.astro +164 -0
  228. package/src/components/sections/QuickDonate/bar.astro +208 -0
  229. package/src/components/sections/QuickDonate/donate.ts +126 -0
  230. package/src/components/sections/QuickDonate/hero.astro +143 -0
  231. package/src/components/sections/QuickDonate/index.astro +73 -0
  232. package/src/components/sections/QuickDonate/jar.astro +225 -0
  233. package/src/components/sections/QuickDonate/ladder.astro +248 -0
  234. package/src/components/sections/QuoteStrip/carousel.astro +340 -0
  235. package/src/components/sections/QuoteStrip/index.astro +58 -0
  236. package/src/components/sections/QuoteStrip/logos.astro +226 -0
  237. package/src/components/sections/QuoteStrip/quotes.ts +61 -0
  238. package/src/components/sections/QuoteStrip/single.astro +92 -0
  239. package/src/components/sections/QuoteStrip/ticker.astro +319 -0
  240. package/src/components/sections/QuoteStrip/wall.astro +113 -0
  241. package/src/components/sections/Resources/band.astro +93 -0
  242. package/src/components/sections/Resources/featured.astro +239 -0
  243. package/src/components/sections/Resources/index.astro +225 -0
  244. package/src/components/sections/Resources/resources.ts +92 -0
  245. package/src/components/sections/SampleBallot/Position.astro +39 -0
  246. package/src/components/sections/SampleBallot/ballot.ts +92 -0
  247. package/src/components/sections/SampleBallot/cards.astro +299 -0
  248. package/src/components/sections/SampleBallot/index.astro +326 -0
  249. package/src/components/sections/SampleBallot/measures.astro +172 -0
  250. package/src/components/sections/Scorecard/grades.astro +141 -0
  251. package/src/components/sections/Scorecard/index.astro +294 -0
  252. package/src/components/sections/Scorecard/promise.astro +167 -0
  253. package/src/components/sections/Scorecard/votes.ts +83 -0
  254. package/src/components/sections/SectionHead.astro +31 -0
  255. package/src/components/sections/Services/Button.astro +24 -0
  256. package/src/components/sections/Services/Check.astro +12 -0
  257. package/src/components/sections/Services/Includes.astro +42 -0
  258. package/src/components/sections/Services/compare.astro +328 -0
  259. package/src/components/sections/Services/index.astro +187 -0
  260. package/src/components/sections/Services/list.astro +181 -0
  261. package/src/components/sections/Services/services.ts +80 -0
  262. package/src/components/sections/ShareKit/Actions.astro +71 -0
  263. package/src/components/sections/ShareKit/Buttons.astro +62 -0
  264. package/src/components/sections/ShareKit/compact.astro +123 -0
  265. package/src/components/sections/ShareKit/index.astro +160 -0
  266. package/src/components/sections/ShareKit/share.ts +60 -0
  267. package/src/components/sections/ShareKit/strip.astro +173 -0
  268. package/src/components/sections/SignupCapture/band.astro +7 -0
  269. package/src/components/sections/SignupCapture/index.astro +103 -0
  270. package/src/components/sections/SignupCapture/inline.astro +7 -0
  271. package/src/components/sections/SocialFeed/index.astro +34 -0
  272. package/src/components/sections/StatCards/feature.astro +143 -0
  273. package/src/components/sections/StatCards/index.astro +51 -0
  274. package/src/components/sections/StatCards/ribbon.astro +113 -0
  275. package/src/components/sections/StatCards/wall.astro +177 -0
  276. package/src/components/sections/Store/featured.astro +14 -0
  277. package/src/components/sections/Store/index.astro +14 -0
  278. package/src/components/sections/Stories/Status.astro +42 -0
  279. package/src/components/sections/Stories/StoryCards.astro +171 -0
  280. package/src/components/sections/Stories/cards.astro +42 -0
  281. package/src/components/sections/Stories/index.astro +238 -0
  282. package/src/components/sections/Stories/stories.ts +97 -0
  283. package/src/components/sections/Stories/timeline.astro +135 -0
  284. package/src/components/sections/TeamGrid/board.astro +280 -0
  285. package/src/components/sections/TeamGrid/index.astro +71 -0
  286. package/src/components/sections/TeamGrid/list.astro +306 -0
  287. package/src/components/sections/TeamGrid/people.ts +178 -0
  288. package/src/components/sections/VideoEmbed/index.astro +52 -0
  289. package/src/components/sections/VideoEmbed/landscape.astro +7 -0
  290. package/src/components/sections/VideoEmbed/portrait.astro +7 -0
  291. package/src/components/sections/VideoEmbed/square.astro +7 -0
  292. package/src/components/sections/VoterTools/DaysLeft.astro +33 -0
  293. package/src/components/sections/VoterTools/dates.astro +149 -0
  294. package/src/components/sections/VoterTools/index.astro +228 -0
  295. package/src/components/sections/VoterTools/polling.astro +141 -0
  296. package/src/components/sections/VoterTools/voter-tools.ts +70 -0
  297. package/src/components/sections/index.ts +370 -0
  298. package/src/components/sections/modules/Headed.astro +39 -0
  299. package/src/components/sections/modules/ModuleFrame.astro +179 -0
  300. package/src/components/volunteer/ShiftLive.astro +90 -0
  301. package/src/components/volunteer/detail.astro +247 -0
  302. package/src/components/volunteer/list.astro +298 -0
  303. package/src/components/volunteer/props.ts +21 -0
  304. package/src/env.d.ts +22 -0
  305. package/src/index.d.ts +10 -0
  306. package/src/index.js +64 -0
  307. package/src/layouts/Site.astro +371 -0
  308. package/src/lib/academy.ts +146 -0
  309. package/src/lib/brand.ts +534 -0
  310. package/src/lib/chrome.ts +119 -0
  311. package/src/lib/donate-frame.ts +64 -0
  312. package/src/lib/entries.ts +190 -0
  313. package/src/lib/env.ts +34 -0
  314. package/src/lib/event-map-draw.ts +91 -0
  315. package/src/lib/events.ts +476 -0
  316. package/src/lib/fonts.ts +116 -0
  317. package/src/lib/footer.ts +24 -0
  318. package/src/lib/format.ts +160 -0
  319. package/src/lib/geo.ts +131 -0
  320. package/src/lib/live.ts +54 -0
  321. package/src/lib/menu.ts +48 -0
  322. package/src/lib/petition-text.ts +29 -0
  323. package/src/lib/reading.ts +17 -0
  324. package/src/lib/regions.ts +215 -0
  325. package/src/lib/section.ts +94 -0
  326. package/src/lib/shifts.ts +186 -0
  327. package/src/lib/stream-time.ts +20 -0
  328. package/src/lib/stream.ts +141 -0
  329. package/src/lib/visitor.ts +54 -0
  330. package/src/routes/catch-all.astro +286 -0
  331. package/src/routes/form.astro +30 -0
  332. package/src/routes/live.astro +49 -0
  333. package/src/routes/not-found.astro +18 -0
  334. package/src/routes/preview.astro +60 -0
  335. package/src/routes/setup.astro +62 -0
  336. package/src/routes/volunteer-shift.astro +61 -0
  337. package/src/routes/volunteer.astro +37 -0
  338. package/src/styles/entries.css +784 -0
  339. package/src/styles/site.css +1839 -0
  340. package/src/template.ts +182 -0
@@ -0,0 +1,169 @@
1
+ // A Membership's rows as its layouts draw them. BackGold bakes the rows from
2
+ // the organization's membership program, one per offer its join page sells,
3
+ // in the join page's order: each tier of a tiered program, else the program's
4
+ // one plan. A row's `<cadence>_cents` is what the join page charges for it at
5
+ // that cadence (a donation program's minimum), null where it is not sold so;
6
+ // a free program's one row has no amount at all. `symbolic` marks a tier
7
+ // whose price carries a meaning in its digits ("Spirit of ’71" at $19.71), and
8
+ // `benefits` is the program's list, the same on every row.
9
+ //
10
+ // Every figure shown is a row's cents, to the cent: a symbolic $19.71 is
11
+ // never rounded to a price the join page does not charge. The cadences are
12
+ // worded and ordered here (monthly, annual, lifetime, one time), so the three
13
+ // layouts say a price the same way. A row of a model this does not know, or a
14
+ // priced model's row with no price, is left out; no rows draws nothing.
15
+
16
+ import type { Section } from '@backgold/content'
17
+ import { links, rows, type Link } from '../../../lib/section'
18
+ import { formatCents, text } from '../../../lib/format'
19
+
20
+ const CADENCES =['monthly', 'annual', 'lifetime', 'onetime'] as const
21
+ export type Cadence = (typeof CADENCES)[number]
22
+
23
+ const MODELS = ['free', 'single', 'tiered', 'donation'] as const
24
+ export type Model = (typeof MODELS)[number]
25
+
26
+ /** Each cadence's suffix after a price ("$25/yr"), the suffix as a screen reader says it, and its name on the switch. */
27
+ const WORDS: Record<Cadence, { suffix: string; spoken: string; label: string }> = {
28
+ monthly: { suffix: '/mo', spoken: 'a month', label: 'Monthly' },
29
+ annual: { suffix: '/yr', spoken: 'a year', label: 'Annual' },
30
+ lifetime: { suffix: 'once, for life', spoken: 'once, for life', label: 'Life' },
31
+ onetime: { suffix: 'once', spoken: 'once', label: 'One time' },
32
+ }
33
+
34
+ /** What an offer is called when its row has no name: a donation or free program's one offer, or a single plan's. */
35
+ const UNNAMED: Record<Model, string> = {
36
+ free: 'Member',
37
+ single: 'Membership',
38
+ tiered: 'Membership',
39
+ donation: 'Supporter',
40
+ }
41
+
42
+ /** The cadence a card leads with: annual, then monthly, lifetime, one time. */
43
+ const LEAD: Cadence[] = ['annual', 'monthly', 'lifetime', 'onetime']
44
+
45
+ export interface Price {
46
+ /** "$25", "$19.71", "$1,000". */
47
+ amount: string
48
+ /** "/yr", "/mo", "once, for life", "once". */
49
+ suffix: string
50
+ /** "a year", "a month", "once, for life", "once": the suffix in words. */
51
+ spoken: string
52
+ /** Whether the suffix is words set apart by a space ("$500 once, for life") rather than a slash. */
53
+ spaced: boolean
54
+ }
55
+
56
+ export interface Offer {
57
+ model: Model
58
+ /** The row's name, or the model's word for an unnamed offer. */
59
+ name: string
60
+ /** The row's own name, when it has one. */
61
+ named: boolean
62
+ symbolic: boolean
63
+ /** Cents at each cadence the offer is sold at. */
64
+ cents: Partial<Record<Cadence, number>>
65
+ /** The cadences it is sold at, in cadence order. */
66
+ cadences: Cadence[]
67
+ }
68
+
69
+ export interface Membership {
70
+ model: Model
71
+ offers: Offer[]
72
+ /** The cadences any offer is sold at, in cadence order. */
73
+ cadences: Cadence[]
74
+ benefits: string[]
75
+ /** The join link (the section's one link), or null when the section has none. */
76
+ join: Link | null
77
+ note: string | null
78
+ }
79
+
80
+ function cents(value: unknown): number | null {
81
+ return typeof value === 'number' && Number.isInteger(value) && value >= 0 ? value : null
82
+ }
83
+
84
+ /** Dollars and cents from cents through formatCents: whole dollars as "$25", anything else to the cent ("$19.71"). */
85
+ function money(amount: number): string {
86
+ const whole = amount - (amount % 100)
87
+ const dollars = formatCents(whole) ?? ''
88
+ return amount % 100 === 0 ? dollars : `${dollars}.${String(amount % 100).padStart(2, '0')}`
89
+ }
90
+
91
+ /** An amount at a cadence, worded. */
92
+ export function price(amount: number, cadence: Cadence): Price {
93
+ const words = WORDS[cadence]
94
+ return { amount: money(amount), suffix: words.suffix, spoken: words.spoken, spaced: !words.suffix.startsWith('/') }
95
+ }
96
+
97
+ /** "Monthly", "Annual", "Life", "One time". */
98
+ export function cadenceLabel(cadence: Cadence): string {
99
+ return WORDS[cadence].label
100
+ }
101
+
102
+ /** The cadence a price leads with among `cadences`; null for none (a free program). */
103
+ export function leadCadenceOf(cadences: Cadence[]): Cadence | null {
104
+ return LEAD.find((c) => cadences.includes(c)) ?? null
105
+ }
106
+
107
+ /** The cadences an offer is sold at after the one its card leads with, in cadence order. */
108
+ export function otherCadences(offer: Offer): Cadence[] {
109
+ const lead = leadCadenceOf(offer.cadences)
110
+ return offer.cadences.filter((c) => c !== lead)
111
+ }
112
+
113
+ /** The section's membership program, or null when it has no rows to draw. */
114
+ export function membershipOf(section: Section): Membership | null {
115
+ const all = rows(section)
116
+ const model = MODELS.find((m) => m === text(all[0]?.model)?.trim())
117
+ if (!model) return null
118
+ const offers = all.flatMap((row): Offer[] => {
119
+ if (text(row.model)?.trim() !== model) return []
120
+ const priced: Partial<Record<Cadence, number>> = {}
121
+ for (const c of CADENCES) {
122
+ const amount = cents(row[`${c}_cents`])
123
+ if (amount !== null) priced[c] = amount
124
+ }
125
+ const cadences = CADENCES.filter((c) => priced[c] !== undefined)
126
+ if (model === 'free' ? cadences.length > 0 : cadences.length === 0) return []
127
+ const name = text(row.name)?.trim() ?? null
128
+ return [{ model, name: name ?? UNNAMED[model], named: name !== null, symbolic: row.symbolic === true, cents: priced, cadences }]
129
+ })
130
+ if (offers.length === 0) return null
131
+ const first = all.find((row) => Array.isArray(row.benefits))
132
+ const benefits = Array.isArray(first?.benefits) ? first.benefits.map(text).filter((b): b is string => b !== null) : []
133
+ const [join] = links(section)
134
+ return {
135
+ model,
136
+ offers,
137
+ cadences: CADENCES.filter((c) => offers.some((o) => o.cents[c] !== undefined)),
138
+ benefits,
139
+ join: join ?? null,
140
+ note: text(section.copy.note),
141
+ }
142
+ }
143
+
144
+ /**
145
+ * The card a Tiers layout fills: the one recurring offer (monthly or annual)
146
+ * that is not symbolic when there is exactly one among two or more offers (the
147
+ * program's standing membership beside its symbolic and lifetime ones), else
148
+ * the middle of exactly three (board 05's centre card: a row of three has a
149
+ * middle, a wrapped row of more does not), else none.
150
+ */
151
+ export function featuredOf(m: Membership): Offer | null {
152
+ if (m.offers.length < 2) return null
153
+ const standing = m.offers.filter((o) => !o.symbolic && (o.cents.monthly !== undefined || o.cents.annual !== undefined))
154
+ if (standing.length === 1) return standing[0]
155
+ return m.offers.length === 3 ? m.offers[1] : null
156
+ }
157
+
158
+ /**
159
+ * The least the program asks at a cadence: the cheapest offer sold at it,
160
+ * symbolic or not, since "from" names a floor and the join page sells a
161
+ * symbolic tier at its price like any other. `from` says whether something
162
+ * sold at that cadence costs more, or the amount is a donation's minimum.
163
+ */
164
+ export function cheapestAt(m: Membership, cadence: Cadence): { amount: number; from: boolean } | null {
165
+ const amounts = m.offers.flatMap((o) => (o.cents[cadence] === undefined ? [] : [o.cents[cadence]!]))
166
+ if (amounts.length === 0) return null
167
+ const amount = Math.min(...amounts)
168
+ return { amount, from: amounts.some((a) => a !== amount) || m.model === 'donation' }
169
+ }
@@ -0,0 +1,217 @@
1
+ ---
2
+ // Membership, 'tiers' layout (board 05, A, "Three tiers"): the section head
3
+ // and the body, then a card per offer the organization's join page sells, in
4
+ // its order, three across (one under another on a phone): the offer's name
5
+ // small in capitals (a donation program's one offer is "Supporter", a free
6
+ // one's "Member"), a "Symbolic price" chip on a tier whose amount carries a
7
+ // meaning in its digits, the price large in the display face with its cadence
8
+ // ("$25/yr"; "$500 once, for life" for a lifetime tier; "Free"), any other
9
+ // cadence it is sold at under it ("or $25/mo"), the program's benefits as a
10
+ // checked list, and the join button. A program with one offer draws one card,
11
+ // centred.
12
+ //
13
+ // One card is filled in the band's second button colour and carries the solid
14
+ // button: the program's one recurring offer that is not symbolic, when the
15
+ // others are symbolic or lifetime ones, else the middle of exactly three.
16
+ // Nothing says it in words: the program does not name a favourite, so the
17
+ // fill is emphasis, not a claim. The other cards' buttons are outlined; with
18
+ // no filled card every button is, and a single card's is solid. Every button
19
+ // goes to the same join page, where the tier is picked. The note sits small
20
+ // under the cards. Nothing is drawn when the program has no offers.
21
+ import type { ComponentProps } from 'astro/types'
22
+ import type Default from './index.astro'
23
+ import Band from '../Band.astro'
24
+ import SectionHead from '../SectionHead.astro'
25
+ import Prose from '../../Prose.astro'
26
+ import Benefits from './Benefits.astro'
27
+ import Price from './Price.astro'
28
+ import { featuredOf, leadCadenceOf, membershipOf, otherCadences } from './offers'
29
+ import { text } from '../../../lib/format'
30
+
31
+ type Props = ComponentProps<typeof Default>
32
+
33
+ const { section } = Astro.props
34
+ const m = membershipOf(section)
35
+ const kicker = text(section.copy.kicker)
36
+ const heading = text(section.copy.heading)
37
+ const featured = m ? featuredOf(m) : null
38
+ const only = m?.offers.length === 1
39
+ ---
40
+ {m && (
41
+ <Band section={section} class="membership membership-tiers">
42
+ <SectionHead kicker={kicker} heading={heading} more={[]} />
43
+ <Prose value={section.copy.body} class="lede" />
44
+ <ul class="ms-tiers" role="list" data-count={Math.min(m.offers.length, 3)}>
45
+ {m.offers.map((offer) => {
46
+ const lead = leadCadenceOf(offer.cadences)
47
+ const others = otherCadences(offer)
48
+ const solid = offer === featured || only
49
+ return (
50
+ <li class:list={['ms-tier', offer === featured && 'ms-tier-featured']}>
51
+ <div class="ms-tier-body">
52
+ <div class="ms-tier-head">
53
+ <h3 class="ms-tier-name">{offer.name}</h3>
54
+ {offer.symbolic && <span class="chip ms-symbolic">Symbolic price</span>}
55
+ </div>
56
+ <p class="ms-tier-price">
57
+ <Price cents={lead ? offer.cents[lead]! : null} cadence={lead} from={offer.model === 'donation'} />
58
+ </p>
59
+ {others.length > 0 && (
60
+ <p class="ms-tier-or">
61
+ or{' '}
62
+ {others.map((cadence, i) => (
63
+ <>
64
+ {i > 0 && ' or '}
65
+ <Price cents={offer.cents[cadence]!} cadence={cadence} />
66
+ </>
67
+ ))}
68
+ </p>
69
+ )}
70
+ {offer.model === 'donation' && <p class="ms-tier-or">You choose the amount</p>}
71
+ <Benefits items={m.benefits} class="ms-tier-benefits" />
72
+ </div>
73
+ {m.join && (
74
+ <a class:list={['button', 'ms-tier-join', !solid && 'button-quiet']} href={m.join.href} rel={m.join.rel}>
75
+ {m.join.label}
76
+ {m.offers.length > 1 && <span class="visually-hidden">: {offer.name}</span>}
77
+ </a>
78
+ )}
79
+ </li>
80
+ )
81
+ })}
82
+ </ul>
83
+ {m.note && <p class="fine ms-tiers-note">{m.note}</p>}
84
+ </Band>
85
+ )}
86
+
87
+ <style>
88
+ .ms-tiers {
89
+ display: grid;
90
+ gap: clamp(1rem, 2vw, 1.5rem);
91
+ margin: 0;
92
+ padding: 0;
93
+ list-style: none;
94
+ }
95
+ :global(.lede) + .ms-tiers {
96
+ margin-top: clamp(1.5rem, 1rem + 1.5vw, 2.5rem);
97
+ }
98
+ .ms-tier {
99
+ display: flex;
100
+ flex-direction: column;
101
+ min-width: 0;
102
+ padding: clamp(1.375rem, 1rem + 1vw, 1.875rem);
103
+ border: 1px solid var(--line);
104
+ border-radius: var(--radius-card);
105
+ background: var(--surface);
106
+ color: var(--ink);
107
+ --ms-price-size: clamp(2.5rem, 2rem + 1.5vw, 3.25rem);
108
+ }
109
+ :global(.bg-band-contrast) .ms-tier {
110
+ background: color-mix(in srgb, var(--ink) 7%, transparent);
111
+ }
112
+ .ms-tier-featured,
113
+ :global(.bg-band-contrast) .ms-tier-featured {
114
+ border-color: var(--button-2);
115
+ background: var(--button-2);
116
+ color: var(--button-2-ink);
117
+ box-shadow: var(--shadow);
118
+ --ms-check: var(--button-2-ink);
119
+ }
120
+ .ms-tier-head {
121
+ display: flex;
122
+ flex-wrap: wrap;
123
+ align-items: center;
124
+ gap: 0.5rem 0.75rem;
125
+ min-height: 1.75rem;
126
+ }
127
+ .ms-tier-name {
128
+ margin: 0;
129
+ color: var(--muted);
130
+ font-family: var(--font);
131
+ font-size: var(--text-xs);
132
+ font-weight: 700;
133
+ letter-spacing: 0.16em;
134
+ line-height: 1.4;
135
+ text-transform: uppercase;
136
+ }
137
+ .ms-tier-featured .ms-tier-name {
138
+ color: color-mix(in srgb, var(--button-2-ink) 78%, transparent);
139
+ }
140
+ .ms-tier-featured .ms-symbolic {
141
+ background: color-mix(in srgb, var(--button-2-ink) 16%, transparent);
142
+ color: var(--button-2-ink);
143
+ }
144
+ .ms-tier-price {
145
+ margin: 0.875rem 0 0;
146
+ line-height: 1.05;
147
+ }
148
+ .ms-tier-or {
149
+ margin: 0.5rem 0 0;
150
+ color: var(--muted);
151
+ font-size: 0.9375rem;
152
+ --ms-price-size: 1.0625rem;
153
+ }
154
+ .ms-tier-or :global(.ms-price-amount) {
155
+ font-family: var(--font);
156
+ font-weight: 700;
157
+ letter-spacing: 0;
158
+ }
159
+ .ms-tier-featured .ms-tier-or {
160
+ color: color-mix(in srgb, var(--button-2-ink) 82%, transparent);
161
+ }
162
+ .ms-tier :global(.ms-tier-benefits) {
163
+ margin: 1.375rem 0 0;
164
+ padding-top: 1.25rem;
165
+ border-top: 1px solid var(--line);
166
+ font-size: 0.9375rem;
167
+ }
168
+ .ms-tier-featured :global(.ms-tier-benefits) {
169
+ border-top-color: color-mix(in srgb, var(--button-2-ink) 22%, transparent);
170
+ }
171
+ .ms-tier-body {
172
+ flex: 1 0 auto;
173
+ }
174
+ .ms-tier-join {
175
+ display: flex;
176
+ width: 100%;
177
+ margin-top: 1.5rem;
178
+ }
179
+ .ms-tier-featured .button-quiet {
180
+ color: var(--button-2-ink);
181
+ }
182
+ .ms-tier-featured :focus-visible {
183
+ outline-color: var(--button-2-ink);
184
+ }
185
+ .ms-tiers-note {
186
+ margin: 1.25rem 0 0;
187
+ text-align: center;
188
+ }
189
+ [data-count='1'] {
190
+ max-width: 26rem;
191
+ margin-inline: auto;
192
+ }
193
+ @media (min-width: 40rem) {
194
+ .ms-tiers {
195
+ grid-template-columns: repeat(2, minmax(0, 1fr));
196
+ }
197
+ [data-count='1'] {
198
+ grid-template-columns: minmax(0, 1fr);
199
+ }
200
+ [data-count='2'] {
201
+ max-width: 48rem;
202
+ margin-inline: auto;
203
+ }
204
+ }
205
+ @media (min-width: 56rem) {
206
+ .ms-tiers[data-count='3'] {
207
+ grid-template-columns: repeat(3, minmax(0, 1fr));
208
+ align-items: center;
209
+ }
210
+ .ms-tiers[data-count='3'] .ms-tier {
211
+ height: calc(100% - 1.5rem);
212
+ }
213
+ .ms-tiers[data-count='3'] .ms-tier-featured {
214
+ height: 100%;
215
+ }
216
+ }
217
+ </style>
@@ -0,0 +1,50 @@
1
+ ---
2
+ // MovementMap: a kicker, a heading, and the live map BackGold frames when the
3
+ // section names a data source — the map a visitor zooms and explores, with its
4
+ // own legend, count badge, stat tiles and source line. A section with no data
5
+ // source sends no frame: then the figures the organization wrote and where
6
+ // the data comes from draw alone, as before. A figure BackGold fills in live
7
+ // is left out of that list (see literalStat).
8
+ import type { Section } from '@backgold/content'
9
+ import Band from '../Band.astro'
10
+ import ModuleFrame from '../modules/ModuleFrame.astro'
11
+ import { links, rows } from '../../../lib/section'
12
+ import { literalStat, text } from '../../../lib/format'
13
+
14
+ interface Props {
15
+ section: Section
16
+ variant?: string
17
+ }
18
+
19
+ const { section } = Astro.props
20
+ const kicker = text(section.copy.kicker)
21
+ const heading = text(section.copy.heading)
22
+ const framed = !!section.embed
23
+ const stats = framed
24
+ ? []
25
+ : rows(section)
26
+ .map((row) => ({ value: literalStat(row.value), label: text(row.label), note: text(row.note) }))
27
+ .filter((stat) => stat.value !== null)
28
+ const [source] = links(section)
29
+ ---
30
+ {(framed || heading || stats.length > 0) && (
31
+ <Band section={section} class="stats">
32
+ {kicker && <p class="kicker">{kicker}</p>}
33
+ {heading && <h2>{heading}</h2>}
34
+ {framed && (
35
+ <ModuleFrame embed={section.embed} band={section.band} type={section.type} layout="full" title={heading || 'Map'} height="44rem" />
36
+ )}
37
+ {stats.length > 0 && (
38
+ <ul class="grid grid-3 stat-list" role="list">
39
+ {stats.map((stat) => (
40
+ <li class="stat">
41
+ <p class="stat-value">{stat.value}</p>
42
+ {stat.label && <p class="stat-label">{stat.label}</p>}
43
+ {stat.note && <p class="stat-note">{stat.note}</p>}
44
+ </li>
45
+ ))}
46
+ </ul>
47
+ )}
48
+ {!framed && source && <p class="fine">Source: <a href={source.href} rel={source.rel}>{source.label}</a></p>}
49
+ </Band>
50
+ )}
@@ -0,0 +1,43 @@
1
+ ---
2
+ // MovementTicker: a heading and the live feed BackGold frames when the api
3
+ // sends one — the people signing, giving and RSVPing, with its count. A
4
+ // section with no frame draws the figures the organization wrote instead; a
5
+ // figure BackGold fills in live is left out of that list (see literalStat).
6
+ import type { Section } from '@backgold/content'
7
+ import Band from '../Band.astro'
8
+ import ModuleFrame from '../modules/ModuleFrame.astro'
9
+ import { rows } from '../../../lib/section'
10
+ import { literalStat, text } from '../../../lib/format'
11
+
12
+ interface Props {
13
+ section: Section
14
+ variant?: string
15
+ }
16
+
17
+ const { section } = Astro.props
18
+ const heading = text(section.copy.heading)
19
+ const framed = !!section.embed
20
+ const stats = framed
21
+ ? []
22
+ : rows(section)
23
+ .map((row) => ({ value: literalStat(row.value), label: text(row.label) }))
24
+ .filter((stat) => stat.value !== null)
25
+ ---
26
+ {(framed || stats.length > 0) && (
27
+ <Band section={section} class="ticker">
28
+ {heading && <h2>{heading}</h2>}
29
+ {framed && (
30
+ <ModuleFrame embed={section.embed} band={section.band} type={section.type} layout="ticker" title={heading || 'Activity'} height="28rem" />
31
+ )}
32
+ {stats.length > 0 && (
33
+ <ul class="grid grid-3 stat-list" role="list">
34
+ {stats.map((stat) => (
35
+ <li class="stat">
36
+ <p class="stat-value">{stat.value}</p>
37
+ {stat.label && <p class="stat-label">{stat.label}</p>}
38
+ </li>
39
+ ))}
40
+ </ul>
41
+ )}
42
+ </Band>
43
+ )}
@@ -0,0 +1,147 @@
1
+ ---
2
+ // The doors (mock 11, A), drawn by the Doors layout and by the Quiz layout
3
+ // while the quiz's script has not run: a card per pathway on the band's
4
+ // surface, as many across as there are pathways up to five on a wide screen
5
+ // (three on a tablet, two on a phone, one when there is one). Each card has
6
+ // the pathway's title, the line about who it is for in the muted ink, a bold
7
+ // "Leave with:" before its outcome, and `programsLabel` with an arrow at the
8
+ // foot in the link colour. The whole card is one link to the pathway's
9
+ // programs, named by its title; a pathway with no address is a card with no
10
+ // link and no label.
11
+ import type { Pathway } from './pathways'
12
+
13
+ interface Props {
14
+ pathways: Pathway[]
15
+ programsLabel: string | null
16
+ }
17
+
18
+ const { pathways, programsLabel } = Astro.props
19
+ const across = Math.min(pathways.length, 5)
20
+ ---
21
+ {pathways.length > 0 && (
22
+ <ul class:list={['doors', `doors-${across}`]} role="list">
23
+ {pathways.map((p) => (
24
+ <li class:list={['door', p.link && 'door-linked']}>
25
+ <h3 class="door-title">{p.link ? <a href={p.link.href} rel={p.link.rel}>{p.title}</a> : p.title}</h3>
26
+ {p.summary && <p class="door-summary">{p.summary}</p>}
27
+ {p.outcome && (
28
+ <p class="door-outcome"><b>Leave with:</b> {p.outcome}</p>
29
+ )}
30
+ {p.link && programsLabel && (
31
+ <p class="door-more">{programsLabel}<span aria-hidden="true"> →</span></p>
32
+ )}
33
+ </li>
34
+ ))}
35
+ </ul>
36
+ )}
37
+
38
+ <style>
39
+ .doors {
40
+ display: grid;
41
+ grid-template-columns: repeat(2, minmax(0, 1fr));
42
+ gap: 0.75rem;
43
+ margin: 0;
44
+ padding: 0;
45
+ list-style: none;
46
+ }
47
+ .doors-1 {
48
+ grid-template-columns: minmax(0, 1fr);
49
+ max-width: 24rem;
50
+ margin-inline: auto;
51
+ }
52
+ .door {
53
+ position: relative;
54
+ display: flex;
55
+ flex-direction: column;
56
+ gap: 0.625rem;
57
+ min-width: 0;
58
+ padding: 1rem 1rem 1.125rem;
59
+ border: 1px solid var(--line);
60
+ border-radius: var(--radius-card);
61
+ background: var(--surface);
62
+ }
63
+ .door > * {
64
+ margin: 0;
65
+ }
66
+ .door-title {
67
+ font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
68
+ font-weight: 700;
69
+ line-height: 1.2;
70
+ overflow-wrap: anywhere;
71
+ hyphens: auto;
72
+ }
73
+ .door-title a {
74
+ color: var(--ink);
75
+ text-decoration: none;
76
+ }
77
+ .door-title a::after {
78
+ content: '';
79
+ position: absolute;
80
+ inset: 0;
81
+ border-radius: inherit;
82
+ }
83
+ .door-title a:focus-visible {
84
+ outline: none;
85
+ }
86
+ .door-linked:hover {
87
+ border-color: var(--line-strong);
88
+ }
89
+ .door-linked:hover .door-more {
90
+ text-decoration: underline;
91
+ text-decoration-thickness: 1.5px;
92
+ text-underline-offset: 0.25em;
93
+ }
94
+ .door-linked:focus-within {
95
+ outline: 3px solid var(--ink);
96
+ outline-offset: 3px;
97
+ }
98
+ .door-summary {
99
+ color: var(--muted);
100
+ font-size: var(--text-sm);
101
+ line-height: 1.5;
102
+ }
103
+ .door-outcome {
104
+ font-size: var(--text-sm);
105
+ line-height: 1.5;
106
+ }
107
+ .door-outcome b {
108
+ font-weight: 700;
109
+ }
110
+ .door .door-more {
111
+ margin-top: auto;
112
+ padding-top: 0.25rem;
113
+ color: var(--link);
114
+ font-size: var(--text-sm);
115
+ font-weight: 700;
116
+ }
117
+ @media (min-width: 40rem) {
118
+ .doors {
119
+ gap: 1rem;
120
+ }
121
+ .doors-3,
122
+ .doors-4,
123
+ .doors-5 {
124
+ grid-template-columns: repeat(3, minmax(0, 1fr));
125
+ }
126
+ .doors-2 {
127
+ max-width: 44rem;
128
+ margin-inline: auto;
129
+ }
130
+ .door {
131
+ padding: 1.25rem 1.25rem 1.375rem;
132
+ }
133
+ }
134
+ @media (min-width: 60rem) {
135
+ .doors-4 {
136
+ grid-template-columns: repeat(4, minmax(0, 1fr));
137
+ }
138
+ .doors-5 {
139
+ grid-template-columns: repeat(5, minmax(0, 1fr));
140
+ }
141
+ }
142
+ @media (prefers-reduced-motion: no-preference) {
143
+ .door {
144
+ transition: border-color 0.15s ease;
145
+ }
146
+ }
147
+ </style>
@@ -0,0 +1,37 @@
1
+ ---
2
+ // The head the Doors and Quiz layouts open with (mock 11, A, "Which one is
3
+ // you?"): the kicker over the heading, then the body as the line under it,
4
+ // all centred over what follows. Draws nothing when there is none of them.
5
+ import Prose from '../../Prose.astro'
6
+ import SectionHead from '../SectionHead.astro'
7
+ import { prose } from '../../../lib/format'
8
+
9
+ interface Props {
10
+ kicker: string | null
11
+ heading: string | null
12
+ body: unknown
13
+ }
14
+
15
+ const { kicker, heading, body } = Astro.props
16
+ ---
17
+ {(kicker || heading || prose(body)) && (
18
+ <div class="pathways-head">
19
+ <SectionHead kicker={kicker} heading={heading} more={[]} />
20
+ <Prose value={body} class="lede" />
21
+ </div>
22
+ )}
23
+
24
+ <style>
25
+ .pathways-head {
26
+ text-align: center;
27
+ }
28
+ .pathways-head > :global(.section-head) {
29
+ justify-content: center;
30
+ }
31
+ .pathways-head > :global(.lede) {
32
+ margin: -0.5rem auto 1.75rem;
33
+ }
34
+ .pathways-head > :global(.lede > :last-child) {
35
+ margin-bottom: 0;
36
+ }
37
+ </style>
@@ -0,0 +1,27 @@
1
+ ---
2
+ // Pathways · Doors, the default (mock 11, A, "Five doors"): the kicker,
3
+ // heading and body centred ("Which path fits you?"), then a card per pathway,
4
+ // as many across as there are up to five, each one link to that pathway's
5
+ // programs (Doors.astro). With no pathways and no heading it draws nothing.
6
+ import type { Section } from '@backgold/content'
7
+ import Band from '../Band.astro'
8
+ import Doors from './Doors.astro'
9
+ import Head from './Head.astro'
10
+ import { pathwaysOf } from './pathways'
11
+ import { text } from '../../../lib/format'
12
+
13
+ interface Props {
14
+ section: Section
15
+ variant?: string
16
+ }
17
+
18
+ const { section } = Astro.props
19
+ const heading = text(section.copy.heading)
20
+ const pathways = pathwaysOf(section)
21
+ ---
22
+ {(pathways.length > 0 || heading) && (
23
+ <Band section={section} class="pathways pathways-doors">
24
+ <Head kicker={text(section.copy.kicker)} heading={heading} body={section.copy.body} />
25
+ <Doors pathways={pathways} programsLabel={text(section.copy.programsLabel)} />
26
+ </Band>
27
+ )}