@sarimarcus/content-sites-ui 0.42.2 → 0.42.3

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.3 (2026-10-22)
6
+
7
+ - `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).
8
+
5
9
  ## 0.42.2 (2026-10-21)
6
10
 
7
11
  - `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.3",
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.3"
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
  );
@@ -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
+ }
@@ -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 ',
@@ -116,18 +119,16 @@ export const LABELS = {
116
119
  },
117
120
  breadcrumb: { homeLabel: 'Home', ariaLabel: 'Breadcrumb navigation' },
118
121
  chronologyTimeline: {
119
- indexLabel: 'Eras',
120
- dossiersLabel: 'Go deeper',
122
+ ...eraLabels,
121
123
  emptyLabel: '',
122
124
  undatedLabel: 'Undated',
123
125
  },
124
126
  eraScenes: {
125
- indexLabel: 'Eras',
127
+ ...eraLabels,
126
128
  castLabel: 'In this era',
127
129
  peopleHeading: 'People',
128
130
  monumentsHeading: 'Monuments',
129
131
  articlesHeading: 'Articles',
130
- dossiersLabel: 'Go deeper',
131
132
  emptyPeople: 'No people catalogued for this era yet.',
132
133
  emptyMonuments: 'No monuments catalogued for this era yet.',
133
134
  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;