@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,108 @@
1
+ ---
2
+ // One of the Press kit's cards (board 15, A): on the band's surface, its
3
+ // label ("Short bio") with the word count beside it, muted, and the Copy
4
+ // button at the right; the words under it, a bio as its paragraphs. The
5
+ // button is drawn hidden; the Press kit's script shows it where the
6
+ // browser can copy, and copies the words under it (`data-kit-text`).
7
+ import Prose from '../../Prose.astro'
8
+ import { wordCount } from './kit'
9
+
10
+ interface Props {
11
+ label: string
12
+ value: string
13
+ level: 'h2' | 'h3'
14
+ /** Whether to show the word count (a bio's; not the fact sheet's line). */
15
+ count?: boolean
16
+ }
17
+
18
+ const { label, value, level: Label, count = true } = Astro.props
19
+ const words = count ? wordCount(value) : 0
20
+ ---
21
+ <li class="bio-card" data-kit-card>
22
+ <div class="bio-card-head">
23
+ <Label class="bio-card-label">{label}</Label>
24
+ {words > 0 && <span class="bio-card-count">{words === 1 ? '1 word' : `${words} words`}</span>}
25
+ <button type="button" class="bio-card-copy" data-kit-copy data-kit-copied={`${label} copied.`} hidden>
26
+ <svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true" focusable="false">
27
+ <path d="M9 9h10v11H9zM5 15V4h10" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" />
28
+ </svg>
29
+ <span data-kit-copy-label>Copy</span><span class="visually-hidden"> {label.toLowerCase()}</span>
30
+ </button>
31
+ </div>
32
+ <div class="bio-card-text" data-kit-text>
33
+ {count ? <Prose value={value} /> : <p>{value}</p>}
34
+ </div>
35
+ </li>
36
+
37
+ <style>
38
+ .bio-card {
39
+ min-width: 0;
40
+ padding: 1rem 1.125rem 1.125rem;
41
+ border: 1px solid var(--line);
42
+ border-radius: var(--radius);
43
+ background: var(--surface);
44
+ }
45
+ .bio-card-head {
46
+ display: flex;
47
+ flex-wrap: wrap;
48
+ align-items: center;
49
+ gap: 0.25rem 0.75rem;
50
+ margin-bottom: 0.375rem;
51
+ }
52
+ .bio-card-head .bio-card-label {
53
+ margin: 0;
54
+ font-family: var(--font);
55
+ font-size: var(--text);
56
+ font-weight: 700;
57
+ letter-spacing: 0;
58
+ line-height: 1.3;
59
+ }
60
+ .bio-card-count {
61
+ color: var(--muted);
62
+ font-size: var(--text-xs);
63
+ font-weight: 600;
64
+ }
65
+ .bio-card-copy {
66
+ display: inline-flex;
67
+ align-items: center;
68
+ gap: 0.375rem;
69
+ min-height: 2.75rem;
70
+ margin: -0.625rem -0.625rem -0.625rem auto;
71
+ padding: 0 0.75rem;
72
+ border: 0;
73
+ border-radius: var(--pill);
74
+ background: transparent;
75
+ color: var(--link);
76
+ font: inherit;
77
+ font-size: var(--text-sm);
78
+ font-weight: 700;
79
+ cursor: pointer;
80
+ }
81
+ .bio-card-copy[hidden] {
82
+ display: none;
83
+ }
84
+ .bio-card-copy:hover {
85
+ text-decoration: underline;
86
+ text-underline-offset: 0.18em;
87
+ }
88
+ .bio-card-text {
89
+ color: var(--muted);
90
+ font-size: var(--text-sm);
91
+ line-height: 1.6;
92
+ }
93
+ .bio-card-text :global(.prose) {
94
+ max-width: none;
95
+ line-height: inherit;
96
+ }
97
+ .bio-card-text :global(p) {
98
+ margin: 0;
99
+ }
100
+ .bio-card-text :global(p + p) {
101
+ margin-top: 0.625rem;
102
+ }
103
+ @media (min-width: 40rem) {
104
+ .bio-card {
105
+ padding: 1.125rem 1.375rem 1.25rem;
106
+ }
107
+ }
108
+ </style>
@@ -0,0 +1,88 @@
1
+ ---
2
+ // The Press kit's downloads (board 15, A): each an outline button with a
3
+ // download mark, the asset's title and its detail ("JPG · 2 MB") small,
4
+ // wrapping onto as many rows as they need. A download with no address is
5
+ // its words alone, not a button.
6
+ import type { KitRow } from './kit'
7
+
8
+ interface Props {
9
+ assets: KitRow[]
10
+ }
11
+
12
+ const { assets } = Astro.props
13
+ ---
14
+ {assets.length > 0 && (
15
+ <ul class="kit-assets" role="list">
16
+ {assets.map((asset) => (
17
+ <li>
18
+ {asset.link ? (
19
+ <a class="button button-quiet kit-asset" href={asset.link.href} rel={asset.link.rel}>
20
+ <svg class="kit-asset-mark" viewBox="0 0 24 24" width="18" height="18" aria-hidden="true" focusable="false">
21
+ <path d="M12 4v11m0 0-4.5-4.5M12 15l4.5-4.5M5 19.5h14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
22
+ </svg>
23
+ <span class="kit-asset-words">
24
+ <span class="kit-asset-title">{asset.title}</span>
25
+ {asset.detail && <span class="kit-asset-detail">{asset.detail}</span>}
26
+ </span>
27
+ </a>
28
+ ) : (
29
+ <p class="kit-asset-plain">
30
+ <span class="kit-asset-title">{asset.title}</span>
31
+ {asset.detail && <span class="kit-asset-detail">{asset.detail}</span>}
32
+ </p>
33
+ )}
34
+ </li>
35
+ ))}
36
+ </ul>
37
+ )}
38
+
39
+ <style>
40
+ .kit-assets {
41
+ display: flex;
42
+ flex-wrap: wrap;
43
+ gap: 0.625rem;
44
+ margin: 0;
45
+ padding: 0;
46
+ list-style: none;
47
+ }
48
+ .kit-assets > li {
49
+ min-width: 0;
50
+ max-width: 100%;
51
+ }
52
+ .kit-asset {
53
+ justify-content: flex-start;
54
+ gap: 0.625rem;
55
+ max-width: 100%;
56
+ padding: 0.5rem 1.125rem 0.5rem 0.875rem;
57
+ border-width: 1.5px;
58
+ text-align: left;
59
+ }
60
+ .kit-asset-mark {
61
+ flex: 0 0 auto;
62
+ }
63
+ .kit-asset-words {
64
+ display: flex;
65
+ flex-wrap: wrap;
66
+ align-items: baseline;
67
+ gap: 0 0.5rem;
68
+ min-width: 0;
69
+ }
70
+ .kit-asset-title {
71
+ overflow-wrap: anywhere;
72
+ }
73
+ .kit-asset-detail {
74
+ color: var(--muted);
75
+ font-size: var(--text-xs);
76
+ font-weight: 600;
77
+ }
78
+ .kit-asset-plain {
79
+ display: flex;
80
+ flex-wrap: wrap;
81
+ align-items: baseline;
82
+ gap: 0 0.5rem;
83
+ margin: 0;
84
+ padding: 0.5rem 0;
85
+ font-size: 0.9375rem;
86
+ font-weight: 700;
87
+ }
88
+ </style>
@@ -0,0 +1,183 @@
1
+ ---
2
+ // MediaKit · Press kit, the default (board 15, A): everything a booker or a
3
+ // reporter takes away. At the left the headshot (`imageUrl`), 4:5 with
4
+ // rounded corners, and under it the downloads (the rows of kind `asset`,
5
+ // drawn by Downloads.astro), each an outline button with its title and its
6
+ // detail ("JPG · 2 MB") small. At the right the kicker, the name
7
+ // (`heading`) large in the display face, the line under it (`role`) muted,
8
+ // then a card on the band's surface for each of the short bio, the long bio
9
+ // and the fact sheet that the copy has (BioCard.astro), each with a Copy
10
+ // button that puts the card's words on the clipboard; the button reads
11
+ // "Copied" for a moment and a status line says which card was copied. The
12
+ // Copy buttons are drawn hidden and shown by the section's script where the
13
+ // browser can copy, so with scripts off nothing is offered that cannot
14
+ // work. The press kit link (`kitLabel` → `kitHref`) is the section's one
15
+ // button, under the cards. Without a headshot the words take the full width
16
+ // and the downloads sit under the cards. Talks, appearances and mentions
17
+ // are the other layouts'. With no name and no download it draws nothing.
18
+ import type { Section } from '@backgold/content'
19
+ import Band from '../Band.astro'
20
+ import BioCard from './BioCard.astro'
21
+ import Downloads from './Downloads.astro'
22
+ import { mediaKitOf } from './kit'
23
+ import { text } from '../../../lib/format'
24
+
25
+ interface Props {
26
+ section: Section
27
+ variant?: string
28
+ }
29
+
30
+ const { section } = Astro.props
31
+ const found = mediaKitOf(section)
32
+ const { assets, photo } = found
33
+ const shortBio = text(section.copy.shortBio)
34
+ const longBio = text(section.copy.longBio)
35
+ const level = found.heading ? 'h3' : 'h2'
36
+ ---
37
+ {(found.heading || assets.length > 0) && (
38
+ <Band section={section} class="mediakit mediakit-kit">
39
+ <div class:list={['kit', photo && 'kit-split']} data-kit>
40
+ {photo && (
41
+ <div class="kit-aside">
42
+ <img class="kit-photo" src={photo.url} alt={photo.alt || found.heading || ''} loading="lazy" decoding="async" />
43
+ <Downloads assets={assets} />
44
+ </div>
45
+ )}
46
+ <div class="kit-words">
47
+ {(found.kicker || found.heading || found.role) && (
48
+ <div class="kit-head">
49
+ {found.kicker && <p class="kicker">{found.kicker}</p>}
50
+ {found.heading && <h2 class="kit-name">{found.heading}</h2>}
51
+ {found.role && <p class="kit-role">{found.role}</p>}
52
+ </div>
53
+ )}
54
+ {(shortBio || longBio || found.facts) && (
55
+ <ul class="kit-cards" role="list">
56
+ {shortBio && <BioCard label="Short bio" value={shortBio} level={level} />}
57
+ {longBio && <BioCard label="Long bio" value={longBio} level={level} />}
58
+ {found.facts && <BioCard label="Fact sheet" value={found.facts} level={level} count={false} />}
59
+ </ul>
60
+ )}
61
+ {!photo && assets.length > 0 && (
62
+ <div class="kit-downloads">
63
+ <Downloads assets={assets} />
64
+ </div>
65
+ )}
66
+ {found.kit && (
67
+ <p class="kit-action">
68
+ <a class="button" href={found.kit.href} rel={found.kit.rel}>{found.kit.label}</a>
69
+ </p>
70
+ )}
71
+ </div>
72
+ {(shortBio || longBio || found.facts) && (
73
+ <>
74
+ <p class="visually-hidden" role="status" data-kit-status></p>
75
+ <script is:inline>
76
+ ;(function (root) {
77
+ if (!root || !navigator.clipboard) return
78
+ var status = root.querySelector('[data-kit-status]')
79
+ var buttons = root.querySelectorAll('[data-kit-copy]')
80
+ var say = function (words) {
81
+ status.textContent = ''
82
+ setTimeout(function () {
83
+ status.textContent = words
84
+ }, 50)
85
+ }
86
+ var arm = function (button) {
87
+ var label = button.querySelector('[data-kit-copy-label]')
88
+ var card = button.closest('[data-kit-card]')
89
+ var words = card.querySelector('[data-kit-text]')
90
+ var timer = 0
91
+ button.addEventListener('click', function () {
92
+ navigator.clipboard.writeText(words.innerText.trim()).then(
93
+ function () {
94
+ label.textContent = 'Copied'
95
+ say(button.getAttribute('data-kit-copied'))
96
+ clearTimeout(timer)
97
+ timer = setTimeout(function () {
98
+ label.textContent = 'Copy'
99
+ }, 2500)
100
+ },
101
+ function () {
102
+ say('Could not copy. Select the words and copy them instead.')
103
+ },
104
+ )
105
+ })
106
+ button.hidden = false
107
+ }
108
+ for (var i = 0; i < buttons.length; i++) arm(buttons[i])
109
+ })(document.currentScript.closest('[data-kit]'))
110
+ </script>
111
+ </>
112
+ )}
113
+ </div>
114
+ </Band>
115
+ )}
116
+
117
+ <style>
118
+ .kit {
119
+ display: grid;
120
+ gap: 1.75rem;
121
+ }
122
+ .kit-aside {
123
+ display: grid;
124
+ gap: 1rem;
125
+ align-content: start;
126
+ min-width: 0;
127
+ }
128
+ .kit-photo {
129
+ display: block;
130
+ width: 100%;
131
+ max-width: 22rem;
132
+ aspect-ratio: 4 / 5;
133
+ object-fit: cover;
134
+ border-radius: var(--radius-card);
135
+ background: var(--surface);
136
+ }
137
+ .kit-words {
138
+ min-width: 0;
139
+ }
140
+ .kit-head > * {
141
+ margin: 0;
142
+ }
143
+ .kit-head .kit-name {
144
+ font-size: clamp(2.125rem, 1.5rem + 2.2vw, 3.25rem);
145
+ font-weight: 800;
146
+ line-height: 1.04;
147
+ }
148
+ .kit-head .kit-role {
149
+ margin-top: 0.625rem;
150
+ color: var(--muted);
151
+ font-size: var(--text-lg);
152
+ }
153
+ .kit-cards {
154
+ display: grid;
155
+ gap: 0.75rem;
156
+ margin: 1.5rem 0 0;
157
+ padding: 0;
158
+ list-style: none;
159
+ }
160
+ .kit-head + .kit-cards {
161
+ margin-top: 1.75rem;
162
+ }
163
+ .kit-cards:first-child {
164
+ margin-top: 0;
165
+ }
166
+ .kit-downloads,
167
+ .kit-action {
168
+ margin: 1.5rem 0 0;
169
+ }
170
+ .kit-words > :first-child {
171
+ margin-top: 0;
172
+ }
173
+ @media (min-width: 48rem) {
174
+ .kit-split {
175
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
176
+ gap: clamp(2rem, 4vw, 3rem);
177
+ align-items: start;
178
+ }
179
+ .kit-photo {
180
+ max-width: none;
181
+ }
182
+ }
183
+ </style>
@@ -0,0 +1,140 @@
1
+ // A MediaKit section as its layouts draw it: what a booker or a reporter
2
+ // needs about one person or organization. The copy carries the name
3
+ // (`heading`), the line under it (`role`), the two bios, the facts line and
4
+ // the words of the talks heading and the contact card; the media its
5
+ // headshot (`imageUrl`). The Content API sends the two links without their
6
+ // keys, so each is told apart by its label, as VoterTools does: the one
7
+ // labelled with `bookLabel` is the booking link, the one labelled with
8
+ // `kitLabel` the press kit.
9
+ //
10
+ // The authored list (`mediakit`) holds rows of four kinds, in row order:
11
+ // asset a download (`title`, `detail` "JPG · 2 MB", `href`)
12
+ // talk a talk the person gives (`title`, `detail` "45 min keynote")
13
+ // appearance a past appearance (`outlet`, else `title`; `href`)
14
+ // mention a press mention (`outlet`, `title`, `detail`, `date`, `href`)
15
+ // A row of no known kind is left out, as is a row with nothing to name it
16
+ // by: an appearance needs an outlet or a title, the others a title. A
17
+ // `date` is kept only when it is a calendar day (YYYY-MM-DD).
18
+
19
+ import type { Section } from '@backgold/content'
20
+ import { safeHref } from '@backgold/astro/server'
21
+ import { linkOf, media, rows, type Link, type Media } from '../../../lib/section'
22
+ import { formatDay, text } from '../../../lib/format'
23
+
24
+ const CALENDAR_DAY = /^\d{4}-\d{2}-\d{2}$/
25
+
26
+ export interface KitRow {
27
+ /** The row's title, or for an appearance with none, its outlet. */
28
+ title: string
29
+ detail: string | null
30
+ outlet: string | null
31
+ /** The row's YYYY-MM-DD, for `<time datetime>`; null when it has no usable date. */
32
+ day: string | null
33
+ /** "March 14, 2026" */
34
+ dayLabel: string | null
35
+ /** The row's link, named by its title, when it has a safe address. */
36
+ link: Link | null
37
+ }
38
+
39
+ export interface MediaKit {
40
+ kicker: string | null
41
+ heading: string | null
42
+ role: string | null
43
+ facts: string | null
44
+ talksHeading: string | null
45
+ contactHeading: string | null
46
+ contactLine: string | null
47
+ photo: Media | null
48
+ book: Link | null
49
+ kit: Link | null
50
+ assets: KitRow[]
51
+ talks: KitRow[]
52
+ appearances: KitRow[]
53
+ mentions: KitRow[]
54
+ }
55
+
56
+ export function mediaKitOf(section: Section): MediaKit {
57
+ const copy = section.copy
58
+ const bookLabel = text(copy.bookLabel)
59
+ const kitLabel = text(copy.kitLabel)
60
+ let book: Link | null = null
61
+ let kit: Link | null = null
62
+ for (const raw of section.links ?? []) {
63
+ const link = linkOf(raw.label, raw.url)
64
+ if (!link) continue
65
+ if (!book && link.label === bookLabel) book = link
66
+ else if (!kit && link.label === kitLabel) kit = link
67
+ }
68
+ const found: Record<'asset' | 'talk' | 'appearance' | 'mention', KitRow[]> = { asset: [], talk: [], appearance: [], mention: [] }
69
+ for (const row of rows(section)) {
70
+ const kind = row.kind
71
+ if (kind !== 'asset' && kind !== 'talk' && kind !== 'appearance' && kind !== 'mention') continue
72
+ const outlet = text(row.outlet)?.trim() ?? null
73
+ const title = text(row.title)?.trim() ?? (kind === 'appearance' ? outlet : null)
74
+ if (!title) continue
75
+ const raw = text(row.date)?.trim() ?? null
76
+ const day = raw && CALENDAR_DAY.test(raw) && formatDay(raw) ? raw : null
77
+ found[kind].push({
78
+ title,
79
+ detail: text(row.detail)?.trim() ?? null,
80
+ outlet,
81
+ day,
82
+ dayLabel: formatDay(day),
83
+ link: linkOf(title, row.href),
84
+ })
85
+ }
86
+ return {
87
+ kicker: text(copy.kicker),
88
+ heading: text(copy.heading),
89
+ role: text(copy.role),
90
+ facts: text(copy.facts),
91
+ talksHeading: text(copy.talksHeading),
92
+ contactHeading: text(copy.contactHeading),
93
+ contactLine: text(copy.contactLine),
94
+ photo: media(section, 'imageUrl'),
95
+ book,
96
+ kit,
97
+ assets: found.asset,
98
+ talks: found.talk,
99
+ appearances: found.appearance,
100
+ mentions: found.mention,
101
+ }
102
+ }
103
+
104
+ /** The number of words in a bio, its markup dropped: the bio card's "48 words". */
105
+ export function wordCount(value: unknown): number {
106
+ const raw = text(value)
107
+ if (!raw) return 0
108
+ return raw.replace(/<[^>]*>/g, ' ').split(/\s+/).filter((word) => /[\p{L}\p{N}]/u.test(word)).length
109
+ }
110
+
111
+ export interface ContactPart {
112
+ text: string
113
+ /** A mailto: address for an email, the address itself for a URL; null for plain words. */
114
+ href: string | null
115
+ }
116
+
117
+ // An email address, or an http(s) address up to the next space.
118
+ const CONTACT_ADDRESS = /([\w.+-]+@[\w-]+(?:\.[\w-]+)+)|(https?:\/\/[^\s<>"]+)/gi
119
+
120
+ /**
121
+ * The contact line in parts: each email address a mailto: link, each web
122
+ * address a link (trailing punctuation left outside it), the words between
123
+ * as they were written.
124
+ */
125
+ export function contactParts(line: string): ContactPart[] {
126
+ const parts: ContactPart[] = []
127
+ let at = 0
128
+ for (const match of line.matchAll(CONTACT_ADDRESS)) {
129
+ let found = match[0]
130
+ if (match[2]) found = found.replace(/[.,;:!?)\]]+$/, '')
131
+ const start = match.index ?? 0
132
+ const href = safeHref(match[1] ? `mailto:${found}` : found)
133
+ if (!href) continue
134
+ if (start > at) parts.push({ text: line.slice(at, start), href: null })
135
+ parts.push({ text: found, href })
136
+ at = start + found.length
137
+ }
138
+ if (at < line.length) parts.push({ text: line.slice(at), href: null })
139
+ return parts
140
+ }