@empoweredvote/ev-ui 0.9.7 → 0.9.9
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 +31 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -978,6 +978,9 @@ function Header({
|
|
|
978
978
|
logoSrc,
|
|
979
979
|
logoAlt = "Empowered Vote",
|
|
980
980
|
logoHref = "https://empowered.vote",
|
|
981
|
+
centerLogoSrc,
|
|
982
|
+
centerLogoHref,
|
|
983
|
+
centerLogoAlt,
|
|
981
984
|
navItems = [],
|
|
982
985
|
ctaButton,
|
|
983
986
|
secondaryAction,
|
|
@@ -1052,6 +1055,7 @@ function Header({
|
|
|
1052
1055
|
...style
|
|
1053
1056
|
},
|
|
1054
1057
|
container: {
|
|
1058
|
+
position: "relative",
|
|
1055
1059
|
maxWidth: "1512px",
|
|
1056
1060
|
margin: "0 auto",
|
|
1057
1061
|
padding: isMobile ? `${spacing[3]} ${spacing[3]}` : `${spacing[4]} ${spacing[6]}`,
|
|
@@ -1064,6 +1068,14 @@ function Header({
|
|
|
1064
1068
|
height: "43px",
|
|
1065
1069
|
cursor: "pointer"
|
|
1066
1070
|
},
|
|
1071
|
+
centerLogo: {
|
|
1072
|
+
position: "absolute",
|
|
1073
|
+
left: "50%",
|
|
1074
|
+
top: "50%",
|
|
1075
|
+
transform: "translate(-50%, -50%)",
|
|
1076
|
+
display: "flex",
|
|
1077
|
+
alignItems: "center"
|
|
1078
|
+
},
|
|
1067
1079
|
nav: {
|
|
1068
1080
|
display: isMobile ? "none" : "flex",
|
|
1069
1081
|
flex: "1 1 auto",
|
|
@@ -1312,14 +1324,18 @@ function Header({
|
|
|
1312
1324
|
))))
|
|
1313
1325
|
);
|
|
1314
1326
|
};
|
|
1327
|
+
const featureOnLeft = isMobile && centerLogoSrc;
|
|
1328
|
+
const leftLogoSrc = featureOnLeft ? centerLogoSrc : logoSrc;
|
|
1329
|
+
const leftLogoAlt = featureOnLeft ? centerLogoAlt || logoAlt : logoAlt;
|
|
1330
|
+
const leftLogoHref = featureOnLeft ? centerLogoHref || logoHref : logoHref;
|
|
1315
1331
|
return /* @__PURE__ */ import_react6.default.createElement("header", { style: styles2.header }, /* @__PURE__ */ import_react6.default.createElement("div", { style: styles2.container }, /* @__PURE__ */ import_react6.default.createElement(
|
|
1316
1332
|
"a",
|
|
1317
1333
|
{
|
|
1318
|
-
href:
|
|
1319
|
-
onClick: (e) => handleNavClick(e,
|
|
1334
|
+
href: leftLogoHref,
|
|
1335
|
+
onClick: (e) => handleNavClick(e, leftLogoHref),
|
|
1320
1336
|
style: { display: "flex", alignItems: "center", flexShrink: 0 }
|
|
1321
1337
|
},
|
|
1322
|
-
|
|
1338
|
+
leftLogoSrc ? /* @__PURE__ */ import_react6.default.createElement("img", { src: leftLogoSrc, alt: leftLogoAlt, style: styles2.logo }) : /* @__PURE__ */ import_react6.default.createElement(
|
|
1323
1339
|
"span",
|
|
1324
1340
|
{
|
|
1325
1341
|
style: {
|
|
@@ -1331,6 +1347,15 @@ function Header({
|
|
|
1331
1347
|
},
|
|
1332
1348
|
"empowered.vote"
|
|
1333
1349
|
)
|
|
1350
|
+
), centerLogoSrc && !isMobile && /* @__PURE__ */ import_react6.default.createElement(
|
|
1351
|
+
"a",
|
|
1352
|
+
{
|
|
1353
|
+
href: centerLogoHref || logoHref,
|
|
1354
|
+
onClick: (e) => handleNavClick(e, centerLogoHref || logoHref),
|
|
1355
|
+
style: styles2.centerLogo,
|
|
1356
|
+
"aria-label": centerLogoAlt || "Feature home"
|
|
1357
|
+
},
|
|
1358
|
+
/* @__PURE__ */ import_react6.default.createElement("img", { src: centerLogoSrc, alt: centerLogoAlt || "", style: styles2.logo })
|
|
1334
1359
|
), /* @__PURE__ */ import_react6.default.createElement("nav", { style: styles2.nav, className: "ev-header-nav" }, navItems.map((item, idx) => /* @__PURE__ */ import_react6.default.createElement(NavLink, { key: idx, item }))), /* @__PURE__ */ import_react6.default.createElement("div", { style: { display: isMobile ? "none" : "flex", alignItems: "center", gap: spacing[3], flexShrink: 0 } }, secondaryAction && import_react6.default.isValidElement(secondaryAction) && secondaryAction, secondaryAction && !import_react6.default.isValidElement(secondaryAction) && /* @__PURE__ */ import_react6.default.createElement(
|
|
1335
1360
|
"a",
|
|
1336
1361
|
{
|
|
@@ -3397,13 +3422,12 @@ function CompassKey({ compact = false } = {}) {
|
|
|
3397
3422
|
persistDismissed(false);
|
|
3398
3423
|
}
|
|
3399
3424
|
if (!loaded) return null;
|
|
3400
|
-
const Swatch = ({ color, label
|
|
3425
|
+
const Swatch = ({ color, label }) => /* @__PURE__ */ import_react17.default.createElement("span", { style: { display: "inline-flex", alignItems: "center", gap: spacing[1] } }, /* @__PURE__ */ import_react17.default.createElement("span", { style: {
|
|
3401
3426
|
display: "inline-block",
|
|
3402
|
-
width:
|
|
3403
|
-
height:
|
|
3427
|
+
width: 16,
|
|
3428
|
+
height: 16,
|
|
3404
3429
|
borderRadius: "50%",
|
|
3405
3430
|
background: color,
|
|
3406
|
-
border: `2px solid ${ring || "#fff"}`,
|
|
3407
3431
|
boxShadow: "0 0 0 1px rgba(0,0,0,0.08)"
|
|
3408
3432
|
} }), /* @__PURE__ */ import_react17.default.createElement("span", { style: { fontSize: fontSizes.xs, color: colors.textSecondary, fontFamily: fonts.primary } }, label));
|
|
3409
3433
|
if (dismissed) {
|