@usableapp/cardds 0.7.137 → 0.7.138

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/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  > For: a project that consumes `@usableapp/cardds` and its AI — what changed between versions, written as before → after, so a screen can be brought up to date without reading the source. Newest first. A consumer never edits cardds; if something here leaves you without a way to do what you did before, report the gap. Each release section after 0.7.97 carries one `Components:` line, written by `node scripts/components-changed.mjs <previous tag>`: the components the release changed, or `all` when a file changed that any component can read (a token, the build), or `none`; check only the screens that import those.
4
4
 
5
+ ## 0.7.138 — 2026-10-26
6
+
7
+ Every stamp has a thin contact shadow, and a stamp can be plain paper with no teeth. A card can bring itself into view when a screen is drawn again.
8
+
9
+ Components: all
10
+
11
+ ### Added
12
+ - **`Stamp edge="plain"`**: a smooth rectangle of paper with no perforation. It keeps the same 4:5 size, frame and shadow. `edge?: 'perforated' | 'plain'` defaults to `'perforated'` (today's teeth). It works bare, `xs`, `tilt`, `arrive`, `onClick`, and in `StampOn`, `StampBook` and `AvatarStack`.
13
+ - **`Card startInView`**: the card scrolls itself into view in its scroller once, at mount (`block: 'nearest'`, no motion). Setting it later does nothing. A screen drawn again lands on the card the member left from, with no ref or id of the app's. Card already forwards `ref`.
14
+
15
+ ### Changed
16
+ - **Every stamp has a thin contact shadow** (knob `--stamp-shadow`, token `--shadow-contact`), so its edge shows on any ground, a white one too. Before, `xs`, a stamp on a card and `StampOn under` had no shadow at all; now each has this one shadow, and the others keep their lift on top of it. The JSX is unchanged.
17
+
5
18
  ## 0.7.137 — 2026-10-25
6
19
 
7
20
  An icon in a `Link` fills the line of its words. It is centred on the Thai letter band, and the X is judged as well as the pencil.
package/css/stamp.css CHANGED
@@ -35,7 +35,7 @@
35
35
  display: block;
36
36
  container-type: inline-size;
37
37
  color: var(--stamp-ink, var(--ink-onlight));
38
- filter: drop-shadow(var(--stamp-drop, var(--shadow-paper))); /* drop-shadow follows the teeth; a box-shadow would draw the rectangle */
38
+ filter: drop-shadow(var(--stamp-shadow, var(--shadow-contact))) drop-shadow(var(--stamp-drop, var(--shadow-paper))); /* drop-shadow follows the teeth; a box-shadow would draw the rectangle. The first is the contact shadow every stamp keeps, the second the lift a stamp off a card adds */
39
39
  rotate: var(--stamp-turn, none);
40
40
  animation: var(--stamp-arrive, none);
41
41
  }
