@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.js
CHANGED
|
@@ -105,10 +105,11 @@ function RadarChartCore({
|
|
|
105
105
|
size = 400,
|
|
106
106
|
labelFontSize = 13,
|
|
107
107
|
padding = 80,
|
|
108
|
-
labelOffset =
|
|
108
|
+
labelOffset = 52,
|
|
109
109
|
tightFit = false,
|
|
110
110
|
activeSpoke = null,
|
|
111
|
-
writeIns = {}
|
|
111
|
+
writeIns = {},
|
|
112
|
+
darkMode = false
|
|
112
113
|
}) {
|
|
113
114
|
var _a;
|
|
114
115
|
const radius = size / 2 - 40;
|
|
@@ -220,7 +221,7 @@ function RadarChartCore({
|
|
|
220
221
|
ring.push(`${centerX + radius * scale * Math.sin(angle)},${centerY - radius * scale * Math.cos(angle)}`);
|
|
221
222
|
}
|
|
222
223
|
guidePolygons.push(
|
|
223
|
-
/* @__PURE__ */ import_react.default.createElement("polygon", { key: level, points: ring.join(" "), fill: "none", stroke: "#ccc" })
|
|
224
|
+
/* @__PURE__ */ import_react.default.createElement("polygon", { key: level, points: ring.join(" "), fill: "none", stroke: darkMode ? "#555" : "#ccc" })
|
|
224
225
|
);
|
|
225
226
|
}
|
|
226
227
|
const getStanceText = (shortTitle, value) => {
|
|
@@ -257,7 +258,7 @@ function RadarChartCore({
|
|
|
257
258
|
y1: centerY,
|
|
258
259
|
x2: endX,
|
|
259
260
|
y2: endY,
|
|
260
|
-
stroke: isUnanswered ? "#9ca3af" : "#
|
|
261
|
+
stroke: isUnanswered ? "#9ca3af" : darkMode ? "#bbb" : "#888",
|
|
261
262
|
strokeDasharray: isUnanswered ? "4 3" : void 0,
|
|
262
263
|
opacity: isUnanswered ? 0.6 : 1
|
|
263
264
|
}
|
|
@@ -289,7 +290,7 @@ function RadarChartCore({
|
|
|
289
290
|
if (isTop && lines.length > 1) labelY -= (lines.length - 1) * lineHeight;
|
|
290
291
|
const isActive = shortTitle === activeSpoke;
|
|
291
292
|
const isUnansweredLabel = !!unansweredSpokes[shortTitle];
|
|
292
|
-
const fSize =
|
|
293
|
+
const fSize = labelFontSize;
|
|
293
294
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
294
295
|
"text",
|
|
295
296
|
{
|
|
@@ -299,7 +300,7 @@ function RadarChartCore({
|
|
|
299
300
|
textAnchor: "middle",
|
|
300
301
|
dominantBaseline: isBottom ? "hanging" : "auto",
|
|
301
302
|
onClick: () => onReplaceTopic(shortTitle),
|
|
302
|
-
fill: isActive ? "#E85D26" : isUnansweredLabel ? "#9ca3af" : "#555",
|
|
303
|
+
fill: isActive ? "#E85D26" : isUnansweredLabel ? "#9ca3af" : darkMode ? "#D3D7DE" : "#555",
|
|
303
304
|
fontWeight: isActive ? "bold" : "normal",
|
|
304
305
|
style: { cursor: "pointer", userSelect: "none", fontSize: fSize, fontFamily: "sans-serif" }
|
|
305
306
|
},
|
|
@@ -421,14 +422,14 @@ function RadarChartCore({
|
|
|
421
422
|
{
|
|
422
423
|
xmlns: "http://www.w3.org/1999/xhtml",
|
|
423
424
|
style: {
|
|
424
|
-
background: "
|
|
425
|
-
border: "1px solid #d1d5db",
|
|
426
|
-
borderRadius:
|
|
427
|
-
padding: "
|
|
428
|
-
fontSize:
|
|
425
|
+
background: darkMode ? "#2F3237" : "#ffffff",
|
|
426
|
+
border: darkMode ? "1px solid #59B0C4" : "1px solid #d1d5db",
|
|
427
|
+
borderRadius: 8,
|
|
428
|
+
padding: "7px 11px",
|
|
429
|
+
fontSize: 12,
|
|
429
430
|
lineHeight: 1.4,
|
|
430
|
-
color: "#111",
|
|
431
|
-
boxShadow: "0 2px 8px rgba(0,0,0,0.12)",
|
|
431
|
+
color: darkMode ? "#EBEDEF" : "#111",
|
|
432
|
+
boxShadow: darkMode ? "0 2px 12px rgba(0,0,0,0.4)" : "0 2px 8px rgba(0,0,0,0.12)",
|
|
432
433
|
width: tipW + "px",
|
|
433
434
|
wordWrap: "break-word"
|
|
434
435
|
}
|