@usableapp/cardds 0.7.135 → 0.7.136

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
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.136 — 2026-10-25
6
+
7
+ A `MapArea` owns its gestures and sits in a thin frame. An icon in a `Link` is now the words' x-height, on their band.
8
+
9
+ Components: MapArea, Link, SheetStack, Walkthrough
10
+
11
+ ### Added
12
+ - **A region that owns its gestures: `data-gestures="own"`.** A touch or drag that starts in it moves only what is in it, never the page, a sheet's body or a sheet round it. The region gets `touch-action: none` and `overscroll-behavior: contain`, and on iOS a non-passive `touchmove`. A stack's pull and a Walkthrough's swipe stay out of it. Any region can take the attribute.
13
+ - **`MapArea` owns its gestures.** A drag in the map (e.g. Google Maps with `gestureHandling: 'greedy'`) pans only the map; the sheet body and the sheet stay still. The engine still gets every touch, and the app adds nothing. Story `MapArea · OwnsGestures`.
14
+ - **An inline `MapArea` sits in a thin grey frame**, the same edge as the joined `BtnGroup look="choice"` (`--border-w`, `--outline`, `--r-chip`), with the map clipped to its corner. Knob `--map-area-edge-ink`. `bleed` keeps only the top and bottom rules.
15
+
16
+ ### Changed
17
+ - **An `Icon` in a `Link` is the words' x-height** (`1ex`, knob `--link-icon-size`; it was `1em` in 0.7.135, which still stood taller than the words). Its bottom sits on the words' baseline and its top on their x-height line, instead of being centred on a line box that Thai marks make taller. The line is centred in the link's height. The JSX is unchanged. Stories `Link · WithIcon` and `Foot · SplitLinks` now have Thai rows.
18
+
5
19
  ## 0.7.135 — 2026-10-25
6
20
 
7
21
  An `Icon` in a `Link` is now as tall as the link's words.
package/bin/cardds.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- // `npx cardds init` — set a project up the ONE way (Lh 2026-09-29): the project's theme.css, the check script, the ESLint rules.
3
- // `npx cardds check [dir…]` — the rules of lint/rules.mjs over the project's source; exit 1 on an error.
2
+ // `npx cardds init` — set a project up the ONE way (Lh 2026-09-29): the project's theme.css, the ESLint rules.
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
6
  // `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
- import { existsSync, readFileSync, writeFileSync, readdirSync, statSync, mkdirSync, copyFileSync } from 'node:fs';
7
+ import { existsSync, readFileSync, readdirSync, statSync, mkdirSync, copyFileSync } from 'node:fs';
8
8
  import { dirname, join, relative, resolve } from 'node:path';
9
9
  import { fileURLToPath } from 'node:url';
10
10
  import { checkSource } from '../lint/rules.mjs';
