@usableapp/cardds 0.7.103 → 0.7.104
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 +27 -0
- package/css/actions.css +102 -36
- package/css/base.css +139 -15
- package/css/card.css +308 -79
- package/css/choice.css +25 -33
- package/css/finish.css +28 -27
- package/css/forms.css +6 -14
- package/css/journey.css +4 -4
- package/css/layover.css +26 -24
- package/css/lists.css +8 -6
- package/css/media.css +13 -74
- package/css/numbers.css +37 -32
- package/css/palette.css +1 -1
- package/css/people.css +3 -8
- package/css/post.css +23 -19
- package/css/sheet.css +84 -56
- package/css/stack.css +39 -215
- package/css/stamp.css +41 -29
- package/css/step.css +1 -107
- package/css/sticky.css +43 -41
- package/css/theme.template.css +12 -0
- package/css/tokens.css +100 -26
- package/dist/actions/Chip.d.ts +1 -1
- package/dist/actions/Chip.js +3 -2
- package/dist/cardds.css +1053 -868
- package/dist/cards/Card.d.ts +3 -3
- package/dist/cards/Card.js +1 -1
- package/dist/cards/CardFeed.js +7 -9
- package/dist/catalog.json +1 -1
- package/dist/layover/Snackbar.js +2 -2
- package/dist/lists/Bubble.d.ts +1 -1
- package/dist/lists/Bubble.js +1 -1
- package/dist/lists/Row.js +5 -7
- package/dist/numbers/Picker.js +11 -18
- package/dist/people/Avatar.d.ts +1 -1
- package/dist/people/Avatar.js +3 -2
- package/dist/post/PostDesk.js +6 -9
- package/dist/post/PostLetter.js +4 -4
- package/dist/pressable.d.ts +9 -0
- package/dist/pressable.js +6 -0
- package/dist/room.d.ts +5 -0
- package/dist/room.js +9 -0
- package/dist/scaffold/Panes.js +8 -14
- package/dist/sheets/Sheet.d.ts +1 -1
- package/dist/sheets/Sheet.js +2 -3
- package/dist/sheets/SheetSteps.js +3 -3
- package/dist/sheets/StackSheet.d.ts +1 -1
- package/dist/sheets/sheetStepsPile.js +2 -3
- package/dist/sheets/stackCard.js +67 -115
- package/dist/state.d.ts +21 -0
- package/dist/state.js +28 -1
- package/dist/sticky/Sticky.js +3 -7
- package/dist/templates/Home.d.ts +1 -1
- package/dist/templates/Splash.js +2 -2
- package/dist/templates/Walkthrough.js +4 -5
- package/docs/reference.md +71 -9
- package/lib/catalog.mjs +23 -7
- package/lint/rules.mjs +7 -5
- package/lint/values.mjs +144 -0
- package/package.json +6 -4
package/dist/cards/Card.d.ts
CHANGED
|
@@ -9,8 +9,8 @@ export type Tone = 1 | 2 | 3 | 4 | 5;
|
|
|
9
9
|
export interface CardProps extends ComponentProps<'article'> {
|
|
10
10
|
/** the tone slot — see `Tone` */
|
|
11
11
|
tone?: Tone;
|
|
12
|
-
/** `true`: the content is
|
|
13
|
-
* the head and the foot are
|
|
12
|
+
/** `true`: the content is the theme's paper (`--action-bg`, the ground of its fields) and the head keeps the card's colour (the look of `Sheet paper`). `'bands'`: the opposite, two-tone —
|
|
13
|
+
* the head and the foot are paper bands edge to edge, the middle between them keeps the card's tone, lightened (knob `--card-middle-bg`).
|
|
14
14
|
* Omit it and the content matches the head */
|
|
15
15
|
paper?: boolean | 'bands';
|
|
16
16
|
/** compact: a small card inside a card or a sheet body (a note, a promo) */
|
|
@@ -85,7 +85,7 @@ export interface CardProps extends ComponentProps<'article'> {
|
|
|
85
85
|
* PRESSED WHOLE: a card whose ONLY control is its foot's button, or a row card's end button, is pressed anywhere — a touch off the
|
|
86
86
|
* button runs that button's own action once, and the card dims under the finger. The app writes nothing; any other card is only read.
|
|
87
87
|
* TWO FACES (`back`): the whole card turns over on a tap off a control (the flip mechanic it shares with Postcard); the head and the foot
|
|
88
|
-
* read the same on both faces, the middle is one fixed height. `paper="bands"`:
|
|
88
|
+
* read the same on both faces, the middle is one fixed height. `paper="bands"`: paper head and foot bands edge to edge, the tint between.
|
|
89
89
|
*/
|
|
90
90
|
export declare function Card({ tone, paper, sm, row, cover, fold, centre, band, as, heading, caption, end, level, foot, footLink, stack, leave, onLeft, onRemove, removeLabel, back, face, defaultFace, onFaceChange, toBackLabel, toFrontLabel, className, style, children, onClick, ref, ...rest }: CardProps): import("react").DetailedReactHTMLElement<{
|
|
91
91
|
onClick: (e: MouseEvent<HTMLElement>) => void;
|
package/dist/cards/Card.js
CHANGED
|
@@ -17,7 +17,7 @@ import { StackHeadCtx, StackPullCtx, ownHead, stackPaint, useStackCard } from '.
|
|
|
17
17
|
* PRESSED WHOLE: a card whose ONLY control is its foot's button, or a row card's end button, is pressed anywhere — a touch off the
|
|
18
18
|
* button runs that button's own action once, and the card dims under the finger. The app writes nothing; any other card is only read.
|
|
19
19
|
* TWO FACES (`back`): the whole card turns over on a tap off a control (the flip mechanic it shares with Postcard); the head and the foot
|
|
20
|
-
* read the same on both faces, the middle is one fixed height. `paper="bands"`:
|
|
20
|
+
* read the same on both faces, the middle is one fixed height. `paper="bands"`: paper head and foot bands edge to edge, the tint between.
|
|
21
21
|
*/
|
|
22
22
|
export function Card({ tone, paper, sm, row, cover, fold, centre, band, as = 'article', heading, caption, end, level, foot, footLink, stack, leave, onLeft, onRemove, removeLabel, back, face, defaultFace = 'front', onFaceChange, toBackLabel, toFrontLabel, className, style, children, onClick, ref, ...rest }) {
|
|
23
23
|
if (onRemove && !row)
|
package/dist/cards/CardFeed.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Children, createContext, isValidElement, useContext, useEffect, useId, useLayoutEffect, useRef } from 'react';
|
|
3
3
|
import { cx } from '../cx.js';
|
|
4
|
-
import { reducedMotion, setRefs, useControlled, warnOnce } from '../state.js';
|
|
4
|
+
import { glide, reducedMotion, setRefs, sheetMs, stopMoves, useControlled, warnOnce } from '../state.js';
|
|
5
5
|
import { Card } from './Card.js';
|
|
6
6
|
import { CardHead } from './CardHead.js';
|
|
7
7
|
import { CardFoot } from './CardFoot.js';
|
|
@@ -45,19 +45,17 @@ export function CardFeed({ big: bigProp, defaultBig, onBigChange, onMore, ahead
|
|
|
45
45
|
if (changed) {
|
|
46
46
|
if (!kept && ids.length)
|
|
47
47
|
request(ids[0], 'queue');
|
|
48
|
-
els
|
|
49
|
-
a.cancel(); })); // read the resting places
|
|
48
|
+
stopMoves(els, 'feed-move'); // read the resting places
|
|
50
49
|
}
|
|
51
50
|
const at = new Map(els.map((el) => [el, el.offsetTop]));
|
|
52
51
|
if (changed && box && !reducedMotion()) {
|
|
53
|
-
const
|
|
52
|
+
const cs = getComputedStyle(box), arrive = cs.getPropertyValue('--ease-out').trim() || 'ease-out';
|
|
54
53
|
for (const el of els) {
|
|
55
54
|
const from = tops.current.get(el);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
move.id = 'feed-move';
|
|
55
|
+
if (from === undefined)
|
|
56
|
+
el.animate([{ opacity: 0 }, { opacity: 1 }], { duration: sheetMs(cs), easing: arrive }).id = 'feed-move'; // it came in: no place to come from
|
|
57
|
+
else if (from !== at.get(el))
|
|
58
|
+
glide(el, from - (at.get(el) ?? 0), cs, 'feed-move');
|
|
61
59
|
}
|
|
62
60
|
}
|
|
63
61
|
tops.current = at;
|