@sarimarcus/content-sites-ui 0.42.2 → 0.42.4

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/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  All packages in the platform release in lockstep; entries are per release version.
4
4
 
5
+ ## 0.42.4 (2026-10-22)
6
+
7
+ - `editorial`: new `PeopleHub`, the body of a people hub page (title band, era index, `PeopleTimeline`, one section per era with the era hook, intro and an optional per-era note, `PersonCard`s, and a "walk in their footsteps" block of era dossiers and people's articles), and `PeopleTimeline`, a static no-JS strip of equal-width era segments with one linked dot per person in birth order (hollow when undated, 44px hit areas, hidden below md). New `layoutPeopleTimeline()` and `footstepLinks()` helpers and `PeopleTimelineEntry` types; copy defaults in `LABELS.peopleTimeline` and `LABELS.peopleHub`. All prose is a prop. No change to existing components' markup (SLA-3310).
8
+
9
+ ## 0.42.3 (2026-10-22)
10
+
11
+ - `editorial`: `ChronologyTimeline` and `EraScenes` share internal `EraEntryRow`, `EraDossiers` and `Thumb` pieces and the `orderEras`/`orphanEraIds` helpers of `chronology.ts`; `ChronologyTimeline` renders identically, and `EraScenes` differs only in the class order of its article thumbnail box (SLA-3307). `composed`: `CardCarousel` no longer ships a global `<style>`: its track hides the scrollbar with the existing `scrollbar-hide` utility and draws its focus ring with `focus-visible:` utilities, so the `cc-track` class is gone and no carousel CSS reaches a page that imports a barrel reaching it. The track's `class` attribute changes on every carousel; the rendering does not. `editorial`: the People strip of `EraScenes` is now a `CardCarousel` (arrows, dots, a named region) in place of a plain scroll-snap track; the `#<era>-people` anchor moves from the heading to the carousel's wrapper (SLA-3308).
12
+
5
13
  ## 0.42.2 (2026-10-21)
6
14
 
7
15
  - `editorial`: new `EraScenes`, a site's eras as stacked scenes: a hero (image, date range, title and hook; a bordered panel without an era image), a cast row of up to six imaged people and monuments that anchors to the strips, the era intro, then a People strip (`PersonCard`, role labels, life dates), a Monuments grid (4:3 `EntityCard`, a landmark placeholder without an image) and an Articles list capped at `articleLimit` (default 5). An empty strip keeps its heading and says so; the era index is a `TableOfContents`. New `SceneItem`, `SceneKind`, `EraScene` types and `splitScene()` (cast ranked imaged first, featured, then year); copy defaults in `LABELS.eraScenes`. `PersonCard`'s `headingLevel` also accepts 4. The People strip is a plain scroll-snap track, not `CardCarousel`, so its global CSS does not ship to every page that imports the editorial barrel. `ChronologyTimeline` and `PersonPage` markup are unchanged (SLA-3299).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sarimarcus/content-sites-ui",
3
- "version": "0.42.2",
3
+ "version": "0.42.4",
4
4
  "description": "Universal Astro UI components, layout shell and design tokens shared by the content sites.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -50,6 +50,6 @@
50
50
  "@lucide/astro": "^1.23.0",
51
51
  "astro": "^7.0.6",
52
52
  "tailwindcss": "^4.1.18",
53
- "@sarimarcus/content-sites-core": "0.42.2"
53
+ "@sarimarcus/content-sites-core": "0.42.4"
54
54
  }
55
55
  }
@@ -62,6 +62,10 @@ const trackId = `${containerId}-t`;
62
62
  // The ::before grows the 36px circle into a 44px touch target.
63
63
  const arrowClass =
64
64
  'relative flex h-9 w-9 cursor-pointer items-center justify-center rounded-full border border-border bg-card transition-colors before:absolute before:-inset-1 hover:border-primary/40 hover:bg-primary/10 aria-disabled:pointer-events-none aria-disabled:opacity-25';
65
+ // Utilities, not component CSS: a style block here would ship to every page importing a barrel that reaches this file.
66
+ // The track stays swipable with no scrollbar; it is a keyboard focus stop, so it draws its own ring.
67
+ const trackClass =
68
+ '-mx-4 flex gap-4 overflow-x-auto scroll-px-4 px-4 py-1.5 snap-x snap-mandatory sm:mx-0 sm:scroll-px-0 sm:px-0 scrollbar-hide focus-visible:rounded-lg focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary';
65
69
  ---
66
70
 
67
71
  <div id={id} data-carousel={containerId} class:list={['scroll-mt-28', className]}>
@@ -110,7 +114,7 @@ const arrowClass =
110
114
  <div
111
115
  id={trackId}
112
116
  data-carousel-track
113
- class="cc-track -mx-4 flex gap-4 overflow-x-auto scroll-px-4 px-4 py-1.5 snap-x snap-mandatory sm:mx-0 sm:scroll-px-0 sm:px-0"
117
+ class={trackClass}
114
118
  aria-label={ariaLabel ?? heading ?? regionLabel}
115
119
  role="group"
116
120
  tabindex="0"
@@ -120,23 +124,6 @@ const arrowClass =
120
124
  <div data-carousel-dots class="mt-4 hidden justify-center"></div>
121
125
  </div>
122
126
 
