@usableapp/cardds 0.7.158 → 0.7.160

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/css/stamp.css CHANGED
@@ -35,10 +35,11 @@
35
35
  display: block;
36
36
  container-type: inline-size;
37
37
  color: var(--stamp-ink, var(--ink-onlight));
38
- /* the contact shadow every stamp has (Lh 2026-10-26: contact only, lighter than --shadow-contact's 0.4): its edge on any ground, a white one too; black as the scrim, no color-mix (iOS 16.4) */
39
- --_contact: 0 0 var(--border-w) rgb(0 0 0 / 0.28);
40
- --_rim: drop-shadow(0 0 0 transparent); /* a framed stamp's teeth are its paper already: no rim (--frameless, below) */
41
- filter: var(--_rim) drop-shadow(var(--stamp-shadow, var(--_contact))) drop-shadow(var(--stamp-drop, 0 0 0 transparent)); /* drop-shadow follows the teeth; a box-shadow would draw the rectangle. The first is the contact shadow every stamp keeps, the second a lift a theme may add (--stamp-drop; none by default, Lh 2026-10-26 — it was --shadow-paper) */
38
+ /* the contact shadow every stamp has, framed or not (Lh 2026-10-26: contact only; Lh 2026-10-28: darker, sharper — a quarter of the blur, about
39
+ twice the opacity, it was 0 0 var(--border-w) rgb(0 0 0 / 0.28); a sliver of blur stays, a 0-offset drop-shadow with none draws nothing):
40
+ its edge on any ground, a white one too; black as the scrim, no color-mix (iOS 16.4) */
41
+ --_contact: 0 0 calc(var(--border-w) / 4) rgb(0 0 0 / 0.6);
42
+ filter: drop-shadow(var(--stamp-shadow, var(--_contact))) drop-shadow(var(--stamp-drop, 0 0 0 transparent)); /* drop-shadow follows the teeth; a box-shadow would draw the rectangle. The first is the contact shadow every stamp keeps, the second a lift a theme may add (--stamp-drop; none by default, Lh 2026-10-26 — it was --shadow-paper) */
42
43
  rotate: var(--stamp-turn, none);
43
44
  animation: var(--stamp-arrive, none);
44
45
  }
@@ -55,14 +56,15 @@
55
56
  /* the white frame: the paper's own colour round the picture. --frameless (`frame={false}`): the paper takes the picture's tone class instead,
56
57
  so the tone runs out to the teeth — the teeth, 4:5, shadow, pictures and words unchanged (Lh 2026-10-26: a stamp is always perforated) */
57
58
  .stamp:not(.stamp--frameless) > .stamp__paper { background-color: var(--stamp-paper-bg, var(--stamp-paper)); }
58
- /* a frameless stamp keeps a thin rim of that paper round its teeth, under every shadow it wears: the tone never touches the dark contact
59
- shadow, so the teeth read on any tone, light or dark, at every size (Lh 2026-10-26: the tone and the shadow ran together). Four hard
60
- drop-shadows, one per side, make the rim; it follows the teeth as the shadow does */
61
- .stamp--frameless {
62
- --_rim-ink: var(--stamp-paper-bg, var(--stamp-paper));
63
- --_rim: drop-shadow(var(--border-w) 0 0 var(--_rim-ink)) drop-shadow(calc(-1 * var(--border-w)) 0 0 var(--_rim-ink))
64
- drop-shadow(0 var(--border-w) 0 var(--_rim-ink)) drop-shadow(0 calc(-1 * var(--border-w)) 0 var(--_rim-ink));
65
- }
59
+ /* no rim round a frameless stamp's teeth (Lh 2026-10-28: the paper-coloured rim of 0.7.149 read as a white edge round a full-colour stamp):
60
+ the tone runs out to the teeth. Its contact shadow is its own tone made dusky, not black (Lh 2026-10-28): a second punched paper under
61
+ the first (.stamp__shade, drawn only when frameless) wears the tone class, a grey painted OVER the tone as a background layer (a real
62
+ overlay, no color-mix — iOS 16.4), blurred as the black one is so its fringe shows round the teeth. Knob --stamp-tone-shadow-bg: the grey
63
+ laid over the tone (a darker or lighter shade; transparent = the bare tone). The black contact shadow is off here, unless a theme sets
64
+ --stamp-shadow */
65
+ .stamp--frameless { --_contact: 0 0 0 transparent; --_tone-shade: rgb(0 0 0 / 0.5); }
66
+ .stamp__shade { position: absolute; inset: 0; filter: blur(calc(var(--border-w) / 4)); }
67
+ .stamp__shade > .stamp__paper { background-image: linear-gradient(var(--stamp-tone-shadow-bg, var(--_tone-shade)) 0 0); }
66
68
  .stamp__pic { position: absolute; inset: var(--stamp-frame, 8cqw); overflow: hidden; } /* the paper's frame round the picture; the ground is the tone class's */