@@ -58,22 +58,12 @@ function init() {
58
58
  if (existsSync(theme)) say(false, `${relative(cwd, theme)} is there — kept`);
59
59
  else { mkdirSync(dirname(theme), { recursive: true }); copyFileSync(join(PKG, 'css', 'theme.template.css'), theme); say(true, `${relative(cwd, theme)} — the project's look: set the bases there, nothing else`); }
60
60
 
61
- // 2 · the check, as a script the project (and its AI) runs before a screen is called done
62
- const pkgFile = join(cwd, 'package.json');
63
- if (existsSync(pkgFile)) {
64
- const pkg = JSON.parse(readFileSync(pkgFile, 'utf8'));
65
- pkg.scripts ??= {};
66
- if (pkg.scripts['cardds:check']) say(false, 'package.json "cardds:check" is there — kept');
67
- else { pkg.scripts['cardds:check'] = `cardds check ${src === '.' ? '' : src}`.trim(); writeFileSync(pkgFile, JSON.stringify(pkg, null, 2) + '\n'); say(true, 'package.json "cardds:check" — run it before a screen is done'); }
68
- }
69
-
70
- // 3 · the same rules in the editor, where the project has ESLint (flat config)
61
+ // 2 · the same rules in the editor, where the project has ESLint (flat config)
71
62
  const eslint = ['eslint.config.js', 'eslint.config.mjs', 'eslint.config.ts'].map((f) => join(cwd, f)).find(existsSync);
72
63
  if (eslint && /@usableapp\/cardds\/eslint/.test(readFileSync(eslint, 'utf8'))) say(false, `${relative(cwd, eslint)} has the cardds rules — kept`);
73
64
  else if (eslint) say(false, `${relative(cwd, eslint)}: add import cardds from '@usableapp/cardds/eslint' and cardds.configs.recommended to its array`);
74
- else say(false, 'no ESLint here — `npm run cardds:check` carries the same rules');
75
65
 
76
- // 4 · the page's <html>: its lang names the controls (without it they read English); a theme with colours of its own wants data-palette
66
+ // 3 · the page's <html>: its lang names the controls (without it they read English); a theme with colours of its own wants data-palette
77
67
  const FIELD = ['index.html', 'src/index.html', 'web/index.html', 'app/index.html', 'public/index.html'];
78
68
  const entry = FIELD.map((f) => join(cwd, f)).find(existsSync);
79
69
  if (!entry) say(false, `no index.html found (looked in ${FIELD.join(', ')}) — put lang="th" (or the app's language) on <html>: cardds names its controls from it`);
package/css/actions.css CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  /* KNOBS (Lh 2026-09-21) — cardds is a framework: a project adjusts ONE component from outside, without touching this file.
7
7
  A knob is a custom property a rule reads WITH ITS DEFAULT AS THE FALLBACK — `padding-inline: var(--btn-pad-x, var(--sp-6))` —
8
- so it is declared nowhere: unset, nothing moves (tests/style-snapshot proves it); set in the project's theme.css it retunes
8
+ so it is declared nowhere: unset, nothing moves; set in the project's theme.css it retunes
9
9
  that component everywhere; set on any element it retunes the components inside that element only. Names: --<component>-<what>
10
10
  (--btn-pad-x, --chip-bg, --icon-btn-size, --appbar-pad-x); a variant says so (--btn-primary-bg, --chip-on-ink, --icon-btn-sm-size).
11
11
  The sizes that already were root tokens (--btn-h, --chip-h, --bar-h, --header-h, --fab…) are knobs too — set them the same way.
@@ -214,7 +214,7 @@
214
214
  .chip--xs { min-height: 0; gap: var(--chip-xs-gap, var(--sp-0)); padding: var(--chip-xs-pad-y, var(--sp-0)) var(--chip-xs-pad-x, var(--sp-1)); font-size: var(--chip-xs-font-size, var(--fs-2xs)); line-height: var(--chip-xs-line, var(--lh-tight)); }
215
215
  .chip--xs > .icon { width: var(--chip-xs-icon-size, 1em); height: var(--chip-xs-icon-size, 1em); }
216
216
  /* soft: the accent washed into the chip's ground, no edge — a status to see, quieter than on (was the inbox Ribbon, Lh 2026-10-21) */
217
- .chip--soft { background: var(--chip-soft-bg, var(--accent-wash)); color: var(--chip-soft-ink, var(--card-ink)); border-color: transparent; } /* the wash on the chip's own paper, opaque (--accent-wash): see-through, a dark tone came through under the light side's ink (ink.spec) */
217
+ .chip--soft { background: var(--chip-soft-bg, var(--accent-wash)); color: var(--chip-soft-ink, var(--card-ink)); border-color: transparent; } /* the wash on the chip's own paper, opaque (--accent-wash): see-through, a dark tone came through under the light side's ink */
218
218
  .chip--on { background: var(--chip-on-bg, var(--accent)); --dark: var(--accent-dark); color: var(--chip-on-ink, var(--card-ink)); border-color: transparent; }
219
219
  /* muted: an untouched default — the words wash out, the edge stays; emphasis is the difference from the neighbours (docs/reference.md 13) */
220
220
  .chip--muted { color: var(--chip-muted-ink, var(--card-muted)); } /* the chip's own fill's muted words: a muted chip on the dark card is still a light chip */
package/css/base.css CHANGED
@@ -373,3 +373,7 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
373
373
  overflow-y: auto;
374
374
  overscroll-behavior: contain;
375
375
  }
