@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,148 @@
1
+ ---
2
+ // Financials, 'bars' layout, the default (REPORT §2 G15, "where the money
3
+ // goes"): the head (the kicker, the heading with the year as a chip, the
4
+ // body), then the figures on the band's surface, one row each: the category
5
+ // with its note small under it, a bar across a track whose fill is the
6
+ // row's `share` percent of the track, then the share ("62%") and the
7
+ // amount beside it. A figure with no share has no bar and no share, only
8
+ // its words. Under the figures, `sourceNote` as a fine line and the report
9
+ // link as the one button.
10
+ //
11
+ // Every number is the organization's own, drawn as given: a bar is as long
12
+ // as its share says, the bars are never scaled to one another, and nothing
13
+ // is summed or derived. On a phone the category and the numbers share a line
14
+ // over the bar. Nothing is drawn with neither a heading nor a figure.
15
+ import type { Section } from '@backgold/content'
16
+ import Band from '../Band.astro'
17
+ import { text } from '../../../lib/format'
18
+ import Head from './Head.astro'
19
+ import Foot from './Foot.astro'
20
+ import { rowsOf, shareLabel } from './financials'
21
+
22
+ interface Props {
23
+ section: Section
24
+ variant?: string
25
+ }
26
+
27
+ const { section } = Astro.props
28
+ const heading = text(section.copy.heading)
29
+ const figures = rowsOf(section)
30
+ ---
31
+ {(heading || figures.length > 0) && (
32
+ <Band section={section} class="financials financials-bars">
33
+ <Head section={section} />
34
+ {figures.length > 0 && (
35
+ <ul class="figures" role="list">
36
+ {figures.map((figure) => (
37
+ <li class="figure">
38
+ <div class="figure-words">
39
+ {figure.category && <p class="figure-category">{figure.category}</p>}
40
+ {figure.note && <p class="figure-note">{figure.note}</p>}
41
+ </div>
42
+ {figure.share !== null && (
43
+ <span class="figure-track" aria-hidden="true">
44
+ <span class="figure-fill" style={`--share: ${figure.share}`}></span>
45
+ </span>
46
+ )}
47
+ {(figure.share !== null || figure.amount) && (
48
+ <p class="figure-numbers">
49
+ {figure.share !== null && <strong class="figure-share">{shareLabel(figure.share)}</strong>}
50
+ {figure.amount && <span class="figure-amount">{figure.amount}</span>}
51
+ </p>
52
+ )}
53
+ </li>
54
+ ))}
55
+ </ul>
56
+ )}
57
+ <Foot section={section} />
58
+ </Band>
59
+ )}
60
+
61
+ <style>
62
+ .figures {
63
+ margin: 0;
64
+ padding: 0.25rem clamp(1rem, 0.5rem + 2vw, 1.75rem);
65
+ list-style: none;
66
+ border: 1px solid var(--line);
67
+ border-radius: var(--radius-card);
68
+ background: var(--surface);
69
+ }
70
+ /*
71
+ A figure: the words at the left, the track in the middle, the numbers at
72
+ the right; the track takes the room the other two leave.
73
+ */
74
+ .figure {
75
+ display: grid;
76
+ grid-template-columns: minmax(9rem, 17rem) minmax(0, 1fr) minmax(7.5rem, auto);
77
+ grid-template-areas: 'words track numbers';
78
+ align-items: center;
79
+ gap: 0.375rem clamp(1rem, 0.5rem + 2vw, 2rem);
80
+ padding: 1.125rem 0;
81
+ border-bottom: 1px solid var(--line);
82
+ }
83
+ .figure:last-child {
84
+ border-bottom: 0;
85
+ }
86
+ .figure-words {
87
+ grid-area: words;
88
+ min-width: 0;
89
+ }
90
+ .figure-category {
91
+ margin: 0;
92
+ font-weight: 700;
93
+ line-height: 1.3;
94
+ }
95
+ .figure-note {
96
+ margin: 0.25rem 0 0;
97
+ color: var(--muted);
98
+ font-size: var(--text-sm);
99
+ line-height: 1.4;
100
+ }
101
+ .figure-track {
102
+ grid-area: track;
103
+ display: block;
104
+ height: 0.875rem;
105
+ border-radius: var(--pill);
106
+ background: color-mix(in srgb, var(--ink) 10%, transparent);
107
+ overflow: hidden;
108
+ }
109
+ .figure-fill {
110
+ display: block;
111
+ width: calc(var(--share) * 1%);
112
+ height: 100%;
113
+ border-radius: var(--pill);
114
+ background: var(--button);
115
+ }
116
+ .figure-numbers {
117
+ grid-area: numbers;
118
+ display: flex;
119
+ flex-direction: column;
120
+ align-items: flex-end;
121
+ gap: 0.125rem;
122
+ margin: 0;
123
+ text-align: right;
124
+ font-variant-numeric: tabular-nums;
125
+ }
126
+ .figure-share {
127
+ font-family: var(--font-display);
128
+ font-size: var(--text-lg);
129
+ font-weight: 700;
130
+ line-height: 1.15;
131
+ }
132
+ .figure-amount {
133
+ color: var(--muted);
134
+ font-size: var(--text-sm);
135
+ font-weight: 600;
136
+ }
137
+ /* A phone: the words and the numbers on one line, the track under them. */
138
+ @media (max-width: 39.99rem) {
139
+ .figure {
140
+ grid-template-columns: minmax(0, 1fr) auto;
141
+ grid-template-areas:
142
+ 'words numbers'
143
+ 'track track';
144
+ align-items: start;
145
+ gap: 0.625rem 1rem;
146
+ }
147
+ }
148
+ </style>
@@ -0,0 +1,157 @@
1
+ ---
2
+ // Financials, 'table' layout (REPORT §2 G15, "where the money goes"): the
3
+ // head (the kicker, the heading with the year as a chip, the body), then the
4
+ // figures as a table on the band's surface, Category · Share · Amount ·
5
+ // Note, then `sourceNote` as a fine line and the report link as the one
6
+ // button. A column no figure fills is left out. The share ("62%") and the
7
+ // amount sit right-aligned in tabular figures, each as the organization
8
+ // published it: no total row, nothing summed or derived. The caption, for a
9
+ // screen reader, is the heading and the year.
10
+ //
11
+ // On a phone each figure is a block: the category with the share and the
12
+ // amount at its right, the note under them. Nothing is drawn with neither a
13
+ // heading nor a figure.
14
+ import type { ComponentProps } from 'astro/types'
15
+ import type Default from './index.astro'
16
+ import Band from '../Band.astro'
17
+ import { text } from '../../../lib/format'
18
+ import Head from './Head.astro'
19
+ import Foot from './Foot.astro'
20
+ import { rowsOf, shareLabel } from './financials'
21
+
22
+ type Props = ComponentProps<typeof Default>
23
+
24
+ const { section } = Astro.props
25
+ const heading = text(section.copy.heading)
26
+ const year = text(section.copy.year)
27
+ const figures = rowsOf(section)
28
+ const has = {
29
+ category: figures.some((f) => f.category),
30
+ share: figures.some((f) => f.share !== null),
31
+ amount: figures.some((f) => f.amount),
32
+ note: figures.some((f) => f.note),
33
+ }
34
+ const caption = [heading, year].filter(Boolean).join(', ')
35
+ ---
36
+ {(heading || figures.length > 0) && (
37
+ <Band section={section} class="financials financials-table">
38
+ <Head section={section} />
39
+ {figures.length > 0 && (
40
+ <div class="ledger-frame">
41
+ <table class="ledger">
42
+ {caption && <caption class="visually-hidden">{caption}</caption>}
43
+ <thead>
44
+ <tr>
45
+ {has.category && <th scope="col">Category</th>}
46
+ {has.share && <th scope="col" class="ledger-number">Share</th>}
47
+ {has.amount && <th scope="col" class="ledger-number">Amount</th>}
48
+ {has.note && <th scope="col">Note</th>}
49
+ </tr>
50
+ </thead>
51
+ <tbody>
52
+ {figures.map((figure) => (
53
+ <tr class="ledger-row">
54
+ {has.category && <th scope="row" class="ledger-category">{figure.category}</th>}
55
+ {has.share && <td class="ledger-number ledger-share">{figure.share !== null ? shareLabel(figure.share) : ''}</td>}
56
+ {has.amount && <td class="ledger-number ledger-amount">{figure.amount}</td>}
57
+ {has.note && <td class="ledger-note">{figure.note}</td>}
58
+ </tr>
59
+ ))}
60
+ </tbody>
61
+ </table>
62
+ </div>
63
+ )}
64
+ <Foot section={section} />
65
+ </Band>
66
+ )}
67
+
68
+ <style>
69
+ .ledger-frame {
70
+ border: 1px solid var(--line);
71
+ border-radius: var(--radius-card);
72
+ background: var(--surface);
73
+ overflow: hidden;
74
+ }
75
+ .ledger {
76
+ width: 100%;
77
+ border-collapse: collapse;
78
+ }
79
+ .ledger th,
80
+ .ledger td {
81
+ padding: 0.9375rem 1.125rem;
82
+ border-bottom: 1px solid var(--line);
83
+ text-align: left;
84
+ vertical-align: baseline;
85
+ }
86
+ .ledger thead th {
87
+ padding-block: 0.75rem;
88
+ border-bottom-color: var(--line-strong);
89
+ background: color-mix(in srgb, var(--ink) 5%, transparent);
90
+ color: var(--muted);
91
+ font-size: var(--text-sm);
92
+ font-weight: 700;
93
+ letter-spacing: 0.08em;
94
+ text-transform: uppercase;
95
+ }
96
+ .ledger-row:last-child > * {
97
+ border-bottom: 0;
98
+ }
99
+ .ledger .ledger-number {
100
+ text-align: right;
101
+ font-variant-numeric: tabular-nums;
102
+ white-space: nowrap;
103
+ }
104
+ .ledger .ledger-category {
105
+ font-weight: 700;
106
+ }
107
+ .ledger-share {
108
+ font-family: var(--font-display);
109
+ font-size: var(--text-lg);
110
+ font-weight: 700;
111
+ }
112
+ .ledger-amount {
113
+ font-weight: 600;
114
+ }
115
+ .ledger-note {
116
+ color: var(--muted);
117
+ font-size: var(--text-sm);
118
+ }
119
+ /* A phone: each figure a block, the category and its numbers on a line, the note under them. */
120
+ @media (max-width: 39.99rem) {
121
+ .ledger thead {
122
+ position: absolute;
123
+ width: 1px;
124
+ height: 1px;
125
+ overflow: hidden;
126
+ clip: rect(0 0 0 0);
127
+ white-space: nowrap;
128
+ }
129
+ .ledger,
130
+ .ledger tbody {
131
+ display: block;
132
+ }
133
+ .ledger-row {
134
+ display: grid;
135
+ grid-template-columns: minmax(0, 1fr) auto auto;
136
+ align-items: baseline;
137
+ gap: 0.25rem 1rem;
138
+ padding: 1rem 1.125rem;
139
+ border-bottom: 1px solid var(--line);
140
+ }
141
+ .ledger-row:last-child {
142
+ border-bottom: 0;
143
+ }
144
+ .ledger .ledger-row > * {
145
+ display: block;
146
+ padding: 0;
147
+ border: 0;
148
+ }
149
+ .ledger .ledger-note {
150
+ grid-column: 1 / -1;
151
+ }
152
+ .ledger .ledger-note:empty,
153
+ .ledger .ledger-share:empty {
154
+ display: none;
155
+ }
156
+ }
157
+ </style>
@@ -0,0 +1,33 @@
1
+ ---
2
+ // FormBlock · Card (board A12, the default): one of the organization's forms
3
+ // on a raised card, its title inside the card, one field to a row, narrow and
4
+ // centred. FormBlock · Wide (A11) is the same card at the full content width,
5
+ // where BackGold lays the fields two to a row. The form is BackGold's frame
6
+ // (ModuleFrame); this draws the card and the title, and the card says so when
7
+ // there is no form to frame.
8
+ import type { Section } from '@backgold/content'
9
+ import Band from '../Band.astro'
10
+ import ModuleFrame from '../modules/ModuleFrame.astro'
11
+ import { text } from '../../../lib/format'
12
+
13
+ interface Props {
14
+ section: Section
15
+ variant?: string
16
+ }
17
+
18
+ const { section, variant } = Astro.props
19
+ const layout = variant === 'wide' ? 'wide' : 'card'
20
+ const heading = text(section.copy.heading)
21
+ ---
22
+ <Band section={section} class:list={['form-module', `form-module-${layout}`]}>
23
+ <ModuleFrame embed={section.embed} band={section.band} type={section.type} layout={layout} card title={heading ?? 'Form'} height={layout === 'wide' ? '34rem' : '40rem'}>
24
+ {heading && <h3>{heading}</h3>}
25
+ </ModuleFrame>
26
+ </Band>
27
+
28
+ <style>
29
+ :global(.form-module-card .module) {
30
+ max-width: 38rem;
31
+ margin-inline: auto;
32
+ }
33
+ </style>
@@ -0,0 +1,7 @@
1
+ ---
2
+ import type { ComponentProps } from 'astro/types'
3
+ import Default from './index.astro'
4
+
5
+ type Props = ComponentProps<typeof Default>
6
+ ---
7
+ <Default {...Astro.props} variant="wide" />
@@ -0,0 +1,170 @@
1
+ ---
2
+ // Hero, 'cover' layout (Full photo; board A1-home, section 1, and A13): the
3
+ // photo fills the band edge to edge and the kicker, the headline, the line
4
+ // under it and the buttons sit over its lower edge on a fixed scrim (A1 note
5
+ // 2: legibility is not a taste, there is no overlay option), in the photo
6
+ // band's inks so they read on any photo. The headline's last word is set in
7
+ // the accent, in italic (A1's "Fewer *excuses.*"): the contract carries no
8
+ // mark for it, so the template takes the last word. The photo's alt text is
9
+ // `copy.imageAlt`, and its caption, when the section carries one
10
+ // (`copy.caption`), sits at the photo's lower left. The first button is the
11
+ // main call, the rest outlines. Without a photo it draws the same words on
12
+ // the section's own band, with no caption. The page-opening
13
+ // Hero's headline is the page's <h1> (`level={1}`); any other Hero's is an
14
+ // <h2>. A Hero with its signup form on carries an `embed`: BackGold's own
15
+ // form, framed under the buttons.
16
+ import type { ComponentProps } from 'astro/types'
17
+ import { Embed } from '@backgold/astro/components'
18
+ import Band from '../Band.astro'
19
+ import type Default from './index.astro'
20
+ import { heroPhoto, links } from '../../../lib/section'
21
+ import { text } from '../../../lib/format'
22
+
23
+ type Props = ComponentProps<typeof Default>
24
+
25
+ const { section, level = 2 } = Astro.props
26
+ const Heading = level === 1 ? 'h1' : 'h2'
27
+ const kicker = text(section.copy.kicker)
28
+ const headline = text(section.copy.headline)?.trim() ?? null
29
+ const subheadline = text(section.copy.subheadline)
30
+ const caption = text(section.copy.caption)
31
+ const picture = heroPhoto(section, 'imageUrl', 'photoUrl', 'videoPosterUrl')
32
+ const buttons = links(section)
33
+ // "More freedom. Fewer " and "excuses.": the last word apart, for the accent.
34
+ const split = headline ? /^(.*\s)(\S+)$/su.exec(headline) : null
35
+ const [lead, last] = split ? [split[1]!, split[2]!] : [headline ?? '', null]
36
+ ---
37
+ <Band section={section} class:list={['hero-cover', picture && 'hero-cover-photo']}>
38
+ {picture && (
39
+ <>
40
+ <img
41
+ class="cover-image"
42
+ src={picture.url}
43
+ alt={picture.alt}
44
+ loading={level === 1 ? 'eager' : 'lazy'}
45
+ fetchpriority={level === 1 ? 'high' : undefined}
46
+ decoding="async"
47
+ />
48
+ <div class="cover-scrim" aria-hidden="true"></div>
49
+ {caption && <p class="cover-caption">{caption}</p>}
50
+ </>
51
+ )}
52
+ <div class:list={['cover-words', picture && 'on-photo']}>
53
+ {kicker && <p class="kicker">{kicker}</p>}
54
+ {headline && <Heading class="cover-headline">{lead}{last && <em>{last}</em>}</Heading>}
55
+ {subheadline && <p class="cover-lede">{subheadline}</p>}
56
+ {buttons.length > 0 && (
57
+ <p class="actions">
58
+ {buttons.map((link, i) => <a class:list={['button', i > 0 && 'button-quiet']} href={link.href} rel={link.rel}>{link.label}</a>)}
59
+ </p>
60
+ )}
61
+ {section.embed && <Embed embed={section.embed} title="Sign up" />}
62
+ </div>
63
+ </Band>
64
+
65
+ <style>
66
+ /* The band itself: the photo's frame. Band.astro renders it, so it is reached through its class. */
67
+ :global(.bg-section.hero-cover-photo) {
68
+ position: relative;
69
+ isolation: isolate;
70
+ overflow: hidden;
71
+ display: flex;
72
+ align-items: flex-end;
73
+ min-height: 32.5rem;
74
+ --bg-section-padding: var(--space) var(--gutter) clamp(2.25rem, 1.5rem + 2.5vw, 4rem);
75
+ }
76
+ :global(.bg-section.hero-cover-photo) > :global(.bg-section-inner) {
77
+ width: 100%;
78
+ }
79
+ /* The photo is not the band's ground: the band after it keeps its own top padding. */
80
+ :global(.bg-section.bg-bleed-full.hero-cover-photo + .bg-section.bg-bleed-full) {
81
+ padding-top: var(--space);
82
+ }
83
+
84
+ .cover-image {
85
+ position: absolute;
86
+ inset: 0;
87
+ z-index: -2;
88
+ width: 100%;
89
+ height: 100%;
90
+ max-width: none;
91
+ object-fit: cover;
92
+ }
93
+ /* A1's scrim: light at the top, deep where the words are, so they read on any photo. */
94
+ .cover-scrim {
95
+ position: absolute;
96
+ inset: 0;
97
+ z-index: -1;
98
+ background: linear-gradient(
99
+ 180deg,
100
+ color-mix(in srgb, var(--band-photo) 10%, transparent) 0%,
101
+ color-mix(in srgb, var(--band-photo) 35%, transparent) 30%,
102
+ color-mix(in srgb, var(--band-photo) 80%, transparent) 62%,
103
+ color-mix(in srgb, var(--band-photo) 92%, transparent) 100%
104
+ );
105
+ }
106
+ .cover-caption {
107
+ position: absolute;
108
+ left: 0.75rem;
109
+ bottom: 0.625rem;
110
+ z-index: 1;
111
+ max-width: calc(100% - 1.5rem);
112
+ margin: 0;
113
+ padding: 0.1875rem 0.5rem;
114
+ border-radius: 0.25rem;
115
+ background: color-mix(in srgb, var(--band-photo) 70%, transparent);
116
+ color: var(--band-photo-ink);
117
+ font-size: 0.6875rem;
118
+ line-height: 1.4;
119
+ }
120
+
121
+ .cover-words .kicker {
122
+ margin-bottom: 0.875rem;
123
+ }
124
+ .cover-headline {
125
+ font-size: clamp(2.75rem, 1.4rem + 4.9vw, 5.25rem);
126
+ font-weight: 800;
127
+ line-height: 0.96;
128
+ letter-spacing: -0.03em;
129
+ max-width: 11em;
130
+ margin: 0;
131
+ }
132
+ .cover-headline em {
133
+ font-style: italic;
134
+ font-weight: 500;
135
+ color: var(--accent);
136
+ }
137
+ .cover-lede {
138
+ font-size: var(--text-lg);
139
+ color: var(--muted);
140
+ max-width: 34em;
141
+ margin: 1.375rem 0 0;
142
+ }
143
+ .on-photo .cover-lede {
144
+ color: color-mix(in srgb, var(--ink) 92%, transparent);
145
+ }
146
+ .cover-words .actions {
147
+ margin-top: 1.875rem;
148
+ }
149
+ .cover-words > :global(.bg-embed) {
150
+ margin-top: 1.5rem;
151
+ }
152
+ @media (min-width: 48rem) {
153
+ :global(.bg-section.hero-cover-photo) {
154
+ min-height: 37.5rem;
155
+ }
156
+ }
157
+ @media (prefers-reduced-motion: no-preference) {
158
+ .cover-headline,
159
+ .cover-lede {
160
+ animation: cover-rise 0.4s ease-out both;
161
+ }
162
+ }
163
+ /* A1's motion note: the headline and lede rise 12px and fade in once on load. */
164
+ @keyframes cover-rise {
165
+ from {
166
+ opacity: 0;
167
+ transform: translateY(0.75rem);
168
+ }
169
+ }
170
+ </style>