@nyt87/ui 0.2.4 → 0.2.5
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/dist/styles.css +94 -1
- package/package.json +1 -1
package/dist/styles.css
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
.ds-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
|
|
7
7
|
|
|
8
8
|
/* One focus style for everything interactive. */
|
|
9
|
-
:where(.ds-btn, .ds-nav__link, .ds-table__sort, .ds-pager__item, .ds-control, .ds-code__copy, .ds-tabs__tab, .ds-tabs__panel, .ds-table-wrap, .ds-code pre):focus-visible,
|
|
9
|
+
:where(.ds-btn, .ds-nav__link, .ds-table__sort, .ds-pager__item, .ds-control, .ds-code__copy, .ds-tabs__tab, .ds-tabs__panel, .ds-table-wrap, .ds-code pre, .ds-chip__action, .ds-list__link, .ds-tabbar__item, .ds-search__clear):focus-visible,
|
|
10
10
|
.ds-choice:has(input:focus-visible) .ds-choice__box,
|
|
11
11
|
.ds-choice:has(input:focus-visible) .ds-switch,
|
|
12
12
|
.ds-seg__item:has(input:focus-visible) {
|
|
@@ -250,6 +250,8 @@
|
|
|
250
250
|
/* Hold the footer's text size and colour even when the host page styles bare <p> elements. */
|
|
251
251
|
.ds-footer__tagline, .ds-footer__credit, .ds-footer__note { font-size: var(--text-sm); color: inherit; }
|
|
252
252
|
.ds-footer__heart { color: var(--accent-ink); }
|
|
253
|
+
/* A footer of notes only: the bottom part alone, without a second dividing line under the footer's own. */
|
|
254
|
+
.ds-footer__bottom:first-child { border-top: 0; padding-top: var(--space-6); }
|
|
253
255
|
|
|
254
256
|
/* ---------- Product site sections: hero, section, features, steps, prose ---------- */
|
|
255
257
|
/* Hold margins and sizes even when the host page styles bare headings, <p> and lists. */
|
|
@@ -282,6 +284,97 @@
|
|
|
282
284
|
.ds-prose > :is(ul, ol):not([class]) { padding-left: 1.25em; }
|
|
283
285
|
.ds-prose a:not([class]) { color: var(--link); }
|
|
284
286
|
|
|
287
|
+
/* ---------- App kit: phone-first apps (bottom sheet, toast, chips, list rows, tab bar, search, progress, details, swatches) ---------- */
|
|
288
|
+
|
|
289
|
+
/* Floating button: an icon button that sits over content such as a map. */
|
|
290
|
+
.ds-btn--floating { background: var(--bg-raised); color: var(--fg); border-color: var(--border); box-shadow: var(--shadow-md); border-radius: var(--radius-full); }
|
|
291
|
+
.ds-btn--floating:hover:not(:disabled) { background: var(--bg-sunken); }
|
|
292
|
+
|
|
293
|
+
/* Bottom sheet: a dialog that rises from the bottom edge (phones). Add to dialog.ds-modal.ds-sheet; doubled classes beat the side sheet's rules below. */
|
|
294
|
+
.ds-sheet.ds-sheet--bottom { margin: auto 0 0; width: 100vw; height: fit-content; max-height: 85dvh; }
|
|
295
|
+
.ds-sheet.ds-sheet--bottom .ds-modal__panel { height: auto; max-height: 85dvh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-width: 1px 0 0; padding-bottom: env(safe-area-inset-bottom); }
|
|
296
|
+
.ds-sheet--bottom[open] .ds-modal__panel { animation: ds-sheet-up var(--duration-base) var(--ease); }
|
|
297
|
+
@keyframes ds-sheet-up { from { transform: translateY(100%); } }
|
|
298
|
+
@media (prefers-reduced-motion: reduce) { .ds-sheet--bottom[open] .ds-modal__panel { animation: none; } }
|
|
299
|
+
|
|
300
|
+
/* Toast: a short message with an optional action (Undo), in a fixed region. */
|
|
301
|
+
.ds-toast-region { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + var(--space-4)); transform: translateX(-50%); z-index: 90; display: grid; gap: var(--space-2); width: max-content; max-width: calc(100vw - 2 * var(--space-4)); }
|
|
302
|
+
.ds-toast-region--top { bottom: auto; top: calc(env(safe-area-inset-top) + var(--space-4)); }
|
|
303
|
+
.ds-toast { display: flex; align-items: center; gap: var(--space-3); min-height: calc(var(--tap-min) + var(--space-2)); padding: var(--space-1) var(--space-2) var(--space-1) var(--space-4); background: var(--bg-raised); color: var(--fg); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
|
|
304
|
+
.ds-toast__text { flex: 1; margin: 0; font-size: var(--text-sm); line-height: var(--leading-normal); }
|
|
305
|
+
.ds-toast__icon { flex: none; color: var(--fg-muted); }
|
|
306
|
+
.ds-toast--ok .ds-toast__icon { color: var(--ok); }
|
|
307
|
+
.ds-toast--danger .ds-toast__icon { color: var(--danger); }
|
|
308
|
+
|
|
309
|
+
/* Chips: compact labels, optionally with a colour dot, a second line and their own small actions. */
|
|
310
|
+
.ds-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
|
|
311
|
+
.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
|
+
.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); }
|
|
314
|
+
.ds-chip__main { display: grid; min-width: 0; line-height: var(--leading-tight); }
|
|
315
|
+
.ds-chip__label { font-weight: 600; overflow-wrap: anywhere; }
|
|
316
|
+
.ds-chip__note { color: var(--fg-muted); font-size: var(--text-xs); overflow-wrap: anywhere; }
|
|
317
|
+
.ds-chip__action { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; padding: 0; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--fg-muted); cursor: pointer; }
|
|
318
|
+
.ds-chip__action:hover { background: var(--bg-sunken); color: var(--fg); }
|
|
319
|
+
.ds-chip--pending { border-style: dashed; }
|
|
320
|
+
.ds-chip--pending .ds-chip__label { color: var(--fg-muted); }
|
|
321
|
+
|
|
322
|
+
/* List rows: a lead (dot or icon), a title with a meta line, and a trailing action or chevron. */
|
|
323
|
+
.ds-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }
|
|
324
|
+
.ds-list__item { display: flex; align-items: center; gap: var(--space-3); min-height: calc(var(--tap-min) + var(--space-2)); padding: var(--space-2) var(--space-1); border-bottom: 1px solid var(--border); }
|
|
325
|
+
.ds-list__link { display: flex; flex: 1; align-items: center; gap: var(--space-3); min-width: 0; align-self: stretch; color: inherit; text-decoration: none; border-radius: var(--radius-md); }
|
|
326
|
+
.ds-list__item:has(> .ds-list__link) { padding: 0; }
|
|
327
|
+
.ds-list__link { padding: var(--space-2) var(--space-1); }
|
|
328
|
+
.ds-list__link:hover { background: var(--bg-sunken); }
|
|
329
|
+
.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)); }
|
|
331
|
+
.ds-list__main { display: grid; flex: 1; min-width: 0; gap: 0.1rem; }
|
|
332
|
+
.ds-list__title { font-weight: 600; overflow-wrap: anywhere; }
|
|
333
|
+
.ds-list__meta { color: var(--fg-muted); font-size: var(--text-sm); overflow-wrap: anywhere; }
|
|
334
|
+
.ds-list__trail { flex: none; display: inline-flex; align-items: center; gap: var(--space-1); color: var(--fg-muted); font-size: var(--text-sm); }
|
|
335
|
+
|
|
336
|
+
/* Tab bar: the bottom navigation of a phone app. The app decides where it sits (usually fixed to the bottom). */
|
|
337
|
+
.ds-tabbar { display: flex; background: var(--bg-raised); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
|
|
338
|
+
.ds-tabbar__item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; min-height: 3.5rem; padding: var(--space-1); color: var(--fg-muted); font-size: var(--text-xs); font-weight: 600; text-decoration: none; }
|
|
339
|
+
.ds-tabbar__item .ds-icon { width: 1.5rem; height: 1.5rem; }
|
|
340
|
+
.ds-tabbar__item[aria-current='page'] { color: var(--accent-ink); }
|
|
341
|
+
|
|
342
|
+
/* Search field: a text input with a search icon, and a clear button once it has text. */
|
|
343
|
+
.ds-search { position: relative; display: flex; align-items: center; }
|
|
344
|
+
.ds-search__icon { position: absolute; left: var(--space-3); color: var(--fg-muted); pointer-events: none; }
|
|
345
|
+
.ds-search .ds-control { padding-left: calc(var(--space-3) * 2 + 1.25em); padding-right: var(--tap-min); }
|
|
346
|
+
.ds-search__clear { position: absolute; right: 0; display: inline-flex; align-items: center; justify-content: center; width: var(--tap-min); height: 100%; min-height: var(--tap-min); padding: 0; border: 0; background: transparent; color: var(--fg-muted); cursor: pointer; border-radius: var(--radius-md); }
|
|
347
|
+
.ds-search__clear:hover { color: var(--fg); }
|
|
348
|
+
.ds-search .ds-control::-webkit-search-cancel-button { display: none; }
|
|
349
|
+
|
|
350
|
+
/* Progress bar: a native <progress>, in the accent. Without a value it shows the platform's busy state. */
|
|
351
|
+
.ds-progress { display: block; width: 100%; height: 0.5rem; border: 0; border-radius: var(--radius-full); background: var(--bg-sunken); color: var(--accent); accent-color: var(--accent); overflow: hidden; -webkit-appearance: none; appearance: none; }
|
|
352
|
+
.ds-progress::-webkit-progress-bar { background: var(--bg-sunken); border-radius: var(--radius-full); }
|
|
353
|
+
.ds-progress::-webkit-progress-value { background: var(--accent); border-radius: var(--radius-full); }
|
|
354
|
+
.ds-progress::-moz-progress-bar { background: var(--accent); border-radius: var(--radius-full); }
|
|
355
|
+
.ds-progress:indeterminate { background: linear-gradient(90deg, var(--bg-sunken) 0 35%, var(--accent) 35% 65%, var(--bg-sunken) 65%) 0 0 / 300% 100%; animation: ds-progress-busy 1.4s linear infinite; }
|
|
356
|
+
.ds-progress:indeterminate::-webkit-progress-bar { background: transparent; }
|
|
357
|
+
.ds-progress:indeterminate::-moz-progress-bar { background: transparent; }
|
|
358
|
+
@keyframes ds-progress-busy { from { background-position: 100% 0; } to { background-position: 0 0; } }
|
|
359
|
+
@media (prefers-reduced-motion: reduce) { .ds-progress:indeterminate { animation: none; background-position: 50% 0; } }
|
|
360
|
+
|
|
361
|
+
/* Details list: labels above their values, each row with an optional action on the right. */
|
|
362
|
+
.ds-details { margin: 0; display: grid; }
|
|
363
|
+
.ds-details__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
|
|
364
|
+
.ds-details__row:first-child { padding-top: 0; }
|
|
365
|
+
.ds-details__row:last-child { border-bottom: 0; padding-bottom: 0; }
|
|
366
|
+
.ds-details dt { grid-column: 1; color: var(--fg-muted); font-size: var(--text-sm); }
|
|
367
|
+
.ds-details dd { grid-column: 1; margin: 0; overflow-wrap: anywhere; }
|
|
368
|
+
.ds-details__action { grid-column: 2; grid-row: 1 / span 2; }
|
|
369
|
+
|
|
370
|
+
/* Colour swatches: a choice of colours as radio buttons. Each swatch sets --ds-swatch. */
|
|
371
|
+
.ds-swatches { display: flex; flex-wrap: wrap; gap: var(--space-1); margin: 0; padding: 0; border: 0; }
|
|
372
|
+
.ds-swatch { position: relative; display: inline-flex; align-items: center; justify-content: center; width: var(--tap-min); height: var(--tap-min); cursor: pointer; }
|
|
373
|
+
.ds-swatch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
|
|
374
|
+
.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
|
+
.ds-swatch input:checked + .ds-swatch__dot { outline: 2px solid var(--fg); outline-offset: 2px; }
|
|
376
|
+
.ds-swatch input:focus-visible + .ds-swatch__dot { outline: 2px solid var(--ring); outline-offset: 4px; }
|
|
377
|
+
|
|
285
378
|
/* ---------- Dashboard kit ---------- */
|
|
286
379
|
|
|
287
380
|
/* App shell: sidebar + top bar + main. Below 860px the sidebar becomes a drawer opened by .ds-app__toggle (needs @nyt87/ui/menu). */
|
package/package.json
CHANGED