@usableapp/cardds 0.7.34 → 0.7.35
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
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
> For: a project that consumes `@usableapp/cardds` and its AI — what changed between versions, written as before → after, so a screen can be brought up to date without reading the source. Newest first. A consumer never edits cardds; if something here leaves you without a way to do what you did before, report the gap.
|
|
4
4
|
|
|
5
|
+
## 0.7.35 — 2026-10-01
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- **`CallSheet`: a sheet on its way out keeps its body until it has slid away** (Lh 2026-10-01). Before, the body was taken out the moment `open` turned null (or another way was called), so an empty sheet slid down. Nothing to change in a screen.
|
|
9
|
+
|
|
5
10
|
## 0.7.34 — 2026-10-01
|
|
6
11
|
|
|
7
12
|
### Changed
|
|
@@ -4,7 +4,7 @@ import { type SheetProps } from '../sheets/Sheet.js';
|
|
|
4
4
|
export interface CallSheetSheet {
|
|
5
5
|
/** the sheet head's title */
|
|
6
6
|
title: ReactNode;
|
|
7
|
-
/** the sheet body — rendered only while the sheet is up; a function is called then */
|
|
7
|
+
/** the sheet body — rendered only while the sheet is up (and while it slides away); a function is called then */
|
|
8
8
|
body: ReactNode | (() => ReactNode);
|
|
9
9
|
/** the sheet foot: the one button that finishes the sheet */
|
|
10
10
|
foot?: ReactNode;
|
|
@@ -21,8 +21,16 @@ export function CallSheet({ media, heading, body, action, sheet, ways, open: ope
|
|
|
21
21
|
const list = ways ?? (sheet ? [{ action, sheet }] : []);
|
|
22
22
|
const [on, set] = useControlled(openProp === undefined ? undefined : index(openProp), index(defaultOpen), onOpenChange && ((next) => onOpenChange(next !== null, next)));
|
|
23
23
|
const [at, setAt] = useState('full');
|
|
24
|
+
// a sheet on its way out keeps its body until it has slid away — an emptied sheet sliding down read as a broken one
|
|
25
|
+
const [leaving, setLeaving] = useState(null), [was, setWas] = useState(on);
|
|
26
|
+
if (was !== on) {
|
|
27
|
+
setWas(on);
|
|
28
|
+
if (was !== null)
|
|
29
|
+
setLeaving(was);
|
|
30
|
+
}
|
|
24
31
|
return (_jsxs(Screen, { fill: true, ...rest, children: [_jsxs(Step, { children: [_jsxs(Page, { children: [media, _jsx(CardHead, { level: "h1", heading: heading }), typeof body === 'string' ? _jsx(Text, { level: "body", children: body }) : body, _jsx(CtaPack, { children: list.map((w, i) => (_jsx(Btn, { primary: i === 0, quiet: i > 0, "aria-expanded": on === i, onClick: () => { setAt('full'); set(i); }, children: w.action }, i))) })] }), list.map(({ sheet: sh }, i) => (_jsxs(Sheet, { state: on === i ? at : 'away', onStateChange: (s) => { if (s === 'away')
|
|
25
32
|
set(null);
|
|
26
33
|
else
|
|
27
|
-
setAt(s); },
|
|
34
|
+
setAt(s); }, onSettled: (s) => { if (s === 'away' && leaving === i)
|
|
35
|
+
setLeaving(null); }, states: states, handle: sh.handle ?? handle, children: [_jsx(CardHead, { heading: sh.title }), _jsx(SheetBody, { children: on === i || leaving === i ? (typeof sh.body === 'function' ? sh.body() : sh.body) : null }), (sh.foot != null || sh.footLink != null) && _jsx(CardFoot, { link: sh.footLink, children: sh.foot })] }, i)))] }), children] }));
|
|
28
36
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usableapp/cardds",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.35",
|
|
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.",
|