@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@n1kname/components",
3
- "version": "0.60.0",
3
+ "version": "0.62.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -58,7 +58,10 @@ interface Props {
58
58
  title: string;
59
59
  /** One line on what it achieved. */
60
60
  text?: string;
61
- /** Above the title: organisation, years, state. */
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
- // The link is named title first, then the line, the overline and the note, so a screen reader
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`, overline && `${uid}-over`, note && `${uid}-note`].filter(Boolean).join(' ');
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
- color-mix(in oklab, var(--tile-tone), white 10%),
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
- .overline {
295
- margin: 0 0 var(--sp-3);
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.74);
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: rgb(255 255 255 / 0.88);
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 .overline { color: rgb(0 0 0 / 0.66); }
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); }
@@ -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
- --mark: var(--c-accent);
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) 14%);
98
+ background: color-mix(in oklab, var(--c-surface-tint), var(--c-accent) 6%);
99
99
  }
100
100
 
101
101
  .ico {
@@ -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
- --mark: var(--c-accent);
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
- --mark: var(--c-accent);
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'] {