stitch2 0.21.0 → 0.22.0
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/dist/consistency.js
CHANGED
|
@@ -335,7 +335,7 @@ export function reuseIssues(path, page) {
|
|
|
335
335
|
if (familyOf(path) !== 'screens')
|
|
336
336
|
return [];
|
|
337
337
|
return page.handBuilt.slice(0, 10).map((h) => ({
|
|
338
|
-
severity: '
|
|
338
|
+
severity: 'error',
|
|
339
339
|
type: 'reuse',
|
|
340
340
|
message: `${nameOf(h.kind)} built by hand; use <${NAMES[h.kind]?.[1] ?? 'the catalog component'}> (see the component catalog, ${config.catalogDir})`,
|
|
341
341
|
selector: h.selector,
|
package/package.json
CHANGED
package/skills/stitch2/SKILL.md
CHANGED
|
@@ -54,8 +54,9 @@ References, read before the first screen:
|
|
|
54
54
|
and translate it with **stitch2-translate**. Never add classes to a component to change how it looks, and never write a colour value (hex,
|
|
55
55
|
`rgb()`, `hsl()`): only DESIGN.md's colours, as token classes or `var(--<prefix>-<name>)`.
|
|
56
56
|
5. **Check** `stitch2 check <path> --shots --strict`. Fix every error (overflow, wrapped labels, content under
|
|
57
|
-
fixed bars, fixed bars overlapping each other, tap targets, contrast, cramped text)
|
|
58
|
-
|
|
57
|
+
fixed bars, fixed bars overlapping each other, tap targets, contrast, cramped text), a hand-built copy of a
|
|
58
|
+
catalog component (`reuse`: use the component or extend it, never rebuild it), and every warning about type
|
|
59
|
+
(`type-*`), components that differ from the catalog (`consistency`) and colour values (`color`).
|
|
59
60
|
Text running into other text (`text-overlap`) or out of its card (`overflow`) is an error; a short label cut
|
|
60
61
|
short with an ellipsis (`truncated`) is a warning to fix with room, not a smaller size. Google's rules are
|
|
61
62
|
warnings too (`text-small`, `edge-margin`, `measure`, `tap-spacing`, `placeholder-label`, `unnamed-control`,
|
|
@@ -11,6 +11,8 @@ colour, icons and states. Users learn an element once; every variant costs atten
|
|
|
11
11
|
|
|
12
12
|
## The ladder
|
|
13
13
|
|
|
14
|
+
Open the catalog first (on the canvas, or its render under `<design>/renders/`): every element of the
|
|
15
|
+
screen is mapped to a component before any markup is written, and the mapping is part of the hand-over.
|
|
14
16
|
Go down only when the step above cannot work:
|
|
15
17
|
|
|
16
18
|
1. **Use** a component as it is.
|
|
@@ -69,9 +71,11 @@ series) is added to DESIGN.md first, with a line in the prose saying where it is
|
|
|
69
71
|
|
|
70
72
|
## What the checks report
|
|
71
73
|
|
|
72
|
-
- **reuse
|
|
73
|
-
|
|
74
|
-
label).
|
|
74
|
+
- **reuse** (an error: it fails `check --strict` and blocks the hand-over): on a lab screen, an element that
|
|
75
|
+
looks like a catalog component but was built by hand (a bottom bar with three or more buttons, an h1,
|
|
76
|
+
a primary-filled button, a pill chip, a header icon button, a caps label). A screen that duplicates a
|
|
77
|
+
component instead of using it is not handed over: use the component, or extend it (step 4 of the ladder)
|
|
78
|
+
when it cannot do what the screen needs.
|
|
75
79
|
- **consistency**: a component whose size, radius, font, icon set or icons differ from the catalog's version
|
|
76
80
|
(or, without a catalog, from the majority of screens in its family), or that appears in two versions on one
|
|
77
81
|
screen. `stitch2 consistency` shows the same as cropped images; see the stitch2-consistency skill.
|