@empoweredvote/ev-ui 0.4.2 → 0.4.4

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 CHANGED
@@ -133,8 +133,9 @@ function RadarChartCore({
133
133
  const hasCompareData = Object.keys(compareData).length > 0;
134
134
  const centerPoints = spokes.map(() => `${centerX},${centerY}`).join(" ");
135
135
  let comparePoints = null;
136
+ let compareCoords = null;
136
137
  if (hasCompareData) {
137
- const cpts = spokes.map(([shortTitle], index) => {
138
+ const ccoords = spokes.map(([shortTitle], index) => {
138
139
  var _a, _b;
139
140
  const value = (_a = compareData[shortTitle]) != null ? _a : 0;
140
141
  const topic = topics.find((t) => t.short_title === shortTitle);
@@ -145,9 +146,10 @@ function RadarChartCore({
145
146
  const r = adjusted / 10 * radius;
146
147
  const x = centerX + r * Math.sin(angle);
147
148
  const y = centerY - r * Math.cos(angle);
148
- return `${x},${y}`;
149
+ return [x, y];
149
150
  });
150
- comparePoints = cpts.join(" ");
151
+ compareCoords = ccoords;
152
+ comparePoints = ccoords.map((p) => p.join(",")).join(" ");
151
153
  }
152
154
  const hadCompareDataRef = (0, import_react2.useRef)(false);
153
155
  const compareJustAppeared = hasCompareData && !hadCompareDataRef.current;
@@ -281,8 +283,8 @@ function RadarChartCore({
281
283
  key: "user-static",
282
284
  points: targetPoints,
283
285
  style: {
284
- fill: "rgba(255, 87, 64, 0.4)",
285
- stroke: "rgb(255, 87, 64)",
286
+ fill: "rgba(124, 107, 158, 0.4)",
287
+ stroke: "#7C6B9E",
286
288
  strokeWidth: 3
287
289
  }
288
290
  }
@@ -292,20 +294,32 @@ function RadarChartCore({
292
294
  key: "user-animated",
293
295
  points: spring.points,
294
296
  style: {
295
- fill: "rgba(255, 87, 64, 0.4)",
296
- stroke: "rgb(255, 87, 64)",
297
+ fill: "rgba(124, 107, 158, 0.4)",
298
+ stroke: "#7C6B9E",
297
299
  strokeWidth: 3
298
300
  }
299
301
  }
300
302
  ),
303
+ pointsArr.map(([cx, cy], i) => /* @__PURE__ */ import_react.default.createElement(
304
+ "circle",
305
+ {
306
+ key: `user-dot-${i}`,
307
+ cx,
308
+ cy,
309
+ r: 5,
310
+ fill: "#7C6B9E",
311
+ stroke: "#FFFFFF",
312
+ strokeWidth: 2
313
+ }
314
+ )),
301
315
  hasCompareData && comparePoints ? countChanged || compareJustAppeared ? /* @__PURE__ */ import_react.default.createElement(
302
316
  "polygon",
303
317
  {
304
318
  key: "compare-static",
305
319
  points: comparePoints,
306
320
  style: {
307
- fill: "rgba(89, 176, 196, 0.3)",
308
- stroke: "rgb(89, 176, 196)",
321
+ fill: "rgba(90, 154, 110, 0.3)",
322
+ stroke: "#5A9A6E",
309
323
  strokeWidth: 2
310
324
  }
311
325
  }
@@ -315,12 +329,24 @@ function RadarChartCore({
315
329
  key: "compare-animated",
316
330
  points: compareSpring.points,
317
331
  style: {
318
- fill: "rgba(89, 176, 196, 0.3)",
319
- stroke: "rgb(89, 176, 196)",
332
+ fill: "rgba(90, 154, 110, 0.3)",
333
+ stroke: "#5A9A6E",
320
334
  strokeWidth: 2
321
335
  }
322
336
  }
323
337
  ) : null,
338
+ hasCompareData && compareCoords && compareCoords.map(([cx, cy], i) => /* @__PURE__ */ import_react.default.createElement(
339
+ "circle",
340
+ {
341
+ key: `compare-dot-${i}`,
342
+ cx,
343
+ cy,
344
+ r: 4,
345
+ fill: "#5A9A6E",
346
+ stroke: "#FFFFFF",
347
+ strokeWidth: 2
348
+ }
349
+ )),
324
350
  spokes.map(([shortTitle], i) => {
325
351
  const angle = 2 * Math.PI * i / numSpokes;
326
352
  const x = centerX + radius * Math.sin(angle);
@@ -3092,6 +3118,15 @@ function PoliticianProfile({
3092
3118
  marginBottom: spacing[3],
3093
3119
  lineHeight: 1.5
3094
3120
  },
3121
+ bioText: {
3122
+ fontFamily: fonts.primary,
3123
+ fontSize: fontSizes.sm,
3124
+ color: "#6A7282",
3125
+ margin: 0,
3126
+ marginTop: spacing[1],
3127
+ marginBottom: spacing[3],
3128
+ lineHeight: 1.5
3129
+ },
3095
3130
  metaRow: {
3096
3131
  display: "flex",
3097
3132
  alignItems: "center",
@@ -3211,7 +3246,7 @@ function PoliticianProfile({
3211
3246
  style: styles2.photo,
3212
3247
  onError: () => setImgError(true)
3213
3248
  }
3214
- ) : /* @__PURE__ */ import_react16.default.createElement("div", { style: styles2.placeholder }, initials || "?")), /* @__PURE__ */ import_react16.default.createElement("div", { style: styles2.infoCol }, styles2.tierBadge && /* @__PURE__ */ import_react16.default.createElement("div", { style: styles2.tierBadge }, tier), /* @__PURE__ */ import_react16.default.createElement("h1", { style: styles2.name }, displayName), banner, /* @__PURE__ */ import_react16.default.createElement("p", { style: styles2.roleLine }, roleLine), pol.office_description && /* @__PURE__ */ import_react16.default.createElement("p", { style: styles2.officeDesc }, pol.office_description), (termLine || pol.total_years_in_office > 0) && /* @__PURE__ */ import_react16.default.createElement("div", { style: styles2.metaRow }, termLine && /* @__PURE__ */ import_react16.default.createElement("span", { style: styles2.metaItem }, /* @__PURE__ */ import_react16.default.createElement(CalendarIcon, { size: 14 }), termLine), pol.total_years_in_office > 0 && /* @__PURE__ */ import_react16.default.createElement("span", { style: styles2.metaItem }, /* @__PURE__ */ import_react16.default.createElement(ClockIcon, { size: 14 }), pol.total_years_in_office, " ", pol.total_years_in_office === 1 ? "year" : "years", " in office")), pol.web_form_url && /* @__PURE__ */ import_react16.default.createElement(
3249
+ ) : /* @__PURE__ */ import_react16.default.createElement("div", { style: styles2.placeholder }, initials || "?")), /* @__PURE__ */ import_react16.default.createElement("div", { style: styles2.infoCol }, styles2.tierBadge && /* @__PURE__ */ import_react16.default.createElement("div", { style: styles2.tierBadge }, tier), /* @__PURE__ */ import_react16.default.createElement("h1", { style: styles2.name }, displayName), banner, /* @__PURE__ */ import_react16.default.createElement("p", { style: styles2.roleLine }, roleLine), pol.office_description && /* @__PURE__ */ import_react16.default.createElement("p", { style: styles2.officeDesc }, pol.office_description), pol.bio_text && /* @__PURE__ */ import_react16.default.createElement("p", { style: styles2.bioText }, pol.bio_text), (termLine || pol.total_years_in_office > 0) && /* @__PURE__ */ import_react16.default.createElement("div", { style: styles2.metaRow }, termLine && /* @__PURE__ */ import_react16.default.createElement("span", { style: styles2.metaItem }, /* @__PURE__ */ import_react16.default.createElement(CalendarIcon, { size: 14 }), termLine), pol.total_years_in_office > 0 && /* @__PURE__ */ import_react16.default.createElement("span", { style: styles2.metaItem }, /* @__PURE__ */ import_react16.default.createElement(ClockIcon, { size: 14 }), pol.total_years_in_office, " ", pol.total_years_in_office === 1 ? "year" : "years", " in office")), pol.web_form_url && /* @__PURE__ */ import_react16.default.createElement(
3215
3250
  "a",
3216
3251
  {
3217
3252
  href: pol.web_form_url,