@empoweredvote/ev-ui 0.3.0 → 0.4.1
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 +210 -54
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +203 -50
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -34,7 +34,9 @@ __export(index_exports, {
|
|
|
34
34
|
BranchIcon: () => BranchIcon,
|
|
35
35
|
CategorySection: () => CategorySection,
|
|
36
36
|
CommitteeTable: () => CommitteeTable,
|
|
37
|
+
CompassCoverageCallout: () => CompassCoverageCallout,
|
|
37
38
|
CompassIcon: () => CompassIcon,
|
|
39
|
+
ExpandCompassNudge: () => ExpandCompassNudge,
|
|
38
40
|
FilterSidebar: () => FilterSidebar,
|
|
39
41
|
GovernmentBodySection: () => GovernmentBodySection,
|
|
40
42
|
Header: () => Header,
|
|
@@ -56,6 +58,7 @@ __export(index_exports, {
|
|
|
56
58
|
breakpoints: () => breakpoints,
|
|
57
59
|
colorScales: () => colorScales,
|
|
58
60
|
colors: () => colors,
|
|
61
|
+
computeTierCoverage: () => computeTierCoverage,
|
|
59
62
|
dataVizPalette: () => dataVizPalette,
|
|
60
63
|
defaultCtaButton: () => defaultCtaButton,
|
|
61
64
|
defaultNavItems: () => defaultNavItems,
|
|
@@ -1302,7 +1305,6 @@ function Header({
|
|
|
1302
1305
|
// src/SiteHeader.jsx
|
|
1303
1306
|
var import_react5 = __toESM(require("react"));
|
|
1304
1307
|
var defaultNavItems = [
|
|
1305
|
-
{ label: "About Us", href: "https://empowered.vote/about" },
|
|
1306
1308
|
{
|
|
1307
1309
|
label: "Features",
|
|
1308
1310
|
href: "#",
|
|
@@ -1310,12 +1312,10 @@ var defaultNavItems = [
|
|
|
1310
1312
|
{ label: "Political Compass", href: "https://compass.empowered.vote" },
|
|
1311
1313
|
{ label: "Find Representatives", href: "https://essentials.empowered.vote" },
|
|
1312
1314
|
{ label: "Read & Rank", href: "https://readrank.empowered.vote" },
|
|
1313
|
-
{ label: "Treasury Tracker", href: "https://
|
|
1314
|
-
{ label: "Empowered Badges", href: "https://
|
|
1315
|
+
{ label: "Treasury Tracker", href: "https://treasurytracker.empowered.vote" },
|
|
1316
|
+
{ label: "Empowered Badges", href: "https://badges.empowered.vote" }
|
|
1315
1317
|
]
|
|
1316
|
-
}
|
|
1317
|
-
{ label: "Volunteer", href: "https://empowered.vote/volunteer" },
|
|
1318
|
-
{ label: "FAQ", href: "https://empowered.vote/faq" }
|
|
1318
|
+
}
|
|
1319
1319
|
];
|
|
1320
1320
|
var defaultCtaButton = {
|
|
1321
1321
|
label: "Donate",
|
|
@@ -4253,15 +4253,168 @@ function TopicTierBadge({
|
|
|
4253
4253
|
);
|
|
4254
4254
|
}
|
|
4255
4255
|
|
|
4256
|
-
// src/
|
|
4256
|
+
// src/CompassCoverageCallout.jsx
|
|
4257
|
+
var import_react21 = __toESM(require("react"));
|
|
4258
|
+
var TIER_LABELS = {
|
|
4259
|
+
federal: "federal",
|
|
4260
|
+
state: "state",
|
|
4261
|
+
local: "local"
|
|
4262
|
+
};
|
|
4263
|
+
function CompassCoverageCallout({
|
|
4264
|
+
tier,
|
|
4265
|
+
count,
|
|
4266
|
+
totalSelected,
|
|
4267
|
+
compassUrl,
|
|
4268
|
+
onDismiss
|
|
4269
|
+
}) {
|
|
4270
|
+
const [dismissed, setDismissed] = (0, import_react21.useState)(false);
|
|
4271
|
+
if (dismissed) return null;
|
|
4272
|
+
const tierLabel = TIER_LABELS[tier] || tier;
|
|
4273
|
+
const tierStyle = tierColors[tier] || tierColors.federal;
|
|
4274
|
+
const containerStyle2 = {
|
|
4275
|
+
display: "flex",
|
|
4276
|
+
alignItems: "flex-start",
|
|
4277
|
+
gap: spacing[3],
|
|
4278
|
+
padding: `${spacing[3]} ${spacing[4]}`,
|
|
4279
|
+
borderLeft: `4px solid ${tierStyle.text}`,
|
|
4280
|
+
backgroundColor: tierStyle.bg,
|
|
4281
|
+
borderRadius: `0 ${borderRadius.md} ${borderRadius.md} 0`,
|
|
4282
|
+
fontFamily: fonts.primary,
|
|
4283
|
+
margin: `${spacing[3]} 0`
|
|
4284
|
+
};
|
|
4285
|
+
const textStyle = {
|
|
4286
|
+
flex: 1,
|
|
4287
|
+
fontSize: fontSizes.sm,
|
|
4288
|
+
color: "#2d3748",
|
|
4289
|
+
lineHeight: 1.5
|
|
4290
|
+
};
|
|
4291
|
+
const headlineStyle = {
|
|
4292
|
+
fontWeight: fontWeights.semibold,
|
|
4293
|
+
marginBottom: spacing[1],
|
|
4294
|
+
color: tierStyle.text
|
|
4295
|
+
};
|
|
4296
|
+
const ctaStyle = {
|
|
4297
|
+
display: "inline-block",
|
|
4298
|
+
marginTop: spacing[2],
|
|
4299
|
+
padding: `${spacing[2]} ${spacing[4]}`,
|
|
4300
|
+
backgroundColor: tierStyle.text,
|
|
4301
|
+
color: "#ffffff",
|
|
4302
|
+
borderRadius: borderRadius.full,
|
|
4303
|
+
fontSize: fontSizes.sm,
|
|
4304
|
+
fontWeight: fontWeights.semibold,
|
|
4305
|
+
textDecoration: "none",
|
|
4306
|
+
cursor: "pointer"
|
|
4307
|
+
};
|
|
4308
|
+
const closeStyle = {
|
|
4309
|
+
background: "none",
|
|
4310
|
+
border: "none",
|
|
4311
|
+
padding: spacing[1],
|
|
4312
|
+
cursor: "pointer",
|
|
4313
|
+
color: "#718096",
|
|
4314
|
+
fontSize: fontSizes.lg,
|
|
4315
|
+
lineHeight: 1
|
|
4316
|
+
};
|
|
4317
|
+
const handleDismiss = () => {
|
|
4318
|
+
setDismissed(true);
|
|
4319
|
+
if (onDismiss) onDismiss();
|
|
4320
|
+
};
|
|
4321
|
+
return /* @__PURE__ */ import_react21.default.createElement(
|
|
4322
|
+
"div",
|
|
4323
|
+
{
|
|
4324
|
+
className: "ev-compass-coverage-callout",
|
|
4325
|
+
role: "status",
|
|
4326
|
+
style: containerStyle2
|
|
4327
|
+
},
|
|
4328
|
+
/* @__PURE__ */ import_react21.default.createElement("div", { style: textStyle }, /* @__PURE__ */ import_react21.default.createElement("div", { style: headlineStyle }, "Your compass covers ", tierLabel, " issues lightly"), /* @__PURE__ */ import_react21.default.createElement("div", null, count === 0 ? `None of your ${totalSelected != null ? totalSelected : "selected"} compass topics apply at the ${tierLabel} level. ` : `Only ${count} of your ${totalSelected != null ? totalSelected : "selected"} compass topics apply at the ${tierLabel} level. `, "Add more ", tierLabel, "-applicable topics to get better comparisons with ", tierLabel, " officials."), /* @__PURE__ */ import_react21.default.createElement("a", { href: compassUrl, style: ctaStyle }, "Add ", tierLabel, " topics \u2192")),
|
|
4329
|
+
onDismiss !== void 0 && /* @__PURE__ */ import_react21.default.createElement(
|
|
4330
|
+
"button",
|
|
4331
|
+
{
|
|
4332
|
+
onClick: handleDismiss,
|
|
4333
|
+
style: closeStyle,
|
|
4334
|
+
"aria-label": "Dismiss coverage callout"
|
|
4335
|
+
},
|
|
4336
|
+
"\xD7"
|
|
4337
|
+
)
|
|
4338
|
+
);
|
|
4339
|
+
}
|
|
4340
|
+
|
|
4341
|
+
// src/ExpandCompassNudge.jsx
|
|
4257
4342
|
var import_react22 = __toESM(require("react"));
|
|
4343
|
+
function ExpandCompassNudge({
|
|
4344
|
+
politicianName,
|
|
4345
|
+
missingCount,
|
|
4346
|
+
compassUrl,
|
|
4347
|
+
style = {}
|
|
4348
|
+
}) {
|
|
4349
|
+
if (!missingCount || missingCount <= 0) return null;
|
|
4350
|
+
const containerStyle2 = {
|
|
4351
|
+
display: "flex",
|
|
4352
|
+
flexDirection: "column",
|
|
4353
|
+
alignItems: "flex-start",
|
|
4354
|
+
gap: spacing[2],
|
|
4355
|
+
padding: spacing[4],
|
|
4356
|
+
marginTop: spacing[4],
|
|
4357
|
+
backgroundColor: "#F5F9FA",
|
|
4358
|
+
borderRadius: borderRadius.lg,
|
|
4359
|
+
border: "1px solid #e0e6eb",
|
|
4360
|
+
fontFamily: fonts.primary,
|
|
4361
|
+
...style
|
|
4362
|
+
};
|
|
4363
|
+
const headlineStyle = {
|
|
4364
|
+
fontSize: fontSizes.base,
|
|
4365
|
+
fontWeight: fontWeights.semibold,
|
|
4366
|
+
color: "#2d3748",
|
|
4367
|
+
margin: 0
|
|
4368
|
+
};
|
|
4369
|
+
const bodyStyle = {
|
|
4370
|
+
fontSize: fontSizes.sm,
|
|
4371
|
+
color: "#4a5568",
|
|
4372
|
+
lineHeight: 1.5,
|
|
4373
|
+
margin: 0
|
|
4374
|
+
};
|
|
4375
|
+
const ctaStyle = {
|
|
4376
|
+
display: "inline-block",
|
|
4377
|
+
marginTop: spacing[2],
|
|
4378
|
+
padding: `${spacing[2]} ${spacing[4]}`,
|
|
4379
|
+
backgroundColor: "#00657c",
|
|
4380
|
+
color: "#ffffff",
|
|
4381
|
+
borderRadius: borderRadius.full,
|
|
4382
|
+
fontSize: fontSizes.sm,
|
|
4383
|
+
fontWeight: fontWeights.semibold,
|
|
4384
|
+
textDecoration: "none",
|
|
4385
|
+
cursor: "pointer"
|
|
4386
|
+
};
|
|
4387
|
+
const topicsLabel = missingCount === 1 ? "topic" : "topics";
|
|
4388
|
+
const speakerName = politicianName || "This politician";
|
|
4389
|
+
return /* @__PURE__ */ import_react22.default.createElement("div", { className: "ev-expand-compass-nudge", style: containerStyle2, role: "region" }, /* @__PURE__ */ import_react22.default.createElement("p", { style: headlineStyle }, "Want a richer comparison?"), /* @__PURE__ */ import_react22.default.createElement("p", { style: bodyStyle }, speakerName, " has stances on ", missingCount, " more ", topicsLabel, " you haven't answered yet. Expand your compass to see where you stand on all of them."), /* @__PURE__ */ import_react22.default.createElement("a", { href: compassUrl, style: ctaStyle }, "Expand my compass \u2192"));
|
|
4390
|
+
}
|
|
4391
|
+
|
|
4392
|
+
// src/computeTierCoverage.js
|
|
4393
|
+
function computeTierCoverage(topics) {
|
|
4394
|
+
const counts = { federal: 0, state: 0, local: 0 };
|
|
4395
|
+
if (!Array.isArray(topics)) return counts;
|
|
4396
|
+
for (const t of topics) {
|
|
4397
|
+
if (!t) continue;
|
|
4398
|
+
const hasFlags = "applies_federal" in t || "applies_state" in t || "applies_local" in t;
|
|
4399
|
+
const f = hasFlags ? Boolean(t.applies_federal) : true;
|
|
4400
|
+
const s = hasFlags ? Boolean(t.applies_state) : true;
|
|
4401
|
+
const l = hasFlags ? Boolean(t.applies_local) : true;
|
|
4402
|
+
if (f) counts.federal++;
|
|
4403
|
+
if (s) counts.state++;
|
|
4404
|
+
if (l) counts.local++;
|
|
4405
|
+
}
|
|
4406
|
+
return counts;
|
|
4407
|
+
}
|
|
4408
|
+
|
|
4409
|
+
// src/StanceAccordion.jsx
|
|
4410
|
+
var import_react24 = __toESM(require("react"));
|
|
4258
4411
|
|
|
4259
4412
|
// src/Favicon.jsx
|
|
4260
|
-
var
|
|
4413
|
+
var import_react23 = __toESM(require("react"));
|
|
4261
4414
|
function Favicon({ url, size = 16 }) {
|
|
4262
4415
|
try {
|
|
4263
4416
|
const domain = new URL(url).hostname;
|
|
4264
|
-
return /* @__PURE__ */
|
|
4417
|
+
return /* @__PURE__ */ import_react23.default.createElement(
|
|
4265
4418
|
"img",
|
|
4266
4419
|
{
|
|
4267
4420
|
src: `https://www.google.com/s2/favicons?sz=${size}&domain=${domain}`,
|
|
@@ -4272,7 +4425,7 @@ function Favicon({ url, size = 16 }) {
|
|
|
4272
4425
|
}
|
|
4273
4426
|
);
|
|
4274
4427
|
} catch {
|
|
4275
|
-
return /* @__PURE__ */
|
|
4428
|
+
return /* @__PURE__ */ import_react23.default.createElement(
|
|
4276
4429
|
"svg",
|
|
4277
4430
|
{
|
|
4278
4431
|
width: size,
|
|
@@ -4283,8 +4436,8 @@ function Favicon({ url, size = 16 }) {
|
|
|
4283
4436
|
strokeWidth: "1.5",
|
|
4284
4437
|
style: { verticalAlign: "middle", flexShrink: 0 }
|
|
4285
4438
|
},
|
|
4286
|
-
/* @__PURE__ */
|
|
4287
|
-
/* @__PURE__ */
|
|
4439
|
+
/* @__PURE__ */ import_react23.default.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
4440
|
+
/* @__PURE__ */ import_react23.default.createElement("path", { d: "M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" })
|
|
4288
4441
|
);
|
|
4289
4442
|
}
|
|
4290
4443
|
}
|
|
@@ -4315,11 +4468,11 @@ function StanceAccordion({
|
|
|
4315
4468
|
apiUrl = "https://api.empowered.vote"
|
|
4316
4469
|
}) {
|
|
4317
4470
|
var _a;
|
|
4318
|
-
const [expandedTopicId, setExpandedTopicId] = (0,
|
|
4319
|
-
const [loadingId, setLoadingId] = (0,
|
|
4320
|
-
const [showAll, setShowAll] = (0,
|
|
4321
|
-
const contextCache = (0,
|
|
4322
|
-
const quotesCache = (0,
|
|
4471
|
+
const [expandedTopicId, setExpandedTopicId] = (0, import_react24.useState)(null);
|
|
4472
|
+
const [loadingId, setLoadingId] = (0, import_react24.useState)(null);
|
|
4473
|
+
const [showAll, setShowAll] = (0, import_react24.useState)(false);
|
|
4474
|
+
const contextCache = (0, import_react24.useRef)(/* @__PURE__ */ new Map());
|
|
4475
|
+
const quotesCache = (0, import_react24.useRef)(null);
|
|
4323
4476
|
const polAnswerMap = {};
|
|
4324
4477
|
if (polAnswers) {
|
|
4325
4478
|
polAnswers.forEach((a) => {
|
|
@@ -4378,7 +4531,7 @@ function StanceAccordion({
|
|
|
4378
4531
|
quotesCache.current = [];
|
|
4379
4532
|
}
|
|
4380
4533
|
}
|
|
4381
|
-
const handleToggle = (0,
|
|
4534
|
+
const handleToggle = (0, import_react24.useCallback)(
|
|
4382
4535
|
async (topicId) => {
|
|
4383
4536
|
if (expandedTopicId === topicId) {
|
|
4384
4537
|
setExpandedTopicId(null);
|
|
@@ -4395,7 +4548,7 @@ function StanceAccordion({
|
|
|
4395
4548
|
},
|
|
4396
4549
|
[expandedTopicId, politicianId, apiUrl]
|
|
4397
4550
|
);
|
|
4398
|
-
(0,
|
|
4551
|
+
(0, import_react24.useEffect)(() => {
|
|
4399
4552
|
if (initialExpandedTopicId && topics && topics.length > 0) {
|
|
4400
4553
|
handleToggle(String(initialExpandedTopicId));
|
|
4401
4554
|
}
|
|
@@ -4411,13 +4564,13 @@ function StanceAccordion({
|
|
|
4411
4564
|
visibleTopics = [pinned, ...baseTopics.filter((t) => String(t.id) !== String(initialExpandedTopicId))];
|
|
4412
4565
|
}
|
|
4413
4566
|
}
|
|
4414
|
-
return /* @__PURE__ */
|
|
4567
|
+
return /* @__PURE__ */ import_react24.default.createElement(
|
|
4415
4568
|
"div",
|
|
4416
4569
|
{
|
|
4417
4570
|
className: "flex flex-col",
|
|
4418
4571
|
style: { fontFamily: "'Manrope', sans-serif" }
|
|
4419
4572
|
},
|
|
4420
|
-
/* @__PURE__ */
|
|
4573
|
+
/* @__PURE__ */ import_react24.default.createElement(
|
|
4421
4574
|
"h3",
|
|
4422
4575
|
{
|
|
4423
4576
|
className: "text-sm font-semibold text-neutral-400 uppercase tracking-wider mb-2",
|
|
@@ -4439,15 +4592,15 @@ function StanceAccordion({
|
|
|
4439
4592
|
if (topic.topic_key) return q.issue === topic.topic_key;
|
|
4440
4593
|
return topic.short_title && q.issue.toLowerCase() === topic.short_title.toLowerCase();
|
|
4441
4594
|
}) : [];
|
|
4442
|
-
return /* @__PURE__ */
|
|
4595
|
+
return /* @__PURE__ */ import_react24.default.createElement("div", { key: topicId, className: "border-b border-neutral-100" }, /* @__PURE__ */ import_react24.default.createElement(
|
|
4443
4596
|
"button",
|
|
4444
4597
|
{
|
|
4445
4598
|
type: "button",
|
|
4446
4599
|
onClick: () => handleToggle(topicId),
|
|
4447
4600
|
className: "w-full flex items-center justify-between py-3 px-2 text-left cursor-pointer hover:bg-neutral-50 transition-colors"
|
|
4448
4601
|
},
|
|
4449
|
-
/* @__PURE__ */
|
|
4450
|
-
/* @__PURE__ */
|
|
4602
|
+
/* @__PURE__ */ import_react24.default.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ import_react24.default.createElement("span", { className: "text-sm font-medium text-neutral-800 truncate" }, topic.short_title), questionText && /* @__PURE__ */ import_react24.default.createElement("span", { className: "text-xs text-neutral-400 mt-0.5" }, questionText), /* @__PURE__ */ import_react24.default.createElement("span", { className: "text-xs text-neutral-500 mt-0.5" }, label)),
|
|
4603
|
+
/* @__PURE__ */ import_react24.default.createElement(
|
|
4451
4604
|
"svg",
|
|
4452
4605
|
{
|
|
4453
4606
|
width: "16",
|
|
@@ -4464,9 +4617,9 @@ function StanceAccordion({
|
|
|
4464
4617
|
transition: "transform 0.2s ease"
|
|
4465
4618
|
}
|
|
4466
4619
|
},
|
|
4467
|
-
/* @__PURE__ */
|
|
4620
|
+
/* @__PURE__ */ import_react24.default.createElement("polyline", { points: "9 18 15 12 9 6" })
|
|
4468
4621
|
)
|
|
4469
|
-
), /* @__PURE__ */
|
|
4622
|
+
), /* @__PURE__ */ import_react24.default.createElement(
|
|
4470
4623
|
"div",
|
|
4471
4624
|
{
|
|
4472
4625
|
style: {
|
|
@@ -4475,7 +4628,7 @@ function StanceAccordion({
|
|
|
4475
4628
|
transition: "grid-template-rows 0.25s ease"
|
|
4476
4629
|
}
|
|
4477
4630
|
},
|
|
4478
|
-
/* @__PURE__ */
|
|
4631
|
+
/* @__PURE__ */ import_react24.default.createElement("div", { style: { overflow: "hidden" } }, /* @__PURE__ */ import_react24.default.createElement("div", { className: "px-2 pb-4" }, isLoading && /* @__PURE__ */ import_react24.default.createElement("div", { className: "flex items-center py-3" }, /* @__PURE__ */ import_react24.default.createElement(
|
|
4479
4632
|
"div",
|
|
4480
4633
|
{
|
|
4481
4634
|
style: {
|
|
@@ -4487,14 +4640,14 @@ function StanceAccordion({
|
|
|
4487
4640
|
animation: "ev-spin 0.8s linear infinite"
|
|
4488
4641
|
}
|
|
4489
4642
|
}
|
|
4490
|
-
)), !isLoading && cached && /* @__PURE__ */
|
|
4643
|
+
)), !isLoading && cached && /* @__PURE__ */ import_react24.default.createElement(import_react24.default.Fragment, null, cached.reasoning ? /* @__PURE__ */ import_react24.default.createElement(
|
|
4491
4644
|
"p",
|
|
4492
4645
|
{
|
|
4493
4646
|
className: "text-sm text-neutral-700 mb-3",
|
|
4494
4647
|
style: { whiteSpace: "pre-wrap", lineHeight: 1.6 }
|
|
4495
4648
|
},
|
|
4496
4649
|
cached.reasoning
|
|
4497
|
-
) : null, cached.sources && cached.sources.length > 0 && /* @__PURE__ */
|
|
4650
|
+
) : null, cached.sources && cached.sources.length > 0 && /* @__PURE__ */ import_react24.default.createElement("div", { className: "mt-2" }, /* @__PURE__ */ import_react24.default.createElement("p", { className: "text-xs font-semibold text-neutral-500 uppercase tracking-wider mb-1.5" }, "References"), /* @__PURE__ */ import_react24.default.createElement("ol", { className: "list-decimal list-inside space-y-1" }, cached.sources.map((src, i) => /* @__PURE__ */ import_react24.default.createElement("li", { key: i, className: "text-xs text-neutral-600" }, /* @__PURE__ */ import_react24.default.createElement(
|
|
4498
4651
|
"a",
|
|
4499
4652
|
{
|
|
4500
4653
|
href: src,
|
|
@@ -4502,9 +4655,9 @@ function StanceAccordion({
|
|
|
4502
4655
|
rel: "noreferrer",
|
|
4503
4656
|
className: "inline-flex items-center gap-1.5 hover:text-[#00657c] transition-colors"
|
|
4504
4657
|
},
|
|
4505
|
-
/* @__PURE__ */
|
|
4506
|
-
/* @__PURE__ */
|
|
4507
|
-
))))), topicQuotes.length > 0 && /* @__PURE__ */
|
|
4658
|
+
/* @__PURE__ */ import_react24.default.createElement(Favicon, { url: src }),
|
|
4659
|
+
/* @__PURE__ */ import_react24.default.createElement("span", { className: "underline underline-offset-2" }, getDisplayUrl(src))
|
|
4660
|
+
))))), topicQuotes.length > 0 && /* @__PURE__ */ import_react24.default.createElement("div", { style: { marginTop: "12px" } }, /* @__PURE__ */ import_react24.default.createElement(
|
|
4508
4661
|
"p",
|
|
4509
4662
|
{
|
|
4510
4663
|
style: {
|
|
@@ -4521,7 +4674,7 @@ function StanceAccordion({
|
|
|
4521
4674
|
const verdict = verdictsByQuote ? verdictsByQuote[quote.id] : void 0;
|
|
4522
4675
|
const borderColor = verdict === "agreed" ? "#0e7490" : verdict === "disagreed" ? "#b45309" : "#e2e8f0";
|
|
4523
4676
|
const sourceName = quote.source_name || quote.sourceName;
|
|
4524
|
-
return /* @__PURE__ */
|
|
4677
|
+
return /* @__PURE__ */ import_react24.default.createElement(
|
|
4525
4678
|
"div",
|
|
4526
4679
|
{
|
|
4527
4680
|
key: quote.id,
|
|
@@ -4533,7 +4686,7 @@ function StanceAccordion({
|
|
|
4533
4686
|
marginBottom: "8px"
|
|
4534
4687
|
}
|
|
4535
4688
|
},
|
|
4536
|
-
/* @__PURE__ */
|
|
4689
|
+
/* @__PURE__ */ import_react24.default.createElement(
|
|
4537
4690
|
"p",
|
|
4538
4691
|
{
|
|
4539
4692
|
style: {
|
|
@@ -4546,7 +4699,7 @@ function StanceAccordion({
|
|
|
4546
4699
|
},
|
|
4547
4700
|
quote.text
|
|
4548
4701
|
),
|
|
4549
|
-
verdict === "agreed" && /* @__PURE__ */
|
|
4702
|
+
verdict === "agreed" && /* @__PURE__ */ import_react24.default.createElement(
|
|
4550
4703
|
"span",
|
|
4551
4704
|
{
|
|
4552
4705
|
style: {
|
|
@@ -4563,10 +4716,10 @@ function StanceAccordion({
|
|
|
4563
4716
|
flexShrink: 0
|
|
4564
4717
|
}
|
|
4565
4718
|
},
|
|
4566
|
-
/* @__PURE__ */
|
|
4719
|
+
/* @__PURE__ */ import_react24.default.createElement("svg", { width: "11", height: "11", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("path", { d: "M5 13l4 4L19 7" })),
|
|
4567
4720
|
"Agreed"
|
|
4568
4721
|
),
|
|
4569
|
-
verdict === "disagreed" && /* @__PURE__ */
|
|
4722
|
+
verdict === "disagreed" && /* @__PURE__ */ import_react24.default.createElement(
|
|
4570
4723
|
"span",
|
|
4571
4724
|
{
|
|
4572
4725
|
style: {
|
|
@@ -4583,10 +4736,10 @@ function StanceAccordion({
|
|
|
4583
4736
|
flexShrink: 0
|
|
4584
4737
|
}
|
|
4585
4738
|
},
|
|
4586
|
-
/* @__PURE__ */
|
|
4739
|
+
/* @__PURE__ */ import_react24.default.createElement("svg", { width: "11", height: "11", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("path", { d: "M6 18L18 6M6 6l12 12" })),
|
|
4587
4740
|
"Disagreed"
|
|
4588
4741
|
),
|
|
4589
|
-
sourceName && /* @__PURE__ */
|
|
4742
|
+
sourceName && /* @__PURE__ */ import_react24.default.createElement(
|
|
4590
4743
|
"a",
|
|
4591
4744
|
{
|
|
4592
4745
|
href: quote.source_url || quote.sourceUrl,
|
|
@@ -4603,10 +4756,10 @@ function StanceAccordion({
|
|
|
4603
4756
|
sourceName
|
|
4604
4757
|
)
|
|
4605
4758
|
);
|
|
4606
|
-
})), !cached.reasoning && (!cached.sources || cached.sources.length === 0) && topicQuotes.length === 0 && /* @__PURE__ */
|
|
4759
|
+
})), !cached.reasoning && (!cached.sources || cached.sources.length === 0) && topicQuotes.length === 0 && /* @__PURE__ */ import_react24.default.createElement("p", { className: "text-sm text-neutral-400 italic py-2" }, "No detailed reasoning available for this topic."))))
|
|
4607
4760
|
));
|
|
4608
4761
|
}),
|
|
4609
|
-
hasToggle && /* @__PURE__ */
|
|
4762
|
+
hasToggle && /* @__PURE__ */ import_react24.default.createElement(
|
|
4610
4763
|
"button",
|
|
4611
4764
|
{
|
|
4612
4765
|
type: "button",
|
|
@@ -4620,9 +4773,9 @@ function StanceAccordion({
|
|
|
4620
4773
|
}
|
|
4621
4774
|
|
|
4622
4775
|
// src/icons.js
|
|
4623
|
-
var
|
|
4776
|
+
var import_react25 = __toESM(require("react"));
|
|
4624
4777
|
function BallotIcon({ size = 16, color = "currentColor" }) {
|
|
4625
|
-
return /* @__PURE__ */
|
|
4778
|
+
return /* @__PURE__ */ import_react25.default.createElement(
|
|
4626
4779
|
"svg",
|
|
4627
4780
|
{
|
|
4628
4781
|
width: size,
|
|
@@ -4635,13 +4788,13 @@ function BallotIcon({ size = 16, color = "currentColor" }) {
|
|
|
4635
4788
|
strokeLinejoin: "round",
|
|
4636
4789
|
xmlns: "http://www.w3.org/2000/svg"
|
|
4637
4790
|
},
|
|
4638
|
-
/* @__PURE__ */
|
|
4639
|
-
/* @__PURE__ */
|
|
4640
|
-
/* @__PURE__ */
|
|
4791
|
+
/* @__PURE__ */ import_react25.default.createElement("path", { d: "m9 12 2 2 4-4" }),
|
|
4792
|
+
/* @__PURE__ */ import_react25.default.createElement("path", { d: "M5 7c0-1.1.9-2 2-2h10a2 2 0 0 1 2 2v12H5V7Z" }),
|
|
4793
|
+
/* @__PURE__ */ import_react25.default.createElement("path", { d: "M22 19H2" })
|
|
4641
4794
|
);
|
|
4642
4795
|
}
|
|
4643
4796
|
function CompassIcon({ size = 16, color = "currentColor" }) {
|
|
4644
|
-
return /* @__PURE__ */
|
|
4797
|
+
return /* @__PURE__ */ import_react25.default.createElement(
|
|
4645
4798
|
"svg",
|
|
4646
4799
|
{
|
|
4647
4800
|
width: size,
|
|
@@ -4654,27 +4807,27 @@ function CompassIcon({ size = 16, color = "currentColor" }) {
|
|
|
4654
4807
|
strokeLinejoin: "round",
|
|
4655
4808
|
xmlns: "http://www.w3.org/2000/svg"
|
|
4656
4809
|
},
|
|
4657
|
-
/* @__PURE__ */
|
|
4658
|
-
/* @__PURE__ */
|
|
4810
|
+
/* @__PURE__ */ import_react25.default.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
4811
|
+
/* @__PURE__ */ import_react25.default.createElement("path", { d: "m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z" })
|
|
4659
4812
|
);
|
|
4660
4813
|
}
|
|
4661
4814
|
function BranchIcon({ size = 16, color = "currentColor", branch }) {
|
|
4662
4815
|
let paths;
|
|
4663
4816
|
switch (branch) {
|
|
4664
4817
|
case "executive":
|
|
4665
|
-
paths = /* @__PURE__ */
|
|
4818
|
+
paths = /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, /* @__PURE__ */ import_react25.default.createElement("path", { d: "M3 21h18" }), /* @__PURE__ */ import_react25.default.createElement("path", { d: "M5 21V7l8-4v18" }), /* @__PURE__ */ import_react25.default.createElement("path", { d: "M19 21V11l-6-4" }), /* @__PURE__ */ import_react25.default.createElement("path", { d: "M9 9v.01" }), /* @__PURE__ */ import_react25.default.createElement("path", { d: "M9 12v.01" }), /* @__PURE__ */ import_react25.default.createElement("path", { d: "M9 15v.01" }), /* @__PURE__ */ import_react25.default.createElement("path", { d: "M9 18v.01" }), /* @__PURE__ */ import_react25.default.createElement("path", { d: "M5 21h14" }), /* @__PURE__ */ import_react25.default.createElement("line", { x1: "13", y1: "5", x2: "13", y2: "3" }), /* @__PURE__ */ import_react25.default.createElement("line", { x1: "13", y1: "3", x2: "15", y2: "4" }));
|
|
4666
4819
|
break;
|
|
4667
4820
|
case "legislative":
|
|
4668
|
-
paths = /* @__PURE__ */
|
|
4821
|
+
paths = /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, /* @__PURE__ */ import_react25.default.createElement("path", { d: "M8 21h12a2 2 0 0 0 2-2v-2H10v2a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v3h4" }), /* @__PURE__ */ import_react25.default.createElement("path", { d: "M19 17V5a2 2 0 0 0-2-2H4" }), /* @__PURE__ */ import_react25.default.createElement("path", { d: "M15 8h-5" }), /* @__PURE__ */ import_react25.default.createElement("path", { d: "M15 12h-5" }));
|
|
4669
4822
|
break;
|
|
4670
4823
|
case "judicial":
|
|
4671
|
-
paths = /* @__PURE__ */
|
|
4824
|
+
paths = /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, /* @__PURE__ */ import_react25.default.createElement("path", { d: "M12 3v19" }), /* @__PURE__ */ import_react25.default.createElement("path", { d: "M5 8l7-5 7 5" }), /* @__PURE__ */ import_react25.default.createElement("path", { d: "M3 13l2-5 2 5a3 3 0 0 1-4 0z" }), /* @__PURE__ */ import_react25.default.createElement("path", { d: "M17 13l2-5 2 5a3 3 0 0 1-4 0z" }), /* @__PURE__ */ import_react25.default.createElement("path", { d: "M8 21h8" }));
|
|
4672
4825
|
break;
|
|
4673
4826
|
default:
|
|
4674
|
-
paths = /* @__PURE__ */
|
|
4827
|
+
paths = /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, /* @__PURE__ */ import_react25.default.createElement("path", { d: "M10 18v-7" }), /* @__PURE__ */ import_react25.default.createElement("path", { d: "M11.12 2.198a2 2 0 0 1 1.76.006l7.866 3.847c.476.233.31.949-.22.949H3.474c-.53 0-.695-.716-.22-.949z" }), /* @__PURE__ */ import_react25.default.createElement("path", { d: "M14 18v-7" }), /* @__PURE__ */ import_react25.default.createElement("path", { d: "M18 18v-7" }), /* @__PURE__ */ import_react25.default.createElement("path", { d: "M3 22h18" }), /* @__PURE__ */ import_react25.default.createElement("path", { d: "M6 18v-7" }));
|
|
4675
4828
|
break;
|
|
4676
4829
|
}
|
|
4677
|
-
return /* @__PURE__ */
|
|
4830
|
+
return /* @__PURE__ */ import_react25.default.createElement(
|
|
4678
4831
|
"svg",
|
|
4679
4832
|
{
|
|
4680
4833
|
width: size,
|
|
@@ -4697,7 +4850,9 @@ function BranchIcon({ size = 16, color = "currentColor", branch }) {
|
|
|
4697
4850
|
BranchIcon,
|
|
4698
4851
|
CategorySection,
|
|
4699
4852
|
CommitteeTable,
|
|
4853
|
+
CompassCoverageCallout,
|
|
4700
4854
|
CompassIcon,
|
|
4855
|
+
ExpandCompassNudge,
|
|
4701
4856
|
FilterSidebar,
|
|
4702
4857
|
GovernmentBodySection,
|
|
4703
4858
|
Header,
|
|
@@ -4719,6 +4874,7 @@ function BranchIcon({ size = 16, color = "currentColor", branch }) {
|
|
|
4719
4874
|
breakpoints,
|
|
4720
4875
|
colorScales,
|
|
4721
4876
|
colors,
|
|
4877
|
+
computeTierCoverage,
|
|
4722
4878
|
dataVizPalette,
|
|
4723
4879
|
defaultCtaButton,
|
|
4724
4880
|
defaultNavItems,
|