@principal-ade/code-quality-panels 0.1.2 → 0.1.3
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/mocks/panelContext.d.ts.map +1 -1
- package/dist/panels/QualityHexagonPanel.d.ts.map +1 -1
- package/dist/panels/RepositoryQualityGridPanel.d.ts.map +1 -1
- package/dist/panels/RepositoryQualityGridPanel.stories.d.ts.map +1 -1
- package/dist/panels.bundle.js +138 -334
- package/dist/panels.bundle.js.map +1 -1
- package/package.json +1 -1
package/dist/panels.bundle.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import * as React2 from "react";
|
|
3
|
-
import React2__default, { forwardRef, createElement, createContext,
|
|
3
|
+
import React2__default, { forwardRef, createElement, createContext, useContext } from "react";
|
|
4
4
|
/**
|
|
5
5
|
* @license lucide-react v0.552.0 - ISC
|
|
6
6
|
*
|
|
@@ -154,158 +154,6 @@ const __iconNode = [
|
|
|
154
154
|
["path", { d: "m4 17 6-6-6-6", key: "1yngyt" }]
|
|
155
155
|
];
|
|
156
156
|
const Terminal = createLucideIcon("terminal", __iconNode);
|
|
157
|
-
var terminalTheme = {
|
|
158
|
-
space: [0, 4, 8, 16, 32, 64, 128, 256, 512],
|
|
159
|
-
fonts: {
|
|
160
|
-
body: '"SF Mono", "Monaco", "Inconsolata", "Fira Code", monospace',
|
|
161
|
-
heading: '"SF Mono", "Monaco", "Inconsolata", "Fira Code", monospace',
|
|
162
|
-
monospace: '"SF Mono", "Monaco", "Inconsolata", "Fira Code", monospace'
|
|
163
|
-
},
|
|
164
|
-
fontSizes: [12, 14, 16, 18, 20, 24, 32, 48, 64, 96],
|
|
165
|
-
fontScale: 1,
|
|
166
|
-
fontWeights: {
|
|
167
|
-
body: 400,
|
|
168
|
-
heading: 500,
|
|
169
|
-
bold: 600,
|
|
170
|
-
light: 300,
|
|
171
|
-
medium: 500,
|
|
172
|
-
semibold: 600
|
|
173
|
-
},
|
|
174
|
-
lineHeights: {
|
|
175
|
-
body: 1.6,
|
|
176
|
-
heading: 1.3,
|
|
177
|
-
tight: 1.4,
|
|
178
|
-
relaxed: 1.8
|
|
179
|
-
},
|
|
180
|
-
breakpoints: ["640px", "768px", "1024px", "1280px"],
|
|
181
|
-
sizes: [16, 32, 64, 128, 256, 512, 768, 1024, 1536],
|
|
182
|
-
radii: [0, 2, 4, 6, 8, 12, 16, 24],
|
|
183
|
-
shadows: [
|
|
184
|
-
"none",
|
|
185
|
-
"0 1px 2px 0 rgba(0, 0, 0, 0.05)",
|
|
186
|
-
"0 2px 4px 0 rgba(0, 0, 0, 0.06)",
|
|
187
|
-
"0 4px 6px 0 rgba(0, 0, 0, 0.07)",
|
|
188
|
-
"0 8px 12px 0 rgba(0, 0, 0, 0.08)",
|
|
189
|
-
"0 16px 24px 0 rgba(0, 0, 0, 0.10)"
|
|
190
|
-
],
|
|
191
|
-
zIndices: [0, 1, 10, 20, 30, 40, 50],
|
|
192
|
-
colors: {
|
|
193
|
-
text: "#e4e4e4",
|
|
194
|
-
background: "rgba(10, 10, 10, 0.85)",
|
|
195
|
-
primary: "#66b3ff",
|
|
196
|
-
secondary: "#80c4ff",
|
|
197
|
-
accent: "#66ff99",
|
|
198
|
-
highlight: "rgba(102, 179, 255, 0.15)",
|
|
199
|
-
muted: "rgba(26, 26, 26, 0.8)",
|
|
200
|
-
success: "#66ff99",
|
|
201
|
-
warning: "#ffcc66",
|
|
202
|
-
error: "#ff6666",
|
|
203
|
-
info: "#66b3ff",
|
|
204
|
-
border: "rgba(255, 255, 255, 0.1)",
|
|
205
|
-
backgroundSecondary: "rgba(15, 15, 15, 0.9)",
|
|
206
|
-
backgroundTertiary: "rgba(20, 20, 20, 0.9)",
|
|
207
|
-
backgroundLight: "rgba(255, 255, 255, 0.05)",
|
|
208
|
-
backgroundHover: "rgba(102, 179, 255, 0.08)",
|
|
209
|
-
surface: "rgba(15, 15, 15, 0.95)",
|
|
210
|
-
textSecondary: "rgba(255, 255, 255, 0.7)",
|
|
211
|
-
textTertiary: "rgba(255, 255, 255, 0.5)",
|
|
212
|
-
textMuted: "rgba(255, 255, 255, 0.4)",
|
|
213
|
-
highlightBg: "rgba(255, 235, 59, 0.25)",
|
|
214
|
-
highlightBorder: "rgba(255, 235, 59, 0.5)"
|
|
215
|
-
},
|
|
216
|
-
modes: {
|
|
217
|
-
light: {
|
|
218
|
-
text: "#1a1a1a",
|
|
219
|
-
background: "rgba(255, 255, 255, 0.9)",
|
|
220
|
-
primary: "#0066cc",
|
|
221
|
-
secondary: "#0052a3",
|
|
222
|
-
accent: "#00cc88",
|
|
223
|
-
highlight: "rgba(0, 102, 204, 0.08)",
|
|
224
|
-
muted: "rgba(245, 245, 245, 0.8)",
|
|
225
|
-
success: "#00cc88",
|
|
226
|
-
warning: "#ffaa00",
|
|
227
|
-
error: "#ff3333",
|
|
228
|
-
info: "#0066cc",
|
|
229
|
-
border: "rgba(0, 0, 0, 0.1)",
|
|
230
|
-
backgroundSecondary: "rgba(250, 250, 250, 0.9)",
|
|
231
|
-
backgroundTertiary: "rgba(245, 245, 245, 0.9)",
|
|
232
|
-
backgroundLight: "rgba(0, 0, 0, 0.02)",
|
|
233
|
-
backgroundHover: "rgba(0, 102, 204, 0.04)",
|
|
234
|
-
surface: "rgba(255, 255, 255, 0.95)",
|
|
235
|
-
textSecondary: "rgba(0, 0, 0, 0.6)",
|
|
236
|
-
textTertiary: "rgba(0, 0, 0, 0.4)",
|
|
237
|
-
textMuted: "rgba(0, 0, 0, 0.3)",
|
|
238
|
-
highlightBg: "rgba(255, 235, 59, 0.3)",
|
|
239
|
-
highlightBorder: "rgba(255, 235, 59, 0.6)"
|
|
240
|
-
}
|
|
241
|
-
},
|
|
242
|
-
buttons: {
|
|
243
|
-
primary: {
|
|
244
|
-
color: "white",
|
|
245
|
-
bg: "primary",
|
|
246
|
-
borderWidth: 0,
|
|
247
|
-
"&:hover": {
|
|
248
|
-
bg: "secondary"
|
|
249
|
-
}
|
|
250
|
-
},
|
|
251
|
-
secondary: {
|
|
252
|
-
color: "primary",
|
|
253
|
-
bg: "transparent",
|
|
254
|
-
borderWidth: 1,
|
|
255
|
-
borderStyle: "solid",
|
|
256
|
-
borderColor: "primary",
|
|
257
|
-
"&:hover": {
|
|
258
|
-
bg: "highlight"
|
|
259
|
-
}
|
|
260
|
-
},
|
|
261
|
-
ghost: {
|
|
262
|
-
color: "text",
|
|
263
|
-
bg: "transparent",
|
|
264
|
-
"&:hover": {
|
|
265
|
-
bg: "backgroundHover"
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
},
|
|
269
|
-
text: {
|
|
270
|
-
heading: {
|
|
271
|
-
fontFamily: "heading",
|
|
272
|
-
fontWeight: "heading",
|
|
273
|
-
lineHeight: "heading"
|
|
274
|
-
},
|
|
275
|
-
body: {
|
|
276
|
-
fontFamily: "body",
|
|
277
|
-
fontWeight: "body",
|
|
278
|
-
lineHeight: "body"
|
|
279
|
-
},
|
|
280
|
-
caption: {
|
|
281
|
-
fontSize: 1,
|
|
282
|
-
color: "textSecondary"
|
|
283
|
-
}
|
|
284
|
-
},
|
|
285
|
-
cards: {
|
|
286
|
-
primary: {
|
|
287
|
-
bg: "surface",
|
|
288
|
-
border: "1px solid",
|
|
289
|
-
borderColor: "border",
|
|
290
|
-
borderRadius: 1
|
|
291
|
-
},
|
|
292
|
-
secondary: {
|
|
293
|
-
bg: "backgroundSecondary",
|
|
294
|
-
border: "1px solid",
|
|
295
|
-
borderColor: "border",
|
|
296
|
-
borderRadius: 1
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
};
|
|
300
|
-
function getMode(theme2, mode) {
|
|
301
|
-
if (!mode || !theme2.modes || !theme2.modes[mode]) {
|
|
302
|
-
return theme2.colors;
|
|
303
|
-
}
|
|
304
|
-
return {
|
|
305
|
-
...theme2.colors,
|
|
306
|
-
...theme2.modes[mode]
|
|
307
|
-
};
|
|
308
|
-
}
|
|
309
157
|
var ThemeContext;
|
|
310
158
|
var getThemeContext = () => {
|
|
311
159
|
if (typeof window !== "undefined") {
|
|
@@ -329,46 +177,6 @@ var useTheme = () => {
|
|
|
329
177
|
}
|
|
330
178
|
return context;
|
|
331
179
|
};
|
|
332
|
-
var ThemeProvider = ({
|
|
333
|
-
children,
|
|
334
|
-
theme: customTheme = theme,
|
|
335
|
-
initialMode
|
|
336
|
-
}) => {
|
|
337
|
-
const [mode, setMode] = useState(initialMode);
|
|
338
|
-
const activeTheme = React2__default.useMemo(() => {
|
|
339
|
-
if (!mode || !customTheme.modes || !customTheme.modes[mode]) {
|
|
340
|
-
return customTheme;
|
|
341
|
-
}
|
|
342
|
-
return {
|
|
343
|
-
...customTheme,
|
|
344
|
-
colors: getMode(customTheme, mode)
|
|
345
|
-
};
|
|
346
|
-
}, [customTheme, mode]);
|
|
347
|
-
useEffect(() => {
|
|
348
|
-
if (!initialMode) {
|
|
349
|
-
const savedMode = localStorage.getItem("principlemd-theme-mode");
|
|
350
|
-
if (savedMode) {
|
|
351
|
-
setMode(savedMode);
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
}, [initialMode]);
|
|
355
|
-
useEffect(() => {
|
|
356
|
-
if (mode) {
|
|
357
|
-
localStorage.setItem("principlemd-theme-mode", mode);
|
|
358
|
-
} else {
|
|
359
|
-
localStorage.removeItem("principlemd-theme-mode");
|
|
360
|
-
}
|
|
361
|
-
}, [mode]);
|
|
362
|
-
const value = {
|
|
363
|
-
theme: activeTheme,
|
|
364
|
-
mode,
|
|
365
|
-
setMode
|
|
366
|
-
};
|
|
367
|
-
return /* @__PURE__ */ React2__default.createElement(ThemeContextSingleton.Provider, {
|
|
368
|
-
value
|
|
369
|
-
}, children);
|
|
370
|
-
};
|
|
371
|
-
var theme = terminalTheme;
|
|
372
180
|
function r(e) {
|
|
373
181
|
var t, f, n = "";
|
|
374
182
|
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
@@ -385,31 +193,31 @@ function clsx() {
|
|
|
385
193
|
function cn(...inputs) {
|
|
386
194
|
return clsx(inputs);
|
|
387
195
|
}
|
|
388
|
-
function getThemeColors(
|
|
196
|
+
function getThemeColors(theme) {
|
|
389
197
|
return {
|
|
390
|
-
gridColor:
|
|
391
|
-
axisColor:
|
|
392
|
-
textColor:
|
|
393
|
-
scoreColor:
|
|
198
|
+
gridColor: theme.colors.border,
|
|
199
|
+
axisColor: theme.colors.muted,
|
|
200
|
+
textColor: theme.colors.text,
|
|
201
|
+
scoreColor: theme.colors.text,
|
|
394
202
|
tierColors: {
|
|
395
|
-
none: { fill:
|
|
396
|
-
bronze: { fill:
|
|
397
|
-
silver: { fill:
|
|
398
|
-
gold: { fill:
|
|
399
|
-
platinum: { fill:
|
|
203
|
+
none: { fill: theme.colors.muted, stroke: theme.colors.border, bg: theme.colors.backgroundLight },
|
|
204
|
+
bronze: { fill: theme.colors.warning, stroke: theme.colors.warning, bg: theme.colors.backgroundLight },
|
|
205
|
+
silver: { fill: theme.colors.secondary, stroke: theme.colors.secondary, bg: theme.colors.backgroundLight },
|
|
206
|
+
gold: { fill: theme.colors.accent, stroke: theme.colors.accent, bg: theme.colors.backgroundLight },
|
|
207
|
+
platinum: { fill: theme.colors.primary, stroke: theme.colors.primary, bg: theme.colors.backgroundLight }
|
|
400
208
|
},
|
|
401
209
|
metricColors: {
|
|
402
|
-
types:
|
|
403
|
-
documentation:
|
|
404
|
-
tests:
|
|
405
|
-
deadCode:
|
|
406
|
-
formatting:
|
|
407
|
-
linting:
|
|
210
|
+
types: theme.colors.warning,
|
|
211
|
+
documentation: theme.colors.info,
|
|
212
|
+
tests: theme.colors.success,
|
|
213
|
+
deadCode: theme.colors.error,
|
|
214
|
+
formatting: theme.colors.accent,
|
|
215
|
+
linting: theme.colors.primary
|
|
408
216
|
},
|
|
409
217
|
qualityIndicators: {
|
|
410
|
-
good:
|
|
411
|
-
medium:
|
|
412
|
-
poor:
|
|
218
|
+
good: theme.colors.success,
|
|
219
|
+
medium: theme.colors.warning,
|
|
220
|
+
poor: theme.colors.error
|
|
413
221
|
}
|
|
414
222
|
};
|
|
415
223
|
}
|
|
@@ -440,7 +248,7 @@ function calculateMetricPoint(center, radius, angle, value) {
|
|
|
440
248
|
function QualityHexagon({
|
|
441
249
|
metrics,
|
|
442
250
|
tier,
|
|
443
|
-
theme
|
|
251
|
+
theme,
|
|
444
252
|
showLabels = false,
|
|
445
253
|
showValues = false,
|
|
446
254
|
className,
|
|
@@ -448,7 +256,7 @@ function QualityHexagon({
|
|
|
448
256
|
onVertexLeave,
|
|
449
257
|
onVertexClick
|
|
450
258
|
}) {
|
|
451
|
-
const themeColors = getThemeColors(
|
|
259
|
+
const themeColors = getThemeColors(theme);
|
|
452
260
|
const colors = themeColors.tierColors[tier] ?? themeColors.tierColors.none;
|
|
453
261
|
const metricConfig = getMetricConfig(themeColors);
|
|
454
262
|
const viewBoxSize = 300;
|
|
@@ -644,7 +452,7 @@ function QualityHexagon({
|
|
|
644
452
|
function QualityHexagonCompact({
|
|
645
453
|
metrics,
|
|
646
454
|
tier,
|
|
647
|
-
theme
|
|
455
|
+
theme,
|
|
648
456
|
className
|
|
649
457
|
}) {
|
|
650
458
|
return /* @__PURE__ */ jsx("div", { className: cn("w-20 h-20", className), children: /* @__PURE__ */ jsx(
|
|
@@ -652,7 +460,7 @@ function QualityHexagonCompact({
|
|
|
652
460
|
{
|
|
653
461
|
metrics,
|
|
654
462
|
tier,
|
|
655
|
-
theme
|
|
463
|
+
theme,
|
|
656
464
|
showLabels: false,
|
|
657
465
|
showValues: false
|
|
658
466
|
}
|
|
@@ -661,14 +469,14 @@ function QualityHexagonCompact({
|
|
|
661
469
|
function QualityHexagonDetailed({
|
|
662
470
|
metrics,
|
|
663
471
|
tier,
|
|
664
|
-
theme
|
|
472
|
+
theme,
|
|
665
473
|
className,
|
|
666
474
|
packageName,
|
|
667
475
|
packageVersion,
|
|
668
476
|
onRefresh,
|
|
669
477
|
isRefreshing = false
|
|
670
478
|
}) {
|
|
671
|
-
const themeColors = getThemeColors(
|
|
479
|
+
const themeColors = getThemeColors(theme);
|
|
672
480
|
const colors = themeColors.tierColors[tier] ?? themeColors.tierColors.none;
|
|
673
481
|
const metricConfig = getMetricConfig(themeColors);
|
|
674
482
|
const hasHeader = packageName || onRefresh;
|
|
@@ -695,7 +503,7 @@ function QualityHexagonDetailed({
|
|
|
695
503
|
packageName.startsWith("@") && packageName.includes("/") ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
696
504
|
/* @__PURE__ */ jsx("span", { style: {
|
|
697
505
|
fontSize: 12,
|
|
698
|
-
color:
|
|
506
|
+
color: theme.colors.textMuted
|
|
699
507
|
}, children: packageName.split("/")[0] }),
|
|
700
508
|
/* @__PURE__ */ jsx("span", { style: {
|
|
701
509
|
fontSize: 14,
|
|
@@ -709,7 +517,7 @@ function QualityHexagonDetailed({
|
|
|
709
517
|
}, children: packageName }),
|
|
710
518
|
packageVersion && /* @__PURE__ */ jsxs("span", { style: {
|
|
711
519
|
fontSize: 12,
|
|
712
|
-
color:
|
|
520
|
+
color: theme.colors.textMuted
|
|
713
521
|
}, children: [
|
|
714
522
|
"v",
|
|
715
523
|
packageVersion
|
|
@@ -725,10 +533,10 @@ function QualityHexagonDetailed({
|
|
|
725
533
|
display: "flex",
|
|
726
534
|
alignItems: "center",
|
|
727
535
|
justifyContent: "center",
|
|
728
|
-
border: `1px solid ${
|
|
536
|
+
border: `1px solid ${theme.colors.border}`,
|
|
729
537
|
borderRadius: 4,
|
|
730
|
-
background:
|
|
731
|
-
color:
|
|
538
|
+
background: theme.colors.surface,
|
|
539
|
+
color: theme.colors.textMuted,
|
|
732
540
|
cursor: isRefreshing ? "not-allowed" : "pointer",
|
|
733
541
|
opacity: isRefreshing ? 0.6 : 1
|
|
734
542
|
},
|
|
@@ -770,7 +578,7 @@ function QualityHexagonDetailed({
|
|
|
770
578
|
{
|
|
771
579
|
metrics,
|
|
772
580
|
tier,
|
|
773
|
-
theme
|
|
581
|
+
theme,
|
|
774
582
|
showLabels: true,
|
|
775
583
|
showValues: false
|
|
776
584
|
}
|
|
@@ -781,7 +589,7 @@ function QualityHexagonDetailed({
|
|
|
781
589
|
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 12 }, children: [
|
|
782
590
|
/* @__PURE__ */ jsxs("span", { style: {
|
|
783
591
|
fontSize: 14,
|
|
784
|
-
color:
|
|
592
|
+
color: theme.colors.textMuted
|
|
785
593
|
}, children: [
|
|
786
594
|
label,
|
|
787
595
|
key === "deadCode" ? " ↓" : ""
|
|
@@ -804,7 +612,7 @@ function QualityHexagonDetailed({
|
|
|
804
612
|
function QualityHexagonExpandable({
|
|
805
613
|
metrics,
|
|
806
614
|
tier,
|
|
807
|
-
theme
|
|
615
|
+
theme,
|
|
808
616
|
className,
|
|
809
617
|
packageName,
|
|
810
618
|
packageVersion,
|
|
@@ -813,7 +621,7 @@ function QualityHexagonExpandable({
|
|
|
813
621
|
defaultExpanded = false
|
|
814
622
|
}) {
|
|
815
623
|
const [expanded, setExpanded] = React2.useState(defaultExpanded);
|
|
816
|
-
const themeColors = getThemeColors(
|
|
624
|
+
const themeColors = getThemeColors(theme);
|
|
817
625
|
const colors = themeColors.tierColors[tier] ?? themeColors.tierColors.none;
|
|
818
626
|
const metricConfig = getMetricConfig(themeColors);
|
|
819
627
|
const hasHeader = packageName || onRefresh;
|
|
@@ -841,7 +649,7 @@ function QualityHexagonExpandable({
|
|
|
841
649
|
packageName.startsWith("@") && packageName.includes("/") ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
842
650
|
/* @__PURE__ */ jsx("span", { style: {
|
|
843
651
|
fontSize: 12,
|
|
844
|
-
color:
|
|
652
|
+
color: theme.colors.textMuted
|
|
845
653
|
}, children: packageName.split("/")[0] }),
|
|
846
654
|
/* @__PURE__ */ jsx("span", { style: {
|
|
847
655
|
fontSize: 14,
|
|
@@ -855,7 +663,7 @@ function QualityHexagonExpandable({
|
|
|
855
663
|
}, children: packageName }),
|
|
856
664
|
packageVersion && /* @__PURE__ */ jsxs("span", { style: {
|
|
857
665
|
fontSize: 12,
|
|
858
|
-
color:
|
|
666
|
+
color: theme.colors.textMuted
|
|
859
667
|
}, children: [
|
|
860
668
|
"v",
|
|
861
669
|
packageVersion
|
|
@@ -871,10 +679,10 @@ function QualityHexagonExpandable({
|
|
|
871
679
|
display: "flex",
|
|
872
680
|
alignItems: "center",
|
|
873
681
|
justifyContent: "center",
|
|
874
|
-
border: `1px solid ${
|
|
682
|
+
border: `1px solid ${theme.colors.border}`,
|
|
875
683
|
borderRadius: 4,
|
|
876
|
-
background:
|
|
877
|
-
color:
|
|
684
|
+
background: theme.colors.surface,
|
|
685
|
+
color: theme.colors.textMuted,
|
|
878
686
|
cursor: isRefreshing ? "not-allowed" : "pointer",
|
|
879
687
|
opacity: isRefreshing ? 0.6 : 1
|
|
880
688
|
},
|
|
@@ -919,7 +727,7 @@ function QualityHexagonExpandable({
|
|
|
919
727
|
{
|
|
920
728
|
metrics,
|
|
921
729
|
tier,
|
|
922
|
-
theme
|
|
730
|
+
theme,
|
|
923
731
|
showLabels: true,
|
|
924
732
|
showValues: false
|
|
925
733
|
}
|
|
@@ -939,14 +747,14 @@ function QualityHexagonExpandable({
|
|
|
939
747
|
flexDirection: "column",
|
|
940
748
|
gap: 8,
|
|
941
749
|
padding: "8px 24px",
|
|
942
|
-
borderTop: `1px solid ${
|
|
750
|
+
borderTop: `1px solid ${theme.colors.border}`,
|
|
943
751
|
marginTop: 8
|
|
944
752
|
}, children: metricConfig.map(({ key, label, color }) => {
|
|
945
753
|
const value = metrics[key];
|
|
946
754
|
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 12 }, children: [
|
|
947
755
|
/* @__PURE__ */ jsxs("span", { style: {
|
|
948
756
|
fontSize: 14,
|
|
949
|
-
color:
|
|
757
|
+
color: theme.colors.textMuted
|
|
950
758
|
}, children: [
|
|
951
759
|
label,
|
|
952
760
|
key === "deadCode" ? " ↓" : ""
|
|
@@ -980,7 +788,7 @@ function QualityHexagonExpandable({
|
|
|
980
788
|
height: "16",
|
|
981
789
|
viewBox: "0 0 24 24",
|
|
982
790
|
fill: "none",
|
|
983
|
-
stroke:
|
|
791
|
+
stroke: theme.colors.textMuted,
|
|
984
792
|
strokeWidth: "2",
|
|
985
793
|
strokeLinecap: "round",
|
|
986
794
|
strokeLinejoin: "round",
|
|
@@ -1016,7 +824,7 @@ function checkFileExistsInTree(treeData, targetPath) {
|
|
|
1016
824
|
return filePath.endsWith(normalizedTarget) || filePath === normalizedTarget;
|
|
1017
825
|
});
|
|
1018
826
|
}
|
|
1019
|
-
const CommandLine = ({ command, theme
|
|
827
|
+
const CommandLine = ({ command, theme }) => {
|
|
1020
828
|
const [copied, setCopied] = React2__default.useState(false);
|
|
1021
829
|
const handleCopy = async () => {
|
|
1022
830
|
try {
|
|
@@ -1037,13 +845,13 @@ const CommandLine = ({ command, theme: theme2 }) => {
|
|
|
1037
845
|
gap: 12,
|
|
1038
846
|
padding: "10px 14px",
|
|
1039
847
|
borderRadius: 6,
|
|
1040
|
-
backgroundColor:
|
|
1041
|
-
border: `1px solid ${
|
|
848
|
+
backgroundColor: theme.colors.background,
|
|
849
|
+
border: `1px solid ${theme.colors.border}`,
|
|
1042
850
|
fontFamily: "monospace",
|
|
1043
851
|
fontSize: 13
|
|
1044
852
|
},
|
|
1045
853
|
children: [
|
|
1046
|
-
/* @__PURE__ */ jsx("code", { style: { color:
|
|
854
|
+
/* @__PURE__ */ jsx("code", { style: { color: theme.colors.text }, children: command }),
|
|
1047
855
|
/* @__PURE__ */ jsx(
|
|
1048
856
|
"button",
|
|
1049
857
|
{
|
|
@@ -1055,11 +863,11 @@ const CommandLine = ({ command, theme: theme2 }) => {
|
|
|
1055
863
|
padding: 4,
|
|
1056
864
|
border: "none",
|
|
1057
865
|
backgroundColor: "transparent",
|
|
1058
|
-
color:
|
|
866
|
+
color: theme.colors.textMuted,
|
|
1059
867
|
cursor: "pointer"
|
|
1060
868
|
},
|
|
1061
869
|
title: "Copy command",
|
|
1062
|
-
children: copied ? /* @__PURE__ */ jsx(Check, { size: 16, color:
|
|
870
|
+
children: copied ? /* @__PURE__ */ jsx(Check, { size: 16, color: theme.colors.success }) : /* @__PURE__ */ jsx(Copy, { size: 16 })
|
|
1063
871
|
}
|
|
1064
872
|
)
|
|
1065
873
|
]
|
|
@@ -1067,7 +875,7 @@ const CommandLine = ({ command, theme: theme2 }) => {
|
|
|
1067
875
|
);
|
|
1068
876
|
};
|
|
1069
877
|
const QualityEmptyState = ({
|
|
1070
|
-
theme
|
|
878
|
+
theme,
|
|
1071
879
|
hasWorkflow
|
|
1072
880
|
}) => {
|
|
1073
881
|
if (hasWorkflow) {
|
|
@@ -1088,7 +896,7 @@ const QualityEmptyState = ({
|
|
|
1088
896
|
style: {
|
|
1089
897
|
margin: 0,
|
|
1090
898
|
fontSize: 14,
|
|
1091
|
-
color:
|
|
899
|
+
color: theme.colors.textMuted,
|
|
1092
900
|
lineHeight: 1.5
|
|
1093
901
|
},
|
|
1094
902
|
children: "Quality metrics will appear here after your next CI run completes."
|
|
@@ -1103,8 +911,8 @@ const QualityEmptyState = ({
|
|
|
1103
911
|
gap: 8,
|
|
1104
912
|
padding: "10px 14px",
|
|
1105
913
|
borderRadius: 6,
|
|
1106
|
-
backgroundColor: `${
|
|
1107
|
-
color:
|
|
914
|
+
backgroundColor: `${theme.colors.success}15`,
|
|
915
|
+
color: theme.colors.success,
|
|
1108
916
|
fontSize: 13
|
|
1109
917
|
},
|
|
1110
918
|
children: [
|
|
@@ -1137,7 +945,7 @@ const QualityEmptyState = ({
|
|
|
1137
945
|
style: {
|
|
1138
946
|
margin: 0,
|
|
1139
947
|
fontSize: 14,
|
|
1140
|
-
color:
|
|
948
|
+
color: theme.colors.textMuted,
|
|
1141
949
|
lineHeight: 1.5
|
|
1142
950
|
},
|
|
1143
951
|
children: "Track your code quality with automated analysis of tests, linting, types, formatting, dead code, and documentation."
|
|
@@ -1152,8 +960,8 @@ const QualityEmptyState = ({
|
|
|
1152
960
|
gap: 16,
|
|
1153
961
|
padding: 20,
|
|
1154
962
|
borderRadius: 8,
|
|
1155
|
-
backgroundColor:
|
|
1156
|
-
border: `1px solid ${
|
|
963
|
+
backgroundColor: theme.colors.surface,
|
|
964
|
+
border: `1px solid ${theme.colors.border}`
|
|
1157
965
|
},
|
|
1158
966
|
children: [
|
|
1159
967
|
/* @__PURE__ */ jsxs(
|
|
@@ -1166,7 +974,7 @@ const QualityEmptyState = ({
|
|
|
1166
974
|
marginBottom: 4
|
|
1167
975
|
},
|
|
1168
976
|
children: [
|
|
1169
|
-
/* @__PURE__ */ jsx(Terminal, { size: 20, color:
|
|
977
|
+
/* @__PURE__ */ jsx(Terminal, { size: 20, color: theme.colors.text }),
|
|
1170
978
|
/* @__PURE__ */ jsx(
|
|
1171
979
|
"h4",
|
|
1172
980
|
{
|
|
@@ -1174,7 +982,7 @@ const QualityEmptyState = ({
|
|
|
1174
982
|
margin: 0,
|
|
1175
983
|
fontSize: 15,
|
|
1176
984
|
fontWeight: 600,
|
|
1177
|
-
color:
|
|
985
|
+
color: theme.colors.text
|
|
1178
986
|
},
|
|
1179
987
|
children: "Get Started"
|
|
1180
988
|
}
|
|
@@ -1192,7 +1000,7 @@ const QualityEmptyState = ({
|
|
|
1192
1000
|
gap: 8,
|
|
1193
1001
|
marginBottom: 8,
|
|
1194
1002
|
fontSize: 13,
|
|
1195
|
-
color:
|
|
1003
|
+
color: theme.colors.textMuted
|
|
1196
1004
|
},
|
|
1197
1005
|
children: [
|
|
1198
1006
|
/* @__PURE__ */ jsx(
|
|
@@ -1205,8 +1013,8 @@ const QualityEmptyState = ({
|
|
|
1205
1013
|
width: 20,
|
|
1206
1014
|
height: 20,
|
|
1207
1015
|
borderRadius: "50%",
|
|
1208
|
-
backgroundColor:
|
|
1209
|
-
color:
|
|
1016
|
+
backgroundColor: theme.colors.primary,
|
|
1017
|
+
color: theme.colors.background,
|
|
1210
1018
|
fontSize: 11,
|
|
1211
1019
|
fontWeight: 600
|
|
1212
1020
|
},
|
|
@@ -1221,7 +1029,7 @@ const QualityEmptyState = ({
|
|
|
1221
1029
|
CommandLine,
|
|
1222
1030
|
{
|
|
1223
1031
|
command: "npm install -g @principal-ai/quality-lens-cli",
|
|
1224
|
-
theme
|
|
1032
|
+
theme
|
|
1225
1033
|
}
|
|
1226
1034
|
)
|
|
1227
1035
|
] }),
|
|
@@ -1235,7 +1043,7 @@ const QualityEmptyState = ({
|
|
|
1235
1043
|
gap: 8,
|
|
1236
1044
|
marginBottom: 8,
|
|
1237
1045
|
fontSize: 13,
|
|
1238
|
-
color:
|
|
1046
|
+
color: theme.colors.textMuted
|
|
1239
1047
|
},
|
|
1240
1048
|
children: [
|
|
1241
1049
|
/* @__PURE__ */ jsx(
|
|
@@ -1248,8 +1056,8 @@ const QualityEmptyState = ({
|
|
|
1248
1056
|
width: 20,
|
|
1249
1057
|
height: 20,
|
|
1250
1058
|
borderRadius: "50%",
|
|
1251
|
-
backgroundColor:
|
|
1252
|
-
color:
|
|
1059
|
+
backgroundColor: theme.colors.primary,
|
|
1060
|
+
color: theme.colors.background,
|
|
1253
1061
|
fontSize: 11,
|
|
1254
1062
|
fontWeight: 600
|
|
1255
1063
|
},
|
|
@@ -1260,7 +1068,7 @@ const QualityEmptyState = ({
|
|
|
1260
1068
|
]
|
|
1261
1069
|
}
|
|
1262
1070
|
),
|
|
1263
|
-
/* @__PURE__ */ jsx(CommandLine, { command: "quality-lens list", theme
|
|
1071
|
+
/* @__PURE__ */ jsx(CommandLine, { command: "quality-lens list", theme })
|
|
1264
1072
|
] }),
|
|
1265
1073
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
1266
1074
|
/* @__PURE__ */ jsxs(
|
|
@@ -1272,7 +1080,7 @@ const QualityEmptyState = ({
|
|
|
1272
1080
|
gap: 8,
|
|
1273
1081
|
marginBottom: 8,
|
|
1274
1082
|
fontSize: 13,
|
|
1275
|
-
color:
|
|
1083
|
+
color: theme.colors.textMuted
|
|
1276
1084
|
},
|
|
1277
1085
|
children: [
|
|
1278
1086
|
/* @__PURE__ */ jsx(
|
|
@@ -1285,8 +1093,8 @@ const QualityEmptyState = ({
|
|
|
1285
1093
|
width: 20,
|
|
1286
1094
|
height: 20,
|
|
1287
1095
|
borderRadius: "50%",
|
|
1288
|
-
backgroundColor:
|
|
1289
|
-
color:
|
|
1096
|
+
backgroundColor: theme.colors.primary,
|
|
1097
|
+
color: theme.colors.background,
|
|
1290
1098
|
fontSize: 11,
|
|
1291
1099
|
fontWeight: 600
|
|
1292
1100
|
},
|
|
@@ -1297,7 +1105,7 @@ const QualityEmptyState = ({
|
|
|
1297
1105
|
]
|
|
1298
1106
|
}
|
|
1299
1107
|
),
|
|
1300
|
-
/* @__PURE__ */ jsx(CommandLine, { command: "quality-lens init", theme
|
|
1108
|
+
/* @__PURE__ */ jsx(CommandLine, { command: "quality-lens init", theme })
|
|
1301
1109
|
] }),
|
|
1302
1110
|
/* @__PURE__ */ jsxs(
|
|
1303
1111
|
"div",
|
|
@@ -1308,7 +1116,7 @@ const QualityEmptyState = ({
|
|
|
1308
1116
|
gap: 6,
|
|
1309
1117
|
paddingTop: 8,
|
|
1310
1118
|
fontSize: 13,
|
|
1311
|
-
color:
|
|
1119
|
+
color: theme.colors.textMuted
|
|
1312
1120
|
},
|
|
1313
1121
|
children: [
|
|
1314
1122
|
/* @__PURE__ */ jsx(ChevronRight, { size: 14 }),
|
|
@@ -1342,7 +1150,7 @@ const QualityHexagonPanelContent = ({
|
|
|
1342
1150
|
events
|
|
1343
1151
|
}) => {
|
|
1344
1152
|
var _a;
|
|
1345
|
-
const { theme
|
|
1153
|
+
const { theme } = useTheme();
|
|
1346
1154
|
const [refreshingPackages, setRefreshingPackages] = React2__default.useState(/* @__PURE__ */ new Set());
|
|
1347
1155
|
const qualitySlice = context.getSlice("quality");
|
|
1348
1156
|
const hasQualitySlice = context.hasSlice("quality");
|
|
@@ -1381,11 +1189,11 @@ const QualityHexagonPanelContent = ({
|
|
|
1381
1189
|
return () => unsubscribers.forEach((unsub) => unsub());
|
|
1382
1190
|
}, [events, context, packages]);
|
|
1383
1191
|
const tierColors = {
|
|
1384
|
-
none:
|
|
1385
|
-
bronze:
|
|
1386
|
-
silver:
|
|
1387
|
-
gold:
|
|
1388
|
-
platinum:
|
|
1192
|
+
none: theme.colors.muted,
|
|
1193
|
+
bronze: theme.colors.warning,
|
|
1194
|
+
silver: theme.colors.secondary,
|
|
1195
|
+
gold: theme.colors.accent,
|
|
1196
|
+
platinum: theme.colors.primary
|
|
1389
1197
|
};
|
|
1390
1198
|
const overallTier = packages.length > 0 ? calculateQualityTier(
|
|
1391
1199
|
packages.reduce((acc, pkg) => ({
|
|
@@ -1401,11 +1209,11 @@ const QualityHexagonPanelContent = ({
|
|
|
1401
1209
|
"div",
|
|
1402
1210
|
{
|
|
1403
1211
|
style: {
|
|
1404
|
-
fontFamily:
|
|
1212
|
+
fontFamily: theme.fonts.body,
|
|
1405
1213
|
height: "100%",
|
|
1406
1214
|
minHeight: 0,
|
|
1407
|
-
backgroundColor:
|
|
1408
|
-
color:
|
|
1215
|
+
backgroundColor: theme.colors.background,
|
|
1216
|
+
color: theme.colors.text,
|
|
1409
1217
|
overflowY: "auto",
|
|
1410
1218
|
boxSizing: "border-box"
|
|
1411
1219
|
},
|
|
@@ -1428,7 +1236,7 @@ const QualityHexagonPanelContent = ({
|
|
|
1428
1236
|
margin: 0,
|
|
1429
1237
|
fontSize: 20,
|
|
1430
1238
|
fontWeight: 600,
|
|
1431
|
-
color:
|
|
1239
|
+
color: theme.colors.text
|
|
1432
1240
|
},
|
|
1433
1241
|
children: "Code Quality"
|
|
1434
1242
|
}
|
|
@@ -1444,9 +1252,9 @@ const QualityHexagonPanelContent = ({
|
|
|
1444
1252
|
width: 18,
|
|
1445
1253
|
height: 18,
|
|
1446
1254
|
borderRadius: "50%",
|
|
1447
|
-
border: `1px solid ${
|
|
1255
|
+
border: `1px solid ${theme.colors.border}`,
|
|
1448
1256
|
fontSize: 12,
|
|
1449
|
-
color:
|
|
1257
|
+
color: theme.colors.textMuted,
|
|
1450
1258
|
cursor: "help"
|
|
1451
1259
|
},
|
|
1452
1260
|
children: "?"
|
|
@@ -1454,7 +1262,7 @@ const QualityHexagonPanelContent = ({
|
|
|
1454
1262
|
),
|
|
1455
1263
|
packages.length > 1 && /* @__PURE__ */ jsxs("span", { style: {
|
|
1456
1264
|
fontSize: 14,
|
|
1457
|
-
color:
|
|
1265
|
+
color: theme.colors.textMuted
|
|
1458
1266
|
}, children: [
|
|
1459
1267
|
packages.length,
|
|
1460
1268
|
" packages"
|
|
@@ -1463,11 +1271,11 @@ const QualityHexagonPanelContent = ({
|
|
|
1463
1271
|
/* @__PURE__ */ jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: 16, minHeight: 0 }, children: isLoading ? /* @__PURE__ */ jsx("div", { style: {
|
|
1464
1272
|
padding: 40,
|
|
1465
1273
|
textAlign: "center",
|
|
1466
|
-
color:
|
|
1274
|
+
color: theme.colors.textMuted
|
|
1467
1275
|
}, children: "Loading quality metrics..." }) : packages.length === 0 ? /* @__PURE__ */ jsx(
|
|
1468
1276
|
QualityEmptyState,
|
|
1469
1277
|
{
|
|
1470
|
-
theme
|
|
1278
|
+
theme,
|
|
1471
1279
|
hasWorkflow
|
|
1472
1280
|
}
|
|
1473
1281
|
) : packages.map((pkg) => {
|
|
@@ -1477,7 +1285,7 @@ const QualityHexagonPanelContent = ({
|
|
|
1477
1285
|
{
|
|
1478
1286
|
metrics: pkg.metrics,
|
|
1479
1287
|
tier,
|
|
1480
|
-
theme
|
|
1288
|
+
theme,
|
|
1481
1289
|
packageName: pkg.name,
|
|
1482
1290
|
packageVersion: pkg.version
|
|
1483
1291
|
},
|
|
@@ -1490,9 +1298,7 @@ const QualityHexagonPanelContent = ({
|
|
|
1490
1298
|
}
|
|
1491
1299
|
);
|
|
1492
1300
|
};
|
|
1493
|
-
const QualityHexagonPanel =
|
|
1494
|
-
return /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(QualityHexagonPanelContent, { ...props }) });
|
|
1495
|
-
};
|
|
1301
|
+
const QualityHexagonPanel = QualityHexagonPanelContent;
|
|
1496
1302
|
const METRIC_OPTIONS = [
|
|
1497
1303
|
{ key: "types", label: "Types" },
|
|
1498
1304
|
{ key: "documentation", label: "Docs" },
|
|
@@ -1539,15 +1345,15 @@ function formatLabel(item, showRepositoryName, isSameAsRepo) {
|
|
|
1539
1345
|
}
|
|
1540
1346
|
return `${item.repositoryName} / ${item.packageName}`;
|
|
1541
1347
|
}
|
|
1542
|
-
function getValueColor(value, key,
|
|
1348
|
+
function getValueColor(value, key, theme) {
|
|
1543
1349
|
const effectiveValue = key === "deadCode" ? 100 - value : value;
|
|
1544
|
-
if (effectiveValue >= 80) return
|
|
1545
|
-
if (effectiveValue >= 60) return
|
|
1546
|
-
return
|
|
1350
|
+
if (effectiveValue >= 80) return theme.colors.success;
|
|
1351
|
+
if (effectiveValue >= 60) return theme.colors.warning;
|
|
1352
|
+
return theme.colors.error;
|
|
1547
1353
|
}
|
|
1548
1354
|
function RepositoryQualityGridItem({
|
|
1549
1355
|
item,
|
|
1550
|
-
theme
|
|
1356
|
+
theme,
|
|
1551
1357
|
onClick,
|
|
1552
1358
|
onVertexClick,
|
|
1553
1359
|
showRepositoryName = true,
|
|
@@ -1558,11 +1364,11 @@ function RepositoryQualityGridItem({
|
|
|
1558
1364
|
const isSameAsRepo = item.packageName === item.repositoryName;
|
|
1559
1365
|
const label = formatLabel(item, showRepositoryName, isSameAsRepo);
|
|
1560
1366
|
const tierColors = {
|
|
1561
|
-
none:
|
|
1562
|
-
bronze:
|
|
1563
|
-
silver:
|
|
1564
|
-
gold:
|
|
1565
|
-
platinum:
|
|
1367
|
+
none: theme.colors.muted,
|
|
1368
|
+
bronze: theme.colors.warning,
|
|
1369
|
+
silver: theme.colors.secondary,
|
|
1370
|
+
gold: theme.colors.accent,
|
|
1371
|
+
platinum: theme.colors.primary
|
|
1566
1372
|
};
|
|
1567
1373
|
const displayInfo = React2.useMemo(() => {
|
|
1568
1374
|
if (selectedMetric) {
|
|
@@ -1572,7 +1378,7 @@ function RepositoryQualityGridItem({
|
|
|
1572
1378
|
return {
|
|
1573
1379
|
label: option.label,
|
|
1574
1380
|
value,
|
|
1575
|
-
valueColor: getValueColor(value, selectedMetric,
|
|
1381
|
+
valueColor: getValueColor(value, selectedMetric, theme)
|
|
1576
1382
|
};
|
|
1577
1383
|
}
|
|
1578
1384
|
}
|
|
@@ -1580,11 +1386,11 @@ function RepositoryQualityGridItem({
|
|
|
1580
1386
|
return {
|
|
1581
1387
|
label: hoveredVertex.label,
|
|
1582
1388
|
value: hoveredVertex.value,
|
|
1583
|
-
valueColor: getValueColor(hoveredVertex.value, hoveredVertex.key,
|
|
1389
|
+
valueColor: getValueColor(hoveredVertex.value, hoveredVertex.key, theme)
|
|
1584
1390
|
};
|
|
1585
1391
|
}
|
|
1586
1392
|
return null;
|
|
1587
|
-
}, [selectedMetric, hoveredVertex, item.metrics,
|
|
1393
|
+
}, [selectedMetric, hoveredVertex, item.metrics, theme]);
|
|
1588
1394
|
return /* @__PURE__ */ jsxs(
|
|
1589
1395
|
"div",
|
|
1590
1396
|
{
|
|
@@ -1597,8 +1403,8 @@ function RepositoryQualityGridItem({
|
|
|
1597
1403
|
gap: 8,
|
|
1598
1404
|
padding: 12,
|
|
1599
1405
|
borderRadius: 8,
|
|
1600
|
-
backgroundColor:
|
|
1601
|
-
border: `1px solid ${
|
|
1406
|
+
backgroundColor: theme.colors.surface,
|
|
1407
|
+
border: `1px solid ${theme.colors.border}`,
|
|
1602
1408
|
cursor: onClick ? "pointer" : "default",
|
|
1603
1409
|
transition: "all 0.2s ease"
|
|
1604
1410
|
},
|
|
@@ -1609,7 +1415,7 @@ function RepositoryQualityGridItem({
|
|
|
1609
1415
|
}
|
|
1610
1416
|
},
|
|
1611
1417
|
onMouseLeave: (e) => {
|
|
1612
|
-
e.currentTarget.style.borderColor =
|
|
1418
|
+
e.currentTarget.style.borderColor = theme.colors.border;
|
|
1613
1419
|
e.currentTarget.style.transform = "translateY(0)";
|
|
1614
1420
|
setHoveredVertex(null);
|
|
1615
1421
|
},
|
|
@@ -1633,7 +1439,7 @@ function RepositoryQualityGridItem({
|
|
|
1633
1439
|
style: {
|
|
1634
1440
|
fontSize: 14,
|
|
1635
1441
|
fontWeight: 500,
|
|
1636
|
-
color:
|
|
1442
|
+
color: theme.colors.text
|
|
1637
1443
|
},
|
|
1638
1444
|
children: displayInfo.label
|
|
1639
1445
|
}
|
|
@@ -1652,7 +1458,7 @@ function RepositoryQualityGridItem({
|
|
|
1652
1458
|
]
|
|
1653
1459
|
}
|
|
1654
1460
|
)
|
|
1655
|
-
] }) : /* @__PURE__ */ jsx("span", { style: { fontSize: 12, color:
|
|
1461
|
+
] }) : /* @__PURE__ */ jsx("span", { style: { fontSize: 12, color: theme.colors.textMuted }, children: "Hover a corner" })
|
|
1656
1462
|
}
|
|
1657
1463
|
),
|
|
1658
1464
|
/* @__PURE__ */ jsx("div", { style: { width: 200, height: 200 }, children: /* @__PURE__ */ jsx(
|
|
@@ -1660,7 +1466,7 @@ function RepositoryQualityGridItem({
|
|
|
1660
1466
|
{
|
|
1661
1467
|
metrics: item.metrics,
|
|
1662
1468
|
tier: item.tier,
|
|
1663
|
-
theme
|
|
1469
|
+
theme,
|
|
1664
1470
|
showLabels: false,
|
|
1665
1471
|
showValues: false,
|
|
1666
1472
|
onVertexHover: setHoveredVertex,
|
|
@@ -1684,7 +1490,7 @@ function RepositoryQualityGridItem({
|
|
|
1684
1490
|
style: {
|
|
1685
1491
|
fontSize: 12,
|
|
1686
1492
|
fontWeight: 500,
|
|
1687
|
-
color:
|
|
1493
|
+
color: theme.colors.text,
|
|
1688
1494
|
textAlign: "center"
|
|
1689
1495
|
},
|
|
1690
1496
|
children: label
|
|
@@ -1695,7 +1501,7 @@ function RepositoryQualityGridItem({
|
|
|
1695
1501
|
{
|
|
1696
1502
|
style: {
|
|
1697
1503
|
fontSize: 10,
|
|
1698
|
-
color:
|
|
1504
|
+
color: theme.colors.textMuted
|
|
1699
1505
|
},
|
|
1700
1506
|
children: [
|
|
1701
1507
|
"v",
|
|
@@ -1717,7 +1523,7 @@ function calculateAverageScore(metrics) {
|
|
|
1717
1523
|
}
|
|
1718
1524
|
function RepositoryQualityGrid({
|
|
1719
1525
|
repositories,
|
|
1720
|
-
theme
|
|
1526
|
+
theme,
|
|
1721
1527
|
onItemClick,
|
|
1722
1528
|
onVertexClick,
|
|
1723
1529
|
className,
|
|
@@ -1739,11 +1545,11 @@ function RepositoryQualityGrid({
|
|
|
1739
1545
|
});
|
|
1740
1546
|
}, [items, selectedMetric]);
|
|
1741
1547
|
const tierColors = {
|
|
1742
|
-
none:
|
|
1743
|
-
bronze:
|
|
1744
|
-
silver:
|
|
1745
|
-
gold:
|
|
1746
|
-
platinum:
|
|
1548
|
+
none: theme.colors.muted,
|
|
1549
|
+
bronze: theme.colors.warning,
|
|
1550
|
+
silver: theme.colors.secondary,
|
|
1551
|
+
gold: theme.colors.accent,
|
|
1552
|
+
platinum: theme.colors.primary
|
|
1747
1553
|
};
|
|
1748
1554
|
const tierLabels = {
|
|
1749
1555
|
none: "No Data",
|
|
@@ -1760,8 +1566,8 @@ function RepositoryQualityGrid({
|
|
|
1760
1566
|
style: {
|
|
1761
1567
|
padding: 40,
|
|
1762
1568
|
textAlign: "center",
|
|
1763
|
-
color:
|
|
1764
|
-
backgroundColor:
|
|
1569
|
+
color: theme.colors.textMuted,
|
|
1570
|
+
backgroundColor: theme.colors.background,
|
|
1765
1571
|
borderRadius: 8
|
|
1766
1572
|
},
|
|
1767
1573
|
children: "No repositories to display"
|
|
@@ -1776,8 +1582,8 @@ function RepositoryQualityGrid({
|
|
|
1776
1582
|
display: "flex",
|
|
1777
1583
|
flexDirection: "column",
|
|
1778
1584
|
gap: 16,
|
|
1779
|
-
backgroundColor:
|
|
1780
|
-
fontFamily:
|
|
1585
|
+
backgroundColor: theme.colors.background,
|
|
1586
|
+
fontFamily: theme.fonts.body
|
|
1781
1587
|
},
|
|
1782
1588
|
children: [
|
|
1783
1589
|
showSummary && /* @__PURE__ */ jsxs(
|
|
@@ -1790,8 +1596,8 @@ function RepositoryQualityGrid({
|
|
|
1790
1596
|
flexWrap: "wrap",
|
|
1791
1597
|
gap: 12,
|
|
1792
1598
|
padding: "12px 16px",
|
|
1793
|
-
backgroundColor:
|
|
1794
|
-
border: `1px solid ${
|
|
1599
|
+
backgroundColor: theme.colors.surface,
|
|
1600
|
+
border: `1px solid ${theme.colors.border}`
|
|
1795
1601
|
},
|
|
1796
1602
|
children: [
|
|
1797
1603
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12 }, children: [
|
|
@@ -1801,7 +1607,7 @@ function RepositoryQualityGrid({
|
|
|
1801
1607
|
style: {
|
|
1802
1608
|
fontSize: 14,
|
|
1803
1609
|
fontWeight: 500,
|
|
1804
|
-
color:
|
|
1610
|
+
color: theme.colors.text
|
|
1805
1611
|
},
|
|
1806
1612
|
children: [
|
|
1807
1613
|
items.length,
|
|
@@ -1810,13 +1616,13 @@ function RepositoryQualityGrid({
|
|
|
1810
1616
|
]
|
|
1811
1617
|
}
|
|
1812
1618
|
),
|
|
1813
|
-
/* @__PURE__ */ jsx("span", { style: { color:
|
|
1619
|
+
/* @__PURE__ */ jsx("span", { style: { color: theme.colors.textMuted }, children: "•" }),
|
|
1814
1620
|
/* @__PURE__ */ jsxs(
|
|
1815
1621
|
"span",
|
|
1816
1622
|
{
|
|
1817
1623
|
style: {
|
|
1818
1624
|
fontSize: 14,
|
|
1819
|
-
color:
|
|
1625
|
+
color: theme.colors.textMuted
|
|
1820
1626
|
},
|
|
1821
1627
|
children: [
|
|
1822
1628
|
repositories.length,
|
|
@@ -1835,9 +1641,9 @@ function RepositoryQualityGrid({
|
|
|
1835
1641
|
style: {
|
|
1836
1642
|
padding: "4px 8px",
|
|
1837
1643
|
fontSize: 13,
|
|
1838
|
-
backgroundColor:
|
|
1839
|
-
color:
|
|
1840
|
-
border: `1px solid ${
|
|
1644
|
+
backgroundColor: theme.colors.background,
|
|
1645
|
+
color: theme.colors.text,
|
|
1646
|
+
border: `1px solid ${theme.colors.border}`,
|
|
1841
1647
|
borderRadius: 4,
|
|
1842
1648
|
cursor: "pointer",
|
|
1843
1649
|
outline: "none"
|
|
@@ -1856,7 +1662,7 @@ function RepositoryQualityGrid({
|
|
|
1856
1662
|
alignItems: "center",
|
|
1857
1663
|
gap: 8,
|
|
1858
1664
|
padding: "4px 12px",
|
|
1859
|
-
backgroundColor:
|
|
1665
|
+
backgroundColor: theme.colors.backgroundLight,
|
|
1860
1666
|
borderRadius: 16,
|
|
1861
1667
|
border: `1px solid ${tierColors[overallTier]}`
|
|
1862
1668
|
},
|
|
@@ -1903,7 +1709,7 @@ function RepositoryQualityGrid({
|
|
|
1903
1709
|
RepositoryQualityGridItem,
|
|
1904
1710
|
{
|
|
1905
1711
|
item,
|
|
1906
|
-
theme
|
|
1712
|
+
theme,
|
|
1907
1713
|
onClick: onItemClick ? () => onItemClick(item) : void 0,
|
|
1908
1714
|
onVertexClick,
|
|
1909
1715
|
showRepositoryName,
|
|
@@ -1967,7 +1773,7 @@ const RepositoryQualityGridPanelContent = ({
|
|
|
1967
1773
|
events
|
|
1968
1774
|
}) => {
|
|
1969
1775
|
var _a;
|
|
1970
|
-
const { theme
|
|
1776
|
+
const { theme } = useTheme();
|
|
1971
1777
|
const qualitySlice = context.getSlice("repositoriesQuality");
|
|
1972
1778
|
const hasQualitySlice = context.hasSlice("repositoriesQuality");
|
|
1973
1779
|
const isLoading = (qualitySlice == null ? void 0 : qualitySlice.loading) ?? false;
|
|
@@ -2026,11 +1832,11 @@ const RepositoryQualityGridPanelContent = ({
|
|
|
2026
1832
|
"div",
|
|
2027
1833
|
{
|
|
2028
1834
|
style: {
|
|
2029
|
-
fontFamily:
|
|
1835
|
+
fontFamily: theme.fonts.body,
|
|
2030
1836
|
height: "100%",
|
|
2031
1837
|
minHeight: 0,
|
|
2032
|
-
backgroundColor:
|
|
2033
|
-
color:
|
|
1838
|
+
backgroundColor: theme.colors.background,
|
|
1839
|
+
color: theme.colors.text,
|
|
2034
1840
|
overflowY: "auto",
|
|
2035
1841
|
boxSizing: "border-box"
|
|
2036
1842
|
},
|
|
@@ -2040,7 +1846,7 @@ const RepositoryQualityGridPanelContent = ({
|
|
|
2040
1846
|
style: {
|
|
2041
1847
|
padding: 40,
|
|
2042
1848
|
textAlign: "center",
|
|
2043
|
-
color:
|
|
1849
|
+
color: theme.colors.textMuted
|
|
2044
1850
|
},
|
|
2045
1851
|
children: "Loading repository quality metrics..."
|
|
2046
1852
|
}
|
|
@@ -2050,7 +1856,7 @@ const RepositoryQualityGridPanelContent = ({
|
|
|
2050
1856
|
style: {
|
|
2051
1857
|
padding: 40,
|
|
2052
1858
|
textAlign: "center",
|
|
2053
|
-
color:
|
|
1859
|
+
color: theme.colors.textMuted
|
|
2054
1860
|
},
|
|
2055
1861
|
children: "No repositories with quality metrics found."
|
|
2056
1862
|
}
|
|
@@ -2058,7 +1864,7 @@ const RepositoryQualityGridPanelContent = ({
|
|
|
2058
1864
|
RepositoryQualityGrid,
|
|
2059
1865
|
{
|
|
2060
1866
|
repositories,
|
|
2061
|
-
theme
|
|
1867
|
+
theme,
|
|
2062
1868
|
onItemClick: handleItemClick,
|
|
2063
1869
|
onVertexClick: handleVertexClick,
|
|
2064
1870
|
showRepositoryName: true,
|
|
@@ -2068,9 +1874,7 @@ const RepositoryQualityGridPanelContent = ({
|
|
|
2068
1874
|
}
|
|
2069
1875
|
);
|
|
2070
1876
|
};
|
|
2071
|
-
const RepositoryQualityGridPanel =
|
|
2072
|
-
return /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(RepositoryQualityGridPanelContent, { ...props }) });
|
|
2073
|
-
};
|
|
1877
|
+
const RepositoryQualityGridPanel = RepositoryQualityGridPanelContent;
|
|
2074
1878
|
const panels = [
|
|
2075
1879
|
{
|
|
2076
1880
|
metadata: {
|