@nyt87/ui 0.2.5 → 0.2.7

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 +13 -6
  2. package/package.json +1 -1
package/dist/styles.css CHANGED
@@ -30,14 +30,16 @@
30
30
  /* ---------- Button ---------- */
31
31
  .ds-btn {
32
32
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
33
- font: inherit; font-weight: 600; line-height: 1; white-space: nowrap;
33
+ font: inherit; font-weight: 600; line-height: 1.25; text-align: center;
34
+ /* A label wraps only when there is no room (a phone at large text sizes) instead of being cut off. */
35
+ padding-block: var(--space-1);
34
36
  border: 1px solid transparent; border-radius: var(--radius-md);
35
37
  cursor: pointer; text-decoration: none;
36
38
  transition: background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
37
39
  }
38
- .ds-btn--sm { min-height: 2rem; padding: 0 var(--space-3); font-size: var(--text-sm); }
39
- .ds-btn--md { min-height: 2.5rem; padding: 0 var(--space-4); font-size: var(--text-sm); }
40
- .ds-btn--lg { min-height: var(--tap-min); padding: 0 var(--space-5); font-size: var(--text-md); }
40
+ .ds-btn--sm { min-height: 2rem; padding-inline: var(--space-3); font-size: var(--text-sm); }
41
+ .ds-btn--md { min-height: 2.5rem; padding-inline: var(--space-4); font-size: var(--text-sm); }
42
+ .ds-btn--lg { min-height: var(--tap-min); padding-inline: var(--space-5); font-size: var(--text-md); }
41
43
  .ds-btn__icon { display: inline-flex; }
42
44
  .ds-btn--icon-only.ds-btn--sm { width: 2rem; padding: 0; }
43
45
  .ds-btn--icon-only.ds-btn--md { width: 2.5rem; padding: 0; }
@@ -310,7 +312,7 @@
310
312
  .ds-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
311
313
  .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; }
312
314
  .ds-chip:not(:has(.ds-chip__action)) { padding-right: var(--space-3); }
313
- .ds-chip__dot { flex: none; width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--ds-chip-dot); }
315
+ .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); }
314
316
  .ds-chip__main { display: grid; min-width: 0; line-height: var(--leading-tight); }
315
317
  .ds-chip__label { font-weight: 600; overflow-wrap: anywhere; }
316
318
  .ds-chip__note { color: var(--fg-muted); font-size: var(--text-xs); overflow-wrap: anywhere; }
@@ -327,7 +329,7 @@
327
329
  .ds-list__link { padding: var(--space-2) var(--space-1); }
328
330
  .ds-list__link:hover { background: var(--bg-sunken); }
329
331
  .ds-list__lead { flex: none; display: inline-flex; color: var(--fg-muted); }
330
- .ds-list__dot { width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--ds-list-dot, var(--fg-muted)); }
332
+ .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); }
331
333
  .ds-list__main { display: grid; flex: 1; min-width: 0; gap: 0.1rem; }
332
334
  .ds-list__title { font-weight: 600; overflow-wrap: anywhere; }
333
335
  .ds-list__meta { color: var(--fg-muted); font-size: var(--text-sm); overflow-wrap: anywhere; }
@@ -374,6 +376,11 @@
374
376
  .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); }
375
377
  .ds-swatch input:checked + .ds-swatch__dot { outline: 2px solid var(--fg); outline-offset: 2px; }
376
378
  .ds-swatch input:focus-visible + .ds-swatch__dot { outline: 2px solid var(--ring); outline-offset: 4px; }
379
+ /* Or <button aria-pressed> swatches, when a choice acts at once: arrow keys then only move focus. */
380
+ button.ds-swatch { padding: 0; background: none; border: 0; color: inherit; font: inherit; }
381
+ .ds-swatch[aria-pressed="true"] .ds-swatch__dot { outline: 2px solid var(--fg); outline-offset: 2px; }
382
+ button.ds-swatch:focus-visible { outline: none; }
383
+ button.ds-swatch:focus-visible .ds-swatch__dot { outline: 2px solid var(--ring); outline-offset: 4px; }
377
384
 
378
385
  /* ---------- Dashboard kit ---------- */
379
386
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nyt87/ui",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
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",