123
- <style is:global>
124
- /* Hide the scrollbar while keeping the track scrollable/swipable. */
125
- .cc-track {
126
- -ms-overflow-style: none;
127
- scrollbar-width: none;
128
- }
129
- .cc-track::-webkit-scrollbar {
130
- display: none;
131
- }
132
- /* The track is a keyboard focus stop (tabindex="0", role="group"), so it needs its own visible focus ring. */
133
- .cc-track:focus-visible {
134
- outline: 2px solid var(--color-primary);
135
- outline-offset: 2px;
136
- border-radius: var(--radius-lg, 8px);
137
- }
138
- </style>
139
-
140
127
  <script>
141
128
  import { initCarousels } from './carousel.ts';
142
129
 
@@ -8,7 +8,6 @@ export { default as InlineImage } from './InlineImage.astro';
8
8
  export { default as Pagination } from './Pagination.astro';
9
9
  export { default as EntityCard } from './EntityCard.astro';
10
10
  export { default as ArrowLinkGrid } from './ArrowLinkGrid.astro';
11
- // RelatedContent sits here, not in ./editorial: it renders CardCarousel, whose <style> ships to every importer of the barrel.
12
11
  export { default as RelatedContent } from './RelatedContent.astro';
13
12
  export { default as RelatedContentCard } from './RelatedContentCard.astro';
14
13
  export { default as RelatedContentGrid } from './RelatedContentGrid.astro';
@@ -5,10 +5,10 @@
5
5
  */
6
6
  import type { EraDefinition } from '@sarimarcus/content-sites-core/eras';
7
7
  import TableOfContents from '../composed/TableOfContents.astro';
8
- import LinkArrow from '../primitives/LinkArrow.astro';
9
- import ResponsivePicture from '../primitives/ResponsivePicture.astro';
8
+ import EraDossiers from './EraDossiers.astro';
9
+ import EraEntryRow from './EraEntryRow.astro';
10
10
  import { LABELS } from '../internal/labels';
11
- import type { TimelineItem } from './chronology';
11
+ import { orderEras, orphanEraIds, type TimelineItem } from './chronology';
12
12
 
