@tristan2828/ui-foundation 4.137.0 → 4.137.1
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/conventions/agents/skills/new-entity/SKILL.md +5 -2
- package/conventions/docs/design-language.md +2 -2
- package/dist/components/app/line-chart.js +1 -1
- package/dist/components/app/multi-line-chart.js +4 -4
- package/dist/components/app/quick-add-input.js +1 -1
- package/dist/lib/line-chart-layout.js +1 -1
- package/package.json +2 -2
- package/styles/index.css +1 -1
|
@@ -7,8 +7,11 @@ allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Agent
|
|
|
7
7
|
Add a full CRUD entity end to end. The entity name is this skill's
|
|
8
8
|
argument — if none was given, ask for one before proceeding.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
Follow `docs/foundation/add-an-entity.md` exactly, in order. Read its
|
|
11
|
+
index, "Before anything: the entity plan" and "The steps" (steps 1 to 10)
|
|
12
|
+
in full. Then reach "Step 6 in detail" and the sections after it through
|
|
13
|
+
the index, reading each one the entity's plan calls for: every field type
|
|
14
|
+
it has, and the standard for every screen it builds. Never guess
|
|
12
15
|
what the entity is: every field comes from `docs/entities/<entity>.md`,
|
|
13
16
|
and if that file doesn't exist you plan it with the developer and wait for
|
|
14
17
|
their go-ahead before building anything. That file is the only copy of the
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
- [Several values over time](#several-values-over-time) · lines 1152–1190
|
|
30
30
|
- [Parts of a whole over time](#parts-of-a-whole-over-time) · lines 1192–1233
|
|
31
31
|
- [A list as a board](#a-list-as-a-board) · lines 1235–1345
|
|
32
|
-
- [Order, groups and the header
|
|
32
|
+
- [Order, groups and the header](#order-groups-and-the-header) · lines 1288–1345
|
|
33
33
|
- [A list as cards](#a-list-as-cards) · lines 1347–1394
|
|
34
34
|
- [Images full screen](#images-full-screen) · lines 1396–1442
|
|
35
35
|
- [Key numbers on a record](#key-numbers-on-a-record) · lines 1444–1480
|
|
@@ -1285,7 +1285,7 @@ the table's.
|
|
|
1285
1285
|
snap points; a phone shows one column at a time, with the edge of the
|
|
1286
1286
|
next one showing.
|
|
1287
1287
|
|
|
1288
|
-
### Order, groups and the header
|
|
1288
|
+
### Order, groups and the header
|
|
1289
1289
|
|
|
1290
1290
|
```tsx
|
|
1291
1291
|
<Board<Job, Stage, Size>
|
|
@@ -78,5 +78,5 @@ export function LineChart({ label, points, target, projection, mark, levels, for
|
|
|
78
78
|
return (_jsxs("figure", { "data-slot": "line-chart", "data-state": "success", "aria-label": label, className: cn('grid min-w-0 gap-x-2 gap-y-1.5', steps ? 'grid-cols-[auto_minmax(0,1fr)]' : 'grid-cols-1', className), children: [steps && (_jsxs("div", { "aria-hidden": "true", "data-slot": "line-chart-levels", className: "relative", style: { height }, children: [levels.map((name, index) => (_jsx("span", { className: "absolute right-0 -translate-y-1/2 type-caption whitespace-nowrap text-muted-foreground", style: { top: percent(layout.levelYs[index]) }, children: name }, name))), _jsx("span", { className: "invisible flex h-0 flex-col overflow-hidden type-caption whitespace-nowrap", children: levels.map((name) => (_jsx("span", { children: name }, name))) })] })), _jsxs("div", { "aria-hidden": "true", className: "relative border-b border-border", style: { height }, children: [steps &&
|
|
79
79
|
layout.levelYs.map((y, index) => (_jsx("span", { "data-slot": "line-chart-level-rule", className: "absolute inset-x-0 border-t border-dashed border-border", style: { top: percent(y) } }, index))), target && layout.targetY !== undefined && (_jsxs(_Fragment, { children: [_jsx("svg", { viewBox: "0 0 100 100", preserveAspectRatio: "none", className: "absolute inset-0 size-full overflow-visible text-success-text", children: _jsx("line", { x1: "0", x2: "100", y1: layout.targetY * 100, y2: layout.targetY * 100, strokeWidth: 1.5, strokeDasharray: "6 4", vectorEffect: "non-scaling-stroke", className: "stroke-current" }) }), _jsxs("span", { className: cn('absolute right-0 -translate-y-full type-caption text-success-text tabular-nums', PLATE), style: { top: percent(layout.targetY) }, children: [target.label, " ", formatY(target.y)] })] })), points.length > 1 && (_jsx("svg", { viewBox: "0 0 100 100", preserveAspectRatio: "none", className: "absolute inset-0 size-full overflow-visible text-info-text", children: _jsx("polyline", { points: line, fill: "none", strokeWidth: 2, strokeLinejoin: "round", strokeLinecap: "round", vectorEffect: "non-scaling-stroke", className: "stroke-current" }) })), projected.length > 1 && (_jsx("svg", { "data-slot": "line-chart-projection", viewBox: "0 0 100 100", preserveAspectRatio: "none", className: "absolute inset-0 size-full overflow-visible text-info-text", children: _jsx("polyline", { points: toLine(projected), fill: "none", strokeWidth: 2, strokeDasharray: "6 4", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke", className: "stroke-current" }) })), dot && (_jsxs(_Fragment, { children: [_jsx("span", { "data-slot": "line-chart-mark", className: "absolute size-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-info-text ring-2 ring-card", style: { left: percent(dot.x), top: percent(dot.y) } }), _jsx("span", { className: cn('absolute type-caption font-medium text-foreground tabular-nums', PLATE, besides(dot.x),
|
|
80
80
|
// Under the lowest point, where the line isn't; over any other.
|
|
81
|
-
mark === 'min' ? 'mt-1' : '-translate-y-full -mt-1'), style: { left: percent(dot.x), top: percent(dot.y) }, children: formatY(points[marked ? layout.markIndex : 0].y) })] }))] }), _jsxs("div", { "aria-hidden": "true", className: cn('flex justify-between gap-3 type-caption text-muted-foreground tabular-nums', steps && 'col-start-2'), children: [_jsx("span", { children: formatX(points[0].x) }), (points.length > 1 || ahead.length > 0) && _jsx("span", { children: formatX(lastX) })] }), _jsx("figcaption", { className: "sr-only", children: steps ? `${summary}; one of ${levels.join(', ')}` : summary }),
|
|
81
|
+
mark === 'min' ? 'mt-1' : '-translate-y-full -mt-1'), style: { left: percent(dot.x), top: percent(dot.y) }, children: formatY(points[marked ? layout.markIndex : 0].y) })] }))] }), _jsxs("div", { "aria-hidden": "true", className: cn('flex justify-between gap-3 type-caption text-muted-foreground tabular-nums', steps && 'col-start-2'), children: [_jsx("span", { children: formatX(points[0].x) }), (points.length > 1 || ahead.length > 0) && _jsx("span", { children: formatX(lastX) })] }), _jsx("figcaption", { className: "sr-only", children: steps ? `${summary}; one of ${levels.join(', ')}` : summary }), _jsx("div", { className: "sr-only", children: _jsxs("table", { children: [_jsx("caption", { children: label }), _jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { scope: "col", children: "When" }), _jsx("th", { scope: "col", children: "Value" })] }) }), _jsxs("tbody", { children: [points.map((point, index) => (_jsxs("tr", { children: [_jsx("th", { scope: "row", children: formatX(point.x) }), _jsx("td", { children: formatY(point.y) })] }, index))), ahead.map((point, index) => (_jsxs("tr", { children: [_jsx("th", { scope: "row", children: formatX(point.x) }), _jsxs("td", { children: [formatY(point.y), " (", projection.label, ")"] })] }, `ahead-${index}`)))] })] }) })] }));
|
|
82
82
|
}
|
|
@@ -68,8 +68,8 @@ export function MultiLineChart({ label, series, target, formatY = defaultY, form
|
|
|
68
68
|
return (_jsx("span", { "data-slot": "multi-line-chart-dot", className: cn('absolute size-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full ring-2 ring-card', DOT[tone]), style: { left: percent(places[0].x), top: percent(places[0].y) } }, s));
|
|
69
69
|
}
|
|
70
70
|
return (_jsx("svg", { "data-slot": "multi-line-chart-series", viewBox: "0 0 100 100", preserveAspectRatio: "none", className: cn('absolute inset-0 size-full overflow-visible', TONE[tone]), children: _jsx("polyline", { points: places.map((place) => `${place.x * 100},${place.y * 100}`).join(' '), fill: "none", strokeWidth: 2, strokeDasharray: one.dashed ? DASH : undefined, strokeLinejoin: "round", strokeLinecap: one.dashed ? undefined : 'round', vectorEffect: "non-scaling-stroke", className: "stroke-current" }) }, s));
|
|
71
|
-
})] }), _jsxs("div", { "aria-hidden": "true", className: "flex justify-between gap-3 type-caption text-muted-foreground tabular-nums", children: [_jsx("span", { children: formatX(left.x) }), right.at > left.at && _jsx("span", { children: formatX(right.x) })] }), _jsx("ul", { "aria-hidden": "true", "data-slot": "multi-line-chart-legend", className: "flex flex-wrap gap-x-4 gap-y-1 type-caption text-foreground", children: drawn.map((one, s) => (_jsxs("li", { className: "flex items-center gap-1.5", children: [_jsx("svg", { viewBox: "0 0 16 4", className: cn('h-1 w-4 shrink-0', TONE[one.tone ?? 'info']), children: _jsx("line", { x1: "0", x2: "16", y1: "2", y2: "2", strokeWidth: 2, strokeDasharray: one.dashed ? '4 2' : undefined, className: "stroke-current" }) }), _jsx("span", { children: one.label }), _jsx("span", { className: "font-medium tabular-nums", children: formatY(one.points[one.points.length - 1].y) })] }, s))) }), _jsx("figcaption", { className: "sr-only", children: summary }),
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
})] }), _jsxs("div", { "aria-hidden": "true", className: "flex justify-between gap-3 type-caption text-muted-foreground tabular-nums", children: [_jsx("span", { children: formatX(left.x) }), right.at > left.at && _jsx("span", { children: formatX(right.x) })] }), _jsx("ul", { "aria-hidden": "true", "data-slot": "multi-line-chart-legend", className: "flex flex-wrap gap-x-4 gap-y-1 type-caption text-foreground", children: drawn.map((one, s) => (_jsxs("li", { className: "flex items-center gap-1.5", children: [_jsx("svg", { viewBox: "0 0 16 4", className: cn('h-1 w-4 shrink-0', TONE[one.tone ?? 'info']), children: _jsx("line", { x1: "0", x2: "16", y1: "2", y2: "2", strokeWidth: 2, strokeDasharray: one.dashed ? '4 2' : undefined, className: "stroke-current" }) }), _jsx("span", { children: one.label }), _jsx("span", { className: "font-medium tabular-nums", children: formatY(one.points[one.points.length - 1].y) })] }, s))) }), _jsx("figcaption", { className: "sr-only", children: summary }), _jsx("div", { className: "sr-only", children: _jsxs("table", { children: [_jsx("caption", { children: label }), _jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { scope: "col", children: "When" }), drawn.map((one, s) => (_jsx("th", { scope: "col", children: one.label }, s)))] }) }), _jsx("tbody", { children: rows.map((x) => (_jsxs("tr", { children: [_jsx("th", { scope: "row", children: formatX(x) }), drawn.map((one, s) => {
|
|
72
|
+
const point = one.points.find((p) => String(p.x) === String(x));
|
|
73
|
+
return _jsx("td", { children: point ? formatY(point.y) : '' }, s);
|
|
74
|
+
})] }, String(x)))) })] }) })] }));
|
|
75
75
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
// A quick add's one line
|
|
2
|
+
// A quick add's one line: what parseQuickAdd reads is
|
|
3
3
|
// marked in the box as you type and shown under it as chips, so a misread
|
|
4
4
|
// is seen at once. ✕ on a read chip gives its words back to the title
|
|
5
5
|
// (the "sun" that wasn't Sunday). The app passes its own chips, the ones
|
|
@@ -77,7 +77,7 @@ export function seriesLayout(series, target) {
|
|
|
77
77
|
targetY: shared.targetY,
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
|
-
// Amounts stacked from zero (StackedAreaChart
|
|
80
|
+
// Amounts stacked from zero (StackedAreaChart): every band shares
|
|
81
81
|
// `xs`, a band's bottom is the sum of the bands below it and its top adds
|
|
82
82
|
// its own value, so the top band's top is the total. The range is 0 to the
|
|
83
83
|
// largest total with room above only. `values` are already cleaned: one per
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tristan2828/ui-foundation",
|
|
3
|
-
"version": "4.137.
|
|
3
|
+
"version": "4.137.1",
|
|
4
4
|
"description": "Shared UI foundation for contract-first, database-backed React apps: shadcn primitives, DataTable/EntityForm composites, auth, the gateway error seam, design tokens, lint rules and the AI playbook.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
"sonner": "^2.0.8",
|
|
183
183
|
"tailwindcss": "^4.3.5",
|
|
184
184
|
"typescript": "~6.0.3",
|
|
185
|
-
"typescript-eslint": "^8.
|
|
185
|
+
"typescript-eslint": "^8.73.0",
|
|
186
186
|
"vite": "^8.3.8",
|
|
187
187
|
"vitest": "^5.1.0",
|
|
188
188
|
"zod": "^4.6.7"
|
package/styles/index.css
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
@custom-variant density-compact (&:where([data-density="compact"], [data-density="compact"] *));
|
|
30
30
|
|
|
31
|
-
/* Page width
|
|
31
|
+
/* Page width: data-width="wide" on <html> (an app's own setting,
|
|
32
32
|
kept per browser as Text Size's data-density is) lifts a record page's
|
|
33
33
|
reading cap, so its column fills a wide screen; the facts rail stays
|
|
34
34
|
300px. A record in a dialog keeps the dialog's size. `page-wide:max-w-none`. */
|