@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.
- package/LICENSE +21 -0
- package/README.md +12 -2
- package/dist/chunk-KOB36GSF.js +62 -0
- package/dist/constants-DvTNj4JI.d-Batjcj3Z.d.ts +38 -0
- package/dist/content-api-CYeY0vU8.d.ts +849 -0
- package/dist/contract/content-api-examples.d.ts +58 -0
- package/dist/contract/content-api-examples.js +783 -0
- package/dist/contract/content-api.d.ts +2 -0
- package/dist/contract/content-api.js +1 -0
- package/dist/contract/site-templates.d.ts +252 -0
- package/dist/contract/site-templates.js +185 -0
- package/package.json +70 -3
- package/src/components/EntryCard.astro +35 -0
- package/src/components/EventMap.astro +118 -0
- package/src/components/EventPage.astro +194 -0
- package/src/components/FieldValue.astro +41 -0
- package/src/components/LeadingHero.astro +21 -0
- package/src/components/NotFound.astro +20 -0
- package/src/components/PageSections.astro +47 -0
- package/src/components/Prose.astro +18 -0
- package/src/components/chrome/Brand.astro +54 -0
- package/src/components/chrome/ClosingCall.astro +94 -0
- package/src/components/chrome/DonateStrip.astro +61 -0
- package/src/components/chrome/FooterColumns.astro +32 -0
- package/src/components/chrome/FooterContact.astro +28 -0
- package/src/components/chrome/MenuList.astro +45 -0
- package/src/components/chrome/ModeToggle.astro +125 -0
- package/src/components/chrome/SignedInNotice.astro +53 -0
- package/src/components/chrome/SignupBand.astro +12 -0
- package/src/components/chrome/TakeoverBanner.astro +56 -0
- package/src/components/chrome/VisitorAccount.astro +82 -0
- package/src/components/entries/AuthorBox.astro +47 -0
- package/src/components/entries/EntryFields.astro +29 -0
- package/src/components/entries/EntryHeader.astro +77 -0
- package/src/components/entries/ListFrame.astro +126 -0
- package/src/components/entries/ListSearch.astro +24 -0
- package/src/components/entries/Share.astro +24 -0
- package/src/components/entries/course/classroom.astro +26 -0
- package/src/components/entries/course/lesson.astro +18 -0
- package/src/components/entries/course/section.ts +20 -0
- package/src/components/entries/course/syllabus.astro +15 -0
- package/src/components/entries/index.ts +77 -0
- package/src/components/entries/newsletter/issue.astro +41 -0
- package/src/components/entries/newsletter/list.astro +26 -0
- package/src/components/entries/podcast/episode.astro +42 -0
- package/src/components/entries/podcast/list.astro +36 -0
- package/src/components/entries/post/article.astro +31 -0
- package/src/components/entries/post/list.astro +85 -0
- package/src/components/entries/props.ts +61 -0
- package/src/components/entries/video/cards.astro +39 -0
- package/src/components/entries/video/grid.astro +15 -0
- package/src/components/entries/video/watch.astro +41 -0
- package/src/components/live/LivePage.astro +215 -0
- package/src/components/live/LocalTime.astro +29 -0
- package/src/components/sections/About/books.astro +188 -0
- package/src/components/sections/About/credentials.ts +90 -0
- package/src/components/sections/About/index.astro +57 -0
- package/src/components/sections/About/left.astro +54 -0
- package/src/components/sections/About/letter.astro +108 -0
- package/src/components/sections/About/portrait.astro +308 -0
- package/src/components/sections/Advocacy/compact.astro +14 -0
- package/src/components/sections/Advocacy/index.astro +14 -0
- package/src/components/sections/Band.astro +39 -0
- package/src/components/sections/Blog/feature.astro +176 -0
- package/src/components/sections/Blog/index.astro +37 -0
- package/src/components/sections/Blog/latest.ts +80 -0
- package/src/components/sections/Blog/list.astro +186 -0
- package/src/components/sections/Booking/index.astro +139 -0
- package/src/components/sections/Booking/list.astro +144 -0
- package/src/components/sections/Booking/types.ts +60 -0
- package/src/components/sections/Calendar/agenda.astro +14 -0
- package/src/components/sections/Calendar/index.astro +14 -0
- package/src/components/sections/CandidateRoster/ballot.astro +394 -0
- package/src/components/sections/CandidateRoster/candidates.ts +69 -0
- package/src/components/sections/CandidateRoster/compact.astro +115 -0
- package/src/components/sections/CandidateRoster/index.astro +57 -0
- package/src/components/sections/CaseStudies/beforeafter.astro +222 -0
- package/src/components/sections/CaseStudies/cases.ts +111 -0
- package/src/components/sections/CaseStudies/grid.astro +261 -0
- package/src/components/sections/CaseStudies/index.astro +333 -0
- package/src/components/sections/Classroom/CourseCard.astro +181 -0
- package/src/components/sections/Classroom/Courses.astro +88 -0
- package/src/components/sections/Classroom/classroom.ts +141 -0
- package/src/components/sections/Classroom/index.astro +20 -0
- package/src/components/sections/Classroom/list.astro +15 -0
- package/src/components/sections/Collection/compact.astro +7 -0
- package/src/components/sections/Collection/entries.ts +62 -0
- package/src/components/sections/Collection/feature.astro +180 -0
- package/src/components/sections/Collection/index.astro +46 -0
- package/src/components/sections/Collection/library.astro +271 -0
- package/src/components/sections/Collection/list.astro +7 -0
- package/src/components/sections/Collection/outline.astro +134 -0
- package/src/components/sections/Collection/shelves.astro +191 -0
- package/src/components/sections/Comparison/Unlisted.astro +6 -0
- package/src/components/sections/Comparison/cards.astro +171 -0
- package/src/components/sections/Comparison/index.astro +191 -0
- package/src/components/sections/Comparison/sides.ts +98 -0
- package/src/components/sections/Comparison/spectrum.astro +261 -0
- package/src/components/sections/ContentPost/banner.astro +152 -0
- package/src/components/sections/ContentPost/index.astro +35 -0
- package/src/components/sections/ContentPost/lesson.ts +119 -0
- package/src/components/sections/ContentPost/player.astro +254 -0
- package/src/components/sections/ContentPost/theater.astro +329 -0
- package/src/components/sections/Countdown/index.astro +53 -0
- package/src/components/sections/Course/Bar.astro +46 -0
- package/src/components/sections/Course/CourseHead.astro +123 -0
- package/src/components/sections/Course/Crumbs.astro +44 -0
- package/src/components/sections/Course/Icon.astro +29 -0
- package/src/components/sections/Course/Ring.astro +62 -0
- package/src/components/sections/Course/Syllabus.astro +146 -0
- package/src/components/sections/Course/course.ts +146 -0
- package/src/components/sections/Course/index.astro +143 -0
- package/src/components/sections/Course/outline.astro +39 -0
- package/src/components/sections/Cta/banner.astro +64 -0
- package/src/components/sections/Cta/card.astro +88 -0
- package/src/components/sections/Cta/index.astro +31 -0
- package/src/components/sections/Cta/photo.astro +114 -0
- package/src/components/sections/Cta/strip.astro +91 -0
- package/src/components/sections/Donate/index.astro +136 -0
- package/src/components/sections/Donate/story.astro +7 -0
- package/src/components/sections/Event/card.astro +14 -0
- package/src/components/sections/Event/index.astro +14 -0
- package/src/components/sections/EventsList/AgendaMonths.astro +105 -0
- package/src/components/sections/EventsList/CalendarLine.astro +23 -0
- package/src/components/sections/EventsList/EventRows.astro +196 -0
- package/src/components/sections/EventsList/LiveCounts.astro +75 -0
- package/src/components/sections/EventsList/TypeTabs.astro +53 -0
- package/src/components/sections/EventsList/agenda.astro +55 -0
- package/src/components/sections/EventsList/calendar.astro +392 -0
- package/src/components/sections/EventsList/cards.astro +186 -0
- package/src/components/sections/EventsList/cohorts.astro +205 -0
- package/src/components/sections/EventsList/compact.astro +163 -0
- package/src/components/sections/EventsList/events.ts +168 -0
- package/src/components/sections/EventsList/index.astro +46 -0
- package/src/components/sections/EventsList/map.astro +436 -0
- package/src/components/sections/EventsList/shifts.astro +355 -0
- package/src/components/sections/EventsList/week.astro +361 -0
- package/src/components/sections/Faq/Contact.astro +63 -0
- package/src/components/sections/Faq/Questions.astro +98 -0
- package/src/components/sections/Faq/cards.astro +74 -0
- package/src/components/sections/Faq/faq.ts +101 -0
- package/src/components/sections/Faq/index.astro +49 -0
- package/src/components/sections/Faq/topics.astro +178 -0
- package/src/components/sections/Financials/Foot.astro +38 -0
- package/src/components/sections/Financials/Head.astro +47 -0
- package/src/components/sections/Financials/donut.astro +197 -0
- package/src/components/sections/Financials/financials.ts +52 -0
- package/src/components/sections/Financials/index.astro +148 -0
- package/src/components/sections/Financials/table.astro +157 -0
- package/src/components/sections/FormBlock/index.astro +33 -0
- package/src/components/sections/FormBlock/wide.astro +7 -0
- package/src/components/sections/Hero/cover.astro +170 -0
- package/src/components/sections/Hero/donate.astro +209 -0
- package/src/components/sections/Hero/field.astro +390 -0
- package/src/components/sections/Hero/index.astro +52 -0
- package/src/components/sections/Hero/overlap.astro +151 -0
- package/src/components/sections/Hero/rotating.astro +30 -0
- package/src/components/sections/Hero/split.astro +96 -0
- package/src/components/sections/Hero/statement.astro +55 -0
- package/src/components/sections/Hero/video.astro +399 -0
- package/src/components/sections/Issues/checklist.astro +204 -0
- package/src/components/sections/Issues/drawer.astro +237 -0
- package/src/components/sections/Issues/index.astro +115 -0
- package/src/components/sections/Issues/issues.ts +37 -0
- package/src/components/sections/Issues/numbered.astro +79 -0
- package/src/components/sections/Issues/rows.astro +137 -0
- package/src/components/sections/Issues/steps.astro +81 -0
- package/src/components/sections/Issues/tabs.astro +322 -0
- package/src/components/sections/Leaderboard/index.astro +29 -0
- package/src/components/sections/Lesson/Door.astro +121 -0
- package/src/components/sections/Lesson/LessonBody.astro +416 -0
- package/src/components/sections/Lesson/Rail.astro +182 -0
- package/src/components/sections/Lesson/Tracker.astro +137 -0
- package/src/components/sections/Lesson/index.astro +27 -0
- package/src/components/sections/Lesson/lesson.ts +233 -0
- package/src/components/sections/Lesson/reading.astro +21 -0
- package/src/components/sections/Map/CoverageLine.astro +19 -0
- package/src/components/sections/Map/RegionMap.astro +109 -0
- package/src/components/sections/Map/bar.astro +160 -0
- package/src/components/sections/Map/index.astro +192 -0
- package/src/components/sections/Map/map.astro +275 -0
- package/src/components/sections/MediaKit/BioCard.astro +108 -0
- package/src/components/sections/MediaKit/Downloads.astro +88 -0
- package/src/components/sections/MediaKit/index.astro +183 -0
- package/src/components/sections/MediaKit/kit.ts +140 -0
- package/src/components/sections/MediaKit/press.astro +189 -0
- package/src/components/sections/MediaKit/speaker.astro +205 -0
- package/src/components/sections/Membership/Benefits.astro +42 -0
- package/src/components/sections/Membership/Check.astro +12 -0
- package/src/components/sections/Membership/Price.astro +61 -0
- package/src/components/sections/Membership/compare.astro +312 -0
- package/src/components/sections/Membership/index.astro +281 -0
- package/src/components/sections/Membership/offers.ts +169 -0
- package/src/components/sections/Membership/tiers.astro +217 -0
- package/src/components/sections/MovementMap/index.astro +50 -0
- package/src/components/sections/MovementTicker/index.astro +43 -0
- package/src/components/sections/Pathways/Doors.astro +147 -0
- package/src/components/sections/Pathways/Head.astro +37 -0
- package/src/components/sections/Pathways/index.astro +27 -0
- package/src/components/sections/Pathways/pathways.ts +100 -0
- package/src/components/sections/Pathways/quiz.astro +286 -0
- package/src/components/sections/Pathways/tabs.astro +271 -0
- package/src/components/sections/PdfEmbed/card.astro +99 -0
- package/src/components/sections/PdfEmbed/index.astro +26 -0
- package/src/components/sections/PdfEmbed/medium.astro +7 -0
- package/src/components/sections/PdfEmbed/tall.astro +7 -0
- package/src/components/sections/Petition/coverage.astro +14 -0
- package/src/components/sections/Petition/image.astro +14 -0
- package/src/components/sections/Petition/index.astro +14 -0
- package/src/components/sections/Petition/map.astro +14 -0
- package/src/components/sections/PlatformPlanks/anchors.ts +66 -0
- package/src/components/sections/PlatformPlanks/columns.astro +171 -0
- package/src/components/sections/PlatformPlanks/index.astro +56 -0
- package/src/components/sections/PlatformPlanks/longread.astro +250 -0
- package/src/components/sections/PollBlock/index.astro +30 -0
- package/src/components/sections/Portfolio/featured.astro +343 -0
- package/src/components/sections/Portfolio/index.astro +571 -0
- package/src/components/sections/Portfolio/strip.astro +173 -0
- package/src/components/sections/Portfolio/work.ts +100 -0
- package/src/components/sections/Progress/MatchClock.astro +166 -0
- package/src/components/sections/Progress/compact.astro +150 -0
- package/src/components/sections/Progress/index.astro +32 -0
- package/src/components/sections/Progress/match.astro +126 -0
- package/src/components/sections/Progress/ring.astro +179 -0
- package/src/components/sections/QuickDonate/DonateCard.astro +149 -0
- package/src/components/sections/QuickDonate/Picker.astro +95 -0
- package/src/components/sections/QuickDonate/band.astro +164 -0
- package/src/components/sections/QuickDonate/bar.astro +208 -0
- package/src/components/sections/QuickDonate/donate.ts +126 -0
- package/src/components/sections/QuickDonate/hero.astro +143 -0
- package/src/components/sections/QuickDonate/index.astro +73 -0
- package/src/components/sections/QuickDonate/jar.astro +225 -0
- package/src/components/sections/QuickDonate/ladder.astro +248 -0
- package/src/components/sections/QuoteStrip/carousel.astro +340 -0
- package/src/components/sections/QuoteStrip/index.astro +58 -0
- package/src/components/sections/QuoteStrip/logos.astro +226 -0
- package/src/components/sections/QuoteStrip/quotes.ts +61 -0
- package/src/components/sections/QuoteStrip/single.astro +92 -0
- package/src/components/sections/QuoteStrip/ticker.astro +319 -0
- package/src/components/sections/QuoteStrip/wall.astro +113 -0
- package/src/components/sections/Resources/band.astro +93 -0
- package/src/components/sections/Resources/featured.astro +239 -0
- package/src/components/sections/Resources/index.astro +225 -0
- package/src/components/sections/Resources/resources.ts +92 -0
- package/src/components/sections/SampleBallot/Position.astro +39 -0
- package/src/components/sections/SampleBallot/ballot.ts +92 -0
- package/src/components/sections/SampleBallot/cards.astro +299 -0
- package/src/components/sections/SampleBallot/index.astro +326 -0
- package/src/components/sections/SampleBallot/measures.astro +172 -0
- package/src/components/sections/Scorecard/grades.astro +141 -0
- package/src/components/sections/Scorecard/index.astro +294 -0
- package/src/components/sections/Scorecard/promise.astro +167 -0
- package/src/components/sections/Scorecard/votes.ts +83 -0
- package/src/components/sections/SectionHead.astro +31 -0
- package/src/components/sections/Services/Button.astro +24 -0
- package/src/components/sections/Services/Check.astro +12 -0
- package/src/components/sections/Services/Includes.astro +42 -0
- package/src/components/sections/Services/compare.astro +328 -0
- package/src/components/sections/Services/index.astro +187 -0
- package/src/components/sections/Services/list.astro +181 -0
- package/src/components/sections/Services/services.ts +80 -0
- package/src/components/sections/ShareKit/Actions.astro +71 -0
- package/src/components/sections/ShareKit/Buttons.astro +62 -0
- package/src/components/sections/ShareKit/compact.astro +123 -0
- package/src/components/sections/ShareKit/index.astro +160 -0
- package/src/components/sections/ShareKit/share.ts +60 -0
- package/src/components/sections/ShareKit/strip.astro +173 -0
- package/src/components/sections/SignupCapture/band.astro +7 -0
- package/src/components/sections/SignupCapture/index.astro +103 -0
- package/src/components/sections/SignupCapture/inline.astro +7 -0
- package/src/components/sections/SocialFeed/index.astro +34 -0
- package/src/components/sections/StatCards/feature.astro +143 -0
- package/src/components/sections/StatCards/index.astro +51 -0
- package/src/components/sections/StatCards/ribbon.astro +113 -0
- package/src/components/sections/StatCards/wall.astro +177 -0
- package/src/components/sections/Store/featured.astro +14 -0
- package/src/components/sections/Store/index.astro +14 -0
- package/src/components/sections/Stories/Status.astro +42 -0
- package/src/components/sections/Stories/StoryCards.astro +171 -0
- package/src/components/sections/Stories/cards.astro +42 -0
- package/src/components/sections/Stories/index.astro +238 -0
- package/src/components/sections/Stories/stories.ts +97 -0
- package/src/components/sections/Stories/timeline.astro +135 -0
- package/src/components/sections/TeamGrid/board.astro +280 -0
- package/src/components/sections/TeamGrid/index.astro +71 -0
- package/src/components/sections/TeamGrid/list.astro +306 -0
- package/src/components/sections/TeamGrid/people.ts +178 -0
- package/src/components/sections/VideoEmbed/index.astro +52 -0
- package/src/components/sections/VideoEmbed/landscape.astro +7 -0
- package/src/components/sections/VideoEmbed/portrait.astro +7 -0
- package/src/components/sections/VideoEmbed/square.astro +7 -0
- package/src/components/sections/VoterTools/DaysLeft.astro +33 -0
- package/src/components/sections/VoterTools/dates.astro +149 -0
- package/src/components/sections/VoterTools/index.astro +228 -0
- package/src/components/sections/VoterTools/polling.astro +141 -0
- package/src/components/sections/VoterTools/voter-tools.ts +70 -0
- package/src/components/sections/index.ts +370 -0
- package/src/components/sections/modules/Headed.astro +39 -0
- package/src/components/sections/modules/ModuleFrame.astro +179 -0
- package/src/components/volunteer/ShiftLive.astro +90 -0
- package/src/components/volunteer/detail.astro +247 -0
- package/src/components/volunteer/list.astro +298 -0
- package/src/components/volunteer/props.ts +21 -0
- package/src/env.d.ts +22 -0
- package/src/index.d.ts +10 -0
- package/src/index.js +64 -0
- package/src/layouts/Site.astro +371 -0
- package/src/lib/academy.ts +146 -0
- package/src/lib/brand.ts +534 -0
- package/src/lib/chrome.ts +119 -0
- package/src/lib/donate-frame.ts +64 -0
- package/src/lib/entries.ts +190 -0
- package/src/lib/env.ts +34 -0
- package/src/lib/event-map-draw.ts +91 -0
- package/src/lib/events.ts +476 -0
- package/src/lib/fonts.ts +116 -0
- package/src/lib/footer.ts +24 -0
- package/src/lib/format.ts +160 -0
- package/src/lib/geo.ts +131 -0
- package/src/lib/live.ts +54 -0
- package/src/lib/menu.ts +48 -0
- package/src/lib/petition-text.ts +29 -0
- package/src/lib/reading.ts +17 -0
- package/src/lib/regions.ts +215 -0
- package/src/lib/section.ts +94 -0
- package/src/lib/shifts.ts +186 -0
- package/src/lib/stream-time.ts +20 -0
- package/src/lib/stream.ts +141 -0
- package/src/lib/visitor.ts +54 -0
- package/src/routes/catch-all.astro +286 -0
- package/src/routes/form.astro +30 -0
- package/src/routes/live.astro +49 -0
- package/src/routes/not-found.astro +18 -0
- package/src/routes/preview.astro +60 -0
- package/src/routes/setup.astro +62 -0
- package/src/routes/volunteer-shift.astro +61 -0
- package/src/routes/volunteer.astro +37 -0
- package/src/styles/entries.css +784 -0
- package/src/styles/site.css +1839 -0
- package/src/template.ts +182 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
// A TeamGrid's rows as its layouts draw them. Rows arrive in one of two
|
|
2
|
+
// shapes:
|
|
3
|
+
//
|
|
4
|
+
// - by seat: each a seat on one of the party's bodies (`body`, `body_key`,
|
|
5
|
+
// `seat`, the holder's `name` (null for a vacant seat), `since`,
|
|
6
|
+
// `term_ends`, `is_officer`, and from the holder's team entry `photo_url`,
|
|
7
|
+
// `bio`, `link`; `url` is the site's own page for the holder, or for a
|
|
8
|
+
// vacant seat its open role), grouped by body in BackGold's order with the
|
|
9
|
+
// officers' body first and the staff who hold no seat last, under `Staff`;
|
|
10
|
+
// - by group: leadership (`exec`: photo, role, a short bio), staff (`staff`:
|
|
11
|
+
// name, role, department) and open roles (`open`: role, department, a line
|
|
12
|
+
// about it).
|
|
13
|
+
//
|
|
14
|
+
// `teamOf` reads both into the three groups (a seat's name is its role, a
|
|
15
|
+
// vacant seat is an open role in its body), so every layout draws either;
|
|
16
|
+
// `bodiesOf` keeps the seats in their bodies for the Board layout.
|
|
17
|
+
|
|
18
|
+
import type { Section } from '@backgold/content'
|
|
19
|
+
import { safeSrc } from '@backgold/astro/server'
|
|
20
|
+
import { links, linkOf, rows, type Link, type Row } from '../../../lib/section'
|
|
21
|
+
import { text } from '../../../lib/format'
|
|
22
|
+
|
|
23
|
+
interface Person {
|
|
24
|
+
name: string | null
|
|
25
|
+
role: string | null
|
|
26
|
+
dept: string | null
|
|
27
|
+
bio: string | null
|
|
28
|
+
blurb: string | null
|
|
29
|
+
photo: string | null
|
|
30
|
+
link: Link | null
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface Team {
|
|
34
|
+
leaders: Person[]
|
|
35
|
+
staff: Person[]
|
|
36
|
+
open: Person[]
|
|
37
|
+
/** The open roles that arrive in the `open` group, without a seat. */
|
|
38
|
+
openRoles: Person[]
|
|
39
|
+
/** The section's "interested?" link, when it has one. */
|
|
40
|
+
interest: Link | null
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface Seat {
|
|
44
|
+
/** The seat's name ("Chair", "At-large"), or null. */
|
|
45
|
+
seat: string | null
|
|
46
|
+
/** The holder, or null for a vacant seat. */
|
|
47
|
+
name: string | null
|
|
48
|
+
/** The year the holder took the seat ("2023"), or null. */
|
|
49
|
+
since: string | null
|
|
50
|
+
/** The month the term ends ("April 2027"), or null. */
|
|
51
|
+
termEnds: string | null
|
|
52
|
+
officer: boolean
|
|
53
|
+
photo: string | null
|
|
54
|
+
bio: string | null
|
|
55
|
+
/** The holder's page (the site's own, else their link), or for a vacant seat its open role's page. */
|
|
56
|
+
link: Link | null
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface Body {
|
|
60
|
+
key: string
|
|
61
|
+
name: string
|
|
62
|
+
seats: Seat[]
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const isSeatRow = (row: Row) => typeof row.body === 'string' && row.body.trim() !== ''
|
|
66
|
+
|
|
67
|
+
const person = (row: Row): Person => ({
|
|
68
|
+
name: text(row.name),
|
|
69
|
+
role: text(row.role),
|
|
70
|
+
dept: text(row.dept),
|
|
71
|
+
bio: text(row.bio),
|
|
72
|
+
blurb: text(row.blurb),
|
|
73
|
+
photo: safeSrc(row.image_url),
|
|
74
|
+
link: linkOf(text(row.name) ?? text(row.role), row.link_url),
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
const MONTH = new Intl.DateTimeFormat('en-US', { month: 'long', timeZone: 'UTC' })
|
|
78
|
+
|
|
79
|
+
/** "2023" from a date or a year; null for anything else. */
|
|
80
|
+
function yearOf(value: unknown): string | null {
|
|
81
|
+
return /^(\d{4})(?:-|$)/.exec(text(value) ?? '')?.[1] ?? null
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** "April 2027" from a date ("2027-04-30", "2027-04"), "2027" from a bare year; null for anything else. */
|
|
85
|
+
function monthOf(value: unknown): string | null {
|
|
86
|
+
const m = /^(\d{4})(?:-(\d{2}))?/.exec(text(value) ?? '')
|
|
87
|
+
if (!m) return null
|
|
88
|
+
const month = m[2] ? Number(m[2]) : null
|
|
89
|
+
if (month === null) return m[1]!
|
|
90
|
+
if (month < 1 || month > 12) return null
|
|
91
|
+
return `${MONTH.format(Date.UTC(2000, month - 1, 1))} ${m[1]}`
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function seatOf(row: Row): Seat {
|
|
95
|
+
const name = text(row.name)
|
|
96
|
+
const label = name ?? text(row.seat) ?? 'Open seat'
|
|
97
|
+
return {
|
|
98
|
+
seat: text(row.seat),
|
|
99
|
+
name,
|
|
100
|
+
since: name ? yearOf(row.since) : null,
|
|
101
|
+
termEnds: monthOf(row.term_ends),
|
|
102
|
+
officer: row.is_officer === true,
|
|
103
|
+
photo: name ? safeSrc(row.photo_url) : null,
|
|
104
|
+
bio: name ? text(row.bio) : null,
|
|
105
|
+
link: linkOf(label, row.url) ?? (name ? linkOf(label, row.link) : null),
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The seat rows by body, in the order they arrive, the officers' body moved
|
|
111
|
+
* first and Staff kept last; empty when the rows are not by seat.
|
|
112
|
+
*/
|
|
113
|
+
export function bodiesOf(section: Section): Body[] {
|
|
114
|
+
const bodies: Body[] = []
|
|
115
|
+
for (const row of rows(section).filter(isSeatRow)) {
|
|
116
|
+
const name = (row.body as string).trim()
|
|
117
|
+
const key = text(row.body_key) ?? name
|
|
118
|
+
let body = bodies.find((b) => b.key === key)
|
|
119
|
+
if (!body) {
|
|
120
|
+
body = { key, name, seats: [] }
|
|
121
|
+
bodies.push(body)
|
|
122
|
+
}
|
|
123
|
+
body.seats.push(seatOf(row))
|
|
124
|
+
}
|
|
125
|
+
const rank = (b: Body) => (b.seats.some((s) => s.officer) ? 0 : b.name === 'Staff' ? 2 : 1)
|
|
126
|
+
return bodies.map((b, i) => ({ b, i })).sort((x, y) => rank(x.b) - rank(y.b) || x.i - y.i).map(({ b }) => b)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** The term every seat in a body ends with, when they all share one; null otherwise. */
|
|
130
|
+
export function sharedTerm(body: Body): string | null {
|
|
131
|
+
const terms = new Set(body.seats.map((s) => s.termEnds))
|
|
132
|
+
return terms.size === 1 ? [...terms][0]! : null
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export function teamOf(section: Section): Team {
|
|
136
|
+
const all = rows(section)
|
|
137
|
+
const group = (name: string) => all.filter((row) => row.group === name).map(person)
|
|
138
|
+
const exec = group('exec')
|
|
139
|
+
const staffRows = group('staff')
|
|
140
|
+
// The same people can come twice: as the exec and staff groups and again as
|
|
141
|
+
// seats (the roster sends a team member with no seat under a Staff body).
|
|
142
|
+
// The groups win; a seat whose person they already name is left out.
|
|
143
|
+
const listed = new Set([...exec, ...staffRows].map((p) => p.name).filter(Boolean))
|
|
144
|
+
const seated = bodiesOf(section)
|
|
145
|
+
.flatMap((body) =>
|
|
146
|
+
body.seats.map((s) => ({
|
|
147
|
+
staff: body.name === 'Staff',
|
|
148
|
+
person: {
|
|
149
|
+
name: s.name,
|
|
150
|
+
role: s.seat,
|
|
151
|
+
dept: s.name ? null : body.name,
|
|
152
|
+
bio: s.bio,
|
|
153
|
+
blurb: null,
|
|
154
|
+
photo: s.photo,
|
|
155
|
+
link: s.link,
|
|
156
|
+
},
|
|
157
|
+
})),
|
|
158
|
+
)
|
|
159
|
+
.filter((s) => !(s.person.name && listed.has(s.person.name)))
|
|
160
|
+
const openRoles = group('open').filter((p) => p.role)
|
|
161
|
+
return {
|
|
162
|
+
leaders: [...exec, ...seated.filter((s) => s.person.name && !s.staff).map((s) => s.person)].filter((p) => p.name),
|
|
163
|
+
staff: [...staffRows, ...seated.filter((s) => s.person.name && s.staff).map((s) => s.person)].filter((p) => p.name),
|
|
164
|
+
open: [...openRoles, ...seated.filter((s) => !s.person.name).map((s) => ({ ...s.person, role: s.person.role ?? 'Open seat' }))],
|
|
165
|
+
openRoles,
|
|
166
|
+
interest: links(section)[0] ?? null,
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/** "RA" in place of a photo that has not been uploaded. */
|
|
171
|
+
export function initials(name: string | null): string {
|
|
172
|
+
return (name ?? '')
|
|
173
|
+
.split(/\s+/)
|
|
174
|
+
.filter(Boolean)
|
|
175
|
+
.slice(0, 2)
|
|
176
|
+
.map((part) => part[0]!.toUpperCase())
|
|
177
|
+
.join('')
|
|
178
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
// VideoEmbed: a YouTube or Vimeo video in its player, a video file in the
|
|
3
|
+
// browser's own player, or a link when it is neither; a caption under it.
|
|
4
|
+
// `variant` is 'portrait' for an upright video; anything else is 16:9.
|
|
5
|
+
import type { Section } from '@backgold/content'
|
|
6
|
+
import Band from '../Band.astro'
|
|
7
|
+
import { media } from '../../../lib/section'
|
|
8
|
+
import { text } from '../../../lib/format'
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
section: Section
|
|
12
|
+
variant?: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const { section } = Astro.props
|
|
16
|
+
const caption = text(section.copy.caption)
|
|
17
|
+
const video = media(section, 'url', 'videoUrl')
|
|
18
|
+
const poster = media(section, 'videoPosterUrl')
|
|
19
|
+
|
|
20
|
+
function playerOf(url: string): string | null {
|
|
21
|
+
let parsed: URL
|
|
22
|
+
try {
|
|
23
|
+
parsed = new URL(url)
|
|
24
|
+
} catch {
|
|
25
|
+
return null
|
|
26
|
+
}
|
|
27
|
+
const host = parsed.hostname.replace(/^www\./, '')
|
|
28
|
+
const youtube =
|
|
29
|
+
host === 'youtu.be'
|
|
30
|
+
? parsed.pathname.slice(1)
|
|
31
|
+
: host === 'youtube.com' || host === 'm.youtube.com'
|
|
32
|
+
? (parsed.searchParams.get('v') ?? /^\/(?:embed|shorts|live)\/([^/]+)/.exec(parsed.pathname)?.[1] ?? '')
|
|
33
|
+
: ''
|
|
34
|
+
if (/^[A-Za-z0-9_-]{11}$/.test(youtube)) return `https://www.youtube-nocookie.com/embed/${youtube}`
|
|
35
|
+
const vimeo = host === 'vimeo.com' || host === 'player.vimeo.com' ? /(\d{6,12})/.exec(parsed.pathname)?.[1] : undefined
|
|
36
|
+
return vimeo ? `https://player.vimeo.com/video/${vimeo}` : null
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const player = video ? playerOf(video.url) : null
|
|
40
|
+
const file = video && !player && /\.(mp4|webm|m4v|mov)(\?|$)/i.test(video.url) ? video.url : null
|
|
41
|
+
const title = caption ?? 'Video'
|
|
42
|
+
---
|
|
43
|
+
{video && (
|
|
44
|
+
<Band section={section} class="video">
|
|
45
|
+
<figure class:list={['video-frame', section.variant === 'portrait' && 'video-portrait']}>
|
|
46
|
+
{player && <iframe src={player} title={title} loading="lazy" allow="encrypted-media; picture-in-picture; fullscreen" allowfullscreen></iframe>}
|
|
47
|
+
{file && <video src={file} poster={poster?.url} controls preload="none" playsinline></video>}
|
|
48
|
+
{!player && !file && <p><a href={video.url} rel="noopener">Watch the video</a></p>}
|
|
49
|
+
{caption && <figcaption>{caption}</figcaption>}
|
|
50
|
+
</figure>
|
|
51
|
+
</Band>
|
|
52
|
+
)}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
// The key dates' one script, placed once inside each VoterTools layout that
|
|
3
|
+
// draws dates. Pages are cached until content changes, so the server writes
|
|
4
|
+
// each date as a calendar day and this counts in the visitor's browser: for
|
|
5
|
+
// every `data-vt-date` in its section it writes the state into that row's
|
|
6
|
+
// `data-vt-state` slot ("12 days left", "1 day left", "Today", "Closed"),
|
|
7
|
+
// marks the row `vt-open` or `vt-closed`, and marks the nearest open one
|
|
8
|
+
// `vt-next`. Days are calendar days in the visitor's own time zone, and a
|
|
9
|
+
// date is open through its whole day. Without script the slots stay empty
|
|
10
|
+
// and the dates read plainly.
|
|
11
|
+
---
|
|
12
|
+
<script is:inline>
|
|
13
|
+
(function (section) {
|
|
14
|
+
if (!section) return
|
|
15
|
+
var now = new Date()
|
|
16
|
+
var today = Date.UTC(now.getFullYear(), now.getMonth(), now.getDate())
|
|
17
|
+
var next = null
|
|
18
|
+
var nearest = Infinity
|
|
19
|
+
section.querySelectorAll('[data-vt-date]').forEach(function (row) {
|
|
20
|
+
var m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(row.getAttribute('data-vt-date') || '')
|
|
21
|
+
if (!m) return
|
|
22
|
+
var days = Math.round((Date.UTC(Number(m[1]), Number(m[2]) - 1, Number(m[3])) - today) / 86400000)
|
|
23
|
+
var slot = row.querySelector('[data-vt-state]')
|
|
24
|
+
if (slot) slot.textContent = days < 0 ? 'Closed' : days === 0 ? 'Today' : days + (days === 1 ? ' day left' : ' days left')
|
|
25
|
+
row.classList.add(days < 0 ? 'vt-closed' : 'vt-open')
|
|
26
|
+
if (days >= 0 && days < nearest) {
|
|
27
|
+
nearest = days
|
|
28
|
+
next = row
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
if (next) next.classList.add('vt-next')
|
|
32
|
+
})(document.currentScript.closest('.bg-section'))
|
|
33
|
+
</script>
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
---
|
|
2
|
+
// VoterTools, 'dates' layout (mock 02, C, without its state picker: the
|
|
3
|
+
// dates are the ones the organization enters for its own state). The
|
|
4
|
+
// kicker over `datesHeading` (else the heading), then a tile per key date,
|
|
5
|
+
// four across (two on a phone): its label in small capitals, its day large
|
|
6
|
+
// in the display face ("Oct 20"), then its state, which DaysLeft writes in
|
|
7
|
+
// the visitor's browser ("12 days left", "Today", "Closed"), and its note.
|
|
8
|
+
// The nearest open date's tile carries an accent rule across its top and
|
|
9
|
+
// its day and state in the accent; a closed date's tile goes quiet. Under
|
|
10
|
+
// the tiles, the registration link as the main call and the polling-place
|
|
11
|
+
// link as an outline (the polling link is the main call when there is no
|
|
12
|
+
// registration link). Nothing is drawn when the section has neither a
|
|
13
|
+
// heading, a link nor a date.
|
|
14
|
+
import type { ComponentProps } from 'astro/types'
|
|
15
|
+
import Band from '../Band.astro'
|
|
16
|
+
import SectionHead from '../SectionHead.astro'
|
|
17
|
+
import DaysLeft from './DaysLeft.astro'
|
|
18
|
+
import type Default from './index.astro'
|
|
19
|
+
import { voterTools } from './voter-tools'
|
|
20
|
+
|
|
21
|
+
type Props = ComponentProps<typeof Default>
|
|
22
|
+
|
|
23
|
+
const { section } = Astro.props
|
|
24
|
+
const vt = voterTools(section)
|
|
25
|
+
const heading = vt.datesHeading ?? vt.heading
|
|
26
|
+
const buttons = [vt.register, vt.polling].filter((link) => link !== null)
|
|
27
|
+
const shown = !!(vt.heading || buttons.length > 0 || vt.dates.length > 0)
|
|
28
|
+
const across = Math.min(vt.dates.length, 4)
|
|
29
|
+
---
|
|
30
|
+
{shown && (
|
|
31
|
+
<Band section={section} class="voter-tools vt-dates">
|
|
32
|
+
<SectionHead kicker={vt.kicker} heading={heading} more={[]} />
|
|
33
|
+
{vt.dates.length > 0 && (
|
|
34
|
+
<ul class:list={['vt-tiles', `vt-tiles-${across}`]} role="list">
|
|
35
|
+
{vt.dates.map((date) => (
|
|
36
|
+
<li class="vt-tile" data-vt-date={date.day ?? undefined}>
|
|
37
|
+
<p class="vt-tile-label">{date.label}</p>
|
|
38
|
+
{date.day && date.short && (
|
|
39
|
+
<p class="vt-tile-day">
|
|
40
|
+
<time datetime={date.day}>
|
|
41
|
+
<span aria-hidden="true">{date.short}</span>
|
|
42
|
+
<span class="visually-hidden">{date.full}</span>
|
|
43
|
+
</time>
|
|
44
|
+
</p>
|
|
45
|
+
)}
|
|
46
|
+
{date.day && <p class="vt-state" data-vt-state></p>}
|
|
47
|
+
{date.note && <p class="vt-note">{date.note}</p>}
|
|
48
|
+
</li>
|
|
49
|
+
))}
|
|
50
|
+
</ul>
|
|
51
|
+
)}
|
|
52
|
+
{buttons.length > 0 && (
|
|
53
|
+
<p class="actions vt-actions">
|
|
54
|
+
{buttons.map((link, i) => <a class:list={['button', i > 0 && 'button-quiet']} href={link.href} rel={link.rel}>{link.label}</a>)}
|
|
55
|
+
</p>
|
|
56
|
+
)}
|
|
57
|
+
{vt.dates.some((date) => date.day) && <DaysLeft />}
|
|
58
|
+
</Band>
|
|
59
|
+
)}
|
|
60
|
+
|
|
61
|
+
<style>
|
|
62
|
+
.vt-tiles {
|
|
63
|
+
display: grid;
|
|
64
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
65
|
+
gap: clamp(0.75rem, 1.5vw, 1.25rem);
|
|
66
|
+
margin: 0;
|
|
67
|
+
padding: 0;
|
|
68
|
+
list-style: none;
|
|
69
|
+
}
|
|
70
|
+
.vt-tiles-1 {
|
|
71
|
+
grid-template-columns: minmax(0, 1fr);
|
|
72
|
+
}
|
|
73
|
+
.vt-tile {
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: column;
|
|
76
|
+
gap: 0.375rem;
|
|
77
|
+
min-width: 0;
|
|
78
|
+
padding: 1.125rem 1.125rem 1.25rem;
|
|
79
|
+
border: 1px solid var(--line);
|
|
80
|
+
border-radius: var(--radius);
|
|
81
|
+
background: var(--surface);
|
|
82
|
+
}
|
|
83
|
+
.vt-tile > * {
|
|
84
|
+
margin: 0;
|
|
85
|
+
}
|
|
86
|
+
.vt-tile-label {
|
|
87
|
+
color: var(--muted);
|
|
88
|
+
font-size: var(--text-xs);
|
|
89
|
+
font-weight: 700;
|
|
90
|
+
letter-spacing: 0.14em;
|
|
91
|
+
line-height: 1.35;
|
|
92
|
+
text-transform: uppercase;
|
|
93
|
+
}
|
|
94
|
+
.vt-tile-day {
|
|
95
|
+
font-family: var(--font-display);
|
|
96
|
+
font-size: clamp(1.875rem, 1.5rem + 1.2vw, 2.5rem);
|
|
97
|
+
font-weight: 800;
|
|
98
|
+
letter-spacing: -0.02em;
|
|
99
|
+
line-height: 1;
|
|
100
|
+
white-space: nowrap;
|
|
101
|
+
}
|
|
102
|
+
.vt-tile .vt-state {
|
|
103
|
+
font-size: var(--text-sm);
|
|
104
|
+
font-weight: 700;
|
|
105
|
+
}
|
|
106
|
+
.vt-state:empty {
|
|
107
|
+
display: none;
|
|
108
|
+
}
|
|
109
|
+
.vt-note {
|
|
110
|
+
color: var(--muted);
|
|
111
|
+
font-size: var(--text-sm);
|
|
112
|
+
}
|
|
113
|
+
/* The nearest open date (DaysLeft): the accent across the top, its day and state in the accent. */
|
|
114
|
+
.vt-tile.vt-next {
|
|
115
|
+
border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
|
|
116
|
+
background:
|
|
117
|
+
linear-gradient(var(--accent), var(--accent)) top / 100% 4px no-repeat,
|
|
118
|
+
var(--surface);
|
|
119
|
+
box-shadow: var(--shadow);
|
|
120
|
+
}
|
|
121
|
+
.vt-next .vt-tile-day,
|
|
122
|
+
.vt-next .vt-state {
|
|
123
|
+
color: var(--accent);
|
|
124
|
+
}
|
|
125
|
+
.vt-tile.vt-closed {
|
|
126
|
+
background: transparent;
|
|
127
|
+
}
|
|
128
|
+
.vt-closed .vt-tile-day,
|
|
129
|
+
.vt-closed .vt-state {
|
|
130
|
+
color: var(--muted);
|
|
131
|
+
}
|
|
132
|
+
.vt-actions {
|
|
133
|
+
margin-top: clamp(1.5rem, 1rem + 1.5vw, 2.25rem);
|
|
134
|
+
}
|
|
135
|
+
@media (min-width: 48rem) {
|
|
136
|
+
.vt-tiles {
|
|
137
|
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
138
|
+
}
|
|
139
|
+
.vt-tiles-1 {
|
|
140
|
+
grid-template-columns: minmax(0, 16rem);
|
|
141
|
+
}
|
|
142
|
+
.vt-tiles-2 {
|
|
143
|
+
grid-template-columns: repeat(2, minmax(0, 16rem));
|
|
144
|
+
}
|
|
145
|
+
.vt-tiles-3 {
|
|
146
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
</style>
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
---
|
|
2
|
+
// VoterTools, 'register' layout, the default (mock 02, A, without its lookup
|
|
3
|
+
// form: BackGold has no registration check of its own, so the check is the
|
|
4
|
+
// official one the organization links to). Two cards side by side, stacked
|
|
5
|
+
// on a phone. The first asks: the kicker, the heading and the body, then the
|
|
6
|
+
// registration link as the main call and the polling-place link as an
|
|
7
|
+
// outline beside it (the polling link is the main call when there is no
|
|
8
|
+
// registration link). The second, raised on the band's card colour, is the
|
|
9
|
+
// visitor's plan: the election-day line in the display face, the early
|
|
10
|
+
// voting line under it, the ID note as a chip, then the key dates under
|
|
11
|
+
// `datesHeading`, each with its label, its day and its note; DaysLeft writes
|
|
12
|
+
// each date's state ("12 days left", "Today", "Closed") and lifts the
|
|
13
|
+
// nearest open one on a tint of the accent. Each card draws only what it has,
|
|
14
|
+
// and a card with nothing is left out. Nothing is drawn when the section
|
|
15
|
+
// has neither a heading, a link nor a date.
|
|
16
|
+
import type { Section } from '@backgold/content'
|
|
17
|
+
import Band from '../Band.astro'
|
|
18
|
+
import Prose from '../../Prose.astro'
|
|
19
|
+
import DaysLeft from './DaysLeft.astro'
|
|
20
|
+
import { voterTools } from './voter-tools'
|
|
21
|
+
import { prose } from '../../../lib/format'
|
|
22
|
+
|
|
23
|
+
interface Props {
|
|
24
|
+
section: Section
|
|
25
|
+
variant?: string
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const { section } = Astro.props
|
|
29
|
+
const vt = voterTools(section)
|
|
30
|
+
const buttons = [vt.register, vt.polling].filter((link) => link !== null)
|
|
31
|
+
const asks = !!(vt.kicker || vt.heading || prose(section.copy.body) || buttons.length > 0)
|
|
32
|
+
const plan = !!(vt.electionDay || vt.earlyVoting || vt.idNote || vt.dates.length > 0)
|
|
33
|
+
const shown = !!(vt.heading || buttons.length > 0 || vt.dates.length > 0)
|
|
34
|
+
---
|
|
35
|
+
{shown && (
|
|
36
|
+
<Band section={section} class="voter-tools vt-register">
|
|
37
|
+
<div class:list={['vt-cards', asks && plan && 'vt-cards-two']}>
|
|
38
|
+
{asks && (
|
|
39
|
+
<div class="vt-card vt-ask">
|
|
40
|
+
{vt.kicker && <p class="kicker">{vt.kicker}</p>}
|
|
41
|
+
{vt.heading && <h2>{vt.heading}</h2>}
|
|
42
|
+
<Prose value={section.copy.body} class="vt-body" />
|
|
43
|
+
{buttons.length > 0 && (
|
|
44
|
+
<p class="actions vt-actions">
|
|
45
|
+
{buttons.map((link, i) => <a class:list={['button', i > 0 && 'button-quiet']} href={link.href} rel={link.rel}>{link.label}</a>)}
|
|
46
|
+
</p>
|
|
47
|
+
)}
|
|
48
|
+
</div>
|
|
49
|
+
)}
|
|
50
|
+
{plan && (
|
|
51
|
+
<div class="vt-card vt-plan">
|
|
52
|
+
{vt.electionDay && <p class="vt-lead">{vt.electionDay}</p>}
|
|
53
|
+
{vt.earlyVoting && <p class="vt-early">{vt.earlyVoting}</p>}
|
|
54
|
+
{vt.idNote && <p class="vt-id"><span class="chip">{vt.idNote}</span></p>}
|
|
55
|
+
{vt.dates.length > 0 && (
|
|
56
|
+
<div class="vt-deadlines">
|
|
57
|
+
{vt.datesHeading && <h3 class="vt-label">{vt.datesHeading}</h3>}
|
|
58
|
+
<ul class="vt-deadline-list" role="list">
|
|
59
|
+
{vt.dates.map((date) => (
|
|
60
|
+
<li class="vt-deadline" data-vt-date={date.day ?? undefined}>
|
|
61
|
+
<span class="vt-deadline-label">{date.label}</span>
|
|
62
|
+
{date.day && date.short && (
|
|
63
|
+
<time class="vt-deadline-day" datetime={date.day}>
|
|
64
|
+
<span aria-hidden="true">{date.short}</span>
|
|
65
|
+
<span class="visually-hidden">{date.full}</span>
|
|
66
|
+
</time>
|
|
67
|
+
)}
|
|
68
|
+
<span class="vt-deadline-meta">
|
|
69
|
+
{date.day && <span class="vt-state" data-vt-state></span>}
|
|
70
|
+
{date.note && <span class="vt-note">{date.note}</span>}
|
|
71
|
+
</span>
|
|
72
|
+
</li>
|
|
73
|
+
))}
|
|
74
|
+
</ul>
|
|
75
|
+
</div>
|
|
76
|
+
)}
|
|
77
|
+
</div>
|
|
78
|
+
)}
|
|
79
|
+
</div>
|
|
80
|
+
{vt.dates.some((date) => date.day) && <DaysLeft />}
|
|
81
|
+
</Band>
|
|
82
|
+
)}
|
|
83
|
+
|
|
84
|
+
<style>
|
|
85
|
+
.vt-cards {
|
|
86
|
+
display: grid;
|
|
87
|
+
gap: clamp(1rem, 2vw, 1.5rem);
|
|
88
|
+
}
|
|
89
|
+
.vt-card {
|
|
90
|
+
min-width: 0;
|
|
91
|
+
padding: clamp(1.375rem, 1rem + 1.5vw, 2.25rem);
|
|
92
|
+
border: 1px solid var(--line);
|
|
93
|
+
border-radius: var(--radius-card);
|
|
94
|
+
}
|
|
95
|
+
.vt-card > :last-child {
|
|
96
|
+
margin-bottom: 0;
|
|
97
|
+
}
|
|
98
|
+
.vt-ask h2 {
|
|
99
|
+
max-width: 18ch;
|
|
100
|
+
}
|
|
101
|
+
.vt-ask :global(.vt-body) {
|
|
102
|
+
color: var(--muted);
|
|
103
|
+
font-size: var(--text-lg);
|
|
104
|
+
}
|
|
105
|
+
.vt-ask :global(.vt-body) > :last-child {
|
|
106
|
+
margin-bottom: 0;
|
|
107
|
+
}
|
|
108
|
+
.vt-actions {
|
|
109
|
+
margin-top: 1.75rem;
|
|
110
|
+
}
|
|
111
|
+
.vt-plan {
|
|
112
|
+
background: var(--surface);
|
|
113
|
+
box-shadow: var(--shadow);
|
|
114
|
+
}
|
|
115
|
+
.vt-lead {
|
|
116
|
+
margin: 0 0 0.625rem;
|
|
117
|
+
font-family: var(--font-display);
|
|
118
|
+
font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem);
|
|
119
|
+
font-weight: 700;
|
|
120
|
+
line-height: 1.15;
|
|
121
|
+
letter-spacing: -0.012em;
|
|
122
|
+
text-wrap: balance;
|
|
123
|
+
}
|
|
124
|
+
.vt-early {
|
|
125
|
+
margin: 0 0 1rem;
|
|
126
|
+
color: var(--muted);
|
|
127
|
+
}
|
|
128
|
+
.vt-id {
|
|
129
|
+
margin: 0 0 1.25rem;
|
|
130
|
+
}
|
|
131
|
+
.vt-deadlines {
|
|
132
|
+
margin-top: 1.5rem;
|
|
133
|
+
padding-top: 1.25rem;
|
|
134
|
+
border-top: 1px solid var(--line);
|
|
135
|
+
}
|
|
136
|
+
.vt-plan > .vt-deadlines:first-child {
|
|
137
|
+
margin-top: 0;
|
|
138
|
+
padding-top: 0;
|
|
139
|
+
border-top: 0;
|
|
140
|
+
}
|
|
141
|
+
.vt-label {
|
|
142
|
+
margin: 0 0 0.5rem;
|
|
143
|
+
color: var(--muted);
|
|
144
|
+
font-family: var(--font);
|
|
145
|
+
font-size: var(--text-xs);
|
|
146
|
+
font-weight: 700;
|
|
147
|
+
letter-spacing: 0.16em;
|
|
148
|
+
line-height: 1.4;
|
|
149
|
+
text-transform: uppercase;
|
|
150
|
+
}
|
|
151
|
+
.vt-deadline-list {
|
|
152
|
+
margin: 0;
|
|
153
|
+
padding: 0;
|
|
154
|
+
list-style: none;
|
|
155
|
+
}
|
|
156
|
+
/* A date's row: the label and its state over the note at the left, the day in the display face at the right. */
|
|
157
|
+
.vt-deadline {
|
|
158
|
+
display: grid;
|
|
159
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
160
|
+
align-items: baseline;
|
|
161
|
+
gap: 0.125rem 1rem;
|
|
162
|
+
padding: 0.75rem 0;
|
|
163
|
+
border-top: 1px solid var(--line);
|
|
164
|
+
}
|
|
165
|
+
.vt-deadline:first-child {
|
|
166
|
+
border-top: 0;
|
|
167
|
+
}
|
|
168
|
+
.vt-deadline-label {
|
|
169
|
+
font-weight: 700;
|
|
170
|
+
}
|
|
171
|
+
.vt-deadline-day {
|
|
172
|
+
grid-row: 1 / span 2;
|
|
173
|
+
grid-column: 2;
|
|
174
|
+
align-self: center;
|
|
175
|
+
font-family: var(--font-display);
|
|
176
|
+
font-size: 1.375rem;
|
|
177
|
+
font-weight: 800;
|
|
178
|
+
letter-spacing: -0.01em;
|
|
179
|
+
line-height: 1;
|
|
180
|
+
white-space: nowrap;
|
|
181
|
+
}
|
|
182
|
+
.vt-deadline-meta {
|
|
183
|
+
display: flex;
|
|
184
|
+
flex-wrap: wrap;
|
|
185
|
+
gap: 0 0.75rem;
|
|
186
|
+
font-size: var(--text-sm);
|
|
187
|
+
}
|
|
188
|
+
.vt-deadline-meta:empty {
|
|
189
|
+
display: none;
|
|
190
|
+
}
|
|
191
|
+
.vt-state {
|
|
192
|
+
font-weight: 700;
|
|
193
|
+
}
|
|
194
|
+
.vt-state:empty {
|
|
195
|
+
display: none;
|
|
196
|
+
}
|
|
197
|
+
.vt-note {
|
|
198
|
+
color: var(--muted);
|
|
199
|
+
}
|
|
200
|
+
/* The nearest open date (DaysLeft): a tint of the accent behind it, its state and day in the accent. */
|
|
201
|
+
.vt-deadline.vt-next {
|
|
202
|
+
margin-inline: calc(-1 * clamp(1.375rem, 1rem + 1.5vw, 2.25rem));
|
|
203
|
+
padding-inline: clamp(1.375rem, 1rem + 1.5vw, 2.25rem);
|
|
204
|
+
background: color-mix(in srgb, var(--accent) 7%, transparent);
|
|
205
|
+
}
|
|
206
|
+
.vt-next .vt-state,
|
|
207
|
+
.vt-next .vt-deadline-day {
|
|
208
|
+
color: var(--accent);
|
|
209
|
+
}
|
|
210
|
+
.vt-next .vt-deadline-day {
|
|
211
|
+
font-size: 1.75rem;
|
|
212
|
+
}
|
|
213
|
+
.vt-closed .vt-deadline-label,
|
|
214
|
+
.vt-closed .vt-deadline-day,
|
|
215
|
+
.vt-closed .vt-state {
|
|
216
|
+
color: var(--muted);
|
|
217
|
+
}
|
|
218
|
+
.vt-closed .vt-deadline-day {
|
|
219
|
+
text-decoration: line-through;
|
|
220
|
+
text-decoration-thickness: 1px;
|
|
221
|
+
}
|
|
222
|
+
@media (min-width: 48rem) {
|
|
223
|
+
.vt-cards-two {
|
|
224
|
+
grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
|
|
225
|
+
align-items: start;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
</style>
|