@usableapp/cardds 0.7.139 → 0.7.141
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 +22 -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/parts.css +2 -2
- package/css/sheet.css +2 -2
- package/css/theme.template.css +1 -1
- package/css/tokens.css +13 -5
- package/dist/cardds.css +50 -39
- 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/parts/Words.d.ts +5 -2
- package/dist/parts/Words.js +6 -5
- package/dist/type/textScale.d.ts +4 -1
- package/dist/type/textScale.js +4 -1
- package/docs/reference.md +12 -7
- package/lint/rules.mjs +3 -2
- package/package.json +1 -1
package/dist/cards/Card.js
CHANGED
|
@@ -17,9 +17,9 @@ 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"`: paper head and foot bands edge to edge, the tint between.
|
|
20
|
+
* read the same on both faces, the middle is one fixed height; `backFull` gives the back the whole card, centred, with neither. `paper="bands"`: paper head and foot bands edge to edge, the tint between.
|
|
21
21
|
*/
|
|
22
|
-
export function Card({ tone, paper, sm, row, cover, fold, centre, band, as = 'article', stack, leave, onLeft, onRemove, removeLabel, back, face, defaultFace = 'front', onFaceChange, toBackLabel, toFrontLabel, startInView, className, style, children, onClick, ref, ...rest }) {
|
|
22
|
+
export function Card({ tone, paper, sm, row, cover, fold, centre, band, as = 'article', stack, leave, onLeft, onRemove, removeLabel, back, backFull, face, defaultFace = 'front', onFaceChange, toBackLabel, toFrontLabel, startInView, className, style, children, onClick, ref, ...rest }) {
|
|
23
23
|
if (onRemove && !row)
|
|
24
24
|
warnOnce('card-remove-row', 'cardds Card: `onRemove` draws its cross on a `row` card only');
|
|
25
25
|
if (back != null && (row || sm || stack))
|
|
@@ -126,8 +126,8 @@ export function Card({ tone, paper, sm, row, cover, fold, centre, band, as = 'ar
|
|
|
126
126
|
const ownHeadKid = kids.find((c) => isValidElement(c) && c.type === Head);
|
|
127
127
|
const ownFootKid = kids.find((c) => isValidElement(c) && c.type === Foot);
|
|
128
128
|
const front = kids.filter((c) => c !== ownHeadKid && c !== ownFootKid);
|
|
129
|
-
const side = (which, middle) => (_jsxs("div", { className: cx('card__face flip__face', `flip__face--${which}`), ...((which === 'back') !== flipped ? { inert: true } : {}), children: [_jsx("button", { type: "button", className: "card__turn", "aria-label": which === 'front' ? toBackLabel ?? word('turnToBack') : toFrontLabel ?? word('turnToFront'), onClick: () => ask(which === 'front' ? 'back' : 'front') }), ownHeadKid, _jsx("div", { className:
|
|
130
|
-
return createElement(as, props, inner(_jsxs(_Fragment, { children: [side('front', null), side('back', back)] })));
|
|
129
|
+
const side = (which, middle, bare = false) => (_jsxs("div", { className: cx('card__face flip__face', `flip__face--${which}`), ...((which === 'back') !== flipped ? { inert: true } : {}), children: [_jsx("button", { type: "button", className: "card__turn", "aria-label": which === 'front' ? toBackLabel ?? word('turnToBack') : toFrontLabel ?? word('turnToFront'), onClick: () => ask(which === 'front' ? 'back' : 'front') }), bare ? null : ownHeadKid, _jsx("div", { className: cx('card__middle', bare && 'card__middle--full'), children: which === 'front' ? front : middle }), bare ? null : ownFootKid] }, which));
|
|
130
|
+
return createElement(as, props, inner(_jsxs(_Fragment, { children: [side('front', null), side('back', back, backFull)] })));
|
|
131
131
|
}
|
|
132
132
|
return createElement(as, props, inner(_jsxs(_Fragment, { children: [children, cross] })));
|
|
133
133
|
}
|