@nyt87/ui 0.3.2 → 0.3.3

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 +33 -2
  2. package/package.json +1 -1
package/dist/styles.css CHANGED
@@ -123,9 +123,9 @@ button.ds-seg__item:focus-visible { outline: 2px solid var(--ring); outline-offs
123
123
  /* Block: the full width, the items sharing it. Grid: rows of --ds-seg-cols (3) items, for longer sets. */
124
124
  .ds-seg--block { display: flex; width: 100%; }
125
125
  .ds-seg--block .ds-seg__item { flex: 1; }
126
- .ds-seg--block .ds-seg__item span { flex: 1; justify-content: center; }
126
+ .ds-seg--block label.ds-seg__item > span { flex: 1; justify-content: center; }
127
127
  .ds-seg--grid { display: grid; grid-template-columns: repeat(var(--ds-seg-cols, 3), minmax(0, 1fr)); width: 100%; }
128
- .ds-seg--grid .ds-seg__item span { flex: 1; justify-content: center; }
128
+ .ds-seg--grid label.ds-seg__item > span { flex: 1; justify-content: center; }
129
129
 
130
130
  /* ---------- Card ---------- */
131
131
  .ds-card { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-lg); }
@@ -411,6 +411,11 @@ button.ds-chip[aria-pressed='true'] { border-color: var(--accent); background: c
411
411
  .ds-list--cards .ds-list__item--ok { border-color: var(--ok); }
412
412
  .ds-list--cards .ds-list__item--warn { border-color: var(--warn); }
413
413
  .ds-list--cards .ds-list__item--danger { border-color: var(--danger); }
414
+ /* A row that acts rather than goes somewhere (pick a workspace): a button as the link, the current one aria-current. */
415
+ button.ds-list__link { width: 100%; margin: 0; font: inherit; color: inherit; text-align: left; background: none; border: 0; cursor: pointer; }
416
+ button.ds-list__link:disabled { cursor: default; opacity: 0.6; }
417
+ .ds-list__link:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
418
+ .ds-list--cards .ds-list__item:has(> .ds-list__link[aria-current='true']) { border-color: var(--accent); }
414
419
 
415
420
  /* Tab bar: the bottom navigation of a phone app. The app decides where it sits (usually fixed to the bottom). */
416
421
  .ds-tabbar { display: flex; background: var(--bg-raised); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
@@ -463,12 +468,38 @@ button.ds-chip[aria-pressed='true'] { border-color: var(--accent); background: c
463
468
  .ds-disclosure[open] > summary::before { transform: rotate(45deg); }
464
469
  .ds-disclosure > summary:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
465
470
  .ds-disclosure__body { padding: 0 var(--space-3) var(--space-3); }
471
+ /* Plain: no frame, for a disclosure in the page's flow whose content brings its own cards */
472
+ .ds-disclosure--plain { background: none; border: 0; }
473
+ .ds-disclosure--plain > summary, .ds-disclosure--plain > .ds-disclosure__body { padding-inline: 0; }
466
474
  @media (prefers-reduced-motion: reduce) { .ds-disclosure > summary::before { transition: none; } }
467
475
 
468
476
  /* Action bar: the screen's main action, fixed to the bottom of a phone screen above the safe area. Leave room under
469
477
  the content for it (padding-bottom on the page). */
470
478
  .ds-actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; gap: var(--space-2); padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom)); background: var(--bg-raised); border-top: 1px solid var(--border); }
471
479
 
480
+ /* Title bar: the top of a phone app's screen. A leading slot (the brand, a back link), the title centred with a line
481
+ under it (or a button that opens a picker), and trailing icon buttons. The app decides where it sits (usually sticky). */
482
+ .ds-titlebar { display: grid; grid-template-columns: 1fr minmax(0, auto) 1fr; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4); background: var(--bg); border-bottom: 1px solid var(--border); }
483
+ .ds-titlebar__lead { justify-self: start; display: flex; align-items: center; min-height: var(--tap-min); }
484
+ .ds-titlebar__main { display: flex; flex-direction: column; align-items: center; min-width: 0; text-align: center; }
485
+ .ds-titlebar__title { display: flex; align-items: center; justify-content: center; gap: 0.375rem; max-width: 100%; min-width: 0; margin: 0; font-size: 1.0625rem; font-weight: 700; line-height: var(--leading-tight); }
486
+ .ds-titlebar__sub { display: inline-flex; align-items: center; gap: 0.125rem; max-width: 100%; color: var(--fg-muted); font-size: 0.8125rem; line-height: 1.3; }
487
+ /* the line under the title as a button: short, so its tap target reaches the bar's 44px */
488
+ button.ds-titlebar__sub { position: relative; padding: 0 0.125rem; font-family: inherit; background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer; }
489
+ button.ds-titlebar__sub::after { content: ''; position: absolute; inset: -0.875rem -0.625rem -0.375rem; }
490
+ button.ds-titlebar__sub:hover { color: var(--fg); }
491
+ button.ds-titlebar__sub:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
492
+ .ds-titlebar__trail { justify-self: end; display: flex; align-items: center; gap: 0.125rem; }
493
+ .ds-titlebar__trail .ds-btn[aria-current='page'] { color: var(--accent-ink); }
494
+
495
+ /* Inline confirmation: the question that takes a button's place before it acts ("Refuse this draft?"), with Cancel and
496
+ the action repeating the verb. Danger by default; --go for an action that is safe but can't be taken back. */
497
+ .ds-confirm { padding: var(--space-3); border: 1px solid var(--danger); border-radius: var(--radius-md); background: color-mix(in srgb, var(--danger) 6%, var(--bg-raised)); }
498
+ .ds-confirm--go { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--bg-raised)); }
499
+ .ds-confirm__text { margin: 0 0 var(--space-2); font-size: var(--text-sm); line-height: var(--leading-normal); }
500
+ .ds-confirm__actions { display: flex; gap: var(--space-2); }
501
+ .ds-confirm__actions > * { flex: 1; }
502
+
472
503
  /* Colour swatches: a choice of colours as radio buttons. Each swatch sets --ds-swatch. */
473
504
  .ds-swatches { display: flex; flex-wrap: wrap; gap: var(--space-1); margin: 0; padding: 0; border: 0; }
474
505
  .ds-swatch { position: relative; display: inline-flex; align-items: center; justify-content: center; width: var(--tap-min); height: var(--tap-min); cursor: pointer; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nyt87/ui",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
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",