67
69
 
68
70
  /* the pictures, placed by COUNT: where, how wide, how far turned — the layout is the stamp's look, never the app's.
@@ -83,8 +85,8 @@
83
85
  /* the words on the picture's foot: a small line, then the big name — one line each (clipped sideways only: Thai tone marks stand above the line box) */
84
86
  .stamp__cap { position: absolute; inset-inline: 5cqw; bottom: 3.5cqw; display: grid; gap: 0.4cqw; }
85
87
  .stamp__words, .stamp__name { display: block; min-width: 0; white-space: nowrap; overflow-x: clip; text-overflow: ellipsis; }
86
- .stamp__words { --_words: 4.8cqw; font: var(--fw-medium) var(--_words) / var(--lh-title) var(--font-ui); font-size: var(--stamp-words-font-size, var(--_words)); }
87
- .stamp__name { --_name: 9.5cqw; font: var(--fw-black) var(--_name) / var(--lh-display) var(--font-display); font-size: var(--stamp-name-font-size, var(--_name)); }
88
+ .stamp__words { --_words: 4.8cqw; font: var(--fw-medium) var(--_words) / round(down, calc(var(--lh-title) * 1em), 1px) var(--font-ui); font-size: var(--stamp-words-font-size, var(--_words)); }
89
+ .stamp__name { --_name: 9.5cqw; font: var(--fw-black) var(--_name) / round(down, calc(var(--lh-display) * 1em), 1px) var(--font-display); font-size: var(--stamp-name-font-size, var(--_name)); }
88
90
  /* at the stamp's own size and under (and stuck on a note): the small line goes, the name grows */
89
91
  /* --bare: the pictures alone, no words — a stamp stuck on something (a note, a postcard). The words belong to the album.
90
92
  The pictures take the foot's room: each sits a little lower, so the group stands in the middle of the frame. */
@@ -101,7 +103,7 @@
101
103
  Too small for words: it is bare whatever it is handed. Only the contact shadow (--stamp-shadow): it lies flat in the line, its edge still seen. The teeth are every stamp's (8 across,
102
104
  10 down), and the frame round the picture wider to clear them. Several, lapped, with a "+8": AvatarStack (below).
103
105
  <span class="stamp stamp--1 stamp--xs">…</span> */
104
- .stamp--xs { width: var(--stamp-xs-size, var(--stamp-xs)); flex: none; margin-inline: 0; filter: var(--_rim) drop-shadow(var(--stamp-shadow, var(--_contact))); }
106
+ .stamp--xs { width: var(--stamp-xs-size, var(--stamp-xs)); flex: none; margin-inline: 0; filter: drop-shadow(var(--stamp-shadow, var(--_contact))); }
105
107
  .stamp--xs .stamp__pic { inset: var(--stamp-frame, 12cqw); }
106
108
  /* held: the stamp keeps its box and draws nothing (visibility, never display or a size of its own) — shown later in the same box, nothing beside it moves */
107
109
  .stamp--held { visibility: hidden; }
@@ -254,7 +256,7 @@
254
256
  After the rule above, at the same weight: `main` is the one place a stuck stamp reads --stamp-size. */
255
257
  .stamp-on--main > .stamp { width: var(--stamp-size, calc(var(--tap) * 2)); }
