@empoweredvote/ev-ui 0.8.9 → 0.8.11

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
@@ -24,7 +24,8 @@ function RadarChartCore({
24
24
  // replacedSpokes: short_titles of substitute spokes (not the user's original defaults)
25
25
  replacedSpokes = {},
26
26
  // boldOriginalSpokes: when true, bold spokes that are NOT replacements
27
- boldOriginalSpokes = false
27
+ boldOriginalSpokes = false,
28
+ highlightedSpoke = null
28
29
  }) {
29
30
  var _a;
30
31
  const radius = size / 2 - 40;
@@ -217,7 +218,7 @@ function RadarChartCore({
217
218
  textAnchor: "middle",
218
219
  dominantBaseline: isBottom ? "hanging" : "auto",
219
220
  onClick: () => onReplaceTopic(shortTitle),
220
- fill: isActive ? "#E85D26" : isUnansweredLabel ? "#9ca3af" : darkMode ? "#D3D7DE" : "#555",
221
+ fill: isActive ? "#E85D26" : shortTitle === highlightedSpoke ? darkMode ? "#7DD4E8" : "#59B0C4" : isUnansweredLabel ? "#9ca3af" : darkMode ? "#D3D7DE" : "#555",
221
222
  fontWeight: isActive || shouldBold ? "bold" : "normal",
222
223
  style: { cursor: "pointer", userSelect: "none", fontSize: fSize, fontFamily: "sans-serif" }
223
224
  },
@@ -3671,6 +3672,7 @@ function SocialLinks({
3671
3672
  linkedin,
3672
3673
  extraLinks = [],
3673
3674
  size = "md",
3675
+ darkMode = false,
3674
3676
  style = {}
3675
3677
  }) {
3676
3678
  const iconSizes = {
@@ -3694,14 +3696,14 @@ function SocialLinks({
3694
3696
  ...style
3695
3697
  },
3696
3698
  link: {
3697
- color: "#6A7282",
3699
+ color: darkMode ? "#9ca3af" : "#6A7282",
3698
3700
  transition: "color 0.2s ease, border-color 0.2s ease",
3699
3701
  display: "flex",
3700
3702
  alignItems: "center",
3701
3703
  justifyContent: "center",
3702
3704
  width: boxSize,
3703
3705
  height: boxSize,
3704
- border: "1px solid #E5E7EB",
3706
+ border: `1px solid ${darkMode ? "rgba(255,255,255,0.15)" : "#E5E7EB"}`,
3705
3707
  borderRadius: "10px"
3706
3708
  },
3707
3709
  icon: {
@@ -3827,8 +3829,8 @@ function SocialLinks({
3827
3829
  e.currentTarget.style.borderColor = colors.evTeal;
3828
3830
  },
3829
3831
  onMouseLeave: (e) => {
3830
- e.currentTarget.style.color = "#6A7282";
3831
- e.currentTarget.style.borderColor = "#E5E7EB";
3832
+ e.currentTarget.style.color = darkMode ? "#9ca3af" : "#6A7282";
3833
+ e.currentTarget.style.borderColor = darkMode ? "rgba(255,255,255,0.15)" : "#E5E7EB";
3832
3834
  }
3833
3835
  },
3834
3836
  link.icon
@@ -4375,7 +4377,17 @@ function getTierLabel(districtType, officeTitle) {
4375
4377
  }
4376
4378
  return "LOCAL";
4377
4379
  }
4378
- function getTierColors(tier) {
4380
+ function getTierColors(tier, darkMode) {
4381
+ if (darkMode) {
4382
+ switch (tier) {
4383
+ case "FEDERAL":
4384
+ return { bg: "rgba(30,64,175,0.25)", text: "#93c5fd" };
4385
+ case "STATE":
4386
+ return { bg: "rgba(22,101,52,0.25)", text: "#86efac" };
4387
+ default:
4388
+ return { bg: "rgba(126,34,206,0.25)", text: "#d8b4fe" };
4389
+ }
4390
+ }
4379
4391
  switch (tier) {
4380
4392
  case "FEDERAL":
4381
4393
  return { bg: "#EFF6FF", text: "#1E40AF" };
@@ -4470,7 +4482,8 @@ function PoliticianProfile({
4470
4482
  judicialRecord,
4471
4483
  politicianId,
4472
4484
  onNavigateToRecord,
4473
- imageFocalPoint
4485
+ imageFocalPoint,
4486
+ darkMode = false
4474
4487
  }) {
4475
4488
  const isMobile = useMediaQuery("(max-width: 768px)");
4476
4489
  const pol = politician;
@@ -4503,7 +4516,7 @@ function PoliticianProfile({
4503
4516
  const instagram = getSocialHandle("INSTAGRAM");
4504
4517
  const { linkedinUrl, personWebsites } = extractLinkedIn(pol);
4505
4518
  const tier = getTierLabel(pol.district_type, pol.office_title);
4506
- const tierColors2 = tier ? getTierColors(tier) : null;
4519
+ const tierColors2 = tier ? getTierColors(tier, darkMode) : null;
4507
4520
  const { title: roleTitle, subtitle: roleSubtitle } = buildTitleAndSubtitle(pol);
4508
4521
  const roleLine = [roleTitle, roleSubtitle].filter(Boolean).join(" \u2013 ");
4509
4522
  const termLine = getTermLine(pol);
@@ -4565,7 +4578,7 @@ function PoliticianProfile({
4565
4578
  const hasContactInfo = hasAddresses || hasPhones || hasEmails || hasWebsitesCol;
4566
4579
  const hasSocial = twitter || facebook || instagram || linkedinUrl;
4567
4580
  const divider = {
4568
- borderTop: "1px solid #E5E7EB",
4581
+ borderTop: `1px solid ${darkMode ? "#374151" : "#E5E7EB"}`,
4569
4582
  margin: `${spacing[6]} 0`
4570
4583
  };
4571
4584
  const sectionHeading = {
@@ -4575,7 +4588,7 @@ function PoliticianProfile({
4575
4588
  fontFamily: fonts.primary,
4576
4589
  fontWeight: fontWeights.semibold,
4577
4590
  fontSize: "18px",
4578
- color: "#101828",
4591
+ color: darkMode ? "#f3f4f6" : "#101828",
4579
4592
  margin: 0,
4580
4593
  marginBottom: spacing[4]
4581
4594
  };
@@ -4600,7 +4613,7 @@ function PoliticianProfile({
4600
4613
  padding: 0
4601
4614
  },
4602
4615
  card: {
4603
- background: colors.bgWhite,
4616
+ background: darkMode ? "#1a2235" : colors.bgWhite,
4604
4617
  borderRadius: borderRadius.lg,
4605
4618
  boxShadow: shadows.lg,
4606
4619
  padding: isMobile ? spacing[4] : spacing[8],
@@ -4659,7 +4672,7 @@ function PoliticianProfile({
4659
4672
  fontFamily: fonts.primary,
4660
4673
  fontWeight: fontWeights.bold,
4661
4674
  fontSize: isMobile ? fontSizes["2xl"] : "30px",
4662
- color: "#101828",
4675
+ color: darkMode ? "#f3f4f6" : "#101828",
4663
4676
  margin: 0,
4664
4677
  marginBottom: spacing[1],
4665
4678
  lineHeight: 1.2
@@ -4668,14 +4681,14 @@ function PoliticianProfile({
4668
4681
  fontFamily: fonts.primary,
4669
4682
  fontWeight: fontWeights.regular,
4670
4683
  fontSize: isMobile ? fontSizes.base : fontSizes.lg,
4671
- color: "#364153",
4684
+ color: darkMode ? "#d1d5db" : "#364153",
4672
4685
  margin: 0,
4673
4686
  marginBottom: spacing[1]
4674
4687
  },
4675
4688
  officeDesc: {
4676
4689
  fontFamily: fonts.primary,
4677
4690
  fontSize: fontSizes.base,
4678
- color: "#6A7282",
4691
+ color: darkMode ? "#9ca3af" : "#6A7282",
4679
4692
  margin: 0,
4680
4693
  marginBottom: spacing[3],
4681
4694
  lineHeight: 1.5
@@ -4683,7 +4696,7 @@ function PoliticianProfile({
4683
4696
  bioText: {
4684
4697
  fontFamily: fonts.primary,
4685
4698
  fontSize: fontSizes.sm,
4686
- color: "#6A7282",
4699
+ color: darkMode ? "#9ca3af" : "#6A7282",
4687
4700
  margin: 0,
4688
4701
  marginTop: spacing[1],
4689
4702
  marginBottom: spacing[3],
@@ -4703,7 +4716,7 @@ function PoliticianProfile({
4703
4716
  gap: spacing[1],
4704
4717
  fontFamily: fonts.primary,
4705
4718
  fontSize: fontSizes.sm,
4706
- color: "#6A7282"
4719
+ color: darkMode ? "#9ca3af" : "#6A7282"
4707
4720
  },
4708
4721
  submitBtn: {
4709
4722
  display: "inline-flex",
@@ -4744,7 +4757,7 @@ function PoliticianProfile({
4744
4757
  fontSize: "11px",
4745
4758
  letterSpacing: "0.05em",
4746
4759
  textTransform: "uppercase",
4747
- color: "#6A7282",
4760
+ color: darkMode ? "#9ca3af" : "#6A7282",
4748
4761
  margin: 0,
4749
4762
  marginBottom: spacing[1],
4750
4763
  display: "flex",
@@ -4754,13 +4767,13 @@ function PoliticianProfile({
4754
4767
  contactValue: {
4755
4768
  fontFamily: fonts.primary,
4756
4769
  fontSize: fontSizes.sm,
4757
- color: "#364153",
4770
+ color: darkMode ? "#d1d5db" : "#364153",
4758
4771
  lineHeight: 1.6,
4759
4772
  margin: 0,
4760
4773
  marginBottom: spacing[2]
4761
4774
  },
4762
4775
  contactLink: {
4763
- color: "#364153",
4776
+ color: darkMode ? "#59b0c4" : "#364153",
4764
4777
  textDecoration: "none",
4765
4778
  wordBreak: "break-all"
4766
4779
  },
@@ -4768,7 +4781,7 @@ function PoliticianProfile({
4768
4781
  fontFamily: fonts.primary,
4769
4782
  fontWeight: fontWeights.medium,
4770
4783
  fontSize: "12px",
4771
- color: "#9CA3AF",
4784
+ color: darkMode ? "#6b7280" : "#9CA3AF",
4772
4785
  margin: 0,
4773
4786
  marginBottom: spacing[1]
4774
4787
  },
@@ -4874,6 +4887,7 @@ function PoliticianProfile({
4874
4887
  linkedin: linkedinUrl,
4875
4888
  extraLinks: socialWebsiteUrls,
4876
4889
  size: "sm",
4890
+ darkMode,
4877
4891
  style: { marginTop: allWebsites.length > 0 ? "8px" : 0 }
4878
4892
  }
4879
4893
  )))), committees.length > 0 && /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement("div", { style: divider }), /* @__PURE__ */ React22.createElement(CommitteeTable, { committees })), pol.is_judicial ? /* @__PURE__ */ React22.createElement(