@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.mjs CHANGED
@@ -49,8 +49,9 @@ function RadarChartCore({
49
49
  const hasCompareData = Object.keys(compareData).length > 0;
50
50
  const centerPoints = spokes.map(() => `${centerX},${centerY}`).join(" ");
51
51
  let comparePoints = null;
52
+ let compareCoords = null;
52
53
  if (hasCompareData) {
53
- const cpts = spokes.map(([shortTitle], index) => {
54
+ const ccoords = spokes.map(([shortTitle], index) => {
54
55
  var _a, _b;
55
56
  const value = (_a = compareData[shortTitle]) != null ? _a : 0;
56
57
  const topic = topics.find((t) => t.short_title === shortTitle);
@@ -61,9 +62,10 @@ function RadarChartCore({
61
62
  const r = adjusted / 10 * radius;
62
63
  const x = centerX + r * Math.sin(angle);
63
64
  const y = centerY - r * Math.cos(angle);
64
- return `${x},${y}`;
65
+ return [x, y];
65
66
  });
66
- comparePoints = cpts.join(" ");
67
+ compareCoords = ccoords;
68
+ comparePoints = ccoords.map((p) => p.join(",")).join(" ");
67
69
  }
68
70
  const hadCompareDataRef = useRef(false);
69
71
  const compareJustAppeared = hasCompareData && !hadCompareDataRef.current;
@@ -197,8 +199,8 @@ function RadarChartCore({
197
199
  key: "user-static",
198
200
  points: targetPoints,
199
201
  style: {
200
- fill: "rgba(255, 87, 64, 0.4)",
201
- stroke: "rgb(255, 87, 64)",
202
+ fill: "rgba(124, 107, 158, 0.4)",
203
+ stroke: "#7C6B9E",
202
204
  strokeWidth: 3
203
205
  }
204
206
  }
@@ -208,20 +210,32 @@ function RadarChartCore({
208
210
  key: "user-animated",
209
211
  points: spring.points,
210
212
  style: {
211
- fill: "rgba(255, 87, 64, 0.4)",
212
- stroke: "rgb(255, 87, 64)",
213
+ fill: "rgba(124, 107, 158, 0.4)",
214
+ stroke: "#7C6B9E",
213
215
  strokeWidth: 3
214
216
  }
215
217
  }
216
218
  ),
219
+ pointsArr.map(([cx, cy], i) => /* @__PURE__ */ React.createElement(
220
+ "circle",
221
+ {
222
+ key: `user-dot-${i}`,
223
+ cx,
224
+ cy,
225
+ r: 5,
226
+ fill: "#7C6B9E",
227
+ stroke: "#FFFFFF",
228
+ strokeWidth: 2
229
+ }
230
+ )),
217
231
  hasCompareData && comparePoints ? countChanged || compareJustAppeared ? /* @__PURE__ */ React.createElement(
218
232
  "polygon",
219
233
  {
220
234
  key: "compare-static",
221
235
  points: comparePoints,
222
236
  style: {
223
- fill: "rgba(89, 176, 196, 0.3)",
224
- stroke: "rgb(89, 176, 196)",
237
+ fill: "rgba(90, 154, 110, 0.3)",
238
+ stroke: "#5A9A6E",
225
239
  strokeWidth: 2
226
240
  }
227
241
  }
@@ -231,12 +245,24 @@ function RadarChartCore({
231
245
  key: "compare-animated",
232
246
  points: compareSpring.points,
233
247
  style: {
234
- fill: "rgba(89, 176, 196, 0.3)",
235
- stroke: "rgb(89, 176, 196)",
248
+ fill: "rgba(90, 154, 110, 0.3)",
249
+ stroke: "#5A9A6E",
236
250
  strokeWidth: 2
237
251
  }
238
252
  }
239
253
  ) : null,
254
+ hasCompareData && compareCoords && compareCoords.map(([cx, cy], i) => /* @__PURE__ */ React.createElement(
255
+ "circle",
256
+ {
257
+ key: `compare-dot-${i}`,
258
+ cx,
259
+ cy,
260
+ r: 4,
261
+ fill: "#5A9A6E",
262
+ stroke: "#FFFFFF",
263
+ strokeWidth: 2
264
+ }
265
+ )),
240
266
  spokes.map(([shortTitle], i) => {
241
267
  const angle = 2 * Math.PI * i / numSpokes;
242
268
  const x = centerX + radius * Math.sin(angle);
@@ -3008,6 +3034,15 @@ function PoliticianProfile({
3008
3034
  marginBottom: spacing[3],
3009
3035
  lineHeight: 1.5
3010
3036
  },
3037
+ bioText: {
3038
+ fontFamily: fonts.primary,
3039
+ fontSize: fontSizes.sm,
3040
+ color: "#6A7282",
3041
+ margin: 0,
3042
+ marginTop: spacing[1],
3043
+ marginBottom: spacing[3],
3044
+ lineHeight: 1.5
3045
+ },
3011
3046
  metaRow: {
3012
3047
  display: "flex",
3013
3048
  alignItems: "center",
@@ -3127,7 +3162,7 @@ function PoliticianProfile({
3127
3162
  style: styles2.photo,
3128
3163
  onError: () => setImgError(true)
3129
3164
  }
3130
- ) : /* @__PURE__ */ React14.createElement("div", { style: styles2.placeholder }, initials || "?")), /* @__PURE__ */ React14.createElement("div", { style: styles2.infoCol }, styles2.tierBadge && /* @__PURE__ */ React14.createElement("div", { style: styles2.tierBadge }, tier), /* @__PURE__ */ React14.createElement("h1", { style: styles2.name }, displayName), banner, /* @__PURE__ */ React14.createElement("p", { style: styles2.roleLine }, roleLine), pol.office_description && /* @__PURE__ */ React14.createElement("p", { style: styles2.officeDesc }, pol.office_description), (termLine || pol.total_years_in_office > 0) && /* @__PURE__ */ React14.createElement("div", { style: styles2.metaRow }, termLine && /* @__PURE__ */ React14.createElement("span", { style: styles2.metaItem }, /* @__PURE__ */ React14.createElement(CalendarIcon, { size: 14 }), termLine), pol.total_years_in_office > 0 && /* @__PURE__ */ React14.createElement("span", { style: styles2.metaItem }, /* @__PURE__ */ React14.createElement(ClockIcon, { size: 14 }), pol.total_years_in_office, " ", pol.total_years_in_office === 1 ? "year" : "years", " in office")), pol.web_form_url && /* @__PURE__ */ React14.createElement(
3165
+ ) : /* @__PURE__ */ React14.createElement("div", { style: styles2.placeholder }, initials || "?")), /* @__PURE__ */ React14.createElement("div", { style: styles2.infoCol }, styles2.tierBadge && /* @__PURE__ */ React14.createElement("div", { style: styles2.tierBadge }, tier), /* @__PURE__ */ React14.createElement("h1", { style: styles2.name }, displayName), banner, /* @__PURE__ */ React14.createElement("p", { style: styles2.roleLine }, roleLine), pol.office_description && /* @__PURE__ */ React14.createElement("p", { style: styles2.officeDesc }, pol.office_description), pol.bio_text && /* @__PURE__ */ React14.createElement("p", { style: styles2.bioText }, pol.bio_text), (termLine || pol.total_years_in_office > 0) && /* @__PURE__ */ React14.createElement("div", { style: styles2.metaRow }, termLine && /* @__PURE__ */ React14.createElement("span", { style: styles2.metaItem }, /* @__PURE__ */ React14.createElement(CalendarIcon, { size: 14 }), termLine), pol.total_years_in_office > 0 && /* @__PURE__ */ React14.createElement("span", { style: styles2.metaItem }, /* @__PURE__ */ React14.createElement(ClockIcon, { size: 14 }), pol.total_years_in_office, " ", pol.total_years_in_office === 1 ? "year" : "years", " in office")), pol.web_form_url && /* @__PURE__ */ React14.createElement(
3131
3166
  "a",
3132
3167
  {
3133
3168
  href: pol.web_form_url,