@empoweredvote/ev-ui 0.2.3 → 0.3.0
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 +99 -25
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +99 -25
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4034,28 +4034,99 @@ var styles = {
|
|
|
4034
4034
|
|
|
4035
4035
|
// src/TopicTierBadge.jsx
|
|
4036
4036
|
import React18 from "react";
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4037
|
+
function LandmarkIcon({ size = 14 }) {
|
|
4038
|
+
return /* @__PURE__ */ React18.createElement(
|
|
4039
|
+
"svg",
|
|
4040
|
+
{
|
|
4041
|
+
width: size,
|
|
4042
|
+
height: size,
|
|
4043
|
+
viewBox: "0 0 24 24",
|
|
4044
|
+
fill: "none",
|
|
4045
|
+
stroke: "currentColor",
|
|
4046
|
+
strokeWidth: "2",
|
|
4047
|
+
strokeLinecap: "round",
|
|
4048
|
+
strokeLinejoin: "round",
|
|
4049
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4050
|
+
"aria-hidden": "true"
|
|
4051
|
+
},
|
|
4052
|
+
/* @__PURE__ */ React18.createElement("path", { d: "M10 18v-7" }),
|
|
4053
|
+
/* @__PURE__ */ React18.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" }),
|
|
4054
|
+
/* @__PURE__ */ React18.createElement("path", { d: "M14 18v-7" }),
|
|
4055
|
+
/* @__PURE__ */ React18.createElement("path", { d: "M18 18v-7" }),
|
|
4056
|
+
/* @__PURE__ */ React18.createElement("path", { d: "M3 22h18" }),
|
|
4057
|
+
/* @__PURE__ */ React18.createElement("path", { d: "M6 18v-7" })
|
|
4058
|
+
);
|
|
4059
|
+
}
|
|
4060
|
+
function Building2Icon({ size = 14 }) {
|
|
4061
|
+
return /* @__PURE__ */ React18.createElement(
|
|
4062
|
+
"svg",
|
|
4063
|
+
{
|
|
4064
|
+
width: size,
|
|
4065
|
+
height: size,
|
|
4066
|
+
viewBox: "0 0 24 24",
|
|
4067
|
+
fill: "none",
|
|
4068
|
+
stroke: "currentColor",
|
|
4069
|
+
strokeWidth: "2",
|
|
4070
|
+
strokeLinecap: "round",
|
|
4071
|
+
strokeLinejoin: "round",
|
|
4072
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4073
|
+
"aria-hidden": "true"
|
|
4074
|
+
},
|
|
4075
|
+
/* @__PURE__ */ React18.createElement("path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" }),
|
|
4076
|
+
/* @__PURE__ */ React18.createElement("path", { d: "M6 12H4a2 2 0 0 0-2 2v8h4" }),
|
|
4077
|
+
/* @__PURE__ */ React18.createElement("path", { d: "M18 9h2a2 2 0 0 1 2 2v11h-4" }),
|
|
4078
|
+
/* @__PURE__ */ React18.createElement("path", { d: "M10 6h4" }),
|
|
4079
|
+
/* @__PURE__ */ React18.createElement("path", { d: "M10 10h4" }),
|
|
4080
|
+
/* @__PURE__ */ React18.createElement("path", { d: "M10 14h4" }),
|
|
4081
|
+
/* @__PURE__ */ React18.createElement("path", { d: "M10 18h4" })
|
|
4082
|
+
);
|
|
4083
|
+
}
|
|
4084
|
+
function HomeIcon({ size = 14 }) {
|
|
4085
|
+
return /* @__PURE__ */ React18.createElement(
|
|
4086
|
+
"svg",
|
|
4087
|
+
{
|
|
4088
|
+
width: size,
|
|
4089
|
+
height: size,
|
|
4090
|
+
viewBox: "0 0 24 24",
|
|
4091
|
+
fill: "none",
|
|
4092
|
+
stroke: "currentColor",
|
|
4093
|
+
strokeWidth: "2",
|
|
4094
|
+
strokeLinecap: "round",
|
|
4095
|
+
strokeLinejoin: "round",
|
|
4096
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4097
|
+
"aria-hidden": "true"
|
|
4098
|
+
},
|
|
4099
|
+
/* @__PURE__ */ React18.createElement("path", { d: "m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }),
|
|
4100
|
+
/* @__PURE__ */ React18.createElement("polyline", { points: "9 22 9 12 15 12 15 22" })
|
|
4101
|
+
);
|
|
4102
|
+
}
|
|
4103
|
+
var TIER_INFO = {
|
|
4104
|
+
federal: { label: "Federal", Icon: LandmarkIcon },
|
|
4105
|
+
state: { label: "State", Icon: Building2Icon },
|
|
4106
|
+
local: { label: "Local", Icon: HomeIcon }
|
|
4041
4107
|
};
|
|
4042
4108
|
var SIZE_STYLES = {
|
|
4043
4109
|
xs: {
|
|
4110
|
+
iconSize: 12,
|
|
4044
4111
|
fontSize: fontSizes.xs,
|
|
4045
|
-
|
|
4046
|
-
gap: spacing[1]
|
|
4112
|
+
pillPadding: `${spacing[1]} ${spacing[2]}`,
|
|
4113
|
+
gap: spacing[1],
|
|
4114
|
+
iconGap: "3px"
|
|
4047
4115
|
},
|
|
4048
4116
|
sm: {
|
|
4117
|
+
iconSize: 14,
|
|
4049
4118
|
fontSize: fontSizes.xs,
|
|
4050
|
-
|
|
4051
|
-
gap: spacing[
|
|
4119
|
+
pillPadding: `${spacing[1]} ${spacing[2]}`,
|
|
4120
|
+
gap: spacing[2],
|
|
4121
|
+
iconGap: "4px"
|
|
4052
4122
|
}
|
|
4053
4123
|
};
|
|
4054
4124
|
function TopicTierBadge({
|
|
4055
4125
|
topic,
|
|
4056
4126
|
tiers,
|
|
4057
4127
|
size = "sm",
|
|
4058
|
-
|
|
4128
|
+
iconOnly = false,
|
|
4129
|
+
variant = "tinted",
|
|
4059
4130
|
style = {}
|
|
4060
4131
|
}) {
|
|
4061
4132
|
const effectiveTiers = tiers != null ? tiers : topic ? [
|
|
@@ -4072,29 +4143,32 @@ function TopicTierBadge({
|
|
|
4072
4143
|
flexWrap: "wrap",
|
|
4073
4144
|
...style
|
|
4074
4145
|
};
|
|
4075
|
-
const
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
}
|
|
4146
|
+
const itemStyle = (tier) => {
|
|
4147
|
+
const color = variant === "muted" ? "#6B7280" : tierColors[tier].text;
|
|
4148
|
+
return {
|
|
4149
|
+
display: "inline-flex",
|
|
4150
|
+
alignItems: "center",
|
|
4151
|
+
gap: sizeStyle.iconGap,
|
|
4152
|
+
fontFamily: fonts.primary,
|
|
4153
|
+
fontWeight: fontWeights.medium,
|
|
4154
|
+
fontSize: sizeStyle.fontSize,
|
|
4155
|
+
color,
|
|
4156
|
+
lineHeight: 1,
|
|
4157
|
+
userSelect: "none"
|
|
4158
|
+
};
|
|
4159
|
+
};
|
|
4089
4160
|
return /* @__PURE__ */ React18.createElement(
|
|
4090
4161
|
"span",
|
|
4091
4162
|
{
|
|
4092
4163
|
className: "ev-topic-tier-badge",
|
|
4093
4164
|
style: containerStyle2,
|
|
4094
4165
|
role: "group",
|
|
4095
|
-
"aria-label": `Applies at: ${effectiveTiers.map((t) =>
|
|
4166
|
+
"aria-label": `Applies at: ${effectiveTiers.map((t) => TIER_INFO[t].label).join(", ")}`
|
|
4096
4167
|
},
|
|
4097
|
-
effectiveTiers.map((tier) =>
|
|
4168
|
+
effectiveTiers.map((tier) => {
|
|
4169
|
+
const { label, Icon } = TIER_INFO[tier];
|
|
4170
|
+
return /* @__PURE__ */ React18.createElement("span", { key: tier, style: itemStyle(tier) }, /* @__PURE__ */ React18.createElement(Icon, { size: sizeStyle.iconSize }), !iconOnly && /* @__PURE__ */ React18.createElement("span", null, label));
|
|
4171
|
+
})
|
|
4098
4172
|
);
|
|
4099
4173
|
}
|
|
4100
4174
|
|