@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.js CHANGED
@@ -115,7 +115,8 @@ function RadarChartCore({
115
115
  // replacedSpokes: short_titles of substitute spokes (not the user's original defaults)
116
116
  replacedSpokes = {},
117
117
  // boldOriginalSpokes: when true, bold spokes that are NOT replacements
118
- boldOriginalSpokes = false
118
+ boldOriginalSpokes = false,
119
+ highlightedSpoke = null
119
120
  }) {
120
121
  var _a;
121
122
  const radius = size / 2 - 40;
@@ -308,7 +309,7 @@ function RadarChartCore({
308
309
  textAnchor: "middle",
309
310
  dominantBaseline: isBottom ? "hanging" : "auto",
310
311
  onClick: () => onReplaceTopic(shortTitle),
311
- fill: isActive ? "#E85D26" : isUnansweredLabel ? "#9ca3af" : darkMode ? "#D3D7DE" : "#555",
312
+ fill: isActive ? "#E85D26" : shortTitle === highlightedSpoke ? darkMode ? "#7DD4E8" : "#59B0C4" : isUnansweredLabel ? "#9ca3af" : darkMode ? "#D3D7DE" : "#555",
312
313
  fontWeight: isActive || shouldBold ? "bold" : "normal",
313
314
  style: { cursor: "pointer", userSelect: "none", fontSize: fSize, fontFamily: "sans-serif" }
314
315
  },
@@ -3750,6 +3751,7 @@ function SocialLinks({
3750
3751
  linkedin,
3751
3752
  extraLinks = [],
3752
3753
  size = "md",
3754
+ darkMode = false,
3753
3755
  style = {}
3754
3756
  }) {
3755
3757
  const iconSizes = {
@@ -3773,14 +3775,14 @@ function SocialLinks({
3773
3775
  ...style
3774
3776
  },
3775
3777
  link: {
3776
- color: "#6A7282",
3778
+ color: darkMode ? "#9ca3af" : "#6A7282",
3777
3779
  transition: "color 0.2s ease, border-color 0.2s ease",
3778
3780
  display: "flex",
3779
3781
  alignItems: "center",
3780
3782
  justifyContent: "center",
3781
3783
  width: boxSize,
3782
3784
  height: boxSize,
3783
- border: "1px solid #E5E7EB",
3785
+ border: `1px solid ${darkMode ? "rgba(255,255,255,0.15)" : "#E5E7EB"}`,
3784
3786
  borderRadius: "10px"
3785
3787
  },
3786
3788
  icon: {
@@ -3906,8 +3908,8 @@ function SocialLinks({
3906
3908
  e.currentTarget.style.borderColor = colors.evTeal;
3907
3909
  },
3908
3910
  onMouseLeave: (e) => {
3909
- e.currentTarget.style.color = "#6A7282";
3910
- e.currentTarget.style.borderColor = "#E5E7EB";
3911
+ e.currentTarget.style.color = darkMode ? "#9ca3af" : "#6A7282";
3912
+ e.currentTarget.style.borderColor = darkMode ? "rgba(255,255,255,0.15)" : "#E5E7EB";
3911
3913
  }
3912
3914
  },
3913
3915
  link.icon
@@ -4454,7 +4456,17 @@ function getTierLabel(districtType, officeTitle) {
4454
4456
  }
4455
4457
  return "LOCAL";
4456
4458
  }
4457
- function getTierColors(tier) {
4459
+ function getTierColors(tier, darkMode) {
4460
+ if (darkMode) {
4461
+ switch (tier) {
4462
+ case "FEDERAL":
4463
+ return { bg: "rgba(30,64,175,0.25)", text: "#93c5fd" };
4464
+ case "STATE":
4465
+ return { bg: "rgba(22,101,52,0.25)", text: "#86efac" };
4466
+ default:
4467
+ return { bg: "rgba(126,34,206,0.25)", text: "#d8b4fe" };
4468
+ }
4469
+ }
4458
4470
  switch (tier) {
4459
4471
  case "FEDERAL":
4460
4472
  return { bg: "#EFF6FF", text: "#1E40AF" };
@@ -4549,7 +4561,8 @@ function PoliticianProfile({
4549
4561
  judicialRecord,
4550
4562
  politicianId,
4551
4563
  onNavigateToRecord,
4552
- imageFocalPoint
4564
+ imageFocalPoint,
4565
+ darkMode = false
4553
4566
  }) {
4554
4567
  const isMobile = useMediaQuery("(max-width: 768px)");
4555
4568
  const pol = politician;
@@ -4582,7 +4595,7 @@ function PoliticianProfile({
4582
4595
  const instagram = getSocialHandle("INSTAGRAM");
4583
4596
  const { linkedinUrl, personWebsites } = extractLinkedIn(pol);
4584
4597
  const tier = getTierLabel(pol.district_type, pol.office_title);
4585
- const tierColors2 = tier ? getTierColors(tier) : null;
4598
+ const tierColors2 = tier ? getTierColors(tier, darkMode) : null;
4586
4599
  const { title: roleTitle, subtitle: roleSubtitle } = buildTitleAndSubtitle(pol);
4587
4600
  const roleLine = [roleTitle, roleSubtitle].filter(Boolean).join(" \u2013 ");
4588
4601
  const termLine = getTermLine(pol);
@@ -4644,7 +4657,7 @@ function PoliticianProfile({
4644
4657
  const hasContactInfo = hasAddresses || hasPhones || hasEmails || hasWebsitesCol;
4645
4658
  const hasSocial = twitter || facebook || instagram || linkedinUrl;
4646
4659
  const divider = {
4647
- borderTop: "1px solid #E5E7EB",
4660
+ borderTop: `1px solid ${darkMode ? "#374151" : "#E5E7EB"}`,
4648
4661
  margin: `${spacing[6]} 0`
4649
4662
  };
4650
4663
  const sectionHeading = {
@@ -4654,7 +4667,7 @@ function PoliticianProfile({
4654
4667
  fontFamily: fonts.primary,
4655
4668
  fontWeight: fontWeights.semibold,
4656
4669
  fontSize: "18px",
4657
- color: "#101828",
4670
+ color: darkMode ? "#f3f4f6" : "#101828",
4658
4671
  margin: 0,
4659
4672
  marginBottom: spacing[4]
4660
4673
  };
@@ -4679,7 +4692,7 @@ function PoliticianProfile({
4679
4692
  padding: 0
4680
4693
  },
4681
4694
  card: {
4682
- background: colors.bgWhite,
4695
+ background: darkMode ? "#1a2235" : colors.bgWhite,
4683
4696
  borderRadius: borderRadius.lg,
4684
4697
  boxShadow: shadows.lg,
4685
4698
  padding: isMobile ? spacing[4] : spacing[8],
@@ -4738,7 +4751,7 @@ function PoliticianProfile({
4738
4751
  fontFamily: fonts.primary,
4739
4752
  fontWeight: fontWeights.bold,
4740
4753
  fontSize: isMobile ? fontSizes["2xl"] : "30px",
4741
- color: "#101828",
4754
+ color: darkMode ? "#f3f4f6" : "#101828",
4742
4755
  margin: 0,
4743
4756
  marginBottom: spacing[1],
4744
4757
  lineHeight: 1.2
@@ -4747,14 +4760,14 @@ function PoliticianProfile({
4747
4760
  fontFamily: fonts.primary,
4748
4761
  fontWeight: fontWeights.regular,
4749
4762
  fontSize: isMobile ? fontSizes.base : fontSizes.lg,
4750
- color: "#364153",
4763
+ color: darkMode ? "#d1d5db" : "#364153",
4751
4764
  margin: 0,
4752
4765
  marginBottom: spacing[1]
4753
4766
  },
4754
4767
  officeDesc: {
4755
4768
  fontFamily: fonts.primary,
4756
4769
  fontSize: fontSizes.base,
4757
- color: "#6A7282",
4770
+ color: darkMode ? "#9ca3af" : "#6A7282",
4758
4771
  margin: 0,
4759
4772
  marginBottom: spacing[3],
4760
4773
  lineHeight: 1.5
@@ -4762,7 +4775,7 @@ function PoliticianProfile({
4762
4775
  bioText: {
4763
4776
  fontFamily: fonts.primary,
4764
4777
  fontSize: fontSizes.sm,
4765
- color: "#6A7282",
4778
+ color: darkMode ? "#9ca3af" : "#6A7282",
4766
4779
  margin: 0,
4767
4780
  marginTop: spacing[1],
4768
4781
  marginBottom: spacing[3],
@@ -4782,7 +4795,7 @@ function PoliticianProfile({
4782
4795
  gap: spacing[1],
4783
4796
  fontFamily: fonts.primary,
4784
4797
  fontSize: fontSizes.sm,
4785
- color: "#6A7282"
4798
+ color: darkMode ? "#9ca3af" : "#6A7282"
4786
4799
  },
4787
4800
  submitBtn: {
4788
4801
  display: "inline-flex",
@@ -4823,7 +4836,7 @@ function PoliticianProfile({
4823
4836
  fontSize: "11px",
4824
4837
  letterSpacing: "0.05em",
4825
4838
  textTransform: "uppercase",
4826
- color: "#6A7282",
4839
+ color: darkMode ? "#9ca3af" : "#6A7282",
4827
4840
  margin: 0,
4828
4841
  marginBottom: spacing[1],
4829
4842
  display: "flex",
@@ -4833,13 +4846,13 @@ function PoliticianProfile({
4833
4846
  contactValue: {
4834
4847
  fontFamily: fonts.primary,
4835
4848
  fontSize: fontSizes.sm,
4836
- color: "#364153",
4849
+ color: darkMode ? "#d1d5db" : "#364153",
4837
4850
  lineHeight: 1.6,
4838
4851
  margin: 0,
4839
4852
  marginBottom: spacing[2]
4840
4853
  },
4841
4854
  contactLink: {
4842
- color: "#364153",
4855
+ color: darkMode ? "#59b0c4" : "#364153",
4843
4856
  textDecoration: "none",
4844
4857
  wordBreak: "break-all"
4845
4858
  },
@@ -4847,7 +4860,7 @@ function PoliticianProfile({
4847
4860
  fontFamily: fonts.primary,
4848
4861
  fontWeight: fontWeights.medium,
4849
4862
  fontSize: "12px",
4850
- color: "#9CA3AF",
4863
+ color: darkMode ? "#6b7280" : "#9CA3AF",
4851
4864
  margin: 0,
4852
4865
  marginBottom: spacing[1]
4853
4866
  },
@@ -4953,6 +4966,7 @@ function PoliticianProfile({
4953
4966
  linkedin: linkedinUrl,
4954
4967
  extraLinks: socialWebsiteUrls,
4955
4968
  size: "sm",
4969
+ darkMode,
4956
4970
  style: { marginTop: allWebsites.length > 0 ? "8px" : 0 }
4957
4971
  }
4958
4972
  )))), committees.length > 0 && /* @__PURE__ */ import_react24.default.createElement(import_react24.default.Fragment, null, /* @__PURE__ */ import_react24.default.createElement("div", { style: divider }), /* @__PURE__ */ import_react24.default.createElement(CommitteeTable, { committees })), pol.is_judicial ? /* @__PURE__ */ import_react24.default.createElement(