376
+
377
+ /* a region that owns its gestures (`data-gestures="own"`: a map, a canvas) — a touch that starts in it pans, pinches or drags only
378
+ what is in it: never the page, a sheet's body or a sheet round it (state.ts `ownsGestures`, `useOwnGestures`) */
379
+ [data-gestures="own"] { touch-action: none; overscroll-behavior: contain; }
package/css/lists.css CHANGED
@@ -188,9 +188,13 @@
188
188
  .link--error { color: var(--link-error-ink, var(--signal-error)); } /* a move that undoes or ends something ("cancel the request"): the signal set's error, the word that says it */
189
189
  .link:disabled { color: var(--link-disabled-ink, var(--card-muted)); cursor: default; } /* inactive = muted (a Countdown) */
190
190
  .link--wait { font-variant-numeric: tabular-nums; } /* the countdown's digits keep their width: the words do not jiggle each second */
191
- /* an icon in a link is as tall as the link's words (TT 2026-10-25: an Icon xs, 16, stood over Link sm's 15): it takes the link's own text
192
- size, whatever `size` the app gave it, through the Icon's own knobs. Centred on the words by the link's align-items, its gap kept */
193
- .link > .icon { --icon-size: var(--link-icon-size, 1em); --icon-xs-size: var(--icon-size); --icon-sm-size: var(--icon-size); --icon-lg-size: var(--icon-size); }
191
+ /* an icon in a link is as tall as the link's words READ (Lh 2026-10-25: "to a human eye the x-height line IS the text's height"): 1ex,
192
+ whatever `size` the app gave it, through the Icon's own knobs. It stands ON the words' x-height band: baseline alignment puts its bottom
193
+ (an svg's baseline) on the words' baseline, so its top is their x-height line — never centred on the line box, whose Thai marks above
194
+ and below would lift it. Baseline-aligned items sit at the top of their line, so the link wraps (one line still) and centres that line
195
+ in its min-height box with align-content; the gap kept */
196
+ .link > .icon { --icon-size: var(--link-icon-size, 1ex); --icon-xs-size: var(--icon-size); --icon-sm-size: var(--icon-size); --icon-lg-size: var(--icon-size); }
197
+ .link:has(> .icon) { flex-wrap: wrap; align-items: baseline; align-content: center; }
194
198
 
195
199
  /* ---- bullets: a list, each item led by a small square picture as tall as a line of its words (Lh 2026-09-28, timebank #153) ----
196
200
  <ul class="bullets"><li class="bullets__item"><img class="bullets__pic" alt=""><span class="bullets__text">…</span></li></ul>
package/css/sheet.css CHANGED
@@ -351,10 +351,12 @@
351
351
  --_band-centre: 50%;
352
352
  position: relative;
353
353
  min-height: var(--map-inline-h, calc(var(--map-ring) * 3 / 2));
354
- border-radius: var(--map-radius, var(--r-media));
355
- overflow: hidden;
354
+ /* a thin grey frame, the joined BtnGroup look="choice"'s edge (actions.css .segment--choice): its width, its ink, its corner; the map clipped to it */
355
+ border: var(--border-w) solid var(--map-area-edge-ink, var(--outline));
356
+ border-radius: var(--map-radius, var(--r-chip));
357
+ overflow: clip;
356
358
  }
357
- .map--bleed { margin-inline: calc(-1 * var(--card-pad, 0rem)); border-radius: 0; } /* edge to edge is a band, and a band has no corner; --map-radius is for the box in the inset */
359
+ .map--bleed { margin-inline: calc(-1 * var(--card-pad, 0rem)); border-radius: 0; border-inline: 0; } /* edge to edge is a band, and a band has no corner; --map-radius is for the box in the inset */
358
360
  /* a map that is a body's only child fills it; the body turns to a column for it (parts.css) */
