@n1kname/components 0.61.0 → 0.63.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 +5 -4
- package/src/CompareCards.astro +2 -1
- package/src/CopyTag.astro +1 -1
- package/src/Notice.astro +7 -2
- package/src/Personas.astro +2 -1
- package/src/Tracks.astro +2 -1
- package/src/controls.css +16 -4
- package/src/icons.ts +4 -0
package/package.json
CHANGED
package/src/CaseTile.astro
CHANGED
|
@@ -251,10 +251,11 @@ const labelledby = [`${uid}-title`, text && `${uid}-text`, meta && `${uid}-meta`
|
|
|
251
251
|
color: #fff;
|
|
252
252
|
text-decoration: none;
|
|
253
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. */
|
|
254
256
|
linear-gradient(
|
|
255
257
|
150deg,
|
|
256
|
-
|
|
257
|
-
var(--tile-tone) 50%,
|
|
258
|
+
var(--tile-tone) 40%,
|
|
258
259
|
color-mix(in oklab, var(--tile-tone), black 32%)
|
|
259
260
|
);
|
|
260
261
|
transition:
|
|
@@ -300,7 +301,7 @@ const labelledby = [`${uid}-title`, text && `${uid}-text`, meta && `${uid}-meta`
|
|
|
300
301
|
margin: var(--sp-2) 0 0;
|
|
301
302
|
font-size: var(--text-caption);
|
|
302
303
|
letter-spacing: 0.02em;
|
|
303
|
-
color: rgb(255 255 255 / 0.
|
|
304
|
+
color: rgb(255 255 255 / 0.92);
|
|
304
305
|
}
|
|
305
306
|
|
|
306
307
|
.title {
|
|
@@ -319,7 +320,7 @@ const labelledby = [`${uid}-title`, text && `${uid}-text`, meta && `${uid}-meta`
|
|
|
319
320
|
max-width: 36ch;
|
|
320
321
|
font-size: clamp(1rem, 2.6cqw, 1.2rem);
|
|
321
322
|
line-height: 1.45;
|
|
322
|
-
color:
|
|
323
|
+
color: #fff;
|
|
323
324
|
text-wrap: pretty;
|
|
324
325
|
}
|
|
325
326
|
|
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/Notice.astro
CHANGED
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* A one-line caveat above the content it's about: the figures are a day old, a sensor is down.
|
|
4
4
|
* Quieter than EmptyState kind="error": the content still shows. Warning by default; info for
|
|
5
|
-
* something to know that isn't a problem.
|
|
5
|
+
* something to know that isn't a problem. A faint tint of the tone and an icon say which it is,
|
|
6
|
+
* so the tone never rests on colour alone.
|
|
6
7
|
*/
|
|
7
8
|
import './controls.css';
|
|
9
|
+
import Icon from './Icon.astro';
|
|
8
10
|
|
|
9
11
|
interface Props {
|
|
10
12
|
tone?: 'warning' | 'info';
|
|
@@ -12,4 +14,7 @@ interface Props {
|
|
|
12
14
|
const { tone = 'warning' } = Astro.props;
|
|
13
15
|
---
|
|
14
16
|
|
|
15
|
-
<p class:list={['notice', { info: tone === 'info' }]}
|
|
17
|
+
<p class:list={['notice', { info: tone === 'info' }]}>
|
|
18
|
+
<Icon name={tone === 'info' ? 'info' : 'triangle-alert'} />
|
|
19
|
+
<span><slot /></span>
|
|
20
|
+
</p>
|
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'] {
|
package/src/controls.css
CHANGED
|
@@ -213,19 +213,31 @@ select.field {
|
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
/* ---- Notice ---- */
|
|
216
|
+
/* A faint wash of the tone and its icon; no coloured bar down one side. */
|
|
216
217
|
.notice {
|
|
218
|
+
--notice-tone: var(--c-status-warning);
|
|
219
|
+
display: flex;
|
|
220
|
+
gap: var(--sp-3);
|
|
221
|
+
align-items: flex-start;
|
|
217
222
|
margin: 0;
|
|
218
223
|
padding: var(--sp-3) var(--sp-4);
|
|
219
|
-
border-
|
|
220
|
-
|
|
221
|
-
background: var(--c-surface);
|
|
224
|
+
border-radius: var(--radius-md);
|
|
225
|
+
background: color-mix(in oklab, var(--notice-tone) 10%, var(--c-surface));
|
|
222
226
|
font-size: var(--text-body-sm);
|
|
223
227
|
line-height: var(--leading-body-sm, 1.5);
|
|
224
228
|
color: var(--c-text-secondary);
|
|
225
229
|
}
|
|
226
230
|
|
|
227
231
|
.notice.info {
|
|
228
|
-
|
|
232
|
+
--notice-tone: var(--c-text-accent);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/* The icon centres on the first line, however the text wraps. */
|
|
236
|
+
.notice > svg {
|
|
237
|
+
flex: none;
|
|
238
|
+
color: var(--notice-tone);
|
|
239
|
+
margin-top: 2px;
|
|
240
|
+
margin-top: calc((1lh - 18px) / 2);
|
|
229
241
|
}
|
|
230
242
|
|
|
231
243
|
.notice strong {
|
package/src/icons.ts
CHANGED
|
@@ -61,6 +61,10 @@ export const ICONS = {
|
|
|
61
61
|
'<path d="M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0"/><circle cx="12" cy="10" r="3"/>',
|
|
62
62
|
'flask-conical':
|
|
63
63
|
'<path d="M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2"/><path d="M6.453 15h11.094"/><path d="M8.5 2h7"/>',
|
|
64
|
+
'triangle-alert':
|
|
65
|
+
'<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4"/><path d="M12 17h.01"/>',
|
|
66
|
+
info:
|
|
67
|
+
'<circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/>',
|
|
64
68
|
'circle-check':
|
|
65
69
|
'<circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/>',
|
|
66
70
|
palette:
|