@@ -50,6 +50,8 @@
50
50
  mask: linear-gradient(#000 0 0) center / calc(100% - var(--_pitch)) calc(100% - var(--_pitch)) no-repeat,
51
51
  radial-gradient(circle, transparent var(--_hole), #000 calc(var(--_hole) + 0.4cqw)) calc(var(--_pitch) / -2) calc(var(--_pitch) / -2) / var(--_pitch) var(--_pitch);
52
52
  }
53
+ /* --plain: a smooth rectangle of paper, no teeth (`edge="plain"`) — the same 4:5, the same frame, the same shadow */
54
+ .stamp--plain .stamp__paper { -webkit-mask: none; mask: none; }
53
55
  .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 */
54
56
 
55
57
  /* the pictures, placed by COUNT: where, how wide, how far turned — the layout is the stamp's look, never the app's.
@@ -85,10 +87,10 @@
85
87
 
86
88
  /* --xs: the stamp INLINE with a status line (a card's foot: the stamp, "X took it", a round button) — one caption line tall,
87
89
  --stamp-xs-size (18.7 × 23.4 at the default bases, one Chip xs tall, on --fs-base: it follows the words it stands with; Lh 2026-10-24).
88
- Too small for words: it is bare whatever it is handed. No shadow (Lh): it lies flat in the line. The teeth are fewer and larger (8 across,
90
+ 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 fewer and larger (8 across,
89
91
  10 down) so they still read, and the frame round the picture wider to clear them. Several, lapped, with a "+8": AvatarStack (below).
90
92
  <span class="stamp stamp--1 stamp--xs">…</span> */
91
- .stamp--xs { width: var(--stamp-xs-size, var(--stamp-xs)); flex: none; margin-inline: 0; filter: none; }
93
+ .stamp--xs { width: var(--stamp-xs-size, var(--stamp-xs)); flex: none; margin-inline: 0; filter: drop-shadow(var(--stamp-shadow, var(--shadow-contact))); }
92
94
  .stamp--xs .stamp__paper { --_pitch: calc(100cqw / 8); --_hole: 3.9cqw; }
93
95
  .stamp--xs .stamp__pic { inset: var(--stamp-frame, 12cqw); }
94
96
  /* 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 */
@@ -240,7 +242,7 @@
240
242
  After the rule above, at the same weight: `main` is the one place a stuck stamp reads --stamp-size. */
241
243
  .stamp-on--main > .stamp { width: var(--stamp-size, calc(var(--tap) * 2)); }
242
244
  .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 */
243
- .stamp-on--under > .stamp { width: var(--stamp-size, calc(var(--tap) * 2)); filter: none; }
245
+ .stamp-on--under > .stamp { width: var(--stamp-size, calc(var(--tap) * 2)); filter: drop-shadow(var(--stamp-shadow, var(--shadow-contact))); }
244
246
  .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) */
245
247
  .stamp-on--move { cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; transition: scale var(--motion-press) var(--ease-out); }
246
248
  .stamp-on--move:focus-visible { outline: var(--focus); outline-offset: var(--sp-1); }
@@ -291,13 +293,13 @@
291
293
  }
292
294
 
293
295
  /* ---- where it sits in what card.css draws (docs/reference.md rule 15) ---- */
294
- /* a stamp ON a card lies flat: no shadow, at every size (Lh 2026-10-24) — a feed card's lead, a foot row's, xs.
296
+ /* 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.
295
297
  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
296
298
  does a stamp in an album's cell wherever the album lies */
297
- .card:not(.sheet) .stamp:not(.stamp-cell > .stamp) { filter: none; }
299
+ .card:not(.sheet) .stamp:not(.stamp-cell > .stamp) { filter: drop-shadow(var(--stamp-shadow, var(--shadow-contact))); }
298
300
  /* 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.
299
- A bare or xs stamp stays flat. Knob: --stamp-under-drop (the name it was born with: `under` had it first) */
300
- .card:not(.sheet) .head > .stamp:not(.stamp--bare, .stamp--xs) { filter: drop-shadow(var(--stamp-under-drop, var(--shadow-glued))); }
301
+ 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) */
302
+ .card:not(.sheet) .head > .stamp:not(.stamp--bare, .stamp--xs) { filter: drop-shadow(var(--stamp-shadow, var(--shadow-contact))) drop-shadow(var(--stamp-under-drop, var(--shadow-glued))); }
301
303
  .head > .stamp { grid-column: 2; grid-row: 1 / span 2; margin-inline: 0; }
302
304
  .head > .stamp--under { grid-column: 1; justify-self: end; } /* `under`: in the words' own column, at its end, the words over it (parts.css) */
303
305
  /* ---- where it sits in what people.css draws (docs/reference.md rule 15) ---- */
package/css/tokens.css CHANGED
@@ -338,6 +338,7 @@
338
338
  /* shadows of paper laid on paper: mixed from the onlight ink, so re-derived where a palette is set */
339
339
  --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) */
340
340
  --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 */