359
361
  .body > .map--inline:only-child { flex: 1 0 auto; }
360
362
 
@@ -12,7 +12,7 @@
12
12
  value (--card-pad, --bar-reserve, --sheet-*).
13
13
 
14
14
  The values below are the defaults (the wireframe): as shipped, this
15
- file changes nothing (tests/tokens.spec.js holds it to that).
15
+ file changes nothing.
16
16
 
17
17
  On :root only. The size tokens are computed where tokens.css declares
18
18
  them (:root), so a base set on a subtree does not reach them.
package/dist/cardds.css CHANGED
@@ -945,6 +945,10 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
945
945
  overscroll-behavior: contain;
946
946
  }
947
947
 
948
+ /* a region that owns its gestures (`data-gestures="own"`: a map, a canvas) — a touch that starts in it pans, pinches or drags only
949
+ what is in it: never the page, a sheet's body or a sheet round it (state.ts `ownsGestures`, `useOwnGestures`) */
950
+ [data-gestures="own"] { touch-action: none; overscroll-behavior: contain; }
951
+
948
952
  /* ---- css/card.css — card boundary + list variants ---- */
949
953
  /* ============================================================
950
954
  cardds/card.css — the card boundary + list variants
@@ -2216,10 +2220,12 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
2216
2220
  --_band-centre: 50%;
2217
2221
  position: relative;
2218
2222
  min-height: var(--map-inline-h, calc(var(--map-ring) * 3 / 2));
2219
- border-radius: var(--map-radius, var(--r-media));
2220
- overflow: hidden;
2223
+ /* a thin grey frame, the joined BtnGroup look="choice"'s edge (actions.css .segment--choice): its width, its ink, its corner; the map clipped to it */
2224
+ border: var(--border-w) solid var(--map-area-edge-ink, var(--outline));
2225
+ border-radius: var(--map-radius, var(--r-chip));
2226
+ overflow: clip;
2221
2227
  }
2222
- .map--bleed { margin-inline: calc(-1 * var(--card-pad, 0rem)); border-radius: 0; } /* edge to edge is a band, and a band has no corner; --map-radius is for the box in the inset */
2228
+ .map--bleed { margin-inline: calc(-1 * var(--card-pad, 0rem)); border-radius: 0; border-inline: 0; } /* edge to edge is a band, and a band has no corner; --map-radius is for the box in the inset */
2223
2229
  /* a map that is a body's only child fills it; the body turns to a column for it (parts.css) */
2224
2230
  .body > .map--inline:only-child { flex: 1 0 auto; }
2225
2231
 
@@ -2698,7 +2704,7 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
2698
2704
 
2699
2705
  /* KNOBS (Lh 2026-09-21) — cardds is a framework: a project adjusts ONE component from outside, without touching this file.
2700
2706
  A knob is a custom property a rule reads WITH ITS DEFAULT AS THE FALLBACK — `padding-inline: var(--btn-pad-x, var(--sp-6))` —
2701
- so it is declared nowhere: unset, nothing moves (tests/style-snapshot proves it); set in the project's theme.css it retunes
2707
+ so it is declared nowhere: unset, nothing moves; set in the project's theme.css it retunes
2702
2708
  that component everywhere; set on any element it retunes the components inside that element only. Names: --<component>-<what>
2703
2709
  (--btn-pad-x, --chip-bg, --icon-btn-size, --appbar-pad-x); a variant says so (--btn-primary-bg, --chip-on-ink, --icon-btn-sm-size).
2704
2710
  The sizes that already were root tokens (--btn-h, --chip-h, --bar-h, --header-h, --fab…) are knobs too — set them the same way.
@@ -2907,7 +2913,7 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
2907
2913
  .chip--xs { min-height: 0; gap: var(--chip-xs-gap, var(--sp-0)); padding: var(--chip-xs-pad-y, var(--sp-0)) var(--chip-xs-pad-x, var(--sp-1)); font-size: var(--chip-xs-font-size, var(--fs-2xs)); line-height: var(--chip-xs-line, var(--lh-tight)); }
2908
2914
  .chip--xs > .icon { width: var(--chip-xs-icon-size, 1em); height: var(--chip-xs-icon-size, 1em); }
2909
2915
  /* soft: the accent washed into the chip's ground, no edge — a status to see, quieter than on (was the inbox Ribbon, Lh 2026-10-21) */
