@sarimarcus/content-sites-ui 0.42.3 → 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,10 @@
|
|
|
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
|
+
|
|
5
9
|
## 0.42.3 (2026-10-22)
|
|
6
10
|
|
|
7
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).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sarimarcus/content-sites-ui",
|
|
3
|
-
"version": "0.42.
|
|
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.
|
|
53
|
+
"@sarimarcus/content-sites-core": "0.42.4"
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -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
|
+
)}
|
package/src/editorial/index.ts
CHANGED
|
@@ -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
|
+
}
|
package/src/internal/labels.ts
CHANGED
|
@@ -78,6 +78,15 @@ export const LABELS = {
|
|
|
78
78
|
eraChip: { ariaLabel: (label: string, range: string) => `${label}, ${range}: see this era on the chronology` },
|
|
79
79
|
personChip: { ariaLabel: (name: string, dates?: string) => `${name}${dates ? `, ${dates}` : ''}: read their profile` },
|
|
80
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
|
+
},
|
|
81
90
|
personPage: {
|
|
82
91
|
readFullStory: 'Read the full story',
|
|
83
92
|
fullStoryHeading: 'The full story',
|