@empoweredvote/ev-ui 0.8.3 → 0.8.5
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 +55 -32
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +55 -32
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -796,6 +796,16 @@ function useMediaQuery(query) {
|
|
|
796
796
|
}
|
|
797
797
|
|
|
798
798
|
// src/Header.jsx
|
|
799
|
+
var dark = {
|
|
800
|
+
bg: "#1C1F23",
|
|
801
|
+
bgElevated: "#2F3237",
|
|
802
|
+
bgHover: "#41454E",
|
|
803
|
+
border: "#41454E",
|
|
804
|
+
link: "#59B0C4",
|
|
805
|
+
text: "#D3D7DE",
|
|
806
|
+
textMuted: "#9CA3AF",
|
|
807
|
+
shadow: "0 10px 40px rgba(0,0,0,0.4)"
|
|
808
|
+
};
|
|
799
809
|
function Header({
|
|
800
810
|
logoSrc,
|
|
801
811
|
logoAlt = "Empowered Vote",
|
|
@@ -806,6 +816,7 @@ function Header({
|
|
|
806
816
|
currentPath,
|
|
807
817
|
onNavigate,
|
|
808
818
|
profileMenu,
|
|
819
|
+
darkMode = false,
|
|
809
820
|
style = {}
|
|
810
821
|
}) {
|
|
811
822
|
const [mobileMenuOpen, setMobileMenuOpen] = useState3(false);
|
|
@@ -829,9 +840,16 @@ function Header({
|
|
|
829
840
|
onNavigate(href);
|
|
830
841
|
}
|
|
831
842
|
};
|
|
843
|
+
const linkColor = darkMode ? dark.link : colors.evTeal;
|
|
844
|
+
const dropdownBg = darkMode ? dark.bgElevated : colors.bgWhite;
|
|
845
|
+
const dropdownShadow = darkMode ? dark.shadow : "0 10px 40px rgba(0,0,0,0.1)";
|
|
846
|
+
const hoverBg = darkMode ? dark.bgHover : colors.bgLight;
|
|
847
|
+
const borderColor = darkMode ? dark.border : colors.borderLight;
|
|
848
|
+
const mobileShadow = darkMode ? "0 4px 20px rgba(0,0,0,0.4)" : "0 4px 20px rgba(0,0,0,0.1)";
|
|
832
849
|
const styles2 = {
|
|
833
850
|
header: {
|
|
834
|
-
backgroundColor: colors.bgWhite,
|
|
851
|
+
backgroundColor: darkMode ? dark.bg : colors.bgWhite,
|
|
852
|
+
borderBottom: darkMode ? `1px solid ${dark.border}` : "none",
|
|
835
853
|
position: "sticky",
|
|
836
854
|
top: 0,
|
|
837
855
|
zIndex: 50,
|
|
@@ -859,7 +877,7 @@ function Header({
|
|
|
859
877
|
fontFamily: fonts.primary,
|
|
860
878
|
fontWeight: fontWeights.bold,
|
|
861
879
|
fontSize: fontSizes.xl,
|
|
862
|
-
color:
|
|
880
|
+
color: linkColor,
|
|
863
881
|
textDecoration: "none",
|
|
864
882
|
cursor: "pointer",
|
|
865
883
|
display: "flex",
|
|
@@ -882,11 +900,12 @@ function Header({
|
|
|
882
900
|
zIndex: 100
|
|
883
901
|
},
|
|
884
902
|
dropdownInner: {
|
|
885
|
-
backgroundColor:
|
|
903
|
+
backgroundColor: dropdownBg,
|
|
886
904
|
borderRadius: borderRadius.lg,
|
|
887
|
-
boxShadow:
|
|
905
|
+
boxShadow: dropdownShadow,
|
|
888
906
|
minWidth: "200px",
|
|
889
|
-
padding: spacing[2]
|
|
907
|
+
padding: spacing[2],
|
|
908
|
+
border: darkMode ? `1px solid ${dark.border}` : "none"
|
|
890
909
|
},
|
|
891
910
|
dropdownItem: {
|
|
892
911
|
display: "block",
|
|
@@ -894,7 +913,7 @@ function Header({
|
|
|
894
913
|
fontFamily: fonts.primary,
|
|
895
914
|
fontWeight: fontWeights.medium,
|
|
896
915
|
fontSize: fontSizes.base,
|
|
897
|
-
color:
|
|
916
|
+
color: linkColor,
|
|
898
917
|
textDecoration: "none",
|
|
899
918
|
borderRadius: borderRadius.md,
|
|
900
919
|
cursor: "pointer"
|
|
@@ -916,13 +935,13 @@ function Header({
|
|
|
916
935
|
display: "inline-flex",
|
|
917
936
|
alignItems: "center",
|
|
918
937
|
backgroundColor: "transparent",
|
|
919
|
-
color:
|
|
938
|
+
color: linkColor,
|
|
920
939
|
fontFamily: fonts.primary,
|
|
921
940
|
fontWeight: fontWeights.bold,
|
|
922
941
|
fontSize: fontSizes.base,
|
|
923
942
|
padding: `${spacing[2]} ${spacing[5]}`,
|
|
924
943
|
borderRadius: borderRadius.full || "999px",
|
|
925
|
-
border: `1.5px solid ${
|
|
944
|
+
border: `1.5px solid ${linkColor}`,
|
|
926
945
|
cursor: "pointer",
|
|
927
946
|
textDecoration: "none",
|
|
928
947
|
lineHeight: 1.2,
|
|
@@ -938,7 +957,7 @@ function Header({
|
|
|
938
957
|
hamburger: {
|
|
939
958
|
width: "24px",
|
|
940
959
|
height: "2px",
|
|
941
|
-
backgroundColor:
|
|
960
|
+
backgroundColor: linkColor,
|
|
942
961
|
position: "relative"
|
|
943
962
|
},
|
|
944
963
|
mobileMenu: {
|
|
@@ -948,25 +967,26 @@ function Header({
|
|
|
948
967
|
top: "100%",
|
|
949
968
|
left: 0,
|
|
950
969
|
right: 0,
|
|
951
|
-
backgroundColor: colors.bgWhite,
|
|
970
|
+
backgroundColor: darkMode ? dark.bg : colors.bgWhite,
|
|
952
971
|
padding: spacing[4],
|
|
953
|
-
boxShadow:
|
|
972
|
+
boxShadow: mobileShadow,
|
|
973
|
+
borderTop: darkMode ? `1px solid ${dark.border}` : "none"
|
|
954
974
|
},
|
|
955
975
|
mobileNavItem: {
|
|
956
976
|
fontFamily: fonts.primary,
|
|
957
977
|
fontWeight: fontWeights.bold,
|
|
958
978
|
fontSize: fontSizes.lg,
|
|
959
|
-
color:
|
|
979
|
+
color: linkColor,
|
|
960
980
|
textDecoration: "none",
|
|
961
981
|
padding: `${spacing[3]} 0`,
|
|
962
|
-
borderBottom: `1px solid ${
|
|
982
|
+
borderBottom: `1px solid ${borderColor}`
|
|
963
983
|
},
|
|
964
984
|
profileButton: {
|
|
965
985
|
width: "40px",
|
|
966
986
|
height: "40px",
|
|
967
987
|
borderRadius: borderRadius.full,
|
|
968
|
-
border: `2px solid ${
|
|
969
|
-
backgroundColor: colors.bgLight,
|
|
988
|
+
border: `2px solid ${linkColor}`,
|
|
989
|
+
backgroundColor: darkMode ? dark.bgElevated : colors.bgLight,
|
|
970
990
|
cursor: "pointer",
|
|
971
991
|
display: "flex",
|
|
972
992
|
alignItems: "center",
|
|
@@ -981,11 +1001,12 @@ function Header({
|
|
|
981
1001
|
zIndex: 100
|
|
982
1002
|
},
|
|
983
1003
|
profileDropdownInner: {
|
|
984
|
-
backgroundColor:
|
|
1004
|
+
backgroundColor: dropdownBg,
|
|
985
1005
|
borderRadius: borderRadius.lg,
|
|
986
|
-
boxShadow:
|
|
1006
|
+
boxShadow: dropdownShadow,
|
|
987
1007
|
minWidth: "160px",
|
|
988
|
-
padding: spacing[2]
|
|
1008
|
+
padding: spacing[2],
|
|
1009
|
+
border: darkMode ? `1px solid ${dark.border}` : "none"
|
|
989
1010
|
},
|
|
990
1011
|
profileDropdownItem: {
|
|
991
1012
|
display: "block",
|
|
@@ -994,7 +1015,7 @@ function Header({
|
|
|
994
1015
|
fontFamily: fonts.primary,
|
|
995
1016
|
fontWeight: fontWeights.medium,
|
|
996
1017
|
fontSize: fontSizes.base,
|
|
997
|
-
color:
|
|
1018
|
+
color: linkColor,
|
|
998
1019
|
textDecoration: "none",
|
|
999
1020
|
borderRadius: borderRadius.md,
|
|
1000
1021
|
cursor: "pointer",
|
|
@@ -1004,7 +1025,7 @@ function Header({
|
|
|
1004
1025
|
},
|
|
1005
1026
|
mobileDivider: {
|
|
1006
1027
|
height: "1px",
|
|
1007
|
-
backgroundColor:
|
|
1028
|
+
backgroundColor: borderColor,
|
|
1008
1029
|
margin: `${spacing[3]} 0`
|
|
1009
1030
|
},
|
|
1010
1031
|
profileLabel: {
|
|
@@ -1012,8 +1033,8 @@ function Header({
|
|
|
1012
1033
|
fontFamily: fonts.primary,
|
|
1013
1034
|
fontWeight: fontWeights.semibold,
|
|
1014
1035
|
fontSize: fontSizes.sm,
|
|
1015
|
-
color: colors.textMuted,
|
|
1016
|
-
borderBottom: `1px solid ${
|
|
1036
|
+
color: darkMode ? dark.textMuted : colors.textMuted,
|
|
1037
|
+
borderBottom: `1px solid ${borderColor}`,
|
|
1017
1038
|
marginBottom: spacing[1],
|
|
1018
1039
|
overflow: "hidden",
|
|
1019
1040
|
textOverflow: "ellipsis",
|
|
@@ -1054,7 +1075,7 @@ function Header({
|
|
|
1054
1075
|
"path",
|
|
1055
1076
|
{
|
|
1056
1077
|
d: "M1 1L8 8L15 1",
|
|
1057
|
-
stroke:
|
|
1078
|
+
stroke: linkColor,
|
|
1058
1079
|
strokeWidth: "2",
|
|
1059
1080
|
strokeLinecap: "round",
|
|
1060
1081
|
strokeLinejoin: "round"
|
|
@@ -1070,7 +1091,7 @@ function Header({
|
|
|
1070
1091
|
onClick: (e) => handleNavClick(e, dropdownItem.href),
|
|
1071
1092
|
style: styles2.dropdownItem,
|
|
1072
1093
|
onMouseEnter: (e) => {
|
|
1073
|
-
e.target.style.backgroundColor =
|
|
1094
|
+
e.target.style.backgroundColor = hoverBg;
|
|
1074
1095
|
},
|
|
1075
1096
|
onMouseLeave: (e) => {
|
|
1076
1097
|
e.target.style.backgroundColor = "transparent";
|
|
@@ -1094,7 +1115,7 @@ function Header({
|
|
|
1094
1115
|
fontFamily: fonts.primary,
|
|
1095
1116
|
fontWeight: fontWeights.bold,
|
|
1096
1117
|
fontSize: fontSizes["2xl"],
|
|
1097
|
-
color:
|
|
1118
|
+
color: linkColor
|
|
1098
1119
|
}
|
|
1099
1120
|
},
|
|
1100
1121
|
"empowered.vote"
|
|
@@ -1113,12 +1134,12 @@ function Header({
|
|
|
1113
1134
|
style: styles2.secondaryAction,
|
|
1114
1135
|
className: "ev-header-secondary",
|
|
1115
1136
|
onMouseEnter: (e) => {
|
|
1116
|
-
e.currentTarget.style.backgroundColor =
|
|
1137
|
+
e.currentTarget.style.backgroundColor = linkColor;
|
|
1117
1138
|
e.currentTarget.style.color = colors.textWhite;
|
|
1118
1139
|
},
|
|
1119
1140
|
onMouseLeave: (e) => {
|
|
1120
1141
|
e.currentTarget.style.backgroundColor = "transparent";
|
|
1121
|
-
e.currentTarget.style.color =
|
|
1142
|
+
e.currentTarget.style.color = linkColor;
|
|
1122
1143
|
}
|
|
1123
1144
|
},
|
|
1124
1145
|
secondaryAction.label
|
|
@@ -1152,7 +1173,7 @@ function Header({
|
|
|
1152
1173
|
height: "20",
|
|
1153
1174
|
viewBox: "0 0 24 24",
|
|
1154
1175
|
fill: "none",
|
|
1155
|
-
stroke:
|
|
1176
|
+
stroke: linkColor,
|
|
1156
1177
|
strokeWidth: "2",
|
|
1157
1178
|
strokeLinecap: "round",
|
|
1158
1179
|
strokeLinejoin: "round"
|
|
@@ -1176,7 +1197,7 @@ function Header({
|
|
|
1176
1197
|
},
|
|
1177
1198
|
style: styles2.profileDropdownItem,
|
|
1178
1199
|
onMouseEnter: (e) => {
|
|
1179
|
-
e.target.style.backgroundColor =
|
|
1200
|
+
e.target.style.backgroundColor = hoverBg;
|
|
1180
1201
|
},
|
|
1181
1202
|
onMouseLeave: (e) => {
|
|
1182
1203
|
e.target.style.backgroundColor = "transparent";
|
|
@@ -1196,7 +1217,7 @@ function Header({
|
|
|
1196
1217
|
},
|
|
1197
1218
|
style: styles2.profileDropdownItem,
|
|
1198
1219
|
onMouseEnter: (e) => {
|
|
1199
|
-
e.target.style.backgroundColor =
|
|
1220
|
+
e.target.style.backgroundColor = hoverBg;
|
|
1200
1221
|
},
|
|
1201
1222
|
onMouseLeave: (e) => {
|
|
1202
1223
|
e.target.style.backgroundColor = "transparent";
|
|
@@ -1222,7 +1243,7 @@ function Header({
|
|
|
1222
1243
|
left: 0,
|
|
1223
1244
|
width: "100%",
|
|
1224
1245
|
height: "2px",
|
|
1225
|
-
backgroundColor:
|
|
1246
|
+
backgroundColor: linkColor
|
|
1226
1247
|
}
|
|
1227
1248
|
}
|
|
1228
1249
|
), /* @__PURE__ */ React2.createElement(
|
|
@@ -1234,7 +1255,7 @@ function Header({
|
|
|
1234
1255
|
left: 0,
|
|
1235
1256
|
width: "100%",
|
|
1236
1257
|
height: "2px",
|
|
1237
|
-
backgroundColor:
|
|
1258
|
+
backgroundColor: linkColor
|
|
1238
1259
|
}
|
|
1239
1260
|
}
|
|
1240
1261
|
))
|
|
@@ -1487,6 +1508,7 @@ function SiteHeader({
|
|
|
1487
1508
|
profileMenu,
|
|
1488
1509
|
secondaryAction,
|
|
1489
1510
|
feedbackFeature,
|
|
1511
|
+
darkMode = false,
|
|
1490
1512
|
style = {}
|
|
1491
1513
|
}) {
|
|
1492
1514
|
const handleNavigate = (href) => {
|
|
@@ -1515,6 +1537,7 @@ function SiteHeader({
|
|
|
1515
1537
|
currentPath,
|
|
1516
1538
|
onNavigate: handleNavigate,
|
|
1517
1539
|
profileMenu,
|
|
1540
|
+
darkMode,
|
|
1518
1541
|
style
|
|
1519
1542
|
}
|
|
1520
1543
|
);
|