---/** * "Sources & further reading" plate for a sheet with secondary provenance. * * SheetCredit carries the one upstream a sheet *is* derived from, and sits * above the article as a header banner. This carries the sources a sheet * merely draws on — one row each — and sits at the foot, where a reader who * has finished the page is looking for where to go next. * * Licence wording is deliberately the same mapping SheetCredit uses. Two * panels describing the same upstream in different words is how a site ends * up implying a grant that does not exist, so `none` reads "no licence * published" in both places or in neither. */import Icon from'./Icon.astro';
import { url } from'../lib/url';
interface Reference {
name:string;
url:string;
author?:string;
license?:string;
relation?:string;
note?:string;
}
interface Props {
references?:Reference[];
}
const { references = [] } = Astro.props;
const BADGE:Record<string, string> = {
verbatim:'mirror',
derived:'derived',
inspired:'inspired',
'link-only':'link',
};
function licenceLabel(license?:string):string|null {
if (!license) returnnull;
if (license ==='none') return'no licence published';
if (license ==='proprietary') return'proprietary — all rights reserved';
return license;
}
---{references.length >0&& (
<asideclass="refs plate corners"aria-labelledby="refs-heading">
<pclass="micro refs__label"id="refs-heading">// sources & further reading</p> <ulclass="refs__list">
{references.map((ref) => (
<liclass="refs__item">
<spanclass="patt-badge refs__badge">{BADGE[ref.relation ??''] ??'credit'}</span>
<spanclass="refs__body">
<aclass="refs__name"href={ref.url} target="_blank"rel="noopener">{ref.name}</a>
{ref.author && <spanclass="refs__author"> by <strong>{ref.author}</strong></span>}
{ref.note && <spanclass="refs__note">{ref.note}</span>}
{licenceLabel(ref.license) && (
<spanclass="refs__lic">{licenceLabel(ref.license)}</span>
)}
</span>
</li>
))}
</ul>
<pclass="refs__foot">
<Iconname="github"style="width:13px;height:13px;" />
Upstream repositories remain canonical — corrections belong there.
<ahref={url('credits')}>Full credits & licences</a>
</p>
</aside>
)}
<style>
/* Same object as the credit banner above the article (SheetCredit) and the provenance slabs on /credits: square plate, corner brackets, left accent bar, provenance metadata set in the terminal font at micro-label size. Unlike SheetCredit this one does NOT pin its palette — it reads as part of the page it closes, not as a foreign notice pasted on top. */ .refs {
margin:2.5rem00;
padding:1rem1.2rem 1.1rem;
border-left:2px solid var(--iris);
--bracket:var(--iris);
}
.refs__label { color:var(--fg-faint); margin:000.75rem; }
.refs__list { list-style:none; margin:0; padding:0; display:grid; gap:0.7rem; }
.refs__item { display:flex; align-items:flex-start; gap:0.7rem; margin:0; }
.refs__badge { flex:none; margin-top:0.1rem; color:var(--iris); border-color:color-mix(in oklab, var(--iris) 50%, transparent); }
.refs__body { display:block; min-width:0; }
.refs__name { font-weight:600; }
.refs__author { color:var(--fg-dim); }
/* Note and licence each take their own line so a long `note` cannot shove the licence off the end of a phone-width row, where it is the one part that must not be missed. */ .refs__note,
.refs__lic {
display:block;
color:var(--fg-dim);
font-size:var(--step--1, 0.9em);
}
.refs__lic {
color:var(--fg-faint);
font-family:var(--font-term);
font-size:var(--step-micro);
letter-spacing:var(--track-micro);
text-transform:uppercase;
margin-top:0.2rem;
}
.refs__foot {
display:flex;
align-items:center;
gap:0.45rem;
flex-wrap:wrap;
margin:0.95rem00;
padding-top:0.7rem;
border-top:1px solid var(--rule);
color:var(--fg-faint);
font-family:var(--font-term);
font-size:var(--step-micro);
letter-spacing:var(--track-micro);
text-transform:uppercase;
}
</style>