dsforge-harness 0.1.2 → 0.1.6
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/README.md +143 -12
- package/package.json +1 -1
- package/plugins/dsforge/.claude-plugin/plugin.json +1 -1
- package/plugins/dsforge/skills/dsforge/SKILL.md +23 -11
- package/plugins/dsforge/skills/dsforge/references/00-portable-kit-and-runbook.md +7 -7
- package/plugins/dsforge/skills/dsforge/references/01-harness-design-and-validation-plan.md +3 -3
- package/plugins/dsforge/skills/dsforge/references/03-verifier-generalization-spec.md +10 -10
- package/plugins/dsforge/skills/dsforge/references/examples/smoke-fixture/README.md +2 -3
- package/plugins/dsforge/skills/dsforge/references/examples/smoke-fixture/validators/projects/smoke.json +1 -1
- package/plugins/dsforge/skills/dsforge/validators/check-layout.js +50 -7
- package/plugins/dsforge/skills/dsforge/validators/check2.js +4 -4
- package/plugins/dsforge/skills/dsforge/validators/check3.js +24 -1
- package/plugins/dsforge/skills/dsforge/validators/extract-tokens.js +1 -1
- package/plugins/dsforge/skills/dsforge/validators/projects/_TEMPLATE.json +4 -1
- package/plugins/dsforge/skills/dsforge/validators/test/check-layout.test.js +144 -8
- package/plugins/dsforge/skills/dsforge/validators/test/check3-icons.test.js +61 -0
- package/plugins/dsforge/skills/dsforge/validators/test/run-all.js +1 -1
- package/plugins/dsforge/skills/dsforge/validators/verify.js +6 -3
- package/templates/CLAUDE.md +4 -4
- package/plugins/dsforge/skills/dsforge/assets/code-scaffold-reference-ezp/DatasetManagement.tsx +0 -48
- package/plugins/dsforge/skills/dsforge/assets/code-scaffold-reference-ezp/ModelCreateEdit.tsx +0 -93
- package/plugins/dsforge/skills/dsforge/assets/code-scaffold-reference-ezp/components/DataTable.tsx +0 -64
- package/plugins/dsforge/skills/dsforge/assets/code-scaffold-reference-ezp/components/controls.tsx +0 -97
- package/plugins/dsforge/skills/dsforge/assets/code-scaffold-reference-ezp/components/forms.tsx +0 -41
- package/plugins/dsforge/skills/dsforge/assets/code-scaffold-reference-ezp/components/shell.tsx +0 -81
- package/plugins/dsforge/skills/dsforge/assets/code-scaffold-reference-ezp/ezp.css +0 -115
- package/plugins/dsforge/skills/dsforge/assets/code-scaffold-reference-ezp/tokens.css +0 -106
- package/plugins/dsforge/skills/dsforge/assets/code-scaffold-reference-ezp/tokens.ts +0 -94
- package/plugins/dsforge/skills/dsforge/references/examples/code-stage-instruction-dataset-management.md +0 -36
- package/plugins/dsforge/skills/dsforge/references/examples/ezp-states-elevation-augmentation-spec.md +0 -35
- package/plugins/dsforge/skills/dsforge/references/examples/run1-dataset-management-list-spec.md +0 -58
- package/plugins/dsforge/skills/dsforge/references/examples/run2-model-create-edit-spec.md +0 -38
- package/plugins/dsforge/skills/dsforge/references/examples/smoke-fixture/reports/22-verification-report.json +0 -53
- package/plugins/dsforge/skills/dsforge/validators/out/ezp-tokens.json +0 -7
- package/plugins/dsforge/skills/dsforge/validators/projects/ezp.json +0 -70
|
@@ -9,11 +9,22 @@
|
|
|
9
9
|
* FIXTURE A — the bug being fixed: a DS-component instance parks hidden internal layers OFF the frame
|
|
10
10
|
* (side-nav collapsed panel, pagination overflow). They are invisible and not rendered. Pre-fix the
|
|
11
11
|
* pass ran with skipInvisibleInstanceChildren=false and had no inInstance/hidden guard, so each such
|
|
12
|
-
* layer became a false outOfFrame (
|
|
12
|
+
* layer became a false outOfFrame (a test screen's A/B frames each produced ~70 of these).
|
|
13
13
|
* Post-fix: hardFails MUST be 0.
|
|
14
14
|
* FIXTURE B — guards against over-correction: real visible breakage is still caught (an authored clipped
|
|
15
15
|
* title + a clipped VISIBLE label inside an instance), while a VISIBLE non-text interior layer that
|
|
16
16
|
* extends past its parent is correctly ignored (DS internals are check1's job).
|
|
17
|
+
* FIXTURE C — nestedSameFill (P7) is an ADVISORY, never a hardFail: an edgeless layout wrapper repainting the
|
|
18
|
+
* page's own fill (white-on-white) is advised; a real raised card (same fill but with a border or a shadow)
|
|
19
|
+
* is exempt; a wrapper carrying a DIFFERENT fill from its parent (white block over an #EEF2FF card) is NOT a
|
|
20
|
+
* same-fill case (discipline, not this check). hardFails stay 0.
|
|
21
|
+
* FIXTURE D — nestedSameFill full-bleed precision (the approved-screen false positives): a full-bleed body
|
|
22
|
+
* background layer that spans a full axis of the surface beneath it is EXEMPT, while a same-fill SUB-REGION
|
|
23
|
+
* (a white table inside a white board) stays advised. hardFails stay 0.
|
|
24
|
+
* FIXTURE E — P2-1: the screen frame's OWN direct children are overlap-checked (real overlap → flag; mere
|
|
25
|
+
* adjacency → pass).
|
|
26
|
+
* FIXTURE F — P1-2: overlapping children INSIDE an instance are NOT flagged (instance = leaf); the same
|
|
27
|
+
* overlap inside an authored FRAME IS flagged.
|
|
17
28
|
*/
|
|
18
29
|
'use strict';
|
|
19
30
|
const fs = require('fs');
|
|
@@ -37,6 +48,9 @@ function buildFigma(rootSpec) {
|
|
|
37
48
|
layoutSizingHorizontal: spec.layoutSizingHorizontal || 'FIXED',
|
|
38
49
|
layoutSizingVertical: spec.layoutSizingVertical || 'FIXED',
|
|
39
50
|
fills: spec.fills !== undefined ? spec.fills : [{ type: 'SOLID' }],
|
|
51
|
+
strokes: spec.strokes || [],
|
|
52
|
+
effects: spec.effects || [],
|
|
53
|
+
opacity: spec.opacity,
|
|
40
54
|
width: spec.bbox ? spec.bbox.width : 0,
|
|
41
55
|
height: spec.bbox ? spec.bbox.height : 0,
|
|
42
56
|
textTruncation: spec.textTruncation || 'DISABLED',
|
|
@@ -82,9 +96,9 @@ async function runCheckLayout(figma) {
|
|
|
82
96
|
// ---- fixtures --------------------------------------------------------------
|
|
83
97
|
// Screen id MUST be '0:0' (CFG.screenFrameId in check-layout.js).
|
|
84
98
|
const fixtureA = {
|
|
85
|
-
id: '0:0', name: '
|
|
99
|
+
id: '0:0', name: 'A-screen', type: 'FRAME', layoutMode: 'VERTICAL', bbox: { x: 0, y: 0, width: 1440, height: 900 },
|
|
86
100
|
children: [
|
|
87
|
-
{ id: 'A:nav', name: '
|
|
101
|
+
{ id: 'A:nav', name: 'A-screen/side-nav', type: 'INSTANCE', bbox: { x: 0, y: 0, width: 240, height: 900 },
|
|
88
102
|
children: [
|
|
89
103
|
{ id: 'A:navitems', name: 'nav-items', type: 'FRAME', layoutMode: 'VERTICAL', bbox: { x: 0, y: 0, width: 240, height: 400 },
|
|
90
104
|
children: [
|
|
@@ -94,13 +108,14 @@ const fixtureA = {
|
|
|
94
108
|
{ id: 'A:dash', name: 'Dashboard', type: 'TEXT', bbox: { x: 16, y: 16, width: 120, height: 20 }, characters: 'Dashboard' },
|
|
95
109
|
] },
|
|
96
110
|
] },
|
|
97
|
-
|
|
111
|
+
// content sits beside the nav (top-level siblings just touch at x=240 — no overlap). Pagination lives
|
|
112
|
+
// INSIDE content (not a screen-level sibling), with its hidden overflow row parked off-frame.
|
|
113
|
+
{ id: 'A:content', name: 'content', type: 'FRAME', layoutMode: 'VERTICAL', bbox: { x: 240, y: 0, width: 1200, height: 900 },
|
|
98
114
|
children: [
|
|
99
|
-
|
|
100
|
-
{ id: 'A:
|
|
115
|
+
{ id: 'A:title', name: 'A-screen', type: 'TEXT', bbox: { x: 272, y: 24, width: 300, height: 28 }, characters: 'A-screen' },
|
|
116
|
+
{ id: 'A:pag', name: 'pagination-wrap', type: 'INSTANCE', bbox: { x: 264, y: 852, width: 1152, height: 32 },
|
|
117
|
+
children: [ { id: 'A:overflow', name: 'overflow-pages', type: 'FRAME', visible: false, layoutMode: 'HORIZONTAL', bbox: { x: 2200, y: 860, width: 300, height: 40 }, children: [] } ] },
|
|
101
118
|
] },
|
|
102
|
-
{ id: 'A:content', name: 'content', type: 'FRAME', layoutMode: 'VERTICAL', bbox: { x: 240, y: 0, width: 1200, height: 900 },
|
|
103
|
-
children: [ { id: 'A:title', name: 'Model Management', type: 'TEXT', bbox: { x: 272, y: 24, width: 300, height: 28 }, characters: 'Model Management' } ] },
|
|
104
119
|
],
|
|
105
120
|
};
|
|
106
121
|
|
|
@@ -124,6 +139,86 @@ const fixtureB = {
|
|
|
124
139
|
],
|
|
125
140
|
};
|
|
126
141
|
|
|
142
|
+
const WHITE = { type: 'SOLID', color: { r: 1, g: 1, b: 1 } };
|
|
143
|
+
const EEF2FF = { type: 'SOLID', color: { r: 238 / 255, g: 242 / 255, b: 1 } };
|
|
144
|
+
const STROKE = [{ type: 'SOLID', visible: true }];
|
|
145
|
+
const SHADOW = [{ type: 'DROP_SHADOW', visible: true }];
|
|
146
|
+
const fixtureC = {
|
|
147
|
+
id: '0:0', name: 'C-screen', type: 'FRAME', layoutMode: 'VERTICAL', bbox: { x: 0, y: 0, width: 1000, height: 800 }, fills: [WHITE],
|
|
148
|
+
children: [
|
|
149
|
+
// edgeless white SUB-REGION wrapper on the white page (spans neither axis fully) → redundant repaint → flag
|
|
150
|
+
{ id: 'C:wrap', name: 'section-wrap', type: 'FRAME', layoutMode: 'VERTICAL', bbox: { x: 40, y: 40, width: 920, height: 140 }, fills: [WHITE],
|
|
151
|
+
children: [ { id: 'C:wtext', name: 'Section', type: 'TEXT', bbox: { x: 64, y: 64, width: 120, height: 20 }, characters: 'Section' } ] },
|
|
152
|
+
// white card WITH a border → a real raised surface → exempt
|
|
153
|
+
{ id: 'C:card', name: 'real-card', type: 'FRAME', bbox: { x: 20, y: 260, width: 300, height: 160 }, fills: [WHITE], strokes: STROKE, children: [] },
|
|
154
|
+
// selected card (#EEF2FF) with a white block inside → DIFFERENT fill → not a same-fill case (discipline)
|
|
155
|
+
{ id: 'C:sel', name: 'selected-card', type: 'FRAME', bbox: { x: 20, y: 440, width: 300, height: 200 }, fills: [EEF2FF], strokes: STROKE,
|
|
156
|
+
children: [ { id: 'C:inner', name: 'inner-white-block', type: 'FRAME', bbox: { x: 30, y: 450, width: 280, height: 80 }, fills: [WHITE], children: [] } ] },
|
|
157
|
+
// white card WITH a shadow → a real raised surface → exempt
|
|
158
|
+
{ id: 'C:shadow', name: 'shadow-card', type: 'FRAME', bbox: { x: 20, y: 660, width: 300, height: 100 }, fills: [WHITE], effects: SHADOW, children: [] },
|
|
159
|
+
],
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
// FIXTURE D — full-bleed body-background layers (the false positives found on the approved screens: Branch B
|
|
163
|
+
// main-col/content #F1F5F9) must be EXEMPT even when inset by a sidebar/topbar (they still span one FULL axis
|
|
164
|
+
// of the surface beneath); a same-fill SUB-REGION (version-table inside a board, spanning neither axis) stays
|
|
165
|
+
// flagged. Mirrors the real 10:2 structure: page-bg → main-col (full height, inset left by sidebar) → content
|
|
166
|
+
// (full width, inset top by topbar) → bordered board (card) → white version-table (sub-region).
|
|
167
|
+
const SLATE = { type: 'SOLID', color: { r: 241 / 255, g: 245 / 255, b: 249 / 255 } }; // #F1F5F9
|
|
168
|
+
const fixtureD = {
|
|
169
|
+
id: '0:0', name: 'D-screen', type: 'FRAME', layoutMode: 'VERTICAL', bbox: { x: 0, y: 0, width: 1200, height: 800 }, fills: [SLATE],
|
|
170
|
+
children: [
|
|
171
|
+
{ id: 'D:main', name: 'main-col', type: 'FRAME', bbox: { x: 220, y: 0, width: 980, height: 800 }, fills: [SLATE], // inset left by sidebar → spans full HEIGHT of page → exempt
|
|
172
|
+
children: [
|
|
173
|
+
{ id: 'D:content', name: 'content', type: 'FRAME', bbox: { x: 220, y: 48, width: 980, height: 752 }, fills: [SLATE], // inset top by topbar → spans full WIDTH of main-col → exempt
|
|
174
|
+
children: [
|
|
175
|
+
{ id: 'D:board', name: 'detail-board', type: 'FRAME', bbox: { x: 260, y: 100, width: 900, height: 560 }, fills: [WHITE], strokes: STROKE, // real card (border + different colour) → exempt
|
|
176
|
+
children: [
|
|
177
|
+
// white table, a SUB-REGION of the white board (spans neither axis) → flagged (white-on-white)
|
|
178
|
+
{ id: 'D:vtable', name: 'version-table', type: 'FRAME', bbox: { x: 300, y: 160, width: 820, height: 200 }, fills: [WHITE], children: [] },
|
|
179
|
+
] },
|
|
180
|
+
] },
|
|
181
|
+
] },
|
|
182
|
+
],
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
// FIXTURE E (P2-1) — the screen frame's OWN direct children are now overlap-checked (previously excluded from
|
|
186
|
+
// `all`/authored → false-negative). E_overlap: two top-level regions that really overlap → flagged.
|
|
187
|
+
// E_ok: two adjacent top-level regions that only touch → pass.
|
|
188
|
+
const fixtureE_overlap = {
|
|
189
|
+
id: '0:0', name: 'E-overlap', type: 'FRAME', layoutMode: 'NONE', bbox: { x: 0, y: 0, width: 1000, height: 600 },
|
|
190
|
+
children: [
|
|
191
|
+
{ id: 'E:a', name: 'region-a', type: 'FRAME', bbox: { x: 0, y: 0, width: 600, height: 400 }, fills: [WHITE], children: [] },
|
|
192
|
+
{ id: 'E:b', name: 'region-b', type: 'FRAME', bbox: { x: 400, y: 0, width: 600, height: 400 }, fills: [WHITE], children: [] }, // x 400–1000 overlaps region-a's 0–600
|
|
193
|
+
],
|
|
194
|
+
};
|
|
195
|
+
const fixtureE_ok = {
|
|
196
|
+
id: '0:0', name: 'E-ok', type: 'FRAME', layoutMode: 'NONE', bbox: { x: 0, y: 0, width: 1000, height: 600 },
|
|
197
|
+
children: [
|
|
198
|
+
{ id: 'E:c', name: 'region-c', type: 'FRAME', bbox: { x: 0, y: 0, width: 500, height: 400 }, fills: [WHITE], children: [] },
|
|
199
|
+
{ id: 'E:d', name: 'region-d', type: 'FRAME', bbox: { x: 500, y: 0, width: 500, height: 400 }, fills: [WHITE], children: [] }, // adjacent at x=500 — touches, no overlap
|
|
200
|
+
],
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
// FIXTURE F (P1-2) — overlapping children INSIDE an instance are NOT flagged (an instance is a leaf for
|
|
204
|
+
// authored-layout; its interior is the DS's responsibility, audited by check1); the same overlap inside an
|
|
205
|
+
// authored FRAME IS flagged (control).
|
|
206
|
+
const fixtureF = {
|
|
207
|
+
id: '0:0', name: 'F-screen', type: 'FRAME', layoutMode: 'NONE', bbox: { x: 0, y: 0, width: 1000, height: 600 },
|
|
208
|
+
children: [
|
|
209
|
+
{ id: 'F:inst', name: 'chip', type: 'INSTANCE', bbox: { x: 0, y: 0, width: 200, height: 100 }, fills: [WHITE],
|
|
210
|
+
children: [
|
|
211
|
+
{ id: 'F:ia', name: 'icon', type: 'FRAME', bbox: { x: 0, y: 0, width: 120, height: 80 }, fills: [WHITE], children: [] },
|
|
212
|
+
{ id: 'F:ib', name: 'label-bg', type: 'FRAME', bbox: { x: 60, y: 0, width: 120, height: 80 }, fills: [WHITE], children: [] }, // overlaps icon, but inside an INSTANCE → NOT flagged
|
|
213
|
+
] },
|
|
214
|
+
{ id: 'F:row', name: 'authored-row', type: 'FRAME', layoutMode: 'HORIZONTAL', bbox: { x: 0, y: 200, width: 400, height: 100 }, fills: [WHITE],
|
|
215
|
+
children: [
|
|
216
|
+
{ id: 'F:c', name: 'col-a', type: 'FRAME', bbox: { x: 0, y: 200, width: 250, height: 80 }, fills: [WHITE], children: [] },
|
|
217
|
+
{ id: 'F:d', name: 'col-b', type: 'FRAME', bbox: { x: 150, y: 200, width: 250, height: 80 }, fills: [WHITE], children: [] }, // overlaps col-a inside an authored FRAME → flagged
|
|
218
|
+
] },
|
|
219
|
+
],
|
|
220
|
+
};
|
|
221
|
+
|
|
127
222
|
// ---- assertions ------------------------------------------------------------
|
|
128
223
|
let failed = 0;
|
|
129
224
|
function ok(cond, msg) { if (cond) { console.log(' PASS ' + msg); } else { console.log(' FAIL ' + msg); failed++; } }
|
|
@@ -144,6 +239,47 @@ function ok(cond, msg) { if (cond) { console.log(' PASS ' + msg); } else { con
|
|
|
144
239
|
ok(!b.hardFails.some((f) => f.node === 'hidden-tooltip'), 'B: hidden interior NOT flagged');
|
|
145
240
|
ok(b.hardFails.length === 2, 'B: exactly 2 hardFails (no spurious overlap/junk)');
|
|
146
241
|
|
|
242
|
+
// Fixture C — nestedSameFill (P7) is an ADVISORY (never a hardFail): edgeless same-fill advised;
|
|
243
|
+
// bordered/shadowed/different-fill exempt.
|
|
244
|
+
const c = await runCheckLayout(buildFigma(fixtureC));
|
|
245
|
+
const nsf = c.advisories.filter((f) => f.type === 'nestedSameFill').map((f) => f.node);
|
|
246
|
+
console.log('Fixture C (nestedSameFill advisories):', JSON.stringify(c.advisories.filter((f) => f.type === 'nestedSameFill')));
|
|
247
|
+
ok(c.hardFails.length === 0, 'C: nestedSameFill is NOT a hardFail (hardFails == 0)');
|
|
248
|
+
ok(nsf.includes('section-wrap'), 'C: edgeless white wrapper on white page advised (nestedSameFill)');
|
|
249
|
+
ok(!nsf.includes('real-card'), 'C: white card WITH border exempt');
|
|
250
|
+
ok(!nsf.includes('shadow-card'), 'C: white card WITH shadow exempt');
|
|
251
|
+
ok(!nsf.includes('inner-white-block'), 'C: white block over #EEF2FF (different fill) NOT advised');
|
|
252
|
+
ok(nsf.length === 1, 'C: exactly 1 nestedSameFill advisory (only the wrapper)');
|
|
253
|
+
|
|
254
|
+
// Fixture D — full-bleed precision: body-bg layers that span a full axis are exempt; a same-fill
|
|
255
|
+
// sub-region (white table in a white board) stays advised. hardFails stay 0.
|
|
256
|
+
const d = await runCheckLayout(buildFigma(fixtureD));
|
|
257
|
+
const dnsf = d.advisories.filter((f) => f.type === 'nestedSameFill').map((f) => f.node);
|
|
258
|
+
console.log('Fixture D (nestedSameFill advisories):', JSON.stringify(d.advisories.filter((f) => f.type === 'nestedSameFill')));
|
|
259
|
+
ok(d.hardFails.length === 0, 'D: nestedSameFill is NOT a hardFail (hardFails == 0)');
|
|
260
|
+
ok(!dnsf.includes('main-col'), 'D: main-col (spans full height, inset by sidebar) exempt');
|
|
261
|
+
ok(!dnsf.includes('content'), 'D: content (spans full width, inset by topbar) exempt');
|
|
262
|
+
ok(dnsf.includes('version-table'), 'D: same-fill sub-region (spans neither axis) advised');
|
|
263
|
+
ok(dnsf.length === 1, 'D: exactly 1 nestedSameFill advisory (only the sub-region)');
|
|
264
|
+
|
|
265
|
+
// Fixture E — P2-1: the screen frame's own children are overlap-checked now.
|
|
266
|
+
const eO = await runCheckLayout(buildFigma(fixtureE_overlap));
|
|
267
|
+
const eOv = eO.hardFails.filter((f) => f.type === 'overlap');
|
|
268
|
+
console.log('Fixture E_overlap:', JSON.stringify(eO.hardFails));
|
|
269
|
+
ok(eOv.length === 1 && eOv[0].parent === 'E-overlap', 'E: top-level region overlap flagged (parent = screen frame)');
|
|
270
|
+
ok(eO.hardFails.length === 1, 'E_overlap: exactly 1 hardFail (the overlap, no junk)');
|
|
271
|
+
const eK = await runCheckLayout(buildFigma(fixtureE_ok));
|
|
272
|
+
console.log('Fixture E_ok:', JSON.stringify(eK.hardFails));
|
|
273
|
+
ok(eK.hardFails.length === 0, 'E_ok: adjacent top-level regions (touch only) → 0 hardFails');
|
|
274
|
+
|
|
275
|
+
// Fixture F — P1-2: instance interior overlap NOT flagged; authored overlap flagged.
|
|
276
|
+
const f = await runCheckLayout(buildFigma(fixtureF));
|
|
277
|
+
const fOv = f.hardFails.filter((x) => x.type === 'overlap');
|
|
278
|
+
console.log('Fixture F (overlap):', JSON.stringify(fOv));
|
|
279
|
+
ok(fOv.length === 1, 'F: exactly 1 overlap (authored only)');
|
|
280
|
+
ok(fOv.some((o) => o.parent === 'authored-row'), 'F: authored FRAME overlap flagged');
|
|
281
|
+
ok(!fOv.some((o) => o.parent === 'chip'), 'F: INSTANCE interior overlap NOT flagged (instance = leaf)');
|
|
282
|
+
|
|
147
283
|
console.log('');
|
|
148
284
|
if (failed) { console.log('check-layout regression: ' + failed + ' assertion(s) FAILED'); process.exit(1); }
|
|
149
285
|
console.log('check-layout regression: all assertions passed');
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Regression test for check3.js icon/vector asset fidelity (P3a). Node, no Figma.
|
|
3
|
+
* node validators/test/check3-icons.test.js
|
|
4
|
+
* Builds a temp project with `iconAssets` declared, runs the real check3.js:
|
|
5
|
+
* good screen — icon slots wrap real <svg> with currentColor → 0 placeholderSlots, 0 rawHexInSvg
|
|
6
|
+
* bad screen — one slot left as an empty placeholder box + an <svg> with a raw hex fill → both flagged
|
|
7
|
+
*/
|
|
8
|
+
'use strict';
|
|
9
|
+
const fs = require('fs');
|
|
10
|
+
const path = require('path');
|
|
11
|
+
const os = require('os');
|
|
12
|
+
const cp = require('child_process');
|
|
13
|
+
|
|
14
|
+
const CHECK3 = path.join(__dirname, '..', 'check3.js');
|
|
15
|
+
const root = path.join(os.tmpdir(), 'dsforge-icons-test-' + process.pid);
|
|
16
|
+
const write = (rel, c) => { const p = path.join(root, rel); fs.mkdirSync(path.dirname(p), { recursive: true }); fs.writeFileSync(p, c); };
|
|
17
|
+
|
|
18
|
+
fs.rmSync(root, { recursive: true, force: true });
|
|
19
|
+
write('validators/out/t-tokens.json', JSON.stringify({ color: {}, float: {}, text: {} }));
|
|
20
|
+
write('app/tokens.css', ':root {}\n');
|
|
21
|
+
// GOOD: both slots carry a real inline SVG; fills are currentColor (no raw hex), slots are not empty boxes.
|
|
22
|
+
write('app/good.tsx', [
|
|
23
|
+
'export const S = () => (<aside>',
|
|
24
|
+
' <span className="rail-logo"><svg viewBox="0 0 1 1"><path d="M0 0h1v1H0z" fill="var(--logo-green)"/></svg></span>',
|
|
25
|
+
' <span className="rail-icon"><svg viewBox="0 0 1 1"><path d="M0 0h1v1H0z" fill="currentColor"/></svg></span>',
|
|
26
|
+
'</aside>);',
|
|
27
|
+
].join('\n'));
|
|
28
|
+
// BAD: rail-logo left as an empty placeholder box; rail-icon svg bakes a raw hex fill.
|
|
29
|
+
write('app/bad.tsx', [
|
|
30
|
+
'export const S = () => (<aside>',
|
|
31
|
+
' <div className="rail-logo" />',
|
|
32
|
+
' <span className="rail-icon"><svg viewBox="0 0 1 1"><path d="M0 0h1v1H0z" fill="#3366FF"/></svg></span>',
|
|
33
|
+
'</aside>);',
|
|
34
|
+
].join('\n'));
|
|
35
|
+
write('validators/projects/t.json', JSON.stringify({
|
|
36
|
+
project: 't', tokenRef: 'validators/out/t-tokens.json', codeTokensCss: 'app/tokens.css',
|
|
37
|
+
tokenCssNaming: { colorPrefix: '--c-', spaceFrom: 'space/', spaceTo: '--space-', sizeFrom: 'size/', sizeTo: '--size-', radiusFrom: 'radius/', radiusTo: '--radius-', textClass: {}, weightMap: {} },
|
|
38
|
+
structuralPxAllow: {},
|
|
39
|
+
iconAssets: { selectors: ['.rail-logo', '.rail-icon'] },
|
|
40
|
+
screens: { good: { label: 'good', code: { files: ['good.tsx'] } }, bad: { label: 'bad', code: { files: ['bad.tsx'] } } },
|
|
41
|
+
}));
|
|
42
|
+
|
|
43
|
+
let failed = 0;
|
|
44
|
+
const ok = (c, m) => { console.log((c ? ' PASS ' : ' FAIL ') + m); if (!c) failed++; };
|
|
45
|
+
const run = (scr) => JSON.parse(cp.execSync(`node "${CHECK3}" t ${scr}`, { cwd: root }).toString()).iconAssets;
|
|
46
|
+
|
|
47
|
+
const good = run('good');
|
|
48
|
+
console.log('good iconAssets:', JSON.stringify(good));
|
|
49
|
+
ok(good.applicable === true, 'applicable when iconAssets declared');
|
|
50
|
+
ok(good.placeholderSlots.length === 0, 'good: no placeholder slots (real <svg> in every slot)');
|
|
51
|
+
ok(good.rawHexInSvg.length === 0, 'good: no raw hex in SVG (currentColor / token var only)');
|
|
52
|
+
|
|
53
|
+
const bad = run('bad');
|
|
54
|
+
console.log('bad iconAssets:', JSON.stringify(bad));
|
|
55
|
+
ok(bad.placeholderSlots.includes('.rail-logo'), 'bad: empty placeholder box slot flagged');
|
|
56
|
+
ok(bad.rawHexInSvg.includes('#3366FF'), 'bad: raw hex in SVG flagged');
|
|
57
|
+
|
|
58
|
+
fs.rmSync(root, { recursive: true, force: true });
|
|
59
|
+
console.log('');
|
|
60
|
+
if (failed) { console.log('check3 icon-assets: ' + failed + ' assertion(s) FAILED'); process.exit(1); }
|
|
61
|
+
console.log('check3 icon-assets: all assertions passed');
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const path = require('path');
|
|
7
7
|
const cp = require('child_process');
|
|
8
8
|
|
|
9
|
-
const tests = ['check-layout.test.js', 'check3-size.test.js', 'check-recall.test.js'];
|
|
9
|
+
const tests = ['check-layout.test.js', 'check3-size.test.js', 'check3-icons.test.js', 'check-recall.test.js'];
|
|
10
10
|
let failed = 0;
|
|
11
11
|
for (const t of tests) {
|
|
12
12
|
console.log('\n=== ' + t + ' ===');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* verify.js — generic harness aggregator (config-driven). Node.
|
|
3
|
-
* node validators/verify.js <project> (cwd = Poc/) e.g.
|
|
3
|
+
* node validators/verify.js <project> (cwd = Poc/) e.g. smoke
|
|
4
4
|
* Reads validators/projects/<project>.json. Orchestrates: Check 1 (DS) + Check 2 (per screen,
|
|
5
5
|
* from out/check2-<screen>.json produced by the use_figma run) + Check 3 (per screen, run here),
|
|
6
6
|
* then self-verifies the result reproduces the project's confirmed baseline.
|
|
@@ -12,7 +12,8 @@ const fs = require('fs');
|
|
|
12
12
|
const path = require('path');
|
|
13
13
|
const cp = require('child_process');
|
|
14
14
|
const ROOT = process.cwd();
|
|
15
|
-
const project = process.argv[2]
|
|
15
|
+
const project = process.argv[2];
|
|
16
|
+
if (!project) { console.error('usage: node validators/verify.js <project>'); process.exit(1); }
|
|
16
17
|
const cfg = JSON.parse(fs.readFileSync(path.join(ROOT, 'validators/projects', project + '.json'), 'utf8'));
|
|
17
18
|
const load = (f) => JSON.parse(fs.readFileSync(path.join(ROOT, 'validators/out', f), 'utf8'));
|
|
18
19
|
const loadOpt = (f) => { try { return load(f); } catch (e) { return null; } };
|
|
@@ -36,7 +37,9 @@ for (const sk of Object.keys(cfg.screens)) {
|
|
|
36
37
|
const contentOk = c3.content.array ? c3.content.array.verbatimAndOrdered : (c3.content.anchors ? c3.content.anchors.verbatim : true);
|
|
37
38
|
// size-token dimension fidelity (P4) — only enforced when the descriptor declares sizeBindings (backward compatible)
|
|
38
39
|
const sizeOk = c3.sizeFidelity && c3.sizeFidelity.applicable ? c3.sizeFidelity.violations.length === 0 : true;
|
|
39
|
-
|
|
40
|
+
// icon/vector asset fidelity (P3a) — only enforced when the descriptor declares iconAssets (Branch A; backward compatible)
|
|
41
|
+
const iconOk = c3.iconAssets && c3.iconAssets.applicable ? (c3.iconAssets.placeholderSlots.length === 0 && c3.iconAssets.rawHexInSvg.length === 0) : true;
|
|
42
|
+
const c3pass = c3.tokenCompare.match === c3.tokenCompare.total && c3.hardcode.hexCount === 0 && c3.hardcode.pxViolationCount === 0 && contentOk && sizeOk && iconOk;
|
|
40
43
|
// Layout floor (objective breakage) — staged in out/check-layout-<screen>.json by the use_figma run.
|
|
41
44
|
// Optional: absent for projects that haven't run it, but hardFails 0 is the precondition to the visual gate.
|
|
42
45
|
const cl = loadOpt('check-layout-' + sk + '.json');
|
package/templates/CLAUDE.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
기능명세 → 시안 → 디자인시스템(DS) → 코드를, 자동 검사 게이트 + 사람 게이트 2곳으로 굴리는 파이프라인. 엔진은 너(+검증하는 리뷰어). 검사기(`validators/`)는 *검사*만 자동화한다 — 시안·코드 빌드와 판단은 네가 한다.
|
|
7
7
|
|
|
8
8
|
## 먼저 할 일
|
|
9
|
-
1. **`docs/00-portable-kit-and-runbook.md`를 끝까지 읽어라.** (전체 그림·런북·한계.) 이어서 필요시 `docs/02`(검사기), `docs/03`(일반화), `docs/examples/`(
|
|
9
|
+
1. **`docs/00-portable-kit-and-runbook.md`를 끝까지 읽어라.** (전체 그림·런북·한계.) 이어서 필요시 `docs/02`(검사기), `docs/03`(일반화), `docs/examples/smoke-fixture/`(Figma 없이 도는 Node 검사 예시).
|
|
10
10
|
2. **전제 확인:** Figma MCP가 *대상 프로젝트 Figma*에 연결돼 있나 · Node.js 있나 · 2개 사람 게이트(시안 확정·최종 확인)를 볼 리뷰어(사람 또는 다른 Claude)가 있나.
|
|
11
11
|
3. **사용자에게 받을 것:** ① 대상 DS의 Figma 파일 키(없으면 "DS 없음") · ② 기능명세 · ③ 시안 빌드할 작업 Figma 파일 키.
|
|
12
12
|
4. **분기 확정 + 질문 2개**(게이트 아님 — 사람 게이트는 그대로 **2개**): ⓐ 진짜 DS 파일이 이미 있나? → **분기 A**(있음) / **분기 B**(없음). ⓑ 화면당 시안 **옵션 몇 개**? (**기본 2–3**.)
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
|
|
17
17
|
### 분기 A — 진짜 DS가 이미 있음
|
|
18
18
|
1. **DS 검증.** `validators/check1.js`를 대상 DS에 돌려(`use_figma`로 본문 실행) "진짜/완성 DS인지" 판정(로컬 변수·바인딩%·raw 분류[인스턴스 내부 traverse]·상태 variant[focus/disabled]·elevation).
|
|
19
|
-
- 부족분(Status variant·focus·disabled·elevation 누락)이 나오면 **자동 보강하지 말고 사용자에게 질문:** ⓐ DS를 **보완**한 뒤 그 위에서 시안, 또는 ⓑ DS는 **그대로** 두고 부족분은 시안에 "(제안)"으로 표기. (
|
|
20
|
-
2. **토큰 추출.** `validators/extract-tokens.js`를 `use_figma`로 대상 DS에 실행 → 반환 JSON을 `validators/out/<proj>-tokens.json`(= tokenRef)에 저장. 이걸로 코드 토큰(`tokens.css`/`tokens.ts`) 생성 — 패턴은 `
|
|
21
|
-
3. **디스크립터 작성.** `validators/projects/_TEMPLATE.json` 복사 → `<proj>.json`: DS 파일키·tokenRef·네이밍맵·shell·structuralPxAllow·화면별 앵커. (`projects/
|
|
19
|
+
- 부족분(Status variant·focus·disabled·elevation 누락)이 나오면 **자동 보강하지 말고 사용자에게 질문:** ⓐ DS를 **보완**한 뒤 그 위에서 시안, 또는 ⓑ DS는 **그대로** 두고 부족분은 시안에 "(제안)"으로 표기. (보완은 check1이 PASS로 flip하면 완료.)
|
|
20
|
+
2. **토큰 추출.** `validators/extract-tokens.js`를 `use_figma`로 대상 DS에 실행 → 반환 JSON을 `validators/out/<proj>-tokens.json`(= tokenRef)에 저장. 이걸로 코드 토큰(`tokens.css`/`tokens.ts`) 생성 — 패턴은 `docs/examples/smoke-fixture/app/tokens.css`를 *네 DS 이름으로* 갈아끼운다.
|
|
21
|
+
3. **디스크립터 작성.** `validators/projects/_TEMPLATE.json` 복사 → `<proj>.json`: DS 파일키·tokenRef·네이밍맵·shell·structuralPxAllow·화면별 앵커. (`docs/examples/smoke-fixture/validators/projects/smoke.json`이 채워진 작은 예시.)
|
|
22
22
|
4. **화면마다:**
|
|
23
23
|
a. **시안 옵션 2–3개** 빌드(`use_figma`) — 각각 **전체 뷰포트 + 앱 셸**, DS 인스턴스로. 명세에 없는 건 "(제안)"(날조 금지).
|
|
24
24
|
b. `validators/check2.js`(Figma MCP) → 앵커 커버리지·날조·화면작성 raw·뷰포트+셸.
|
package/plugins/dsforge/skills/dsforge/assets/code-scaffold-reference-ezp/DatasetManagement.tsx
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Dataset Management (list) — code build of validated 시안 (Figma frame 315:170).
|
|
3
|
-
* 1920×1080 + EZP app shell. Tokens only (EZP -> tokens.css). No self-judgment.
|
|
4
|
-
* Layout/content mirror the 시안: shell (sidebar + topbar) -> content surface with
|
|
5
|
-
* breadcrumb(in topbar) · title · "제안" caption · toolbar · table(6 col/5 row) ·
|
|
6
|
-
* open 9-action menu · pagination. Content verbatim; 날조/누락 0.
|
|
7
|
-
*/
|
|
8
|
-
import React from 'react';
|
|
9
|
-
import './tokens.css';
|
|
10
|
-
import './ezp.css';
|
|
11
|
-
import { Sidebar, Topbar } from './components/shell';
|
|
12
|
-
import { DataTable } from './components/DataTable';
|
|
13
|
-
import { SearchInput, FilterSelect, CreateButton, Pagination } from './components/controls';
|
|
14
|
-
|
|
15
|
-
export function DatasetManagement() {
|
|
16
|
-
return (
|
|
17
|
-
<div className="ezp-screen">
|
|
18
|
-
<Sidebar />
|
|
19
|
-
<div className="ezp-main">
|
|
20
|
-
<Topbar />
|
|
21
|
-
<div className="ezp-content">
|
|
22
|
-
<div className="ezp-surface">
|
|
23
|
-
<div className="ezp-header">
|
|
24
|
-
<h1 className="ezp-title ezp-text-page-title">Management</h1>
|
|
25
|
-
<p className="ezp-caption ezp-text-caption">
|
|
26
|
-
※ 표시 열(이름·버전·상태·태그·수정일·액션)과 상태값은 제안입니다 — 스펙에 열/필드 정의 없음,
|
|
27
|
-
사람 게이트①에서 확정. 행 데이터는 placeholder.
|
|
28
|
-
</p>
|
|
29
|
-
</div>
|
|
30
|
-
|
|
31
|
-
<div className="ezp-toolbar">
|
|
32
|
-
<div className="ezp-toolbar-left">
|
|
33
|
-
<SearchInput placeholder="데이터셋 검색" />
|
|
34
|
-
<FilterSelect label="상태: 전체" />
|
|
35
|
-
<FilterSelect label="태그: 전체" />
|
|
36
|
-
</div>
|
|
37
|
-
<CreateButton label="생성" />
|
|
38
|
-
</div>
|
|
39
|
-
|
|
40
|
-
<DataTable />
|
|
41
|
-
|
|
42
|
-
<Pagination />
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
);
|
|
48
|
-
}
|
package/plugins/dsforge/skills/dsforge/assets/code-scaffold-reference-ezp/ModelCreateEdit.tsx
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Model 등록/수정 (AI Orchestration) — code build of confirmed 시안 (frame 330:260).
|
|
3
|
-
* 1920×1080 + EZP shell. Tokens only (EZP -> tokens.css). No self-judgment.
|
|
4
|
-
* Anchors verbatim (시안 일치): breadcrumb AI Orchestration>Management>Model ·
|
|
5
|
-
* Default/Custom Model · Source Code Repository/File · Create/Modify Model info · 취소.
|
|
6
|
-
* Proposed fields labeled "(제안)" + placeholder (날조 0).
|
|
7
|
-
* States: Model Name = focus (logo-blue ring) · 저장 = disabled.
|
|
8
|
-
*/
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import './tokens.css';
|
|
11
|
-
import './ezp.css';
|
|
12
|
-
import { Sidebar, Topbar } from './components/shell';
|
|
13
|
-
import { TextInput, TextArea, Select, Radio, Button } from './components/forms';
|
|
14
|
-
|
|
15
|
-
export function ModelCreateEdit() {
|
|
16
|
-
return (
|
|
17
|
-
<div className="ezp-screen">
|
|
18
|
-
<Sidebar
|
|
19
|
-
section="AI Orchestration"
|
|
20
|
-
navGroups={[{
|
|
21
|
-
label: 'AI Orch',
|
|
22
|
-
items: [
|
|
23
|
-
{ label: 'Management', active: true },
|
|
24
|
-
{ label: 'Model', active: true },
|
|
25
|
-
{ label: 'Default Model' },
|
|
26
|
-
{ label: 'Custom Model' },
|
|
27
|
-
],
|
|
28
|
-
}]}
|
|
29
|
-
/>
|
|
30
|
-
<div className="ezp-main">
|
|
31
|
-
<Topbar breadcrumb={['AI Orchestration', 'Management', 'Model']} />
|
|
32
|
-
<div className="ezp-content">
|
|
33
|
-
<div className="ezp-surface">
|
|
34
|
-
<div className="ezp-header">
|
|
35
|
-
<h1 className="ezp-title ezp-text-page-title">Model</h1>
|
|
36
|
-
<p className="ezp-text-body" style={{ color: 'var(--ezp-light-600)' }}>Create Model info (신규) · Modify Model info (수정)</p>
|
|
37
|
-
<p className="ezp-caption ezp-text-caption">※ 필드/배치는 제안 — 명세에 정의 없음, 사람 확정 대상. 값은 placeholder.</p>
|
|
38
|
-
</div>
|
|
39
|
-
|
|
40
|
-
<div className="ezp-form">
|
|
41
|
-
<div className="ezp-field">
|
|
42
|
-
<span className="ezp-field-label ezp-text-body-small-bold">모델 타입 (제안)</span>
|
|
43
|
-
<div className="ezp-radio-row">
|
|
44
|
-
<Radio label="Default Model" checked />
|
|
45
|
-
<Radio label="Custom Model" />
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
|
|
49
|
-
<div className="ezp-field">
|
|
50
|
-
<span className="ezp-field-label ezp-text-body-small-bold">업로드 방식</span>
|
|
51
|
-
<div className="ezp-radio-row">
|
|
52
|
-
<Radio label="Source Code Repository" checked />
|
|
53
|
-
<Radio label="File" />
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
|
|
57
|
-
<div className="ezp-field">
|
|
58
|
-
<span className="ezp-field-label ezp-text-body-small-bold">Repository URL (제안 · 선택된 방식: Source Code Repository)</span>
|
|
59
|
-
<TextInput placeholder="https://git.example.com/org/model-repo" />
|
|
60
|
-
<span className="ezp-switch-note ezp-text-caption">※ 'File' 선택 시 파일 업로드 영역으로 전환 (제안)</span>
|
|
61
|
-
</div>
|
|
62
|
-
|
|
63
|
-
<div className="ezp-field">
|
|
64
|
-
<span className="ezp-field-label ezp-text-body-small-bold">모델 이름 (제안 · 포커스 상태)</span>
|
|
65
|
-
<TextInput placeholder="dataset-model-001" focus />
|
|
66
|
-
</div>
|
|
67
|
-
|
|
68
|
-
<div className="ezp-field">
|
|
69
|
-
<span className="ezp-field-label ezp-text-body-small-bold">설명 (제안)</span>
|
|
70
|
-
<TextArea placeholder="모델 설명 placeholder" />
|
|
71
|
-
</div>
|
|
72
|
-
|
|
73
|
-
<div className="ezp-field">
|
|
74
|
-
<span className="ezp-field-label ezp-text-body-small-bold">프레임워크 / 알고리즘 (제안)</span>
|
|
75
|
-
<Select label="PyTorch" />
|
|
76
|
-
</div>
|
|
77
|
-
|
|
78
|
-
<div className="ezp-field">
|
|
79
|
-
<span className="ezp-field-label ezp-text-body-small-bold">태그 (제안)</span>
|
|
80
|
-
<TextInput placeholder="tag-a, tag-b" />
|
|
81
|
-
</div>
|
|
82
|
-
</div>
|
|
83
|
-
|
|
84
|
-
<div className="ezp-action-bar">
|
|
85
|
-
<Button label="취소" variant="secondary" />
|
|
86
|
-
<Button label="저장" variant="primary" disabled />
|
|
87
|
-
</div>
|
|
88
|
-
</div>
|
|
89
|
-
</div>
|
|
90
|
-
</div>
|
|
91
|
-
</div>
|
|
92
|
-
);
|
|
93
|
-
}
|
package/plugins/dsforge/skills/dsforge/assets/code-scaffold-reference-ezp/components/DataTable.tsx
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Data table (code counterpart of the 시안's token-bound grid).
|
|
3
|
-
* 6 columns (이름·버전·상태·태그·수정일·액션) — all "제안" per §3.
|
|
4
|
-
* 5 placeholder rows (no fabricated real data). Tokens only.
|
|
5
|
-
* Row 1 shows the open action menu (affordance for the 9 §1 row actions).
|
|
6
|
-
*/
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import { StatusBadge, Tag, RowActionButton, ActionMenu } from './controls';
|
|
9
|
-
|
|
10
|
-
/* §1 row actions — verbatim, 9 items */
|
|
11
|
-
export const ROW_ACTIONS = [
|
|
12
|
-
'Information 수정',
|
|
13
|
-
'Tagging',
|
|
14
|
-
'Deprecate',
|
|
15
|
-
'버전 생성',
|
|
16
|
-
'버전관리 옵션 변경',
|
|
17
|
-
'포맷 변환 (Export 요청)',
|
|
18
|
-
'Embedding 요청',
|
|
19
|
-
'Inference 요청',
|
|
20
|
-
'Action History 조회',
|
|
21
|
-
];
|
|
22
|
-
|
|
23
|
-
type Row = { name: string; version: string; status: { label: string; tone: 'done' | 'inuse' | 'todo' | 'deprecated' }; tag: string; updated: string };
|
|
24
|
-
|
|
25
|
-
const ROWS: Row[] = [
|
|
26
|
-
{ name: 'dataset-001', version: 'v1.0', status: { label: '완료', tone: 'done' }, tag: 'tag-a', updated: '2026-06-10' },
|
|
27
|
-
{ name: 'dataset-002', version: 'v2.3', status: { label: '사용중', tone: 'inuse' }, tag: 'tag-b', updated: '2026-06-11' },
|
|
28
|
-
{ name: 'dataset-003', version: 'v1.1', status: { label: '대기', tone: 'todo' }, tag: 'tag-a', updated: '2026-06-12' },
|
|
29
|
-
{ name: 'dataset-004', version: 'v3.0', status: { label: '지원중단', tone: 'deprecated' }, tag: 'tag-c', updated: '2026-06-13' },
|
|
30
|
-
{ name: 'dataset-005', version: 'v1.0', status: { label: '완료', tone: 'done' }, tag: 'tag-b', updated: '2026-06-14' },
|
|
31
|
-
];
|
|
32
|
-
|
|
33
|
-
const COLS = ['이름', '버전', '상태', '태그', '수정일', '액션'];
|
|
34
|
-
|
|
35
|
-
export function DataTable() {
|
|
36
|
-
return (
|
|
37
|
-
<div className="ezp-table-wrap">
|
|
38
|
-
<table className="ezp-table">
|
|
39
|
-
<thead>
|
|
40
|
-
<tr>
|
|
41
|
-
{COLS.map((c, i) => (
|
|
42
|
-
<th key={c} className={'ezp-th ezp-text-body-small-bold' + (i === 5 ? ' ezp-cell-action' : '')}>{c}</th>
|
|
43
|
-
))}
|
|
44
|
-
</tr>
|
|
45
|
-
</thead>
|
|
46
|
-
<tbody>
|
|
47
|
-
{ROWS.map((r, idx) => (
|
|
48
|
-
<tr key={r.name} className="ezp-tr">
|
|
49
|
-
<td className="ezp-td"><span className="ezp-cell-name ezp-text-body">{r.name}</span></td>
|
|
50
|
-
<td className="ezp-td ezp-text-body">{r.version}</td>
|
|
51
|
-
<td className="ezp-td"><StatusBadge label={r.status.label} tone={r.status.tone} /></td>
|
|
52
|
-
<td className="ezp-td"><Tag label={r.tag} /></td>
|
|
53
|
-
<td className="ezp-td ezp-text-body">{r.updated}</td>
|
|
54
|
-
<td className="ezp-td ezp-cell-action" style={{ position: 'relative' }}>
|
|
55
|
-
<RowActionButton />
|
|
56
|
-
{idx === 0 && <ActionMenu items={ROW_ACTIONS} />}
|
|
57
|
-
</td>
|
|
58
|
-
</tr>
|
|
59
|
-
))}
|
|
60
|
-
</tbody>
|
|
61
|
-
</table>
|
|
62
|
-
</div>
|
|
63
|
-
);
|
|
64
|
-
}
|
package/plugins/dsforge/skills/dsforge/assets/code-scaffold-reference-ezp/components/controls.tsx
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* EZP atomic components (code counterparts of EZP Figma components).
|
|
3
|
-
* Static appearance only — interactive states (hover/active/focus/disabled)
|
|
4
|
-
* are OUT OF SCOPE this run (EZP variants in progress). Placeholders noted.
|
|
5
|
-
* All visuals come from --ezp-* tokens (tokens.css / ezp.css). No raw hex/px here.
|
|
6
|
-
*/
|
|
7
|
-
import React from 'react';
|
|
8
|
-
|
|
9
|
-
/* status-badge — tone maps to an EZP color token. Status taxonomy = 제안 (§3). */
|
|
10
|
-
const STATUS_TONE: Record<string, string> = {
|
|
11
|
-
done: '--ezp-logo-green',
|
|
12
|
-
inuse: '--ezp-logo-blue',
|
|
13
|
-
todo: '--ezp-light-900',
|
|
14
|
-
deprecated: '--ezp-logo-yellow',
|
|
15
|
-
};
|
|
16
|
-
export function StatusBadge({ label, tone }: { label: string; tone: keyof typeof STATUS_TONE }) {
|
|
17
|
-
return (
|
|
18
|
-
<span className="ezp-badge ezp-text-body-small" style={{ background: `var(${STATUS_TONE[tone]})` }}>
|
|
19
|
-
{label}
|
|
20
|
-
</span>
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/* tag-item */
|
|
25
|
-
export function Tag({ label }: { label: string }) {
|
|
26
|
-
return (
|
|
27
|
-
<span className="ezp-tag ezp-text-body-small">
|
|
28
|
-
{label}
|
|
29
|
-
<span className="ezp-tag-x" aria-hidden>×</span>
|
|
30
|
-
</span>
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/* form-control (search input) — static (read-only); focus/disabled 추후 */
|
|
35
|
-
export function SearchInput({ placeholder }: { placeholder: string }) {
|
|
36
|
-
return <input className="ezp-input ezp-text-body" placeholder={placeholder} readOnly />;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/* form-select (filter) — static; hover/focus/disabled 추후 */
|
|
40
|
-
export function FilterSelect({ label }: { label: string }) {
|
|
41
|
-
return (
|
|
42
|
-
<div className="ezp-select ezp-text-body" role="button" tabIndex={0}>
|
|
43
|
-
<span>{label}</span>
|
|
44
|
-
<span className="ezp-select-caret" aria-hidden>▾</span>
|
|
45
|
-
</div>
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/* btn-w-auto (primary) — static; hover/active/disabled 추후 */
|
|
50
|
-
export function CreateButton({ label }: { label: string }) {
|
|
51
|
-
return <button type="button" className="ezp-btn-primary ezp-text-body-small-bold">{label}</button>;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/* toolbox-btn (row action trigger) */
|
|
55
|
-
export function RowActionButton({ label = 'Tools', onClick }: { label?: string; onClick?: () => void }) {
|
|
56
|
-
return (
|
|
57
|
-
<button type="button" className="ezp-tools-btn ezp-text-body-small" onClick={onClick}>
|
|
58
|
-
{label}
|
|
59
|
-
<span className="ezp-tools-caret" aria-hidden>▴</span>
|
|
60
|
-
</button>
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/* dropdown menu of row actions (open state shown for the affordance) */
|
|
65
|
-
export function ActionMenu({ items }: { items: string[] }) {
|
|
66
|
-
return (
|
|
67
|
-
<div className="ezp-menu" role="menu">
|
|
68
|
-
{items.map((it) => (
|
|
69
|
-
<div key={it} className="ezp-menu-item ezp-text-body" role="menuitem">{it}</div>
|
|
70
|
-
))}
|
|
71
|
-
</div>
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/* pagination-wrap — static */
|
|
76
|
-
export function Pagination() {
|
|
77
|
-
const pages = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
78
|
-
return (
|
|
79
|
-
<div className="ezp-pagination ezp-text-body">
|
|
80
|
-
<div className="ezp-page-meta">
|
|
81
|
-
<span>Page Size</span>
|
|
82
|
-
<span className="ezp-select" role="button" tabIndex={0}>20 <span className="ezp-select-caret" aria-hidden>▾</span></span>
|
|
83
|
-
<span>Sort By</span>
|
|
84
|
-
<span className="ezp-select" role="button" tabIndex={0}>Edit <span className="ezp-select-caret" aria-hidden>▴</span></span>
|
|
85
|
-
</div>
|
|
86
|
-
<div className="ezp-pagination-group">
|
|
87
|
-
<span className="ezp-page-arrow" aria-hidden>«</span>
|
|
88
|
-
<span className="ezp-page-arrow" aria-hidden>‹</span>
|
|
89
|
-
{pages.map((p) => (
|
|
90
|
-
<span key={p} className={'ezp-page-num' + (p === 1 ? ' ezp-page-num--active' : '')}>{p}</span>
|
|
91
|
-
))}
|
|
92
|
-
<span className="ezp-page-arrow" aria-hidden>›</span>
|
|
93
|
-
<span className="ezp-page-arrow" aria-hidden>»</span>
|
|
94
|
-
</div>
|
|
95
|
-
</div>
|
|
96
|
-
);
|
|
97
|
-
}
|