256
258
  .stamp-on--under { top: var(--card-pad, 0); right: var(--card-pad, 0); left: auto; translate: none; z-index: var(--z-under); pointer-events: none; } /* the card's top right corner, below everything the card holds */
257
- .stamp-on--under > .stamp { width: var(--stamp-size, calc(var(--tap) * 2)); filter: var(--_rim) drop-shadow(var(--stamp-shadow, var(--_contact))); }
259
+ .stamp-on--under > .stamp { width: var(--stamp-size, calc(var(--tap) * 2)); filter: drop-shadow(var(--stamp-shadow, var(--_contact))); }
258
260
  .stamp-on--move { will-change: transform; } /* its own layer: Safari left the stamp's shadow behind as a trail along the drag when it was painted with the note (seen on the simulator, 2026-10-07) */
259
261
  .stamp-on--move { cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; transition: scale var(--motion-press) var(--ease-out); }
260
262
  .stamp-on--move:focus-visible { outline: var(--focus); outline-offset: var(--sp-1); }
@@ -314,7 +316,7 @@
314
316
  width: var(--appbar-stamp-size, var(--_fit));
315
317
  flex: none;
316
318
  margin-inline: 0;
317
- filter: var(--_rim) drop-shadow(var(--stamp-shadow, var(--_contact)));
319
+ filter: drop-shadow(var(--stamp-shadow, var(--_contact)));
318
320
  }
319
321
  :is(.appbar__brand, .appbar__who) > .stamp .stamp__cap { display: none; }
320
322
  :is(.appbar__brand, .appbar__who) > .stamp .stamp__art { top: calc(var(--_y) + 9%); }
@@ -322,10 +324,10 @@
322
324
  /* a stamp ON a card lies flat: only the contact shadow (--stamp-shadow), at every size (Lh 2026-10-24; the contact shadow 2026-10-26) — a feed card's lead, a foot row's, xs.
323
325
  A sheet is a `.card` too, but what it holds stands off its paper: the album, the tray, a start screen's stamp keep their shadow, and so
324
326
  does a stamp in an album's cell wherever the album lies */
325
- .card:not(.sheet) .stamp:not(.stamp-cell > .stamp) { filter: var(--_rim) drop-shadow(var(--stamp-shadow, var(--_contact))); }
327
+ .card:not(.sheet) .stamp:not(.stamp-cell > .stamp) { filter: drop-shadow(var(--stamp-shadow, var(--_contact))); }
326
328
  /* ONE exception (Lh 2026-10-25): a stamp in the head is glued down — plain, `under` or `sm`, a hair of shadow at its teeth, flat paper, never a lifted sticker.
327
329
  A bare or xs stamp stays flat, its contact shadow only. Knob: --stamp-under-drop (the name it was born with: `under` had it first) */
328
- .card:not(.sheet) .head > .stamp:not(.stamp--bare, .stamp--xs) { filter: var(--_rim) drop-shadow(var(--stamp-shadow, var(--_contact))) drop-shadow(var(--stamp-under-drop, var(--shadow-glued))); }
330
+ .card:not(.sheet) .head > .stamp:not(.stamp--bare, .stamp--xs) { filter: drop-shadow(var(--stamp-shadow, var(--_contact))) drop-shadow(var(--stamp-under-drop, var(--shadow-glued))); }
329
331
  .head > .stamp { grid-column: 2; grid-row: 1 / span 2; margin-inline: 0; }
330
332
  .head > .stamp--under { grid-column: 1; justify-self: end; } /* `under`: in the words' own column, at its end, the words over it (parts.css) */
331
333
  /* ---- where it sits in what people.css draws (docs/reference.md rule 15) ---- */
package/css/sticky.css CHANGED
@@ -428,7 +428,7 @@
428
428
  border-block-end: var(--rule-w) dotted currentColor;
429
429
  font: inherit;
430
430
  }
