@empoweredvote/ev-ui 0.8.2 → 0.8.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/index.js +14 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -14,10 +14,11 @@ function RadarChartCore({
|
|
|
14
14
|
size = 400,
|
|
15
15
|
labelFontSize = 13,
|
|
16
16
|
padding = 80,
|
|
17
|
-
labelOffset =
|
|
17
|
+
labelOffset = 52,
|
|
18
18
|
tightFit = false,
|
|
19
19
|
activeSpoke = null,
|
|
20
|
-
writeIns = {}
|
|
20
|
+
writeIns = {},
|
|
21
|
+
darkMode = false
|
|
21
22
|
}) {
|
|
22
23
|
var _a;
|
|
23
24
|
const radius = size / 2 - 40;
|
|
@@ -129,7 +130,7 @@ function RadarChartCore({
|
|
|
129
130
|
ring.push(`${centerX + radius * scale * Math.sin(angle)},${centerY - radius * scale * Math.cos(angle)}`);
|
|
130
131
|
}
|
|
131
132
|
guidePolygons.push(
|
|
132
|
-
/* @__PURE__ */ React.createElement("polygon", { key: level, points: ring.join(" "), fill: "none", stroke: "#ccc" })
|
|
133
|
+
/* @__PURE__ */ React.createElement("polygon", { key: level, points: ring.join(" "), fill: "none", stroke: darkMode ? "#555" : "#ccc" })
|
|
133
134
|
);
|
|
134
135
|
}
|
|
135
136
|
const getStanceText = (shortTitle, value) => {
|
|
@@ -166,7 +167,7 @@ function RadarChartCore({
|
|
|
166
167
|
y1: centerY,
|
|
167
168
|
x2: endX,
|
|
168
169
|
y2: endY,
|
|
169
|
-
stroke: isUnanswered ? "#9ca3af" : "#
|
|
170
|
+
stroke: isUnanswered ? "#9ca3af" : darkMode ? "#bbb" : "#888",
|
|
170
171
|
strokeDasharray: isUnanswered ? "4 3" : void 0,
|
|
171
172
|
opacity: isUnanswered ? 0.6 : 1
|
|
172
173
|
}
|
|
@@ -198,7 +199,7 @@ function RadarChartCore({
|
|
|
198
199
|
if (isTop && lines.length > 1) labelY -= (lines.length - 1) * lineHeight;
|
|
199
200
|
const isActive = shortTitle === activeSpoke;
|
|
200
201
|
const isUnansweredLabel = !!unansweredSpokes[shortTitle];
|
|
201
|
-
const fSize =
|
|
202
|
+
const fSize = labelFontSize;
|
|
202
203
|
return /* @__PURE__ */ React.createElement(
|
|
203
204
|
"text",
|
|
204
205
|
{
|
|
@@ -208,7 +209,7 @@ function RadarChartCore({
|
|
|
208
209
|
textAnchor: "middle",
|
|
209
210
|
dominantBaseline: isBottom ? "hanging" : "auto",
|
|
210
211
|
onClick: () => onReplaceTopic(shortTitle),
|
|
211
|
-
fill: isActive ? "#E85D26" : isUnansweredLabel ? "#9ca3af" : "#555",
|
|
212
|
+
fill: isActive ? "#E85D26" : isUnansweredLabel ? "#9ca3af" : darkMode ? "#D3D7DE" : "#555",
|
|
212
213
|
fontWeight: isActive ? "bold" : "normal",
|
|
213
214
|
style: { cursor: "pointer", userSelect: "none", fontSize: fSize, fontFamily: "sans-serif" }
|
|
214
215
|
},
|
|
@@ -330,14 +331,14 @@ function RadarChartCore({
|
|
|
330
331
|
{
|
|
331
332
|
xmlns: "http://www.w3.org/1999/xhtml",
|
|
332
333
|
style: {
|
|
333
|
-
background: "
|
|
334
|
-
border: "1px solid #d1d5db",
|
|
335
|
-
borderRadius:
|
|
336
|
-
padding: "
|
|
337
|
-
fontSize:
|
|
334
|
+
background: darkMode ? "#2F3237" : "#ffffff",
|
|
335
|
+
border: darkMode ? "1px solid #59B0C4" : "1px solid #d1d5db",
|
|
336
|
+
borderRadius: 8,
|
|
337
|
+
padding: "7px 11px",
|
|
338
|
+
fontSize: 12,
|
|
338
339
|
lineHeight: 1.4,
|
|
339
|
-
color: "#111",
|
|
340
|
-
boxShadow: "0 2px 8px rgba(0,0,0,0.12)",
|
|
340
|
+
color: darkMode ? "#EBEDEF" : "#111",
|
|
341
|
+
boxShadow: darkMode ? "0 2px 12px rgba(0,0,0,0.4)" : "0 2px 8px rgba(0,0,0,0.12)",
|
|
341
342
|
width: tipW + "px",
|
|
342
343
|
wordWrap: "break-word"
|
|
343
344
|
}
|