@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,73 @@
1
+ ---
2
+ // QuickDonate, 'grid' layout, the default (board 01, A): the kicker as a
3
+ // chip, the heading and the body at the left, and the donate card at the
4
+ // right: the amounts three across with Other, the monthly switch when the
5
+ // section offers it, the one button and the note under it. Each amount hands
6
+ // its choice to the organization's own donate page in BackGold (`?amount=`,
7
+ // and `&frequency=monthly` with the switch on); nothing is collected here.
8
+ // On a phone the card follows the words. Without words the card stands alone,
9
+ // centred. Nothing is drawn when the section has no donate link.
10
+ import type { Section } from '@backgold/content'
11
+ import Band from '../Band.astro'
12
+ import Prose from '../../Prose.astro'
13
+ import DonateCard from './DonateCard.astro'
14
+ import { quickDonate } from './donate'
15
+ import { prose, text } from '../../../lib/format'
16
+
17
+ interface Props {
18
+ section: Section
19
+ variant?: string
20
+ }
21
+
22
+ const { section } = Astro.props
23
+ const qd = quickDonate(section)
24
+ const kicker = text(section.copy.kicker)
25
+ const heading = text(section.copy.heading)
26
+ const words = kicker || heading || prose(section.copy.body)
27
+ ---
28
+ {qd && (
29
+ <Band section={section} class="quick-donate">
30
+ <div class:list={['qd-grid', words && 'qd-grid-words']}>
31
+ {words && (
32
+ <div class="qd-words">
33
+ {kicker && <p class="chip qd-kicker">{kicker}</p>}
34
+ {heading && <h2>{heading}</h2>}
35
+ <Prose value={section.copy.body} class="lede" />
36
+ </div>
37
+ )}
38
+ <DonateCard qd={qd} />
39
+ </div>
40
+ </Band>
41
+ )}
42
+
43
+ <style>
44
+ .qd-grid {
45
+ display: grid;
46
+ gap: 1.75rem;
47
+ max-width: 30rem;
48
+ margin-inline: auto;
49
+ }
50
+ .qd-grid-words {
51
+ max-width: none;
52
+ }
53
+ .qd-kicker {
54
+ margin: 0 0 1rem;
55
+ }
56
+ .qd-words h2 {
57
+ margin: 0;
58
+ max-width: 16em;
59
+ }
60
+ .qd-words > :global(.lede) {
61
+ margin: 1rem 0 0;
62
+ }
63
+ .qd-words > :global(.lede) > :last-child {
64
+ margin-bottom: 0;
65
+ }
66
+ @media (min-width: 48rem) {
67
+ .qd-grid-words {
68
+ grid-template-columns: minmax(0, 1fr) minmax(0, 28rem);
69
+ gap: clamp(2rem, 4vw, 3.5rem);
70
+ align-items: center;
71
+ }
72
+ }
73
+ </style>
@@ -0,0 +1,225 @@
1
+ ---
2
+ // QuickDonate, 'jar' layout (board 16, A, without its note field: the donate
3
+ // page takes a note): a tip jar, one card centred on the band's surface. The
4
+ // section's picture as a small round portrait beside the heading and the
5
+ // body; then the unit ("× $5") and how many of it, 1, 3 or 5; the monthly
6
+ // switch when the section offers it; the one button; the note small under
7
+ // it. The unit is the section's default amount, else the first of its
8
+ // amounts: a jar asks for one thing, so any other amounts are not drawn, nor
9
+ // is the kicker. Without script each quantity is a plain link to the donate
10
+ // page with its total as `?amount=`, and the button carries one of the unit.
11
+ // With script (Picker.astro, which reads each quantity's total as its
12
+ // amount) a quantity is a toggle the button follows ("Support $15"), and
13
+ // the switch sets `&frequency=monthly`. A quantity whose total passes the
14
+ // donate page's $99,999 is left out. Nothing is drawn when the section has
15
+ // no donate link.
16
+ import type { ComponentProps } from 'astro/types'
17
+ import Band from '../Band.astro'
18
+ import Prose from '../../Prose.astro'
19
+ import Picker from './Picker.astro'
20
+ import type Default from './index.astro'
21
+ import { amountHref, dollars, giveLabel, jarOf, quickDonate } from './donate'
22
+ import { media } from '../../../lib/section'
23
+ import { prose, text } from '../../../lib/format'
24
+
25
+ type Props = ComponentProps<typeof Default>
26
+
27
+ const { section } = Astro.props
28
+ const qd = quickDonate(section)
29
+ const jar = qd ? jarOf(section, qd) : null
30
+ const heading = text(section.copy.heading)
31
+ const body = prose(section.copy.body)
32
+ const picture = media(section, 'imageUrl')
33
+ ---
34
+ {qd && jar && (
35
+ <Band section={section} class="quick-donate qd-jar-band">
36
+ <div class="qd-jar" data-quick-donate data-href={qd.donate.href} data-label={qd.donate.label}>
37
+ {(picture || heading || body) && (
38
+ <div class="qd-jar-head">
39
+ {picture && <img class="qd-jar-portrait" src={picture.url} alt={picture.alt} width="64" height="64" loading="lazy" decoding="async" />}
40
+ {(heading || body) && (
41
+ <div class="qd-jar-words">
42
+ {heading && <h2 class="qd-jar-heading">{heading}</h2>}
43
+ <Prose value={section.copy.body} class="qd-jar-body" />
44
+ </div>
45
+ )}
46
+ </div>
47
+ )}
48
+ <div class="qd-jar-pick">
49
+ <p class="qd-jar-unit" aria-hidden="true">× {dollars(jar.unit)}</p>
50
+ <ul class="qd-jar-counts" role="list" aria-label={`How many, at ${dollars(jar.unit)} each`}>
51
+ {jar.choices.map((choice, i) => (
52
+ <li>
53
+ <a class="qd-jar-count" href={amountHref(qd.donate.href, choice.amount)} rel={qd.donate.rel} data-amount={choice.amount} data-selected={i === 0 ? '' : undefined}>
54
+ {choice.count}<span class="visually-hidden"> for {dollars(choice.amount)}</span>
55
+ </a>
56
+ </li>
57
+ ))}
58
+ </ul>
59
+ </div>
60
+ {qd.monthly && (
61
+ <button type="button" class="qd-switch" role="switch" aria-checked="false" data-monthly hidden>
62
+ <span class="qd-switch-track" aria-hidden="true"><span class="qd-switch-thumb"></span></span>
63
+ <span>{qd.monthly}</span>
64
+ </button>
65
+ )}
66
+ <a class="button qd-jar-give" href={amountHref(qd.donate.href, jar.unit)} rel={qd.donate.rel} data-give>{giveLabel({ ...qd, selected: jar.unit })}</a>
67
+ {qd.note && <p class="fine qd-jar-note">{qd.note}</p>}
68
+ </div>
69
+ <Picker />
70
+ </Band>
71
+ )}
72
+
73
+ <style>
74
+ .qd-jar {
75
+ max-width: 30rem;
76
+ margin-inline: auto;
77
+ padding: clamp(1.25rem, 0.9rem + 1.2vw, 1.75rem);
78
+ background: var(--surface);
79
+ border: 1px solid var(--line);
80
+ border-radius: var(--radius-card);
81
+ box-shadow: var(--shadow);
82
+ color: var(--ink);
83
+ }
84
+ .qd-jar-head {
85
+ display: flex;
86
+ align-items: center;
87
+ gap: 0.875rem;
88
+ margin-bottom: 1.25rem;
89
+ }
90
+ .qd-jar-portrait {
91
+ flex: 0 0 auto;
92
+ width: 3.5rem;
93
+ height: 3.5rem;
94
+ border-radius: 50%;
95
+ object-fit: cover;
96
+ }
97
+ .qd-jar-words {
98
+ min-width: 0;
99
+ }
100
+ .qd-jar-heading {
101
+ margin: 0;
102
+ font-size: var(--h3);
103
+ line-height: 1.2;
104
+ }
105
+ .qd-jar-words > :global(.qd-jar-body) {
106
+ margin-top: 0.25rem;
107
+ color: var(--muted);
108
+ font-size: var(--text-sm);
109
+ line-height: 1.45;
110
+ }
111
+ .qd-jar-words > :global(.qd-jar-body) > :last-child {
112
+ margin-bottom: 0;
113
+ }
114
+ .qd-jar-words > :global(.qd-jar-body) :global(p) {
115
+ margin: 0 0 0.5rem;
116
+ }
117
+ .qd-jar-pick {
118
+ display: flex;
119
+ flex-wrap: wrap;
120
+ align-items: center;
121
+ gap: 0.75rem 1rem;
122
+ }
123
+ .qd-jar-unit {
124
+ margin: 0;
125
+ font-family: var(--font-display);
126
+ font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
127
+ font-weight: 700;
128
+ font-variant-numeric: lining-nums tabular-nums;
129
+ letter-spacing: -0.01em;
130
+ white-space: nowrap;
131
+ }
132
+ .qd-jar-counts {
133
+ display: flex;
134
+ gap: 0.625rem;
135
+ margin: 0;
136
+ padding: 0;
137
+ list-style: none;
138
+ }
139
+ .qd-jar-count {
140
+ display: grid;
141
+ place-items: center;
142
+ width: 3.25rem;
143
+ height: 3.25rem;
144
+ border: 2px solid var(--line-strong);
145
+ border-radius: 50%;
146
+ color: var(--ink);
147
+ font-family: var(--font-display);
148
+ font-size: 1.25rem;
149
+ font-weight: 700;
150
+ font-variant-numeric: lining-nums tabular-nums;
151
+ text-decoration: none;
152
+ }
153
+ .qd-jar-count:hover {
154
+ border-color: var(--ink);
155
+ }
156
+ .qd-jar-count[data-selected] {
157
+ background: var(--button-2);
158
+ border-color: var(--button-2);
159
+ color: var(--button-2-ink);
160
+ }
161
+ .qd-switch {
162
+ display: inline-flex;
163
+ align-items: center;
164
+ gap: 0.75rem;
165
+ min-height: 2.75rem;
166
+ margin: 0.875rem 0 0;
167
+ padding: 0 0.25rem 0 0;
168
+ border: 0;
169
+ background: none;
170
+ color: var(--ink);
171
+ font: inherit;
172
+ font-size: 0.9375rem;
173
+ font-weight: 600;
174
+ cursor: pointer;
175
+ }
176
+ .qd-switch[hidden] {
177
+ display: none;
178
+ }
179
+ .qd-switch-track {
180
+ position: relative;
181
+ flex: 0 0 auto;
182
+ width: 2.75rem;
183
+ height: 1.5rem;
184
+ border: 2px solid var(--line-strong);
185
+ border-radius: var(--pill);
186
+ }
187
+ .qd-switch-thumb {
188
+ position: absolute;
189
+ top: 0.1875rem;
190
+ left: 0.1875rem;
191
+ width: 0.875rem;
192
+ height: 0.875rem;
193
+ border-radius: 50%;
194
+ background: var(--muted);
195
+ }
196
+ .qd-switch[aria-checked='true'] .qd-switch-track {
197
+ background: var(--button-2);
198
+ border-color: var(--button-2);
199
+ }
200
+ .qd-switch[aria-checked='true'] .qd-switch-thumb {
201
+ background: var(--button-2-ink);
202
+ transform: translateX(1.25rem);
203
+ }
204
+ .qd-jar-give {
205
+ display: flex;
206
+ width: 100%;
207
+ margin-top: 1rem;
208
+ font-size: var(--text);
209
+ }
210
+ .qd-jar-note {
211
+ margin: 0.75rem 0 0;
212
+ text-align: center;
213
+ }
214
+ @media (prefers-reduced-motion: no-preference) {
215
+ .qd-jar-count,
216
+ .qd-switch-track,
217
+ .qd-switch-thumb {
218
+ transition:
219
+ background-color 0.15s ease,
220
+ border-color 0.15s ease,
221
+ color 0.15s ease,
222
+ transform 0.15s ease;
223
+ }
224
+ }
225
+ </style>
@@ -0,0 +1,248 @@
1
+ ---
2
+ // QuickDonate, 'ladder' layout (REPORT §2 G4, the impact ladder): the kicker
3
+ // as a chip, the heading and the body at the left as the grid layout draws
4
+ // them, and at the right a card holding the ladder, one rung per row: the
5
+ // amount large in the display face and what it does beside it ("$25 — 50
6
+ // doors knocked"), in the order the section lists its `ladder` rows. Under the
7
+ // rungs a small Other amount link, the monthly switch when the section offers
8
+ // it, the one button and the note under it, as DonateCard draws them.
9
+ // Every rung is a plain link to the organization's own donate page in
10
+ // BackGold with its `?amount=`, and Other links there with none, so without
11
+ // script a rung is the gift. Picker.astro, right after the card, makes the
12
+ // rungs a choice instead: picking one marks it and the button's address and
13
+ // words ("Donate $100") follow. The section's default amount starts
14
+ // selected when it is a rung. Nothing is collected here and no raised
15
+ // figures or donor counts are shown. On a phone the card follows the
16
+ // words; without words the card stands alone, centred. Without rungs the
17
+ // grid layout is drawn; nothing is drawn when the section has no donate link.
18
+ import type { ComponentProps } from 'astro/types'
19
+ import Band from '../Band.astro'
20
+ import Prose from '../../Prose.astro'
21
+ import Picker from './Picker.astro'
22
+ import Default from './index.astro'
23
+ import { amountHref, dollars, giveLabel, ladderOf, presetOf, quickDonate } from './donate'
24
+ import { prose, text } from '../../../lib/format'
25
+
26
+ type Props = ComponentProps<typeof Default>
27
+
28
+ const { section } = Astro.props
29
+ const found = quickDonate(section)
30
+ const rungs = ladderOf(section)
31
+ // The rungs are this layout's amounts: the default amount starts selected when it is one of them.
32
+ const preset = presetOf(section)
33
+ const qd = found && { ...found, selected: rungs.some((rung) => rung.amount === preset) ? preset : null }
34
+ const kicker = text(section.copy.kicker)
35
+ const heading = text(section.copy.heading)
36
+ const words = kicker || heading || prose(section.copy.body)
37
+ ---
38
+ {qd && rungs.length === 0 && <Default {...Astro.props} />}
39
+ {qd && rungs.length > 0 && (
40
+ <Band section={section} class="quick-donate qd-ladder">
41
+ <div class:list={['qd-ladder-grid', words && 'qd-ladder-words']}>
42
+ {words && (
43
+ <div class="qd-words">
44
+ {kicker && <p class="chip qd-kicker">{kicker}</p>}
45
+ {heading && <h2>{heading}</h2>}
46
+ <Prose value={section.copy.body} class="lede" />
47
+ </div>
48
+ )}
49
+ <div class="qd-ladder-card" data-quick-donate data-href={qd.donate.href} data-label={qd.donate.label}>
50
+ <ul class="qd-rungs" role="list" aria-label="Choose an amount">
51
+ {rungs.map((rung) => (
52
+ <li>
53
+ <a class="qd-rung" href={amountHref(qd.donate.href, rung.amount)} rel={qd.donate.rel} data-amount={rung.amount} data-selected={rung.amount === qd.selected ? '' : undefined}>
54
+ <span class="qd-rung-amount">{dollars(rung.amount)}</span>
55
+ <span class="visually-hidden"> — </span>
56
+ <span class="qd-rung-impact">{rung.impact}</span>
57
+ </a>
58
+ </li>
59
+ ))}
60
+ </ul>
61
+ <p class="qd-other-line">
62
+ <a class="qd-other" href={amountHref(qd.donate.href, null)} rel={qd.donate.rel} data-other>Other amount</a>
63
+ </p>
64
+ {qd.monthly && (
65
+ <button type="button" class="qd-switch" role="switch" aria-checked="false" data-monthly hidden>
66
+ <span class="qd-switch-track" aria-hidden="true"><span class="qd-switch-thumb"></span></span>
67
+ <span>{qd.monthly}</span>
68
+ </button>
69
+ )}
70
+ <a class="button qd-give" href={amountHref(qd.donate.href, qd.selected)} rel={qd.donate.rel} data-give>{giveLabel(qd)}</a>
71
+ {qd.note && <p class="fine qd-note">{qd.note}</p>}
72
+ </div>
73
+ <Picker />
74
+ </div>
75
+ </Band>
76
+ )}
77
+
78
+ <style>
79
+ .qd-ladder-grid {
80
+ display: grid;
81
+ gap: 1.75rem;
82
+ max-width: 32rem;
83
+ margin-inline: auto;
84
+ }
85
+ .qd-ladder-words {
86
+ max-width: none;
87
+ }
88
+ .qd-kicker {
89
+ margin: 0 0 1rem;
90
+ }
91
+ .qd-words h2 {
92
+ margin: 0;
93
+ max-width: 16em;
94
+ }
95
+ .qd-words > :global(.lede) {
96
+ margin: 1rem 0 0;
97
+ }
98
+ .qd-words > :global(.lede) > :last-child {
99
+ margin-bottom: 0;
100
+ }
101
+
102
+ .qd-ladder-card {
103
+ padding: clamp(1.25rem, 0.9rem + 1.2vw, 1.75rem);
104
+ background: var(--surface);
105
+ border: 1px solid var(--line);
106
+ border-radius: var(--radius-card);
107
+ box-shadow: var(--shadow);
108
+ color: var(--ink);
109
+ }
110
+ /* The amounts share one column, as wide as the widest, so the impacts line up (each rung its own two columns where subgrid is missing). */
111
+ .qd-rungs {
112
+ display: grid;
113
+ grid-template-columns: max-content minmax(0, 1fr);
114
+ gap: 0.625rem;
115
+ margin: 0;
116
+ padding: 0;
117
+ list-style: none;
118
+ }
119
+ .qd-rungs > li {
120
+ display: grid;
121
+ grid-column: 1 / -1;
122
+ grid-template-columns: max-content minmax(0, 1fr);
123
+ grid-template-columns: subgrid;
124
+ }
125
+ .qd-rung {
126
+ display: grid;
127
+ grid-column: 1 / -1;
128
+ grid-template-columns: max-content minmax(0, 1fr);
129
+ grid-template-columns: subgrid;
130
+ column-gap: 1rem;
131
+ align-items: center;
132
+ min-height: 3.5rem;
133
+ padding: 0.625rem 1rem;
134
+ border: 2px solid var(--line-strong);
135
+ border-radius: var(--radius);
136
+ color: var(--ink);
137
+ text-decoration: none;
138
+ }
139
+ .qd-rung:hover {
140
+ border-color: var(--ink);
141
+ }
142
+ .qd-rung[data-selected] {
143
+ background: var(--button-2);
144
+ border-color: var(--button-2);
145
+ color: var(--button-2-ink);
146
+ }
147
+ .qd-rung-amount {
148
+ font-family: var(--font-display);
149
+ font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem);
150
+ font-weight: 700;
151
+ font-variant-numeric: lining-nums tabular-nums;
152
+ letter-spacing: -0.01em;
153
+ line-height: 1.1;
154
+ }
155
+ .qd-rung-impact {
156
+ font-size: var(--text);
157
+ font-weight: 600;
158
+ line-height: 1.3;
159
+ }
160
+ .qd-other-line {
161
+ margin: 0.25rem 0 0;
162
+ font-size: var(--text-sm);
163
+ }
164
+ /* A small link with a full-size tap target. */
165
+ .qd-other {
166
+ display: inline-flex;
167
+ align-items: center;
168
+ min-height: 2.75rem;
169
+ color: var(--link);
170
+ font-weight: 600;
171
+ text-decoration: underline;
172
+ text-decoration-thickness: 1.5px;
173
+ text-underline-offset: 0.25em;
174
+ }
175
+
176
+ .qd-switch {
177
+ display: inline-flex;
178
+ align-items: center;
179
+ gap: 0.75rem;
180
+ min-height: 2.75rem;
181
+ margin: 0.25rem 0 0;
182
+ padding: 0 0.25rem 0 0;
183
+ border: 0;
184
+ background: none;
185
+ color: var(--ink);
186
+ font: inherit;
187
+ font-size: 0.9375rem;
188
+ font-weight: 600;
189
+ cursor: pointer;
190
+ }
191
+ .qd-switch[hidden] {
192
+ display: none;
193
+ }
194
+ .qd-switch-track {
195
+ position: relative;
196
+ flex: 0 0 auto;
197
+ width: 2.75rem;
198
+ height: 1.5rem;
199
+ border: 2px solid var(--line-strong);
200
+ border-radius: var(--pill);
201
+ }
202
+ .qd-switch-thumb {
203
+ position: absolute;
204
+ top: 0.1875rem;
205
+ left: 0.1875rem;
206
+ width: 0.875rem;
207
+ height: 0.875rem;
208
+ border-radius: 50%;
209
+ background: var(--muted);
210
+ }
211
+ .qd-switch[aria-checked='true'] .qd-switch-track {
212
+ background: var(--button-2);
213
+ border-color: var(--button-2);
214
+ }
215
+ .qd-switch[aria-checked='true'] .qd-switch-thumb {
216
+ background: var(--button-2-ink);
217
+ transform: translateX(1.25rem);
218
+ }
219
+ .qd-give {
220
+ display: flex;
221
+ width: 100%;
222
+ margin-top: 0.875rem;
223
+ font-size: var(--text);
224
+ }
225
+ .qd-note {
226
+ margin: 0.75rem 0 0;
227
+ text-align: center;
228
+ }
229
+
230
+ @media (min-width: 48rem) {
231
+ .qd-ladder-words {
232
+ grid-template-columns: minmax(0, 1fr) minmax(0, 30rem);
233
+ gap: clamp(2rem, 4vw, 3.5rem);
234
+ align-items: center;
235
+ }
236
+ }
237
+ @media (prefers-reduced-motion: no-preference) {
238
+ .qd-rung,
239
+ .qd-switch-track,
240
+ .qd-switch-thumb {
241
+ transition:
242
+ background-color 0.15s ease,
243
+ border-color 0.15s ease,
244
+ color 0.15s ease,
245
+ transform 0.15s ease;
246
+ }
247
+ }
248
+ </style>