@usableapp/cardds 0.7.109 → 0.7.110
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 +25 -0
- package/css/base.css +1 -0
- package/css/card.css +1 -0
- package/css/sheet.css +12 -3
- package/css/stamp.css +2 -0
- package/dist/cardds.css +16 -3
- package/dist/catalog.json +1 -1
- package/dist/stamp/StampOn.d.ts +3 -1
- package/dist/stamp/StampOn.js +5 -5
- package/dist/type/Text.d.ts +3 -1
- package/dist/type/Text.js +2 -2
- package/package.json +1 -1
package/dist/stamp/StampOn.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ export interface StampOnProps extends ComponentProps<'div'> {
|
|
|
23
23
|
removeFor?: number;
|
|
24
24
|
/** the stamp at the stamp's MAIN size, 96 × 120 (`--stamp-size`), to cover what it lies on; the default is the small size, 48 × 60 (`--stamp-sm-size`), which leaves a note's words readable */
|
|
25
25
|
main?: boolean;
|
|
26
|
+
/** UNDER A CARD'S WORDS: the stamp at the main size, 96 × 120, laid at the top right corner of the card (or of its face), stacked LOWEST inside it so the badge, the chips and the words are all drawn over it and none is hidden. No shadow, no drag (`at` and `onAtChange` are ignored), and a press on it falls through to the card; `turn` and `arrive` work as on any stamp. Put it as a direct child of the `Card` */
|
|
27
|
+
under?: boolean;
|
|
26
28
|
/** the stamp sticks ITSELF: as it comes onto the screen it is struck onto its place (shown large, pressed down to its size). Nobody
|
|
27
29
|
* picked it or pressed to stick it — the app shows it when its own move (send) begins. With `onArrived`. A stamp that already stands in a card's head or a centre, where the layout put it, is `Stamp arrive` instead */
|
|
28
30
|
arrive?: boolean;
|
|
@@ -47,4 +49,4 @@ export interface StampOnProps extends ComponentProps<'div'> {
|
|
|
47
49
|
* arriving cannot be taken off: no cross, no focus, no Delete until it has landed (it is not stuck yet). `arrive` with `main` strikes
|
|
48
50
|
* the main size, 96 × 120, onto its place.
|
|
49
51
|
*/
|
|
50
|
-
export declare function StampOn({ at, defaultAt, turn, onAtChange, label, onRemove, removeLabel, removeFor, main, arrive, onArrived, className, style, onAnimationEnd, children, ...rest }: StampOnProps): import("react").JSX.Element;
|
|
52
|
+
export declare function StampOn({ at, defaultAt, turn, onAtChange, label, onRemove, removeLabel, removeFor, main, under, arrive, onArrived, className, style, onAnimationEnd, children, ...rest }: StampOnProps): import("react").JSX.Element;
|
package/dist/stamp/StampOn.js
CHANGED
|
@@ -38,16 +38,16 @@ const write = (el, at) => { el.style.setProperty('--stamp-on-x', String(at.x));
|
|
|
38
38
|
* arriving cannot be taken off: no cross, no focus, no Delete until it has landed (it is not stuck yet). `arrive` with `main` strikes
|
|
39
39
|
* the main size, 96 × 120, onto its place.
|
|
40
40
|
*/
|
|
41
|
-
export function StampOn({ at, defaultAt = MIDDLE, turn = 0, onAtChange, label, onRemove, removeLabel, removeFor = 3000, main, arrive, onArrived, className, style, onAnimationEnd, children, ...rest }) {
|
|
42
|
-
const
|
|
41
|
+
export function StampOn({ at, defaultAt = MIDDLE, turn = 0, onAtChange, label, onRemove, removeLabel, removeFor = 3000, main, under, arrive, onArrived, className, style, onAnimationEnd, children, ...rest }) {
|
|
42
|
+
const pile = useContext(UnderNotes);
|
|
43
43
|
const [shown, request] = useControlled(at, defaultAt, onAtChange);
|
|
44
44
|
const [held, setHeld] = useState(false);
|
|
45
45
|
const [cross, setCross] = useState(false);
|
|
46
46
|
const grip = useRef(null);
|
|
47
47
|
const timer = useRef(undefined);
|
|
48
|
-
const moves = onAtChange != null && !under;
|
|
48
|
+
const moves = onAtChange != null && !pile && !under;
|
|
49
49
|
const { arrived, struck } = useStrike(arrive, onArrived, onAnimationEnd);
|
|
50
|
-
const removes = onRemove != null && !
|
|
50
|
+
const removes = onRemove != null && !pile && !(arrive && !arrived);
|
|
51
51
|
const ask = (next) => { if (next.x !== shown.x || next.y !== shown.y)
|
|
52
52
|
request(next); };
|
|
53
53
|
const stop = () => clearTimeout(timer.current);
|
|
@@ -119,6 +119,6 @@ export function StampOn({ at, defaultAt = MIDDLE, turn = 0, onAtChange, label, o
|
|
|
119
119
|
const own = moves || removes ? { tabIndex: 0, role: 'group', 'aria-label': label, onKeyDown: key } : null;
|
|
120
120
|
const drag = moves ? { onPointerDown: down, onPointerMove: move, onPointerUp: up, onPointerCancel: up } : null;
|
|
121
121
|
const guard = removes ? { onClick: click } : null;
|
|
122
|
-
return (_jsxs("div", { className: cx('stamp-on', moves && 'stamp-on--move', main && 'stamp-on--main', arrive && 'stamp-on--arrive', held && 'is-held', className), style: place, onAnimationEnd: struck, ...rest, ...own, ...drag, ...guard, inert:
|
|
122
|
+
return (_jsxs("div", { className: cx('stamp-on', moves && 'stamp-on--move', main && 'stamp-on--main', under && 'stamp-on--under', arrive && 'stamp-on--arrive', held && 'is-held', className), style: place, onAnimationEnd: struck, ...rest, ...own, ...drag, ...guard, inert: pile || undefined, children: [children, removes && cross && (_jsx("button", { type: "button", className: "stamp-on__remove", "aria-label": removeLabel ?? word('remove'), onPointerDown: (e) => e.stopPropagation(), onClick: (e) => { e.stopPropagation(); stop(); setCross(false); onRemove(); }, onFocus: stop, onBlur: () => { if (!grip.current)
|
|
123
123
|
show(); }, children: _jsx("span", { className: "stamp-on__remove-disc", children: _jsx(Icon, { name: "x" }) }) }))] }));
|
|
124
124
|
}
|
package/dist/type/Text.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export interface TextProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
19
19
|
/** the member may select and copy these words (a code, an address, a reference number) — everything else in a Screen is not
|
|
20
20
|
* selectable, like a native app (Lh 2026-09-25) */
|
|
21
21
|
selectable?: boolean;
|
|
22
|
+
/** body only: the words show `--text-scroll-lines` lines (knob, default 3) in a plain box with no border, and the rest scrolls inside the box — a long reason in a card. A scroll never turns a turning card */
|
|
23
|
+
scroll?: boolean;
|
|
22
24
|
/** the element; defaults per level (h2 for display/h1/h2, p for title/body/stat, span for the rest) */
|
|
23
25
|
as?: 'h1' | 'h2' | 'h3' | 'p' | 'span' | 'strong' | 'div';
|
|
24
26
|
}
|
|
@@ -27,7 +29,7 @@ export interface TextProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
27
29
|
* Headings inside a card head are h2 by default; a screen title in a TopBar is h1.
|
|
28
30
|
* Everything scales from the root font-size, so there are no pixel sizes to pick.
|
|
29
31
|
*/
|
|
30
|
-
export declare function Text({ level, xl, mono, muted, caps, grow, sr, selectable, as, className, ...rest }: TextProps): import("react").DetailedReactHTMLElement<{
|
|
32
|
+
export declare function Text({ level, xl, mono, muted, caps, grow, sr, selectable, scroll, as, className, ...rest }: TextProps): import("react").DetailedReactHTMLElement<{
|
|
31
33
|
/** the element it renders (React 19 passes `ref` as a prop) */
|
|
32
34
|
ref?: React.Ref<HTMLElement>;
|
|
33
35
|
defaultChecked?: boolean | undefined;
|
package/dist/type/Text.js
CHANGED
|
@@ -8,9 +8,9 @@ const DEFAULT_AS = {
|
|
|
8
8
|
* Headings inside a card head are h2 by default; a screen title in a TopBar is h1.
|
|
9
9
|
* Everything scales from the root font-size, so there are no pixel sizes to pick.
|
|
10
10
|
*/
|
|
11
|
-
export function Text({ level, xl, mono, muted, caps, grow, sr, selectable, as, className, ...rest }) {
|
|
11
|
+
export function Text({ level, xl, mono, muted, caps, grow, sr, selectable, scroll, as, className, ...rest }) {
|
|
12
12
|
return createElement(as ?? DEFAULT_AS[level] ?? 'span', {
|
|
13
|
-
className: cx(`t-${level}`, level === 'stat' && xl && 't-stat--xl', level === 'stat' && mono && 't-stat--mono', muted && 't-muted', caps && 't-caps', grow && 'grow', sr && 't-sr', selectable && 't-select', className),
|
|
13
|
+
className: cx(`t-${level}`, level === 'stat' && xl && 't-stat--xl', level === 'stat' && mono && 't-stat--mono', muted && 't-muted', caps && 't-caps', grow && 'grow', sr && 't-sr', selectable && 't-select', scroll && level === 'body' && 't-scroll', className),
|
|
14
14
|
...rest,
|
|
15
15
|
});
|
|
16
16
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usableapp/cardds",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.110",
|
|
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), tests/ measures the geometry.",
|