@nyt87/ui 0.2.6 → 0.3.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.
Files changed (2) hide show
  1. package/dist/styles.css +25 -3
  2. package/package.json +2 -2
package/dist/styles.css CHANGED
@@ -267,6 +267,8 @@
267
267
  .ds-section__title { margin: 0 0 var(--space-4); font-size: clamp(var(--text-2xl), 3.5vw, var(--text-3xl)); line-height: var(--leading-tight); }
268
268
 
269
269
  .ds-features { display: grid; gap: var(--space-5) var(--space-6); grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); margin: 0; padding: 0; list-style: none; }
270
+ .ds-features__icon { display: inline-grid; place-items: center; width: 3rem; height: 3rem; margin-bottom: var(--space-3); border-radius: var(--radius-md); background: var(--bg-sunken); color: var(--accent-ink); }
271
+ .ds-features__icon > :is(svg, img) { width: 1.75rem; height: 1.75rem; }
270
272
  .ds-features__title { margin: 0 0 var(--space-1); font-size: var(--text-md); line-height: var(--leading-tight); }
271
273
  .ds-features__text { margin: 0; color: var(--fg-muted); line-height: var(--leading-normal); }
272
274
 
@@ -285,6 +287,20 @@
285
287
  .ds-prose > h3 { font-size: var(--text-lg); }
286
288
  .ds-prose > :is(ul, ol):not([class]) { padding-left: 1.25em; }
287
289
  .ds-prose a:not([class]) { color: var(--link); }
290
+ .ds-prose > :is(h2, h3, h4) { scroll-margin-top: var(--space-4); }
291
+ .ds-prose > h4 { margin-top: var(--space-5); font-size: var(--text-md); }
292
+ .ds-prose li + li { margin-top: var(--space-1); }
293
+ /* Markdown output: code, tables, quotes, pictures and rules. Wide blocks scroll on their own, not the page. */
294
+ .ds-prose :not(pre) > code { padding: 0.1em 0.35em; font-family: var(--font-mono); font-size: 0.9em; background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 5px; overflow-wrap: break-word; }
295
+ .ds-prose > pre:not([class]) { padding: var(--space-3) var(--space-4); overflow-x: auto; background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--radius-md); font-family: var(--font-mono); font-size: var(--text-sm); }
296
+ .ds-prose > table:not([class]) { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: var(--text-sm); }
297
+ .ds-prose > table:not([class]) :is(th, td) { padding: var(--space-2) var(--space-3); border: 1px solid var(--border); text-align: left; vertical-align: top; }
298
+ .ds-prose > table:not([class]) th { background: var(--bg-sunken); }
299
+ .ds-prose > blockquote:not([class]) { padding: var(--space-2) var(--space-4); border-left: 3px solid var(--accent); background: var(--bg-sunken); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
300
+ .ds-prose > blockquote:not([class]) > * { margin: 0; }
301
+ .ds-prose > blockquote:not([class]) > * + * { margin-top: var(--space-2); }
302
+ .ds-prose img:not([class]) { max-width: 100%; height: auto; }
303
+ .ds-prose > hr:not([class]) { border: 0; border-top: 1px solid var(--border); margin-block: var(--space-6); }
288
304
 
289
305
  /* ---------- App kit: phone-first apps (bottom sheet, toast, chips, list rows, tab bar, search, progress, details, swatches) ---------- */
290
306
 
@@ -312,7 +328,7 @@
312
328
  .ds-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
313
329
  .ds-chip { --ds-chip-dot: var(--fg-muted); display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap-min); max-width: 100%; padding: var(--space-1) var(--space-1) var(--space-1) var(--space-3); background: var(--bg-raised); color: var(--fg); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); font-size: var(--text-sm); box-sizing: border-box; }
314
330
  .ds-chip:not(:has(.ds-chip__action)) { padding-right: var(--space-3); }
