@empoweredvote/ev-ui 0.8.7 → 0.8.9

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.mjs CHANGED
@@ -20,7 +20,11 @@ function RadarChartCore({
20
20
  writeIns = {},
21
21
  darkMode = false,
22
22
  lineColor,
23
- ringColor
23
+ ringColor,
24
+ // replacedSpokes: short_titles of substitute spokes (not the user's original defaults)
25
+ replacedSpokes = {},
26
+ // boldOriginalSpokes: when true, bold spokes that are NOT replacements
27
+ boldOriginalSpokes = false
24
28
  }) {
25
29
  var _a;
26
30
  const radius = size / 2 - 40;
@@ -201,6 +205,8 @@ function RadarChartCore({
201
205
  if (isTop && lines.length > 1) labelY -= (lines.length - 1) * lineHeight;
202
206
  const isActive = shortTitle === activeSpoke;
203
207
  const isUnansweredLabel = !!unansweredSpokes[shortTitle];
208
+ const isReplaced = !!replacedSpokes[shortTitle];
209
+ const shouldBold = boldOriginalSpokes && !isReplaced;
204
210
  const fSize = labelFontSize;
205
211
  return /* @__PURE__ */ React.createElement(
206
212
  "text",
@@ -212,7 +218,7 @@ function RadarChartCore({
212
218
  dominantBaseline: isBottom ? "hanging" : "auto",
213
219
  onClick: () => onReplaceTopic(shortTitle),
214
220
  fill: isActive ? "#E85D26" : isUnansweredLabel ? "#9ca3af" : darkMode ? "#D3D7DE" : "#555",
215
- fontWeight: isActive ? "bold" : "normal",
221
+ fontWeight: isActive || shouldBold ? "bold" : "normal",
216
222
  style: { cursor: "pointer", userSelect: "none", fontSize: fSize, fontFamily: "sans-serif" }
217
223
  },
218
224
  isUnansweredLabel && /* @__PURE__ */ React.createElement("title", null, "No stance on file for this topic."),
@@ -259,14 +265,24 @@ function RadarChartCore({
259
265
  {
260
266
  key: "compare-static",
261
267
  points: comparePoints,
262
- style: { fill: "rgba(90, 154, 110, 0.3)", stroke: "#5A9A6E", strokeWidth: 2 }
268
+ style: {
269
+ fill: darkMode ? "rgba(110, 210, 140, 0.55)" : "rgba(90, 154, 110, 0.45)",
270
+ stroke: darkMode ? "#6DD28C" : "#5A9A6E",
271
+ strokeWidth: 2,
272
+ mixBlendMode: darkMode ? "normal" : "multiply"
273
+ }
263
274
  }
264
275
  ) : /* @__PURE__ */ React.createElement(
265
276
  animated.polygon,
266
277
  {
267
278
  key: "compare-animated",
268
279
  points: compareSpring.points,
269
- style: { fill: "rgba(90, 154, 110, 0.3)", stroke: "#5A9A6E", strokeWidth: 2 }
280
+ style: {
281
+ fill: darkMode ? "rgba(110, 210, 140, 0.55)" : "rgba(90, 154, 110, 0.45)",
282
+ stroke: darkMode ? "#6DD28C" : "#5A9A6E",
283
+ strokeWidth: 2,
284
+ mixBlendMode: darkMode ? "normal" : "multiply"
285
+ }
270
286
  }
271
287
  ) : null,
272
288
  hasCompareData && compareCoords && compareCoords.map(([cx, cy], i) => {
@@ -282,7 +298,7 @@ function RadarChartCore({
282
298
  cx,
283
299
  cy,
284
300
  r: matches ? 8 : 7,
285
- fill: matches ? "#fed12e" : "#5A9A6E",
301
+ fill: matches ? "#fed12e" : darkMode ? "#6DD28C" : "#5A9A6E",
286
302
  stroke: "#FFFFFF",
287
303
  strokeWidth: 3,
288
304
  style: { pointerEvents: "none" }