@sarimarcus/content-sites-ui 0.56.1 → 0.57.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/CHANGELOG.md +7 -0
- package/package.json +4 -3
- package/src/composed/TableOfContents.astro +4 -1
- package/src/editorial/ArticlePage.astro +34 -39
- package/src/editorial/interludes/DidYouKnow.astro +1 -1
- package/src/editorial/interludes/Interlude.astro +1 -1
- package/src/editorial/interludes/Quote.astro +2 -2
- package/src/editorial/interludes/StatFact.astro +1 -1
- package/src/editorial/interludes/Timeline.astro +1 -1
- package/src/internal/labels.ts +2 -0
- package/src/primitives/FeatureList.astro +2 -2
- package/src/styles/article-lede.css +25 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All packages in the platform release in lockstep; entries are per release version.
|
|
4
4
|
|
|
5
|
+
## 0.57.0 (2026-11-05)
|
|
6
|
+
|
|
7
|
+
- `ArticlePage`: the breadcrumb band always precedes the hero (it followed the hero when an image was set), the hero is `minHeight="short"` with no hardcoded `mt-16`, interludes render inside `not-prose` with primary-coloured links underlined only on hover, and the lede loses its `text-lg sm:text-xl leading-relaxed` utilities to the new `article-lede.css`. The ToC now shows the localised "In this article" heading by default, desktop only (`articlePage.tocEyebrow`, EN and IT) (SLA-3871).
|
|
8
|
+
- `TableOfContents`: new `headerClass` prop on the heading block (SLA-3871).
|
|
9
|
+
- `./article-lede.css` (new export): `.article-lede` size and drop cap in `@layer components`, colour from `--article-dropcap-color` (fallback `--color-primary`). Routes import it, since a `<style>` in a barrel-exported component reaches every page; a site drops its own `.article-lede` rules when it adopts it (SLA-3871).
|
|
10
|
+
- `editorial` interludes: one vertical rhythm (`DidYouKnow` ruled `my-10 sm:my-12`, `StatFact` `my-10 sm:my-12`, `Quote` `my-8`, `Timeline` `p-5 sm:p-6`, checklist wrapper `my-8`), and `FeatureList` `compact` is tighter on mobile (`p-3`, item `py-2`) (SLA-3871).
|
|
11
|
+
|
|
5
12
|
## 0.56.1 (2026-11-05)
|
|
6
13
|
|
|
7
14
|
- `ArticlePage`: place `<main>` around the `size="measure"` body `<Container>` (after `ContentHero` and `BreadcrumbBand`) so the first non-shell band inside `<main>` is `max-w-measure`, emit `data-pagefind-meta="type:article"` and `data-pagefind-filter="audience:<slug>"`, and wrap prose paragraph blocks in `<div class="text-base text-muted-foreground leading-relaxed mb-4">` (SLA-3723).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sarimarcus/content-sites-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.57.0",
|
|
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",
|
|
@@ -44,12 +44,13 @@
|
|
|
44
44
|
"./theme.css": "./src/styles/theme.css",
|
|
45
45
|
"./consent.css": "./src/styles/consent.css",
|
|
46
46
|
"./search.css": "./src/styles/search.css",
|
|
47
|
-
"./not-found.css": "./src/styles/not-found.css"
|
|
47
|
+
"./not-found.css": "./src/styles/not-found.css",
|
|
48
|
+
"./article-lede.css": "./src/styles/article-lede.css"
|
|
48
49
|
},
|
|
49
50
|
"peerDependencies": {
|
|
50
51
|
"@lucide/astro": "^1.23.0",
|
|
51
52
|
"astro": "^7.0.6",
|
|
52
53
|
"tailwindcss": "^4.1.18",
|
|
53
|
-
"@sarimarcus/content-sites-core": "0.
|
|
54
|
+
"@sarimarcus/content-sites-core": "0.57.0"
|
|
54
55
|
}
|
|
55
56
|
}
|
|
@@ -24,6 +24,8 @@ interface Props {
|
|
|
24
24
|
locale?: string;
|
|
25
25
|
class?: string;
|
|
26
26
|
eyebrowClass?: string;
|
|
27
|
+
/** Extra classes on the header block (e.g. `max-md:hidden` for a desktop-only heading). */
|
|
28
|
+
headerClass?: string;
|
|
27
29
|
variant?: 'card' | 'plain';
|
|
28
30
|
showHeader?: boolean;
|
|
29
31
|
navClass?: string;
|
|
@@ -47,6 +49,7 @@ const {
|
|
|
47
49
|
description,
|
|
48
50
|
class: className = '',
|
|
49
51
|
eyebrowClass = 'text-primary',
|
|
52
|
+
headerClass = '',
|
|
50
53
|
variant = 'card',
|
|
51
54
|
showHeader = true,
|
|
52
55
|
navClass: navClassName = '',
|
|
@@ -107,7 +110,7 @@ const showMini = variant === 'card';
|
|
|
107
110
|
class:list={[rootClass, className]}
|
|
108
111
|
>
|
|
109
112
|
{showHeader && (title || eyebrow || description) && (
|
|
110
|
-
<div class=
|
|
113
|
+
<div class:list={['mb-5 flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between', headerClass]}>
|
|
111
114
|
<div>
|
|
112
115
|
{eyebrow && (
|
|
113
116
|
<p class:list={['text-sm font-medium uppercase tracking-[0.2em]', title ? 'mb-2' : '', eyebrowClass]}>{eyebrow}</p>
|
|
@@ -289,37 +289,30 @@ const resolvedRelatedTitle = relatedProps.title ?? l.relatedTitle;
|
|
|
289
289
|
<span class="sr-only" data-pagefind-filter={`audience:${a}`}>{a}</span>
|
|
290
290
|
))}
|
|
291
291
|
|
|
292
|
+
<BreadcrumbBand>
|
|
293
|
+
<Breadcrumb items={breadcrumbs} {...breadcrumbProps} />
|
|
294
|
+
</BreadcrumbBand>
|
|
295
|
+
|
|
292
296
|
{heroImage ? (
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
class="mt-16"
|
|
303
|
-
/>
|
|
304
|
-
<BreadcrumbBand class="bg-muted/50 border-b border-border">
|
|
305
|
-
<Breadcrumb items={breadcrumbs} {...breadcrumbProps} />
|
|
306
|
-
</BreadcrumbBand>
|
|
307
|
-
</>
|
|
297
|
+
<ContentHero
|
|
298
|
+
title={article.title}
|
|
299
|
+
description={article.description}
|
|
300
|
+
image={heroImage}
|
|
301
|
+
imageAlt={article.imageAlt}
|
|
302
|
+
imageTitle={article.imageTitle}
|
|
303
|
+
overlay="editorial"
|
|
304
|
+
minHeight="short"
|
|
305
|
+
/>
|
|
308
306
|
) : (
|
|
309
|
-
|
|
310
|
-
<
|
|
311
|
-
<
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
</h1>
|
|
319
|
-
<p class="text-lg text-muted-foreground leading-relaxed">{article.description}</p>
|
|
320
|
-
</Container>
|
|
321
|
-
</header>
|
|
322
|
-
</>
|
|
307
|
+
<header class="pt-10 pb-6 border-b border-border">
|
|
308
|
+
<Container size="measure">
|
|
309
|
+
<p class={noHeroEyebrowClass}>{resolvedNoHeroEyebrow}</p>
|
|
310
|
+
<h1 class="text-3xl sm:text-4xl lg:text-5xl font-normal font-display text-foreground leading-tight mb-4">
|
|
311
|
+
{article.title}
|
|
312
|
+
</h1>
|
|
313
|
+
<p class="text-lg text-muted-foreground leading-relaxed">{article.description}</p>
|
|
314
|
+
</Container>
|
|
315
|
+
</header>
|
|
323
316
|
)}
|
|
324
317
|
|
|
325
318
|
<main>
|
|
@@ -343,7 +336,7 @@ const resolvedRelatedTitle = relatedProps.title ?? l.relatedTitle;
|
|
|
343
336
|
<slot name="after-byline" />
|
|
344
337
|
|
|
345
338
|
<div
|
|
346
|
-
class="article-lede text-
|
|
339
|
+
class="article-lede text-foreground/90 mb-8 font-normal border-l-2 border-primary/40 pl-5"
|
|
347
340
|
data-dropcap={hasDropCap ? '' : undefined}
|
|
348
341
|
set:html={introHtml}
|
|
349
342
|
/>
|
|
@@ -360,7 +353,7 @@ const resolvedRelatedTitle = relatedProps.title ?? l.relatedTitle;
|
|
|
360
353
|
|
|
361
354
|
{showToc && (
|
|
362
355
|
<div class="mb-10" data-pagefind-ignore>
|
|
363
|
-
<TableOfContents items={tocItems} {...tocProps} />
|
|
356
|
+
<TableOfContents items={tocItems} eyebrow={l.tocEyebrow} headerClass="max-md:hidden" {...tocProps} />
|
|
364
357
|
</div>
|
|
365
358
|
)}
|
|
366
359
|
|
|
@@ -383,14 +376,16 @@ const resolvedRelatedTitle = relatedProps.title ?? l.relatedTitle;
|
|
|
383
376
|
}
|
|
384
377
|
if (block.kind === 'interlude') {
|
|
385
378
|
return (
|
|
386
|
-
<
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
379
|
+
<div class="not-prose [&_a]:text-primary [&_a]:no-underline [&_a:hover]:underline">
|
|
380
|
+
<Interlude
|
|
381
|
+
interlude={block.data}
|
|
382
|
+
renderInline={md}
|
|
383
|
+
labels={interludeLabels}
|
|
384
|
+
author={article.author}
|
|
385
|
+
didYouKnowVariant={didYouKnowVariant}
|
|
386
|
+
didYouKnowLabelClass={didYouKnowLabelClass}
|
|
387
|
+
/>
|
|
388
|
+
</div>
|
|
394
389
|
);
|
|
395
390
|
}
|
|
396
391
|
if (block.kind === 'entity') {
|
|
@@ -17,7 +17,7 @@ const { content, label, variant = 'ruled', labelClass } = Astro.props;
|
|
|
17
17
|
---
|
|
18
18
|
|
|
19
19
|
{variant === 'ruled' ? (
|
|
20
|
-
<aside class="my-
|
|
20
|
+
<aside class="my-10 sm:my-12 max-w-prose border-t-2 border-b-2 border-secondary py-6 sm:py-8">
|
|
21
21
|
<div class="flex items-center gap-2 mb-3">
|
|
22
22
|
<Icon name="lightbulb" class="w-4 h-4 text-secondary" aria-hidden="true" />
|
|
23
23
|
<p class={labelClass ?? 'text-xs font-semibold uppercase tracking-[0.2em] text-secondary'}>{label}</p>
|
|
@@ -85,7 +85,7 @@ const { interlude: il, renderInline: md, labels, author, didYouKnowVariant, didY
|
|
|
85
85
|
)}
|
|
86
86
|
|
|
87
87
|
{il.type === 'checklist' && (
|
|
88
|
-
<div class="my-
|
|
88
|
+
<div class="my-8">
|
|
89
89
|
<FeatureList title={il.title} items={il.items.map(md)} variant="checklist" headingLevel="h3" container compact />
|
|
90
90
|
</div>
|
|
91
91
|
)}
|
|
@@ -14,7 +14,7 @@ const { variant, content, attribution } = Astro.props;
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
{variant === 'pull' && (
|
|
17
|
-
<figure class="my-
|
|
17
|
+
<figure class="my-8 pl-6 sm:pl-10 border-l border-primary/30">
|
|
18
18
|
<blockquote class="text-xl sm:text-2xl font-display italic leading-snug text-foreground/90 text-balance">
|
|
19
19
|
<span set:html={content} />
|
|
20
20
|
</blockquote>
|
|
@@ -22,7 +22,7 @@ const { variant, content, attribution } = Astro.props;
|
|
|
22
22
|
)}
|
|
23
23
|
|
|
24
24
|
{variant === 'external' && (
|
|
25
|
-
<figure class="relative my-
|
|
25
|
+
<figure class="relative my-8 pl-12 pr-6 py-7 sm:pl-14 sm:pr-8 sm:py-8 rounded-lg bg-muted border border-border">
|
|
26
26
|
<span
|
|
27
27
|
class="pointer-events-none absolute left-4 top-3 sm:left-5 select-none font-display text-5xl sm:text-6xl leading-none text-accent"
|
|
28
28
|
aria-hidden="true"
|
|
@@ -8,7 +8,7 @@ interface Props {
|
|
|
8
8
|
const { figure, caption } = Astro.props;
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
<figure class="my-
|
|
11
|
+
<figure class="my-10 sm:my-12 text-center">
|
|
12
12
|
<span class="block mx-auto h-px w-12 bg-primary/40 mb-6" aria-hidden="true"></span>
|
|
13
13
|
<p
|
|
14
14
|
class="font-display text-5xl sm:text-6xl text-primary leading-none tracking-[-0.03em] tabular-nums"
|
|
@@ -14,7 +14,7 @@ interface Props {
|
|
|
14
14
|
const { events, label } = Astro.props;
|
|
15
15
|
---
|
|
16
16
|
|
|
17
|
-
<figure class="my-8 p-
|
|
17
|
+
<figure class="my-8 p-5 sm:p-6 rounded-lg bg-card border border-border">
|
|
18
18
|
<figcaption class="text-xs font-semibold uppercase tracking-[0.18em] text-secondary mb-5">{label}</figcaption>
|
|
19
19
|
<ol class="space-y-4">
|
|
20
20
|
{events.map((event) => (
|
package/src/internal/labels.ts
CHANGED
|
@@ -169,6 +169,7 @@ export const LABELS = {
|
|
|
169
169
|
tagsAriaLabel: 'Article tags',
|
|
170
170
|
allArticlesLabel: 'All articles',
|
|
171
171
|
relatedTitle: 'Related reading',
|
|
172
|
+
tocEyebrow: 'In this article',
|
|
172
173
|
},
|
|
173
174
|
authoritativeSources: {
|
|
174
175
|
title: 'Sources',
|
|
@@ -415,6 +416,7 @@ export const LABELS_IT: typeof LABELS = {
|
|
|
415
416
|
tagsAriaLabel: 'Tag dell’articolo',
|
|
416
417
|
allArticlesLabel: 'Tutti gli articoli',
|
|
417
418
|
relatedTitle: 'Letture correlate',
|
|
419
|
+
tocEyebrow: 'In questo articolo',
|
|
418
420
|
},
|
|
419
421
|
authoritativeSources: {
|
|
420
422
|
title: 'Fonti',
|
|
@@ -83,7 +83,7 @@ const titleClass = container
|
|
|
83
83
|
{items.length > 0 && (
|
|
84
84
|
<div
|
|
85
85
|
class:list={[
|
|
86
|
-
container ? `${compact ? 'p-
|
|
86
|
+
container ? `${compact ? 'p-3 sm:p-5 lg:p-6' : 'p-6 lg:p-8'} ${colors.containerBg} rounded-xl` : '',
|
|
87
87
|
className,
|
|
88
88
|
]}
|
|
89
89
|
data-pagefind-ignore
|
|
@@ -98,7 +98,7 @@ const titleClass = container
|
|
|
98
98
|
{variant === 'checklist' ? (
|
|
99
99
|
<ul class:list={['grid grid-cols-1 sm:grid-cols-2', compact ? 'gap-2' : 'gap-2.5']}>
|
|
100
100
|
{items.map((item) => (
|
|
101
|
-
<li class:list={['flex items-start gap-3 rounded-lg', compact ? 'px-3 py-2
|
|
101
|
+
<li class:list={['flex items-start gap-3 rounded-lg', compact ? 'px-3 py-2' : 'px-4 py-3', colors.itemBg]}>
|
|
102
102
|
<Icon name="check" class={`w-5 h-5 ${colors.icon} shrink-0 mt-0.5`} />
|
|
103
103
|
<span class="text-sm text-foreground leading-relaxed" set:html={item} />
|
|
104
104
|
</li>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.article-lede {
|
|
3
|
+
font-size: clamp(1.1875rem, 0.95rem + 0.75vw, 1.4375rem);
|
|
4
|
+
line-height: 1.55;
|
|
5
|
+
max-width: 62ch;
|
|
6
|
+
text-wrap: pretty;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.article-lede[data-dropcap]::first-letter {
|
|
10
|
+
float: left;
|
|
11
|
+
font-family: var(--font-display);
|
|
12
|
+
font-size: 3.1em;
|
|
13
|
+
line-height: 0.8;
|
|
14
|
+
padding-right: 0.07em;
|
|
15
|
+
margin-top: 0.05em;
|
|
16
|
+
color: var(--article-dropcap-color, var(--color-primary));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@media (max-width: 40rem) {
|
|
20
|
+
.article-lede[data-dropcap]::first-letter {
|
|
21
|
+
font-size: 2.5em;
|
|
22
|
+
line-height: 0.84;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|