@usableapp/cardds 0.7.165 → 0.7.167
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 +30 -0
- package/bin/cardds.mjs +4 -3
- package/css/card.css +1 -1
- package/css/lists.css +8 -1
- package/css/parts.css +7 -4
- package/css/stack.css +1 -1
- package/dist/cardds.css +17 -7
- package/dist/cards/Card.js +2 -1
- package/dist/cards/CardFeed.js +1 -2
- package/dist/cards/FeedEnd.d.ts +2 -2
- package/dist/cards/FeedEnd.js +1 -1
- package/dist/catalog.json +1 -1
- package/dist/lists/Bubble.d.ts +29 -5
- package/dist/lists/Bubble.js +70 -9
- package/dist/parts/Head.d.ts +57 -13
- package/dist/parts/Head.js +72 -31
- package/dist/parts/Words.d.ts +2 -2
- package/dist/parts/Words.js +2 -2
- package/dist/parts/endRoom.d.ts +2 -0
- package/dist/parts/endRoom.js +1 -1
- package/dist/parts/headCtx.d.ts +3 -0
- package/dist/parts/headCtx.js +3 -0
- package/dist/sheets/Modal.d.ts +1 -1
- package/dist/sheets/Modal.js +4 -2
- package/dist/sheets/Sheet.d.ts +3 -2
- package/dist/sheets/Sheet.js +4 -1
- package/dist/sheets/StackBack.d.ts +1 -1
- package/dist/sheets/StackBack.js +1 -1
- package/dist/sheets/StackSheet.js +4 -6
- package/dist/sheets/sheetMeasure.js +1 -1
- package/dist/templates/CallSheet.js +2 -3
- package/dist/templates/Walkthrough.js +1 -2
- package/dist/type/icons.d.ts +1 -1
- package/dist/type/icons.js +2 -2
- package/dist/words.d.ts +1 -1
- package/dist/words.js +2 -2
- package/docs/reference.md +52 -29
- package/icons.svg +2 -1
- package/lib/guide.mjs +6 -5
- package/lint/headSlots.d.mts +2 -0
- package/lint/headSlots.mjs +15 -0
- package/lint/rules.mjs +42 -1
- package/package.json +2 -1
- package/scripts/codemod-head.mjs +306 -0
- package/scripts/codemod-parts.mjs +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,36 @@
|
|
|
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.167 — 2026-10-29
|
|
6
|
+
|
|
7
|
+
`Head` is ONE part with a `variant` and named slots; the sheet head draws and wires its own close. A head written with children is gone.
|
|
8
|
+
|
|
9
|
+
Components: Head, Words, Card, CardFeed, Sheet, Modal, StackSheet, StackBack, CallSheet, Walkthrough, Bubble, Thread
|
|
10
|
+
|
|
11
|
+
### Changed (breaking)
|
|
12
|
+
- **`Head` takes no children** (timebank, Lh 2026-10-29: "cardds should make the head a component with variants"). A head is one of a closed set, `variant` = `plain` (default) · `lead` · `date` · `status` · `centre` · `sheet` · `stack`, filled through named slots (`title` `meta` `over` `level` `lead` `tag` `chips` `end` `actions` `onClose` `closeLabel` `back` `backLabel`); the variant lays them out, never the order they are written in. A slot the variant does not take is left out with a warning. Before → after:
|
|
13
|
+
- `<Head><Words title meta/><End caption="5 min"/></Head>` → `<Head title meta end={<End caption="5 min"/>} />`
|
|
14
|
+
- `<Head><Avatar/><Words title meta/><End/><Btn shape="round" size="sm" icon="check" label="…"/><Btn shape="round" size="sm" icon="x" label="…"/></Head>` (a feed card's head) → `<Head variant="lead" lead={<Avatar/>} title meta end={<><End/><Btn …/><Btn …/></>} />`
|
|
15
|
+
- `<Head><Words title meta/><Btn shape="round" size="sm" icon="x" label="ปิด" onClick={onClose}/></Head>` in a sheet → `<Head variant="sheet" title meta onClose={onClose} />` (no `onClose` inside a `Sheet`: the close asks the sheet, `onStateChange('away', 'close')`)
|
|
16
|
+
- a sheet head with a stamp and a flag → `<Head variant="sheet" lead={<AvatarStack><Stamp bare …/></AvatarStack>} title meta actions={<Btn shape="round" icon="flag" label="…"/>} onClose={onClose} />` (up to two `actions`, drawn at the close's size)
|
|
17
|
+
- `<Head centre>` → `<Head variant="centre" lead={<Btn …/>} end={<Btn …/>} title meta />` (no alias)
|
|
18
|
+
- a stack sheet's head → `variant="stack"` (`StackSheet` builds it itself).
|
|
19
|
+
Run `npx cardds codemod-head <files or folders>` on your screens: it rewrites each head written with children through the TypeScript AST and names every head it cannot decide. `cardds check` reports `head-slot` (error) and `head-close-by-hand` (warn). Stories `Head · Plain`, `WithLead`, `WithDate`, `Status`, `Centre`, `SheetClose`, `SheetControlled`, `StackControlled`.
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
- **`Head variant="sheet"`**: the close is drawn (a round ✕ named in the page's language, `closeLabel` for other words) and wired: `onClose`, else the `Sheet` round it goes `away`; with neither (a modal, a card) none is drawn.
|
|
23
|
+
- **`Head variant="status"`**: a `tag` chip and an `end` badge on the first row, the status words (`meta`, never a heading) under them. Knobs `--head-status-font`, `--head-status-ink`.
|
|
24
|
+
- **`Thread`** follows the end of a chat (keyboard up included), with a jump-to-latest button and room at the end; **`Bubble`** shows the author per `Thread authors` and the day only where it changes (`day`, `days`, `showDay`).
|
|
25
|
+
|
|
26
|
+
## 0.7.166 — 2026-10-29
|
|
27
|
+
|
|
28
|
+
`FeedEnd art` is 30% of the feed's width.
|
|
29
|
+
|
|
30
|
+
Components: FeedEnd
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
- **`FeedEnd art` width** (timebank, 2026-10-29): the app's picture stands centred in a box `--feed-end-art-w` wide, default 30% of the feed's width (before: `--feed-end-size`, 96). The drawn cat is unchanged (`--feed-end-size`). Before → after: `style` by hand to centre and size a Lottie → `<FeedEnd art={<MyLottie />} />`, nothing else. Story `CardFeed · EndArt`.
|
|
34
|
+
|
|
5
35
|
## 0.7.165 — 2026-10-29
|
|
6
36
|
|
|
7
37
|
A led line's round ends take their tap again; `FeedEnd art`.
|
package/bin/cardds.mjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// `npx cardds check [dir…]` — the rules of lint/rules.mjs over the project's source; exit 1 on an error. A person's tool, never a session's step.
|
|
4
4
|
// `npx cardds guide` — the few rules no checker sees, as text (the MCP server hands the same text over as its instructions).
|
|
5
5
|
// `npx cardds codemod-parts [--check] <files…>` — rewrite a screen from the retired parts (CardHead, SheetBody, CardFoot…) to Head · Body · Foot · Lead · Words · End.
|
|
6
|
+
// `npx cardds codemod-head [--check] <files or folders…>` — rewrite every Head written with children to its variant and slots (scripts/codemod-head.mjs).
|
|
6
7
|
// `npx cardds list | get <Name> | find [words…] [--represents a,b] [--shape s] [--interact k|none] | scaffold [id]` — the component catalog (lib/catalog.mjs) for an AI session; `npx cardds mcp` serves the same over MCP.
|
|
7
8
|
import { existsSync, readFileSync, readdirSync, statSync, mkdirSync, copyFileSync } from 'node:fs';
|
|
8
9
|
import { dirname, join, relative, resolve } from 'node:path';
|
|
@@ -153,7 +154,7 @@ function ask(cmd, argv) {
|
|
|
153
154
|
return 0;
|
|
154
155
|
}
|
|
155
156
|
|
|
156
|
-
const codemod = (a) => import(
|
|
157
|
-
const code = cmd === 'check' ? check(args) : cmd === 'codemod-parts' ? await codemod(args) : cmd === 'init' ? init() : cmd === 'guide' ? (process.stdout.write(GUIDE), 0) : ['list', 'get', 'find', 'scaffold', 'mcp'].includes(cmd) ? await ask(cmd, args)
|
|
158
|
-
: (console.log('usage: cardds init | guide | check [dir…] | codemod-parts [--check] <files…> | list | get <Name> [--html] | find [words…] [--represents a,b] [--shape s] [--interact k|none] | scaffold [id] [--html [--css <href>]] | mcp (list get find scaffold mcp: --root <path> --json)'), cmd ? 2 : 0);
|
|
157
|
+
const codemod = (which, a) => import(`../scripts/${which}.mjs`).then((m) => m.main(a), (e) => { console.error(`cardds ${which}: ${e.code === 'ERR_MODULE_NOT_FOUND' ? 'it reads the TypeScript compiler: install `typescript` in the project' : e.message}`); return 2; });
|
|
158
|
+
const code = cmd === 'check' ? check(args) : cmd === 'codemod-parts' || cmd === 'codemod-head' ? await codemod(cmd, args) : cmd === 'init' ? init() : cmd === 'guide' ? (process.stdout.write(GUIDE), 0) : ['list', 'get', 'find', 'scaffold', 'mcp'].includes(cmd) ? await ask(cmd, args)
|
|
159
|
+
: (console.log('usage: cardds init | guide | check [dir…] | codemod-parts [--check] <files…> | codemod-head [--check] <files or folders…> | list | get <Name> [--html] | find [words…] [--represents a,b] [--shape s] [--interact k|none] | scaffold [id] [--html [--css <href>]] | mcp (list get find scaffold mcp: --root <path> --json)'), cmd ? 2 : 0);
|
|
159
160
|
process.exitCode = code; // not process.exit: a big answer piped to a reader is cut off by an exit before it is flushed
|
package/css/card.css
CHANGED
|
@@ -318,7 +318,7 @@
|
|
|
318
318
|
/* FeedEnd (Lh 2026-10-29): the end of a feed — a drawn cat, its tail wagging, and a caption. Quiet: the ground's muted ink. */
|
|
319
319
|
.feed-end { display: grid; justify-items: center; gap: var(--sp-2); padding-block: var(--sp-4); color: var(--feed-end-ink, var(--on-surface-muted)); text-align: center; }
|
|
320
320
|
.feed-end__cat { width: var(--feed-end-size, var(--stamp)); height: auto; }
|
|
321
|
-
.feed-end__art { width: var(--feed-end-
|
|
321
|
+
.feed-end__art { width: var(--feed-end-art-w, 30%); } /* the app's own picture: its box is the cat's box */
|
|
322
322
|
.feed-end__art > * { display: block; width: 100%; height: auto; }
|
|
323
323
|
.feed-end__tail { transform-box: view-box; transform-origin: 59.4% 84.7%; } /* the tail's root (57, 61) on the 96 × 72 drawing */
|
|
324
324
|
@keyframes feed-end-wag { 0%, 100% { rotate: calc(var(--feed-end-wag, 14deg) * -1); } 50% { rotate: var(--feed-end-wag, 14deg); } }
|
package/css/lists.css
CHANGED
|
@@ -91,7 +91,14 @@
|
|
|
91
91
|
<div class="bubble"><p class="bubble__body">…</p><span class="bubble__meta">Dec 4 · 8:15</span></div>
|
|
92
92
|
<div class="bubble bubble--right">…</div>
|
|
93
93
|
</div> */
|
|
94
|
-
.thread { display: grid; gap: var(--thread-gap, var(--sp-4)); }
|
|
94
|
+
.thread { display: grid; gap: var(--thread-gap, var(--sp-4)); padding-bottom: var(--thread-end-size, var(--sp-4)); }
|
|
95
|
+
/* the jump to the last words (Thread, Lh 2026-10-29): a row of no height at the thread's end, stuck to the scroller's bottom edge;
|
|
96
|
+
the round Btn hangs up from it at the end corner while the reader is away from the end */
|
|
97
|
+
.thread__end { position: sticky; bottom: 0; height: 0; margin-top: calc(-1 * var(--thread-gap, var(--sp-4))); display: grid; justify-items: end; z-index: 1; }
|
|
98
|
+
.thread__jump { translate: 0 calc(-100% - var(--thread-jump-at, var(--sp-3))); }
|
|
99
|
+
.bubble__author + *::before { content: "·"; margin-inline-end: var(--bubble-meta-gap, var(--sp-1)); }
|
|
100
|
+
.bubble__author:has(+ *) { margin-inline-end: var(--bubble-meta-gap, var(--sp-1)); }
|
|
101
|
+
.bubble__day:has(+ *) { margin-inline-end: var(--bubble-meta-gap, var(--sp-1)); } /* the day, then the time: "Dec 4 8:15" */
|
|
95
102
|
/* one column: the message (max-content, but it gives way — minmax(0) — so a long one shrinks and wraps); the meta under it */
|
|
96
103
|
.bubble {
|
|
97
104
|
display: grid;
|
package/css/parts.css
CHANGED
|
@@ -79,6 +79,9 @@
|
|
|
79
79
|
min-height: var(--head-min-h, auto);
|
|
80
80
|
}
|
|
81
81
|
.head--top { align-items: flex-start; }
|
|
82
|
+
/* `Head variant="status"`: the tag at the left and the end at the far right on the first row, the status words (the meta, a plain line, never a heading)
|
|
83
|
+
under both in the caption's weight and muted ink. The UI face ships weights 400 and 500 only: a heavier one is the browser's fake bold, so no bolder look */
|
|
84
|
+
.head--status > .words__meta { font: var(--head-status-font, var(--type-caption)); color: var(--head-status-ink, var(--card-muted)); }
|
|
82
85
|
|
|
83
86
|
/* ---- the card skeleton: head · content · foot ----
|
|
84
87
|
Every card is a head (the heading left, hints / actions / a more-menu at
|
|
@@ -89,8 +92,9 @@
|
|
|
89
92
|
heading (or the div that wraps it) is that leading child: a control that
|
|
90
93
|
leads a custom head — a chip, an avatar, a tile badge — keeps its own
|
|
91
94
|
width, else the rule stretched a chip into a bar and an avatar into an
|
|
92
|
-
ellipse (two agents and the wallet demo caught it, 2026-09-10).
|
|
93
|
-
|
|
95
|
+
ellipse (two agents and the wallet demo caught it, 2026-09-10). The title takes the room wherever its variant stands it (after a date
|
|
96
|
+
with no chips, after a stack sheet's back), never only as the first child (2026-10-29, the head's variants). */
|
|
97
|
+
.head > :is(h1, h2, h3, div, p):first-child, .head > :is(.words__title, .words__over-title) { flex: 1; min-width: 0; }
|
|
94
98
|
|
|
95
99
|
/* Skeleton head — the heading in a card's OWN head, and only there.
|
|
96
100
|
The heading wraps, no squeeze, up to three lines and cut there with an
|
|
@@ -160,8 +164,7 @@
|
|
|
160
164
|
/* a head that LEADS with a date (Lh 2026-10-21, timebank's request card): a `Head` whose first child is a JourneyBadge and whose second is a
|
|
161
165
|
ChipRow. The date stands at the left and the chips beside it, the two as tall as each other; the heading and its caption take the whole
|
|
162
166
|
width under them, so the heading sits right over the words of the middle. The date is always as tall as the chips. The gap under the date row is --head-lead-gap; the date and the chips place themselves (journey.css, actions.css).
|
|
163
|
-
Everything after the chips stands on rows of its own under them, in the order given
|
|
164
|
-
pinned at the right beside both lines (stamp.css) and so lay over the date (Lh 2026-10-23).
|
|
167
|
+
Everything after the chips stands on rows of its own under them, in the order given.
|
|
165
168
|
<div class="head"><span class="tile-badge tile-badge--stretch">…</span><div class="chip-row">…</div><div><h2 class="words__title t-h1">…</h2>…</div></div> */
|
|
166
169
|
.head:has(> .tile-badge:first-child + .chip-row) {
|
|
167
170
|
display: grid;
|
package/css/stack.css
CHANGED
|
@@ -330,7 +330,7 @@
|
|
|
330
330
|
|
|
331
331
|
/* AT THE END (Lh 2026-09-29, the home): after the tabs, chevron down — the open sheet folds down. The head's end gives it its room
|
|
332
332
|
while open; the last tab then sits on the inset (no reach into the padding) */
|
|
333
|
-
.sheet-stack--tap .sheet-stack__back--end { left: auto; right: 0; }
|
|
333
|
+
:is(.sheet-stack--tap > .card, .sheet-stack--tap > :not(.card, .sheet-stack__base) > .card) > .head > .sheet-stack__back--end { left: auto; right: 0; } /* as specific as the rule that sets it at the start (above), so it wins: a shorter selector lost, and the back stood over the title */
|
|
334
334
|
.sheet-stack--tap > .card.is-open > .head:has(> .sheet-stack__back--end) > .stack-sheet__tabs { margin-right: 0; }
|
|
335
335
|
.sheet-stack--tap .sheet-stack__back > .icon { --icon-size: var(--stack-back-icon, calc(var(--tap-base) * 13 / 24)); } /* 26: the chevron fills the small disc (Lh 2026-09-23) */
|
|
336
336
|
.sheet-stack--tap .sheet-stack__back::after { content: ""; position: absolute; inset: calc((var(--_back-size) - var(--tap-sm)) / 2); }
|
package/dist/cardds.css
CHANGED
|
@@ -1341,7 +1341,7 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
|
|
|
1341
1341
|
/* FeedEnd (Lh 2026-10-29): the end of a feed — a drawn cat, its tail wagging, and a caption. Quiet: the ground's muted ink. */
|
|
1342
1342
|
.feed-end { display: grid; justify-items: center; gap: var(--sp-2); padding-block: var(--sp-4); color: var(--feed-end-ink, var(--on-surface-muted)); text-align: center; }
|
|
1343
1343
|
.feed-end__cat { width: var(--feed-end-size, var(--stamp)); height: auto; }
|
|
1344
|
-
.feed-end__art { width: var(--feed-end-
|
|
1344
|
+
.feed-end__art { width: var(--feed-end-art-w, 30%); } /* the app's own picture: its box is the cat's box */
|
|
1345
1345
|
.feed-end__art > * { display: block; width: 100%; height: auto; }
|
|
1346
1346
|
.feed-end__tail { transform-box: view-box; transform-origin: 59.4% 84.7%; } /* the tail's root (57, 61) on the 96 × 72 drawing */
|
|
1347
1347
|
@keyframes feed-end-wag { 0%, 100% { rotate: calc(var(--feed-end-wag, 14deg) * -1); } 50% { rotate: var(--feed-end-wag, 14deg); } }
|
|
@@ -1970,7 +1970,7 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
|
|
|
1970
1970
|
|
|
1971
1971
|
/* AT THE END (Lh 2026-09-29, the home): after the tabs, chevron down — the open sheet folds down. The head's end gives it its room
|
|
1972
1972
|
while open; the last tab then sits on the inset (no reach into the padding) */
|
|
1973
|
-
.sheet-stack--tap .sheet-stack__back--end { left: auto; right: 0; }
|
|
1973
|
+
:is(.sheet-stack--tap > .card, .sheet-stack--tap > :not(.card, .sheet-stack__base) > .card) > .head > .sheet-stack__back--end { left: auto; right: 0; } /* as specific as the rule that sets it at the start (above), so it wins: a shorter selector lost, and the back stood over the title */
|
|
1974
1974
|
.sheet-stack--tap > .card.is-open > .head:has(> .sheet-stack__back--end) > .stack-sheet__tabs { margin-right: 0; }
|
|
1975
1975
|
.sheet-stack--tap .sheet-stack__back > .icon { --icon-size: var(--stack-back-icon, calc(var(--tap-base) * 13 / 24)); } /* 26: the chevron fills the small disc (Lh 2026-09-23) */
|
|
1976
1976
|
.sheet-stack--tap .sheet-stack__back::after { content: ""; position: absolute; inset: calc((var(--_back-size) - var(--tap-sm)) / 2); }
|
|
@@ -4399,7 +4399,14 @@ button.calendar__label:focus-visible { outline: var(--focus); outline-offset: va
|
|
|
4399
4399
|
<div class="bubble"><p class="bubble__body">…</p><span class="bubble__meta">Dec 4 · 8:15</span></div>
|
|
4400
4400
|
<div class="bubble bubble--right">…</div>
|
|
4401
4401
|
</div> */
|
|
4402
|
-
.thread { display: grid; gap: var(--thread-gap, var(--sp-4)); }
|
|
4402
|
+
.thread { display: grid; gap: var(--thread-gap, var(--sp-4)); padding-bottom: var(--thread-end-size, var(--sp-4)); }
|
|
4403
|
+
/* the jump to the last words (Thread, Lh 2026-10-29): a row of no height at the thread's end, stuck to the scroller's bottom edge;
|
|
4404
|
+
the round Btn hangs up from it at the end corner while the reader is away from the end */
|
|
4405
|
+
.thread__end { position: sticky; bottom: 0; height: 0; margin-top: calc(-1 * var(--thread-gap, var(--sp-4))); display: grid; justify-items: end; z-index: 1; }
|
|
4406
|
+
.thread__jump { translate: 0 calc(-100% - var(--thread-jump-at, var(--sp-3))); }
|
|
4407
|
+
.bubble__author + *::before { content: "·"; margin-inline-end: var(--bubble-meta-gap, var(--sp-1)); }
|
|
4408
|
+
.bubble__author:has(+ *) { margin-inline-end: var(--bubble-meta-gap, var(--sp-1)); }
|
|
4409
|
+
.bubble__day:has(+ *) { margin-inline-end: var(--bubble-meta-gap, var(--sp-1)); } /* the day, then the time: "Dec 4 8:15" */
|
|
4403
4410
|
/* one column: the message (max-content, but it gives way — minmax(0) — so a long one shrinks and wraps); the meta under it */
|
|
4404
4411
|
.bubble {
|
|
4405
4412
|
display: grid;
|
|
@@ -4607,6 +4614,9 @@ a.bubble { color: inherit; text-decoration: none; }
|
|
|
4607
4614
|
min-height: var(--head-min-h, auto);
|
|
4608
4615
|
}
|
|
4609
4616
|
.head--top { align-items: flex-start; }
|
|
4617
|
+
/* `Head variant="status"`: the tag at the left and the end at the far right on the first row, the status words (the meta, a plain line, never a heading)
|
|
4618
|
+
under both in the caption's weight and muted ink. The UI face ships weights 400 and 500 only: a heavier one is the browser's fake bold, so no bolder look */
|
|
4619
|
+
.head--status > .words__meta { font: var(--head-status-font, var(--type-caption)); color: var(--head-status-ink, var(--card-muted)); }
|
|
4610
4620
|
|
|
4611
4621
|
/* ---- the card skeleton: head · content · foot ----
|
|
4612
4622
|
Every card is a head (the heading left, hints / actions / a more-menu at
|
|
@@ -4617,8 +4627,9 @@ a.bubble { color: inherit; text-decoration: none; }
|
|
|
4617
4627
|
heading (or the div that wraps it) is that leading child: a control that
|
|
4618
4628
|
leads a custom head — a chip, an avatar, a tile badge — keeps its own
|
|
4619
4629
|
width, else the rule stretched a chip into a bar and an avatar into an
|
|
4620
|
-
ellipse (two agents and the wallet demo caught it, 2026-09-10).
|
|
4621
|
-
|
|
4630
|
+
ellipse (two agents and the wallet demo caught it, 2026-09-10). The title takes the room wherever its variant stands it (after a date
|
|
4631
|
+
with no chips, after a stack sheet's back), never only as the first child (2026-10-29, the head's variants). */
|
|
4632
|
+
.head > :is(h1, h2, h3, div, p):first-child, .head > :is(.words__title, .words__over-title) { flex: 1; min-width: 0; }
|
|
4622
4633
|
|
|
4623
4634
|
/* Skeleton head — the heading in a card's OWN head, and only there.
|
|
4624
4635
|
The heading wraps, no squeeze, up to three lines and cut there with an
|
|
@@ -4688,8 +4699,7 @@ a.bubble { color: inherit; text-decoration: none; }
|
|
|
4688
4699
|
/* a head that LEADS with a date (Lh 2026-10-21, timebank's request card): a `Head` whose first child is a JourneyBadge and whose second is a
|
|
4689
4700
|
ChipRow. The date stands at the left and the chips beside it, the two as tall as each other; the heading and its caption take the whole
|
|
4690
4701
|
width under them, so the heading sits right over the words of the middle. The date is always as tall as the chips. The gap under the date row is --head-lead-gap; the date and the chips place themselves (journey.css, actions.css).
|
|
4691
|
-
Everything after the chips stands on rows of its own under them, in the order given
|
|
4692
|
-
pinned at the right beside both lines (stamp.css) and so lay over the date (Lh 2026-10-23).
|
|
4702
|
+
Everything after the chips stands on rows of its own under them, in the order given.
|
|
4693
4703
|
<div class="head"><span class="tile-badge tile-badge--stretch">…</span><div class="chip-row">…</div><div><h2 class="words__title t-h1">…</h2>…</div></div> */
|
|
4694
4704
|
.head:has(> .tile-badge:first-child + .chip-row) {
|
|
4695
4705
|
display: grid;
|
package/dist/cards/Card.js
CHANGED
|
@@ -3,6 +3,7 @@ import { Children, createElement, isValidElement, useEffect, useLayoutEffect, us
|
|
|
3
3
|
import { cx } from '../cx.js';
|
|
4
4
|
import { useControlled, useLatest, warnOnce } from '../state.js';
|
|
5
5
|
import { Head } from '../parts/Head.js';
|
|
6
|
+
import { HeadCloseCtx } from '../parts/headCtx.js';
|
|
6
7
|
import { Foot } from '../parts/Foot.js';
|
|
7
8
|
import { goControl, onControl } from './cardGo.js';
|
|
8
9
|
import { Icon } from '../type/Icon.js';
|
|
@@ -121,7 +122,7 @@ export function Card({ tone, paper, sm, row, cover, fold, centre, wide, band, as
|
|
|
121
122
|
if (!stack.open && !stack.before && !stack.after)
|
|
122
123
|
stack.onOpen();
|
|
123
124
|
};
|
|
124
|
-
const inner = (body) => (_jsx(StackHeadCtx.Provider, { value: stack ? (stack.before || stack.after ? -1 : 0) : null, children: _jsx(StackPullCtx.Provider, { value: pulling, children: body }) }));
|
|
125
|
+
const inner = (body) => (_jsx(StackHeadCtx.Provider, { value: stack ? (stack.before || stack.after ? -1 : 0) : null, children: _jsx(StackPullCtx.Provider, { value: pulling, children: _jsx(HeadCloseCtx.Provider, { value: null, children: body }) }) }));
|
|
125
126
|
const props = {
|
|
126
127
|
...rest,
|
|
127
128
|
ref: setRef,
|
package/dist/cards/CardFeed.js
CHANGED
|
@@ -3,7 +3,6 @@ import { Children, createContext, isValidElement, useContext, useEffect, useId,
|
|
|
3
3
|
import { cx } from '../cx.js';
|
|
4
4
|
import { glide, reducedMotion, setRefs, sheetMs, stopMoves, useControlled, warnOnce } from '../state.js';
|
|
5
5
|
import { Card } from './Card.js';
|
|
6
|
-
import { Head } from '../parts/Head.js';
|
|
7
6
|
import { Foot } from '../parts/Foot.js';
|
|
8
7
|
import { Lead } from '../parts/Lead.js';
|
|
9
8
|
import { Icon } from '../type/Icon.js';
|
|
@@ -120,5 +119,5 @@ export function FeedCard({ id, heading, caption, icon, lead, tone, foot, classNa
|
|
|
120
119
|
byKey.current = e.detail === 0;
|
|
121
120
|
feed.grow(id);
|
|
122
121
|
} }, onKeyDown: (e) => { onKeyDown?.(e); if (small && !e.defaultPrevented)
|
|
123
|
-
onSmallKey(e); }, children: [_jsxs(
|
|
122
|
+
onSmallKey(e); }, children: [_jsxs("div", { className: "head", children: [lead != null ? _jsx("span", { className: "feed-card__lead", children: lead }) : icon && _jsx(Lead, { children: _jsx(Icon, { name: icon, size: "sm" }) }), _jsx(Text, { level: "h2", id: name, children: heading }), caption != null && _jsx(Text, { level: "caption", muted: true, children: caption })] }), _jsx("div", { className: "feed-card__more", inert: small, children: _jsxs("div", { className: "feed-card__rest", children: [children, foot != null && _jsx(Foot, { children: foot })] }) })] }));
|
|
124
123
|
}
|
package/dist/cards/FeedEnd.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { ComponentProps, ReactNode } from 'react';
|
|
|
2
2
|
export interface FeedEndProps extends Omit<ComponentProps<'div'>, 'children'> {
|
|
3
3
|
/** the one line under the cat, in the app's own words ("you've seen it all") — omit it for the cat alone */
|
|
4
4
|
children?: ReactNode;
|
|
5
|
-
/** the app's own picture in place of the drawn cat (a Lottie player, an img, an svg): it is drawn in a box `--feed-end-
|
|
5
|
+
/** the app's own picture in place of the drawn cat (a Lottie player, an img, an svg): it is drawn centred in a box `--feed-end-art-w` wide (default 30% of the feed's width) and fills it; cardds plays nothing, the app's player does. Hidden from a screen reader — `children` or `label` names the end */
|
|
6
6
|
art?: ReactNode;
|
|
7
7
|
/** the cat's spoken name when there is no caption to read out */
|
|
8
8
|
label?: string;
|
|
@@ -10,5 +10,5 @@ export interface FeedEndProps extends Omit<ComponentProps<'div'>, 'children'> {
|
|
|
10
10
|
/** FeedEnd — "this is the end of the feed": a small drawn cat sitting with its tail wagging, quiet (the muted ink of the ground), and an optional
|
|
11
11
|
* one-line caption under it. Stands under the LAST card of a scrolling feed: pass it as a `CardFeed`'s `end` (the feed then asks for no more), or put it
|
|
12
12
|
* after the cards yourself. It keeps the card's width and centres, so a short feed ends on it as a long one does. The tail wags forever; under
|
|
13
|
-
* reduced motion the cat sits still. `art` swaps the drawn cat for the app's own picture (its Lottie, an image). Knobs `--feed-end-size` (the
|
|
13
|
+
* reduced motion the cat sits still. `art` swaps the drawn cat for the app's own picture (its Lottie, an image). Knobs `--feed-end-size` (the drawn cat's width) · `--feed-end-art-w` (the `art` box's width, 30%) · `--feed-end-ink` · `--feed-end-wag`. */
|
|
14
14
|
export declare function FeedEnd({ children, label, art, className, ...rest }: FeedEndProps): import("react").JSX.Element;
|
package/dist/cards/FeedEnd.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Text } from '../type/Text.js';
|
|
|
4
4
|
/** FeedEnd — "this is the end of the feed": a small drawn cat sitting with its tail wagging, quiet (the muted ink of the ground), and an optional
|
|
5
5
|
* one-line caption under it. Stands under the LAST card of a scrolling feed: pass it as a `CardFeed`'s `end` (the feed then asks for no more), or put it
|
|
6
6
|
* after the cards yourself. It keeps the card's width and centres, so a short feed ends on it as a long one does. The tail wags forever; under
|
|
7
|
-
* reduced motion the cat sits still. `art` swaps the drawn cat for the app's own picture (its Lottie, an image). Knobs `--feed-end-size` (the
|
|
7
|
+
* reduced motion the cat sits still. `art` swaps the drawn cat for the app's own picture (its Lottie, an image). Knobs `--feed-end-size` (the drawn cat's width) · `--feed-end-art-w` (the `art` box's width, 30%) · `--feed-end-ink` · `--feed-end-wag`. */
|
|
8
8
|
export function FeedEnd({ children, label, art, className, ...rest }) {
|
|
9
9
|
return (_jsxs("div", { className: cx('feed-end', className), role: "note", "aria-label": children == null ? label : undefined, ...rest, children: [art != null ? _jsx("div", { className: "feed-end__art", "aria-hidden": "true", children: art }) : _jsxs("svg", { className: "feed-end__cat", viewBox: "0 0 96 72", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("path", { className: "feed-end__tail", d: "M57 61C70 61 74 52 72 40" }), _jsx("path", { d: "M30 65C21 65 19 52 23 43C26 36 31 33 36 33C46 33 55 40 57 50C59 59 56 65 50 65Z" }), _jsx("path", { d: "M23 23C23 15 28 12 34 12C40 12 45 15 45 23C45 30 40 34 34 34C28 34 23 30 23 23Z" }), _jsx("path", { d: "M25 16L24 5L32 12M43 16L44 5L36 12M30 22V24M38 22V24M32 28H36" })] }), children != null && _jsx(Text, { level: "caption", muted: true, as: "p", children: children })] }));
|
|
10
10
|
}
|