315
- .ds-chip__dot { flex: none; width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--ds-chip-dot); }
331
+ .ds-chip__dot { flex: none; width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--ds-chip-dot); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 20%, transparent); }
316
332
  .ds-chip__main { display: grid; min-width: 0; line-height: var(--leading-tight); }
317
333
  .ds-chip__label { font-weight: 600; overflow-wrap: anywhere; }
318
334
  .ds-chip__note { color: var(--fg-muted); font-size: var(--text-xs); overflow-wrap: anywhere; }
@@ -329,7 +345,7 @@
329
345
  .ds-list__link { padding: var(--space-2) var(--space-1); }
330
346
  .ds-list__link:hover { background: var(--bg-sunken); }
331
347
  .ds-list__lead { flex: none; display: inline-flex; color: var(--fg-muted); }
332
- .ds-list__dot { width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--ds-list-dot, var(--fg-muted)); }
348
+ .ds-list__dot { width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--ds-list-dot, var(--fg-muted)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 20%, transparent); }
333
349
  .ds-list__main { display: grid; flex: 1; min-width: 0; gap: 0.1rem; }
334
350
  .ds-list__title { font-weight: 600; overflow-wrap: anywhere; }
335
351
  .ds-list__meta { color: var(--fg-muted); font-size: var(--text-sm); overflow-wrap: anywhere; }
@@ -367,7 +383,8 @@
367
383
  .ds-details__row:last-child { border-bottom: 0; padding-bottom: 0; }
368
384
  .ds-details dt { grid-column: 1; color: var(--fg-muted); font-size: var(--text-sm); }
369
385
  .ds-details dd { grid-column: 1; margin: 0; overflow-wrap: anywhere; }
370
- .ds-details__action { grid-column: 2; grid-row: 1 / span 2; }
386
+ /* A <dd>: the only valid child of a row besides <dt>. Two classes, to beat ".ds-details dd". */
387
+ .ds-details .ds-details__action { grid-column: 2; grid-row: 1 / span 2; }
371
388
 
372
389
  /* Colour swatches: a choice of colours as radio buttons. Each swatch sets --ds-swatch. */
373
390
  .ds-swatches { display: flex; flex-wrap: wrap; gap: var(--space-1); margin: 0; padding: 0; border: 0; }
@@ -376,6 +393,11 @@
376
393
  .ds-swatch__dot { width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--ds-swatch); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 20%, transparent); }
377
394
  .ds-swatch input:checked + .ds-swatch__dot { outline: 2px solid var(--fg); outline-offset: 2px; }
378
395
  .ds-swatch input:focus-visible + .ds-swatch__dot { outline: 2px solid var(--ring); outline-offset: 4px; }
396
+ /* Or <button aria-pressed> swatches, when a choice acts at once: arrow keys then only move focus. */
397
+ button.ds-swatch { padding: 0; background: none; border: 0; color: inherit; font: inherit; }
398
+ .ds-swatch[aria-pressed="true"] .ds-swatch__dot { outline: 2px solid var(--fg); outline-offset: 2px; }
399
+ button.ds-swatch:focus-visible { outline: none; }
400
+ button.ds-swatch:focus-visible .ds-swatch__dot { outline: 2px solid var(--ring); outline-offset: 4px; }
379
401
 
380
402
  /* ---------- Dashboard kit ---------- */
381
403
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nyt87/ui",
3
- "version": "0.2.6",
3
+ "version": "0.3.0",
4
4
  "description": "Framework-free UI components for nyt87 products: HTML + CSS, with small vanilla behaviours for the interactive parts",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -49,7 +49,7 @@
49
49
  "dist"
50
50
  ],
51
51
  "dependencies": {
52
- "@nyt87/tokens": ">=0.1.3"
52
+ "@nyt87/tokens": ">=0.1.4"
53
53
  },
54
54
  "scripts": {
55
55
  "build": "tsup && cp src/styles.css dist/styles.css",