@usableapp/cardds 0.7.145 → 0.7.147
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 +18 -0
- package/css/actions.css +2 -0
- package/css/base.css +12 -0
- package/css/stamp.css +3 -3
- package/css/step.css +2 -0
- package/dist/cardds.css +19 -3
- package/dist/catalog.json +1 -1
- package/dist/scaffold/Screen.d.ts +5 -2
- package/dist/scaffold/Screen.js +3 -3
- package/dist/stamp/Stamp.d.ts +4 -4
- package/dist/stamp/Stamp.js +3 -3
- package/docs/reference.md +5 -1
- package/package.json +1 -1
|
@@ -9,6 +9,9 @@ export interface ScreenProps extends ComponentProps<'div'> {
|
|
|
9
9
|
as?: 'div' | 'main' | 'section';
|
|
10
10
|
/** TOP: a `TopBar` / `AppBar`, or `"lead"` — no bar, the content starts `--screen-lead` (15% of the screen) down */
|
|
11
11
|
top?: ReactNode | 'lead';
|
|
12
|
+
/** a ROW PINNED under the top (a `Row`: the request a chat is about, its time, an arrow to its card) — it never scrolls away;
|
|
13
|
+
* the content starts under it, however tall it grows. Edge to edge on the screen's ground, touching the top bar */
|
|
14
|
+
topRow?: ReactNode;
|
|
12
15
|
/** BOTTOM: an `ActionBar` (or a `FloatBar`, or a chat's `MessageBar`) — a LAYER over the content's foot, as tall as its rows need.
|
|
13
16
|
* Never with a `Sheet` in the content: a sheet finishes on its own foot (warns once). */
|
|
14
17
|
bottom?: ReactNode;
|
|
@@ -20,13 +23,13 @@ export interface ScreenProps extends ComponentProps<'div'> {
|
|
|
20
23
|
/**
|
|
21
24
|
* Screen — the mobile screen in THREE parts: **top** and **content** (the children) in one flex column, the content down to the
|
|
22
25
|
* screen's foot; **bottom** a LAYER over it there (Lh 2026-09-23). Top = `TopBar` / `AppBar`, or `top="lead"` (no bar, the words start
|
|
23
|
-
* 15% down). Content = a box of components one after another — a `Step` (`Pages` of `Page`s / a `Page` [+ `Sheet`]), a `Centre`, a
|
|
26
|
+
* 15% down), and under it `topRow`, a row pinned there (it never scrolls away). Content = a box of components one after another — a `Step` (`Pages` of `Page`s / a `Page` [+ `Sheet`]), a `Centre`, a
|
|
24
27
|
* `SheetStack`… Bottom = an `ActionBar` (the walk's `Pager` its first row) or a `FloatBar`, covering the content's foot on purpose. Max 34.375rem (550px) wide, the standard inset, no vertical padding. A plain Screen (no `fill`) scrolls.
|
|
25
28
|
* ONE OUTCOME, DRAWN ONCE (Lh 2026-10-01): a screen that can come out more than one way is not drawn until the app knows which —
|
|
26
29
|
* `ready={false}` until then.
|
|
27
30
|
* The slots set the order; children laid by hand in the same order still work.
|
|
28
31
|
*/
|
|
29
|
-
export declare function Screen({ fill, palette, as, top, bottom, ready, className, children, ref, ...rest }: ScreenProps): import("react").DetailedReactHTMLElement<{
|
|
32
|
+
export declare function Screen({ fill, palette, as, top, topRow, bottom, ready, className, children, ref, ...rest }: ScreenProps): import("react").DetailedReactHTMLElement<{
|
|
30
33
|
key?: import("react").Key | null | undefined;
|
|
31
34
|
defaultChecked?: boolean | undefined;
|
|
32
35
|
defaultValue?: string | number | readonly string[] | undefined;
|
package/dist/scaffold/Screen.js
CHANGED
|
@@ -4,13 +4,13 @@ import { cx } from '../cx.js';
|
|
|
4
4
|
/**
|
|
5
5
|
* Screen — the mobile screen in THREE parts: **top** and **content** (the children) in one flex column, the content down to the
|
|
6
6
|
* screen's foot; **bottom** a LAYER over it there (Lh 2026-09-23). Top = `TopBar` / `AppBar`, or `top="lead"` (no bar, the words start
|
|
7
|
-
* 15% down). Content = a box of components one after another — a `Step` (`Pages` of `Page`s / a `Page` [+ `Sheet`]), a `Centre`, a
|
|
7
|
+
* 15% down), and under it `topRow`, a row pinned there (it never scrolls away). Content = a box of components one after another — a `Step` (`Pages` of `Page`s / a `Page` [+ `Sheet`]), a `Centre`, a
|
|
8
8
|
* `SheetStack`… Bottom = an `ActionBar` (the walk's `Pager` its first row) or a `FloatBar`, covering the content's foot on purpose. Max 34.375rem (550px) wide, the standard inset, no vertical padding. A plain Screen (no `fill`) scrolls.
|
|
9
9
|
* ONE OUTCOME, DRAWN ONCE (Lh 2026-10-01): a screen that can come out more than one way is not drawn until the app knows which —
|
|
10
10
|
* `ready={false}` until then.
|
|
11
11
|
* The slots set the order; children laid by hand in the same order still work.
|
|
12
12
|
*/
|
|
13
|
-
export function Screen({ fill, palette, as = 'div', top, bottom, ready = true, className, children, ref, ...rest }) {
|
|
13
|
+
export function Screen({ fill, palette, as = 'div', top, topRow, bottom, ready = true, className, children, ref, ...rest }) {
|
|
14
14
|
const own = useRef(null);
|
|
15
15
|
useEffect(() => {
|
|
16
16
|
const el = own.current;
|
|
@@ -39,5 +39,5 @@ export function Screen({ fill, palette, as = 'div', top, bottom, ready = true, c
|
|
|
39
39
|
}
|
|
40
40
|
return watchSize([lead], () => el.style.setProperty('--top-h', `${lead.offsetHeight}px`));
|
|
41
41
|
}, [top, ready]);
|
|
42
|
-
return createElement(as, { className: cx('screen', fill && 'screen--fill', top === 'lead' && 'screen--lead', className), 'data-palette': palette, 'data-pending': ready ? undefined : '', 'aria-busy': ready ? undefined : true, ref: setRefs(own, ref), ...rest }, ready && top !== 'lead' ? top : null, ready ? children : null, ready ? bottom : null);
|
|
42
|
+
return createElement(as, { className: cx('screen', fill && 'screen--fill', top === 'lead' && 'screen--lead', className), 'data-palette': palette, 'data-pending': ready ? undefined : '', 'aria-busy': ready ? undefined : true, ref: setRefs(own, ref), ...rest }, ready && top !== 'lead' ? top : null, ready && topRow != null ? createElement('div', { className: 'screen__top-row' }, topRow) : null, ready ? children : null, ready ? bottom : null);
|
|
43
43
|
}
|
package/dist/stamp/Stamp.d.ts
CHANGED
|
@@ -13,8 +13,8 @@ export interface StampProps extends Omit<ComponentProps<'span'>, 'onClick'> {
|
|
|
13
13
|
bare?: boolean;
|
|
14
14
|
/** the inline size: a stamp beside a status line's words (a card's `Foot`: the stamp, "X took it", a round button), one `Chip xs` tall (`--stamp-xs-size`). Always bare and flat: only the thin contact shadow every stamp has. Several, lapped with a "+8": `AvatarStack more` */
|
|
15
15
|
xs?: boolean;
|
|
16
|
-
/** the paper
|
|
17
|
-
|
|
16
|
+
/** the white paper frame between the teeth and the picture: `true` (default) the paper's band round the picture, `false` none — the tone fills the paper right out to the teeth. The teeth, the 4:5 size, the shadow, the pictures and the words stay, at every size and in every holder */
|
|
17
|
+
frame?: boolean;
|
|
18
18
|
/** kept back: the stamp keeps its box and draws nothing, hidden from screen readers too — until the app is ready to show it; when this turns false it appears in the same box, so nothing beside it moves */
|
|
19
19
|
held?: boolean;
|
|
20
20
|
/** in a `Head`: the words keep no room for the stamp — they run the head's whole width and lie OVER it, the stamp in its place and size at the right under them (a long title that would wrap in the column beside it). Never hides a word */
|
|
@@ -29,7 +29,7 @@ export interface StampProps extends Omit<ComponentProps<'span'>, 'onClick'> {
|
|
|
29
29
|
onArrived?: () => void;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
* Stamp — a paper stamp, 4:5, perforated
|
|
32
|
+
* Stamp — a paper stamp, 4:5, always perforated: the pictures fill the inner frame on a tone (`frame={false}`: no white frame, the tone runs out to the teeth), the words sit on the picture's foot.
|
|
33
33
|
* Every stamp is ONE size wherever it stands (`--stamp-size`, two taps wide: 96 × 120) — what holds it only places it; a holder narrower than that shows it whole, smaller.
|
|
34
34
|
* The one small stamp is a stamp stuck on something (`StampOn`); `xs` is the inline one, beside a status line's words. Every inner length follows the stamp's width.
|
|
35
35
|
* The outer box holds the size and the shadow; the paper inside is the one whose edge is punched (a mask would cut the shadow too).
|
|
@@ -38,7 +38,7 @@ export interface StampProps extends Omit<ComponentProps<'span'>, 'onClick'> {
|
|
|
38
38
|
* the app it has landed, so it sends. The strike scales it down from twice its size, so it never moves the layout (it may cover its neighbours for a moment);
|
|
39
39
|
* a `tilt` is kept, the stamp ends at its turn. Afterwards the same stamp stands in the same place with no strike: drop `arrive` or keep it, nothing is struck twice.
|
|
40
40
|
*/
|
|
41
|
-
export declare function Stamp({ pictures, tone, name, words, bare, xs,
|
|
41
|
+
export declare function Stamp({ pictures, tone, name, words, bare, xs, frame, held, under, tilt, onClick, arrive, onArrived, className, onAnimationEnd, ...rest }: StampProps): import("react").JSX.Element;
|
|
42
42
|
export interface StampPlaceProps extends Omit<ComponentProps<'span'>, 'onClick'> {
|
|
43
43
|
/** a gap nobody is asked to fill: a paler edge (an album's free places) */
|
|
44
44
|
faint?: boolean;
|
package/dist/stamp/Stamp.js
CHANGED
|
@@ -3,7 +3,7 @@ import { cx } from '../cx.js';
|
|
|
3
3
|
import { pressable } from '../pressable.js';
|
|
4
4
|
import { useStrike } from './useStrike.js';
|
|
5
5
|
/**
|
|
6
|
-
* Stamp — a paper stamp, 4:5, perforated
|
|
6
|
+
* Stamp — a paper stamp, 4:5, always perforated: the pictures fill the inner frame on a tone (`frame={false}`: no white frame, the tone runs out to the teeth), the words sit on the picture's foot.
|
|
7
7
|
* Every stamp is ONE size wherever it stands (`--stamp-size`, two taps wide: 96 × 120) — what holds it only places it; a holder narrower than that shows it whole, smaller.
|
|
8
8
|
* The one small stamp is a stamp stuck on something (`StampOn`); `xs` is the inline one, beside a status line's words. Every inner length follows the stamp's width.
|
|
9
9
|
* The outer box holds the size and the shadow; the paper inside is the one whose edge is punched (a mask would cut the shadow too).
|
|
@@ -12,11 +12,11 @@ import { useStrike } from './useStrike.js';
|
|
|
12
12
|
* the app it has landed, so it sends. The strike scales it down from twice its size, so it never moves the layout (it may cover its neighbours for a moment);
|
|
13
13
|
* a `tilt` is kept, the stamp ends at its turn. Afterwards the same stamp stands in the same place with no strike: drop `arrive` or keep it, nothing is struck twice.
|
|
14
14
|
*/
|
|
15
|
-
export function Stamp({ pictures, tone = 'custard', name, words, bare, xs,
|
|
15
|
+
export function Stamp({ pictures, tone = 'custard', name, words, bare, xs, frame = true, held, under, tilt, onClick, arrive, onArrived, className, onAnimationEnd, ...rest }) {
|
|
16
16
|
const shown = pictures.slice(0, 4);
|
|
17
17
|
const { struck } = useStrike(arrive, onArrived, onAnimationEnd);
|
|
18
18
|
const { tap, Box, boxProps } = pressable(onClick, 'span', rest);
|
|
19
|
-
return (_jsx(Box, { className: cx('stamp', `stamp--${shown.length}`, bare && 'stamp--bare', xs && 'stamp--xs',
|
|
19
|
+
return (_jsx(Box, { className: cx('stamp', `stamp--${shown.length}`, bare && 'stamp--bare', xs && 'stamp--xs', !frame && 'stamp--frameless', held && 'stamp--held', under && 'stamp--under', tilt && `stamp--tilt-${tilt}`, tap && 'stamp--tap', arrive && 'stamp--arrive', className), onAnimationEnd: struck, "aria-hidden": held || undefined, ...boxProps, children: _jsx("span", { className: cx('stamp__paper', !frame && `sticky--${tone}`), children: _jsxs("span", { className: cx('stamp__pic', `sticky--${tone}`), children: [shown.map((picture, i) => _jsx("span", { className: "stamp__art", "aria-hidden": "true", children: picture }, i)), (name != null || words != null) && (_jsxs("span", { className: "stamp__cap", children: [words != null && _jsx("span", { className: "stamp__words", children: words }), name != null && _jsx("span", { className: "stamp__name", children: name })] }))] }) }) }));
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* StampPlace — an empty place for a stamp: a 4:5 frame of round dots the size a Stamp is (`--stamp-size`), a word or an Icon inside.
|
package/docs/reference.md
CHANGED
|
@@ -327,6 +327,7 @@ of `Screen`:
|
|
|
327
327
|
| Part | Prop | What fills it |
|
|
328
328
|
|---|---|---|
|
|
329
329
|
| **top** | `top` | `TopBar` · `AppBar` · `"lead"` (no bar: the content starts `--screen-lead`, 15% of the screen, down) |
|
|
330
|
+
| **top row** | `topRow` | one `Row` pinned under the top (a chat's request: icon · words · arrow to its card) · nothing |
|
|
330
331
|
| **content** | children | a `Step` (`Pages` · `Page` · `Page` + `Sheet`) · `Centre` · `SheetStack` … |
|
|
331
332
|
| **bottom** | `bottom` | `ActionBar` (rows: `controls` · the one `cta` row — the pager bar ← → or one wide button · a `ctaLink`) · `FloatBar` · `MessageBar` (a chat) · nothing |
|
|
332
333
|
|
|
@@ -348,6 +349,9 @@ of `Screen`:
|
|
|
348
349
|
`defaultValue`); `onSend(words)` hands them to the app, then the bar asks for an empty box; the cursor stays in the box, so
|
|
349
350
|
the keyboard stays up. It is a layer like the `ActionBar`: measured into `--bottom-h`, lifted by `--kb`. It is not the
|
|
350
351
|
`Composer` (the one big write-in on a sheet) and not a sheet's form: a message is sent from where it is read.
|
|
352
|
+
- **A row pinned under the top is `topRow`** (Lh 2026-10-26) — `<Screen fill top={<TopBar…/>} topRow={<Row>…</Row>}>`: a row
|
|
353
|
+
of the column, so it never scrolls away and the content starts under it at its real height; it touches the bar, edge to
|
|
354
|
+
edge, on the screen's ground (`--top-row-bg`). On a scrolling screen it sticks to the top once the bar has gone.
|
|
351
355
|
- **A screen with a `Sheet` has no bottom.** The sheet finishes on its own `Foot`; `Screen` warns once when both
|
|
352
356
|
are there.
|
|
353
357
|
- **Templates** are `Screen`s with the three parts filled (`Walkthrough` = top `lead` · content `Pages` · bottom
|
|
@@ -844,7 +848,7 @@ ground of my own stamp.
|
|
|
844
848
|
A stamp is a small paper picture a member keeps and sticks on a note or a postcard for a neighbour. Sending never uses
|
|
845
849
|
it up. cardds draws the paper; the pictures, their words and which stamp a member owns are the app's.
|
|
846
850
|
|
|
847
|
-
- **`Stamp`** — a perforated 4:5 stamp; `
|
|
851
|
+
- **`Stamp`** — a perforated 4:5 stamp, always with teeth; `frame={false}` drops the white paper frame round the picture, so the tone runs out to the teeth (the same size, shadow and words), wherever a stamp goes (`xs`, `tilt`, `arrive`, `onClick`, a `StampOn`, a `StampBook`, an `AvatarStack`). `pictures` is one to four nodes, the app's own art (an svg, an img), in placement
|
|
848
852
|
order: the stamp places, sizes and turns them by how many there are. `tone` is the ground, one of `STICKY_TONES` (the
|
|
849
853
|
same list and the same `--sticky-<tone>-bg` knobs as a note's paper). `name` is the big line on the picture's foot,
|
|
850
854
|
`words` the small line above it. `tilt` turns it, `onClick` makes the whole stamp a button. Every inner length follows
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usableapp/cardds",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.147",
|
|
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).",
|