@sarimarcus/content-sites-ui 0.49.4 → 0.50.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
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.50.0 (2026-10-27)
|
|
6
|
+
|
|
7
|
+
- `editorial`: new `EraPeopleRow`, the one compact row under an article intro: the era chip leads, then up to `visible` (default 3) name-only person chips, the rest behind a native `<details>` "+N more"; without an era a "People:" label leads. `EraChip` and `PersonChip` take an optional `size` (`sm`|`md`, default `md`, unchanged) and `PersonChip` a `showDates` (default true; dates stay in the accessible name). Defaults render identically to 0.49.4 (`tests/fixtures/render-diff/era-person-chip-defaults.json`). New label group `eraPeopleRow` (SLA-3535).
|
|
8
|
+
|
|
5
9
|
## 0.49.4 (2026-10-27)
|
|
6
10
|
|
|
7
11
|
- `affiliate`: `AffiliateCard` takes an optional `variant` through `AffiliateCardOptions`: `overlay` (default, unchanged look) or `quiet` (title under the photo, no gradient, outline CTA that fills on hover). On every card the trust lines (`labels.verified`, `labels.booksUp`) now sit above the CTA instead of below it, so the CTA closes the card and CTAs line up across a row however many lines each card shows: an HTML change on every page with affiliate cards (SLA-3515).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sarimarcus/content-sites-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.50.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",
|
|
@@ -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.
|
|
53
|
+
"@sarimarcus/content-sites-core": "0.50.0"
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -17,6 +17,7 @@ interface Props {
|
|
|
17
17
|
icon?: string;
|
|
18
18
|
/** Opaque scrim tone for a chip laid over a photo or the hero overlay. */
|
|
19
19
|
onImage?: boolean;
|
|
20
|
+
size?: 'sm' | 'md';
|
|
20
21
|
class?: string;
|
|
21
22
|
}
|
|
22
23
|
|
|
@@ -26,6 +27,7 @@ const {
|
|
|
26
27
|
ariaLabel = (e: EraDefinition) => LABELS.eraChip.ariaLabel(e.label, e.rangeLabel),
|
|
27
28
|
icon = 'history',
|
|
28
29
|
onImage = false,
|
|
30
|
+
size = 'md',
|
|
29
31
|
class: className,
|
|
30
32
|
}: Props = Astro.props;
|
|
31
33
|
---
|
|
@@ -34,7 +36,7 @@ const {
|
|
|
34
36
|
<Chip
|
|
35
37
|
as="a"
|
|
36
38
|
href={eraHref(era, basePath)}
|
|
37
|
-
size=
|
|
39
|
+
size={size}
|
|
38
40
|
tone={onImage ? 'onImage' : 'tint'}
|
|
39
41
|
accent="primary"
|
|
40
42
|
icon={icon}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
/**
|
|
3
|
+
* EraPeopleRow — the one compact row under an article intro: the era chip leads, then up to `visible` name-only person
|
|
4
|
+
* chips, the rest behind a native <details> "+N more". Without an era a "People:" label leads. Renders nothing when
|
|
5
|
+
* there is neither an era nor a person. The sm chips are 28px tall; `hit` stretches each tap target to 44px.
|
|
6
|
+
*/
|
|
7
|
+
import type { EraDefinition } from '@sarimarcus/content-sites-core/eras';
|
|
8
|
+
import EraChip from './EraChip.astro';
|
|
9
|
+
import PersonChip from './PersonChip.astro';
|
|
10
|
+
import { PILL_BASE } from '../primitives/pillRecipe';
|
|
11
|
+
import { LABELS } from '../internal/labels';
|
|
12
|
+
|
|
13
|
+
interface Person {
|
|
14
|
+
name: string;
|
|
15
|
+
href: string;
|
|
16
|
+
dates?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface Props {
|
|
20
|
+
era?: EraDefinition;
|
|
21
|
+
eraBasePath?: string;
|
|
22
|
+
people?: readonly Person[];
|
|
23
|
+
visible?: number;
|
|
24
|
+
label?: string;
|
|
25
|
+
class?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const {
|
|
29
|
+
era,
|
|
30
|
+
eraBasePath,
|
|
31
|
+
people = [],
|
|
32
|
+
visible = 3,
|
|
33
|
+
label = LABELS.eraPeopleRow.peopleLabel,
|
|
34
|
+
class: className,
|
|
35
|
+
}: Props = Astro.props;
|
|
36
|
+
const valid = people.filter((p) => p.name && p.href);
|
|
37
|
+
const shown = valid.slice(0, visible);
|
|
38
|
+
const rest = valid.slice(visible);
|
|
39
|
+
const hit = "relative before:absolute before:inset-x-0 before:-inset-y-2 before:content-['']";
|
|
40
|
+
const chip = (p: Person) => ({ name: p.name, href: p.href, dates: p.dates, size: 'sm' as const, showDates: false, class: hit });
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
{(era || valid.length > 0) && (
|
|
44
|
+
<div class:list={['flex flex-wrap items-center gap-x-2 gap-y-3', className]} data-era-people-row>
|
|
45
|
+
{era ? <EraChip era={era} basePath={eraBasePath} size="sm" class={hit} /> : (
|
|
46
|
+
<span class="text-xs font-semibold uppercase tracking-wide text-muted-foreground">{label}</span>
|
|
47
|
+
)}
|
|
48
|
+
{valid.length > 0 && (
|
|
49
|
+
<ul class="flex flex-wrap items-center gap-x-1.5 gap-y-3" aria-label={era ? label : undefined}>
|
|
50
|
+
{shown.map((p) => <li><PersonChip {...chip(p)} /></li>)}
|
|
51
|
+
{rest.length > 0 && (
|
|
52
|
+
<li>
|
|
53
|
+
<details class="group">
|
|
54
|
+
<summary
|
|
55
|
+
class:list={[PILL_BASE, hit, 'cursor-pointer list-none border border-border px-3 py-1.5 text-xs text-muted-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary [&::-webkit-details-marker]:hidden']}
|
|
56
|
+
>{LABELS.eraPeopleRow.more(rest.length)}<span class="sr-only">{LABELS.eraPeopleRow.moreSr}</span></summary>
|
|
57
|
+
<ul class="mt-3 flex flex-wrap gap-x-1.5 gap-y-3">
|
|
58
|
+
{rest.map((p) => <li><PersonChip {...chip(p)} /></li>)}
|
|
59
|
+
</ul>
|
|
60
|
+
</details>
|
|
61
|
+
</li>
|
|
62
|
+
)}
|
|
63
|
+
</ul>
|
|
64
|
+
)}
|
|
65
|
+
</div>
|
|
66
|
+
)}
|
|
@@ -14,6 +14,9 @@ interface Props {
|
|
|
14
14
|
/** Accessible name; keep the visible name and dates in it. */
|
|
15
15
|
ariaLabel?: (name: string, dates?: string) => string;
|
|
16
16
|
icon?: string;
|
|
17
|
+
size?: 'sm' | 'md';
|
|
18
|
+
/** Set false to drop the visible life dates; they stay in the accessible name. */
|
|
19
|
+
showDates?: boolean;
|
|
17
20
|
class?: string;
|
|
18
21
|
}
|
|
19
22
|
|
|
@@ -23,6 +26,8 @@ const {
|
|
|
23
26
|
dates,
|
|
24
27
|
ariaLabel = LABELS.personChip.ariaLabel,
|
|
25
28
|
icon = 'user',
|
|
29
|
+
size = 'md',
|
|
30
|
+
showDates = true,
|
|
26
31
|
class: className,
|
|
27
32
|
}: Props = Astro.props;
|
|
28
33
|
---
|
|
@@ -31,7 +36,7 @@ const {
|
|
|
31
36
|
<Chip
|
|
32
37
|
as="a"
|
|
33
38
|
href={href}
|
|
34
|
-
size=
|
|
39
|
+
size={size}
|
|
35
40
|
tone="tint"
|
|
36
41
|
accent="primary"
|
|
37
42
|
icon={icon}
|
|
@@ -39,6 +44,6 @@ const {
|
|
|
39
44
|
aria-label={ariaLabel(name, dates)}
|
|
40
45
|
class={className}
|
|
41
46
|
>
|
|
42
|
-
{name}{dates && (<><span aria-hidden="true">·</span><span class="whitespace-nowrap tabular-nums">{dates}</span></>)}
|
|
47
|
+
{name}{showDates && dates && (<><span aria-hidden="true">·</span><span class="whitespace-nowrap tabular-nums">{dates}</span></>)}
|
|
43
48
|
</Chip>
|
|
44
49
|
)}
|
package/src/editorial/index.ts
CHANGED
|
@@ -31,6 +31,7 @@ export type { InsiderTip, InsiderTipAuthor, InsiderTipKinds, InsiderTipTone } fr
|
|
|
31
31
|
export { default as AuthorStrip } from './AuthorStrip.astro';
|
|
32
32
|
export { default as EraChip } from './EraChip.astro';
|
|
33
33
|
export { default as PersonChip } from './PersonChip.astro';
|
|
34
|
+
export { default as EraPeopleRow } from './EraPeopleRow.astro';
|
|
34
35
|
export { default as PersonCard } from './PersonCard.astro';
|
|
35
36
|
export { default as PersonPage } from './PersonPage.astro';
|
|
36
37
|
export { default as AlsoExplore } from './AlsoExplore.astro';
|
package/src/internal/labels.ts
CHANGED
|
@@ -83,6 +83,7 @@ export const LABELS = {
|
|
|
83
83
|
articleFeatureCard: { readLabel: 'Read article', updatedLabel: 'Updated' },
|
|
84
84
|
eraChip: { ariaLabel: (label: string, range: string) => `${label}, ${range}: see this era on the chronology` },
|
|
85
85
|
personChip: { ariaLabel: (name: string, dates?: string) => `${name}${dates ? `, ${dates}` : ''}: read their profile` },
|
|
86
|
+
eraPeopleRow: { peopleLabel: 'People:', more: (n: number) => `+${n} more`, moreSr: ' people' },
|
|
86
87
|
personCard: { cta: 'Read the profile' },
|
|
87
88
|
peopleTimeline: {
|
|
88
89
|
ariaLabel: 'People by era',
|