@empoweredvote/ev-ui 0.9.4 → 0.9.6
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 +24 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -882,7 +882,7 @@ function useMediaQuery(query) {
|
|
|
882
882
|
function Header({
|
|
883
883
|
logoSrc,
|
|
884
884
|
logoAlt = "Empowered Vote",
|
|
885
|
-
logoHref = "https://
|
|
885
|
+
logoHref = "https://empowered.vote",
|
|
886
886
|
navItems = [],
|
|
887
887
|
ctaButton,
|
|
888
888
|
secondaryAction,
|
|
@@ -1065,15 +1065,23 @@ function Header({
|
|
|
1065
1065
|
position: "relative"
|
|
1066
1066
|
},
|
|
1067
1067
|
mobileMenu: {
|
|
1068
|
+
// Compact dropdown panel anchored under the hamburger (right edge), rather
|
|
1069
|
+
// than a full-bleed left:0/right:0 bar across the whole viewport.
|
|
1068
1070
|
display: mobileMenuOpen ? "flex" : "none",
|
|
1069
1071
|
flexDirection: "column",
|
|
1070
1072
|
position: "absolute",
|
|
1071
1073
|
top: "100%",
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
+
right: spacing[3],
|
|
1075
|
+
left: "auto",
|
|
1076
|
+
width: "min(300px, calc(100vw - 24px))",
|
|
1077
|
+
maxWidth: "calc(100vw - 24px)",
|
|
1074
1078
|
backgroundColor: t.surface,
|
|
1075
|
-
padding: spacing[
|
|
1076
|
-
boxShadow: t.shadow
|
|
1079
|
+
padding: spacing[3],
|
|
1080
|
+
boxShadow: t.shadow,
|
|
1081
|
+
borderRadius: borderRadius.lg,
|
|
1082
|
+
border: `1px solid ${t.border}`,
|
|
1083
|
+
marginTop: spacing[2],
|
|
1084
|
+
zIndex: 100
|
|
1077
1085
|
},
|
|
1078
1086
|
mobileNavItem: {
|
|
1079
1087
|
fontFamily: fonts.primary,
|
|
@@ -1495,7 +1503,7 @@ import React5 from "react";
|
|
|
1495
1503
|
|
|
1496
1504
|
// src/FeedbackButton.jsx
|
|
1497
1505
|
import React4 from "react";
|
|
1498
|
-
var FEEDBACK_BASE_DEFAULT = "https://
|
|
1506
|
+
var FEEDBACK_BASE_DEFAULT = "https://empowered.vote/feedback";
|
|
1499
1507
|
var HOST_FEATURE_MAP = {
|
|
1500
1508
|
"compass.empowered.vote": "compass",
|
|
1501
1509
|
"essentials.empowered.vote": "essentials",
|
|
@@ -1505,7 +1513,8 @@ var HOST_FEATURE_MAP = {
|
|
|
1505
1513
|
"ctc.empowered.vote": "trivia",
|
|
1506
1514
|
"alpha.empowered.vote": "landing",
|
|
1507
1515
|
"ev-landing.empowered.vote": "landing",
|
|
1508
|
-
"ev-landing.onrender.com": "landing"
|
|
1516
|
+
"ev-landing.onrender.com": "landing",
|
|
1517
|
+
"empowered.vote": "landing"
|
|
1509
1518
|
};
|
|
1510
1519
|
function detectFeature() {
|
|
1511
1520
|
if (typeof window === "undefined") return void 0;
|
|
@@ -1520,9 +1529,10 @@ function detectFeature() {
|
|
|
1520
1529
|
}
|
|
1521
1530
|
return "other";
|
|
1522
1531
|
}
|
|
1523
|
-
function
|
|
1532
|
+
function getFeedbackUrl({ feature, baseUrl = FEEDBACK_BASE_DEFAULT, includeUrl = true } = {}) {
|
|
1533
|
+
const resolvedFeature = feature != null ? feature : detectFeature();
|
|
1524
1534
|
const params = new URLSearchParams();
|
|
1525
|
-
if (
|
|
1535
|
+
if (resolvedFeature) params.set("feature", resolvedFeature);
|
|
1526
1536
|
if (includeUrl && typeof window !== "undefined") {
|
|
1527
1537
|
params.set("url", window.location.href);
|
|
1528
1538
|
}
|
|
@@ -1538,8 +1548,7 @@ function FeedbackButton({
|
|
|
1538
1548
|
className = "",
|
|
1539
1549
|
style = {}
|
|
1540
1550
|
}) {
|
|
1541
|
-
const
|
|
1542
|
-
const href = buildHref({ baseUrl, feature, includeUrl });
|
|
1551
|
+
const href = getFeedbackUrl({ feature: featureProp, baseUrl, includeUrl });
|
|
1543
1552
|
const pillStyle = {
|
|
1544
1553
|
display: "inline-flex",
|
|
1545
1554
|
alignItems: "center",
|
|
@@ -6767,6 +6776,7 @@ export {
|
|
|
6767
6776
|
dataVizPalette,
|
|
6768
6777
|
defaultCtaButton,
|
|
6769
6778
|
defaultNavItems,
|
|
6779
|
+
detectFeature,
|
|
6770
6780
|
duration,
|
|
6771
6781
|
easing,
|
|
6772
6782
|
evAppLinks,
|
|
@@ -6775,6 +6785,7 @@ export {
|
|
|
6775
6785
|
fontSizes,
|
|
6776
6786
|
fontWeights,
|
|
6777
6787
|
fonts,
|
|
6788
|
+
getFeedbackUrl,
|
|
6778
6789
|
letterSpacing,
|
|
6779
6790
|
lineHeights,
|
|
6780
6791
|
opacity,
|