uilint-react 0.1.43 → 0.1.45
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/{ElementBadges-2I25HN6W.js → ElementBadges-RV7I6QXS.js} +1 -1
- package/dist/InspectionPanel-QC6WR5IG.js +10 -0
- package/dist/{LocatorOverlay-ERRFPXKK.js → LocatorOverlay-Z24VU27L.js} +2 -2
- package/dist/UILintToolbar-5NK77IQJ.js +10 -0
- package/dist/{chunk-LAL3JTAA.js → chunk-BJD2V2LF.js} +39 -7
- package/dist/{chunk-C6NUU5MF.js → chunk-EQKEHJI4.js} +291 -141
- package/dist/chunk-W42PI2OF.js +81 -0
- package/dist/{chunk-UD6HPLEZ.js → chunk-YLTHKMTO.js} +1 -1
- package/dist/chunk-ZZOKTGSU.js +1017 -0
- package/dist/index.js +5 -4
- package/package.json +6 -3
- package/dist/InspectionPanel-4LOWGHW7.js +0 -9
- package/dist/UILintToolbar-MJH7RUZK.js +0 -9
- package/dist/chunk-2VRWAMW7.js +0 -927
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/ui-lint/Badge.tsx
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
var BADGE_COLORS = {
|
|
6
|
+
success: "#68d391",
|
|
7
|
+
// Soft green
|
|
8
|
+
warning: "#f6ad55",
|
|
9
|
+
// Warm orange
|
|
10
|
+
error: "#ef4444"
|
|
11
|
+
// Red (for future use)
|
|
12
|
+
};
|
|
13
|
+
var FONT_MONO = `"SF Mono", Monaco, "Cascadia Code", monospace`;
|
|
14
|
+
function getBadgeTextColor(issueCount) {
|
|
15
|
+
if (issueCount === 0) return BADGE_COLORS.success;
|
|
16
|
+
return BADGE_COLORS.warning;
|
|
17
|
+
}
|
|
18
|
+
function getBadgeBackgroundColor(issueCount) {
|
|
19
|
+
const color = getBadgeTextColor(issueCount);
|
|
20
|
+
return `${color}20`;
|
|
21
|
+
}
|
|
22
|
+
var BADGE_STYLES = {
|
|
23
|
+
default: {
|
|
24
|
+
minWidth: "20px",
|
|
25
|
+
height: "20px",
|
|
26
|
+
padding: "0 6px",
|
|
27
|
+
borderRadius: "10px",
|
|
28
|
+
fontSize: "11px",
|
|
29
|
+
fontWeight: 600,
|
|
30
|
+
letterSpacing: "-0.02em"
|
|
31
|
+
},
|
|
32
|
+
small: {
|
|
33
|
+
minWidth: "18px",
|
|
34
|
+
height: "18px",
|
|
35
|
+
padding: "0 5px",
|
|
36
|
+
borderRadius: "9px",
|
|
37
|
+
fontSize: "10px",
|
|
38
|
+
fontWeight: 700,
|
|
39
|
+
letterSpacing: "0"
|
|
40
|
+
},
|
|
41
|
+
// For file row badges (slightly larger than small)
|
|
42
|
+
medium: {
|
|
43
|
+
minWidth: "22px",
|
|
44
|
+
height: "18px",
|
|
45
|
+
padding: "0 6px",
|
|
46
|
+
borderRadius: "9px",
|
|
47
|
+
fontSize: "10px",
|
|
48
|
+
fontWeight: 700,
|
|
49
|
+
letterSpacing: "0"
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
function Badge({
|
|
53
|
+
count,
|
|
54
|
+
size = "default",
|
|
55
|
+
backgroundColor,
|
|
56
|
+
color
|
|
57
|
+
}) {
|
|
58
|
+
const sizeStyles = BADGE_STYLES[size];
|
|
59
|
+
const bgColor = backgroundColor ?? getBadgeBackgroundColor(count);
|
|
60
|
+
const textColor = color ?? getBadgeTextColor(count);
|
|
61
|
+
return /* @__PURE__ */ jsx(
|
|
62
|
+
"span",
|
|
63
|
+
{
|
|
64
|
+
style: {
|
|
65
|
+
display: "inline-flex",
|
|
66
|
+
alignItems: "center",
|
|
67
|
+
justifyContent: "center",
|
|
68
|
+
...sizeStyles,
|
|
69
|
+
backgroundColor: bgColor,
|
|
70
|
+
color: textColor,
|
|
71
|
+
fontFamily: FONT_MONO
|
|
72
|
+
},
|
|
73
|
+
children: count
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export {
|
|
79
|
+
BADGE_COLORS,
|
|
80
|
+
Badge
|
|
81
|
+
};
|