@usableapp/cardds 0.7.95 → 0.7.97

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/lib/guide.mjs CHANGED
@@ -7,7 +7,7 @@ ORDER: find → scaffold or get → write → check. First question: has cardds
7
7
  TOOLS: find_components · scaffold_screen · get_component · list_components · check_source. No MCP: npx cardds find|scaffold|get|list|check (all take --json).
8
8
  What no checker sees:
9
9
  1. cardds is a framework you take from outside. Never edit, commit to or release cardds from a consumer project, never node_modules. What cannot be set from outside is a framework gap: STOP and tell the user exactly what you needed.
10
- 2. Adjust from outside only, widest first: theme.css bases → knobs (--<component>-<what>) → props/slots. The theme's values are the user's call; never pick them.
10
+ 2. Adjust from outside only, widest first: theme.css bases → knobs (--<component>-<what>) → props/slots. The theme's values are the user's call; never pick them. cardGrounds() names a card the member cannot see on that theme; inkGrounds() a word or glyph they cannot read (docs/reference.md).
11
11
  3. Every component is controlled like an input (state/open/value + its on…, or default…) and none knows another: the app owns the state and wires them.
12
12
  4. Import components, never copy their markup or classes: a component is the look AND the behaviour.
13
13
  5. Mobile only, big targets; never adapt it to desktop.
package/lint/rules.mjs CHANGED
@@ -251,8 +251,12 @@ export function checkSource(source, file, { classes = carddsClasses() } = {}) {
251
251
  const el = elementAt(text, m.index);
252
252
  const btns = [...el.slice(tag.length).matchAll(/<Btn\b(?![\w.])/g)].map((b) => m.index + tag.length + b.index);
253
253
  if (btns.length < 2) continue;
254
+ // the two branches of a conditional (`last ? <Btn primary>Send</Btn> : <Btn primary>Next</Btn>`) are ONE slot: both are the forward one
255
+ const slot = []; let n = 0;
256
+ btns.forEach((at, i) => { if (i && /^\s*\)?\s*:\s*\(?\s*$/.test(text.slice(btns[i - 1] + elementAt(text, btns[i - 1]).length, at))) slot.push(n); else slot.push(++n); });
257
+ if (n < 2) continue;
254
258
  btns.forEach((at, i) => {
255
- const forward = i === btns.length - 1, primary = /\sprimary\b(?!\s*=\s*\{\s*false)/.test(tagAt(text, at));
259
+ const forward = slot[i] === n, primary = /\sprimary\b(?!\s*=\s*\{\s*false)/.test(tagAt(text, at));
256
260
  if (primary !== forward) add('pager-forward-primary', 'error', at, forward
257
261
  ? 'the forward <Btn> of a worded pager is not `primary`: back and next carry the same signal. The last Btn (the step it leads to) is <Btn primary>; the back one stays plain.'
258
262
  : 'a back <Btn> of a worded pager is `primary`: only the forward one (the last) is. Drop `primary` here.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usableapp/cardds",
3
- "version": "0.7.95",
3
+ "version": "0.7.97",
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.",
@@ -63,6 +63,7 @@
63
63
  "cardds.js",
64
64
  "icons.svg",
65
65
  "README.md",
66
+ "docs/reference.md",
66
67
  "CHANGELOG.md"
67
68
  ],
68
69
  "peerDependencies": {