431
- .sticky-heading__title { min-width: 0; max-width: 100%; font: var(--sticky-heading-title-font, var(--type-label)); line-height: var(--lh-caption); /* Thai marks stack taller than the label's 1.2, and overflow clips them */ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
431
+ .sticky-heading__title { min-width: 0; max-width: 100%; font: var(--sticky-heading-title-font, var(--type-label)); line-height: round(down, calc(var(--lh-caption) * 1em), 1px); /* Thai marks stack taller than the label's 1.2, and overflow clips them */ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
432
432
  .sticky-heading__caption { font: var(--sticky-heading-caption-font, var(--type-caption)); color: var(--sticky-heading-caption-ink, var(--card-muted)); white-space: nowrap; } /* the muted words of what it stands on: a note, or the screen */
433
433
  /* on a note: across the top of its paper, and the note's words start under it */
434
434
  .sticky__stuck > .sticky-heading { position: absolute; inset: var(--sp-2) var(--sp-4) auto; }
@@ -72,5 +72,6 @@
72
72
  layer: --z-under-2 … --z-over-3 fade: --off --fade-faint … --fade-most
73
73
  type: per kind (display h1 h2 title body label caption stat) --face-<kind> --fw-<kind> --fs-<kind> --lh-<kind> --track-<kind>; --lh-h1-caption;
74
74
  the scales --fw-regular --fw-medium --fw-semibold --fw-strong --fw-bold --fw-heavy --fw-black
75
- --lh-mark --lh-band --lh-badge --lh-solid --lh-tight --lh-field --lh-hand --lh-ruled --track-loose --track-caps */
75
+ --lh-mark --lh-band --lh-badge --lh-solid --lh-tight --lh-field --lh-hand --lh-ruled --track-loose --track-caps
76
+ every --lh-* (and every leading knob) is a unitless ratio, never a length: 1.25, not 28px (docs/reference.md "type") */
76
77
  }
package/css/tokens.css CHANGED
@@ -336,14 +336,14 @@
336
336
  onlight shade washed 14% into the surface (tone 2's formula) */
337
337
  :root, [data-palette], [data-mode] {
338
338
  /* each kind's style, from its tokens: set here so a palette or a mode that tunes a kind's weight, size, leading or face reaches .t-<kind> */
339
- --type-display: var(--fw-display) var(--fs-display) / var(--lh-display) var(--face-display);
340
- --type-h1: var(--fw-h1) var(--fs-h1) / var(--lh-h1) var(--face-h1);
341
- --type-h2: var(--fw-h2) var(--fs-h2) / var(--lh-h2) var(--face-h2);
342
- --type-title: var(--fw-title) var(--fs-title) / var(--lh-title) var(--face-title);
343
- --type-body: var(--fw-body) var(--fs-body) / var(--lh-body) var(--face-body);
344
- --type-label: var(--fw-label) var(--fs-label) / var(--lh-label) var(--face-label);
345
- --type-caption: var(--fw-caption) var(--fs-caption) / var(--lh-caption) var(--face-caption);
346
- --type-stat: var(--fw-stat) var(--fs-stat) / var(--lh-stat) var(--face-stat);
339
+ --type-display: var(--fw-display) var(--fs-display) / round(down, calc(var(--lh-display) * 1em), 1px) var(--face-display);
340
+ --type-h1: var(--fw-h1) var(--fs-h1) / round(down, calc(var(--lh-h1) * 1em), 1px) var(--face-h1);
341
+ --type-h2: var(--fw-h2) var(--fs-h2) / round(down, calc(var(--lh-h2) * 1em), 1px) var(--face-h2);
342
+ --type-title: var(--fw-title) var(--fs-title) / round(down, calc(var(--lh-title) * 1em), 1px) var(--face-title);
343
+ --type-body: var(--fw-body) var(--fs-body) / round(down, calc(var(--lh-body) * 1em), 1px) var(--face-body);
344
+ --type-label: var(--fw-label) var(--fs-label) / round(down, calc(var(--lh-label) * 1em), 1px) var(--face-label);
345
+ --type-caption: var(--fw-caption) var(--fs-caption) / round(down, calc(var(--lh-caption) * 1em), 1px) var(--face-caption);
346
+ --type-stat: var(--fw-stat) var(--fs-stat) / round(down, calc(var(--lh-stat) * 1em), 1px) var(--face-stat);
347
347
  /* shadows of paper laid on paper: mixed from the onlight ink, so re-derived where a palette is set */
348
348
  --shadow-paper: 0 var(--sp-1) var(--sp-2) color-mix(in srgb, var(--ink-onlight) 16%, transparent); /* a stamp lying on paper: follows its teeth (drop-shadow) */
349
349
  --shadow-lift: 0 var(--sp-0) var(--sp-1) color-mix(in srgb, var(--ink-onlight) 35%, transparent); /* a small disc lifted over a picture */
@@ -22,10 +22,11 @@ export interface BtnGroupProps extends Omit<ComponentProps<'div'>, 'onChange' |
22
22
  /** `frame` only: the buttons one OVER the other, the panel one button wide — at a `Row`'s end, where a panel across would take the
23
23
  * words' room */
24
24
  vertical?: boolean;
25
- /** `frame` only: the panel as wide as its buttons (each one tap wide, or as wide as its word), in the middle of its column the way a
25
+ /** `frame` and `choice`: the panel as wide as its buttons (each one tap wide, or as wide as its word), in the middle of its column the way a
26
26
  * `Btn form` is — in a `Page`, a `Centre`, a `CtaPack`, and in a card's or a sheet's foot, where it keeps that width instead of filling
27
27
  * the row. Without it the panel is the width of what it stands in. Not with `vertical`: that is already one button wide, at a row's
28
- * end — `form` wins and warns */
28
+ * end — `form` wins and warns. `choice` (Lh 2026-10-28): the joined words each as wide as its word, the frame as wide as them all — on
29
+ * its own in the middle of a step, in a `CtaPack` beside another control on the same line */
29
30
  form?: boolean;
30
31
  /** with `form`: SHOW the `label` as words at the panel's left, on one line, the two centred together — plain ink in the label's type,
31
32
  * outside the frame, and the words are the group's name (`aria-labelledby`). Where the line is too narrow (a big text size on a small
@@ -15,8 +15,8 @@ export function BtnGroup({ look = 'frame', label, labelled, form, select, value,
15
15
  const strip = look !== 'frame'; // `choice` is a strip of words in a button's look
16
16
  if (!strip && Children.count(children) > 4)
17
17
  warnOnce('icon-btn-group', 'cardds BtnGroup: more than 4 buttons in a frame — keep 4, put the rest in a Menu behind one of them');
18
- if (strip && (form || vertical || labelled))
19
- warnOnce('btn-group-strip-frame', 'cardds BtnGroup: `form`, `vertical` and `labelled` are the frame\'s — a strip always shares the width it stands in; they are ignored');
18
+ if (strip && (vertical || labelled || (form && look !== 'choice')))
19
+ warnOnce('btn-group-strip-frame', 'cardds BtnGroup: `vertical` and `labelled` are the frame\'s, `form` the frame\'s and the choice\'s — a strip always shares the width it stands in; they are ignored');
20
20
  if (!strip && form && vertical)
21
21
  warnOnce('icon-btn-group-form-vertical', 'cardds BtnGroup: `form` and `vertical` together — `vertical` is already one button wide at a row\'s end, `form` is the panel in the middle of its column; `form` is kept, `vertical` ignored');
22
22
  if (!strip && labelled && !form)
@@ -48,7 +48,7 @@ export function BtnGroup({ look = 'frame', label, labelled, form, select, value,
48
48
  });
49
49
  });
50
50
  if (strip)
51
- return _jsx("div", { role: "tablist", "aria-label": label, className: cx('segment', look === 'choice' && 'segment--choice', className), ...rest, children: items });
51
+ return _jsx("div", { role: "tablist", "aria-label": label, className: cx('segment', look === 'choice' && 'segment--choice', look === 'choice' && form && 'segment--form', className), ...rest, children: items });
52
52
  const panel = (_jsx("div", { role: "group", "aria-label": line ? undefined : label, "aria-labelledby": line ? words : undefined, className: cx('icon-btn-group', form && 'icon-btn-group--form', vertical && !form && 'icon-btn-group--vertical', !line && className), ...(line ? {} : rest), children: items }));
53
53
  if (!line)
54
54
  return panel;