@empoweredvote/ev-ui 0.8.3 → 0.8.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.js CHANGED
@@ -887,6 +887,16 @@ function useMediaQuery(query) {
887
887
  }
888
888
 
889
889
  // src/Header.jsx
890
+ var dark = {
891
+ bg: "#1C1F23",
892
+ bgElevated: "#2F3237",
893
+ bgHover: "#41454E",
894
+ border: "#41454E",
895
+ link: "#59B0C4",
896
+ text: "#D3D7DE",
897
+ textMuted: "#9CA3AF",
898
+ shadow: "0 10px 40px rgba(0,0,0,0.4)"
899
+ };
890
900
  function Header({
891
901
  logoSrc,
892
902
  logoAlt = "Empowered Vote",
@@ -897,6 +907,7 @@ function Header({
897
907
  currentPath,
898
908
  onNavigate,
899
909
  profileMenu,
910
+ darkMode = false,
900
911
  style = {}
901
912
  }) {
902
913
  const [mobileMenuOpen, setMobileMenuOpen] = (0, import_react3.useState)(false);
@@ -920,9 +931,16 @@ function Header({
920
931
  onNavigate(href);
921
932
  }
922
933
  };
934
+ const linkColor = darkMode ? dark.link : colors.evTeal;
935
+ const dropdownBg = darkMode ? dark.bgElevated : colors.bgWhite;
936
+ const dropdownShadow = darkMode ? dark.shadow : "0 10px 40px rgba(0,0,0,0.1)";
937
+ const hoverBg = darkMode ? dark.bgHover : colors.bgLight;
938
+ const borderColor = darkMode ? dark.border : colors.borderLight;
939
+ const mobileShadow = darkMode ? "0 4px 20px rgba(0,0,0,0.4)" : "0 4px 20px rgba(0,0,0,0.1)";
923
940
  const styles2 = {
924
941
  header: {
925
- backgroundColor: colors.bgWhite,
942
+ backgroundColor: darkMode ? dark.bg : colors.bgWhite,
943
+ borderBottom: darkMode ? `1px solid ${dark.border}` : "none",
926
944
  position: "sticky",
927
945
  top: 0,
928
946
  zIndex: 50,
@@ -950,7 +968,7 @@ function Header({
950
968
  fontFamily: fonts.primary,
951
969
  fontWeight: fontWeights.bold,
952
970
  fontSize: fontSizes.xl,
953
- color: colors.evTeal,
971
+ color: linkColor,
954
972
  textDecoration: "none",
955
973
  cursor: "pointer",
956
974
  display: "flex",
@@ -973,11 +991,12 @@ function Header({
973
991
  zIndex: 100
974
992
  },
975
993
  dropdownInner: {
976
- backgroundColor: colors.bgWhite,
994
+ backgroundColor: dropdownBg,
977
995
  borderRadius: borderRadius.lg,
978
- boxShadow: "0 10px 40px rgba(0,0,0,0.1)",
996
+ boxShadow: dropdownShadow,
979
997
  minWidth: "200px",
980
- padding: spacing[2]
998
+ padding: spacing[2],
999
+ border: darkMode ? `1px solid ${dark.border}` : "none"
981
1000
  },
982
1001
  dropdownItem: {
983
1002
  display: "block",
@@ -985,7 +1004,7 @@ function Header({
985
1004
  fontFamily: fonts.primary,
986
1005
  fontWeight: fontWeights.medium,
987
1006
  fontSize: fontSizes.base,
988
- color: colors.evTeal,
1007
+ color: linkColor,
989
1008
  textDecoration: "none",
990
1009
  borderRadius: borderRadius.md,
991
1010
  cursor: "pointer"
@@ -1007,13 +1026,13 @@ function Header({
1007
1026
  display: "inline-flex",
1008
1027
  alignItems: "center",
1009
1028
  backgroundColor: "transparent",
1010
- color: colors.evTeal,
1029
+ color: linkColor,
1011
1030
  fontFamily: fonts.primary,
1012
1031
  fontWeight: fontWeights.bold,
1013
1032
  fontSize: fontSizes.base,
1014
1033
  padding: `${spacing[2]} ${spacing[5]}`,
1015
1034
  borderRadius: borderRadius.full || "999px",
1016
- border: `1.5px solid ${colors.evTeal}`,
1035
+ border: `1.5px solid ${linkColor}`,
1017
1036
  cursor: "pointer",
1018
1037
  textDecoration: "none",
1019
1038
  lineHeight: 1.2,
@@ -1029,7 +1048,7 @@ function Header({
1029
1048
  hamburger: {
1030
1049
  width: "24px",
1031
1050
  height: "2px",
1032
- backgroundColor: colors.evTeal,
1051
+ backgroundColor: linkColor,
1033
1052
  position: "relative"
1034
1053
  },
1035
1054
  mobileMenu: {
@@ -1039,25 +1058,26 @@ function Header({
1039
1058
  top: "100%",
1040
1059
  left: 0,
1041
1060
  right: 0,
1042
- backgroundColor: colors.bgWhite,
1061
+ backgroundColor: darkMode ? dark.bg : colors.bgWhite,
1043
1062
  padding: spacing[4],
1044
- boxShadow: "0 4px 20px rgba(0,0,0,0.1)"
1063
+ boxShadow: mobileShadow,
1064
+ borderTop: darkMode ? `1px solid ${dark.border}` : "none"
1045
1065
  },
1046
1066
  mobileNavItem: {
1047
1067
  fontFamily: fonts.primary,
1048
1068
  fontWeight: fontWeights.bold,
1049
1069
  fontSize: fontSizes.lg,
1050
- color: colors.evTeal,
1070
+ color: linkColor,
1051
1071
  textDecoration: "none",
1052
1072
  padding: `${spacing[3]} 0`,
1053
- borderBottom: `1px solid ${colors.borderLight}`
1073
+ borderBottom: `1px solid ${borderColor}`
1054
1074
  },
1055
1075
  profileButton: {
1056
1076
  width: "40px",
1057
1077
  height: "40px",
1058
1078
  borderRadius: borderRadius.full,
1059
- border: `2px solid ${colors.evTeal}`,
1060
- backgroundColor: colors.bgLight,
1079
+ border: `2px solid ${linkColor}`,
1080
+ backgroundColor: darkMode ? dark.bgElevated : colors.bgLight,
1061
1081
  cursor: "pointer",
1062
1082
  display: "flex",
1063
1083
  alignItems: "center",
@@ -1072,11 +1092,12 @@ function Header({
1072
1092
  zIndex: 100
1073
1093
  },
1074
1094
  profileDropdownInner: {
1075
- backgroundColor: colors.bgWhite,
1095
+ backgroundColor: dropdownBg,
1076
1096
  borderRadius: borderRadius.lg,
1077
- boxShadow: "0 10px 40px rgba(0,0,0,0.1)",
1097
+ boxShadow: dropdownShadow,
1078
1098
  minWidth: "160px",
1079
- padding: spacing[2]
1099
+ padding: spacing[2],
1100
+ border: darkMode ? `1px solid ${dark.border}` : "none"
1080
1101
  },
1081
1102
  profileDropdownItem: {
1082
1103
  display: "block",
@@ -1085,7 +1106,7 @@ function Header({
1085
1106
  fontFamily: fonts.primary,
1086
1107
  fontWeight: fontWeights.medium,
1087
1108
  fontSize: fontSizes.base,
1088
- color: colors.evTeal,
1109
+ color: linkColor,
1089
1110
  textDecoration: "none",
1090
1111
  borderRadius: borderRadius.md,
1091
1112
  cursor: "pointer",
@@ -1095,7 +1116,7 @@ function Header({
1095
1116
  },
1096
1117
  mobileDivider: {
1097
1118
  height: "1px",
1098
- backgroundColor: colors.borderLight,
1119
+ backgroundColor: borderColor,
1099
1120
  margin: `${spacing[3]} 0`
1100
1121
  },
1101
1122
  profileLabel: {
@@ -1103,8 +1124,8 @@ function Header({
1103
1124
  fontFamily: fonts.primary,
1104
1125
  fontWeight: fontWeights.semibold,
1105
1126
  fontSize: fontSizes.sm,
1106
- color: colors.textMuted,
1107
- borderBottom: `1px solid ${colors.borderLight}`,
1127
+ color: darkMode ? dark.textMuted : colors.textMuted,
1128
+ borderBottom: `1px solid ${borderColor}`,
1108
1129
  marginBottom: spacing[1],
1109
1130
  overflow: "hidden",
1110
1131
  textOverflow: "ellipsis",
@@ -1145,7 +1166,7 @@ function Header({
1145
1166
  "path",
1146
1167
  {
1147
1168
  d: "M1 1L8 8L15 1",
1148
- stroke: colors.evTeal,
1169
+ stroke: linkColor,
1149
1170
  strokeWidth: "2",
1150
1171
  strokeLinecap: "round",
1151
1172
  strokeLinejoin: "round"
@@ -1161,7 +1182,7 @@ function Header({
1161
1182
  onClick: (e) => handleNavClick(e, dropdownItem.href),
1162
1183
  style: styles2.dropdownItem,
1163
1184
  onMouseEnter: (e) => {
1164
- e.target.style.backgroundColor = colors.bgLight;
1185
+ e.target.style.backgroundColor = hoverBg;
1165
1186
  },
1166
1187
  onMouseLeave: (e) => {
1167
1188
  e.target.style.backgroundColor = "transparent";
@@ -1185,7 +1206,7 @@ function Header({
1185
1206
  fontFamily: fonts.primary,
1186
1207
  fontWeight: fontWeights.bold,
1187
1208
  fontSize: fontSizes["2xl"],
1188
- color: colors.evTeal
1209
+ color: linkColor
1189
1210
  }
1190
1211
  },
1191
1212
  "empowered.vote"
@@ -1204,12 +1225,12 @@ function Header({
1204
1225
  style: styles2.secondaryAction,
1205
1226
  className: "ev-header-secondary",
1206
1227
  onMouseEnter: (e) => {
1207
- e.currentTarget.style.backgroundColor = colors.evTeal;
1228
+ e.currentTarget.style.backgroundColor = linkColor;
1208
1229
  e.currentTarget.style.color = colors.textWhite;
1209
1230
  },
1210
1231
  onMouseLeave: (e) => {
1211
1232
  e.currentTarget.style.backgroundColor = "transparent";
1212
- e.currentTarget.style.color = colors.evTeal;
1233
+ e.currentTarget.style.color = linkColor;
1213
1234
  }
1214
1235
  },
1215
1236
  secondaryAction.label
@@ -1243,7 +1264,7 @@ function Header({
1243
1264
  height: "20",
1244
1265
  viewBox: "0 0 24 24",
1245
1266
  fill: "none",
1246
- stroke: colors.evTeal,
1267
+ stroke: linkColor,
1247
1268
  strokeWidth: "2",
1248
1269
  strokeLinecap: "round",
1249
1270
  strokeLinejoin: "round"
@@ -1267,7 +1288,7 @@ function Header({
1267
1288
  },
1268
1289
  style: styles2.profileDropdownItem,
1269
1290
  onMouseEnter: (e) => {
1270
- e.target.style.backgroundColor = colors.bgLight;
1291
+ e.target.style.backgroundColor = hoverBg;
1271
1292
  },
1272
1293
  onMouseLeave: (e) => {
1273
1294
  e.target.style.backgroundColor = "transparent";
@@ -1287,7 +1308,7 @@ function Header({
1287
1308
  },
1288
1309
  style: styles2.profileDropdownItem,
1289
1310
  onMouseEnter: (e) => {
1290
- e.target.style.backgroundColor = colors.bgLight;
1311
+ e.target.style.backgroundColor = hoverBg;
1291
1312
  },
1292
1313
  onMouseLeave: (e) => {
1293
1314
  e.target.style.backgroundColor = "transparent";
@@ -1313,7 +1334,7 @@ function Header({
1313
1334
  left: 0,
1314
1335
  width: "100%",
1315
1336
  height: "2px",
1316
- backgroundColor: colors.evTeal
1337
+ backgroundColor: linkColor
1317
1338
  }
1318
1339
  }
1319
1340
  ), /* @__PURE__ */ import_react3.default.createElement(
@@ -1325,7 +1346,7 @@ function Header({
1325
1346
  left: 0,
1326
1347
  width: "100%",
1327
1348
  height: "2px",
1328
- backgroundColor: colors.evTeal
1349
+ backgroundColor: linkColor
1329
1350
  }
1330
1351
  }
1331
1352
  ))
@@ -1578,6 +1599,7 @@ function SiteHeader({
1578
1599
  profileMenu,
1579
1600
  secondaryAction,
1580
1601
  feedbackFeature,
1602
+ darkMode = false,
1581
1603
  style = {}
1582
1604
  }) {
1583
1605
  const handleNavigate = (href) => {
@@ -1606,6 +1628,7 @@ function SiteHeader({
1606
1628
  currentPath,
1607
1629
  onNavigate: handleNavigate,
1608
1630
  profileMenu,
1631
+ darkMode,
1609
1632
  style
1610
1633
  }
1611
1634
  );