@usableapp/cardds 0.7.138 → 0.7.139

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.
@@ -9,6 +9,8 @@ export interface StackSheetTab {
9
9
  label: string;
10
10
  /** a small count over the icon: what waits there (alerts, new asks); 0 or none = no circle */
11
11
  count?: number;
12
+ /** words before the count in its circle, the app's: `'+'` draws "+1" (new ones came). Shown only with a count; a screen reader hears it with the count */
13
+ countPrefix?: string;
12
14
  }
13
15
  export interface StackSheetProps extends Omit<ComponentProps<'article'>, 'title'> {
14
16
  /** the SHEET HEAD's title — an h2 (the page's h1 is its own) */
@@ -43,7 +45,7 @@ export interface StackSheetProps extends Omit<ComponentProps<'article'>, 'title'
43
45
  * StackSheet — ONE sheet of a `SheetStack`, in the one sheet shape: SHEET HEAD (back · title · tabs or an icon) pinned at the top ·
44
46
  * `top` (pinned under the head, optional) · SHEET BODY (the children; scrolls) · SHEET FOOT (`foot`, the CTA) at the bottom. Its tabs are icon buttons. The chosen one is filled
45
47
  * only while this sheet is open — a closed home shows every icon plain; the disc fades in with the rise and out with the fold.
46
- * A count shows as a small circle over its icon. The body is the app's: render the page of the chosen tab (and nothing while the sheet
48
+ * A count shows as a small circle over its icon (`countPrefix` writes before it: "+1"), and is read with the tab's name. The body is the app's: render the page of the chosen tab (and nothing while the sheet
47
49
  * is closed — see `Home`). A direct child of `SheetStack`. Once open, cardds puts the cursor in the field marked `data-autofocus`, else the first field, else the heading — write no focus code.
48
50
  */
49
51
  export declare function StackSheet({ title, tone, paper, icon, tabs, tab: tabProp, defaultTab, onTabChange, top, foot, backLabel, backAt, stack, className, children, ...rest }: StackSheetProps): import("react").JSX.Element;
@@ -17,7 +17,7 @@ import { runOver } from './sheetMeasure.js';
17
17
  * StackSheet — ONE sheet of a `SheetStack`, in the one sheet shape: SHEET HEAD (back · title · tabs or an icon) pinned at the top ·
18
18
  * `top` (pinned under the head, optional) · SHEET BODY (the children; scrolls) · SHEET FOOT (`foot`, the CTA) at the bottom. Its tabs are icon buttons. The chosen one is filled
19
19
  * only while this sheet is open — a closed home shows every icon plain; the disc fades in with the rise and out with the fold.
20
- * A count shows as a small circle over its icon. The body is the app's: render the page of the chosen tab (and nothing while the sheet
20
+ * A count shows as a small circle over its icon (`countPrefix` writes before it: "+1"), and is read with the tab's name. The body is the app's: render the page of the chosen tab (and nothing while the sheet
21
21
  * is closed — see `Home`). A direct child of `SheetStack`. Once open, cardds puts the cursor in the field marked `data-autofocus`, else the first field, else the heading — write no focus code.
22
22
  */
23
23
  export function StackSheet({ title, tone, paper, icon, tabs, tab: tabProp, defaultTab, onTabChange, top, foot, backLabel = word('back'), backAt = 'none', stack, className, children, ...rest }) {
@@ -34,5 +34,8 @@ export function StackSheet({ title, tone, paper, icon, tabs, tab: tabProp, defau
34
34
  measure();
35
35
  return watchSize([h, run], measure);
36
36
  }, [title]);
37
- return (_jsxs(Card, { stack: stack, tone: tone, paper: paper, className: cx('stack-sheet', className), ...rest, children: [_jsxs(Head, { ref: headRef, long: long, children: [backAt === 'start' && _jsx(StackBack, { label: backLabel }), _jsx(Words, { title: _jsx("span", { className: "stack-sheet__run", children: title }) }), tabs?.length ? (_jsx("span", { className: "stack-sheet__tabs", role: "tablist", children: tabs.map((t) => (_jsxs(IconBtn, { sm: true, invert: t.id === tab, role: "tab", "aria-selected": t.id === tab, label: t.label, className: "stack-sheet__tab", onClick: () => pick(t.id), children: [_jsx(Icon, { name: t.icon }), t.count ? _jsx(Badge, { className: "stack-sheet__count", children: t.count > 99 ? '99+' : t.count }) : null] }, t.id))) })) : icon, backAt === 'end' && _jsx(StackBack, { end: true, label: backLabel })] }), top != null && _jsx("div", { className: "stack-sheet__top", children: top }), _jsx(Body, { role: tabs?.length ? 'tabpanel' : undefined, children: children }), foot != null && _jsx(Foot, { children: foot })] }));
37
+ return (_jsxs(Card, { stack: stack, tone: tone, paper: paper, className: cx('stack-sheet', className), ...rest, children: [_jsxs(Head, { ref: headRef, long: long, children: [backAt === 'start' && _jsx(StackBack, { label: backLabel }), _jsx(Words, { title: _jsx("span", { className: "stack-sheet__run", children: title }) }), tabs?.length ? (_jsx("span", { className: "stack-sheet__tabs", role: "tablist", children: tabs.map((t) => {
38
+ const count = t.count ? `${t.countPrefix ?? ''}${t.count > 99 ? '99+' : t.count}` : '';
39
+ return (_jsxs(IconBtn, { sm: true, invert: t.id === tab, role: "tab", "aria-selected": t.id === tab, label: count ? `${t.label} ${count}` : t.label, className: "stack-sheet__tab", onClick: () => pick(t.id), children: [_jsx(Icon, { name: t.icon }), count ? _jsx(Badge, { className: "stack-sheet__count", children: count }) : null] }, t.id));
40
+ }) })) : icon, backAt === 'end' && _jsx(StackBack, { end: true, label: backLabel })] }), top != null && _jsx("div", { className: "stack-sheet__top", children: top }), _jsx(Body, { role: tabs?.length ? 'tabpanel' : undefined, children: children }), foot != null && _jsx(Foot, { children: foot })] }));
38
41
  }
package/lib/mcp.mjs CHANGED
@@ -71,7 +71,7 @@ const TOOLS = [
71
71
  },
72
72
  {
73
73
  name: 'check_source',
74
- description: 'Run cardds\'s rules over code you wrote (a hand-written cardds class, a Sheet that cannot move, a bar with a sheet…). A person's tool, never a session's step; an empty list means clean.',
74
+ description: "Run cardds's rules over code you wrote (a hand-written cardds class, a Sheet that cannot move, a bar with a sheet…). A person's tool, never a session's step; an empty list means clean.",
75
75
  inputSchema: { type: 'object', properties: { code: str('the .tsx/.jsx source'), filename: str('its file name, for the report (default screen.tsx)') }, required: ['code'] },
76
76
  run: (_cat, a) => catalog.check(a.code, a.filename),
77
77
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usableapp/cardds",
3
- "version": "0.7.138",
3
+ "version": "0.7.139",
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).",