@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 +13 -0
- package/css/stamp.css +10 -8
- package/css/tokens.css +1 -0
- package/dist/cardds.css +11 -8
- package/dist/cards/Card.d.ts +3 -1
- package/dist/cards/Card.js +9 -1
- package/dist/catalog.json +1 -1
- package/dist/stamp/Stamp.d.ts +6 -3
- package/dist/stamp/Stamp.js +4 -3
- package/dist/stamp/StampOn.d.ts +1 -1
- package/docs/reference.md +14 -4
- package/package.json +1 -1
package/dist/stamp/Stamp.d.ts
CHANGED
|
@@ -11,8 +11,10 @@ export interface StampProps extends Omit<ComponentProps<'span'>, 'onClick'> {
|
|
|
11
11
|
words?: ReactNode;
|
|
12
12
|
/** the pictures alone: `name` and `words` are not drawn. For a stamp stuck on something (a postcard's corner); in a `StampOn` every stamp is bare already. The words are for the album */
|
|
13
13
|
bare?: boolean;
|
|
14
|
-
/** the inline size: a stamp beside a status line's words (a card's `Foot`: the stamp, "X took it", a round button), one `Chip xs` tall (`--stamp-xs-size`). Always bare and flat
|
|
14
|
+
/** the inline size: a stamp beside a status line's words (a card's `Foot`: the stamp, "X took it", a round button), one `Chip xs` tall (`--stamp-xs-size`). Always bare and flat: only the thin contact shadow every stamp has. Several, lapped with a "+8": `AvatarStack more` */
|
|
15
15
|
xs?: boolean;
|
|
16
|
+
/** the paper's edge: `'perforated'` (default) the punched teeth, `'plain'` a smooth rectangle of paper with no teeth — the same 4:5 size and shadow, at every size and in every holder */
|
|
17
|
+
edge?: 'perforated' | 'plain';
|
|
16
18
|
/** kept back: the stamp keeps its box and draws nothing, hidden from screen readers too — until the app is ready to show it; when this turns false it appears in the same box, so nothing beside it moves */
|
|
17
19
|
held?: boolean;
|
|
18
20
|
/** in a `Head`: the words keep no room for the stamp — they run the head's whole width and lie OVER it, the stamp in its place and size at the right under them (a long title that would wrap in the column beside it). Never hides a word */
|
|
@@ -27,15 +29,16 @@ export interface StampProps extends Omit<ComponentProps<'span'>, 'onClick'> {
|
|
|
27
29
|
onArrived?: () => void;
|
|
28
30
|
}
|
|
29
31
|
/**
|
|
30
|
-
* Stamp — a
|
|
32
|
+
* Stamp — a paper stamp, 4:5, perforated (or `edge="plain"`): the pictures fill the inner frame on a tone, the words sit on the picture's foot.
|
|
31
33
|
* Every stamp is ONE size wherever it stands (`--stamp-size`, two taps wide: 96 × 120) — what holds it only places it; a holder narrower than that shows it whole, smaller.
|
|
32
34
|
* The one small stamp is a stamp stuck on something (`StampOn`); `xs` is the inline one, beside a status line's words. Every inner length follows the stamp's width.
|
|
33
35
|
* The outer box holds the size and the shadow; the paper inside is the one whose edge is punched (a mask would cut the shadow too).
|
|
36
|
+
* Every stamp, at every size and wherever it stands, has a thin contact shadow (`--stamp-shadow`): its edge shows on any ground, a white one too.
|
|
34
37
|
* With `arrive` the stamp that stands in its place (the head of a card, `end={<Stamp arrive …/>}`) is struck onto it when the member sends, and `onArrived` tells
|
|
35
38
|
* the app it has landed, so it sends. The strike scales it down from twice its size, so it never moves the layout (it may cover its neighbours for a moment);
|
|
36
39
|
* a `tilt` is kept, the stamp ends at its turn. Afterwards the same stamp stands in the same place with no strike: drop `arrive` or keep it, nothing is struck twice.
|
|
37
40
|
*/
|
|
38
|
-
export declare function Stamp({ pictures, tone, name, words, bare, xs, held, under, tilt, onClick, arrive, onArrived, className, onAnimationEnd, ...rest }: StampProps): import("react").JSX.Element;
|
|
41
|
+
export declare function Stamp({ pictures, tone, name, words, bare, xs, edge, held, under, tilt, onClick, arrive, onArrived, className, onAnimationEnd, ...rest }: StampProps): import("react").JSX.Element;
|
|
39
42
|
export interface StampPlaceProps extends Omit<ComponentProps<'span'>, 'onClick'> {
|
|
40
43
|
/** a gap nobody is asked to fill: a paler edge (an album's free places) */
|
|
41
44
|
faint?: boolean;
|
package/dist/stamp/Stamp.js
CHANGED
|
@@ -3,19 +3,20 @@ import { cx } from '../cx.js';
|
|
|
3
3
|
import { pressable } from '../pressable.js';
|
|
4
4
|
import { useStrike } from './useStrike.js';
|
|
5
5
|
/**
|
|
6
|
-
* Stamp — a
|
|
6
|
+
* Stamp — a paper stamp, 4:5, perforated (or `edge="plain"`): the pictures fill the inner frame on a tone, the words sit on the picture's foot.
|
|
7
7
|
* Every stamp is ONE size wherever it stands (`--stamp-size`, two taps wide: 96 × 120) — what holds it only places it; a holder narrower than that shows it whole, smaller.
|
|
8
8
|
* The one small stamp is a stamp stuck on something (`StampOn`); `xs` is the inline one, beside a status line's words. Every inner length follows the stamp's width.
|
|
9
9
|
* The outer box holds the size and the shadow; the paper inside is the one whose edge is punched (a mask would cut the shadow too).
|
|
10
|
+
* Every stamp, at every size and wherever it stands, has a thin contact shadow (`--stamp-shadow`): its edge shows on any ground, a white one too.
|
|
10
11
|
* With `arrive` the stamp that stands in its place (the head of a card, `end={<Stamp arrive …/>}`) is struck onto it when the member sends, and `onArrived` tells
|
|
11
12
|
* the app it has landed, so it sends. The strike scales it down from twice its size, so it never moves the layout (it may cover its neighbours for a moment);
|
|
12
13
|
* a `tilt` is kept, the stamp ends at its turn. Afterwards the same stamp stands in the same place with no strike: drop `arrive` or keep it, nothing is struck twice.
|
|
13
14
|
*/
|
|
14
|
-
export function Stamp({ pictures, tone = 'custard', name, words, bare, xs, held, under, tilt, onClick, arrive, onArrived, className, onAnimationEnd, ...rest }) {
|
|
15
|
+
export function Stamp({ pictures, tone = 'custard', name, words, bare, xs, edge, held, under, tilt, onClick, arrive, onArrived, className, onAnimationEnd, ...rest }) {
|
|
15
16
|
const shown = pictures.slice(0, 4);
|
|
16
17
|
const { struck } = useStrike(arrive, onArrived, onAnimationEnd);
|
|
17
18
|
const { tap, Box, boxProps } = pressable(onClick, 'span', rest);
|
|
18
|
-
return (_jsx(Box, { className: cx('stamp', `stamp--${shown.length}`, bare && 'stamp--bare', xs && 'stamp--xs', held && 'stamp--held', under && 'stamp--under', tilt && `stamp--tilt-${tilt}`, tap && 'stamp--tap', arrive && 'stamp--arrive', className), onAnimationEnd: struck, "aria-hidden": held || undefined, ...boxProps, children: _jsx("span", { className: "stamp__paper", children: _jsxs("span", { className: cx('stamp__pic', `sticky--${tone}`), children: [shown.map((picture, i) => _jsx("span", { className: "stamp__art", "aria-hidden": "true", children: picture }, i)), (name != null || words != null) && (_jsxs("span", { className: "stamp__cap", children: [words != null && _jsx("span", { className: "stamp__words", children: words }), name != null && _jsx("span", { className: "stamp__name", children: name })] }))] }) }) }));
|
|
19
|
+
return (_jsx(Box, { className: cx('stamp', `stamp--${shown.length}`, bare && 'stamp--bare', xs && 'stamp--xs', edge === 'plain' && 'stamp--plain', held && 'stamp--held', under && 'stamp--under', tilt && `stamp--tilt-${tilt}`, tap && 'stamp--tap', arrive && 'stamp--arrive', className), onAnimationEnd: struck, "aria-hidden": held || undefined, ...boxProps, children: _jsx("span", { className: "stamp__paper", children: _jsxs("span", { className: cx('stamp__pic', `sticky--${tone}`), children: [shown.map((picture, i) => _jsx("span", { className: "stamp__art", "aria-hidden": "true", children: picture }, i)), (name != null || words != null) && (_jsxs("span", { className: "stamp__cap", children: [words != null && _jsx("span", { className: "stamp__words", children: words }), name != null && _jsx("span", { className: "stamp__name", children: name })] }))] }) }) }));
|
|
19
20
|
}
|
|
20
21
|
/**
|
|
21
22
|
* StampPlace — an empty place for a stamp: a 4:5 frame of round dots the size a Stamp is (`--stamp-size`), a word or an Icon inside.
|
package/dist/stamp/StampOn.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export interface StampOnProps extends ComponentProps<'div'> {
|
|
|
23
23
|
removeFor?: number;
|
|
24
24
|
/** the stamp at the stamp's MAIN size, 96 × 120 (`--stamp-size`), to cover what it lies on; the default is the small size, 48 × 60 (`--stamp-sm-size`), which leaves a note's words readable */
|
|
25
25
|
main?: boolean;
|
|
26
|
-
/** UNDER A CARD'S WORDS: the stamp at the main size, 96 × 120, laid at the top right corner of the card (or of its face), stacked LOWEST inside it so the badge, the chips and the words are all drawn over it and none is hidden.
|
|
26
|
+
/** UNDER A CARD'S WORDS: the stamp at the main size, 96 × 120, laid at the top right corner of the card (or of its face), stacked LOWEST inside it so the badge, the chips and the words are all drawn over it and none is hidden. Only the thin contact shadow, no drag (`at` and `onAtChange` are ignored), and a press on it falls through to the card; `turn` and `arrive` work as on any stamp. Put it as a direct child of the `Card` */
|
|
27
27
|
under?: boolean;
|
|
28
28
|
/** the stamp sticks ITSELF: as it comes onto the screen it is struck onto its place (shown large, pressed down to its size). Nobody
|
|
29
29
|
* picked it or pressed to stick it — the app shows it when its own move (send) begins. With `onArrived`. A stamp that already stands in a card's head or a centre, where the layout put it, is `Stamp arrive` instead */
|
package/docs/reference.md
CHANGED
|
@@ -240,6 +240,14 @@ end. Its words follow four rules (Lh 2026-10-24):
|
|
|
240
240
|
</Rows>
|
|
241
241
|
```
|
|
242
242
|
|
|
243
|
+
### A card that starts in view
|
|
244
|
+
|
|
245
|
+
`Card startInView` brings the card into view in its scroller once, when it mounts: no motion, `block: 'nearest'`
|
|
246
|
+
(a card already in sight does not move the list). A screen the app draws again (the member comes back from another
|
|
247
|
+
one) lands on the card they left from, and the app holds no ref or id to it and adds no markup. Mark one card; set
|
|
248
|
+
later, the prop does nothing. A screen's bottom bar is measured after the card mounts, so the card looks again one frame
|
|
249
|
+
later and stands clear of it. `Card` forwards `ref` to its root for anything else the app wants of it. Story `Card · StartsInView`.
|
|
250
|
+
|
|
243
251
|
## Sheet stack markup
|
|
244
252
|
|
|
245
253
|
The sheet stack (`.sheet-stack`, `stack.css` — the menu, see *Anatomy*) is the
|
|
@@ -823,7 +831,7 @@ ground of my own stamp.
|
|
|
823
831
|
A stamp is a small paper picture a member keeps and sticks on a note or a postcard for a neighbour. Sending never uses
|
|
824
832
|
it up. cardds draws the paper; the pictures, their words and which stamp a member owns are the app's.
|
|
825
833
|
|
|
826
|
-
- **`Stamp`** — a perforated 4:5 stamp. `pictures` is one to four nodes, the app's own art (an svg, an img), in placement
|
|
834
|
+
- **`Stamp`** — a perforated 4:5 stamp; `edge="plain"` is a smooth rectangle of paper with no teeth, the same size and shadow, wherever a stamp goes (`xs`, `tilt`, `arrive`, `onClick`, a `StampOn`, a `StampBook`, an `AvatarStack`). `pictures` is one to four nodes, the app's own art (an svg, an img), in placement
|
|
827
835
|
order: the stamp places, sizes and turns them by how many there are. `tone` is the ground, one of `STICKY_TONES` (the
|
|
828
836
|
same list and the same `--sticky-<tone>-bg` knobs as a note's paper). `name` is the big line on the picture's foot,
|
|
829
837
|
`words` the small line above it. `tilt` turns it, `onClick` makes the whole stamp a button. Every inner length follows
|
|
@@ -834,16 +842,18 @@ it up. cardds draws the paper; the pictures, their words and which stamp a membe
|
|
|
834
842
|
stamp, or on an element for the stamps inside it. There is one other size, the small one: a stamp in a `StampOn` and a
|
|
835
843
|
stamp in an `AvatarStack` are `--stamp-sm-size` wide (one tap: 48 × 60), on any surface and in any row. And the inline
|
|
836
844
|
one: `Stamp xs` stands beside a status line's words (a card's `Foot`: the stamp, "X took it", a round button), one
|
|
837
|
-
`Chip xs` tall, `--stamp-xs-size` (18.7 × 23.4, on `--fs-base`); always bare,
|
|
845
|
+
`Chip xs` tall, `--stamp-xs-size` (18.7 × 23.4, on `--fs-base`); always bare, flat but for the contact shadow, its teeth fewer and larger.
|
|
838
846
|
Several lap in an `AvatarStack` with `more` ("+8"), the count then at the chip's scale. In a card's head band the stamp keeps the head's padding below it as well as above (`--card-pad`, not the seam), so the head is never shorter
|
|
839
847
|
than the stamp plus its padding, plain or `under`. A stamp the app is not ready to show yet is `held`: it keeps its box, draws nothing,
|
|
840
848
|
is hidden from screen readers, and appears in the same box when `held` turns false, so nothing beside it moves (any size). The stamps in
|
|
841
849
|
a `PostDesk`'s tray are the standard size. One exception, by the owner's decision: the stamp at a postcard's corner is
|
|
842
850
|
the postcard's own size, 72 × 90 (`--post-corner-stamp-w`), in neither. `words` is not drawn on a stamp 96 wide or
|
|
843
851
|
narrower, so at the standard size only `name` shows, and it is larger.
|
|
844
|
-
- **
|
|
852
|
+
- **Every stamp has a thin contact shadow** (2026-10-26): at every size, `xs` and a `StampOn` too, on a card or off it — paper a hair off
|
|
853
|
+
its ground, so its edge shows on any ground, a white one included (`--shadow-contact`, knob `--stamp-shadow`). What follows is the shadow it gets on top of that.
|
|
854
|
+
- **A stamp on a card lies flat** (Lh 2026-10-24): no lift, only the contact shadow, at every size — a `FeedCard`'s lead, a
|
|
845
855
|
`Foot` row's, `xs`. A stamp in a card's head is glued down (Lh 2026-10-25): plain, `under` or `sm`, a hair of shadow
|
|
846
|
-
under paper (`--shadow-glued`, knob `--stamp-under-drop`); `bare` and `xs` stay flat. One rule by where it stands (`stamp.css`), nothing to pass. A stamp off a card keeps its shadow: the
|
|
856
|
+
under paper (`--shadow-glued`, knob `--stamp-under-drop`); `bare` and `xs` stay flat (contact shadow only). One rule by where it stands (`stamp.css`), nothing to pass. A stamp off a card keeps its shadow: the
|
|
847
857
|
album (`StampBook`, also in a card or a sheet), the tray, a `PostDesk`, a start screen's stamp, a postcard's corner, a
|
|
848
858
|
stamp stuck on a note. A sheet is not "on a card" here: what a sheet holds keeps its shadow.
|
|
849
859
|
- **`StampPlace`** — an empty place the size of a stamp, its edge a ring of round dots: a word inside, `onClick` for "make
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usableapp/cardds",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.138",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "card-first mobile design system, React-first: the components in src/ are thin wrappers over the CSS contract (css/*.css stays the only truth); gallery/ shows every story live (npm run dev).",
|