@n1kname/components 0.62.0 → 0.64.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.62.0",
3
+ "version": "0.64.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -84,13 +84,15 @@ const Heading = `h${level}` as 'h2' | 'h3';
84
84
  border-radius: var(--radius-lg);
85
85
  }
86
86
 
87
+ /* A real heading, a step above the part labels, in the accent text colour like the figures and
88
+ * bullets under it. It was a small label in a heading's place, smaller than the parts. */
87
89
  .glance-title {
88
- margin: 0 0 var(--sp-4);
89
- font-family: var(--font-body);
90
- font-size: var(--text-overline);
90
+ margin: 0 0 var(--sp-5);
91
+ font-family: var(--font-display);
92
+ font-size: var(--text-h3);
91
93
  font-weight: 600;
92
- line-height: var(--leading-overline);
93
- letter-spacing: var(--tracking-overline);
94
+ line-height: var(--leading-h3);
95
+ letter-spacing: var(--tracking-h3);
94
96
  color: var(--c-text-accent);
95
97
  }
96
98
 
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' }]}><slot /></p>
17
+ <p class:list={['notice', { info: tone === 'info' }]}>
18
+ <Icon name={tone === 'info' ? 'info' : 'triangle-alert'} />
19
+ <span><slot /></span>
20
+ </p>
@@ -152,7 +152,10 @@ const lineAbove = (stage: Stage, laneIndex: number) => {
152
152
  overflow: hidden;
153
153
  }
154
154
 
155
+ /* Positioned, so the screen-reader labels (absolute) inside it stay inside it: without this they
156
+ * anchored to the page and widened it by the grid's full width. */
155
157
  .scroller {
158
+ position: relative;
156
159
  overflow-x: auto;
157
160
  overscroll-behavior-x: contain;
158
161
  padding: var(--sp-5) var(--sp-5) var(--sp-5) 0;
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-left: 3px solid var(--c-status-warning);
220
- border-radius: var(--radius-sm);
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
- border-left-color: var(--c-accent);
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: