@usableapp/cardds 0.7.139 → 0.7.140
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/css/actions.css +5 -5
- package/css/card.css +2 -0
- package/css/choice.css +23 -22
- package/css/forms.css +3 -3
- package/css/sheet.css +2 -2
- package/css/theme.template.css +1 -1
- package/css/tokens.css +13 -5
- package/dist/cardds.css +48 -37
- package/dist/cards/Card.d.ts +5 -2
- package/dist/cards/Card.js +4 -4
- package/dist/catalog.json +1 -1
- package/dist/forms/Field.d.ts +3 -3
- package/dist/forms/Field.js +3 -3
- package/dist/forms/Pin.d.ts +1 -1
- package/dist/forms/Pin.js +1 -1
- package/dist/type/textScale.d.ts +4 -1
- package/dist/type/textScale.js +4 -1
- package/docs/reference.md +9 -5
- package/lint/rules.mjs +3 -2
- package/package.json +1 -1
package/dist/forms/Field.d.ts
CHANGED
|
@@ -37,9 +37,9 @@ export interface FieldProps extends Omit<ComponentProps<'input'>, 'className' |
|
|
|
37
37
|
/** the digits of `v`, written into `mask`; a mark is written only when a digit comes after it */
|
|
38
38
|
export declare function applyMask(v: string, mask: string): string;
|
|
39
39
|
/**
|
|
40
|
-
* Field — the flat outlined input
|
|
41
|
-
*
|
|
42
|
-
* (
|
|
40
|
+
* Field — the flat outlined input. A form's fields stand on the SHEET, the paper the member fills in (Lh 2026-10-18): a Sheet's `Body`, a
|
|
41
|
+
* `SheetStep`, or a stack sheet, 1–3 per step. One Field may also stand on a `Card`, either face — words written on the card itself, a
|
|
42
|
+
* thank-you (Lh 2026-10-26); the other controls the member fills or picks never do (`cardds check` rule `field-in-card`).
|
|
43
43
|
* The LABEL IS THE PLACEHOLDER. 48px tall (56px with an action inside).
|
|
44
44
|
* Variation `rows={n}`: several lines in the same frame, for what the member writes in words (the request and its reason on the ask
|
|
45
45
|
* sheet: `<Field rows={4} />` over `<Field rows={2} />`). A frame says "tap me", so a framed write-in is a Field, never a Composer:
|
package/dist/forms/Field.js
CHANGED
|
@@ -20,9 +20,9 @@ export function applyMask(v, mask) {
|
|
|
20
20
|
return out;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
* Field — the flat outlined input
|
|
24
|
-
*
|
|
25
|
-
* (
|
|
23
|
+
* Field — the flat outlined input. A form's fields stand on the SHEET, the paper the member fills in (Lh 2026-10-18): a Sheet's `Body`, a
|
|
24
|
+
* `SheetStep`, or a stack sheet, 1–3 per step. One Field may also stand on a `Card`, either face — words written on the card itself, a
|
|
25
|
+
* thank-you (Lh 2026-10-26); the other controls the member fills or picks never do (`cardds check` rule `field-in-card`).
|
|
26
26
|
* The LABEL IS THE PLACEHOLDER. 48px tall (56px with an action inside).
|
|
27
27
|
* Variation `rows={n}`: several lines in the same frame, for what the member writes in words (the request and its reason on the ask
|
|
28
28
|
* sheet: `<Field rows={4} />` over `<Field rows={2} />`). A frame says "tap me", so a framed write-in is a Field, never a Composer:
|
package/dist/forms/Pin.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export interface PinProps extends Omit<ComponentProps<'div'>, 'onChange' | 'defa
|
|
|
31
31
|
autoFocus?: boolean;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
* Pin — big code entry, one digit per pill; a filled cell turns accent. Lives on a sheet
|
|
34
|
+
* Pin — big code entry, one digit per pill; a filled cell turns accent. Lives on a sheet (the paper the member fills in, Lh 2026-10-18), or on a `Card`, either face — a code typed on the card itself (Lh 2026-10-26).
|
|
35
35
|
* Its own behaviour, inside it: typing a digit moves to the next cell, Backspace in an empty cell moves back and clears, the
|
|
36
36
|
* arrows walk the cells, a pasted code fills them from the one it landed in; only digits stay. The first cell takes the SMS
|
|
37
37
|
* one-time-code autofill. The code is a VALUE, controlled like an input: `value` + `onChange`, or `defaultValue`.
|
package/dist/forms/Pin.js
CHANGED
|
@@ -7,7 +7,7 @@ import { word } from '../words.js';
|
|
|
7
7
|
import { useStepCursor } from '../sheets/stepCursor.js';
|
|
8
8
|
const RESET_MS = 900; // a code that does not match: red + shake this long, then the cells empty for a new try
|
|
9
9
|
/**
|
|
10
|
-
* Pin — big code entry, one digit per pill; a filled cell turns accent. Lives on a sheet
|
|
10
|
+
* Pin — big code entry, one digit per pill; a filled cell turns accent. Lives on a sheet (the paper the member fills in, Lh 2026-10-18), or on a `Card`, either face — a code typed on the card itself (Lh 2026-10-26).
|
|
11
11
|
* Its own behaviour, inside it: typing a digit moves to the next cell, Backspace in an empty cell moves back and clears, the
|
|
12
12
|
* arrows walk the cells, a pasted code fills them from the one it landed in; only digits stay. The first cell takes the SMS
|
|
13
13
|
* one-time-code autofill. The code is a VALUE, controlled like an input: `value` + `onChange`, or `defaultValue`.
|
package/dist/type/textScale.d.ts
CHANGED
|
@@ -3,11 +3,14 @@
|
|
|
3
3
|
* a fixed size (a round with a number, a button, the top bar) is drawn for the theme's text — at a larger text the words outgrew
|
|
4
4
|
* it; growing the things at the same rate would zoom the whole UI and leave no room for content (Lh 2026-10-03, pairs set by
|
|
5
5
|
* measuring the gallery: 115 → 107.5 · 130 → 115 · 145 → 122.5 · 160 → 130). A smaller text never shrinks a control.
|
|
6
|
+
* The FORM controls are not on this rate: a field, a button, a chip, a Pin cell, a switch, a check, a segmented choice follow the
|
|
7
|
+
* words in full (Lh 2026-10-26 — tokens.css `--form-tap`, `--btn-h`: the larger of their `--tap-base` and the same share of `--fs-base`).
|
|
6
8
|
*/
|
|
7
9
|
export declare const controlsFor: (percent: number) => number;
|
|
8
10
|
/**
|
|
9
11
|
* The member's text size: `--fs-base` on <html> as a share of the theme's own base (100 = as the theme set it), and with it
|
|
10
|
-
* `--tap-base` — the things grow half as much as the words (`controlsFor`), so a larger text still fits what holds it
|
|
12
|
+
* `--tap-base` — the things grow half as much as the words (`controlsFor`), so a larger text still fits what holds it; the form
|
|
13
|
+
* controls (fields, buttons, chips, Pin, switches) grow as much as the words, being sized on `--fs-base` too.
|
|
11
14
|
* The bases are read from the CSS (cardds's default or the project's theme.css) — never copied into app code. Keeping the choice
|
|
12
15
|
* (localStorage, an account) is the app's.
|
|
13
16
|
*/
|
package/dist/type/textScale.js
CHANGED
|
@@ -3,11 +3,14 @@
|
|
|
3
3
|
* a fixed size (a round with a number, a button, the top bar) is drawn for the theme's text — at a larger text the words outgrew
|
|
4
4
|
* it; growing the things at the same rate would zoom the whole UI and leave no room for content (Lh 2026-10-03, pairs set by
|
|
5
5
|
* measuring the gallery: 115 → 107.5 · 130 → 115 · 145 → 122.5 · 160 → 130). A smaller text never shrinks a control.
|
|
6
|
+
* The FORM controls are not on this rate: a field, a button, a chip, a Pin cell, a switch, a check, a segmented choice follow the
|
|
7
|
+
* words in full (Lh 2026-10-26 — tokens.css `--form-tap`, `--btn-h`: the larger of their `--tap-base` and the same share of `--fs-base`).
|
|
6
8
|
*/
|
|
7
9
|
export const controlsFor = (percent) => 100 + Math.max(0, percent - 100) / 2;
|
|
8
10
|
/**
|
|
9
11
|
* The member's text size: `--fs-base` on <html> as a share of the theme's own base (100 = as the theme set it), and with it
|
|
10
|
-
* `--tap-base` — the things grow half as much as the words (`controlsFor`), so a larger text still fits what holds it
|
|
12
|
+
* `--tap-base` — the things grow half as much as the words (`controlsFor`), so a larger text still fits what holds it; the form
|
|
13
|
+
* controls (fields, buttons, chips, Pin, switches) grow as much as the words, being sized on `--fs-base` too.
|
|
11
14
|
* The bases are read from the CSS (cardds's default or the project's theme.css) — never copied into app code. Keeping the choice
|
|
12
15
|
* (localStorage, an account) is the app's.
|
|
13
16
|
*/
|
package/docs/reference.md
CHANGED
|
@@ -665,9 +665,13 @@ between at 40% down the screen (see *Anatomy*, "Where the centre is"):
|
|
|
665
665
|
and `ComposerArea`, `Pin`, `Dropdown`, `Slider`, `Toggle`, `Check`,
|
|
666
666
|
`ChipPick`, `Calendar`, `CalendarWeeks`, `HourGrid`, `DayStrip` and `Day`, `Picker`, `Mood`,
|
|
667
667
|
`AvatarPick`, `FileBtn`, `AddRow`, `MapPick`, a `Tile pick` and a
|
|
668
|
-
`Tile upload`. A card is for reading and pressing buttons
|
|
669
|
-
a form
|
|
670
|
-
|
|
668
|
+
`Tile upload`. A card is for reading and pressing buttons; never put
|
|
669
|
+
a form in a card. Two exceptions (Lh 2026-10-26): a `Pin` and a `Field`
|
|
670
|
+
may stand on a `Card`, on either face — a code typed on the card itself
|
|
671
|
+
(the helper's code on a turned card's back), words written on it (a
|
|
672
|
+
thank-you on its front). Every other control stays on a sheet. `cardds
|
|
673
|
+
check` rule `field-in-card` (error) flags the others written inside a
|
|
674
|
+
`<Card>`. A `Card`
|
|
671
675
|
that is a sheet of a `SheetStack` is that stack's sheet, so it may hold
|
|
672
676
|
them. Seen in timebank's help-ask prototype: a Composer, a Dropdown and a
|
|
673
677
|
map on white cards inside the help sheet, the cards the colour of the
|
|
@@ -1159,7 +1163,7 @@ Rules:
|
|
|
1159
1163
|
Both name the tokens to move.
|
|
1160
1164
|
- The member's text-size setting is the same `--fs-base`, written on `<html>`
|
|
1161
1165
|
at run time by `setTextScale(percent)` (a share of the theme's base; 100 = the
|
|
1162
|
-
theme's own): the words grow, and the things grow HALF as much (`--tap-base`; `controlsFor(percent)` — 130% text → 115% controls, 160% → 130%), so a larger text still fits what holds it. (`--text-scale`, which multiplied the root and zoomed the UI too, is gone.)
|
|
1166
|
+
theme's own): the words grow, and the things grow HALF as much (`--tap-base`; `controlsFor(percent)` — 130% text → 115% controls, 160% → 130%), so a larger text still fits what holds it. The FORM controls grow as much as the words (Lh 2026-10-26): `Field`, `Btn`, `Chip`/`ChipPick`, `Pin`, `Toggle`, `Check`, `Slider`, `Dropdown`, `BtnGroup look="choice"`, a `SheetStep`'s bar, `Composer` — each is the larger of its size of things and the same share of `--fs-base` (`--form-tap`, `--form-tap-sm`, `--form-tap-lg`, `--btn-h`, `--chip-h`; equal at the default bases), so the field and the words typed in it use the same tokens. (`--text-scale`, which multiplied the root and zoomed the UI too, is gone.)
|
|
1163
1167
|
|
|
1164
1168
|
Try it live: the gallery's nav (`npm run dev`) has a slider per size base, and
|
|
1165
1169
|
palette `own` shows a colour well per colour base.
|
|
@@ -1277,7 +1281,7 @@ platform's: the initial value of a registered length (`@property`), which may no
|
|
|
1277
1281
|
lengths a script measures off the page (`--kb`, a sheet's peek, a pulled sheet).
|
|
1278
1282
|
An app with its own text-size setting calls `setTextScale(percent)`, which writes
|
|
1279
1283
|
`--fs-base` on `<html>` from the theme's base (100% = the theme's; 160% = 2.2rem by default): the type and its holders (the count
|
|
1280
|
-
badge, the inline icon) grow, the
|
|
1284
|
+
badge, the inline icon) and the form controls grow, the other things grow half as much (`--tap-base`), spacing and radii keep their size.
|
|
1281
1285
|
Components never write a raw length: spacing from `--sp-*`, control sizes from
|
|
1282
1286
|
`--tap`, `--tap-lg`, `--btn-h`, `--bar-h`, `--header-h`, `--fab`, `--badge`, container
|
|
1283
1287
|
padding from `--screen-pad` / `--card-pad`, radii from
|
package/lint/rules.mjs
CHANGED
|
@@ -233,7 +233,7 @@ export function checkSource(source, file, { classes = carddsClasses() } = {}) {
|
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
// 10 · the sheet is the paper the member fills in (Lh 2026-10-18): every control the member fills or picks stands on a Sheet's body, a SheetStep
|
|
236
|
-
// or a stack sheet; a card is for reading and
|
|
236
|
+
// or a stack sheet; a card is for reading, pressing buttons and typing in a Pin or a Field (Lh 2026-10-26). A Card that is a sheet of a SheetStack IS a sheet (the stack's material)
|
|
237
237
|
// a `<` right after a name is a type argument (`Record<Step, string>`, `useState<Step>`), not a tag; an element that never closes holds nothing
|
|
238
238
|
const span = (re) => [...text.matchAll(re)].filter((m) => !/[\w$)\].]/.test(text[m.index - 1] ?? '')).map((m) => {
|
|
239
239
|
const open = tagAt(text, m.index), el = elementAt(text, m.index), closed = open.endsWith('/>') || el.endsWith(`</${m[0].slice(1).match(/^[\w.]+/)[0]}>`);
|
|
@@ -275,10 +275,11 @@ export function checkSource(source, file, { classes = carddsClasses() } = {}) {
|
|
|
275
275
|
if (onSheet(c.index) === false) add('field-off-sheet', 'error', c.index, `<${kind ? `Tile ${kind}` : c[1]}> on the ground: a form is never on the ground, it sits only on a sheet (Lh 2026-10-18). A Page, Pages, Step or Screen is the base, not a sheet. Put the control in a Sheet's <Body>, in a <SheetStep>, or on a stack sheet — a form over a screen is a <Sheet> in a <SheetStage over dim> (Home/AskSheet).`);
|
|
276
276
|
continue;
|
|
277
277
|
}
|
|
278
|
+
if (c[1] === 'Pin' || c[1] === 'Field') continue; // a code or words typed on the card itself, either face (Lh 2026-10-26, timebank: the helper's code on the card's back, the thank-you on its front)
|
|
278
279
|
const stack = stacks.filter((s) => card.at >= s.body && card.at < s.end).at(-1);
|
|
279
280
|
if (stack && !cards.some((o) => o !== card && within(card.at, o) && o.at >= stack.body)) continue;
|
|
280
281
|
const name = kind ? `Tile ${kind}` : c[1];
|
|
281
|
-
add('field-in-card', 'error', c.index, `<${name}> inside a <Card>: the sheet is the paper the member fills in (Lh 2026-10-18) — a card is for reading and
|
|
282
|
+
add('field-in-card', 'error', c.index, `<${name}> inside a <Card>: the sheet is the paper the member fills in (Lh 2026-10-18) — a card is for reading, pressing buttons and typing in a Pin or a Field. Put the ${name} straight in a Sheet's <Body>, in a <SheetStep>, or on a stack sheet, with no card round it.`);
|
|
282
283
|
}
|
|
283
284
|
|
|
284
285
|
// 11 · a worded pager bar: back and next never carry the same signal — the forward Btn (the last) is `primary`, the back one is not
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usableapp/cardds",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.140",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "card-first mobile design system, React-first: the components in src/ are thin wrappers over the CSS contract (css/*.css stays the only truth); gallery/ shows every story live (npm run dev).",
|