341
+ --shadow-contact: 0 0 var(--border-w) rgb(0 0 0 / 0.4); /* paper a hair off its ground, every side: the edge a stamp has on any ground, a white one too; black as the scrim, no color-mix (iOS 16.4) */
341
342
  --shadow-glued: 0 var(--border-w) var(--border-w) rgb(0 0 0 / 0.22); /* a stamp glued flat on its card, a hair raised (Lh 2026-10-25): one border's offset and blur, black as the scrim; no color-mix (iOS 16.4) */
342
343
  --shadow-fold: calc(-1 * var(--sp-0)) calc(-1 * var(--sp-0)) var(--sp-1) color-mix(in srgb, var(--ink-onlight) 8%, transparent); /* a note's folded corner */
343
344
  --on-surface: color-mix(in srgb, var(--ink-ondark) calc(var(--surface-dark) * 100%), var(--ink-onlight));
package/dist/cardds.css CHANGED
@@ -379,6 +379,7 @@
379
379
  /* shadows of paper laid on paper: mixed from the onlight ink, so re-derived where a palette is set */
380
380
  --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) */
381
381
  --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 */
382
+ --shadow-contact: 0 0 var(--border-w) rgb(0 0 0 / 0.4); /* paper a hair off its ground, every side: the edge a stamp has on any ground, a white one too; black as the scrim, no color-mix (iOS 16.4) */
382
383
  --shadow-glued: 0 var(--border-w) var(--border-w) rgb(0 0 0 / 0.22); /* a stamp glued flat on its card, a hair raised (Lh 2026-10-25): one border's offset and blur, black as the scrim; no color-mix (iOS 16.4) */
383
384
  --shadow-fold: calc(-1 * var(--sp-0)) calc(-1 * var(--sp-0)) var(--sp-1) color-mix(in srgb, var(--ink-onlight) 8%, transparent); /* a note's folded corner */
384
385
  --on-surface: color-mix(in srgb, var(--ink-ondark) calc(var(--surface-dark) * 100%), var(--ink-onlight));
@@ -5166,7 +5167,7 @@ button.calendar__label:focus-visible { outline: var(--focus); outline-offset: va
5166
5167
  display: block;
5167
5168
  container-type: inline-size;
5168
5169
  color: var(--stamp-ink, var(--ink-onlight));
5169
- filter: drop-shadow(var(--stamp-drop, var(--shadow-paper))); /* drop-shadow follows the teeth; a box-shadow would draw the rectangle */
5170
+ filter: drop-shadow(var(--stamp-shadow, var(--shadow-contact))) drop-shadow(var(--stamp-drop, var(--shadow-paper))); /* drop-shadow follows the teeth; a box-shadow would draw the rectangle. The first is the contact shadow every stamp keeps, the second the lift a stamp off a card adds */
5170
5171
  rotate: var(--stamp-turn, none);
5171
5172
  animation: var(--stamp-arrive, none);
5172
5173
  }
