@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.js
CHANGED
|
@@ -4115,28 +4115,99 @@ var styles = {
|
|
|
4115
4115
|
|
|
4116
4116
|
// src/TopicTierBadge.jsx
|
|
4117
4117
|
var import_react20 = __toESM(require("react"));
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4118
|
+
function LandmarkIcon({ size = 14 }) {
|
|
4119
|
+
return /* @__PURE__ */ import_react20.default.createElement(
|
|
4120
|
+
"svg",
|
|
4121
|
+
{
|
|
4122
|
+
width: size,
|
|
4123
|
+
height: size,
|
|
4124
|
+
viewBox: "0 0 24 24",
|
|
4125
|
+
fill: "none",
|
|
4126
|
+
stroke: "currentColor",
|
|
4127
|
+
strokeWidth: "2",
|
|
4128
|
+
strokeLinecap: "round",
|
|
4129
|
+
strokeLinejoin: "round",
|
|
4130
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4131
|
+
"aria-hidden": "true"
|
|
4132
|
+
},
|
|
4133
|
+
/* @__PURE__ */ import_react20.default.createElement("path", { d: "M10 18v-7" }),
|
|
4134
|
+
/* @__PURE__ */ import_react20.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" }),
|
|
4135
|
+
/* @__PURE__ */ import_react20.default.createElement("path", { d: "M14 18v-7" }),
|
|
4136
|
+
/* @__PURE__ */ import_react20.default.createElement("path", { d: "M18 18v-7" }),
|
|
4137
|
+
/* @__PURE__ */ import_react20.default.createElement("path", { d: "M3 22h18" }),
|
|
4138
|
+
/* @__PURE__ */ import_react20.default.createElement("path", { d: "M6 18v-7" })
|
|
4139
|
+
);
|
|
4140
|
+
}
|
|
4141
|
+
function Building2Icon({ size = 14 }) {
|
|
4142
|
+
return /* @__PURE__ */ import_react20.default.createElement(
|
|
4143
|
+
"svg",
|
|
4144
|
+
{
|
|
4145
|
+
width: size,
|
|
4146
|
+
height: size,
|
|
4147
|
+
viewBox: "0 0 24 24",
|
|
4148
|
+
fill: "none",
|
|
4149
|
+
stroke: "currentColor",
|
|
4150
|
+
strokeWidth: "2",
|
|
4151
|
+
strokeLinecap: "round",
|
|
4152
|
+
strokeLinejoin: "round",
|
|
4153
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4154
|
+
"aria-hidden": "true"
|
|
4155
|
+
},
|
|
4156
|
+
/* @__PURE__ */ import_react20.default.createElement("path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" }),
|
|
4157
|
+
/* @__PURE__ */ import_react20.default.createElement("path", { d: "M6 12H4a2 2 0 0 0-2 2v8h4" }),
|
|
4158
|
+
/* @__PURE__ */ import_react20.default.createElement("path", { d: "M18 9h2a2 2 0 0 1 2 2v11h-4" }),
|
|
4159
|
+
/* @__PURE__ */ import_react20.default.createElement("path", { d: "M10 6h4" }),
|
|
4160
|
+
/* @__PURE__ */ import_react20.default.createElement("path", { d: "M10 10h4" }),
|
|
4161
|
+
/* @__PURE__ */ import_react20.default.createElement("path", { d: "M10 14h4" }),
|
|
4162
|
+
/* @__PURE__ */ import_react20.default.createElement("path", { d: "M10 18h4" })
|
|
4163
|
+
);
|
|
4164
|
+
}
|
|
4165
|
+
function HomeIcon({ size = 14 }) {
|
|
4166
|
+
return /* @__PURE__ */ import_react20.default.createElement(
|
|
4167
|
+
"svg",
|
|
4168
|
+
{
|
|
4169
|
+
width: size,
|
|
4170
|
+
height: size,
|
|
4171
|
+
viewBox: "0 0 24 24",
|
|
4172
|
+
fill: "none",
|
|
4173
|
+
stroke: "currentColor",
|
|
4174
|
+
strokeWidth: "2",
|
|
4175
|
+
strokeLinecap: "round",
|
|
4176
|
+
strokeLinejoin: "round",
|
|
4177
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4178
|
+
"aria-hidden": "true"
|
|
4179
|
+
},
|
|
4180
|
+
/* @__PURE__ */ import_react20.default.createElement("path", { d: "m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }),
|
|
4181
|
+
/* @__PURE__ */ import_react20.default.createElement("polyline", { points: "9 22 9 12 15 12 15 22" })
|
|
4182
|
+
);
|
|
4183
|
+
}
|
|
4184
|
+
var TIER_INFO = {
|
|
4185
|
+
federal: { label: "Federal", Icon: LandmarkIcon },
|
|
4186
|
+
state: { label: "State", Icon: Building2Icon },
|
|
4187
|
+
local: { label: "Local", Icon: HomeIcon }
|
|
4122
4188
|
};
|
|
4123
4189
|
var SIZE_STYLES = {
|
|
4124
4190
|
xs: {
|
|
4191
|
+
iconSize: 12,
|
|
4125
4192
|
fontSize: fontSizes.xs,
|
|
4126
|
-
|
|
4127
|
-
gap: spacing[1]
|
|
4193
|
+
pillPadding: `${spacing[1]} ${spacing[2]}`,
|
|
4194
|
+
gap: spacing[1],
|
|
4195
|
+
iconGap: "3px"
|
|
4128
4196
|
},
|
|
4129
4197
|
sm: {
|
|
4198
|
+
iconSize: 14,
|
|
4130
4199
|
fontSize: fontSizes.xs,
|
|
4131
|
-
|
|
4132
|
-
gap: spacing[
|
|
4200
|
+
pillPadding: `${spacing[1]} ${spacing[2]}`,
|
|
4201
|
+
gap: spacing[2],
|
|
4202
|
+
iconGap: "4px"
|
|
4133
4203
|
}
|
|
4134
4204
|
};
|
|
4135
4205
|
function TopicTierBadge({
|
|
4136
4206
|
topic,
|
|
4137
4207
|
tiers,
|
|
4138
4208
|
size = "sm",
|
|
4139
|
-
|
|
4209
|
+
iconOnly = false,
|
|
4210
|
+
variant = "tinted",
|
|
4140
4211
|
style = {}
|
|
4141
4212
|
}) {
|
|
4142
4213
|
const effectiveTiers = tiers != null ? tiers : topic ? [
|
|
@@ -4153,29 +4224,32 @@ function TopicTierBadge({
|
|
|
4153
4224
|
flexWrap: "wrap",
|
|
4154
4225
|
...style
|
|
4155
4226
|
};
|
|
4156
|
-
const
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
}
|
|
4227
|
+
const itemStyle = (tier) => {
|
|
4228
|
+
const color = variant === "muted" ? "#6B7280" : tierColors[tier].text;
|
|
4229
|
+
return {
|
|
4230
|
+
display: "inline-flex",
|
|
4231
|
+
alignItems: "center",
|
|
4232
|
+
gap: sizeStyle.iconGap,
|
|
4233
|
+
fontFamily: fonts.primary,
|
|
4234
|
+
fontWeight: fontWeights.medium,
|
|
4235
|
+
fontSize: sizeStyle.fontSize,
|
|
4236
|
+
color,
|
|
4237
|
+
lineHeight: 1,
|
|
4238
|
+
userSelect: "none"
|
|
4239
|
+
};
|
|
4240
|
+
};
|
|
4170
4241
|
return /* @__PURE__ */ import_react20.default.createElement(
|
|
4171
4242
|
"span",
|
|
4172
4243
|
{
|
|
4173
4244
|
className: "ev-topic-tier-badge",
|
|
4174
4245
|
style: containerStyle2,
|
|
4175
4246
|
role: "group",
|
|
4176
|
-
"aria-label": `Applies at: ${effectiveTiers.map((t) =>
|
|
4247
|
+
"aria-label": `Applies at: ${effectiveTiers.map((t) => TIER_INFO[t].label).join(", ")}`
|
|
4177
4248
|
},
|
|
4178
|
-
effectiveTiers.map((tier) =>
|
|
4249
|
+
effectiveTiers.map((tier) => {
|
|
4250
|
+
const { label, Icon } = TIER_INFO[tier];
|
|
4251
|
+
return /* @__PURE__ */ import_react20.default.createElement("span", { key: tier, style: itemStyle(tier) }, /* @__PURE__ */ import_react20.default.createElement(Icon, { size: sizeStyle.iconSize }), !iconOnly && /* @__PURE__ */ import_react20.default.createElement("span", null, label));
|
|
4252
|
+
})
|
|
4179
4253
|
);
|
|
4180
4254
|
}
|
|
4181
4255
|
|