2910
- .chip--soft { background: var(--chip-soft-bg, var(--accent-wash)); color: var(--chip-soft-ink, var(--card-ink)); border-color: transparent; } /* the wash on the chip's own paper, opaque (--accent-wash): see-through, a dark tone came through under the light side's ink (ink.spec) */
2916
+ .chip--soft { background: var(--chip-soft-bg, var(--accent-wash)); color: var(--chip-soft-ink, var(--card-ink)); border-color: transparent; } /* the wash on the chip's own paper, opaque (--accent-wash): see-through, a dark tone came through under the light side's ink */
2911
2917
  .chip--on { background: var(--chip-on-bg, var(--accent)); --dark: var(--accent-dark); color: var(--chip-on-ink, var(--card-ink)); border-color: transparent; }
2912
2918
  /* muted: an untouched default — the words wash out, the edge stays; emphasis is the difference from the neighbours (docs/reference.md 13) */
2913
2919
  .chip--muted { color: var(--chip-muted-ink, var(--card-muted)); } /* the chip's own fill's muted words: a muted chip on the dark card is still a light chip */
@@ -4192,9 +4198,13 @@ button.calendar__label:focus-visible { outline: var(--focus); outline-offset: va
4192
4198
  .link--error { color: var(--link-error-ink, var(--signal-error)); } /* a move that undoes or ends something ("cancel the request"): the signal set's error, the word that says it */
4193
4199
  .link:disabled { color: var(--link-disabled-ink, var(--card-muted)); cursor: default; } /* inactive = muted (a Countdown) */
4194
4200
  .link--wait { font-variant-numeric: tabular-nums; } /* the countdown's digits keep their width: the words do not jiggle each second */
4195
- /* an icon in a link is as tall as the link's words (TT 2026-10-25: an Icon xs, 16, stood over Link sm's 15): it takes the link's own text
4196
- size, whatever `size` the app gave it, through the Icon's own knobs. Centred on the words by the link's align-items, its gap kept */
4197
- .link > .icon { --icon-size: var(--link-icon-size, 1em); --icon-xs-size: var(--icon-size); --icon-sm-size: var(--icon-size); --icon-lg-size: var(--icon-size); }
4201
+ /* an icon in a link is as tall as the link's words READ (Lh 2026-10-25: "to a human eye the x-height line IS the text's height"): 1ex,
4202
+ whatever `size` the app gave it, through the Icon's own knobs. It stands ON the words' x-height band: baseline alignment puts its bottom
4203
+ (an svg's baseline) on the words' baseline, so its top is their x-height line — never centred on the line box, whose Thai marks above
4204
+ and below would lift it. Baseline-aligned items sit at the top of their line, so the link wraps (one line still) and centres that line
4205
+ in its min-height box with align-content; the gap kept */
4206
+ .link > .icon { --icon-size: var(--link-icon-size, 1ex); --icon-xs-size: var(--icon-size); --icon-sm-size: var(--icon-size); --icon-lg-size: var(--icon-size); }
4207
+ .link:has(> .icon) { flex-wrap: wrap; align-items: baseline; align-content: center; }
4198
4208
 
4199
4209
  /* ---- bullets: a list, each item led by a small square picture as tall as a line of its words (Lh 2026-09-28, timebank #153) ----
4200
4210
  <ul class="bullets"><li class="bullets__item"><img class="bullets__pic" alt=""><span class="bullets__text">…</span></li></ul>