@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,123 @@
1
+ ---
2
+ // A course's head (board D2): "Course · 12 lessons · 1 h 1 min" as the
3
+ // kicker, the title, the summary, and for a visitor the course's bar with
4
+ // "4 of 12 · 38 min left" and "Lesson 4 finished on Tuesday" (the newest
5
+ // lesson the visitor finished, when the api says when); then the one accent button, "Continue · Lesson 5"
6
+ // with the lesson's title and length under it ("Start · Lesson 1" before the
7
+ // first lesson is finished, nothing once the course is finished, which says
8
+ // Finished instead). Signed out, the line under it says why to sign in. The
9
+ // cover sits at the right (`cover`), above the words on a phone.
10
+ import Bar from './Bar.astro'
11
+ import Icon from './Icon.astro'
12
+ import type { CourseView } from './course'
13
+ import { clockOf, countAndLength, leftOf, stateOf } from '../../../lib/academy'
14
+
15
+ interface Props {
16
+ view: CourseView
17
+ /** The title is the page's <h1> (the course's own page) rather than an <h2>. */
18
+ lead: boolean
19
+ cover: boolean
20
+ }
21
+
22
+ const { view, lead, cover } = Astro.props
23
+ const Title = lead ? 'h1' : 'h2'
24
+ const finished = view.progress ? stateOf(view.progress) === 'finished' : false
25
+ const left = view.progress ? leftOf(view.progress) : null
26
+ const nextLength = view.next ? clockOf(view.next.row.seconds) : null
27
+ ---
28
+ <header class:list={['cs-head', cover && view.cover && 'cs-head-cover']}>
29
+ {cover && view.cover && <img class="cs-cover" src={view.cover} alt="" decoding="async" />}
30
+ <div class="cs-words">
31
+ <p class="kicker">Course · {countAndLength(view.lessons, view.seconds)}</p>
32
+ <Title class="cs-title">{view.title}</Title>
33
+ {view.summary && <p class="lede cs-summary">{view.summary}</p>}
34
+ {view.progress && (
35
+ <div class="cs-progress">
36
+ <Bar completed={view.progress.completed} total={view.progress.total} label={`${view.title}: ${view.progress.completed} of ${view.progress.total} lessons`} />
37
+ <p class="cs-figures">
38
+ <strong>{view.progress.completed} of {view.progress.total}</strong>
39
+ {left && !finished && <> · {left}</>}
40
+ {finished && <span class="cs-finished"> · <Icon name="check" /> Finished</span>}
41
+ </p>
42
+ {view.lastFinished && <p class="fine cs-last">Lesson {view.lastFinished.n} finished {view.lastFinished.on}</p>}
43
+ </div>
44
+ )}
45
+ {view.next && !finished && (
46
+ <div class="cs-next">
47
+ <a class="button" href={view.next.row.href ?? undefined}>{view.next.verb} · Lesson {view.next.row.n}</a>
48
+ <p class="fine">{nextLength ? `${view.next.row.name} · ${nextLength}` : view.next.row.name}</p>
49
+ </div>
50
+ )}
51
+ {!view.visitor && (
52
+ <p class="fine cs-sign-in">
53
+ Sign in with your email and the Academy keeps your place in every course. <a class="text-link" href={view.signIn}>Sign in</a>
54
+ </p>
55
+ )}
56
+ </div>
57
+ </header>
58
+
59
+ <style>
60
+ .cs-head {
61
+ display: grid;
62
+ gap: 1.5rem;
63
+ margin-bottom: clamp(2rem, 1.5rem + 2vw, 3rem);
64
+ }
65
+ .cs-words {
66
+ display: grid;
67
+ gap: 0.875rem;
68
+ align-content: start;
69
+ min-width: 0;
70
+ }
71
+ .cs-words > * {
72
+ margin: 0;
73
+ }
74
+ .cs-title {
75
+ font-size: var(--h1);
76
+ }
77
+ .cs-cover {
78
+ display: block;
79
+ width: 100%;
80
+ aspect-ratio: 16 / 10;
81
+ border-radius: var(--radius-card);
82
+ object-fit: cover;
83
+ }
84
+ .cs-progress {
85
+ display: grid;
86
+ gap: 0.5rem;
87
+ max-width: 26rem;
88
+ }
89
+ .cs-progress > * {
90
+ margin: 0;
91
+ }
92
+ .cs-figures {
93
+ color: var(--muted);
94
+ font-size: var(--text-sm);
95
+ font-variant-numeric: tabular-nums;
96
+ }
97
+ .cs-figures strong,
98
+ .cs-finished {
99
+ color: var(--ink);
100
+ }
101
+ .cs-next {
102
+ display: grid;
103
+ justify-items: start;
104
+ gap: 0.5rem;
105
+ margin-top: 0.5rem;
106
+ }
107
+ .cs-next > * {
108
+ margin: 0;
109
+ }
110
+ .cs-next .button:focus-visible {
111
+ outline-color: var(--link);
112
+ }
113
+ @media (min-width: 56rem) {
114
+ .cs-head-cover {
115
+ grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
116
+ gap: 3rem;
117
+ align-items: center;
118
+ }
119
+ .cs-head-cover .cs-cover {
120
+ order: 2;
121
+ }
122
+ }
123
+ </style>
@@ -0,0 +1,44 @@
1
+ ---
2
+ // The academy's breadcrumb (boards D2, D3): "Courses › Foundational
3
+ // Leadership" on a course, "Courses › Foundational Leadership › Lesson 5" on
4
+ // a lesson, the last step the page itself.
5
+ interface Props {
6
+ steps: { label: string; href: string | null }[]
7
+ }
8
+
9
+ const { steps } = Astro.props
10
+ ---
11
+ <nav class="ac-crumbs" aria-label="Breadcrumb">
12
+ <ol role="list">
13
+ {steps.map((step, i) => (
14
+ <li>
15
+ {i < steps.length - 1 && step.href ? <a href={step.href}>{step.label}</a> : <span aria-current={i === steps.length - 1 ? 'page' : undefined}>{step.label}</span>}
16
+ </li>
17
+ ))}
18
+ </ol>
19
+ </nav>
20
+
21
+ <style>
22
+ .ac-crumbs ol {
23
+ display: flex;
24
+ flex-wrap: wrap;
25
+ gap: 0.25rem 0;
26
+ margin: 0 0 1.25rem;
27
+ padding: 0;
28
+ list-style: none;
29
+ color: var(--muted);
30
+ font-size: var(--text-sm);
31
+ }
32
+ .ac-crumbs li + li::before {
33
+ content: '›';
34
+ padding: 0 0.5rem;
35
+ color: var(--muted);
36
+ }
37
+ .ac-crumbs a {
38
+ color: var(--link);
39
+ font-weight: 600;
40
+ }
41
+ .ac-crumbs [aria-current] {
42
+ color: var(--ink);
43
+ }
44
+ </style>
@@ -0,0 +1,29 @@
1
+ ---
2
+ // The academy's two marks: the check beside Done and Finished, the lock
3
+ // beside For members and Sign in to watch. Each only repeats the word
4
+ // printed next to it, so it is hidden from screen readers.
5
+ interface Props {
6
+ name: 'check' | 'lock'
7
+ class?: string
8
+ }
9
+
10
+ const { name, class: className } = Astro.props
11
+ ---
12
+ <svg class:list={['ac-icon', className]} viewBox="0 0 20 20" width="16" height="16" aria-hidden="true" focusable="false">
13
+ {name === 'check' && <path d="M4.5 10.5l3.5 3.5 7.5-8" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" />}
14
+ {name === 'lock' && (
15
+ <>
16
+ <rect x="4" y="9" width="12" height="8.5" rx="2" fill="none" stroke="currentColor" stroke-width="1.8" />
17
+ <path d="M6.75 9V6.75a3.25 3.25 0 0 1 6.5 0V9" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" />
18
+ </>
19
+ )}
20
+ </svg>
21
+
22
+ <style>
23
+ .ac-icon {
24
+ flex: none;
25
+ width: 1em;
26
+ height: 1em;
27
+ vertical-align: -0.125em;
28
+ }
29
+ </style>
@@ -0,0 +1,62 @@
1
+ ---
2
+ // A course's ring (board L1's cards, L2's course head, L3's rail): a circle
3
+ // whose arc is `value` of `max`, drawn at its value. The arc has a
4
+ // pathLength of 100, so its dash offset is the share left to go and a
5
+ // template can draw it in from 0 by animating `stroke-dashoffset` from 100
6
+ // on `.ac-ring-arc`. It only repeats the words printed beside it ("4 of 12"),
7
+ // so it is hidden from screen readers. `size` is its width in pixels and
8
+ // `stroke` the line's width as a share of it (out of 40); the track reads
9
+ // --ring-track (else the ink at 16%) and the arc --ring-arc (else the
10
+ // accent). With nothing done, only the track is drawn.
11
+ interface Props {
12
+ value: number
13
+ max: number
14
+ size?: number
15
+ stroke?: number
16
+ class?: string
17
+ }
18
+
19
+ const { value, max, size = 56, stroke = 3.5, class: className } = Astro.props
20
+ const share = max > 0 && Number.isFinite(value) ? Math.min(Math.max(value / max, 0), 1) : 0
21
+ const percent = Math.round(share * 1000) / 10
22
+ const r = 20 - stroke / 2
23
+ ---
24
+ <svg class:list={['ac-ring', className]} viewBox="0 0 40 40" width={size} height={size} aria-hidden="true" focusable="false">
25
+ <circle class="ac-ring-track" cx="20" cy="20" r={r} fill="none" stroke-width={stroke} />
26
+ {percent > 0 && (
27
+ <circle
28
+ class="ac-ring-arc"
29
+ cx="20"
30
+ cy="20"
31
+ r={r}
32
+ fill="none"
33
+ stroke-width={stroke}
34
+ stroke-linecap={percent < 100 ? 'round' : 'butt'}
35
+ pathLength="100"
36
+ stroke-dasharray="100 100"
37
+ stroke-dashoffset={100 - percent}
38
+ transform="rotate(-90 20 20)"
39
+ />
40
+ )}
41
+ </svg>
42
+
43
+ <style>
44
+ .ac-ring {
45
+ display: block;
46
+ flex: none;
47
+ }
48
+ .ac-ring-track {
49
+ stroke: var(--ring-track, color-mix(in srgb, var(--ink) 16%, transparent));
50
+ }
51
+ .ac-ring-arc {
52
+ stroke: var(--ring-arc, var(--accent));
53
+ }
54
+ @media (forced-colors: active) {
55
+ .ac-ring-track {
56
+ stroke: GrayText;
57
+ }
58
+ .ac-ring-arc {
59
+ stroke: CanvasText;
60
+ }
61
+ }
62
+ </style>
@@ -0,0 +1,146 @@
1
+ ---
2
+ // A course's lessons in order (board D2's syllabus): each row the lesson's
3
+ // mark (its number, the check when this visitor finished it, the lock when
4
+ // they cannot open it), "Lesson 5: Decide what you want" (the whole row is
5
+ // the link to the lesson; a locked one opens its door), the state in words
6
+ // (Done, Up next, For members with Join to watch, Sign in to watch) and the
7
+ // lesson's length at the right.
8
+ import Icon from './Icon.astro'
9
+ import type { SyllabusRow } from './course'
10
+ import { clockOf, lessonTitle } from '../../../lib/academy'
11
+
12
+ interface Props {
13
+ rows: SyllabusRow[]
14
+ }
15
+
16
+ const { rows } = Astro.props
17
+ ---
18
+ <ol class="cs-rows" role="list">
19
+ {rows.map((row) => (
20
+ <li class:list={['cs-row', `cs-row-${row.state}`, row.href && 'cs-row-linked']}>
21
+ <span class="cs-mark" aria-hidden="true">{row.state === 'done' ? <Icon name="check" /> : row.state === 'locked' ? <Icon name="lock" /> : row.n}</span>
22
+ <span class="cs-name">{row.href ? <a href={row.href}>{lessonTitle(row.n, row.name)}</a> : lessonTitle(row.n, row.name)}</span>
23
+ <span class="cs-word">
24
+ {row.state === 'done' && 'Done'}
25
+ {row.state === 'next' && 'Up next'}
26
+ {row.state === 'locked' && (
27
+ <>
28
+ {row.lockWord}
29
+ {row.lock?.reason === 'members' && <span class="cs-join">Join to watch</span>}
30
+ </>
31
+ )}
32
+ </span>
33
+ {clockOf(row.seconds) && <span class="cs-len">{clockOf(row.seconds)}</span>}
34
+ </li>
35
+ ))}
36
+ </ol>
37
+
38
+ <style>
39
+ .cs-rows {
40
+ display: grid;
41
+ margin: 0;
42
+ padding: 0;
43
+ list-style: none;
44
+ border-top: 1px solid var(--line);
45
+ }
46
+ .cs-row {
47
+ position: relative;
48
+ display: grid;
49
+ grid-template-columns: 2rem minmax(0, 1fr) auto;
50
+ grid-template-areas: 'mark name len' 'mark word word';
51
+ gap: 0.125rem 0.875rem;
52
+ align-items: center;
53
+ padding: 0.875rem 0.5rem;
54
+ border-bottom: 1px solid var(--line);
55
+ }
56
+ .cs-row-linked:hover {
57
+ background: color-mix(in srgb, var(--ink) 5%, transparent);
58
+ }
59
+ .cs-mark {
60
+ grid-area: mark;
61
+ display: inline-grid;
62
+ place-items: center;
63
+ width: 2rem;
64
+ height: 2rem;
65
+ border: 1.5px solid var(--line-strong);
66
+ border-radius: 50%;
67
+ color: var(--muted);
68
+ font-size: var(--text-sm);
69
+ font-weight: 700;
70
+ font-variant-numeric: tabular-nums;
71
+ }
72
+ .cs-row-done .cs-mark {
73
+ border-color: var(--button);
74
+ background: var(--button);
75
+ color: var(--button-ink);
76
+ }
77
+ .cs-row-next .cs-mark {
78
+ border-color: var(--accent);
79
+ color: var(--ink);
80
+ }
81
+ .cs-name {
82
+ grid-area: name;
83
+ min-width: 0;
84
+ font-weight: 600;
85
+ line-height: 1.35;
86
+ }
87
+ .cs-name a {
88
+ color: var(--ink);
89
+ text-decoration: none;
90
+ }
91
+ .cs-name a::after {
92
+ content: '';
93
+ position: absolute;
94
+ inset: 0;
95
+ }
96
+ .cs-name a:focus-visible {
97
+ outline: none;
98
+ }
99
+ .cs-row-linked:focus-within {
100
+ outline: 3px solid var(--link);
101
+ outline-offset: -3px;
102
+ }
103
+ .cs-row-linked:hover .cs-name a {
104
+ text-decoration: underline;
105
+ }
106
+ .cs-word {
107
+ grid-area: word;
108
+ display: flex;
109
+ flex-wrap: wrap;
110
+ gap: 0 0.75rem;
111
+ color: var(--muted);
112
+ font-size: var(--text-sm);
113
+ }
114
+ .cs-word:empty {
115
+ display: none;
116
+ }
117
+ .cs-row-next .cs-word,
118
+ .cs-row-done .cs-word {
119
+ color: var(--ink);
120
+ font-weight: 700;
121
+ }
122
+ .cs-join {
123
+ color: var(--link);
124
+ font-weight: 700;
125
+ }
126
+ .cs-len {
127
+ grid-area: len;
128
+ color: var(--muted);
129
+ font-size: var(--text-sm);
130
+ font-variant-numeric: tabular-nums;
131
+ }
132
+ @media (min-width: 48rem) {
133
+ .cs-row {
134
+ grid-template-columns: 2rem minmax(0, 1fr) auto 3.5rem;
135
+ grid-template-areas: 'mark name word len';
136
+ gap: 0 1rem;
137
+ padding: 0.875rem 0.75rem;
138
+ }
139
+ .cs-word {
140
+ justify-content: flex-end;
141
+ }
142
+ .cs-len {
143
+ text-align: right;
144
+ }
145
+ }
146
+ </style>
@@ -0,0 +1,146 @@
1
+ // A Course as its syllabus and outline layouts draw it (board D2), and the
2
+ // course address both the Course and the Lesson sections read their course
3
+ // from.
4
+ //
5
+ // The course is the one at this address (`/<courses base>/<course>`, and a
6
+ // lesson's `/<courses base>/<course>/<lesson>`, the base the course type's
7
+ // `url_base`), or the section's `options.courseSlug` on a page that pins one.
8
+ // It is read through lib/visitor.ts: as the visitor while one is signed in
9
+ // (each lesson's Done and the course's bar, the locks as that visitor meets
10
+ // them), else as the public reader. The section's own data carries no course.
11
+
12
+ import type { Section } from '@backgold/content'
13
+ import type { ContentAccessLevel, CourseDetail, CourseLesson, CourseProgress, EntryLock, Visitor } from '#contract/content-api'
14
+ import { safeHref, safeSrc, signInHref, signOutHref } from '@backgold/astro/server'
15
+ import { COURSE_TYPE_KEY, finishedOn, lockWordOf, whoCanWatch } from '../../../lib/academy'
16
+ import { SLUG, academyReads, type AcademyReads } from '../../../lib/visitor'
17
+
18
+ export interface AcademyContext {
19
+ locals: App.Locals
20
+ url: URL
21
+ }
22
+
23
+ /** The course (and lesson) this address names under the course type's base, or null. */
24
+ export async function routeOf(astro: AcademyContext): Promise<{ course: string; lesson: string | null } | null> {
25
+ const client = astro.locals.backgold.client
26
+ if (!client) return null
27
+ const base = (await client.types()).types.find((t) => t.key === COURSE_TYPE_KEY)?.url_base
28
+ let parts: string[]
29
+ try {
30
+ parts = astro.url.pathname.split('/').filter(Boolean).map(decodeURIComponent)
31
+ } catch {
32
+ return null
33
+ }
34
+ if (!base || parts[0] !== base || !parts[1] || parts.length > 3) return null
35
+ return { course: parts[1], lesson: parts[2] ?? null }
36
+ }
37
+
38
+ /** The section's pinned course (`options.courseSlug`), or null when it pins none. */
39
+ export function pinnedCourseOf(section: Section): string | null {
40
+ const slug = section.options?.courseSlug
41
+ return typeof slug === 'string' && SLUG.test(slug) ? slug : null
42
+ }
43
+
44
+ export type LessonState = 'done' | 'next' | 'locked' | 'open'
45
+
46
+ export interface SyllabusRow {
47
+ n: number
48
+ slug: string
49
+ /** The lesson's own title, "Decide what you want". */
50
+ name: string
51
+ href: string | null
52
+ seconds: number | null
53
+ state: LessonState
54
+ lock: EntryLock | null
55
+ /** The lock's word ("For members", "Sign in to watch"); null on an open lesson. */
56
+ lockWord: string | null
57
+ access: ContentAccessLevel
58
+ }
59
+
60
+ export interface CourseView {
61
+ title: string
62
+ summary: string | null
63
+ cover: string | null
64
+ /** The courses list (the course address's parent), for the breadcrumb. */
65
+ coursesHref: string | null
66
+ lessons: number
67
+ seconds: number | null
68
+ access: ContentAccessLevel
69
+ visitor: Visitor | null
70
+ /** The visitor's place; null signed out. */
71
+ progress: CourseProgress | null
72
+ rows: SyllabusRow[]
73
+ /** The lesson this visitor finished last and when ("Lesson 4 finished on Tuesday"); null signed out or before any `completed_at`. */
74
+ lastFinished: { n: number; on: string } | null
75
+ /** The lesson the head's button opens ("Continue · Lesson 5", "Start · Lesson 1"); null when there is none to open. */
76
+ next: { row: SyllabusRow; verb: 'Continue' | 'Start' } | null
77
+ /** "Anyone signed in with their email". */
78
+ whoCanWatch: string
79
+ /** The lessons whose rule is not the course's: "Lesson 9", "Members of <org>". */
80
+ exceptions: { n: number; who: string }[]
81
+ signIn: string
82
+ signOut: string
83
+ }
84
+
85
+ function rowOf(lesson: CourseLesson, n: number, progress: CourseProgress | null): SyllabusRow {
86
+ const state: LessonState = lesson.locked ? 'locked' : lesson.completed ? 'done' : progress?.next_lesson_slug === lesson.slug ? 'next' : 'open'
87
+ return {
88
+ n,
89
+ slug: lesson.slug,
90
+ name: lesson.title,
91
+ href: safeHref(lesson.url),
92
+ seconds: lesson.duration_seconds,
93
+ state,
94
+ lock: lesson.locked ? lesson.lock : null,
95
+ lockWord: lesson.locked && lesson.lock ? lockWordOf(lesson.lock) : null,
96
+ access: lesson.access,
97
+ }
98
+ }
99
+
100
+ /** The newest `completed_at` among the visitor's finished lessons. */
101
+ function lastFinishedOf(lessons: CourseLesson[], visitor: Visitor | null): { n: number; on: string } | null {
102
+ if (!visitor) return null
103
+ let best: { n: number; at: number } | null = null
104
+ for (const [i, lesson] of lessons.entries()) {
105
+ const at = lesson.completed && lesson.completed_at !== null ? Date.parse(lesson.completed_at) : NaN
106
+ if (!Number.isNaN(at) && (best === null || at > best.at)) best = { n: i + 1, at }
107
+ }
108
+ if (best === null) return null
109
+ const on = finishedOn(new Date(best.at).toISOString())
110
+ return on ? { n: best.n, on } : null
111
+ }
112
+
113
+ /** The course as the layouts draw it, for this visitor (null signed out), this page's address and the organization's name. */
114
+ export function courseView(course: CourseDetail, visitor: Visitor | null, path: string, orgName: string | null): CourseView {
115
+ const lessons = [...course.lessons].sort((a, b) => a.position - b.position)
116
+ const progress = visitor ? course.progress : null
117
+ const rows = lessons.map((lesson, i) => rowOf(lesson, i + 1, progress))
118
+ const nextRow = progress ? rows.find((r) => r.slug === progress.next_lesson_slug) : rows[0]
119
+ const coursesPath = course.url.replace(/\/[^/]+\/?$/, '')
120
+ return {
121
+ title: course.title,
122
+ summary: course.summary,
123
+ cover: course.hero ? safeSrc(course.hero.url) : null,
124
+ coursesHref: coursesPath ? safeHref(coursesPath) : null,
125
+ lessons: course.lesson_count || lessons.length,
126
+ seconds: course.total_seconds,
127
+ access: course.access,
128
+ visitor,
129
+ progress,
130
+ rows,
131
+ lastFinished: lastFinishedOf(lessons, progress ? visitor : null),
132
+ next: nextRow ? { row: nextRow, verb: progress && progress.completed > 0 ? 'Continue' : 'Start' } : null,
133
+ whoCanWatch: whoCanWatch(course.access, orgName, course.lock?.tag_label ?? null),
134
+ exceptions: rows.filter((r) => r.access !== course.access).map((r) => ({ n: r.n, who: whoCanWatch(r.access, orgName, r.lock?.tag_label ?? null) })),
135
+ signIn: signInHref(path, course.title),
136
+ signOut: signOutHref(path),
137
+ }
138
+ }
139
+
140
+ /** The course this section names (its pin, else the address), read for this visitor; null when there is none. */
141
+ export async function courseOf(section: Section, astro: AcademyContext, reads: AcademyReads = academyReads(astro)): Promise<CourseView | null> {
142
+ const slug = pinnedCourseOf(section) ?? (await routeOf(astro))?.course ?? null
143
+ if (!slug) return null
144
+ const found = await reads.course(slug)
145
+ return found ? courseView(found.course, reads.visitor, astro.url.pathname, reads.orgName) : null
146
+ }
@@ -0,0 +1,143 @@
1
+ ---
2
+ // Course · Syllabus (board D2): one course as a visitor sees it. The
3
+ // breadcrumb, the head (CourseHead: the cover, the summary, this visitor's
4
+ // bar and "Continue · Lesson 5"), then the syllabus (Syllabus: every lesson
5
+ // in order with Done, Up next, the locks and the lengths) beside "About this
6
+ // course" (Lessons, Length, Who can watch, and the lessons whose rule is not
7
+ // the course's) and, for a visitor, "Your place" with Sign out. On a phone
8
+ // the cover moves above the title and the panels follow the syllabus.
9
+ //
10
+ // The course is the one at this address, or the section's pinned course
11
+ // (course.ts); with neither, or one the api does not have, nothing is drawn.
12
+ // The default layout; it draws `syllabus` and any layout the kit has no
13
+ // file for.
14
+ import type { Section } from '@backgold/content'
15
+ import Band from '../Band.astro'
16
+ import Crumbs from './Crumbs.astro'
17
+ import CourseHead from './CourseHead.astro'
18
+ import Syllabus from './Syllabus.astro'
19
+ import { courseOf, type CourseView } from './course'
20
+ import { lengthOf, lessonsOf } from '../../../lib/academy'
21
+
22
+ interface Props {
23
+ section: Section
24
+ variant?: string
25
+ /** Drawn as the course's own page: the title is the <h1>. */
26
+ lead?: boolean
27
+ /** The course, already read (the course entry layout); left out, the section reads it. */
28
+ view?: CourseView | null
29
+ }
30
+
31
+ const { section, lead = false } = Astro.props
32
+ const view = Astro.props.view !== undefined ? Astro.props.view : await courseOf(section, Astro)
33
+ const Sub = lead ? 'h2' : 'h3'
34
+ const name = view?.visitor ? (view.visitor.first_name ?? view.visitor.email) : null
35
+ ---
36
+ {view && (
37
+ <Band section={section} class="course course-syllabus">
38
+ <Crumbs steps={[{ label: 'Courses', href: view.coursesHref }, { label: view.title, href: null }]} />
39
+ <CourseHead view={view} lead={lead} cover />
40
+ <div class="cs-columns">
41
+ <div class="cs-syllabus">
42
+ <div class="cs-list-head">
43
+ <p class="kicker">Syllabus</p>
44
+ <Sub>{lessonsOf(view.lessons)}</Sub>
45
+ </div>
46
+ <Syllabus rows={view.rows} />
47
+ </div>
48
+ <aside class="cs-aside" aria-label="About this course">
49
+ <section class="cs-panel">
50
+ <Sub class="cs-panel-title">About this course</Sub>
51
+ <dl class="cs-facts">
52
+ <div><dt>Lessons</dt><dd>{view.lessons}</dd></div>
53
+ {lengthOf(view.seconds) && <div><dt>Length</dt><dd>{lengthOf(view.seconds)}</dd></div>}
54
+ <div><dt>Who can watch</dt><dd>{view.whoCanWatch}</dd></div>
55
+ {view.exceptions.map((e) => <div><dt>Lesson {e.n}</dt><dd>{e.who}</dd></div>)}
56
+ </dl>
57
+ </section>
58
+ {view.visitor && (
59
+ <section class="cs-panel">
60
+ <Sub class="cs-panel-title">Your place</Sub>
61
+ <p>You are signed in as {name}. The Academy keeps your place in each course on this site.</p>
62
+ <a class="text-link" href={view.signOut}>Sign out</a>
63
+ </section>
64
+ )}
65
+ </aside>
66
+ </div>
67
+ </Band>
68
+ )}
69
+
70
+ <style>
71
+ .cs-columns {
72
+ display: grid;
73
+ gap: 2rem;
74
+ }
75
+ .cs-syllabus {
76
+ min-width: 0;
77
+ }
78
+ .cs-list-head {
79
+ margin-bottom: 1rem;
80
+ }
81
+ .cs-list-head > * {
82
+ margin: 0;
83
+ }
84
+ .cs-list-head .kicker {
85
+ margin-bottom: 0.375rem;
86
+ }
87
+ .cs-list-head :is(h2, h3) {
88
+ font-size: var(--h3);
89
+ }
90
+ .cs-aside {
91
+ display: grid;
92
+ gap: 1.25rem;
93
+ align-content: start;
94
+ }
95
+ .cs-panel {
96
+ display: grid;
97
+ gap: 0.75rem;
98
+ justify-items: start;
99
+ padding: 1.25rem 1.375rem;
100
+ border: 1px solid var(--line);
101
+ border-radius: var(--radius-card);
102
+ background: var(--surface);
103
+ }
104
+ .cs-panel > * {
105
+ margin: 0;
106
+ }
107
+ .cs-panel .cs-panel-title {
108
+ font-family: var(--font);
109
+ font-size: var(--text);
110
+ font-weight: 700;
111
+ letter-spacing: 0;
112
+ }
113
+ .cs-panel p {
114
+ color: var(--muted);
115
+ font-size: var(--text-sm);
116
+ }
117
+ .cs-facts {
118
+ display: grid;
119
+ gap: 0.625rem;
120
+ width: 100%;
121
+ margin: 0;
122
+ font-size: var(--text-sm);
123
+ }
124
+ .cs-facts > div {
125
+ display: grid;
126
+ grid-template-columns: minmax(6rem, auto) minmax(0, 1fr);
127
+ gap: 0.75rem;
128
+ }
129
+ .cs-facts dt {
130
+ color: var(--muted);
131
+ }
132
+ .cs-facts dd {
133
+ margin: 0;
134
+ color: var(--ink);
135
+ font-weight: 600;
136
+ }
137
+ @media (min-width: 56rem) {
138
+ .cs-columns {
139
+ grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem);
140
+ gap: 3rem;
141
+ }
142
+ }
143
+ </style>