@n1kname/components 0.60.0 → 0.62.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/package.json +1 -1
- package/src/CaseTile.astro +17 -11
- package/src/CompareCards.astro +2 -1
- package/src/CopyTag.astro +1 -1
- package/src/Personas.astro +2 -1
- package/src/Tracks.astro +2 -1
package/package.json
CHANGED
package/src/CaseTile.astro
CHANGED
|
@@ -58,7 +58,10 @@ interface Props {
|
|
|
58
58
|
title: string;
|
|
59
59
|
/** One line on what it achieved. */
|
|
60
60
|
text?: string;
|
|
61
|
-
/**
|
|
61
|
+
/** Under the title: organisation, years, state. The title leads; a label over a heading is one
|
|
62
|
+
* of the habits that reads as generated, so the facts follow it instead. */
|
|
63
|
+
meta?: string;
|
|
64
|
+
/** @deprecated Since 0.61.0: use `meta`. Still accepted, and shown in meta's place, under the title. */
|
|
62
65
|
overline?: string;
|
|
63
66
|
/** Shown on a wide tile only; up to four. */
|
|
64
67
|
metrics?: Metric[];
|
|
@@ -94,6 +97,7 @@ const {
|
|
|
94
97
|
href,
|
|
95
98
|
title,
|
|
96
99
|
text,
|
|
100
|
+
meta: metaProp,
|
|
97
101
|
overline,
|
|
98
102
|
metrics = [],
|
|
99
103
|
screens = [],
|
|
@@ -132,10 +136,11 @@ const layerWidths = (img: ImageMetadata) => {
|
|
|
132
136
|
const layerSizes = (width: number) =>
|
|
133
137
|
`(max-width: 760px) ${Math.round(width * 0.85)}vw, ${Math.round(width * (layout === 'wide' ? 7 : 6))}px`;
|
|
134
138
|
const figures = layout === 'wide' ? metrics.slice(0, 4) : [];
|
|
135
|
-
|
|
139
|
+
const meta = metaProp ?? overline;
|
|
140
|
+
// The link is named title first, then the line, the meta and the note, so a screen reader
|
|
136
141
|
// hears the case before its dates. Ids from the href, so the build stays the same each run.
|
|
137
142
|
const uid = `case-tile-${href.replace(/[^a-z0-9]+/gi, '-').replace(/^-|-$/g, '') || 'home'}`;
|
|
138
|
-
const labelledby = [`${uid}-title`, text && `${uid}-text`,
|
|
143
|
+
const labelledby = [`${uid}-title`, text && `${uid}-text`, meta && `${uid}-meta`, note && `${uid}-note`].filter(Boolean).join(' ');
|
|
139
144
|
---
|
|
140
145
|
|
|
141
146
|
<a
|
|
@@ -147,8 +152,8 @@ const labelledby = [`${uid}-title`, text && `${uid}-text`, overline && `${uid}-o
|
|
|
147
152
|
>
|
|
148
153
|
<div class="frame">
|
|
149
154
|
<div class="copy">
|
|
150
|
-
{overline && <p class="overline" id={`${uid}-over`}>{overline}</p>}
|
|
151
155
|
<Heading class="title" id={`${uid}-title`}>{title}</Heading>
|
|
156
|
+
{meta && <p class="meta" id={`${uid}-meta`}>{meta}</p>}
|
|
152
157
|
{text && <p class="text" id={`${uid}-text`}>{text}</p>}
|
|
153
158
|
{note && <p class="note" id={`${uid}-note`}>{note}</p>}
|
|
154
159
|
{
|
|
@@ -246,10 +251,11 @@ const labelledby = [`${uid}-title`, text && `${uid}-text`, overline && `${uid}-o
|
|
|
246
251
|
color: #fff;
|
|
247
252
|
text-decoration: none;
|
|
248
253
|
background:
|
|
254
|
+
/* The words sit top left, so the gradient starts at the tone itself there and only darkens
|
|
255
|
+
* away from them: a lighter stop under the copy took the meta line below AA. */
|
|
249
256
|
linear-gradient(
|
|
250
257
|
150deg,
|
|
251
|
-
|
|
252
|
-
var(--tile-tone) 50%,
|
|
258
|
+
var(--tile-tone) 40%,
|
|
253
259
|
color-mix(in oklab, var(--tile-tone), black 32%)
|
|
254
260
|
);
|
|
255
261
|
transition:
|
|
@@ -291,11 +297,11 @@ const labelledby = [`${uid}-title`, text && `${uid}-text`, overline && `${uid}-o
|
|
|
291
297
|
padding-bottom: 0;
|
|
292
298
|
}
|
|
293
299
|
|
|
294
|
-
.
|
|
295
|
-
margin:
|
|
300
|
+
.meta {
|
|
301
|
+
margin: var(--sp-2) 0 0;
|
|
296
302
|
font-size: var(--text-caption);
|
|
297
303
|
letter-spacing: 0.02em;
|
|
298
|
-
color: rgb(255 255 255 / 0.
|
|
304
|
+
color: rgb(255 255 255 / 0.92);
|
|
299
305
|
}
|
|
300
306
|
|
|
301
307
|
.title {
|
|
@@ -314,7 +320,7 @@ const labelledby = [`${uid}-title`, text && `${uid}-text`, overline && `${uid}-o
|
|
|
314
320
|
max-width: 36ch;
|
|
315
321
|
font-size: clamp(1rem, 2.6cqw, 1.2rem);
|
|
316
322
|
line-height: 1.45;
|
|
317
|
-
color:
|
|
323
|
+
color: #fff;
|
|
318
324
|
text-wrap: pretty;
|
|
319
325
|
}
|
|
320
326
|
|
|
@@ -418,7 +424,7 @@ const labelledby = [`${uid}-title`, text && `${uid}-text`, overline && `${uid}-o
|
|
|
418
424
|
);
|
|
419
425
|
}
|
|
420
426
|
.ink-dark .title { color: #17181a; }
|
|
421
|
-
.ink-dark .
|
|
427
|
+
.ink-dark .meta { color: rgb(0 0 0 / 0.66); }
|
|
422
428
|
.ink-dark .text { color: rgb(0 0 0 / 0.8); }
|
|
423
429
|
.ink-dark .note { background: rgb(0 0 0 / 0.1); color: #17181a; }
|
|
424
430
|
.ink-dark .metrics { border-top-color: rgb(0 0 0 / 0.2); }
|
package/src/CompareCards.astro
CHANGED
|
@@ -119,7 +119,8 @@ const markIcon: Partial<Record<Mark, IconName>> = { gain: 'circle-check', gap: '
|
|
|
119
119
|
[data-tone='accent'] {
|
|
120
120
|
--edge: var(--c-accent-edge);
|
|
121
121
|
--soft: var(--c-surface-tint);
|
|
122
|
-
|
|
122
|
+
/* The readable orange: the raw accent on its own tint is 2.6:1. */
|
|
123
|
+
--mark: var(--c-text-accent);
|
|
123
124
|
}
|
|
124
125
|
|
|
125
126
|
[data-tone='cool'] {
|
package/src/CopyTag.astro
CHANGED
|
@@ -95,7 +95,7 @@ const svg = { width: 15, height: 15, viewBox: '0 0 24 24', fill: 'none', stroke:
|
|
|
95
95
|
.copy-tag :global(a.tag:hover),
|
|
96
96
|
.copy:hover {
|
|
97
97
|
border-color: transparent;
|
|
98
|
-
background: color-mix(in oklab, var(--c-surface-tint), var(--c-accent)
|
|
98
|
+
background: color-mix(in oklab, var(--c-surface-tint), var(--c-accent) 6%);
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
.ico {
|
package/src/Personas.astro
CHANGED
|
@@ -116,7 +116,8 @@ const tones: Tone[] = ['accent', 'cool'];
|
|
|
116
116
|
[data-tone='accent'] {
|
|
117
117
|
--edge: var(--c-accent-edge);
|
|
118
118
|
--soft: var(--c-surface-tint);
|
|
119
|
-
|
|
119
|
+
/* The readable orange: the raw accent on its own tint is 2.6:1. */
|
|
120
|
+
--mark: var(--c-text-accent);
|
|
120
121
|
}
|
|
121
122
|
|
|
122
123
|
[data-tone='cool'] {
|
package/src/Tracks.astro
CHANGED
|
@@ -128,7 +128,8 @@ const trackTones: Tone[] = ['accent', 'cool'];
|
|
|
128
128
|
[data-tone='accent'] {
|
|
129
129
|
--fill: color-mix(in oklab, var(--c-accent) 16%, var(--c-surface));
|
|
130
130
|
--edge: var(--c-accent-edge);
|
|
131
|
-
|
|
131
|
+
/* The readable orange: the raw accent on its own tint is 2.6:1. */
|
|
132
|
+
--mark: var(--c-text-accent);
|
|
132
133
|
}
|
|
133
134
|
|
|
134
135
|
[data-tone='cool'] {
|