13
13
  interface Props {
14
14
  eras: readonly EraDefinition[];
@@ -37,8 +37,7 @@ const {
37
37
  class: className,
38
38
  } = Astro.props;
39
39
 
40
- const ordered = [...eras].sort((a, b) => a.startYear - b.startYear);
41
- const rows = ordered.map((era) => {
40
+ const rows = orderEras(eras).map((era) => {
42
41
  const entries = items[era.id] ?? [];
43
42
  const dated = entries.filter((item) => item.yearLabel);
44
43
  const undated = entries.filter((item) => !item.yearLabel);
@@ -50,12 +49,9 @@ const rows = ordered.map((era) => {
50
49
  const fullEras = rows.filter((r) => r.full).map((r) => r.era);
51
50
 
52
51
  if (import.meta.env.DEV) {
53
- const known = new Set(eras.map((e) => e.id));
54
- const orphans = Object.keys(items).filter((id) => !known.has(id) && items[id].length);
52
+ const orphans = orphanEraIds(eras, items);
55
53
  if (orphans.length) console.warn(`ChronologyTimeline: entries for unknown era id(s) ${orphans.join(', ')} are not rendered.`);
56
54
  }
57
-
58
- const thumbSizes = '(min-width: 640px) 128px, 64px';
59
55
  ---
60
56
 
61
57
  <div class:list={['w-full', className]} data-chronology>
@@ -83,45 +79,11 @@ const thumbSizes = '(min-width: 640px) 128px, 64px';
83
79
  <>
84
80
  {run.label && <p id={`${era.anchor}-undated`} class="mt-8 text-sm font-semibold text-muted-foreground">{run.label}</p>}
85
81
  <ol aria-labelledby={run.label ? `${era.anchor}-undated` : undefined} class:list={[run.label ? 'mt-3' : 'mt-8', 'divide-y divide-border border-y border-border']}>
86
- {run.entries.map((item) => (
87
- <li class="group/entry relative flex items-start gap-3 py-5 sm:gap-6">
88
- <div class="min-w-0 flex-1">
89
- <h3 class="text-lg font-semibold leading-snug text-foreground text-pretty">
90
- <a href={item.href} class="rounded-sm transition-colors group-hover/entry:text-primary focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-ring after:absolute after:inset-0">{item.title}</a>
91
- </h3>
92
- <p class="mt-1 flex flex-wrap gap-x-2 gap-y-0.5 text-sm text-muted-foreground">
93
- {item.yearLabel && <span class="tabular-nums font-medium text-foreground">{item.yearLabel}</span>}
94
- {item.yearLabel && <span aria-hidden="true">·</span>}
95
- <span>{item.kind}</span>
96
- </p>
97
- {item.description && (
98
- <p class="mt-2 line-clamp-3 max-w-measure text-base leading-relaxed text-muted-foreground sm:line-clamp-none">{item.description}</p>
99
- )}
100
- </div>
101
- {item.image && (
102
- <div class="w-16 shrink-0 overflow-hidden rounded-md bg-muted aspect-[4/3] sm:w-32">
103
- {typeof item.image === 'string' ? (
104
- <img src={item.image} alt="" width="128" height="96" loading="lazy" decoding="async" class="size-full object-cover" />
105
- ) : (
106
- <ResponsivePicture src={item.image} alt="" sizes={thumbSizes} loading="lazy" decoding="async" class="size-full object-cover" />
107
- )}
108
- </div>
109
- )}
110
- </li>
111
- ))}
82
+ {run.entries.map((item) => <EraEntryRow item={item} headingLevel={3} />)}
112
83
  </ol>
113
84
  </>
114
85
  ))}
115
- {era.dossiers && era.dossiers.length > 0 && (
116
- <div class="mt-8">
117
- <p id={`${era.anchor}-dossiers`} class="text-sm font-semibold text-foreground">{dossiersLabel}</p>
118
- <ul aria-labelledby={`${era.anchor}-dossiers`} class="mt-2 flex flex-wrap gap-x-6">
119
- {era.dossiers.map((d) => (
120
- <li><LinkArrow href={d.href} color="secondary" class="min-h-11">{d.label}</LinkArrow></li>
121
- ))}
122
- </ul>
123
- </div>
124
- )}
86
+ <EraDossiers era={era} label={dossiersLabel} />
125
87
  </div>
126
88
  </li>
127
89
  ) : (
@@ -0,0 +1,24 @@
1
+ ---
2
+ /** The "go deeper" links under an era; renders nothing without dossiers. */
3
+ import type { EraDefinition } from '@sarimarcus/content-sites-core/eras';
4
+ import LinkArrow from '../primitives/LinkArrow.astro';
5
+ import { LABELS } from '../internal/labels';
6
+
7
+ interface Props {
8
+ era: EraDefinition;
9
+ label?: string;
10
+ }
11
+
12
+ const { era, label = LABELS.chronologyTimeline.dossiersLabel } = Astro.props;
13
+ ---
14
+
15
+ {era.dossiers && era.dossiers.length > 0 && (
16
+ <div class="mt-8">
17
+ <p id={`${era.anchor}-dossiers`} class="text-sm font-semibold text-foreground">{label}</p>
18
+ <ul aria-labelledby={`${era.anchor}-dossiers`} class="mt-2 flex flex-wrap gap-x-6">
19
+ {era.dossiers.map((d) => (
20
+ <li><LinkArrow href={d.href} color="secondary" class="min-h-11">{d.label}</LinkArrow></li>
21
+ ))}
22
+ </ul>
23
+ </div>
24
+ )}
@@ -0,0 +1,34 @@
1
+ ---
2
+ /** One dated entry of an era: title link covering the row, year and kind, description, optional thumbnail. */
3
+ import Thumb from './Thumb.astro';
4
+ import type { TimelineItem } from './chronology';
5
+
6
+ interface Props {
7
+ item: TimelineItem;
8
+ headingLevel: 3 | 4;
9
+ }
10
+
11
+ const { item, headingLevel } = Astro.props;
12
+ const Heading = `h${headingLevel}` as const;
13
+ ---
14
+
15
+ <li class="group/entry relative flex items-start gap-3 py-5 sm:gap-6">
16
+ <div class="min-w-0 flex-1">
17
+ <Heading class="text-lg font-semibold leading-snug text-foreground text-pretty">
18
+ <a href={item.href} class="rounded-sm transition-colors group-hover/entry:text-primary focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-ring after:absolute after:inset-0">{item.title}</a>
19
+ </Heading>
20
+ <p class="mt-1 flex flex-wrap gap-x-2 gap-y-0.5 text-sm text-muted-foreground">
21
+ {item.yearLabel && <span class="tabular-nums font-medium text-foreground">{item.yearLabel}</span>}
22
+ {item.yearLabel && <span aria-hidden="true">·</span>}
23
+ <span>{item.kind}</span>
24
+ </p>
25
+ {item.description && (
26
+ <p class="mt-2 line-clamp-3 max-w-measure text-base leading-relaxed text-muted-foreground sm:line-clamp-none">{item.description}</p>
27
+ )}
28
+ </div>
29
+ {item.image && (
30
+ <div class="w-16 shrink-0 overflow-hidden rounded-md bg-muted aspect-[4/3] sm:w-32">
31
+ <Thumb image={item.image} sizes="(min-width: 640px) 128px, 64px" width={128} height={96} />
32
+ </div>
33
+ )}
34
+ </li>
@@ -10,16 +10,19 @@
10
10
  */
11
11
  import type { ImageMetadata } from 'astro';
12
12
  import type { EraDefinition } from '@sarimarcus/content-sites-core/eras';
13
+ import CardCarousel from '../composed/CardCarousel.astro';
13
14
  import TableOfContents from '../composed/TableOfContents.astro';
14
15
  import EntityCard from '../composed/EntityCard.astro';
15
16
  import Container from '../layout/Container.astro';
16
17
  import Icon from '../primitives/Icon.astro';
17
- import LinkArrow from '../primitives/LinkArrow.astro';
18
18
  import ResponsivePicture from '../primitives/ResponsivePicture.astro';
19
19
  import PersonCard from './PersonCard.astro';
20
20
  import CardPlaceholder from './CardPlaceholder.astro';
21
+ import EraDossiers from './EraDossiers.astro';
22
+ import EraEntryRow from './EraEntryRow.astro';
23
+ import Thumb from './Thumb.astro';
21
24
  import { LABELS } from '../internal/labels';
22
- import { splitScene, type SceneItem } from './chronology';
25
+ import { orderEras, orphanEraIds, splitScene, type SceneItem } from './chronology';
23
26
 
24
27
  type SceneLabels = typeof LABELS.eraScenes;
25
28
 
@@ -38,19 +41,15 @@ interface Props {
38
41
  const { eras, items, index = true, castLimit = 6, articleLimit = 5, labels, class: className } = Astro.props;
39
42
  const L: SceneLabels = { ...LABELS.eraScenes, ...labels };
40
43
 
41
- const ordered = [...eras].sort((a, b) => a.startYear - b.startYear);
42
- const scenes = ordered.map((era) => ({ era, scene: splitScene(items[era.id] ?? [], { castLimit, articleLimit }) }));
44
+ const scenes = orderEras(eras).map((era) => ({ era, scene: splitScene(items[era.id] ?? [], { castLimit, articleLimit }) }));
43
45
 
44
46
  if (import.meta.env.DEV) {
45
- const known = new Set(eras.map((e) => e.id));
46
- const orphans = Object.keys(items).filter((id) => !known.has(id) && items[id].length);
47
+ const orphans = orphanEraIds(eras, items);
47
48
  if (orphans.length) console.warn(`EraScenes: entries for unknown era id(s) ${orphans.join(', ')} are not rendered.`);
48
49
  }
49
50
 
50
51
  const asImage = (image: SceneItem['image']): ImageMetadata | undefined => (typeof image === 'object' ? image : undefined);
51
52
  const asSrc = (image: SceneItem['image']): string | undefined => (typeof image === 'string' ? image : undefined);
52
- // A plain snap track: CardCarousel's CSS would ship to every page importing the editorial barrel.
53
- const track = 'flex gap-4 overflow-x-auto snap-x snap-mandatory pb-3 focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-ring';
54
53
  const cardWidth = 'snap-start shrink-0 w-[72vw] sm:w-60';
55
54
  const stripHeading = 'font-display text-2xl text-foreground';
56
55
  ---
@@ -112,11 +111,7 @@ const stripHeading = 'font-display text-2xl text-foreground';
112
111
  <li class="w-20">
113
112
  <a href={href} class="group flex flex-col gap-1.5 rounded-lg focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-ring">
114
113
  <span class="block aspect-square overflow-hidden rounded-lg bg-muted">
115
- {asImage(item.image) ? (
116
- <ResponsivePicture src={asImage(item.image)!} alt="" sizes="80px" loading="lazy" decoding="async" pictureAttributes={{ class: 'block size-full' }} class="size-full object-cover" />
117
- ) : (
118
- <img src={asSrc(item.image)} alt="" width="80" height="80" loading="lazy" decoding="async" class="size-full object-cover" />
119
- )}
114
+ <Thumb image={item.image!} sizes="80px" width={80} height={80} pictureAttributes={{ class: 'block size-full' }} />
120
115
  </span>
121
116
  <span class="line-clamp-2 text-sm leading-tight text-foreground group-hover:text-primary">{item.title}</span>
122
117
  </a>
@@ -129,9 +124,8 @@ const stripHeading = 'font-display text-2xl text-foreground';
129
124
  <p class="mt-8 max-w-measure text-lg leading-relaxed text-foreground">{era.intro}</p>
130
125
 
131
126
  <div class="mt-10">
132
- <h3 id={`${era.anchor}-people`} class={stripHeading}>{L.peopleHeading}</h3>
133
127
  {scene.people.length > 0 ? (
134
- <div role="region" aria-labelledby={`${era.anchor}-people`} tabindex="0" class={`mt-4 ${track}`}>
128
+ <CardCarousel id={`${era.anchor}-people`} heading={L.peopleHeading} headingTag="h3" headingClass={stripHeading} ariaLabel={`${era.label}: ${L.peopleHeading}`}>
135
129
  {scene.people.map((item, i) => (
136
130
  <div id={`${era.anchor}-person-${i}`} class={`${cardWidth} scroll-mt-28`}>
137
131
  <PersonCard
@@ -148,9 +142,12 @@ const stripHeading = 'font-display text-2xl text-foreground';
148
142
  />
149
143
  </div>
150
144
  ))}
151
- </div>
145
+ </CardCarousel>
152
146
  ) : (
153
- <p class="mt-2 text-muted-foreground">{L.emptyPeople}</p>
147
+ <>
148
+ <h3 id={`${era.anchor}-people`} class={stripHeading}>{L.peopleHeading}</h3>
149
+ <p class="mt-2 text-muted-foreground">{L.emptyPeople}</p>
150
+ </>
154
151
  )}
155
152
  </div>
156
153
 
@@ -193,48 +190,14 @@ const stripHeading = 'font-display text-2xl text-foreground';
193
190
  <h3 id={`${era.anchor}-articles`} class={stripHeading}>{L.articlesHeading}</h3>
194
191
  {scene.articles.length > 0 ? (
195
192
  <ol aria-labelledby={`${era.anchor}-articles`} class="mt-4 divide-y divide-border border-y border-border">
196
- {scene.articles.map((item) => (
197
- <li class="group/entry relative flex items-start gap-3 py-5 sm:gap-6">
198
- <div class="min-w-0 flex-1">
199
- <h4 class="text-lg font-semibold leading-snug text-foreground text-pretty">
200
- <a href={item.href} class="rounded-sm transition-colors group-hover/entry:text-primary focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-ring after:absolute after:inset-0">{item.title}</a>
201
- </h4>
202
- <p class="mt-1 flex flex-wrap gap-x-2 gap-y-0.5 text-sm text-muted-foreground">
203
- {item.yearLabel && <span class="tabular-nums font-medium text-foreground">{item.yearLabel}</span>}
204
- {item.yearLabel && <span aria-hidden="true">·</span>}
205
- <span>{item.kind}</span>
206
- </p>
207
- {item.description && (
208
- <p class="mt-2 line-clamp-3 max-w-measure text-base leading-relaxed text-muted-foreground sm:line-clamp-none">{item.description}</p>
209
- )}
210
- </div>
211
- {item.image && (
212
- <div class="aspect-[4/3] w-16 shrink-0 overflow-hidden rounded-md bg-muted sm:w-32">
213
- {asImage(item.image) ? (
214
- <ResponsivePicture src={asImage(item.image)!} alt="" sizes="(min-width: 640px) 128px, 64px" loading="lazy" decoding="async" class="size-full object-cover" />
215
- ) : (
216
- <img src={asSrc(item.image)} alt="" width="128" height="96" loading="lazy" decoding="async" class="size-full object-cover" />
217
- )}
218
- </div>
219
- )}
220
- </li>
221
- ))}
193
+ {scene.articles.map((item) => <EraEntryRow item={item} headingLevel={4} />)}
222
194
  </ol>
223
195
  ) : (
224
196
  <p class="mt-2 text-muted-foreground">{L.emptyArticles}</p>
225
197
  )}
226
198
  </div>
227
199
 
228
- {era.dossiers && era.dossiers.length > 0 && (
229
- <div class="mt-8">
230
- <p id={`${era.anchor}-dossiers`} class="text-sm font-semibold text-foreground">{L.dossiersLabel}</p>
231
- <ul aria-labelledby={`${era.anchor}-dossiers`} class="mt-2 flex flex-wrap gap-x-6">
232
- {era.dossiers.map((d) => (
233
- <li><LinkArrow href={d.href} color="secondary" class="min-h-11">{d.label}</LinkArrow></li>
234
- ))}
235
- </ul>
236
- </div>
237
- )}
200
+ <EraDossiers era={era} label={L.dossiersLabel} />
238
201
  </Container>
239
202
  </section>
240
203
  );
@@ -0,0 +1,111 @@
1
+ ---
2
+ /**
3
+ * PeopleHub — the body of a people hub page: title band, era index, people timeline, then one section per era
4
+ * (era hook and intro, an optional people-focused line, PersonCards) and a closing "walk in their footsteps" block
5
+ * built from the eras' dossiers and each person's article. Prose arrives as props: nothing is written here.
6
+ * The site keeps Layout, StructuredData and the breadcrumb band, and wraps this in `<main>`.
7
+ */
8
+ import type { ImageMetadata } from 'astro';
9
+ import type { EraDefinition } from '@sarimarcus/content-sites-core/eras';
10
+ import TableOfContents from '../composed/TableOfContents.astro';
11
+ import Container from '../layout/Container.astro';
12
+ import LinkArrow from '../primitives/LinkArrow.astro';
13
+ import PersonCard from './PersonCard.astro';
14
+ import PeopleTimeline from './PeopleTimeline.astro';
15
+ import { LABELS } from '../internal/labels';
16
+ import { footstepLinks, layoutPeopleTimeline, type PeopleTimelineEntry } from './people-timeline';
17
+
18
+ interface HubPerson extends PeopleTimelineEntry {
19
+ image?: ImageMetadata;
20
+ imageAlt: string;
21
+ roles?: readonly string[];
22
+ knownFor?: string;
23
+ /** The person's main article, listed in the footsteps block. */
24
+ article?: { label: string; href: string };
25
+ }
26
+
27
+ interface Props {
28
+ title: string;
29
+ /** Under the title, 1-2 short lines. */
30
+ lede?: string;
31
+ /** Hub intro paragraphs, shown under the lede band. */
32
+ intro?: readonly string[];
33
+ eras: readonly EraDefinition[];
34
+ people: readonly HubPerson[];
35
+ /** People-focused line per era id, shown after the era intro. */
36
+ eraNotes?: Record<string, string>;
37
+ indexLabel?: string;
38
+ timelineLabel?: string;
39
+ footstepsHeading?: string;
40
+ }
41
+
42
+ const {
43
+ title,
44
+ lede,
45
+ intro = [],
46
+ eras,
47
+ people,
48
+ eraNotes = {},
49
+ indexLabel = LABELS.peopleHub.indexLabel,
50
+ timelineLabel,
51
+ footstepsHeading = LABELS.peopleHub.footstepsHeading,
52
+ } = Astro.props;
53
+
54
+ const segments = layoutPeopleTimeline(eras, people);
55
+ const sections = segments.map(({ era, dots }) => ({ era, group: dots }));
56
+ const footsteps = footstepLinks(segments.map((s) => s.era), segments.flatMap((s) => s.dots));
57
+ ---
58
+
59
+ <div class="bg-muted/30 border-b border-border pt-12 pb-10" data-pagefind-body>
60
+ <Container>
61
+ <h1 class="max-w-measure text-3xl sm:text-4xl font-normal font-display text-foreground leading-tight text-balance">{title}</h1>
62
+ {lede && <p class="mt-5 max-w-measure text-lg text-muted-foreground leading-relaxed">{lede}</p>}
63
+ {intro.map((paragraph) => <p class="mt-4 max-w-measure text-base text-foreground leading-relaxed">{paragraph}</p>)}
64
+ </Container>
65
+ </div>
66
+
67
+ <div class="py-12 lg:py-20" data-pagefind-body>
68
+ <Container>
69
+ <TableOfContents
70
+ class="mb-8 md:hidden"
71
+ showHeader={false}
72
+ ariaLabel={indexLabel}
73
+ items={sections.map(({ era, group }) => ({ label: `${era.label} (${group.length})`, href: `#era-${era.id}` }))}
74
+ sectionSelector="[data-people-era]"
75
+ hideMiniPastLastSection
76
+ />
77
+ <PeopleTimeline class="mb-14" segments={segments} ariaLabel={timelineLabel} />
78
+ {sections.map(({ era, group }) => (
79
+ <section id={`era-${era.id}`} class="mb-14 scroll-mt-28" aria-labelledby={`era-${era.id}-heading`} data-people-era>
80
+ <h2 id={`era-${era.id}-heading`} class="font-display text-2xl font-semibold text-foreground">{era.label}</h2>
81
+ {era.hook && <p class="mt-2 max-w-measure font-display text-lg text-secondary">{era.hook}</p>}
82
+ <p class="mt-3 max-w-measure text-base text-foreground leading-relaxed">{era.intro}</p>
83
+ {eraNotes[era.id] && <p class="mt-3 max-w-measure text-base text-foreground leading-relaxed">{eraNotes[era.id]}</p>}
84
+ <div class="mt-6 grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
85
+ {group.map((p) => (
86
+ <PersonCard
87
+ href={p.href}
88
+ name={p.name}
89
+ image={p.image}
90
+ imageAlt={p.imageAlt}
91
+ dates={p.dates}
92
+ roles={p.roles}
93
+ knownFor={p.knownFor}
94
+ eraLabel={`${era.label} · ${era.rangeLabel}`}
95
+ />
96
+ ))}
97
+ </div>
98
+ </section>
99
+ ))}
100
+ {footsteps.length > 0 && (
101
+ <section class="border-t border-border pt-10" aria-labelledby="people-footsteps-heading">
102
+ <h2 id="people-footsteps-heading" class="font-display text-2xl font-semibold text-foreground">{footstepsHeading}</h2>
103
+ <ul class="mt-4 grid gap-x-8 sm:grid-cols-2">
104
+ {footsteps.map((link) => (
105
+ <li><LinkArrow href={link.href} color="secondary" class="min-h-11">{link.label}</LinkArrow></li>
106
+ ))}
107
+ </ul>
108
+ </section>
109
+ )}
110
+ </Container>
111
+ </div>
@@ -0,0 +1,69 @@
1
+ ---
2
+ /**
3
+ * PeopleTimeline — a static, no-JS strip of the eras that have people: equal-width era segments, one dot per person
4
+ * in birth order, each linking to its target. People with no dates come last in their era as a hollow dot. Era labels
5
+ * link to `#<sectionIdPrefix><era.id>`. Hidden below md: the hub's era index takes over there.
6
+ */
7
+ import type { EraDefinition } from '@sarimarcus/content-sites-core/eras';
8
+ import { LABELS } from '../internal/labels';
9
+ import { layoutPeopleTimeline, type PeopleTimelineEntry, type PeopleTimelineSegment } from './people-timeline';
10
+
11
+ interface Props {
12
+ /** With `people`, laid out here; or pass `segments` already laid out (PeopleHub does, to group once). */
13
+ eras?: readonly EraDefinition[];
14
+ people?: readonly PeopleTimelineEntry[];
15
+ segments?: readonly PeopleTimelineSegment[];
16
+ ariaLabel?: string;
17
+ /** Fragment prefix of the era sections the labels link to. */
18
+ sectionIdPrefix?: string;
19
+ approximateLabel?: string;
20
+ class?: string;
21
+ }
22
+
23
+ const {
24
+ eras = [],
25
+ people = [],
26
+ segments: laidOut,
27
+ ariaLabel = LABELS.peopleTimeline.ariaLabel,
28
+ sectionIdPrefix = 'era-',
29
+ approximateLabel = LABELS.peopleTimeline.approximate,
30
+ class: className,
31
+ } = Astro.props;
32
+
33
+ const segments = laidOut ?? layoutPeopleTimeline(eras, people);
34
+ ---
35
+
36
+ {segments.length > 0 && (
37
+ <nav aria-label={ariaLabel} class:list={['hidden md:block', className]} data-people-timeline>
38
+ <ol class="flex">
39
+ {segments.map(({ era, dots }) => (
40
+ <li class="min-w-0 flex-1 border-l border-border first:border-l-0">
41
+ <a href={`#${sectionIdPrefix}${era.id}`} class="flex min-h-11 flex-col justify-center px-2 text-center hover:text-primary focus-visible:text-primary">
42
+ <span class="block truncate font-display text-sm text-foreground">{era.label}</span>
43
+ <span class="block truncate text-xs tabular-nums text-muted-foreground">{era.rangeLabel}</span>
44
+ </a>
45
+ <div class="relative mx-2 mt-3 h-6">
46
+ <span class="absolute inset-x-0 top-1/2 h-0.5 -translate-y-1/2 bg-foreground/15" aria-hidden="true"></span>
47
+ {dots.map((dot) => {
48
+ const label = LABELS.peopleTimeline.dotLabel(dot.name, dot.dates);
49
+ const full = dot.approximate ? `${label} (${approximateLabel})` : label;
50
+ return (
51
+ <a
52
+ href={dot.href}
53
+ aria-label={full}
54
+ title={full}
55
+ style={`left:${dot.offset}%`}
56
+ class:list={[
57
+ 'absolute top-1/2 size-3 -translate-x-1/2 -translate-y-1/2 rounded-full ring-2 ring-background before:absolute before:-inset-4 hover:scale-125 focus-visible:scale-125',
58
+ dot.approximate ? 'border border-primary bg-background' : 'bg-primary',
59
+ ]}
60
+ data-approximate={dot.approximate ? '' : undefined}
61
+ ></a>
62
+ );
63
+ })}
64
+ </div>
65
+ </li>
66
+ ))}
67
+ </ol>
68
+ </nav>
69
+ )}
@@ -6,8 +6,8 @@
6
6
  * the lifespan as typography; portrait as the backdrop, else a monogram panel), a quiet key-facts strip (aliases,
7
7
  * optional `contextFact`), a short sticky ToC only when the bio runs past four paragraphs, the bio with its first
8
8
  * paragraph as the lead, the featured full-story card, places to see, the era on a ChronologyTimeline, then up to
9
- * four related reads (`RelatedContentGrid`, not `RelatedContent`: the person page owns its headings and
10
- * `RelatedContent` carries the carousel CSS). Every string is a prop or a LABELS default; a block with no data
9
+ * four related reads (`RelatedContentGrid`, not `RelatedContent`: the person page owns its headings).
10
+ * Every string is a prop or a LABELS default; a block with no data
11
11
  * renders nothing. The lifespan reads "Lived c. 1138–1204 (about 66 years)" from `birthYear`/`deathYear`/`circa`,
12
12
  * or from a pre-formatted `lifespan` or `dates` (both shown as is). `readMore` is ranked by the caller: the first
13
13
  * `readMoreLimit` (four) render, so the route passes the best reads first. Slots:
@@ -0,0 +1,22 @@
1
+ ---
2
+ /** A decorative (alt="") image that is either an imported asset or a plain URL; the caller sizes the box. */
3
+ import type { ImageMetadata } from 'astro';
4
+ import ResponsivePicture from '../primitives/ResponsivePicture.astro';
5
+
6
+ interface Props {
7
+ image: ImageMetadata | string;
8
+ sizes: string;
9
+ /** Intrinsic size of the plain-URL `<img>`. */
10
+ width: number;
11
+ height: number;
12
+ pictureAttributes?: Record<string, string>;
13
+ }
14
+
15
+ const { image, sizes, width, height, pictureAttributes } = Astro.props;
16
+ ---
17
+
18
+ {typeof image === 'string' ? (
19
+ <img src={image} alt="" width={width} height={height} loading="lazy" decoding="async" class="size-full object-cover" />
20
+ ) : (
21
+ <ResponsivePicture src={image} alt="" sizes={sizes} loading="lazy" decoding="async" pictureAttributes={pictureAttributes} class="size-full object-cover" />
22
+ )}
@@ -1,4 +1,5 @@
1
1
  import type { ImageMetadata } from 'astro';
2
+ import type { EraDefinition } from '@sarimarcus/content-sites-core/eras';
2
3
 
3
4
  /** One entry on a ChronologyTimeline era. `kind` and `yearLabel` are site copy, rendered verbatim. */
4
5
  export interface TimelineItem {
@@ -86,3 +87,14 @@ export function groupByEra<T>(
86
87
  }
87
88
  return groups;
88
89
  }
90
+
91
+ /** The eras oldest first; the input is not mutated. */
92
+ export function orderEras(eras: readonly EraDefinition[]): EraDefinition[] {
93
+ return [...eras].sort((a, b) => a.startYear - b.startYear);
94
+ }
95
+
96
+ /** Era ids in `items` that carry entries but match no era, so nothing renders them. */
97
+ export function orphanEraIds(eras: readonly EraDefinition[], items: Record<string, readonly unknown[]>): string[] {
98
+ const known = new Set(eras.map((e) => e.id));
99
+ return Object.keys(items).filter((id) => !known.has(id) && items[id].length);
100
+ }
@@ -32,6 +32,9 @@ export { default as AlsoExplore } from './AlsoExplore.astro';
32
32
  export { default as VisitTiming } from './VisitTiming.astro';
33
33
  export { default as ChronologyTimeline } from './ChronologyTimeline.astro';
34
34
  export { groupByEra, type TimelineItem } from './chronology';
35
+ export { default as PeopleHub } from './PeopleHub.astro';
36
+ export { default as PeopleTimeline } from './PeopleTimeline.astro';
37
+ export { layoutPeopleTimeline, footstepLinks, type PeopleTimelineEntry, type PeopleTimelineDot, type PeopleTimelineSegment } from './people-timeline';
35
38
  export { monogram } from './monogram';
36
39
  export type { AlsoExploreItem } from './AlsoExplore.astro';
37
40
  export type { VisitTimingData } from './VisitTiming.astro';
@@ -0,0 +1,71 @@
1
+ import type { EraDefinition } from '@sarimarcus/content-sites-core/eras';
2
+ import { groupByEra, orderEras } from './chronology.ts';
3
+
4
+ export interface PeopleTimelineEntry {
5
+ slug: string;
6
+ name: string;
7
+ href: string;
8
+ era?: string;
9
+ birthYear?: number;
10
+ deathYear?: number;
11
+ /** Life dates as displayed, shown in the dot's label. */
12
+ dates?: string;
13
+ }
14
+
15
+ export type PeopleTimelineDot<T extends PeopleTimelineEntry = PeopleTimelineEntry> = T & {
16
+ /** 0–100, position inside the era segment. */
17
+ offset: number;
18
+ /** No birth or death year: drawn hollow, in the slot its sort order gives it (last). */
19
+ approximate: boolean;
20
+ };
21
+
22
+ export interface PeopleTimelineSegment<T extends PeopleTimelineEntry = PeopleTimelineEntry> {
23
+ era: EraDefinition;
24
+ dots: PeopleTimelineDot<T>[];
25
+ }
26
+
27
+ /**
28
+ * The closing "footsteps" links: each era's dossiers (oldest era first), then each person's article, both deduped by
29
+ * href. Eras without people are the caller's to leave out.
30
+ */
31
+ export function footstepLinks(
32
+ eras: readonly EraDefinition[],
33
+ people: readonly { article?: { label: string; href: string } }[],
34
+ ): { label: string; href: string }[] {
35
+ const seen = new Set<string>();
36
+ const links: { label: string; href: string }[] = [];
37
+ const add = (link: { label: string; href: string } | undefined) => {
38
+ if (!link || seen.has(link.href)) return;
39
+ seen.add(link.href);
40
+ links.push(link);
41
+ };
42
+ for (const era of orderEras(eras)) era.dossiers?.forEach(add);
43
+ people.forEach((p) => add(p.article));
44
+ return links;
45
+ }
46
+
47
+ /**
48
+ * One segment per era that has people, oldest era first, equal widths. Inside a segment the dots follow birth year
49
+ * (death year when there is no birth year; people with neither come last, flagged approximate), in the order
50
+ * `groupByEra` gives and evenly spaced, so no two dots share a position. Entries with an unknown or missing era are
51
+ * dropped. The input is not mutated; each dot keeps every field of its entry.
52
+ */
53
+ export function layoutPeopleTimeline<T extends PeopleTimelineEntry>(
54
+ eras: readonly EraDefinition[],
55
+ people: readonly T[],
56
+ ): PeopleTimelineSegment<T>[] {
57
+ const groups = groupByEra(people, (p) => p.era, (p) => p.birthYear ?? p.deathYear, (p) => p.name);
58
+ return orderEras(eras)
59
+ .filter((era) => groups[era.id]?.length)
60
+ .map((era) => {
61
+ const group = groups[era.id];
62
+ return {
63
+ era,
64
+ dots: group.map((p, i) => ({
65
+ ...p,
66
+ offset: ((i + 0.5) / group.length) * 100,
67
+ approximate: p.birthYear === undefined && p.deathYear === undefined,
68
+ })),
69
+ };
70
+ });
71
+ }
@@ -1,5 +1,8 @@
1
1
  // The English copy ui components fall back to when the site passes no prop (SLA-2991). A template never writes
2
2
  // reader-visible text itself (validate-packages refuses it); it reads a prop whose default is here.
3
+ // Shared by ChronologyTimeline and EraScenes, so the two cannot drift.
4
+ const eraLabels = { indexLabel: 'Eras', dossiersLabel: 'Go deeper' };
5
+
3
6
  export const LABELS = {
4
7
  affiliateCard: {
5
8
  pricePrefix: 'From ',
@@ -75,6 +78,15 @@ export const LABELS = {
75
78
  eraChip: { ariaLabel: (label: string, range: string) => `${label}, ${range}: see this era on the chronology` },
76
79
  personChip: { ariaLabel: (name: string, dates?: string) => `${name}${dates ? `, ${dates}` : ''}: read their profile` },
77
80
  personCard: { cta: 'Read the profile' },
81
+ peopleTimeline: {
82
+ ariaLabel: 'People by era',
83
+ approximate: 'date unknown, placed mid-era',
84
+ dotLabel: (name: string, dates?: string) => (dates ? `${name}, ${dates}` : name),
85
+ },
86
+ peopleHub: {
87
+ indexLabel: 'Jump to an era',
88
+ footstepsHeading: 'Walk in their footsteps',
89
+ },
78
90
  personPage: {
79
91
  readFullStory: 'Read the full story',
80
92
  fullStoryHeading: 'The full story',
@@ -116,18 +128,16 @@ export const LABELS = {
116
128
  },
117
129
  breadcrumb: { homeLabel: 'Home', ariaLabel: 'Breadcrumb navigation' },
118
130
  chronologyTimeline: {
119
- indexLabel: 'Eras',
120
- dossiersLabel: 'Go deeper',
131
+ ...eraLabels,
121
132
  emptyLabel: '',
122
133
  undatedLabel: 'Undated',
123
134
  },
124
135
  eraScenes: {
125
- indexLabel: 'Eras',
136
+ ...eraLabels,
126
137
  castLabel: 'In this era',
127
138
  peopleHeading: 'People',
128
139
  monumentsHeading: 'Monuments',
129
140
  articlesHeading: 'Articles',
130
- dossiersLabel: 'Go deeper',
131
141
  emptyPeople: 'No people catalogued for this era yet.',
132
142
  emptyMonuments: 'No monuments catalogued for this era yet.',
133
143
  emptyArticles: 'No articles for this era yet.',
@@ -2,7 +2,7 @@
2
2
  package's own templates are scanned: @import "@sarimarcus/content-sites-ui/tailwind.css"; */
3
3
  @source "..";
4
4
 
5
- /* Horizontal scrollers that keep scrolling but draw no scrollbar (Breadcrumb, TableOfContents). */
5
+ /* Horizontal scrollers that keep scrolling but draw no scrollbar (Breadcrumb, TableOfContents, CardCarousel). */
6
6
  @utility scrollbar-hide {
7
7
  -ms-overflow-style: none;
8
8
  scrollbar-width: none;