@usableapp/cardds 0.7.76 → 0.7.77
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/README.md +8 -2
- package/css/card.css +9 -0
- package/css/stamp.css +31 -8
- package/dist/cardds.css +40 -8
- package/dist/catalog.json +1 -1
- package/dist/stamp/Stamp.d.ts +5 -2
- package/dist/stamp/Stamp.js +6 -3
- package/dist/stamp/StampBook.js +1 -1
- package/package.json +1 -1
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.
|
|
4
4
|
|
|
5
|
+
## 0.7.77 — 2026-10-10
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **A neighbour as one card: `Card heading caption end={<Stamp/>} foot`** (timebank, 2026-10-09) — the words at the left, a large stamp at the right, the one button in the foot. Before → after: a `CardHead` with a hand-written `<div>` of two `Text`s and a `Stamp` with `--stamp-max-w` in a `style` (the stamp had no width in a head: it takes the head's whole width up to its cap) → `<Card heading={name} caption={greeting} end={<Stamp bare {...art} />} foot={<Btn primary block>…</Btn>} />`, no markup and no `style`. The stamp is as tall as the heading and the caption together. New knob `--card-head-stamp-w` (the stamp's width in a head; default two taps). The card's only control is the foot's button, so a touch anywhere presses it; the stamp is a picture, not a button. The same goes for a `CardHead` of your own with a `Stamp` as a direct child. Story `StampScreens · Neighbours`.
|
|
9
|
+
- **`StampPlace` in a `Centre`** — a neighbour with no stamp yet: `<Centre><StampPlace>…</StampPlace><Text>…</Text><Link>…</Link></Centre>`. Before → after: the frame was centred but the name and the link stood at the left, and its size was the plain cap → it takes the size a `Stamp` takes there (`--stamp-centre-max-w`) and the words and the link centre under it, as under a stamp. Story `StampScreens · NoStampYet`.
|
|
10
|
+
- **`--stamp-place-dash`, `--stamp-place-gap`** — the dashes of a `StampPlace`'s edge: how long each dash is, and the gap between (defaults `--sp-2` and `--sp-3`).
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- **The dashes of a `StampPlace` stand further apart** (Lh 2026-10-09) — the edge was a CSS dashed border (the browser's dash and gap: 6px dash and 4px gap in Chrome, 6px and 6px in Safari, at 2px wide). Before → after: the same edge drawn as a stroke with a gap of 12px and a dash of 8px, still round at `--stamp-place-radius`, the same colours (`--stamp-place-border`, `--stamp-place-faint-border`, a card's muted ink), the same 4:5 size, the words and icon inside where they were. A project that drew the edge itself with `border-style` on `.stamp-place` sets `--stamp-place-border` or the two new knobs instead: its border is now clear. A `StampPlace` has an `<svg aria-hidden>` as its first child.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
- **`StampBook places={9}` drew eight places when a child was `false` or `null`** (timebank, 2026-10-09) — `{owned && <StampCell/>}` that was `false` still counted as a place, so one empty place too few was drawn. Before → after: nine boxes (the cells that render, the rest empty). Story `StampBook · Conditional`.
|
|
17
|
+
|
|
5
18
|
## 0.7.76 — 2026-10-09
|
|
6
19
|
|
|
7
20
|
### Changed
|
package/README.md
CHANGED
|
@@ -543,10 +543,16 @@ it up. cardds draws the paper; the pictures, their words and which stamp a membe
|
|
|
543
543
|
`words` the small line above it. `tilt` turns it, `onClick` makes the whole stamp a button. It fills its column up to
|
|
544
544
|
`--stamp-max-w`, and every inner length follows its width, so one stamp reads in a tray and in a sheet.
|
|
545
545
|
- **`StampPlace`** — an empty dashed place the size of a stamp: a word inside, `onClick` for "make yours", `faint` for a
|
|
546
|
-
gap nobody is asked to fill.
|
|
546
|
+
gap nobody is asked to fill. The edge is a drawn stroke, so its dashes are yours: `--stamp-place-dash` and
|
|
547
|
+
`--stamp-place-gap` (defaults 8px and 12px), its corner is `--stamp-place-radius`.
|
|
547
548
|
- **`StampBook`** + **`StampCell`** — the album page: cells three across on an album ground, a `label` under each stamp,
|
|
548
549
|
the free places drawn up to `places`. A cell with `onClick` is a button; `on` marks it pressed. `strip` is one line
|
|
549
|
-
of small stamps that scrolls sideways, the tray a member picks from.
|
|
550
|
+
of small stamps that scrolls sideways, the tray a member picks from. A `false` or `null` child holds no place.
|
|
551
|
+
- A stamp stands for a person in three more places. In a `Centre` — a `Stamp` or a `StampPlace` — it takes the screen's
|
|
552
|
+
size and the words and link under it centre. In a card's head — `<Card heading={name} caption={greeting}
|
|
553
|
+
end={<Stamp bare …/>} foot={<Btn primary block>…</Btn>} />` — the words stand at the left and the stamp at the right,
|
|
554
|
+
as tall as both lines, `--card-head-stamp-w` wide (default two taps); the card's one button presses it whole. In an
|
|
555
|
+
`AvatarStack` it is a head (`more="+9"` for the count).
|
|
550
556
|
- **`StampOn`** — a stamp stuck on a surface. `at` is the stamp's middle as a share of the surface (`{ x, y }`, 0 to 1),
|
|
551
557
|
`turn` its angle in degrees. With `onAtChange` the member drags it (the arrow keys move it too) and it asks with the
|
|
552
558
|
new place when the finger lets go; without it the stamp is still. The surface is the nearest positioned box:
|
package/css/card.css
CHANGED
|
@@ -84,6 +84,15 @@
|
|
|
84
84
|
height, only the row gap. */
|
|
85
85
|
.card__head :is(h1, h2, h3) { overflow-wrap: anywhere; }
|
|
86
86
|
|
|
87
|
+
/* a Stamp in a card's head (`Card end={<Stamp …/>}`): the words stand at the left, the stamp at the right and AS TALL AS BOTH LINES — the heading and the
|
|
88
|
+
caption pair up beside it, not the stamp beside the heading alone with the caption left under it. A stamp has no size of its own in a flex
|
|
89
|
+
row (a width of 100% of the head, up to its cap), so it takes --card-head-stamp-w here, as a stamp in an AvatarStack takes a width of its own.
|
|
90
|
+
<div class="card__head"><h2 class="t-h2">…</h2><span class="t-caption t-muted">…</span><span class="stamp">…</span></div> */
|
|
91
|
+
.card__head:has(> .stamp) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
|
|
92
|
+
.card__head:has(> .stamp) > :is(h1, h2, h3) { grid-column: 1; grid-row: 1; align-self: end; }
|
|
93
|
+
.card__head:has(> .stamp) > :is(.t-caption, .t-body) { grid-column: 1; grid-row: 2; align-self: start; }
|
|
94
|
+
.card__head > .stamp { grid-column: 2; grid-row: 1 / span 2; width: var(--card-head-stamp-w, calc(var(--tap) * 2)); margin-inline: 0; }
|
|
95
|
+
|
|
87
96
|
/* ---- bleed: a scrolling track that runs to the container's edges ----
|
|
88
97
|
For a horizontal strip inside a padded container — .avatar-pick, .chip-row,
|
|
89
98
|
a tile grid: the TRACK reaches the edges so it reads as scrollable, while
|
package/css/stamp.css
CHANGED
|
@@ -82,29 +82,52 @@
|
|
|
82
82
|
/* --tap: the whole stamp is the button (`onClick`); the press and the ring are the PRESS list's (actions.css) */
|
|
83
83
|
.stamp--tap { appearance: none; border: 0; padding: 0; background: none; font: inherit; text-align: start; -webkit-tap-highlight-color: transparent; }
|
|
84
84
|
|
|
85
|
-
/* a stamp handed over in a Centre: sized by the SCREEN (a little over half its width inside the inset), its greeting centred under it */
|
|
86
|
-
.screen__centre:has(> .stamp) { justify-items: center; text-align: center; }
|
|
87
|
-
.screen__centre > .stamp { max-width: var(--stamp-centre-max-w, 56cqw); }
|
|
85
|
+
/* a stamp — or the empty place for one — handed over in a Centre: sized by the SCREEN (a little over half its width inside the inset), its greeting centred under it */
|
|
86
|
+
.screen__centre:has(> :is(.stamp, .stamp-place)) { justify-items: center; text-align: center; }
|
|
87
|
+
.screen__centre > :is(.stamp, .stamp-place) { max-width: var(--stamp-centre-max-w, 56cqw); }
|
|
88
88
|
/* in the room above a closed stack's heads the stamp is held by that room's HEIGHT too: its height at most 45% of it, so two lines of words under it
|
|
89
89
|
still fit on a short phone (320×568 left 253px for a group 314 tall — reported by timebank, 2026-10-07). cqh reads the base, a size container. */
|
|
90
|
-
.sheet-stack__base > .screen__centre > .stamp { max-width: min(var(--stamp-centre-max-w, 56cqw), 36cqh); }
|
|
90
|
+
.sheet-stack__base > .screen__centre > :is(.stamp, .stamp-place) { max-width: min(var(--stamp-centre-max-w, 56cqw), 36cqh); }
|
|
91
91
|
|
|
92
92
|
/* ---- stamp place: an empty place for a stamp — an album's gap, "make yours" ----
|
|
93
|
-
<span class="stamp-place">สร้าง</span> · <button class="stamp-place">…</button> · <span class="stamp-place stamp-place--faint"
|
|
93
|
+
<span class="stamp-place"><svg class="stamp-place__edge" aria-hidden="true"><rect/></svg>สร้าง</span> · <button class="stamp-place">…</button> · <span class="stamp-place stamp-place--faint">…</span>
|
|
94
|
+
The dashed edge is a <rect> of its own, not a border: a dashed border's dash and gap are the browser's to choose, a stroke's are two
|
|
95
|
+
knobs (--stamp-place-dash, --stamp-place-gap) and its corners still follow --stamp-place-radius. The element keeps a clear border
|
|
96
|
+
of the same width so what is inside sits where it did; the svg lies on that border, over it, and takes no part in the layout. */
|
|
94
97
|
.stamp-place {
|
|
98
|
+
position: relative;
|
|
95
99
|
display: grid;
|
|
96
100
|
place-content: center;
|
|
97
101
|
justify-items: center;
|
|
98
102
|
padding: var(--sp-1);
|
|
99
|
-
border: var(--rule-w)
|
|
103
|
+
border: var(--rule-w) solid transparent;
|
|
100
104
|
border-radius: var(--stamp-place-radius, var(--sp-2));
|
|
101
105
|
background: none;
|
|
102
106
|
color: var(--stamp-place-ink, var(--on-surface-muted));
|
|
103
107
|
font: var(--stamp-place-font, var(--type-caption));
|
|
104
108
|
text-align: center;
|
|
109
|
+
--_edge: var(--stamp-place-border, var(--on-surface-muted));
|
|
110
|
+
}
|
|
111
|
+
.stamp-place__edge {
|
|
112
|
+
position: absolute;
|
|
113
|
+
inset: calc(var(--rule-w) / -2) auto auto calc(var(--rule-w) / -2);
|
|
114
|
+
width: calc(100% + var(--rule-w));
|
|
115
|
+
height: calc(100% + var(--rule-w));
|
|
116
|
+
max-width: none; /* base.css caps every svg at its box */
|
|
117
|
+
overflow: visible; /* the stroke is centred on the rect's own edge: half of it falls outside the svg */
|
|
118
|
+
pointer-events: none;
|
|
119
|
+
}
|
|
120
|
+
.stamp-place__edge > rect {
|
|
121
|
+
width: 100%;
|
|
122
|
+
height: 100%;
|
|
123
|
+
rx: calc(var(--stamp-place-radius, var(--sp-2)) - var(--rule-w) / 2); /* the corner of the stroke's middle, so its outer edge is the radius */
|
|
124
|
+
fill: none;
|
|
125
|
+
stroke: var(--_edge);
|
|
126
|
+
stroke-width: var(--rule-w);
|
|
127
|
+
stroke-dasharray: var(--stamp-place-dash, var(--sp-2)) var(--stamp-place-gap, var(--sp-3));
|
|
105
128
|
}
|
|
106
|
-
.card .stamp-place, .post-paper .stamp-place {
|
|
107
|
-
.stamp-place--faint {
|
|
129
|
+
.card .stamp-place, .post-paper .stamp-place { --_edge: var(--stamp-place-border, var(--card-muted)); color: var(--stamp-place-ink, var(--card-muted)); }
|
|
130
|
+
.stamp-place--faint { --_edge: var(--stamp-place-faint-border, var(--hairline)); }
|
|
108
131
|
|
|
109
132
|
/* ---- stamp book: the album page — three stamps across on an album ground, who each is from under it ----
|
|
110
133
|
<div class="stamp-book">
|
package/dist/cardds.css
CHANGED
|
@@ -770,6 +770,15 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
|
|
|
770
770
|
height, only the row gap. */
|
|
771
771
|
.card__head :is(h1, h2, h3) { overflow-wrap: anywhere; }
|
|
772
772
|
|
|
773
|
+
/* a Stamp in a card's head (`Card end={<Stamp …/>}`): the words stand at the left, the stamp at the right and AS TALL AS BOTH LINES — the heading and the
|
|
774
|
+
caption pair up beside it, not the stamp beside the heading alone with the caption left under it. A stamp has no size of its own in a flex
|
|
775
|
+
row (a width of 100% of the head, up to its cap), so it takes --card-head-stamp-w here, as a stamp in an AvatarStack takes a width of its own.
|
|
776
|
+
<div class="card__head"><h2 class="t-h2">…</h2><span class="t-caption t-muted">…</span><span class="stamp">…</span></div> */
|
|
777
|
+
.card__head:has(> .stamp) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
|
|
778
|
+
.card__head:has(> .stamp) > :is(h1, h2, h3) { grid-column: 1; grid-row: 1; align-self: end; }
|
|
779
|
+
.card__head:has(> .stamp) > :is(.t-caption, .t-body) { grid-column: 1; grid-row: 2; align-self: start; }
|
|
780
|
+
.card__head > .stamp { grid-column: 2; grid-row: 1 / span 2; width: var(--card-head-stamp-w, calc(var(--tap) * 2)); margin-inline: 0; }
|
|
781
|
+
|
|
773
782
|
/* ---- bleed: a scrolling track that runs to the container's edges ----
|
|
774
783
|
For a horizontal strip inside a padded container — .avatar-pick, .chip-row,
|
|
775
784
|
a tile grid: the TRACK reaches the edges so it reads as scrollable, while
|
|
@@ -3996,29 +4005,52 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
|
|
|
3996
4005
|
/* --tap: the whole stamp is the button (`onClick`); the press and the ring are the PRESS list's (actions.css) */
|
|
3997
4006
|
.stamp--tap { appearance: none; border: 0; padding: 0; background: none; font: inherit; text-align: start; -webkit-tap-highlight-color: transparent; }
|
|
3998
4007
|
|
|
3999
|
-
/* a stamp handed over in a Centre: sized by the SCREEN (a little over half its width inside the inset), its greeting centred under it */
|
|
4000
|
-
.screen__centre:has(> .stamp) { justify-items: center; text-align: center; }
|
|
4001
|
-
.screen__centre > .stamp { max-width: var(--stamp-centre-max-w, 56cqw); }
|
|
4008
|
+
/* a stamp — or the empty place for one — handed over in a Centre: sized by the SCREEN (a little over half its width inside the inset), its greeting centred under it */
|
|
4009
|
+
.screen__centre:has(> :is(.stamp, .stamp-place)) { justify-items: center; text-align: center; }
|
|
4010
|
+
.screen__centre > :is(.stamp, .stamp-place) { max-width: var(--stamp-centre-max-w, 56cqw); }
|
|
4002
4011
|
/* in the room above a closed stack's heads the stamp is held by that room's HEIGHT too: its height at most 45% of it, so two lines of words under it
|
|
4003
4012
|
still fit on a short phone (320×568 left 253px for a group 314 tall — reported by timebank, 2026-10-07). cqh reads the base, a size container. */
|
|
4004
|
-
.sheet-stack__base > .screen__centre > .stamp { max-width: min(var(--stamp-centre-max-w, 56cqw), 36cqh); }
|
|
4013
|
+
.sheet-stack__base > .screen__centre > :is(.stamp, .stamp-place) { max-width: min(var(--stamp-centre-max-w, 56cqw), 36cqh); }
|
|
4005
4014
|
|
|
4006
4015
|
/* ---- stamp place: an empty place for a stamp — an album's gap, "make yours" ----
|
|
4007
|
-
<span class="stamp-place">สร้าง</span> · <button class="stamp-place">…</button> · <span class="stamp-place stamp-place--faint"
|
|
4016
|
+
<span class="stamp-place"><svg class="stamp-place__edge" aria-hidden="true"><rect/></svg>สร้าง</span> · <button class="stamp-place">…</button> · <span class="stamp-place stamp-place--faint">…</span>
|
|
4017
|
+
The dashed edge is a <rect> of its own, not a border: a dashed border's dash and gap are the browser's to choose, a stroke's are two
|
|
4018
|
+
knobs (--stamp-place-dash, --stamp-place-gap) and its corners still follow --stamp-place-radius. The element keeps a clear border
|
|
4019
|
+
of the same width so what is inside sits where it did; the svg lies on that border, over it, and takes no part in the layout. */
|
|
4008
4020
|
.stamp-place {
|
|
4021
|
+
position: relative;
|
|
4009
4022
|
display: grid;
|
|
4010
4023
|
place-content: center;
|
|
4011
4024
|
justify-items: center;
|
|
4012
4025
|
padding: var(--sp-1);
|
|
4013
|
-
border: var(--rule-w)
|
|
4026
|
+
border: var(--rule-w) solid transparent;
|
|
4014
4027
|
border-radius: var(--stamp-place-radius, var(--sp-2));
|
|
4015
4028
|
background: none;
|
|
4016
4029
|
color: var(--stamp-place-ink, var(--on-surface-muted));
|
|
4017
4030
|
font: var(--stamp-place-font, var(--type-caption));
|
|
4018
4031
|
text-align: center;
|
|
4032
|
+
--_edge: var(--stamp-place-border, var(--on-surface-muted));
|
|
4019
4033
|
}
|
|
4020
|
-
.
|
|
4021
|
-
|
|
4034
|
+
.stamp-place__edge {
|
|
4035
|
+
position: absolute;
|
|
4036
|
+
inset: calc(var(--rule-w) / -2) auto auto calc(var(--rule-w) / -2);
|
|
4037
|
+
width: calc(100% + var(--rule-w));
|
|
4038
|
+
height: calc(100% + var(--rule-w));
|
|
4039
|
+
max-width: none; /* base.css caps every svg at its box */
|
|
4040
|
+
overflow: visible; /* the stroke is centred on the rect's own edge: half of it falls outside the svg */
|
|
4041
|
+
pointer-events: none;
|
|
4042
|
+
}
|
|
4043
|
+
.stamp-place__edge > rect {
|
|
4044
|
+
width: 100%;
|
|
4045
|
+
height: 100%;
|
|
4046
|
+
rx: calc(var(--stamp-place-radius, var(--sp-2)) - var(--rule-w) / 2); /* the corner of the stroke's middle, so its outer edge is the radius */
|
|
4047
|
+
fill: none;
|
|
4048
|
+
stroke: var(--_edge);
|
|
4049
|
+
stroke-width: var(--rule-w);
|
|
4050
|
+
stroke-dasharray: var(--stamp-place-dash, var(--sp-2)) var(--stamp-place-gap, var(--sp-3));
|
|
4051
|
+
}
|
|
4052
|
+
.card .stamp-place, .post-paper .stamp-place { --_edge: var(--stamp-place-border, var(--card-muted)); color: var(--stamp-place-ink, var(--card-muted)); }
|
|
4053
|
+
.stamp-place--faint { --_edge: var(--stamp-place-faint-border, var(--hairline)); }
|
|
4022
4054
|
|
|
4023
4055
|
/* ---- stamp book: the album page — three stamps across on an album ground, who each is from under it ----
|
|
4024
4056
|
<div class="stamp-book">
|