@usableapp/cardds 0.7.170 → 0.7.172
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 +27 -0
- package/css/actions.css +6 -3
- package/css/base.css +2 -2
- package/css/card.css +17 -7
- package/css/numbers.css +3 -2
- package/css/sheet.css +2 -1
- package/css/tokens.css +7 -0
- package/dist/cardds.css +37 -15
- package/dist/cards/Card.d.ts +17 -1
- package/dist/cards/Card.js +26 -6
- package/dist/catalog.json +1 -1
- package/dist/numbers/NumberBand.d.ts +1 -1
- package/dist/numbers/NumberBand.js +1 -1
- package/docs/reference.md +17 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,33 @@
|
|
|
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.172 — 2026-10-29
|
|
6
|
+
|
|
7
|
+
`NumberBand` reads its type from the tokens: the label is a label, the number is the one number on a sheet.
|
|
8
|
+
|
|
9
|
+
Components: NumberBand
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- **`NumberBand` label** (Lh 2026-10-29, "ไม่ได้ถูกคุมด้วย tokens"): before, `.band__label` took the label weight but the body size (`--fs-body`, 22). After, the label size (`--fs-label`, 17), as every other label. The knob `--band-label-font-size` still overrides it.
|
|
13
|
+
- **`NumberBand` number**: before, `.band__num` was `--fw-heavy --fs-giant` (64) on `--lh-band`, written by hand. After, `--type-stat` at `--fs-hero` (55), the size of `Text level="stat" xl`. Its layout (label left, number right, footnote under the label) is unchanged. `--lh-band` is no longer read by the band.
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
- **`--band-num-font`** (default `--type-stat`) and **`--band-num-font-size`** (default `--fs-hero`): the band's number.
|
|
17
|
+
|
|
18
|
+
## 0.7.171 — 2026-10-29
|
|
19
|
+
|
|
20
|
+
A `Card` can fold to its head, and a Thai mark over a lone page's first line or a SheetStep's title is no longer cut.
|
|
21
|
+
|
|
22
|
+
Components: all
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
- **`Card folds`** (timebank, Lh 2026-10-29): a card that shows only its `Head` and opens on a tap of the head. Controlled like every stateful part: `open` + `onOpenChange`, or `defaultOpen` (default `false`, folded). The rest (the content and the `Foot`) opens and folds as a grid row, the small `FeedCard`'s own fold; folded it is `inert`. The card draws its own chevron down as the head's last end (after the app's), turned up while open, as a `Banner`'s. The head dims under the finger, a control in it keeps its own press; the keyboard meets one unseen button after the head (`aria-expanded`, named by the head, or `openLabel`). Not on `row`, `sm`, `stack`, `paper="bands"`, nor with `back` or `onPress` (ignored with a warning). A folding card is never pressed whole. Stories `Card · Folds`, `FoldsControlled`.
|
|
26
|
+
- **`--glyph-rise-room`** (tokens.css): the room a scrolling box keeps over its first line, `calc(var(--fs-display) * 0.2)`.
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
- **Thai marks over a lone `Page`'s first line** (Lh 2026-10-29, ก่อนเริ่มใช้งาน on a `Screen top="lead"`): before, the stacked marks of เริ่ม ทั้ง ชี้ ปี่ in the page's h1 were cut — the `Step`'s lone `.page` is its own scroller with no top padding, and a scroller clips whatever rises out of it (the head's own glyph padding sits outside it). After, the page pads its top by `--glyph-rise-room` and takes it back from the lead (`margin-top`), so the words stand exactly where they stood, at every text size. `Page bleed` keeps its extra `--sp-2` on top of it.
|
|
30
|
+
- **SheetStep / SheetSettings title** (`.sheet-step__title`, `.sheet-settings__title`): before, the label's 1.2 line with `overflow: hidden` cut the stacked marks (ฉบับย่อ, อ่านฉบับเต็ม). After, it keeps the glyphs' room inside the clip and gives it back outside (`--glyph-rise` / `--glyph-drop`, as a head's title), so nothing moves.
|
|
31
|
+
|
|
5
32
|
## 0.7.170 — 2026-10-29
|
|
6
33
|
|
|
7
34
|
A dim sheet's scrim fades with the sheet, and `Card backFull` centres by eye.
|
package/css/actions.css
CHANGED
|
@@ -488,7 +488,9 @@
|
|
|
488
488
|
.t-expand--more (Lh 2026-10-25) = a `Text expand` that does not fit: the whole box opens or folds. It is WORDS, so it neither
|
|
489
489
|
dims nor gives: its ink never changes under the finger (Lh 2026-10-25), the opening is the answer. Pointer only (below).
|
|
490
490
|
.bubble--press (Lh 2026-10-28) = a chat `Bubble` that is a link (`href`) or pressed (`onClick`): a message is as wide as a row, so it DIMS.
|
|
491
|
-
.link-block (Lh 2026-10-28) = a `LinkBlock`, a few pieces of a card's content as one link: as wide as the card, it DIMS.
|
|
491
|
+
.link-block (Lh 2026-10-28) = a `LinkBlock`, a few pieces of a card's content as one link: as wide as the card, it DIMS.
|
|
492
|
+
.card--folds > .head (Lh 2026-10-29) = the head of a `Card folds`: a tap opens or folds the card, so it DIMS (pointer and :active only —
|
|
493
|
+
the focus ring is the card's, from its unseen open button, card.css). A control in the head keeps its own press. */
|
|
492
494
|
:where(.btn, .icon-btn, .link, a.chip, button.chip, .chip--pick, a.tile, button.tile, .tile--pick, .day, .segment__item, .calendar__day,
|
|
493
495
|
.float-bar__item, .avatar-pick__item, .add-row, .picker__item, .dropdown__btn, .appbar__who, .check, .toggle, .mood__opt, .sheet__handle,
|
|
494
496
|
a.avatar, button.avatar, .menu__item, button.snackbar__body, .stamp--tap, button.stamp-cell, button.stamp-place, .post-letter__turn, .post-desk__slot, .post-desk__pick, .post-desk__reach, .stamp-on__remove, .map-pick, .count-in__cancel) {
|
|
@@ -496,7 +498,7 @@
|
|
|
496
498
|
touch-action: manipulation;
|
|
497
499
|
transition: scale var(--motion-press) var(--ease-out);
|
|
498
500
|
}
|
|
499
|
-
:where(a.row, button.row, label.row, .row-expand > summary, .banner__summary, a.card, label.card, .card--go, .card--press, .feed-card--small, .toggle-field, .post-box__edge, .bubble--press, .link-block) {
|
|
501
|
+
:where(a.row, button.row, label.row, .row-expand > summary, .banner__summary, a.card, label.card, .card--go, .card--press, .feed-card--small, .card--folds > .head, .toggle-field, .post-box__edge, .bubble--press, .link-block) {
|
|
500
502
|
cursor: pointer;
|
|
501
503
|
touch-action: manipulation;
|
|
502
504
|
transition: opacity var(--motion-press) var(--ease-out);
|
|
@@ -512,8 +514,9 @@
|
|
|
512
514
|
:where(.btn, .icon-btn, .link, a.chip, button.chip, .chip--pick, a.tile, button.tile, .tile--pick, .day, .segment__item, .calendar__day,
|
|
513
515
|
.float-bar__item, .avatar-pick__item, .add-row, .picker__item, .dropdown__btn, .appbar__who, .check, .toggle, .mood__opt, .sheet__handle,
|
|
514
516
|
a.avatar, button.avatar, .menu__item, button.snackbar__body, .stamp--tap, button.stamp-cell, button.stamp-place, .post-letter__turn, .post-desk__slot, .post-desk__pick, .post-desk__reach, .stamp-on__remove, .map-pick):active:not(:disabled, [aria-disabled="true"], :has(:disabled)) { scale: var(--press-scale); }
|
|
515
|
-
:where(a.row, button.row, label.row, .row-expand > summary, .banner__summary, a.card, label.card, .card--go, .card--press, .feed-card--small, .toggle-field, .post-box__edge, .bubble--press, .link-block):active:not([aria-disabled="true"], :has(:disabled)) { opacity: var(--press-dim); }
|
|
517
|
+
:where(a.row, button.row, label.row, .row-expand > summary, .banner__summary, a.card, label.card, .card--go, .card--press, .feed-card--small, .card--folds > .head, .toggle-field, .post-box__edge, .bubble--press, .link-block):active:not([aria-disabled="true"], :has(:disabled)) { opacity: var(--press-dim); }
|
|
516
518
|
.card--press:active:has(:is(a[href], button, [role=button], input, select, textarea, summary):active) { opacity: 1; } /* the finger is on a link or a button inside: that one answers, the card stays */
|
|
519
|
+
.card--folds > .head:active:has(:is(a[href], button, [role=button], input, select, textarea, summary):active) { opacity: 1; } /* a button in a folding card's head answers itself, the head stays */
|
|
517
520
|
/* SHADE — what has something BEHIND it (a peeked sheet over the pile, a postcard's face over its back, a post letter's sheet over the other) must not turn see-through:
|
|
518
521
|
it darkens a touch instead (--press-shade) */
|
|
519
522
|
:where(.sheet-stack--tap > .card:not(.is-open), .postcard__turn, .post-letter__sheet:not(:has(.icon-btn:active))) { cursor: pointer; touch-action: manipulation; transition: filter var(--motion-press) var(--ease-out); }
|
package/css/base.css
CHANGED
|
@@ -358,12 +358,12 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
|
|
|
358
358
|
the screen's gap, moved in here from above the step; the inset, taken back from the bleed.
|
|
359
359
|
It ends with the bottom layer's room, as a walk's page does: it scrolls only when the layer would cover its words
|
|
360
360
|
(timebank onboard-04, 2026-09-27 — its last Link lay under the bar; Lh: same rule as the walk) */
|
|
361
|
-
.step > .page { margin: var(--_lead,
|
|
361
|
+
.step > .page { margin: calc(var(--_lead, 0rem) - var(--glyph-rise-room)) var(--screen-pad) 0; padding-top: var(--glyph-rise-room); padding-bottom: var(--bottom-h, 0rem); } /* the lone page is its own scroller: its top keeps the glyphs' room (tokens.css --glyph-rise-room), taken back from the lead, so a Thai mark over the first line is never cut by its edge */
|
|
362
362
|
/* a field brought into sight (focus, Tab) stops above the bottom layer, not under it */
|
|
363
363
|
.step > .page, .step > .pages > .page { scroll-padding-bottom: var(--bottom-h, 0rem); }
|
|
364
364
|
/* --bleed: the page's box runs to the screen's edges, the inset is its own padding — what leans, slides or casts a shadow past
|
|
365
365
|
the inset (a postcard) is cut at the glass, not at the inset; a little room on top for a turned corner. Nothing pans sideways. */
|
|
366
|
-
.step > .page--bleed { margin-inline: 0; padding-inline: var(--screen-pad); padding-block-start: var(--sp-2); overflow-x: hidden; }
|
|
366
|
+
.step > .page--bleed { margin-inline: 0; padding-inline: var(--screen-pad); padding-block-start: calc(var(--glyph-rise-room) + var(--sp-2)); overflow-x: hidden; }
|
|
367
367
|
.step > .pages > .page {
|
|
368
368
|
padding-inline: var(--screen-pad); /* the words keep the inset INSIDE it */
|
|
369
369
|
margin-top: var(--_lead, 0rem); /* the lead is each PAGE's margin (15% with no top, the screen's gap under a bar): the words start there and scroll up to the box's edge */
|
package/css/card.css
CHANGED
|
@@ -328,18 +328,28 @@
|
|
|
328
328
|
@keyframes feed-end-wag { 0%, 100% { rotate: calc(var(--feed-end-wag, 14deg) * -1); } 50% { rotate: var(--feed-end-wag, 14deg); } }
|
|
329
329
|
@media (prefers-reduced-motion: no-preference) { .feed-end__tail { animation: feed-end-wag var(--motion-wag) var(--ease-in-out) infinite; } }
|
|
330
330
|
.card-feed__end { text-align: center; }
|
|
331
|
-
|
|
332
|
-
.
|
|
333
|
-
.
|
|
331
|
+
/* the same fold on a lone card (`Card folds`, Lh 2026-10-29): the head always shows, the rest (content and foot) is the grid row that
|
|
332
|
+
goes 1fr ↔ 0fr; folded (.is-folded) it is cut and hidden as a small feed card's is. The head is the press (actions.css, the DIM list);
|
|
333
|
+
the keyboard's way is the unseen .card__open after it, and its focus ring is the card's. The chevron (.card__chevron) is the card's, the head's last end.
|
|
334
|
+
<article class="card card--folds is-folded"><div class="head" id="…">…</div><button class="card__open" aria-expanded="false" aria-controls="…r"></button>
|
|
335
|
+
<div class="card__more" id="…r" inert><div class="card__rest">content · <div class="foot">…</div></div></div></article> */
|
|
336
|
+
.card--folds { row-gap: 0; }
|
|
337
|
+
.card__chevron { --icon-motion: rotate var(--motion-quick) var(--ease); } /* the card's own chevron, the head's last end: down while folded, turned up while open (as a Banner's) */
|
|
338
|
+
.card--folds:not(.is-folded) .card__chevron { --icon-turn: 180deg; }
|
|
339
|
+
.card__open { position: absolute; inset: 0; width: var(--px); height: var(--px); padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); }
|
|
340
|
+
.card--folds:has(> .card__open:focus-visible) { outline: var(--focus); outline-offset: var(--sp-1); }
|
|
341
|
+
:is(.feed-card__more, .card__more) { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr; }
|
|
342
|
+
:is(.feed-card--small > .feed-card__more, .card--folds.is-folded > .card__more) { grid-template-rows: 0fr; }
|
|
343
|
+
:is(.feed-card__rest, .card__rest) {
|
|
334
344
|
min-height: 0;
|
|
335
345
|
display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: var(--card-gap);
|
|
336
346
|
clip-path: inset(0 calc(-1 * var(--card-pad)) calc(-1 * var(--sp-2)));
|
|
337
347
|
}
|
|
338
|
-
.feed-card__rest > :first-child { margin-top: var(--card-gap); }
|
|
339
|
-
.feed-card--small .feed-card__rest { overflow: clip; visibility: hidden; }
|
|
348
|
+
:is(.feed-card__rest, .card__rest) > :first-child { margin-top: var(--card-gap); }
|
|
349
|
+
:is(.feed-card--small .feed-card__rest, .card--folds.is-folded > .card__more > .card__rest) { overflow: clip; visibility: hidden; }
|
|
340
350
|
@media (prefers-reduced-motion: no-preference) {
|
|
341
|
-
.feed-card__more { transition: grid-template-rows var(--motion-sheet) var(--ease); }
|
|
342
|
-
.feed-card--small .feed-card__rest { transition: visibility 0s var(--motion-sheet); }
|
|
351
|
+
:is(.feed-card__more, .card__more) { transition: grid-template-rows var(--motion-sheet) var(--ease); }
|
|
352
|
+
:is(.feed-card--small .feed-card__rest, .card--folds.is-folded > .card__more > .card__rest) { transition: visibility 0s var(--motion-sheet); }
|
|
343
353
|
}
|
|
344
354
|
|
|
345
355
|
/* ---- panes: a few panes side by side inside a card or a sheet, one in sight (Lh 2026-10-02) ----
|
package/css/numbers.css
CHANGED
|
@@ -92,10 +92,11 @@
|
|
|
92
92
|
|
|
93
93
|
/* ---- band: data card — 2-line label · giant number · footnote ----
|
|
94
94
|
<article class="card card--band"><span class="band__label">Hours<br>banked</span><span class="band__num">18</span><span class="band__foot">this week</span></article> */
|
|
95
|
-
.band__label { grid-area: label; align-self: start; font: var(--band-label-font, var(--type-label)); font-size: var(--band-label-font-size, var(--fs-
|
|
95
|
+
.band__label { grid-area: label; align-self: start; font: var(--band-label-font, var(--type-label)); font-size: var(--band-label-font-size, var(--fs-label)); line-height: round(down, calc(var(--lh-label) * 1em), 1px); } /* a label like every label, the --type-label size (Lh 2026-10-29: the band's words read bigger than the rest) */
|
|
96
96
|
.band__num {
|
|
97
97
|
grid-area: num;
|
|
98
|
-
font: var(--
|
|
98
|
+
font: var(--band-num-font, var(--type-stat)); /* the one number on a sheet, as `Text level="stat" xl` (Lh 2026-10-29: it was 64 written by hand) */
|
|
99
|
+
font-size: var(--band-num-font-size, var(--fs-hero));
|
|
99
100
|
letter-spacing: var(--track-display);
|
|
100
101
|
font-variant-numeric: tabular-nums;
|
|
101
102
|
}
|
package/css/sheet.css
CHANGED
|
@@ -519,7 +519,8 @@
|
|
|
519
519
|
--card-muted: var(--card-ink); /* a tint of the ink: its secondary words are the full ink (no lighter shade holds 4.5:1 there) */
|
|
520
520
|
border-top: var(--sheet-step-border-w, 0rem) solid var(--sheet-step-border, currentColor); /* a rule instead of the bar: set this, the bar's bg transparent, radius 0 */
|
|
521
521
|
}
|
|
522
|
-
:is(.sheet-step__title, .sheet-settings__title) { font: var(--sheet-step-title-font, var(--type-label)); margin: 0; flex: 0 1 auto; min-width: 0; outline: none; /* the label size, not a body title: a pile of rows must stay small (Lh 2026-09-24) */ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
522
|
+
:is(.sheet-step__title, .sheet-settings__title) { font: var(--sheet-step-title-font, var(--type-label)); margin: 0; flex: 0 1 auto; min-width: 0; outline: none; /* the label size, not a body title: a pile of rows must stay small (Lh 2026-09-24) */ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
523
|
+
padding-block: var(--glyph-rise) var(--glyph-drop); margin-block: calc(-1 * var(--glyph-rise)) calc(-1 * var(--glyph-drop)); /* the label's 1.2 line is shorter than a stacked Thai mark (ฉบับย่อ, อ่านฉบับเต็ม were cut): room inside the clip, given back outside (tokens.css, the glyphs' room) */ }
|
|
523
524
|
.sheet-step__num { /* `numbered`: the step's number in a disc BEFORE its title (Lh 2026-09-25) — a disc of the card's colour on the bar, the number in the ink */
|
|
524
525
|
flex: none; display: grid; place-items: center; box-sizing: border-box; inline-size: var(--sheet-step-num-size, 1.408em); block-size: var(--sheet-step-num-size, 1.408em); /* em, not rem (Lh 2026-10-03, as the StackSheet's count): the disc is cut from ITS OWN number's size —
|
|
525
526
|
at a large text size the number grew and a 24px disc did not, so the digit sat on its bottom edge; 1.408em of a 17px caption = the 24px it always was */
|
package/css/tokens.css
CHANGED
|
@@ -244,6 +244,13 @@
|
|
|
244
244
|
reaches 0.30em under the baseline; a tight line box, 1.15, ends 0.175em under it) */
|
|
245
245
|
--glyph-rise: 0.2em;
|
|
246
246
|
--glyph-drop: 0.15em;
|
|
247
|
+
/* …and the room a SCROLLING box keeps over its first line (Lh 2026-10-29, ก่อนเริ่มใช้งาน on a lone Page: the marks of เริ่ม ทั้ง ชี้ ปี่ were
|
|
248
|
+
cut by the page's own scroll edge, which clips whatever rises out of it — a child's padding cannot reach past its scroller). The
|
|
249
|
+
scroller pads its top by it and takes it back from its margin, so the words stand where they stood and a mark rising over the first
|
|
250
|
+
line is inside the box. A box cannot read its first child's em, so it is the rise of the biggest words that may open it (the display
|
|
251
|
+
size, --fs-display, and so it grows with a member's larger text). Measured (Noto Sans Thai Looped, shaped): a stacked tone over an
|
|
252
|
+
upper vowel reaches 1.19em over the baseline at weight 900, an h1 line (1.15) ends 1.025em over it — 0.165em out */
|
|
253
|
+
--glyph-rise-room: calc(var(--fs-display) * 0.2);
|
|
247
254
|
/* THE EIGHT KINDS: each has its face, weight, size (--fs-* above), leading and tracking, and its style --type-<kind> is made of them */
|
|
248
255
|
--fw-display: var(--fw-heavy); --lh-display: 1.15; --track-display: -0.02em; /* leading: Thai marks stack to 1.1em up and 0.3em down — 1.02 clipped them (2026-09-10) */
|
|
249
256
|
--fw-h1: var(--fw-black); --lh-h1: 1.15; --track-h1: -0.015em; /* tight, the display's floor: a stacked mark (1.13em up) clears the line above (Lh 2026-10-25: 1.2 read loose) */
|
package/dist/cardds.css
CHANGED
|
@@ -314,6 +314,13 @@
|
|
|
314
314
|
reaches 0.30em under the baseline; a tight line box, 1.15, ends 0.175em under it) */
|
|
315
315
|
--glyph-rise: 0.2em;
|
|
316
316
|
--glyph-drop: 0.15em;
|
|
317
|
+
/* …and the room a SCROLLING box keeps over its first line (Lh 2026-10-29, ก่อนเริ่มใช้งาน on a lone Page: the marks of เริ่ม ทั้ง ชี้ ปี่ were
|
|
318
|
+
cut by the page's own scroll edge, which clips whatever rises out of it — a child's padding cannot reach past its scroller). The
|
|
319
|
+
scroller pads its top by it and takes it back from its margin, so the words stand where they stood and a mark rising over the first
|
|
320
|
+
line is inside the box. A box cannot read its first child's em, so it is the rise of the biggest words that may open it (the display
|
|
321
|
+
size, --fs-display, and so it grows with a member's larger text). Measured (Noto Sans Thai Looped, shaped): a stacked tone over an
|
|
322
|
+
upper vowel reaches 1.19em over the baseline at weight 900, an h1 line (1.15) ends 1.025em over it — 0.165em out */
|
|
323
|
+
--glyph-rise-room: calc(var(--fs-display) * 0.2);
|
|
317
324
|
/* THE EIGHT KINDS: each has its face, weight, size (--fs-* above), leading and tracking, and its style --type-<kind> is made of them */
|
|
318
325
|
--fw-display: var(--fw-heavy); --lh-display: 1.15; --track-display: -0.02em; /* leading: Thai marks stack to 1.1em up and 0.3em down — 1.02 clipped them (2026-09-10) */
|
|
319
326
|
--fw-h1: var(--fw-black); --lh-h1: 1.15; --track-h1: -0.015em; /* tight, the display's floor: a stacked mark (1.13em up) clears the line above (Lh 2026-10-25: 1.2 read loose) */
|
|
@@ -1003,12 +1010,12 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
|
|
|
1003
1010
|
the screen's gap, moved in here from above the step; the inset, taken back from the bleed.
|
|
1004
1011
|
It ends with the bottom layer's room, as a walk's page does: it scrolls only when the layer would cover its words
|
|
1005
1012
|
(timebank onboard-04, 2026-09-27 — its last Link lay under the bar; Lh: same rule as the walk) */
|
|
1006
|
-
.step > .page { margin: var(--_lead,
|
|
1013
|
+
.step > .page { margin: calc(var(--_lead, 0rem) - var(--glyph-rise-room)) var(--screen-pad) 0; padding-top: var(--glyph-rise-room); padding-bottom: var(--bottom-h, 0rem); } /* the lone page is its own scroller: its top keeps the glyphs' room (tokens.css --glyph-rise-room), taken back from the lead, so a Thai mark over the first line is never cut by its edge */
|
|
1007
1014
|
/* a field brought into sight (focus, Tab) stops above the bottom layer, not under it */
|
|
1008
1015
|
.step > .page, .step > .pages > .page { scroll-padding-bottom: var(--bottom-h, 0rem); }
|
|
1009
1016
|
/* --bleed: the page's box runs to the screen's edges, the inset is its own padding — what leans, slides or casts a shadow past
|
|
1010
1017
|
the inset (a postcard) is cut at the glass, not at the inset; a little room on top for a turned corner. Nothing pans sideways. */
|
|
1011
|
-
.step > .page--bleed { margin-inline: 0; padding-inline: var(--screen-pad); padding-block-start: var(--sp-2); overflow-x: hidden; }
|
|
1018
|
+
.step > .page--bleed { margin-inline: 0; padding-inline: var(--screen-pad); padding-block-start: calc(var(--glyph-rise-room) + var(--sp-2)); overflow-x: hidden; }
|
|
1012
1019
|
.step > .pages > .page {
|
|
1013
1020
|
padding-inline: var(--screen-pad); /* the words keep the inset INSIDE it */
|
|
1014
1021
|
margin-top: var(--_lead, 0rem); /* the lead is each PAGE's margin (15% with no top, the screen's gap under a bar): the words start there and scroll up to the box's edge */
|
|
@@ -1381,18 +1388,28 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
|
|
|
1381
1388
|
@keyframes feed-end-wag { 0%, 100% { rotate: calc(var(--feed-end-wag, 14deg) * -1); } 50% { rotate: var(--feed-end-wag, 14deg); } }
|
|
1382
1389
|
@media (prefers-reduced-motion: no-preference) { .feed-end__tail { animation: feed-end-wag var(--motion-wag) var(--ease-in-out) infinite; } }
|
|
1383
1390
|
.card-feed__end { text-align: center; }
|
|
1384
|
-
|
|
1385
|
-
.
|
|
1386
|
-
.
|
|
1391
|
+
/* the same fold on a lone card (`Card folds`, Lh 2026-10-29): the head always shows, the rest (content and foot) is the grid row that
|
|
1392
|
+
goes 1fr ↔ 0fr; folded (.is-folded) it is cut and hidden as a small feed card's is. The head is the press (actions.css, the DIM list);
|
|
1393
|
+
the keyboard's way is the unseen .card__open after it, and its focus ring is the card's. The chevron (.card__chevron) is the card's, the head's last end.
|
|
1394
|
+
<article class="card card--folds is-folded"><div class="head" id="…">…</div><button class="card__open" aria-expanded="false" aria-controls="…r"></button>
|
|
1395
|
+
<div class="card__more" id="…r" inert><div class="card__rest">content · <div class="foot">…</div></div></div></article> */
|
|
1396
|
+
.card--folds { row-gap: 0; }
|
|
1397
|
+
.card__chevron { --icon-motion: rotate var(--motion-quick) var(--ease); } /* the card's own chevron, the head's last end: down while folded, turned up while open (as a Banner's) */
|
|
1398
|
+
.card--folds:not(.is-folded) .card__chevron { --icon-turn: 180deg; }
|
|
1399
|
+
.card__open { position: absolute; inset: 0; width: var(--px); height: var(--px); padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); }
|
|
1400
|
+
.card--folds:has(> .card__open:focus-visible) { outline: var(--focus); outline-offset: var(--sp-1); }
|
|
1401
|
+
:is(.feed-card__more, .card__more) { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr; }
|
|
1402
|
+
:is(.feed-card--small > .feed-card__more, .card--folds.is-folded > .card__more) { grid-template-rows: 0fr; }
|
|
1403
|
+
:is(.feed-card__rest, .card__rest) {
|
|
1387
1404
|
min-height: 0;
|
|
1388
1405
|
display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: var(--card-gap);
|
|
1389
1406
|
clip-path: inset(0 calc(-1 * var(--card-pad)) calc(-1 * var(--sp-2)));
|
|
1390
1407
|
}
|
|
1391
|
-
.feed-card__rest > :first-child { margin-top: var(--card-gap); }
|
|
1392
|
-
.feed-card--small .feed-card__rest { overflow: clip; visibility: hidden; }
|
|
1408
|
+
:is(.feed-card__rest, .card__rest) > :first-child { margin-top: var(--card-gap); }
|
|
1409
|
+
:is(.feed-card--small .feed-card__rest, .card--folds.is-folded > .card__more > .card__rest) { overflow: clip; visibility: hidden; }
|
|
1393
1410
|
@media (prefers-reduced-motion: no-preference) {
|
|
1394
|
-
.feed-card__more { transition: grid-template-rows var(--motion-sheet) var(--ease); }
|
|
1395
|
-
.feed-card--small .feed-card__rest { transition: visibility 0s var(--motion-sheet); }
|
|
1411
|
+
:is(.feed-card__more, .card__more) { transition: grid-template-rows var(--motion-sheet) var(--ease); }
|
|
1412
|
+
:is(.feed-card--small .feed-card__rest, .card--folds.is-folded > .card__more > .card__rest) { transition: visibility 0s var(--motion-sheet); }
|
|
1396
1413
|
}
|
|
1397
1414
|
|
|
1398
1415
|
/* ---- panes: a few panes side by side inside a card or a sheet, one in sight (Lh 2026-10-02) ----
|
|
@@ -2543,7 +2560,8 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
|
|
|
2543
2560
|
--card-muted: var(--card-ink); /* a tint of the ink: its secondary words are the full ink (no lighter shade holds 4.5:1 there) */
|
|
2544
2561
|
border-top: var(--sheet-step-border-w, 0rem) solid var(--sheet-step-border, currentColor); /* a rule instead of the bar: set this, the bar's bg transparent, radius 0 */
|
|
2545
2562
|
}
|
|
2546
|
-
:is(.sheet-step__title, .sheet-settings__title) { font: var(--sheet-step-title-font, var(--type-label)); margin: 0; flex: 0 1 auto; min-width: 0; outline: none; /* the label size, not a body title: a pile of rows must stay small (Lh 2026-09-24) */ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
2563
|
+
:is(.sheet-step__title, .sheet-settings__title) { font: var(--sheet-step-title-font, var(--type-label)); margin: 0; flex: 0 1 auto; min-width: 0; outline: none; /* the label size, not a body title: a pile of rows must stay small (Lh 2026-09-24) */ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
2564
|
+
padding-block: var(--glyph-rise) var(--glyph-drop); margin-block: calc(-1 * var(--glyph-rise)) calc(-1 * var(--glyph-drop)); /* the label's 1.2 line is shorter than a stacked Thai mark (ฉบับย่อ, อ่านฉบับเต็ม were cut): room inside the clip, given back outside (tokens.css, the glyphs' room) */ }
|
|
2547
2565
|
.sheet-step__num { /* `numbered`: the step's number in a disc BEFORE its title (Lh 2026-09-25) — a disc of the card's colour on the bar, the number in the ink */
|
|
2548
2566
|
flex: none; display: grid; place-items: center; box-sizing: border-box; inline-size: var(--sheet-step-num-size, 1.408em); block-size: var(--sheet-step-num-size, 1.408em); /* em, not rem (Lh 2026-10-03, as the StackSheet's count): the disc is cut from ITS OWN number's size —
|
|
2549
2567
|
at a large text size the number grew and a 24px disc did not, so the digit sat on its bottom edge; 1.408em of a 17px caption = the 24px it always was */
|
|
@@ -3462,7 +3480,9 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
|
|
|
3462
3480
|
.t-expand--more (Lh 2026-10-25) = a `Text expand` that does not fit: the whole box opens or folds. It is WORDS, so it neither
|
|
3463
3481
|
dims nor gives: its ink never changes under the finger (Lh 2026-10-25), the opening is the answer. Pointer only (below).
|
|
3464
3482
|
.bubble--press (Lh 2026-10-28) = a chat `Bubble` that is a link (`href`) or pressed (`onClick`): a message is as wide as a row, so it DIMS.
|
|
3465
|
-
.link-block (Lh 2026-10-28) = a `LinkBlock`, a few pieces of a card's content as one link: as wide as the card, it DIMS.
|
|
3483
|
+
.link-block (Lh 2026-10-28) = a `LinkBlock`, a few pieces of a card's content as one link: as wide as the card, it DIMS.
|
|
3484
|
+
.card--folds > .head (Lh 2026-10-29) = the head of a `Card folds`: a tap opens or folds the card, so it DIMS (pointer and :active only —
|
|
3485
|
+
the focus ring is the card's, from its unseen open button, card.css). A control in the head keeps its own press. */
|
|
3466
3486
|
:where(.btn, .icon-btn, .link, a.chip, button.chip, .chip--pick, a.tile, button.tile, .tile--pick, .day, .segment__item, .calendar__day,
|
|
3467
3487
|
.float-bar__item, .avatar-pick__item, .add-row, .picker__item, .dropdown__btn, .appbar__who, .check, .toggle, .mood__opt, .sheet__handle,
|
|
3468
3488
|
a.avatar, button.avatar, .menu__item, button.snackbar__body, .stamp--tap, button.stamp-cell, button.stamp-place, .post-letter__turn, .post-desk__slot, .post-desk__pick, .post-desk__reach, .stamp-on__remove, .map-pick, .count-in__cancel) {
|
|
@@ -3470,7 +3490,7 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
|
|
|
3470
3490
|
touch-action: manipulation;
|
|
3471
3491
|
transition: scale var(--motion-press) var(--ease-out);
|
|
3472
3492
|
}
|
|
3473
|
-
:where(a.row, button.row, label.row, .row-expand > summary, .banner__summary, a.card, label.card, .card--go, .card--press, .feed-card--small, .toggle-field, .post-box__edge, .bubble--press, .link-block) {
|
|
3493
|
+
:where(a.row, button.row, label.row, .row-expand > summary, .banner__summary, a.card, label.card, .card--go, .card--press, .feed-card--small, .card--folds > .head, .toggle-field, .post-box__edge, .bubble--press, .link-block) {
|
|
3474
3494
|
cursor: pointer;
|
|
3475
3495
|
touch-action: manipulation;
|
|
3476
3496
|
transition: opacity var(--motion-press) var(--ease-out);
|
|
@@ -3486,8 +3506,9 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
|
|
|
3486
3506
|
:where(.btn, .icon-btn, .link, a.chip, button.chip, .chip--pick, a.tile, button.tile, .tile--pick, .day, .segment__item, .calendar__day,
|
|
3487
3507
|
.float-bar__item, .avatar-pick__item, .add-row, .picker__item, .dropdown__btn, .appbar__who, .check, .toggle, .mood__opt, .sheet__handle,
|
|
3488
3508
|
a.avatar, button.avatar, .menu__item, button.snackbar__body, .stamp--tap, button.stamp-cell, button.stamp-place, .post-letter__turn, .post-desk__slot, .post-desk__pick, .post-desk__reach, .stamp-on__remove, .map-pick):active:not(:disabled, [aria-disabled="true"], :has(:disabled)) { scale: var(--press-scale); }
|
|
3489
|
-
:where(a.row, button.row, label.row, .row-expand > summary, .banner__summary, a.card, label.card, .card--go, .card--press, .feed-card--small, .toggle-field, .post-box__edge, .bubble--press, .link-block):active:not([aria-disabled="true"], :has(:disabled)) { opacity: var(--press-dim); }
|
|
3509
|
+
:where(a.row, button.row, label.row, .row-expand > summary, .banner__summary, a.card, label.card, .card--go, .card--press, .feed-card--small, .card--folds > .head, .toggle-field, .post-box__edge, .bubble--press, .link-block):active:not([aria-disabled="true"], :has(:disabled)) { opacity: var(--press-dim); }
|
|
3490
3510
|
.card--press:active:has(:is(a[href], button, [role=button], input, select, textarea, summary):active) { opacity: 1; } /* the finger is on a link or a button inside: that one answers, the card stays */
|
|
3511
|
+
.card--folds > .head:active:has(:is(a[href], button, [role=button], input, select, textarea, summary):active) { opacity: 1; } /* a button in a folding card's head answers itself, the head stays */
|
|
3491
3512
|
/* SHADE — what has something BEHIND it (a peeked sheet over the pile, a postcard's face over its back, a post letter's sheet over the other) must not turn see-through:
|
|
3492
3513
|
it darkens a touch instead (--press-shade) */
|
|
3493
3514
|
:where(.sheet-stack--tap > .card:not(.is-open), .postcard__turn, .post-letter__sheet:not(:has(.icon-btn:active))) { cursor: pointer; touch-action: manipulation; transition: filter var(--motion-press) var(--ease-out); }
|
|
@@ -3694,10 +3715,11 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
|
|
|
3694
3715
|
|
|
3695
3716
|
/* ---- band: data card — 2-line label · giant number · footnote ----
|
|
3696
3717
|
<article class="card card--band"><span class="band__label">Hours<br>banked</span><span class="band__num">18</span><span class="band__foot">this week</span></article> */
|
|
3697
|
-
.band__label { grid-area: label; align-self: start; font: var(--band-label-font, var(--type-label)); font-size: var(--band-label-font-size, var(--fs-
|
|
3718
|
+
.band__label { grid-area: label; align-self: start; font: var(--band-label-font, var(--type-label)); font-size: var(--band-label-font-size, var(--fs-label)); line-height: round(down, calc(var(--lh-label) * 1em), 1px); } /* a label like every label, the --type-label size (Lh 2026-10-29: the band's words read bigger than the rest) */
|
|
3698
3719
|
.band__num {
|
|
3699
3720
|
grid-area: num;
|
|
3700
|
-
font: var(--
|
|
3721
|
+
font: var(--band-num-font, var(--type-stat)); /* the one number on a sheet, as `Text level="stat" xl` (Lh 2026-10-29: it was 64 written by hand) */
|
|
3722
|
+
font-size: var(--band-num-font-size, var(--fs-hero));
|
|
3701
3723
|
letter-spacing: var(--track-display);
|
|
3702
3724
|
font-variant-numeric: tabular-nums;
|
|
3703
3725
|
}
|
package/dist/cards/Card.d.ts
CHANGED
|
@@ -80,6 +80,21 @@ export interface CardProps extends ComponentProps<'article'> {
|
|
|
80
80
|
pressLabel?: string;
|
|
81
81
|
/** the cross's spoken name (default: the words' `remove`) — name what goes: "Remove 'buy medicine'" */
|
|
82
82
|
removeLabel?: string;
|
|
83
|
+
/** THE FOLD — the card can fold to its head: folded, only its `Head` shows; a tap on the head (not on a control in it) opens the rest
|
|
84
|
+
* (the content and the `Foot`), another folds it again. The rest opens and folds as a grid row, nothing jumps; folded it is `inert`.
|
|
85
|
+
* The card draws its own chevron down as the head's last `end` (after the app's own ends), turned up while open, as a Banner's.
|
|
86
|
+
* The keyboard and a screen reader meet ONE unseen button after the head, named by the head (or `openLabel`), that says open or folded.
|
|
87
|
+
* The card finds its `Head` by type, as a two-faced card does. Not on a `row`, `sm`, `stack`, `paper="bands"` card, nor with `back` or `onPress`:
|
|
88
|
+
* there it is ignored. A folding card is never pressed whole (the head is its press). Knob: none — the motion is the sheet's (`--motion-sheet`) */
|
|
89
|
+
folds?: boolean;
|
|
90
|
+
/** CONTROLLED: the card is open (only with `folds`) — pair it with `onOpenChange`. The app owns it */
|
|
91
|
+
open?: boolean;
|
|
92
|
+
/** UNCONTROLLED: the card starts open (default `false`: folded to its head) */
|
|
93
|
+
defaultOpen?: boolean;
|
|
94
|
+
/** a tap on the head (or the unseen button) asked to open or to fold: the state it asks for */
|
|
95
|
+
onOpenChange?: (open: boolean) => void;
|
|
96
|
+
/** the unseen open button's spoken name (default: the head's own words) */
|
|
97
|
+
openLabel?: string;
|
|
83
98
|
}
|
|
84
99
|
/**
|
|
85
100
|
* Card — ONE boundary: head · content · foot. Cards are content the system offers (the words, the thing to read).
|
|
@@ -92,8 +107,9 @@ export interface CardProps extends ComponentProps<'article'> {
|
|
|
92
107
|
* PRESSED WHOLE WITH CONTROLS INSIDE (`onPress` + `pressLabel`): the card is pressed anywhere off its own links and buttons, which keep their own press; one unseen button serves the keyboard.
|
|
93
108
|
* 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
|
|
94
109
|
* read the same on both faces, the middle is one fixed height; `backFull` gives the back the whole card, centred, with neither. `paper="bands"`: paper head and foot bands edge to edge, the tint between.
|
|
110
|
+
* FOLDS (`folds`): folded to its head, a tap on the head opens the rest — controlled (`open` + `onOpenChange`) or `defaultOpen`.
|
|
95
111
|
*/
|
|
96
|
-
export declare function Card({ tone, paper, sm, row, cover, fold, centre, wide, band, as, stack, leave, onLeft, onPress, pressLabel, onRemove, removeLabel, back, backFull, face, defaultFace, onFaceChange, toBackLabel, toFrontLabel, startInView, className, style, children, onClick, ref, ...rest }: CardProps): import("react").DetailedReactHTMLElement<{
|
|
112
|
+
export declare function Card({ tone, paper, sm, row, cover, fold, centre, wide, band, as, stack, leave, onLeft, onPress, pressLabel, onRemove, removeLabel, back, backFull, face, defaultFace, onFaceChange, toBackLabel, toFrontLabel, startInView, folds, open, defaultOpen, onOpenChange, openLabel, className, style, children, onClick, ref, ...rest }: CardProps): import("react").DetailedReactHTMLElement<{
|
|
97
113
|
onClick: (e: MouseEvent<HTMLElement>) => void;
|
|
98
114
|
inert?: boolean | undefined;
|
|
99
115
|
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
package/dist/cards/Card.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
2
|
-
import { Children, createElement, isValidElement, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Children, cloneElement, createElement, isValidElement, useEffect, useId, useLayoutEffect, useRef, useState } from 'react';
|
|
3
3
|
import { cx } from '../cx.js';
|
|
4
4
|
import { useControlled, useLatest, warnOnce } from '../state.js';
|
|
5
5
|
import { Head } from '../parts/Head.js';
|
|
@@ -20,8 +20,9 @@ import { StackHeadCtx, StackPullCtx, ownHead, stackPaint, useStackCard } from '.
|
|
|
20
20
|
* PRESSED WHOLE WITH CONTROLS INSIDE (`onPress` + `pressLabel`): the card is pressed anywhere off its own links and buttons, which keep their own press; one unseen button serves the keyboard.
|
|
21
21
|
* 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
|
|
22
22
|
* read the same on both faces, the middle is one fixed height; `backFull` gives the back the whole card, centred, with neither. `paper="bands"`: paper head and foot bands edge to edge, the tint between.
|
|
23
|
+
* FOLDS (`folds`): folded to its head, a tap on the head opens the rest — controlled (`open` + `onOpenChange`) or `defaultOpen`.
|
|
23
24
|
*/
|
|
24
|
-
export function Card({ tone, paper, sm, row, cover, fold, centre, wide, band, as = 'article', stack, leave, onLeft, onPress, pressLabel, onRemove, removeLabel, back, backFull, face, defaultFace = 'front', onFaceChange, toBackLabel, toFrontLabel, startInView, className, style, children, onClick, ref, ...rest }) {
|
|
25
|
+
export function Card({ tone, paper, sm, row, cover, fold, centre, wide, band, as = 'article', stack, leave, onLeft, onPress, pressLabel, onRemove, removeLabel, back, backFull, face, defaultFace = 'front', onFaceChange, toBackLabel, toFrontLabel, startInView, folds, open, defaultOpen = false, onOpenChange, openLabel, className, style, children, onClick, ref, ...rest }) {
|
|
25
26
|
if (onRemove && !row)
|
|
26
27
|
warnOnce('card-remove-row', 'cardds Card: `onRemove` draws its cross on a `row` card only');
|
|
27
28
|
if (back != null && (row || sm || stack))
|
|
@@ -31,6 +32,16 @@ export function Card({ tone, paper, sm, row, cover, fold, centre, wide, band, as
|
|
|
31
32
|
if (onPress && !pressLabel)
|
|
32
33
|
warnOnce('card-press-label', 'cardds Card: `onPress` needs a `pressLabel` — the unseen button needs a spoken name');
|
|
33
34
|
const turns = back != null && !row && !sm && !stack;
|
|
35
|
+
if (folds && (row || sm || stack || paper === 'bands' || back != null || onPress))
|
|
36
|
+
warnOnce('card-folds-kind', 'cardds Card: `folds` folds a plain card — not a `row`, `sm`, `stack` or `paper="bands"` card, nor one with `back` or `onPress`; it is ignored');
|
|
37
|
+
const kids = Children.toArray(children);
|
|
38
|
+
const headKid = kids.find((c) => isValidElement(c) && c.type === Head);
|
|
39
|
+
if (folds && !headKid)
|
|
40
|
+
warnOnce('card-folds-head', 'cardds Card: `folds` needs a `Head` child — the head is what shows folded and what opens it; it is ignored');
|
|
41
|
+
const folding = !!folds && !!headKid && !row && !sm && !stack && paper !== 'bands' && back == null && !onPress;
|
|
42
|
+
const [opened, askOpen] = useControlled(open, defaultOpen, onOpenChange);
|
|
43
|
+
const folded = folding && !opened;
|
|
44
|
+
const foldId = useId();
|
|
34
45
|
const [shown, ask] = useControlled(face, defaultFace, onFaceChange);
|
|
35
46
|
const flipped = turns && shown === 'back';
|
|
36
47
|
const pressed = onPress != null && back == null && !stack;
|
|
@@ -68,7 +79,7 @@ export function Card({ tone, paper, sm, row, cover, fold, centre, wide, band, as
|
|
|
68
79
|
return () => { live = false; };
|
|
69
80
|
}, [away]);
|
|
70
81
|
const [go, setGo] = useState(false);
|
|
71
|
-
const findGo = useLatest(() => setGo(!turns && !pressed && own.current != null && goControl(own.current) != null));
|
|
82
|
+
const findGo = useLatest(() => setGo(!turns && !pressed && !folding && own.current != null && goControl(own.current) != null));
|
|
72
83
|
useLayoutEffect(() => findGo.current()); // every render: what the card holds is its children's
|
|
73
84
|
useEffect(() => {
|
|
74
85
|
const card = own.current;
|
|
@@ -95,6 +106,11 @@ export function Card({ tone, paper, sm, row, cover, fold, centre, wide, band, as
|
|
|
95
106
|
onPress?.();
|
|
96
107
|
return;
|
|
97
108
|
}
|
|
109
|
+
if (folding) {
|
|
110
|
+
if (!e.defaultPrevented && card && ownHead(card, target) && !onControl(card, target))
|
|
111
|
+
askOpen(!opened);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
98
114
|
if (!e.defaultPrevented && card?.contains(target)) {
|
|
99
115
|
const control = goControl(card);
|
|
100
116
|
if (control && !control.contains(target)) {
|
|
@@ -126,7 +142,7 @@ export function Card({ tone, paper, sm, row, cover, fold, centre, wide, band, as
|
|
|
126
142
|
const props = {
|
|
127
143
|
...rest,
|
|
128
144
|
ref: setRef,
|
|
129
|
-
className: cx('card', tone && tone !== 1 && `card--${tone}`, paper === true && 'sheet--paper', paper === 'bands' && 'card--bands', turns && 'card--turns flip', flipped && 'is-flipped', sm && 'card--sm', row && 'card--row', cover && 'card--cover', fold && 'card--fold', centre && 'card--centre', wide && 'card--wide', band && 'card--band', go && 'card--go', pressed && 'card--press', leaver && 'card--leaver', away && 'card--away', painted.className, className),
|
|
145
|
+
className: cx('card', tone && tone !== 1 && `card--${tone}`, paper === true && 'sheet--paper', paper === 'bands' && 'card--bands', turns && 'card--turns flip', flipped && 'is-flipped', sm && 'card--sm', row && 'card--row', cover && 'card--cover', fold && 'card--fold', centre && 'card--centre', wide && 'card--wide', band && 'card--band', go && 'card--go', pressed && 'card--press', folding && 'card--folds', folded && 'is-folded', leaver && 'card--leaver', away && 'card--away', painted.className, className),
|
|
130
146
|
style: painted.style || style ? { ...painted.style, ...style } : undefined,
|
|
131
147
|
...(stack ? { 'aria-busy': painted.busy } : {}),
|
|
132
148
|
...(away ? { inert: true } : {}),
|
|
@@ -134,8 +150,12 @@ export function Card({ tone, paper, sm, row, cover, fold, centre, wide, band, as
|
|
|
134
150
|
};
|
|
135
151
|
const cross = row && onRemove ? (_jsx("button", { type: "button", className: "card__remove", "aria-label": removeLabel ?? word('remove'), onClick: (e) => { e.preventDefault(); e.stopPropagation(); onRemove(); }, children: _jsx(Icon, { name: "x" }) }, "remove")) : null;
|
|
136
152
|
const press = pressed ? (_jsx("button", { type: "button", className: "card__press", "aria-label": pressLabel, onClick: (e) => { e.stopPropagation(); onPress?.(); } }, "press")) : null;
|
|
153
|
+
if (folding) {
|
|
154
|
+
const headId = headKid.props.id ?? `${foldId}h`;
|
|
155
|
+
const rest = kids.filter((c) => c !== headKid);
|
|
156
|
+
return createElement(as, props, inner(_jsxs(_Fragment, { children: [cloneElement(headKid, { id: headId, end: _jsxs(_Fragment, { children: [headKid.props.end, _jsx(Icon, { name: "chevron-down", size: "sm", className: "card__chevron" })] }) }), _jsx("button", { type: "button", className: "card__open", "aria-expanded": opened, "aria-controls": `${foldId}r`, ...(openLabel ? { 'aria-label': openLabel } : { 'aria-labelledby': headId }), onClick: () => askOpen(!opened) }), _jsx("div", { className: "card__more", id: `${foldId}r`, inert: folded, children: _jsx("div", { className: "card__rest", children: rest }) })] })));
|
|
157
|
+
}
|
|
137
158
|
if (turns) {
|
|
138
|
-
const kids = Children.toArray(children);
|
|
139
159
|
const ownHeadKid = kids.find((c) => isValidElement(c) && c.type === Head);
|
|
140
160
|
const ownFootKid = kids.find((c) => isValidElement(c) && c.type === Foot);
|
|
141
161
|
const front = kids.filter((c) => c !== ownHeadKid && c !== ownFootKid);
|