@@ -5181,6 +5182,8 @@ button.calendar__label:focus-visible { outline: var(--focus); outline-offset: va
5181
5182
  mask: linear-gradient(#000 0 0) center / calc(100% - var(--_pitch)) calc(100% - var(--_pitch)) no-repeat,
5182
5183
  radial-gradient(circle, transparent var(--_hole), #000 calc(var(--_hole) + 0.4cqw)) calc(var(--_pitch) / -2) calc(var(--_pitch) / -2) / var(--_pitch) var(--_pitch);
5183
5184
  }
5185
+ /* --plain: a smooth rectangle of paper, no teeth (`edge="plain"`) — the same 4:5, the same frame, the same shadow */
5186
+ .stamp--plain .stamp__paper { -webkit-mask: none; mask: none; }
5184
5187
  .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 */
5185
5188
 
5186
5189
  /* the pictures, placed by COUNT: where, how wide, how far turned — the layout is the stamp's look, never the app's.
@@ -5216,10 +5219,10 @@ button.calendar__label:focus-visible { outline: var(--focus); outline-offset: va
5216
5219
 
5217
5220
  /* --xs: the stamp INLINE with a status line (a card's foot: the stamp, "X took it", a round button) — one caption line tall,
5218
5221
  --stamp-xs-size (18.7 × 23.4 at the default bases, one Chip xs tall, on --fs-base: it follows the words it stands with; Lh 2026-10-24).
5219
- Too small for words: it is bare whatever it is handed. No shadow (Lh): it lies flat in the line. The teeth are fewer and larger (8 across,
5222
+ 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 fewer and larger (8 across,
5220
5223
  10 down) so they still read, and the frame round the picture wider to clear them. Several, lapped, with a "+8": AvatarStack (below).
5221
5224
  <span class="stamp stamp--1 stamp--xs">…</span> */
5222
- .stamp--xs { width: var(--stamp-xs-size, var(--stamp-xs)); flex: none; margin-inline: 0; filter: none; }
5225
+ .stamp--xs { width: var(--stamp-xs-size, var(--stamp-xs)); flex: none; margin-inline: 0; filter: drop-shadow(var(--stamp-shadow, var(--shadow-contact))); }
5223
5226
  .stamp--xs .stamp__paper { --_pitch: calc(100cqw / 8); --_hole: 3.9cqw; }
5224
5227
  .stamp--xs .stamp__pic { inset: var(--stamp-frame, 12cqw); }
5225
5228
  /* 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 */
@@ -5371,7 +5374,7 @@ button.calendar__label:focus-visible { outline: var(--focus); outline-offset: va
5371
5374
  After the rule above, at the same weight: `main` is the one place a stuck stamp reads --stamp-size. */
5372
5375
  .stamp-on--main > .stamp { width: var(--stamp-size, calc(var(--tap) * 2)); }
5373
5376
  .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 */
5374
- .stamp-on--under > .stamp { width: var(--stamp-size, calc(var(--tap) * 2)); filter: none; }
5377
+ .stamp-on--under > .stamp { width: var(--stamp-size, calc(var(--tap) * 2)); filter: drop-shadow(var(--stamp-shadow, var(--shadow-contact))); }
5375
5378
  .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) */
5376
5379
  .stamp-on--move { cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; transition: scale var(--motion-press) var(--ease-out); }
5377
5380
  .stamp-on--move:focus-visible { outline: var(--focus); outline-offset: var(--sp-1); }
@@ -5422,13 +5425,13 @@ button.calendar__label:focus-visible { outline: var(--focus); outline-offset: va
5422
5425
  }
5423
5426
 
5424
5427
  /* ---- where it sits in what card.css draws (docs/reference.md rule 15) ---- */
5425
- /* a stamp ON a card lies flat: no shadow, at every size (Lh 2026-10-24) — a feed card's lead, a foot row's, xs.
5428
+ /* 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.
5426
5429
  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
5427
5430
  does a stamp in an album's cell wherever the album lies */
5428
- .card:not(.sheet) .stamp:not(.stamp-cell > .stamp) { filter: none; }
5431
+ .card:not(.sheet) .stamp:not(.stamp-cell > .stamp) { filter: drop-shadow(var(--stamp-shadow, var(--shadow-contact))); }
5429
5432
  /* 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.
5430
- A bare or xs stamp stays flat. Knob: --stamp-under-drop (the name it was born with: `under` had it first) */
5431
- .card:not(.sheet) .head > .stamp:not(.stamp--bare, .stamp--xs) { filter: drop-shadow(var(--stamp-under-drop, var(--shadow-glued))); }
5433
+ 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) */
5434
+ .card:not(.sheet) .head > .stamp:not(.stamp--bare, .stamp--xs) { filter: drop-shadow(var(--stamp-shadow, var(--shadow-contact))) drop-shadow(var(--stamp-under-drop, var(--shadow-glued))); }
5432
5435
  .head > .stamp { grid-column: 2; grid-row: 1 / span 2; margin-inline: 0; }
5433
5436
  .head > .stamp--under { grid-column: 1; justify-self: end; } /* `under`: in the words' own column, at its end, the words over it (parts.css) */
5434
5437
  /* ---- where it sits in what people.css draws (docs/reference.md rule 15) ---- */
@@ -59,6 +59,8 @@ export interface CardProps extends ComponentProps<'article'> {
59
59
  toBackLabel?: string;
60
60
  /** the spoken name of the back's hidden turn-over button (default: the words' `turnToFront`) */
61
61
  toFrontLabel?: string;
62
+ /** the card brings itself into view in its scroller ONCE, when it mounts (no motion, `block: 'nearest'`): a screen drawn again lands on the card the member left from, with no ref or id of the app's. Set later, it does nothing */
63
+ startInView?: boolean;
62
64
  /** the cross's spoken name (default: the words' `remove`) — name what goes: "Remove 'buy medicine'" */
63
65
  removeLabel?: string;
64
66
  }
@@ -73,7 +75,7 @@ export interface CardProps extends ComponentProps<'article'> {
73
75
  * TWO FACES (`back`): the whole card turns over on a tap off a control (the flip mechanic it shares with Postcard); the head and the foot
74
76
  * read the same on both faces, the middle is one fixed height. `paper="bands"`: paper head and foot bands edge to edge, the tint between.
75
77
  */
76
- export declare function Card({ tone, paper, sm, row, cover, fold, centre, band, as, stack, leave, onLeft, onRemove, removeLabel, back, face, defaultFace, onFaceChange, toBackLabel, toFrontLabel, className, style, children, onClick, ref, ...rest }: CardProps): import("react").DetailedReactHTMLElement<{
78
+ export declare function Card({ tone, paper, sm, row, cover, fold, centre, band, as, stack, leave, onLeft, onRemove, removeLabel, back, face, defaultFace, onFaceChange, toBackLabel, toFrontLabel, startInView, className, style, children, onClick, ref, ...rest }: CardProps): import("react").DetailedReactHTMLElement<{
77
79
  onClick: (e: MouseEvent<HTMLElement>) => void;
78
80
  inert?: boolean | undefined;
79
81
  "aria-busy"?: (boolean | "true" | "false") | undefined;
@@ -19,7 +19,7 @@ import { StackHeadCtx, StackPullCtx, ownHead, stackPaint, useStackCard } from '.
19
19
  * TWO FACES (`back`): the whole card turns over on a tap off a control (the flip mechanic it shares with Postcard); the head and the foot
20
20
  * read the same on both faces, the middle is one fixed height. `paper="bands"`: paper head and foot bands edge to edge, the tint between.
21
21
  */
22
- export function Card({ tone, paper, sm, row, cover, fold, centre, band, as = 'article', stack, leave, onLeft, onRemove, removeLabel, back, face, defaultFace = 'front', onFaceChange, toBackLabel, toFrontLabel, className, style, children, onClick, ref, ...rest }) {
22
+ export function Card({ tone, paper, sm, row, cover, fold, centre, band, as = 'article', stack, leave, onLeft, onRemove, removeLabel, back, face, defaultFace = 'front', onFaceChange, toBackLabel, toFrontLabel, startInView, className, style, children, onClick, ref, ...rest }) {
23
23
  if (onRemove && !row)
24
24
  warnOnce('card-remove-row', 'cardds Card: `onRemove` draws its cross on a `row` card only');
25
25
  if (back != null && (row || sm || stack))
@@ -39,6 +39,14 @@ export function Card({ tone, paper, sm, row, cover, fold, centre, band, as = 'ar
39
39
  else if (passed)
40
40
  passed.current = node;
41
41
  };
42
+ useLayoutEffect(() => {
43
+ if (!startInView)
44
+ return;
45
+ const show = () => own.current?.scrollIntoView({ block: 'nearest', behavior: 'instant' });
46
+ show();
47
+ let frame = requestAnimationFrame(() => { frame = requestAnimationFrame(show); });
48
+ return () => cancelAnimationFrame(frame);
49
+ }, []);
42
50
  const leaver = leave != null && !stack;
43
51
  const away = leaver && leave;
44
52
  const left = useLatest(onLeft);