@empoweredvote/ev-ui 0.8.14 → 0.9.0
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 +585 -346
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +573 -336
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -378,8 +378,8 @@ function wrapLabel(label, maxChars = 12) {
|
|
|
378
378
|
return lines;
|
|
379
379
|
}
|
|
380
380
|
|
|
381
|
-
// src/
|
|
382
|
-
import React2
|
|
381
|
+
// src/PlaceholderRadar.jsx
|
|
382
|
+
import React2 from "react";
|
|
383
383
|
|
|
384
384
|
// src/tokens.js
|
|
385
385
|
var colorScales = {
|
|
@@ -774,6 +774,87 @@ var breakpoints = {
|
|
|
774
774
|
xl: "1280px"
|
|
775
775
|
};
|
|
776
776
|
|
|
777
|
+
// src/PlaceholderRadar.jsx
|
|
778
|
+
function PlaceholderRadar({ size = 250, name = "", darkMode = false }) {
|
|
779
|
+
const cx = size / 2;
|
|
780
|
+
const cy = size / 2;
|
|
781
|
+
const r = size / 2 * 0.65;
|
|
782
|
+
const n = 8;
|
|
783
|
+
const surface = darkMode ? "#1e2a3a" : colorScales.teal["050"];
|
|
784
|
+
const stroke = darkMode ? "rgba(255,255,255,0.22)" : colorScales.gray["200"];
|
|
785
|
+
const vertices = Array.from({ length: n }, (_, i) => {
|
|
786
|
+
const a = 2 * Math.PI * i / n;
|
|
787
|
+
return [cx + r * Math.sin(a), cy - r * Math.cos(a)];
|
|
788
|
+
});
|
|
789
|
+
const outerPts = vertices.map(([x, y]) => `${x},${y}`).join(" ");
|
|
790
|
+
const midPts = vertices.map(([x, y]) => `${cx + (x - cx) * 0.6},${cy + (y - cy) * 0.6}`).join(" ");
|
|
791
|
+
const innerPts = vertices.map(([x, y]) => `${cx + (x - cx) * 0.3},${cy + (y - cy) * 0.3}`).join(" ");
|
|
792
|
+
return /* @__PURE__ */ React2.createElement(
|
|
793
|
+
"svg",
|
|
794
|
+
{
|
|
795
|
+
width: size,
|
|
796
|
+
height: size,
|
|
797
|
+
viewBox: `0 0 ${size} ${size}`,
|
|
798
|
+
role: "img",
|
|
799
|
+
"aria-label": name ? `${name} \u2014 compass data unavailable` : "compass data unavailable",
|
|
800
|
+
style: {
|
|
801
|
+
backgroundColor: surface,
|
|
802
|
+
borderRadius: borderRadius.sm,
|
|
803
|
+
flexShrink: 0
|
|
804
|
+
}
|
|
805
|
+
},
|
|
806
|
+
vertices.map(([x, y], i) => /* @__PURE__ */ React2.createElement(
|
|
807
|
+
"line",
|
|
808
|
+
{
|
|
809
|
+
key: i,
|
|
810
|
+
x1: cx,
|
|
811
|
+
y1: cy,
|
|
812
|
+
x2: x,
|
|
813
|
+
y2: y,
|
|
814
|
+
stroke,
|
|
815
|
+
strokeWidth: "1",
|
|
816
|
+
strokeDasharray: "2 3",
|
|
817
|
+
opacity: "0.6"
|
|
818
|
+
}
|
|
819
|
+
)),
|
|
820
|
+
/* @__PURE__ */ React2.createElement(
|
|
821
|
+
"polygon",
|
|
822
|
+
{
|
|
823
|
+
points: innerPts,
|
|
824
|
+
fill: "none",
|
|
825
|
+
stroke,
|
|
826
|
+
strokeWidth: "1",
|
|
827
|
+
strokeDasharray: "2 3",
|
|
828
|
+
opacity: "0.5"
|
|
829
|
+
}
|
|
830
|
+
),
|
|
831
|
+
/* @__PURE__ */ React2.createElement(
|
|
832
|
+
"polygon",
|
|
833
|
+
{
|
|
834
|
+
points: midPts,
|
|
835
|
+
fill: "none",
|
|
836
|
+
stroke,
|
|
837
|
+
strokeWidth: "1",
|
|
838
|
+
strokeDasharray: "3 3",
|
|
839
|
+
opacity: "0.6"
|
|
840
|
+
}
|
|
841
|
+
),
|
|
842
|
+
/* @__PURE__ */ React2.createElement(
|
|
843
|
+
"polygon",
|
|
844
|
+
{
|
|
845
|
+
points: outerPts,
|
|
846
|
+
fill: "none",
|
|
847
|
+
stroke,
|
|
848
|
+
strokeWidth: "1.5",
|
|
849
|
+
strokeDasharray: "4 3"
|
|
850
|
+
}
|
|
851
|
+
)
|
|
852
|
+
);
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
// src/Header.jsx
|
|
856
|
+
import React3, { useState as useState3, useRef as useRef2, useEffect as useEffect4 } from "react";
|
|
857
|
+
|
|
777
858
|
// src/useMediaQuery.js
|
|
778
859
|
import { useState as useState2, useEffect as useEffect3 } from "react";
|
|
779
860
|
function useMediaQuery(query) {
|
|
@@ -803,12 +884,14 @@ function Header({
|
|
|
803
884
|
currentPath,
|
|
804
885
|
onNavigate,
|
|
805
886
|
profileMenu,
|
|
887
|
+
darkMode = false,
|
|
888
|
+
navCollapseBreakpoint = 1024,
|
|
806
889
|
style = {}
|
|
807
890
|
}) {
|
|
808
891
|
const [mobileMenuOpen, setMobileMenuOpen] = useState3(false);
|
|
809
892
|
const [openDropdown, setOpenDropdown] = useState3(null);
|
|
810
893
|
const [profileOpen, setProfileOpen] = useState3(false);
|
|
811
|
-
const isMobile = useMediaQuery(
|
|
894
|
+
const isMobile = useMediaQuery(`(max-width: ${navCollapseBreakpoint}px)`);
|
|
812
895
|
const profileRef = useRef2(null);
|
|
813
896
|
useEffect4(() => {
|
|
814
897
|
if (!profileOpen) return;
|
|
@@ -826,9 +909,42 @@ function Header({
|
|
|
826
909
|
onNavigate(href);
|
|
827
910
|
}
|
|
828
911
|
};
|
|
912
|
+
const t = darkMode ? {
|
|
913
|
+
surface: semanticTokens.dark.layerBase.background,
|
|
914
|
+
// #131416
|
|
915
|
+
raised: semanticTokens.dark.layerOne.background,
|
|
916
|
+
// #2F3237 (dropdowns)
|
|
917
|
+
text: colors.evLightBlue,
|
|
918
|
+
// #59B0C4 — AA on dark
|
|
919
|
+
itemText: semanticTokens.dark.layerOne.text,
|
|
920
|
+
// #D3D7DE (dropdown items)
|
|
921
|
+
muted: semanticTokens.dark.layerBase.text,
|
|
922
|
+
// #B3BBCC
|
|
923
|
+
border: semanticTokens.dark.divider,
|
|
924
|
+
// #41454E
|
|
925
|
+
hoverBg: semanticTokens.dark.layerTwo.background,
|
|
926
|
+
// #41454E
|
|
927
|
+
ctaBg: semanticTokens.dark.buttonPrimary.background.default,
|
|
928
|
+
// #005366
|
|
929
|
+
ctaBgHover: semanticTokens.dark.buttonPrimary.background.hovered,
|
|
930
|
+
ctaText: "#FFFFFF",
|
|
931
|
+
shadow: "0 10px 40px rgba(0,0,0,0.5)"
|
|
932
|
+
} : {
|
|
933
|
+
surface: colors.bgWhite,
|
|
934
|
+
raised: colors.bgWhite,
|
|
935
|
+
text: colors.evTeal,
|
|
936
|
+
itemText: colors.evTeal,
|
|
937
|
+
muted: colors.textMuted,
|
|
938
|
+
border: colors.borderLight,
|
|
939
|
+
hoverBg: colors.bgLight,
|
|
940
|
+
ctaBg: colors.evTeal,
|
|
941
|
+
ctaBgHover: colors.evTealDark,
|
|
942
|
+
ctaText: colors.textWhite,
|
|
943
|
+
shadow: "0 10px 40px rgba(0,0,0,0.1)"
|
|
944
|
+
};
|
|
829
945
|
const styles2 = {
|
|
830
946
|
header: {
|
|
831
|
-
backgroundColor:
|
|
947
|
+
backgroundColor: t.surface,
|
|
832
948
|
position: "sticky",
|
|
833
949
|
top: 0,
|
|
834
950
|
zIndex: 50,
|
|
@@ -841,7 +957,8 @@ function Header({
|
|
|
841
957
|
padding: isMobile ? `${spacing[3]} ${spacing[3]}` : `${spacing[4]} ${spacing[6]}`,
|
|
842
958
|
display: "flex",
|
|
843
959
|
alignItems: "center",
|
|
844
|
-
justifyContent: "space-between"
|
|
960
|
+
justifyContent: "space-between",
|
|
961
|
+
gap: spacing[6]
|
|
845
962
|
},
|
|
846
963
|
logo: {
|
|
847
964
|
height: "43px",
|
|
@@ -849,20 +966,24 @@ function Header({
|
|
|
849
966
|
},
|
|
850
967
|
nav: {
|
|
851
968
|
display: isMobile ? "none" : "flex",
|
|
969
|
+
flex: "1 1 auto",
|
|
852
970
|
alignItems: "center",
|
|
853
|
-
|
|
971
|
+
justifyContent: "center",
|
|
972
|
+
flexWrap: "nowrap",
|
|
973
|
+
gap: spacing[8]
|
|
854
974
|
},
|
|
855
975
|
navItem: {
|
|
856
976
|
fontFamily: fonts.primary,
|
|
857
|
-
fontWeight: fontWeights.
|
|
858
|
-
fontSize: fontSizes.
|
|
859
|
-
color:
|
|
977
|
+
fontWeight: fontWeights.medium,
|
|
978
|
+
fontSize: fontSizes.base,
|
|
979
|
+
color: t.text,
|
|
860
980
|
textDecoration: "none",
|
|
861
981
|
cursor: "pointer",
|
|
862
982
|
display: "flex",
|
|
863
983
|
alignItems: "center",
|
|
864
984
|
gap: spacing[2],
|
|
865
|
-
position: "relative"
|
|
985
|
+
position: "relative",
|
|
986
|
+
whiteSpace: "nowrap"
|
|
866
987
|
},
|
|
867
988
|
navItemActive: {
|
|
868
989
|
textDecoration: "underline"
|
|
@@ -879,9 +1000,9 @@ function Header({
|
|
|
879
1000
|
zIndex: 100
|
|
880
1001
|
},
|
|
881
1002
|
dropdownInner: {
|
|
882
|
-
backgroundColor:
|
|
1003
|
+
backgroundColor: t.raised,
|
|
883
1004
|
borderRadius: borderRadius.lg,
|
|
884
|
-
boxShadow:
|
|
1005
|
+
boxShadow: t.shadow,
|
|
885
1006
|
minWidth: "200px",
|
|
886
1007
|
padding: spacing[2]
|
|
887
1008
|
},
|
|
@@ -891,14 +1012,14 @@ function Header({
|
|
|
891
1012
|
fontFamily: fonts.primary,
|
|
892
1013
|
fontWeight: fontWeights.medium,
|
|
893
1014
|
fontSize: fontSizes.base,
|
|
894
|
-
color:
|
|
1015
|
+
color: t.itemText,
|
|
895
1016
|
textDecoration: "none",
|
|
896
1017
|
borderRadius: borderRadius.md,
|
|
897
1018
|
cursor: "pointer"
|
|
898
1019
|
},
|
|
899
1020
|
ctaButton: {
|
|
900
|
-
backgroundColor:
|
|
901
|
-
color:
|
|
1021
|
+
backgroundColor: t.ctaBg,
|
|
1022
|
+
color: t.ctaText,
|
|
902
1023
|
fontFamily: fonts.primary,
|
|
903
1024
|
fontWeight: fontWeights.bold,
|
|
904
1025
|
fontSize: fontSizes.xl,
|
|
@@ -913,13 +1034,13 @@ function Header({
|
|
|
913
1034
|
display: "inline-flex",
|
|
914
1035
|
alignItems: "center",
|
|
915
1036
|
backgroundColor: "transparent",
|
|
916
|
-
color:
|
|
1037
|
+
color: t.text,
|
|
917
1038
|
fontFamily: fonts.primary,
|
|
918
1039
|
fontWeight: fontWeights.bold,
|
|
919
1040
|
fontSize: fontSizes.base,
|
|
920
1041
|
padding: `${spacing[2]} ${spacing[5]}`,
|
|
921
1042
|
borderRadius: borderRadius.full || "999px",
|
|
922
|
-
border: `1.5px solid ${
|
|
1043
|
+
border: `1.5px solid ${t.text}`,
|
|
923
1044
|
cursor: "pointer",
|
|
924
1045
|
textDecoration: "none",
|
|
925
1046
|
lineHeight: 1.2,
|
|
@@ -935,7 +1056,7 @@ function Header({
|
|
|
935
1056
|
hamburger: {
|
|
936
1057
|
width: "24px",
|
|
937
1058
|
height: "2px",
|
|
938
|
-
backgroundColor:
|
|
1059
|
+
backgroundColor: t.text,
|
|
939
1060
|
position: "relative"
|
|
940
1061
|
},
|
|
941
1062
|
mobileMenu: {
|
|
@@ -945,25 +1066,25 @@ function Header({
|
|
|
945
1066
|
top: "100%",
|
|
946
1067
|
left: 0,
|
|
947
1068
|
right: 0,
|
|
948
|
-
backgroundColor:
|
|
1069
|
+
backgroundColor: t.surface,
|
|
949
1070
|
padding: spacing[4],
|
|
950
|
-
boxShadow:
|
|
1071
|
+
boxShadow: t.shadow
|
|
951
1072
|
},
|
|
952
1073
|
mobileNavItem: {
|
|
953
1074
|
fontFamily: fonts.primary,
|
|
954
|
-
fontWeight: fontWeights.
|
|
955
|
-
fontSize: fontSizes.
|
|
956
|
-
color:
|
|
1075
|
+
fontWeight: fontWeights.medium,
|
|
1076
|
+
fontSize: fontSizes.base,
|
|
1077
|
+
color: t.text,
|
|
957
1078
|
textDecoration: "none",
|
|
958
1079
|
padding: `${spacing[3]} 0`,
|
|
959
|
-
borderBottom: `1px solid ${
|
|
1080
|
+
borderBottom: `1px solid ${t.border}`
|
|
960
1081
|
},
|
|
961
1082
|
profileButton: {
|
|
962
1083
|
width: "40px",
|
|
963
1084
|
height: "40px",
|
|
964
1085
|
borderRadius: borderRadius.full,
|
|
965
|
-
border: `2px solid ${
|
|
966
|
-
backgroundColor: colors.bgLight,
|
|
1086
|
+
border: `2px solid ${t.text}`,
|
|
1087
|
+
backgroundColor: darkMode ? t.raised : colors.bgLight,
|
|
967
1088
|
cursor: "pointer",
|
|
968
1089
|
display: "flex",
|
|
969
1090
|
alignItems: "center",
|
|
@@ -978,9 +1099,9 @@ function Header({
|
|
|
978
1099
|
zIndex: 100
|
|
979
1100
|
},
|
|
980
1101
|
profileDropdownInner: {
|
|
981
|
-
backgroundColor:
|
|
1102
|
+
backgroundColor: t.raised,
|
|
982
1103
|
borderRadius: borderRadius.lg,
|
|
983
|
-
boxShadow:
|
|
1104
|
+
boxShadow: t.shadow,
|
|
984
1105
|
minWidth: "160px",
|
|
985
1106
|
padding: spacing[2]
|
|
986
1107
|
},
|
|
@@ -991,7 +1112,7 @@ function Header({
|
|
|
991
1112
|
fontFamily: fonts.primary,
|
|
992
1113
|
fontWeight: fontWeights.medium,
|
|
993
1114
|
fontSize: fontSizes.base,
|
|
994
|
-
color:
|
|
1115
|
+
color: t.itemText,
|
|
995
1116
|
textDecoration: "none",
|
|
996
1117
|
borderRadius: borderRadius.md,
|
|
997
1118
|
cursor: "pointer",
|
|
@@ -1001,7 +1122,7 @@ function Header({
|
|
|
1001
1122
|
},
|
|
1002
1123
|
mobileDivider: {
|
|
1003
1124
|
height: "1px",
|
|
1004
|
-
backgroundColor:
|
|
1125
|
+
backgroundColor: t.border,
|
|
1005
1126
|
margin: `${spacing[3]} 0`
|
|
1006
1127
|
},
|
|
1007
1128
|
profileLabel: {
|
|
@@ -1009,8 +1130,8 @@ function Header({
|
|
|
1009
1130
|
fontFamily: fonts.primary,
|
|
1010
1131
|
fontWeight: fontWeights.semibold,
|
|
1011
1132
|
fontSize: fontSizes.sm,
|
|
1012
|
-
color:
|
|
1013
|
-
borderBottom: `1px solid ${
|
|
1133
|
+
color: t.muted,
|
|
1134
|
+
borderBottom: `1px solid ${t.border}`,
|
|
1014
1135
|
marginBottom: spacing[1],
|
|
1015
1136
|
overflow: "hidden",
|
|
1016
1137
|
textOverflow: "ellipsis",
|
|
@@ -1018,17 +1139,23 @@ function Header({
|
|
|
1018
1139
|
}
|
|
1019
1140
|
};
|
|
1020
1141
|
const NavLink = ({ item }) => {
|
|
1021
|
-
const isActive = currentPath === item.href
|
|
1142
|
+
const isActive = currentPath === item.href || typeof window !== "undefined" && /^https?:\/\//.test(item.href) && (() => {
|
|
1143
|
+
try {
|
|
1144
|
+
return new URL(item.href).hostname === window.location.hostname;
|
|
1145
|
+
} catch {
|
|
1146
|
+
return false;
|
|
1147
|
+
}
|
|
1148
|
+
})();
|
|
1022
1149
|
const hasDropdown = item.dropdown && item.dropdown.length > 0;
|
|
1023
1150
|
const isOpen = openDropdown === item.label;
|
|
1024
|
-
return /* @__PURE__ */
|
|
1151
|
+
return /* @__PURE__ */ React3.createElement(
|
|
1025
1152
|
"div",
|
|
1026
1153
|
{
|
|
1027
1154
|
style: { position: "relative" },
|
|
1028
1155
|
onMouseEnter: () => hasDropdown && setOpenDropdown(item.label),
|
|
1029
1156
|
onMouseLeave: () => hasDropdown && setOpenDropdown(null)
|
|
1030
1157
|
},
|
|
1031
|
-
/* @__PURE__ */
|
|
1158
|
+
/* @__PURE__ */ React3.createElement(
|
|
1032
1159
|
"a",
|
|
1033
1160
|
{
|
|
1034
1161
|
href: item.href,
|
|
@@ -1039,7 +1166,7 @@ function Header({
|
|
|
1039
1166
|
}
|
|
1040
1167
|
},
|
|
1041
1168
|
item.label,
|
|
1042
|
-
hasDropdown && /* @__PURE__ */
|
|
1169
|
+
hasDropdown && /* @__PURE__ */ React3.createElement(
|
|
1043
1170
|
"svg",
|
|
1044
1171
|
{
|
|
1045
1172
|
style: styles2.dropdownIcon,
|
|
@@ -1047,11 +1174,11 @@ function Header({
|
|
|
1047
1174
|
fill: "none",
|
|
1048
1175
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1049
1176
|
},
|
|
1050
|
-
/* @__PURE__ */
|
|
1177
|
+
/* @__PURE__ */ React3.createElement(
|
|
1051
1178
|
"path",
|
|
1052
1179
|
{
|
|
1053
1180
|
d: "M1 1L8 8L15 1",
|
|
1054
|
-
stroke:
|
|
1181
|
+
stroke: t.text,
|
|
1055
1182
|
strokeWidth: "2",
|
|
1056
1183
|
strokeLinecap: "round",
|
|
1057
1184
|
strokeLinejoin: "round"
|
|
@@ -1059,7 +1186,7 @@ function Header({
|
|
|
1059
1186
|
)
|
|
1060
1187
|
)
|
|
1061
1188
|
),
|
|
1062
|
-
hasDropdown && isOpen && /* @__PURE__ */
|
|
1189
|
+
hasDropdown && isOpen && /* @__PURE__ */ React3.createElement("div", { style: styles2.dropdown }, /* @__PURE__ */ React3.createElement("div", { style: styles2.dropdownInner }, item.dropdown.map((dropdownItem, idx) => /* @__PURE__ */ React3.createElement(
|
|
1063
1190
|
"a",
|
|
1064
1191
|
{
|
|
1065
1192
|
key: idx,
|
|
@@ -1067,7 +1194,7 @@ function Header({
|
|
|
1067
1194
|
onClick: (e) => handleNavClick(e, dropdownItem.href),
|
|
1068
1195
|
style: styles2.dropdownItem,
|
|
1069
1196
|
onMouseEnter: (e) => {
|
|
1070
|
-
e.target.style.backgroundColor =
|
|
1197
|
+
e.target.style.backgroundColor = t.hoverBg;
|
|
1071
1198
|
},
|
|
1072
1199
|
onMouseLeave: (e) => {
|
|
1073
1200
|
e.target.style.backgroundColor = "transparent";
|
|
@@ -1077,26 +1204,26 @@ function Header({
|
|
|
1077
1204
|
))))
|
|
1078
1205
|
);
|
|
1079
1206
|
};
|
|
1080
|
-
return /* @__PURE__ */
|
|
1207
|
+
return /* @__PURE__ */ React3.createElement("header", { style: styles2.header }, /* @__PURE__ */ React3.createElement("div", { style: styles2.container }, /* @__PURE__ */ React3.createElement(
|
|
1081
1208
|
"a",
|
|
1082
1209
|
{
|
|
1083
1210
|
href: logoHref,
|
|
1084
1211
|
onClick: (e) => handleNavClick(e, logoHref),
|
|
1085
|
-
style: { display: "flex", alignItems: "center" }
|
|
1212
|
+
style: { display: "flex", alignItems: "center", flexShrink: 0 }
|
|
1086
1213
|
},
|
|
1087
|
-
logoSrc ? /* @__PURE__ */
|
|
1214
|
+
logoSrc ? /* @__PURE__ */ React3.createElement("img", { src: logoSrc, alt: logoAlt, style: styles2.logo }) : /* @__PURE__ */ React3.createElement(
|
|
1088
1215
|
"span",
|
|
1089
1216
|
{
|
|
1090
1217
|
style: {
|
|
1091
1218
|
fontFamily: fonts.primary,
|
|
1092
1219
|
fontWeight: fontWeights.bold,
|
|
1093
1220
|
fontSize: fontSizes["2xl"],
|
|
1094
|
-
color:
|
|
1221
|
+
color: t.text
|
|
1095
1222
|
}
|
|
1096
1223
|
},
|
|
1097
1224
|
"empowered.vote"
|
|
1098
1225
|
)
|
|
1099
|
-
), /* @__PURE__ */
|
|
1226
|
+
), /* @__PURE__ */ React3.createElement("nav", { style: styles2.nav, className: "ev-header-nav" }, navItems.map((item, idx) => /* @__PURE__ */ React3.createElement(NavLink, { key: idx, item }))), /* @__PURE__ */ React3.createElement("div", { style: { display: isMobile ? "none" : "flex", alignItems: "center", gap: spacing[3], flexShrink: 0 } }, secondaryAction && React3.isValidElement(secondaryAction) && secondaryAction, secondaryAction && !React3.isValidElement(secondaryAction) && /* @__PURE__ */ React3.createElement(
|
|
1100
1227
|
"a",
|
|
1101
1228
|
{
|
|
1102
1229
|
href: secondaryAction.href,
|
|
@@ -1110,16 +1237,16 @@ function Header({
|
|
|
1110
1237
|
style: styles2.secondaryAction,
|
|
1111
1238
|
className: "ev-header-secondary",
|
|
1112
1239
|
onMouseEnter: (e) => {
|
|
1113
|
-
e.currentTarget.style.backgroundColor =
|
|
1114
|
-
e.currentTarget.style.color = colors.textWhite;
|
|
1240
|
+
e.currentTarget.style.backgroundColor = t.text;
|
|
1241
|
+
e.currentTarget.style.color = darkMode ? t.surface : colors.textWhite;
|
|
1115
1242
|
},
|
|
1116
1243
|
onMouseLeave: (e) => {
|
|
1117
1244
|
e.currentTarget.style.backgroundColor = "transparent";
|
|
1118
|
-
e.currentTarget.style.color =
|
|
1245
|
+
e.currentTarget.style.color = t.text;
|
|
1119
1246
|
}
|
|
1120
1247
|
},
|
|
1121
1248
|
secondaryAction.label
|
|
1122
|
-
), ctaButton && /* @__PURE__ */
|
|
1249
|
+
), ctaButton && /* @__PURE__ */ React3.createElement(
|
|
1123
1250
|
"a",
|
|
1124
1251
|
{
|
|
1125
1252
|
href: ctaButton.href,
|
|
@@ -1127,14 +1254,14 @@ function Header({
|
|
|
1127
1254
|
style: styles2.ctaButton,
|
|
1128
1255
|
className: "ev-header-cta",
|
|
1129
1256
|
onMouseEnter: (e) => {
|
|
1130
|
-
e.target.style.backgroundColor =
|
|
1257
|
+
e.target.style.backgroundColor = t.ctaBgHover;
|
|
1131
1258
|
},
|
|
1132
1259
|
onMouseLeave: (e) => {
|
|
1133
|
-
e.target.style.backgroundColor =
|
|
1260
|
+
e.target.style.backgroundColor = t.ctaBg;
|
|
1134
1261
|
}
|
|
1135
1262
|
},
|
|
1136
1263
|
ctaButton.label
|
|
1137
|
-
), profileMenu && /* @__PURE__ */
|
|
1264
|
+
), profileMenu && /* @__PURE__ */ React3.createElement("div", { ref: profileRef, style: { position: "relative" } }, /* @__PURE__ */ React3.createElement(
|
|
1138
1265
|
"button",
|
|
1139
1266
|
{
|
|
1140
1267
|
style: styles2.profileButton,
|
|
@@ -1142,24 +1269,24 @@ function Header({
|
|
|
1142
1269
|
"aria-label": "Profile menu",
|
|
1143
1270
|
"aria-expanded": profileOpen
|
|
1144
1271
|
},
|
|
1145
|
-
/* @__PURE__ */
|
|
1272
|
+
/* @__PURE__ */ React3.createElement(
|
|
1146
1273
|
"svg",
|
|
1147
1274
|
{
|
|
1148
1275
|
width: "20",
|
|
1149
1276
|
height: "20",
|
|
1150
1277
|
viewBox: "0 0 24 24",
|
|
1151
1278
|
fill: "none",
|
|
1152
|
-
stroke:
|
|
1279
|
+
stroke: t.text,
|
|
1153
1280
|
strokeWidth: "2",
|
|
1154
1281
|
strokeLinecap: "round",
|
|
1155
1282
|
strokeLinejoin: "round"
|
|
1156
1283
|
},
|
|
1157
|
-
/* @__PURE__ */
|
|
1158
|
-
/* @__PURE__ */
|
|
1284
|
+
/* @__PURE__ */ React3.createElement("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }),
|
|
1285
|
+
/* @__PURE__ */ React3.createElement("circle", { cx: "12", cy: "7", r: "4" })
|
|
1159
1286
|
)
|
|
1160
|
-
), profileOpen && /* @__PURE__ */
|
|
1287
|
+
), profileOpen && /* @__PURE__ */ React3.createElement("div", { style: styles2.profileDropdown }, /* @__PURE__ */ React3.createElement("div", { style: styles2.profileDropdownInner }, profileMenu.label && /* @__PURE__ */ React3.createElement("div", { style: styles2.profileLabel }, profileMenu.label), profileMenu.items.map((item, idx) => {
|
|
1161
1288
|
if (item.href) {
|
|
1162
|
-
return /* @__PURE__ */
|
|
1289
|
+
return /* @__PURE__ */ React3.createElement(
|
|
1163
1290
|
"a",
|
|
1164
1291
|
{
|
|
1165
1292
|
key: idx,
|
|
@@ -1173,7 +1300,7 @@ function Header({
|
|
|
1173
1300
|
},
|
|
1174
1301
|
style: styles2.profileDropdownItem,
|
|
1175
1302
|
onMouseEnter: (e) => {
|
|
1176
|
-
e.target.style.backgroundColor =
|
|
1303
|
+
e.target.style.backgroundColor = t.hoverBg;
|
|
1177
1304
|
},
|
|
1178
1305
|
onMouseLeave: (e) => {
|
|
1179
1306
|
e.target.style.backgroundColor = "transparent";
|
|
@@ -1182,7 +1309,7 @@ function Header({
|
|
|
1182
1309
|
item.label
|
|
1183
1310
|
);
|
|
1184
1311
|
}
|
|
1185
|
-
return /* @__PURE__ */
|
|
1312
|
+
return /* @__PURE__ */ React3.createElement(
|
|
1186
1313
|
"button",
|
|
1187
1314
|
{
|
|
1188
1315
|
key: idx,
|
|
@@ -1193,7 +1320,7 @@ function Header({
|
|
|
1193
1320
|
},
|
|
1194
1321
|
style: styles2.profileDropdownItem,
|
|
1195
1322
|
onMouseEnter: (e) => {
|
|
1196
|
-
e.target.style.backgroundColor =
|
|
1323
|
+
e.target.style.backgroundColor = t.hoverBg;
|
|
1197
1324
|
},
|
|
1198
1325
|
onMouseLeave: (e) => {
|
|
1199
1326
|
e.target.style.backgroundColor = "transparent";
|
|
@@ -1201,7 +1328,7 @@ function Header({
|
|
|
1201
1328
|
},
|
|
1202
1329
|
item.label
|
|
1203
1330
|
);
|
|
1204
|
-
}))))), /* @__PURE__ */
|
|
1331
|
+
}))))), /* @__PURE__ */ React3.createElement(
|
|
1205
1332
|
"button",
|
|
1206
1333
|
{
|
|
1207
1334
|
style: styles2.mobileMenuButton,
|
|
@@ -1210,7 +1337,7 @@ function Header({
|
|
|
1210
1337
|
"aria-label": "Toggle menu",
|
|
1211
1338
|
"aria-expanded": mobileMenuOpen
|
|
1212
1339
|
},
|
|
1213
|
-
/* @__PURE__ */
|
|
1340
|
+
/* @__PURE__ */ React3.createElement("div", { style: styles2.hamburger }, /* @__PURE__ */ React3.createElement(
|
|
1214
1341
|
"span",
|
|
1215
1342
|
{
|
|
1216
1343
|
style: {
|
|
@@ -1219,10 +1346,10 @@ function Header({
|
|
|
1219
1346
|
left: 0,
|
|
1220
1347
|
width: "100%",
|
|
1221
1348
|
height: "2px",
|
|
1222
|
-
backgroundColor:
|
|
1349
|
+
backgroundColor: t.text
|
|
1223
1350
|
}
|
|
1224
1351
|
}
|
|
1225
|
-
), /* @__PURE__ */
|
|
1352
|
+
), /* @__PURE__ */ React3.createElement(
|
|
1226
1353
|
"span",
|
|
1227
1354
|
{
|
|
1228
1355
|
style: {
|
|
@@ -1231,13 +1358,13 @@ function Header({
|
|
|
1231
1358
|
left: 0,
|
|
1232
1359
|
width: "100%",
|
|
1233
1360
|
height: "2px",
|
|
1234
|
-
backgroundColor:
|
|
1361
|
+
backgroundColor: t.text
|
|
1235
1362
|
}
|
|
1236
1363
|
}
|
|
1237
1364
|
))
|
|
1238
|
-
)), /* @__PURE__ */
|
|
1365
|
+
)), /* @__PURE__ */ React3.createElement("div", { style: styles2.mobileMenu, className: "ev-header-mobile-menu" }, navItems.map((item, idx) => {
|
|
1239
1366
|
const hasDropdown = item.dropdown && item.dropdown.length > 0;
|
|
1240
|
-
return /* @__PURE__ */
|
|
1367
|
+
return /* @__PURE__ */ React3.createElement(React3.Fragment, { key: idx }, hasDropdown ? /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(
|
|
1241
1368
|
"span",
|
|
1242
1369
|
{
|
|
1243
1370
|
style: {
|
|
@@ -1247,7 +1374,7 @@ function Header({
|
|
|
1247
1374
|
}
|
|
1248
1375
|
},
|
|
1249
1376
|
item.label
|
|
1250
|
-
), item.dropdown.map((sub, subIdx) => /* @__PURE__ */
|
|
1377
|
+
), item.dropdown.map((sub, subIdx) => /* @__PURE__ */ React3.createElement(
|
|
1251
1378
|
"a",
|
|
1252
1379
|
{
|
|
1253
1380
|
key: subIdx,
|
|
@@ -1264,7 +1391,7 @@ function Header({
|
|
|
1264
1391
|
}
|
|
1265
1392
|
},
|
|
1266
1393
|
sub.label
|
|
1267
|
-
))) : /* @__PURE__ */
|
|
1394
|
+
))) : /* @__PURE__ */ React3.createElement(
|
|
1268
1395
|
"a",
|
|
1269
1396
|
{
|
|
1270
1397
|
href: item.href,
|
|
@@ -1276,7 +1403,7 @@ function Header({
|
|
|
1276
1403
|
},
|
|
1277
1404
|
item.label
|
|
1278
1405
|
));
|
|
1279
|
-
}), secondaryAction &&
|
|
1406
|
+
}), secondaryAction && React3.isValidElement(secondaryAction) && /* @__PURE__ */ React3.createElement("div", { style: { marginTop: spacing[4], textAlign: "center" } }, secondaryAction), secondaryAction && !React3.isValidElement(secondaryAction) && /* @__PURE__ */ React3.createElement(
|
|
1280
1407
|
"a",
|
|
1281
1408
|
{
|
|
1282
1409
|
href: secondaryAction.href,
|
|
@@ -1291,7 +1418,7 @@ function Header({
|
|
|
1291
1418
|
style: { ...styles2.secondaryAction, marginTop: spacing[4], textAlign: "center", justifyContent: "center" }
|
|
1292
1419
|
},
|
|
1293
1420
|
secondaryAction.label
|
|
1294
|
-
), ctaButton && /* @__PURE__ */
|
|
1421
|
+
), ctaButton && /* @__PURE__ */ React3.createElement(
|
|
1295
1422
|
"a",
|
|
1296
1423
|
{
|
|
1297
1424
|
href: ctaButton.href,
|
|
@@ -1302,14 +1429,14 @@ function Header({
|
|
|
1302
1429
|
style: { ...styles2.ctaButton, marginTop: spacing[4], textAlign: "center" }
|
|
1303
1430
|
},
|
|
1304
1431
|
ctaButton.label
|
|
1305
|
-
), profileMenu && /* @__PURE__ */
|
|
1432
|
+
), profileMenu && /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement("div", { style: styles2.mobileDivider }), profileMenu.label && /* @__PURE__ */ React3.createElement(
|
|
1306
1433
|
"span",
|
|
1307
1434
|
{
|
|
1308
1435
|
style: {
|
|
1309
1436
|
...styles2.mobileNavItem,
|
|
1310
1437
|
fontWeight: fontWeights.medium,
|
|
1311
1438
|
fontSize: fontSizes.sm,
|
|
1312
|
-
color:
|
|
1439
|
+
color: t.muted,
|
|
1313
1440
|
cursor: "default",
|
|
1314
1441
|
display: "block",
|
|
1315
1442
|
borderBottom: "none"
|
|
@@ -1318,7 +1445,7 @@ function Header({
|
|
|
1318
1445
|
profileMenu.label
|
|
1319
1446
|
), profileMenu.items.map((item, idx) => {
|
|
1320
1447
|
if (item.href) {
|
|
1321
|
-
return /* @__PURE__ */
|
|
1448
|
+
return /* @__PURE__ */ React3.createElement(
|
|
1322
1449
|
"a",
|
|
1323
1450
|
{
|
|
1324
1451
|
key: idx,
|
|
@@ -1335,7 +1462,7 @@ function Header({
|
|
|
1335
1462
|
item.label
|
|
1336
1463
|
);
|
|
1337
1464
|
}
|
|
1338
|
-
return /* @__PURE__ */
|
|
1465
|
+
return /* @__PURE__ */ React3.createElement(
|
|
1339
1466
|
"button",
|
|
1340
1467
|
{
|
|
1341
1468
|
key: idx,
|
|
@@ -1359,10 +1486,10 @@ function Header({
|
|
|
1359
1486
|
}
|
|
1360
1487
|
|
|
1361
1488
|
// src/SiteHeader.jsx
|
|
1362
|
-
import
|
|
1489
|
+
import React5 from "react";
|
|
1363
1490
|
|
|
1364
1491
|
// src/FeedbackButton.jsx
|
|
1365
|
-
import
|
|
1492
|
+
import React4 from "react";
|
|
1366
1493
|
var FEEDBACK_BASE_DEFAULT = "https://alpha.empowered.vote/feedback";
|
|
1367
1494
|
var HOST_FEATURE_MAP = {
|
|
1368
1495
|
"compass.empowered.vote": "compass",
|
|
@@ -1433,7 +1560,7 @@ function FeedbackButton({
|
|
|
1433
1560
|
cursor: "pointer"
|
|
1434
1561
|
};
|
|
1435
1562
|
const baseStyle = variant === "link" ? linkStyle2 : pillStyle;
|
|
1436
|
-
return /* @__PURE__ */
|
|
1563
|
+
return /* @__PURE__ */ React4.createElement(
|
|
1437
1564
|
"a",
|
|
1438
1565
|
{
|
|
1439
1566
|
href,
|
|
@@ -1469,10 +1596,17 @@ var defaultNavItems = [
|
|
|
1469
1596
|
{ label: "Find Representatives", href: "https://essentials.empowered.vote" },
|
|
1470
1597
|
{ label: "Read & Rank", href: "https://readrank.empowered.vote" },
|
|
1471
1598
|
{ label: "Treasury Tracker", href: "https://treasurytracker.empowered.vote" },
|
|
1599
|
+
{ label: "Civic Trivia", href: "https://ctc.empowered.vote" },
|
|
1472
1600
|
{ label: "Empowered Badges", href: "https://badges.empowered.vote" }
|
|
1473
1601
|
]
|
|
1474
1602
|
}
|
|
1475
1603
|
];
|
|
1604
|
+
var evAppLinks = [
|
|
1605
|
+
{ label: "Compass", href: "https://compass.empowered.vote" },
|
|
1606
|
+
{ label: "Find Representatives", href: "https://essentials.empowered.vote" },
|
|
1607
|
+
{ label: "Treasury Tracker", href: "https://treasurytracker.empowered.vote" },
|
|
1608
|
+
{ label: "Civic Trivia", href: "https://ctc.empowered.vote" }
|
|
1609
|
+
];
|
|
1476
1610
|
var defaultCtaButton = {
|
|
1477
1611
|
label: "Donate",
|
|
1478
1612
|
href: "https://empowered.vote/donate"
|
|
@@ -1497,11 +1631,11 @@ function SiteHeader({
|
|
|
1497
1631
|
if (secondaryAction === false) {
|
|
1498
1632
|
resolvedSecondary = void 0;
|
|
1499
1633
|
} else if (secondaryAction === void 0) {
|
|
1500
|
-
resolvedSecondary = /* @__PURE__ */
|
|
1634
|
+
resolvedSecondary = /* @__PURE__ */ React5.createElement(FeedbackButton, { feature: feedbackFeature });
|
|
1501
1635
|
} else {
|
|
1502
1636
|
resolvedSecondary = secondaryAction;
|
|
1503
1637
|
}
|
|
1504
|
-
return /* @__PURE__ */
|
|
1638
|
+
return /* @__PURE__ */ React5.createElement(
|
|
1505
1639
|
Header,
|
|
1506
1640
|
{
|
|
1507
1641
|
logoSrc,
|
|
@@ -1518,7 +1652,7 @@ function SiteHeader({
|
|
|
1518
1652
|
}
|
|
1519
1653
|
|
|
1520
1654
|
// src/FilterSidebar.jsx
|
|
1521
|
-
import
|
|
1655
|
+
import React6 from "react";
|
|
1522
1656
|
function FilterSidebar({
|
|
1523
1657
|
title = "Filter by",
|
|
1524
1658
|
zipCode = "",
|
|
@@ -1672,14 +1806,14 @@ function FilterSidebar({
|
|
|
1672
1806
|
fontSize: fontSizes.sm
|
|
1673
1807
|
}
|
|
1674
1808
|
};
|
|
1675
|
-
return /* @__PURE__ */
|
|
1809
|
+
return /* @__PURE__ */ React6.createElement("aside", { style: styles2.sidebar, className: "ev-filter-sidebar" }, !isMobile && /* @__PURE__ */ React6.createElement("h2", { style: styles2.title }, title), /* @__PURE__ */ React6.createElement("div", { style: isMobile ? void 0 : styles2.contentTop }, /* @__PURE__ */ React6.createElement("div", { style: isMobile ? { marginBottom: spacing[3] } : styles2.section }, !isMobile && /* @__PURE__ */ React6.createElement("label", { style: styles2.sectionLabel }, "Location"), autocompleteContainerRef ? /* @__PURE__ */ React6.createElement(
|
|
1676
1810
|
"div",
|
|
1677
1811
|
{
|
|
1678
1812
|
ref: autocompleteContainerRef,
|
|
1679
1813
|
style: styles2.zipInputWrapper,
|
|
1680
1814
|
className: "ev-autocomplete-container"
|
|
1681
1815
|
}
|
|
1682
|
-
) : /* @__PURE__ */
|
|
1816
|
+
) : /* @__PURE__ */ React6.createElement("div", { style: styles2.zipInputWrapper }, /* @__PURE__ */ React6.createElement(
|
|
1683
1817
|
"input",
|
|
1684
1818
|
{
|
|
1685
1819
|
ref: zipInputRef,
|
|
@@ -1691,7 +1825,7 @@ function FilterSidebar({
|
|
|
1691
1825
|
style: styles2.zipInput,
|
|
1692
1826
|
"aria-label": "Search location"
|
|
1693
1827
|
}
|
|
1694
|
-
), /* @__PURE__ */
|
|
1828
|
+
), /* @__PURE__ */ React6.createElement(
|
|
1695
1829
|
"button",
|
|
1696
1830
|
{
|
|
1697
1831
|
type: "button",
|
|
@@ -1700,7 +1834,7 @@ function FilterSidebar({
|
|
|
1700
1834
|
"aria-label": "Clear ZIP code"
|
|
1701
1835
|
},
|
|
1702
1836
|
"\xD7"
|
|
1703
|
-
))), /* @__PURE__ */
|
|
1837
|
+
))), /* @__PURE__ */ React6.createElement("div", { style: isMobile ? {} : styles2.section }, !isMobile && /* @__PURE__ */ React6.createElement("label", { style: styles2.sectionLabel }, "Group"), /* @__PURE__ */ React6.createElement("div", { style: styles2.radioGroup, role: "radiogroup", "aria-label": "Filter by group" }, filterOptions.map((option) => /* @__PURE__ */ React6.createElement("label", { key: option.value, style: styles2.radioLabel }, /* @__PURE__ */ React6.createElement(
|
|
1704
1838
|
"input",
|
|
1705
1839
|
{
|
|
1706
1840
|
type: "radio",
|
|
@@ -1710,18 +1844,18 @@ function FilterSidebar({
|
|
|
1710
1844
|
onChange: () => onFilterChange == null ? void 0 : onFilterChange(option.value),
|
|
1711
1845
|
style: styles2.radioInput
|
|
1712
1846
|
}
|
|
1713
|
-
), option.label))))), !isMobile && /* @__PURE__ */
|
|
1847
|
+
), option.label))))), !isMobile && /* @__PURE__ */ React6.createElement("div", { style: styles2.imageSection }, locationLabel && /* @__PURE__ */ React6.createElement("div", { style: styles2.locationLabel }, locationLabel), buildingImageSrc ? /* @__PURE__ */ React6.createElement(
|
|
1714
1848
|
"img",
|
|
1715
1849
|
{
|
|
1716
1850
|
src: buildingImageSrc,
|
|
1717
1851
|
alt: `${selectedFilter} government building`,
|
|
1718
1852
|
style: styles2.buildingImage
|
|
1719
1853
|
}
|
|
1720
|
-
) : /* @__PURE__ */
|
|
1854
|
+
) : /* @__PURE__ */ React6.createElement("div", { style: styles2.buildingPlaceholder }, "No image")));
|
|
1721
1855
|
}
|
|
1722
1856
|
|
|
1723
1857
|
// src/PoliticianCard.jsx
|
|
1724
|
-
import
|
|
1858
|
+
import React7, { useState as useState4, useEffect as useEffect5 } from "react";
|
|
1725
1859
|
function PoliticianCard({
|
|
1726
1860
|
id,
|
|
1727
1861
|
imageSrc,
|
|
@@ -1873,7 +2007,7 @@ function PoliticianCard({
|
|
|
1873
2007
|
textTransform: "uppercase"
|
|
1874
2008
|
}
|
|
1875
2009
|
};
|
|
1876
|
-
const CompassIcon2 = () => /* @__PURE__ */
|
|
2010
|
+
const CompassIcon2 = () => /* @__PURE__ */ React7.createElement(
|
|
1877
2011
|
"svg",
|
|
1878
2012
|
{
|
|
1879
2013
|
style: styles2.compassIcon,
|
|
@@ -1881,7 +2015,7 @@ function PoliticianCard({
|
|
|
1881
2015
|
fill: "none",
|
|
1882
2016
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1883
2017
|
},
|
|
1884
|
-
/* @__PURE__ */
|
|
2018
|
+
/* @__PURE__ */ React7.createElement(
|
|
1885
2019
|
"polygon",
|
|
1886
2020
|
{
|
|
1887
2021
|
points: "12,1 21.5,6.5 21.5,17.5 12,23 2.5,17.5 2.5,6.5",
|
|
@@ -1891,13 +2025,13 @@ function PoliticianCard({
|
|
|
1891
2025
|
strokeLinejoin: "round"
|
|
1892
2026
|
}
|
|
1893
2027
|
),
|
|
1894
|
-
/* @__PURE__ */
|
|
1895
|
-
/* @__PURE__ */
|
|
1896
|
-
/* @__PURE__ */
|
|
1897
|
-
/* @__PURE__ */
|
|
1898
|
-
/* @__PURE__ */
|
|
1899
|
-
/* @__PURE__ */
|
|
1900
|
-
/* @__PURE__ */
|
|
2028
|
+
/* @__PURE__ */ React7.createElement("line", { x1: "12", y1: "12", x2: "12", y2: "1", stroke: "currentColor", strokeWidth: "1" }),
|
|
2029
|
+
/* @__PURE__ */ React7.createElement("line", { x1: "12", y1: "12", x2: "21.5", y2: "6.5", stroke: "currentColor", strokeWidth: "1" }),
|
|
2030
|
+
/* @__PURE__ */ React7.createElement("line", { x1: "12", y1: "12", x2: "21.5", y2: "17.5", stroke: "currentColor", strokeWidth: "1" }),
|
|
2031
|
+
/* @__PURE__ */ React7.createElement("line", { x1: "12", y1: "12", x2: "12", y2: "23", stroke: "currentColor", strokeWidth: "1" }),
|
|
2032
|
+
/* @__PURE__ */ React7.createElement("line", { x1: "12", y1: "12", x2: "2.5", y2: "17.5", stroke: "currentColor", strokeWidth: "1" }),
|
|
2033
|
+
/* @__PURE__ */ React7.createElement("line", { x1: "12", y1: "12", x2: "2.5", y2: "6.5", stroke: "currentColor", strokeWidth: "1" }),
|
|
2034
|
+
/* @__PURE__ */ React7.createElement(
|
|
1901
2035
|
"polygon",
|
|
1902
2036
|
{
|
|
1903
2037
|
points: "12,4 18,7.5 18,16 12,19.5 7,15 5,8",
|
|
@@ -1905,7 +2039,7 @@ function PoliticianCard({
|
|
|
1905
2039
|
opacity: "0.35"
|
|
1906
2040
|
}
|
|
1907
2041
|
),
|
|
1908
|
-
/* @__PURE__ */
|
|
2042
|
+
/* @__PURE__ */ React7.createElement(
|
|
1909
2043
|
"polygon",
|
|
1910
2044
|
{
|
|
1911
2045
|
points: "12,4 18,7.5 18,16 12,19.5 7,15 5,8",
|
|
@@ -1926,7 +2060,7 @@ function PoliticianCard({
|
|
|
1926
2060
|
const initials = parts.length >= 2 ? parts[0][0] + parts[parts.length - 1][0] : ((_a = parts[0]) == null ? void 0 : _a[0]) || "?";
|
|
1927
2061
|
return initials.toUpperCase();
|
|
1928
2062
|
};
|
|
1929
|
-
return /* @__PURE__ */
|
|
2063
|
+
return /* @__PURE__ */ React7.createElement(
|
|
1930
2064
|
"div",
|
|
1931
2065
|
{
|
|
1932
2066
|
style: styles2.card,
|
|
@@ -1951,8 +2085,8 @@ function PoliticianCard({
|
|
|
1951
2085
|
}
|
|
1952
2086
|
}
|
|
1953
2087
|
},
|
|
1954
|
-
badge && /* @__PURE__ */
|
|
1955
|
-
/* @__PURE__ */
|
|
2088
|
+
badge && /* @__PURE__ */ React7.createElement("span", { style: styles2.badge }, badge),
|
|
2089
|
+
/* @__PURE__ */ React7.createElement("div", { style: styles2.imageWrapper }, imageSrc && !imgError ? /* @__PURE__ */ React7.createElement(
|
|
1956
2090
|
"img",
|
|
1957
2091
|
{
|
|
1958
2092
|
src: imageSrc,
|
|
@@ -1960,9 +2094,9 @@ function PoliticianCard({
|
|
|
1960
2094
|
style: styles2.image,
|
|
1961
2095
|
onError: () => setImgError(true)
|
|
1962
2096
|
}
|
|
1963
|
-
) : /* @__PURE__ */
|
|
1964
|
-
/* @__PURE__ */
|
|
1965
|
-
onCompassClick && /* @__PURE__ */
|
|
2097
|
+
) : /* @__PURE__ */ React7.createElement("div", { style: styles2.imagePlaceholder }, getInitials(name))),
|
|
2098
|
+
/* @__PURE__ */ React7.createElement("div", { style: styles2.content }, /* @__PURE__ */ React7.createElement("h3", { style: styles2.name }, name), /* @__PURE__ */ React7.createElement("p", { style: styles2.title }, title), subtitle && /* @__PURE__ */ React7.createElement("p", { style: styles2.subtitle }, subtitle), footer && /* @__PURE__ */ React7.createElement("div", { style: { marginTop: "auto", marginLeft: "-5px" } }, footer)),
|
|
2099
|
+
onCompassClick && /* @__PURE__ */ React7.createElement(
|
|
1966
2100
|
"button",
|
|
1967
2101
|
{
|
|
1968
2102
|
type: "button",
|
|
@@ -1977,7 +2111,7 @@ function PoliticianCard({
|
|
|
1977
2111
|
},
|
|
1978
2112
|
"aria-label": `View ${name}'s compass`
|
|
1979
2113
|
},
|
|
1980
|
-
/* @__PURE__ */
|
|
2114
|
+
/* @__PURE__ */ React7.createElement(CompassIcon2, null)
|
|
1981
2115
|
)
|
|
1982
2116
|
);
|
|
1983
2117
|
}
|
|
@@ -1985,83 +2119,6 @@ function PoliticianCard({
|
|
|
1985
2119
|
// src/CompassCardHorizontal.jsx
|
|
1986
2120
|
import React11, { useState as useState6, useEffect as useEffect6 } from "react";
|
|
1987
2121
|
|
|
1988
|
-
// src/PlaceholderRadar.jsx
|
|
1989
|
-
import React7 from "react";
|
|
1990
|
-
function PlaceholderRadar({ size = 250, name = "" }) {
|
|
1991
|
-
const cx = size / 2;
|
|
1992
|
-
const cy = size / 2;
|
|
1993
|
-
const r = size / 2 * 0.65;
|
|
1994
|
-
const n = 8;
|
|
1995
|
-
const vertices = Array.from({ length: n }, (_, i) => {
|
|
1996
|
-
const a = 2 * Math.PI * i / n;
|
|
1997
|
-
return [cx + r * Math.sin(a), cy - r * Math.cos(a)];
|
|
1998
|
-
});
|
|
1999
|
-
const outerPts = vertices.map(([x, y]) => `${x},${y}`).join(" ");
|
|
2000
|
-
const midPts = vertices.map(([x, y]) => `${cx + (x - cx) * 0.6},${cy + (y - cy) * 0.6}`).join(" ");
|
|
2001
|
-
const innerPts = vertices.map(([x, y]) => `${cx + (x - cx) * 0.3},${cy + (y - cy) * 0.3}`).join(" ");
|
|
2002
|
-
return /* @__PURE__ */ React7.createElement(
|
|
2003
|
-
"svg",
|
|
2004
|
-
{
|
|
2005
|
-
width: size,
|
|
2006
|
-
height: size,
|
|
2007
|
-
viewBox: `0 0 ${size} ${size}`,
|
|
2008
|
-
role: "img",
|
|
2009
|
-
"aria-label": name ? `${name} \u2014 compass data unavailable` : "compass data unavailable",
|
|
2010
|
-
style: {
|
|
2011
|
-
backgroundColor: colorScales.teal["050"],
|
|
2012
|
-
borderRadius: borderRadius.sm,
|
|
2013
|
-
flexShrink: 0
|
|
2014
|
-
}
|
|
2015
|
-
},
|
|
2016
|
-
vertices.map(([x, y], i) => /* @__PURE__ */ React7.createElement(
|
|
2017
|
-
"line",
|
|
2018
|
-
{
|
|
2019
|
-
key: i,
|
|
2020
|
-
x1: cx,
|
|
2021
|
-
y1: cy,
|
|
2022
|
-
x2: x,
|
|
2023
|
-
y2: y,
|
|
2024
|
-
stroke: colorScales.gray["200"],
|
|
2025
|
-
strokeWidth: "1",
|
|
2026
|
-
strokeDasharray: "2 3",
|
|
2027
|
-
opacity: "0.6"
|
|
2028
|
-
}
|
|
2029
|
-
)),
|
|
2030
|
-
/* @__PURE__ */ React7.createElement(
|
|
2031
|
-
"polygon",
|
|
2032
|
-
{
|
|
2033
|
-
points: innerPts,
|
|
2034
|
-
fill: "none",
|
|
2035
|
-
stroke: colorScales.gray["200"],
|
|
2036
|
-
strokeWidth: "1",
|
|
2037
|
-
strokeDasharray: "2 3",
|
|
2038
|
-
opacity: "0.5"
|
|
2039
|
-
}
|
|
2040
|
-
),
|
|
2041
|
-
/* @__PURE__ */ React7.createElement(
|
|
2042
|
-
"polygon",
|
|
2043
|
-
{
|
|
2044
|
-
points: midPts,
|
|
2045
|
-
fill: "none",
|
|
2046
|
-
stroke: colorScales.gray["200"],
|
|
2047
|
-
strokeWidth: "1",
|
|
2048
|
-
strokeDasharray: "3 3",
|
|
2049
|
-
opacity: "0.6"
|
|
2050
|
-
}
|
|
2051
|
-
),
|
|
2052
|
-
/* @__PURE__ */ React7.createElement(
|
|
2053
|
-
"polygon",
|
|
2054
|
-
{
|
|
2055
|
-
points: outerPts,
|
|
2056
|
-
fill: "none",
|
|
2057
|
-
stroke: colorScales.gray["200"],
|
|
2058
|
-
strokeWidth: "1.5",
|
|
2059
|
-
strokeDasharray: "4 3"
|
|
2060
|
-
}
|
|
2061
|
-
)
|
|
2062
|
-
);
|
|
2063
|
-
}
|
|
2064
|
-
|
|
2065
2122
|
// src/CompassCardHorizontalMeta.jsx
|
|
2066
2123
|
import React10 from "react";
|
|
2067
2124
|
|
|
@@ -6160,14 +6217,78 @@ function getDisplayUrl(url) {
|
|
|
6160
6217
|
return url.length > 60 ? url.slice(0, 57) + "..." : url;
|
|
6161
6218
|
}
|
|
6162
6219
|
}
|
|
6220
|
+
var USER_DOT = "#7C6B9E";
|
|
6221
|
+
var POL_DOT_LIGHT = "#5A9A6E";
|
|
6222
|
+
var POL_DOT_DARK = "#6DD28C";
|
|
6223
|
+
function palette(darkMode) {
|
|
6224
|
+
return darkMode ? {
|
|
6225
|
+
rowBorder: "rgba(255,255,255,0.08)",
|
|
6226
|
+
rowHover: "#1e2a3a",
|
|
6227
|
+
// ev-navy-elevated
|
|
6228
|
+
title: "#f3f4f6",
|
|
6229
|
+
chipLabel: "#d1d5db",
|
|
6230
|
+
sectionLabel: "#9ca3af",
|
|
6231
|
+
// 6.24:1 on #1a2235 ✓ AA
|
|
6232
|
+
reasoning: "#d1d5db",
|
|
6233
|
+
chevron: "#9ca3af",
|
|
6234
|
+
// 6.24:1 — bumped from #6b7280 (3.28) for clarity
|
|
6235
|
+
pillActiveBg: "#1e2a3a",
|
|
6236
|
+
pillActiveBorder: "rgba(255,255,255,0.14)",
|
|
6237
|
+
pillIdleText: "#9ca3af",
|
|
6238
|
+
// 6.24:1 ✓ AA
|
|
6239
|
+
pillActiveText: "#f3f4f6",
|
|
6240
|
+
link: "#59b0c4",
|
|
6241
|
+
// 6.37:1 ✓ AA
|
|
6242
|
+
sourceText: "#9ca3af",
|
|
6243
|
+
quoteText: "#d1d5db",
|
|
6244
|
+
quoteBorder: "rgba(255,255,255,0.14)",
|
|
6245
|
+
emptyText: "#9ca3af",
|
|
6246
|
+
// 6.24:1 — bumped from #6b7280 (3.28, failed AA)
|
|
6247
|
+
spinnerTrack: "#374151",
|
|
6248
|
+
polDot: POL_DOT_DARK,
|
|
6249
|
+
agreedBg: "rgba(14,116,144,0.18)",
|
|
6250
|
+
agreedText: "#67e8f9",
|
|
6251
|
+
disagreedBg: "rgba(180,83,9,0.18)",
|
|
6252
|
+
disagreedText: "#fbbf24"
|
|
6253
|
+
} : {
|
|
6254
|
+
rowBorder: "#f1f1f1",
|
|
6255
|
+
rowHover: "#f9fafb",
|
|
6256
|
+
title: "#262626",
|
|
6257
|
+
chipLabel: "#525252",
|
|
6258
|
+
sectionLabel: "#6b7280",
|
|
6259
|
+
// 4.83:1 on white — bumped from #a3a3a3 (2.52, failed AA)
|
|
6260
|
+
reasoning: "#404040",
|
|
6261
|
+
chevron: "#6b7280",
|
|
6262
|
+
// 4.83:1 — bumped from #a3a3a3 (2.52, failed 3:1)
|
|
6263
|
+
pillActiveBg: "#fafafa",
|
|
6264
|
+
pillActiveBorder: "#e5e5e5",
|
|
6265
|
+
pillIdleText: "#737373",
|
|
6266
|
+
// 4.74:1 ✓ AA
|
|
6267
|
+
pillActiveText: "#171717",
|
|
6268
|
+
link: "#00657c",
|
|
6269
|
+
sourceText: "#737373",
|
|
6270
|
+
quoteText: "#374151",
|
|
6271
|
+
quoteBorder: "#e2e8f0",
|
|
6272
|
+
emptyText: "#6b7280",
|
|
6273
|
+
// 4.83:1 — bumped from #a3a3a3 (2.52, failed AA)
|
|
6274
|
+
spinnerTrack: "#e2e8f0",
|
|
6275
|
+
polDot: POL_DOT_LIGHT,
|
|
6276
|
+
agreedBg: "#ecfeff",
|
|
6277
|
+
agreedText: "#0e7490",
|
|
6278
|
+
disagreedBg: "#fffbeb",
|
|
6279
|
+
disagreedText: "#b45309"
|
|
6280
|
+
};
|
|
6281
|
+
}
|
|
6163
6282
|
function StanceAccordion({
|
|
6164
6283
|
topics,
|
|
6165
6284
|
polAnswers,
|
|
6285
|
+
userAnswerMap = {},
|
|
6166
6286
|
politicianId,
|
|
6167
6287
|
allTopics,
|
|
6168
6288
|
expandedTopics,
|
|
6289
|
+
darkMode = false,
|
|
6169
6290
|
verdictsByTopic,
|
|
6170
|
-
//
|
|
6291
|
+
// DEPRECATED, no longer rendered
|
|
6171
6292
|
verdictsByQuote,
|
|
6172
6293
|
// Record<quote_id, 'agreed' | 'disagreed'> | undefined
|
|
6173
6294
|
initialExpandedTopicId,
|
|
@@ -6179,6 +6300,7 @@ function StanceAccordion({
|
|
|
6179
6300
|
const [showAll, setShowAll] = useState17(false);
|
|
6180
6301
|
const contextCache = useRef4(/* @__PURE__ */ new Map());
|
|
6181
6302
|
const quotesCache = useRef4(null);
|
|
6303
|
+
const c = palette(darkMode);
|
|
6182
6304
|
const polAnswerMap = {};
|
|
6183
6305
|
if (polAnswers) {
|
|
6184
6306
|
polAnswers.forEach((a) => {
|
|
@@ -6270,201 +6392,314 @@ function StanceAccordion({
|
|
|
6270
6392
|
visibleTopics = [pinned, ...baseTopics.filter((t) => String(t.id) !== String(initialExpandedTopicId))];
|
|
6271
6393
|
}
|
|
6272
6394
|
}
|
|
6395
|
+
const sectionLabelStyle = {
|
|
6396
|
+
fontSize: "11px",
|
|
6397
|
+
fontWeight: 600,
|
|
6398
|
+
color: c.sectionLabel,
|
|
6399
|
+
textTransform: "uppercase",
|
|
6400
|
+
letterSpacing: "0.06em"
|
|
6401
|
+
};
|
|
6273
6402
|
return /* @__PURE__ */ React30.createElement(
|
|
6274
6403
|
"div",
|
|
6275
6404
|
{
|
|
6276
|
-
className: "flex flex-col",
|
|
6405
|
+
className: "ev-stance-panel flex flex-col",
|
|
6277
6406
|
style: { fontFamily: "'Manrope', sans-serif" }
|
|
6278
6407
|
},
|
|
6279
|
-
/* @__PURE__ */ React30.createElement(
|
|
6280
|
-
"h3",
|
|
6281
|
-
{
|
|
6282
|
-
className: "text-sm font-semibold text-neutral-400 uppercase tracking-wider mb-2",
|
|
6283
|
-
style: { fontSize: "12px" }
|
|
6284
|
-
},
|
|
6285
|
-
"Stance Breakdown"
|
|
6286
|
-
),
|
|
6408
|
+
/* @__PURE__ */ React30.createElement("h3", { style: { ...sectionLabelStyle, marginBottom: "8px" } }, "Stance Breakdown"),
|
|
6287
6409
|
visibleTopics.map((topic) => {
|
|
6288
6410
|
const topicId = String(topic.id);
|
|
6289
|
-
const
|
|
6290
|
-
const
|
|
6411
|
+
const polValue = polAnswerMap[topicId];
|
|
6412
|
+
const userValue = userAnswerMap[topicId];
|
|
6413
|
+
const label = getStanceLabel(topicId, polValue);
|
|
6291
6414
|
const isExpanded = expandedTopicId === topicId;
|
|
6292
6415
|
const isLoading = loadingId === topicId;
|
|
6293
6416
|
const cached = contextCache.current.get(topicId);
|
|
6294
6417
|
const fullTopic = topicById[topicId];
|
|
6295
6418
|
const questionText = fullTopic == null ? void 0 : fullTopic.question_text;
|
|
6419
|
+
const titleText = questionText || topic.short_title;
|
|
6420
|
+
const stances = (fullTopic == null ? void 0 : fullTopic.stances) || topic.stances || [];
|
|
6296
6421
|
const topicQuotes = quotesCache.current ? quotesCache.current.filter((q) => {
|
|
6297
6422
|
if (!q.issue) return false;
|
|
6298
6423
|
if (q.candidateId && q.candidateId !== politicianId) return false;
|
|
6299
6424
|
if (topic.topic_key) return q.issue === topic.topic_key;
|
|
6300
6425
|
return topic.short_title && q.issue.toLowerCase() === topic.short_title.toLowerCase();
|
|
6301
6426
|
}) : [];
|
|
6302
|
-
return /* @__PURE__ */ React30.createElement(
|
|
6303
|
-
"
|
|
6427
|
+
return /* @__PURE__ */ React30.createElement(
|
|
6428
|
+
"div",
|
|
6304
6429
|
{
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
className: "w-full flex items-center justify-between py-3 px-2 text-left cursor-pointer hover:bg-neutral-50 transition-colors"
|
|
6430
|
+
key: topicId,
|
|
6431
|
+
style: { borderBottom: `1px solid ${c.rowBorder}` }
|
|
6308
6432
|
},
|
|
6309
|
-
/* @__PURE__ */ React30.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ React30.createElement("span", { className: "text-sm font-medium text-neutral-800 truncate" }, topic.short_title), questionText && /* @__PURE__ */ React30.createElement("span", { className: "text-xs text-neutral-400 mt-0.5" }, questionText), /* @__PURE__ */ React30.createElement("span", { className: "text-xs text-neutral-500 mt-0.5" }, label)),
|
|
6310
6433
|
/* @__PURE__ */ React30.createElement(
|
|
6311
|
-
"
|
|
6434
|
+
"button",
|
|
6312
6435
|
{
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
fill: "none",
|
|
6317
|
-
stroke: "currentColor",
|
|
6318
|
-
strokeWidth: "2",
|
|
6319
|
-
strokeLinecap: "round",
|
|
6320
|
-
strokeLinejoin: "round",
|
|
6321
|
-
className: "text-neutral-400 flex-shrink-0 ml-2",
|
|
6436
|
+
type: "button",
|
|
6437
|
+
onClick: () => handleToggle(topicId),
|
|
6438
|
+
className: "w-full flex items-start justify-between text-left cursor-pointer",
|
|
6322
6439
|
style: {
|
|
6323
|
-
|
|
6324
|
-
|
|
6440
|
+
padding: "12px 8px",
|
|
6441
|
+
background: "transparent",
|
|
6442
|
+
border: "none",
|
|
6443
|
+
transition: "background 0.15s ease",
|
|
6444
|
+
borderRadius: "8px"
|
|
6445
|
+
},
|
|
6446
|
+
onMouseEnter: (e) => {
|
|
6447
|
+
e.currentTarget.style.background = c.rowHover;
|
|
6448
|
+
},
|
|
6449
|
+
onMouseLeave: (e) => {
|
|
6450
|
+
e.currentTarget.style.background = "transparent";
|
|
6325
6451
|
}
|
|
6326
6452
|
},
|
|
6327
|
-
/* @__PURE__ */ React30.createElement("
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
6453
|
+
/* @__PURE__ */ React30.createElement("div", { className: "flex flex-col min-w-0", style: { gap: "5px" } }, /* @__PURE__ */ React30.createElement(
|
|
6454
|
+
"span",
|
|
6455
|
+
{
|
|
6456
|
+
style: {
|
|
6457
|
+
fontSize: "14px",
|
|
6458
|
+
fontWeight: 600,
|
|
6459
|
+
color: c.title,
|
|
6460
|
+
lineHeight: 1.4
|
|
6461
|
+
}
|
|
6462
|
+
},
|
|
6463
|
+
titleText
|
|
6464
|
+
), /* @__PURE__ */ React30.createElement("span", { style: { display: "flex", alignItems: "flex-start", gap: "8px" } }, /* @__PURE__ */ React30.createElement(
|
|
6465
|
+
"span",
|
|
6466
|
+
{
|
|
6467
|
+
style: {
|
|
6468
|
+
width: "8px",
|
|
6469
|
+
height: "8px",
|
|
6470
|
+
borderRadius: "50%",
|
|
6471
|
+
backgroundColor: c.polDot,
|
|
6472
|
+
flexShrink: 0,
|
|
6473
|
+
marginTop: "6px"
|
|
6474
|
+
}
|
|
6348
6475
|
}
|
|
6349
|
-
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
|
|
6353
|
-
|
|
6354
|
-
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
|
|
6358
|
-
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6476
|
+
), /* @__PURE__ */ React30.createElement(
|
|
6477
|
+
"span",
|
|
6478
|
+
{
|
|
6479
|
+
style: {
|
|
6480
|
+
fontSize: "13px",
|
|
6481
|
+
color: c.chipLabel,
|
|
6482
|
+
lineHeight: 1.45
|
|
6483
|
+
}
|
|
6484
|
+
},
|
|
6485
|
+
label
|
|
6486
|
+
))),
|
|
6487
|
+
/* @__PURE__ */ React30.createElement(
|
|
6488
|
+
"svg",
|
|
6489
|
+
{
|
|
6490
|
+
width: "16",
|
|
6491
|
+
height: "16",
|
|
6492
|
+
viewBox: "0 0 24 24",
|
|
6493
|
+
fill: "none",
|
|
6494
|
+
stroke: c.chevron,
|
|
6495
|
+
strokeWidth: "2",
|
|
6496
|
+
strokeLinecap: "round",
|
|
6497
|
+
strokeLinejoin: "round",
|
|
6498
|
+
className: "flex-shrink-0 ml-2",
|
|
6499
|
+
style: {
|
|
6500
|
+
marginTop: "3px",
|
|
6501
|
+
transform: isExpanded ? "rotate(90deg)" : "rotate(0deg)",
|
|
6502
|
+
transition: "transform 0.2s ease"
|
|
6503
|
+
}
|
|
6504
|
+
},
|
|
6505
|
+
/* @__PURE__ */ React30.createElement("polyline", { points: "9 18 15 12 9 6" })
|
|
6506
|
+
)
|
|
6507
|
+
),
|
|
6508
|
+
/* @__PURE__ */ React30.createElement(
|
|
6509
|
+
"div",
|
|
6369
6510
|
{
|
|
6370
6511
|
style: {
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
textTransform: "uppercase",
|
|
6375
|
-
letterSpacing: "0.05em",
|
|
6376
|
-
marginBottom: "8px"
|
|
6512
|
+
display: "grid",
|
|
6513
|
+
gridTemplateRows: isExpanded ? "1fr" : "0fr",
|
|
6514
|
+
transition: "grid-template-rows 0.25s ease"
|
|
6377
6515
|
}
|
|
6378
6516
|
},
|
|
6379
|
-
"
|
|
6380
|
-
), topicQuotes.map((quote) => {
|
|
6381
|
-
const verdict = verdictsByQuote ? verdictsByQuote[quote.id] : void 0;
|
|
6382
|
-
const borderColor = verdict === "agreed" ? "#0e7490" : verdict === "disagreed" ? "#b45309" : "#e2e8f0";
|
|
6383
|
-
const sourceName = quote.source_name || quote.sourceName;
|
|
6384
|
-
return /* @__PURE__ */ React30.createElement(
|
|
6517
|
+
/* @__PURE__ */ React30.createElement("div", { style: { overflow: "hidden" } }, /* @__PURE__ */ React30.createElement("div", { style: { padding: "4px 8px 16px" } }, stances.length > 0 && /* @__PURE__ */ React30.createElement(React30.Fragment, null, (userValue > 0 || polValue > 0) && /* @__PURE__ */ React30.createElement(
|
|
6385
6518
|
"div",
|
|
6386
6519
|
{
|
|
6387
|
-
key: quote.id,
|
|
6388
6520
|
style: {
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6521
|
+
display: "flex",
|
|
6522
|
+
alignItems: "center",
|
|
6523
|
+
gap: "14px",
|
|
6524
|
+
marginBottom: "8px",
|
|
6525
|
+
fontSize: "12px",
|
|
6526
|
+
color: c.sourceText
|
|
6394
6527
|
}
|
|
6395
6528
|
},
|
|
6396
|
-
/* @__PURE__ */ React30.createElement(
|
|
6397
|
-
|
|
6529
|
+
userValue > 0 && /* @__PURE__ */ React30.createElement("span", { style: { display: "inline-flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React30.createElement("span", { style: { width: "9px", height: "9px", borderRadius: "50%", backgroundColor: USER_DOT } }), "You"),
|
|
6530
|
+
/* @__PURE__ */ React30.createElement("span", { style: { display: "inline-flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ React30.createElement("span", { style: { width: "9px", height: "9px", borderRadius: "50%", backgroundColor: c.polDot } }), "Their stance")
|
|
6531
|
+
), /* @__PURE__ */ React30.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "6px", marginBottom: "14px" } }, stances.map((stance, i) => {
|
|
6532
|
+
const stanceNum = i + 1;
|
|
6533
|
+
const isUser = userValue === stanceNum;
|
|
6534
|
+
const isPol = polValue === stanceNum;
|
|
6535
|
+
const isActive = isUser || isPol;
|
|
6536
|
+
return /* @__PURE__ */ React30.createElement(
|
|
6537
|
+
"div",
|
|
6398
6538
|
{
|
|
6539
|
+
key: i,
|
|
6399
6540
|
style: {
|
|
6541
|
+
display: "flex",
|
|
6542
|
+
alignItems: "flex-start",
|
|
6543
|
+
gap: "10px",
|
|
6544
|
+
padding: "10px 12px",
|
|
6545
|
+
borderRadius: "12px",
|
|
6400
6546
|
fontSize: "13px",
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
lineHeight: 1.5
|
|
6405
|
-
}
|
|
6406
|
-
},
|
|
6407
|
-
quote.text
|
|
6408
|
-
),
|
|
6409
|
-
verdict === "agreed" && /* @__PURE__ */ React30.createElement(
|
|
6410
|
-
"span",
|
|
6411
|
-
{
|
|
6412
|
-
style: {
|
|
6413
|
-
display: "inline-flex",
|
|
6414
|
-
alignItems: "center",
|
|
6415
|
-
gap: "4px",
|
|
6416
|
-
backgroundColor: "#ecfeff",
|
|
6417
|
-
color: "#0e7490",
|
|
6418
|
-
padding: "2px 8px",
|
|
6419
|
-
borderRadius: "9999px",
|
|
6420
|
-
fontSize: "11px",
|
|
6421
|
-
fontWeight: 500,
|
|
6422
|
-
marginTop: "4px",
|
|
6423
|
-
flexShrink: 0
|
|
6424
|
-
}
|
|
6425
|
-
},
|
|
6426
|
-
/* @__PURE__ */ React30.createElement("svg", { width: "11", height: "11", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React30.createElement("path", { d: "M5 13l4 4L19 7" })),
|
|
6427
|
-
"Agreed"
|
|
6428
|
-
),
|
|
6429
|
-
verdict === "disagreed" && /* @__PURE__ */ React30.createElement(
|
|
6430
|
-
"span",
|
|
6431
|
-
{
|
|
6432
|
-
style: {
|
|
6433
|
-
display: "inline-flex",
|
|
6434
|
-
alignItems: "center",
|
|
6435
|
-
gap: "4px",
|
|
6436
|
-
backgroundColor: "#fffbeb",
|
|
6437
|
-
color: "#b45309",
|
|
6438
|
-
padding: "2px 8px",
|
|
6439
|
-
borderRadius: "9999px",
|
|
6440
|
-
fontSize: "11px",
|
|
6441
|
-
fontWeight: 500,
|
|
6442
|
-
marginTop: "4px",
|
|
6443
|
-
flexShrink: 0
|
|
6547
|
+
lineHeight: 1.4,
|
|
6548
|
+
border: `1px solid ${isActive ? c.pillActiveBorder : "transparent"}`,
|
|
6549
|
+
backgroundColor: isActive ? c.pillActiveBg : "transparent"
|
|
6444
6550
|
}
|
|
6445
6551
|
},
|
|
6446
|
-
/* @__PURE__ */ React30.createElement(
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6450
|
-
|
|
6552
|
+
/* @__PURE__ */ React30.createElement(
|
|
6553
|
+
"span",
|
|
6554
|
+
{
|
|
6555
|
+
style: {
|
|
6556
|
+
flexShrink: 0,
|
|
6557
|
+
width: "30px",
|
|
6558
|
+
display: "flex",
|
|
6559
|
+
alignItems: "center",
|
|
6560
|
+
gap: "5px",
|
|
6561
|
+
paddingTop: "3px"
|
|
6562
|
+
}
|
|
6563
|
+
},
|
|
6564
|
+
isUser && /* @__PURE__ */ React30.createElement("span", { style: { width: "9px", height: "9px", borderRadius: "50%", backgroundColor: USER_DOT, boxShadow: `0 0 0 3px ${USER_DOT}33` } }),
|
|
6565
|
+
isPol && /* @__PURE__ */ React30.createElement("span", { style: { width: "9px", height: "9px", borderRadius: "50%", backgroundColor: c.polDot, boxShadow: `0 0 0 3px ${c.polDot}33` } })
|
|
6566
|
+
),
|
|
6567
|
+
/* @__PURE__ */ React30.createElement(
|
|
6568
|
+
"span",
|
|
6569
|
+
{
|
|
6570
|
+
style: {
|
|
6571
|
+
flex: 1,
|
|
6572
|
+
color: isActive ? c.pillActiveText : c.pillIdleText,
|
|
6573
|
+
fontWeight: isActive ? 500 : 400
|
|
6574
|
+
}
|
|
6575
|
+
},
|
|
6576
|
+
stance.text
|
|
6577
|
+
)
|
|
6578
|
+
);
|
|
6579
|
+
}))), isLoading && /* @__PURE__ */ React30.createElement("div", { className: "flex items-center", style: { padding: "12px 0" } }, /* @__PURE__ */ React30.createElement(
|
|
6580
|
+
"div",
|
|
6581
|
+
{
|
|
6582
|
+
style: {
|
|
6583
|
+
width: "20px",
|
|
6584
|
+
height: "20px",
|
|
6585
|
+
border: `2px solid ${c.spinnerTrack}`,
|
|
6586
|
+
borderTopColor: "#00657c",
|
|
6587
|
+
borderRadius: "50%",
|
|
6588
|
+
animation: "ev-spin 0.8s linear infinite"
|
|
6589
|
+
}
|
|
6590
|
+
}
|
|
6591
|
+
)), !isLoading && cached && /* @__PURE__ */ React30.createElement(React30.Fragment, null, cached.reasoning ? /* @__PURE__ */ React30.createElement(
|
|
6592
|
+
"p",
|
|
6593
|
+
{
|
|
6594
|
+
style: {
|
|
6595
|
+
fontSize: "14px",
|
|
6596
|
+
color: c.reasoning,
|
|
6597
|
+
marginBottom: "12px",
|
|
6598
|
+
whiteSpace: "pre-wrap",
|
|
6599
|
+
lineHeight: 1.6
|
|
6600
|
+
}
|
|
6601
|
+
},
|
|
6602
|
+
cached.reasoning
|
|
6603
|
+
) : null, cached.sources && cached.sources.length > 0 && /* @__PURE__ */ React30.createElement("div", { style: { marginTop: "8px" } }, /* @__PURE__ */ React30.createElement("p", { style: { ...sectionLabelStyle, marginBottom: "6px" } }, "References"), /* @__PURE__ */ React30.createElement("ol", { style: { listStyle: "decimal", listStylePosition: "inside", display: "flex", flexDirection: "column", gap: "4px" } }, cached.sources.map((src, i) => /* @__PURE__ */ React30.createElement("li", { key: i, style: { fontSize: "12px", color: c.sourceText } }, /* @__PURE__ */ React30.createElement(
|
|
6604
|
+
"a",
|
|
6605
|
+
{
|
|
6606
|
+
href: src,
|
|
6607
|
+
target: "_blank",
|
|
6608
|
+
rel: "noreferrer",
|
|
6609
|
+
className: "inline-flex items-center gap-1.5",
|
|
6610
|
+
style: { color: c.link }
|
|
6611
|
+
},
|
|
6612
|
+
/* @__PURE__ */ React30.createElement(Favicon, { url: src }),
|
|
6613
|
+
/* @__PURE__ */ React30.createElement("span", { style: { textDecoration: "underline", textUnderlineOffset: "2px" } }, getDisplayUrl(src))
|
|
6614
|
+
))))), topicQuotes.length > 0 && /* @__PURE__ */ React30.createElement("div", { style: { marginTop: "14px" } }, /* @__PURE__ */ React30.createElement("p", { style: { ...sectionLabelStyle, marginBottom: "8px" } }, "Quotes"), topicQuotes.map((quote) => {
|
|
6615
|
+
const verdict = verdictsByQuote ? verdictsByQuote[quote.id] : void 0;
|
|
6616
|
+
const borderColor = verdict === "agreed" ? c.agreedText : verdict === "disagreed" ? c.disagreedText : c.quoteBorder;
|
|
6617
|
+
const sourceName = quote.source_name || quote.sourceName;
|
|
6618
|
+
return /* @__PURE__ */ React30.createElement(
|
|
6619
|
+
"div",
|
|
6451
6620
|
{
|
|
6452
|
-
|
|
6453
|
-
target: "_blank",
|
|
6454
|
-
rel: "noreferrer",
|
|
6621
|
+
key: quote.id,
|
|
6455
6622
|
style: {
|
|
6456
|
-
|
|
6457
|
-
|
|
6458
|
-
|
|
6459
|
-
|
|
6460
|
-
|
|
6623
|
+
borderLeft: `3px solid ${borderColor}`,
|
|
6624
|
+
paddingLeft: "10px",
|
|
6625
|
+
paddingTop: "6px",
|
|
6626
|
+
paddingBottom: "6px",
|
|
6627
|
+
marginBottom: "8px"
|
|
6461
6628
|
}
|
|
6462
6629
|
},
|
|
6463
|
-
|
|
6464
|
-
|
|
6465
|
-
|
|
6466
|
-
|
|
6467
|
-
|
|
6630
|
+
/* @__PURE__ */ React30.createElement(
|
|
6631
|
+
"p",
|
|
6632
|
+
{
|
|
6633
|
+
style: {
|
|
6634
|
+
fontSize: "13px",
|
|
6635
|
+
fontStyle: "italic",
|
|
6636
|
+
color: c.quoteText,
|
|
6637
|
+
margin: 0,
|
|
6638
|
+
lineHeight: 1.5
|
|
6639
|
+
}
|
|
6640
|
+
},
|
|
6641
|
+
quote.text
|
|
6642
|
+
),
|
|
6643
|
+
verdict === "agreed" && /* @__PURE__ */ React30.createElement(
|
|
6644
|
+
"span",
|
|
6645
|
+
{
|
|
6646
|
+
style: {
|
|
6647
|
+
display: "inline-flex",
|
|
6648
|
+
alignItems: "center",
|
|
6649
|
+
gap: "4px",
|
|
6650
|
+
backgroundColor: c.agreedBg,
|
|
6651
|
+
color: c.agreedText,
|
|
6652
|
+
padding: "2px 8px",
|
|
6653
|
+
borderRadius: "9999px",
|
|
6654
|
+
fontSize: "11px",
|
|
6655
|
+
fontWeight: 500,
|
|
6656
|
+
marginTop: "4px",
|
|
6657
|
+
flexShrink: 0
|
|
6658
|
+
}
|
|
6659
|
+
},
|
|
6660
|
+
/* @__PURE__ */ React30.createElement("svg", { width: "11", height: "11", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React30.createElement("path", { d: "M5 13l4 4L19 7" })),
|
|
6661
|
+
"Agreed"
|
|
6662
|
+
),
|
|
6663
|
+
verdict === "disagreed" && /* @__PURE__ */ React30.createElement(
|
|
6664
|
+
"span",
|
|
6665
|
+
{
|
|
6666
|
+
style: {
|
|
6667
|
+
display: "inline-flex",
|
|
6668
|
+
alignItems: "center",
|
|
6669
|
+
gap: "4px",
|
|
6670
|
+
backgroundColor: c.disagreedBg,
|
|
6671
|
+
color: c.disagreedText,
|
|
6672
|
+
padding: "2px 8px",
|
|
6673
|
+
borderRadius: "9999px",
|
|
6674
|
+
fontSize: "11px",
|
|
6675
|
+
fontWeight: 500,
|
|
6676
|
+
marginTop: "4px",
|
|
6677
|
+
flexShrink: 0
|
|
6678
|
+
}
|
|
6679
|
+
},
|
|
6680
|
+
/* @__PURE__ */ React30.createElement("svg", { width: "11", height: "11", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React30.createElement("path", { d: "M6 18L18 6M6 6l12 12" })),
|
|
6681
|
+
"Disagreed"
|
|
6682
|
+
),
|
|
6683
|
+
sourceName && /* @__PURE__ */ React30.createElement(
|
|
6684
|
+
"a",
|
|
6685
|
+
{
|
|
6686
|
+
href: quote.source_url || quote.sourceUrl,
|
|
6687
|
+
target: "_blank",
|
|
6688
|
+
rel: "noreferrer",
|
|
6689
|
+
style: {
|
|
6690
|
+
display: "block",
|
|
6691
|
+
fontSize: "11px",
|
|
6692
|
+
color: c.link,
|
|
6693
|
+
marginTop: "3px",
|
|
6694
|
+
textDecoration: "none"
|
|
6695
|
+
}
|
|
6696
|
+
},
|
|
6697
|
+
sourceName
|
|
6698
|
+
)
|
|
6699
|
+
);
|
|
6700
|
+
})), !cached.reasoning && (!cached.sources || cached.sources.length === 0) && topicQuotes.length === 0 && /* @__PURE__ */ React30.createElement("p", { style: { fontSize: "14px", color: c.emptyText, fontStyle: "italic", padding: "8px 0" } }, "No detailed reasoning available for this topic."))))
|
|
6701
|
+
)
|
|
6702
|
+
);
|
|
6468
6703
|
}),
|
|
6469
6704
|
hasToggle && /* @__PURE__ */ React30.createElement(
|
|
6470
6705
|
"button",
|
|
@@ -6472,7 +6707,7 @@ function StanceAccordion({
|
|
|
6472
6707
|
type: "button",
|
|
6473
6708
|
onClick: () => setShowAll((v) => !v),
|
|
6474
6709
|
className: "text-sm font-medium mt-2 px-2 py-1 self-start cursor-pointer hover:underline",
|
|
6475
|
-
style: { color:
|
|
6710
|
+
style: { color: c.link }
|
|
6476
6711
|
},
|
|
6477
6712
|
showAll ? "Show fewer" : `Show all ${expandedTopics.length} topics`
|
|
6478
6713
|
)
|
|
@@ -6500,6 +6735,7 @@ export {
|
|
|
6500
6735
|
JudicialScorecard,
|
|
6501
6736
|
LegislativeInlineSummary,
|
|
6502
6737
|
LegislativeRecord,
|
|
6738
|
+
PlaceholderRadar,
|
|
6503
6739
|
PoliticianCard,
|
|
6504
6740
|
PoliticianProfile,
|
|
6505
6741
|
RadarChartCore,
|
|
@@ -6519,6 +6755,7 @@ export {
|
|
|
6519
6755
|
defaultNavItems,
|
|
6520
6756
|
duration,
|
|
6521
6757
|
easing,
|
|
6758
|
+
evAppLinks,
|
|
6522
6759
|
evContext,
|
|
6523
6760
|
focus,
|
|
6524
6761
|
fontSizes,
|