jig-ui 0.26.0 → 0.26.2
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 +47 -0
- package/dist/index.js +629 -423
- package/package.json +1 -1
- package/rules/03-patterns.md +11 -1
- package/templates/COMMAND.md.tmpl +17 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jig-ui",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.2",
|
|
4
4
|
"description": "A design system for coding agents. 160 numbered UI rules, brand x mode design tokens, and an installer for Claude Code, Codex, Cursor and opencode.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
package/rules/03-patterns.md
CHANGED
|
@@ -53,7 +53,16 @@ Four numbers, and most button designs in the wild fail at least one:
|
|
|
53
53
|
| Button **shape** — fill or border — against its background | **3:1** |
|
|
54
54
|
| Button **text** against the button | **4.5:1** |
|
|
55
55
|
| Two buttons sharing a style, distinguished only by contrast | **3:1 between them** |
|
|
56
|
-
| Hit area | `--size-touch-target` — **48×48px** floor |
|
|
56
|
+
| Hit area | `--size-touch-target` — **48×48px** floor, except inside a table row (below) |
|
|
57
|
+
|
|
58
|
+
**Inside a table row, a button takes the row's height.** A dense row is shorter
|
|
59
|
+
than the floor, and a button given `min-height: var(--size-touch-target)` there
|
|
60
|
+
stretches the rows that hold it and not the rest: an invoices table had its
|
|
61
|
+
"Mark as paid" rows at 65px among 41px ones, twice. Size it to `--size-control`
|
|
62
|
+
and never give it a minimum height of its own. On a touch screen the row itself
|
|
63
|
+
rises to `--size-touch-target` (the mode files do it under a coarse pointer), so
|
|
64
|
+
a finger still gets the floor. The render probe reports rows made uneven this
|
|
65
|
+
way.
|
|
57
66
|
|
|
58
67
|
A secondary button's fill or border is **not decorative**. It is the only thing identifying the element as a button, so it carries the 3:1 non-text requirement (`02-tokens.md`). Strip it and you have coloured text.
|
|
59
68
|
|
|
@@ -285,6 +294,7 @@ Primarily an `operator` pattern; the rules apply wherever a table appears.
|
|
|
285
294
|
**Rules**
|
|
286
295
|
- Row identity is stable across refresh, sort and filter. A row that moves under a click causes the wrong record to be acted on — the most damaging bug this pattern has.
|
|
287
296
|
- Numeric columns are right-aligned and use tabular figures (`--font-numeric`). Text columns are start-aligned. Never centre either.
|
|
297
|
+
- Every row is one height. A button or link in a row takes the row's height and has no minimum height of its own (see the Button pattern, Hit area).
|
|
288
298
|
- A cell stays a table cell. To line up what is inside it (a name and a tag, an icon and a label), put `display: flex` on a wrapper inside the cell, never on the `<td>` or `<th>` itself: a cell given its own display stops taking its row's height, so its text and its border drift from the rest of the row. A table stacked on a phone, the whole table set to `block`, is the exception (`L-01`, step 6). The render probe reports a cell that has left its table.
|
|
289
299
|
- Column headers state units. "Weight" is ambiguous; "Weight (kg)" is not.
|
|
290
300
|
- Truncation is resolvable by click or expand, never by hover alone (`E-31`, `01-modes.md`).
|
|
@@ -78,12 +78,13 @@ came from, and the surfaces it used — the output says whether they came from
|
|
|
78
78
|
`jig.config.json` or from the default.
|
|
79
79
|
|
|
80
80
|
If the token layer does not exist yet, this is the command that creates it. **Do
|
|
81
|
-
not
|
|
81
|
+
not write the token files by hand.** `init` derives the brand colour, checks it
|
|
82
82
|
against the contrast floor in both light and dark, and records a checksum for
|
|
83
83
|
each file it writes; a file you write by hand is untracked, so `jig update` can
|
|
84
|
-
never refresh it again.
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
never refresh it again. The brand file it writes is the project's own, though:
|
|
85
|
+
once `DECISIONS.md` records a colour, a typeface or corners, change those values
|
|
86
|
+
in it to match (see `decide`). `jig check` reads the token layer back and holds it
|
|
87
|
+
to those floors, so a value that fails one is caught however it got there.
|
|
87
88
|
|
|
88
89
|
## check
|
|
89
90
|
|
|
@@ -1973,6 +1974,18 @@ the user as left out on purpose, with the reason. Then go the other way: every
|
|
|
1973
1974
|
and ask. A `Why (inferred):` traces to what it was inferred from; say what that was.
|
|
1974
1975
|
Include this mapping in your message, below the file.
|
|
1975
1976
|
|
|
1977
|
+
**Then put the answers into the brand file.** The type, the colour and the
|
|
1978
|
+
corners each name the token they become, and the brand file `init` wrote is the
|
|
1979
|
+
project's own: `jig update` refreshes the mode files and never touches it. Change
|
|
1980
|
+
its values to match what the user decided: the brand hue, saturation and lightness
|
|
1981
|
+
for the colour, `--font-text` and `--font-display` for the type (and load the face
|
|
1982
|
+
wherever the pages load their styles, if it is a web font), and the `--radius-*`
|
|
1983
|
+
scale for the corners. A value the user did not decide stays as `init` wrote it.
|
|
1984
|
+
Then run `{{scripts_path}} check`: it holds the brand file to the contrast floors
|
|
1985
|
+
in light and dark, and says if a decided colour or typeface never reached it. Of
|
|
1986
|
+
six runs whose owner named a colour and a typeface, four recorded both in this file
|
|
1987
|
+
and built every page in Jig's unbranded default, because no step said to apply them.
|
|
1988
|
+
|
|
1976
1989
|
Show it and ask the user to confirm it is right before you stop. Leave no
|
|
1977
1990
|
`[TODO]` markers — the gate treats them as an unwritten file, correctly, because
|
|
1978
1991
|
a placeholder decision is not a decision.
|