@local-civics/hub-ui 0.1.222 → 0.1.223

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 CHANGED
@@ -3043,6 +3043,7 @@ const BadgeEmblem = (props) => {
3043
3043
  return ["h-max w-24", "w-12 h-12"];
3044
3044
  case "lg":
3045
3045
  return ["h-max w-40", "w-20 h-20"];
3046
+ case "md":
3046
3047
  default:
3047
3048
  return ["h-max w-28", "w-14 h-14"];
3048
3049
  }
@@ -3726,7 +3727,7 @@ const BadgeListCard = (props) => {
3726
3727
  imageURL: props.imageURL,
3727
3728
  alt: props.displayName,
3728
3729
  level: props.level,
3729
- size: "sm"
3730
+ size: "md"
3730
3731
  }
3731
3732
  )), /* @__PURE__ */ React__namespace.createElement("div", { className: "w-full truncate text-xs font-bold text-dark-blue-400" }, props.displayName), /* @__PURE__ */ React__namespace.createElement(Pill, { label: pillLabel, accent: pillAccent }))
3732
3733
  );
@@ -3748,7 +3749,7 @@ const BadgeListRow = (props) => {
3748
3749
  imageURL: props.imageURL,
3749
3750
  alt: props.displayName,
3750
3751
  level: props.level,
3751
- size: "xxs"
3752
+ size: "xs"
3752
3753
  }
3753
3754
  )),
3754
3755
  /* @__PURE__ */ React__namespace.createElement("div", { className: "min-w-0 flex-1 truncate text-xs font-semibold text-dark-blue-400" }, props.displayName),
@@ -3801,7 +3802,7 @@ const BadgeDetail = (props) => {
3801
3802
  imageURL: props.imageURL,
3802
3803
  alt: props.displayName,
3803
3804
  level: props.level,
3804
- size: "sm"
3805
+ size: "lg"
3805
3806
  }
3806
3807
  )), /* @__PURE__ */ React__namespace.createElement("div", { className: "flex-1" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "text-lg font-extrabold text-dark-blue-400" }, props.displayName), /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-2 text-xs text-slate-500" }, /* @__PURE__ */ React__namespace.createElement("span", { className: "font-semibold" }, "Level ", (props.level || 0) + 1, "."), !!xp && /* @__PURE__ */ React__namespace.createElement("span", { className: "ml-1.5 font-bold text-mint-400" }, xp, " XP")), !!props.summary && /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-2 text-xs text-slate-500" }, props.summary), /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-2.5" }, /* @__PURE__ */ React__namespace.createElement(Pill, { label: status, accent: pillAccent }))))), criteriaNames.length > 0 && /* @__PURE__ */ React__namespace.createElement("div", { className: `rounded-2xl border bg-white p-5 ${border} ${shadow}` }, /* @__PURE__ */ React__namespace.createElement("div", { className: "text-sm font-bold text-dark-blue-400" }, "Badge Criteria"), /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-1.5 text-xs text-slate-500" }, "Complete 1 of each: ", criteriaNames.join(", ")), /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-4 flex flex-col" }, criteria.map((c, i) => {
3807
3808
  var _a;
@@ -5934,7 +5935,15 @@ const PathwayTranscript = (props) => {
5934
5935
  const badgesEarnedCount = completedBadges.length;
5935
5936
  const target = badges.length;
5936
5937
  const anyStarted = badges.some((b) => b.startedAt);
5937
- const status = target > 0 && badgesEarnedCount === target ? "Completed" : anyStarted || badgesEarnedCount > 0 ? "In Progress" : "Available";
5938
+ const criteriaEntries = Object.entries(props.rawCriteria || {});
5939
+ const hasCriteria = criteriaEntries.length > 0;
5940
+ const criteriaMet = hasCriteria && criteriaEntries.every(
5941
+ ([categoryId, threshold]) => {
5942
+ var _a2;
5943
+ return (((_a2 = props.points) == null ? void 0 : _a2[categoryId]) || 0) >= threshold;
5944
+ }
5945
+ );
5946
+ const status = hasCriteria ? criteriaMet ? "Completed" : anyStarted || badgesEarnedCount > 0 ? "In Progress" : "Available" : target > 0 && badgesEarnedCount === target ? "Completed" : anyStarted || badgesEarnedCount > 0 ? "In Progress" : "Available";
5938
5947
  const safeRender = (val) => typeof val === "string" || typeof val === "number" ? val : "";
5939
5948
  const renderBadgePool = (badgePool) => {
5940
5949
  if (badgePool.length === 0)
@@ -6248,7 +6257,7 @@ const PathwayListCard = (props) => {
6248
6257
  className: `overflow-hidden rounded-2xl border bg-white ${border} ${shadow} ${props.onClick ? "cursor-pointer hover:bg-slate-50" : ""}`
6249
6258
  },
6250
6259
  /* @__PURE__ */ React__namespace.createElement("div", { className: `h-1 bg-gradient-to-r ${strip}` }),
6251
- /* @__PURE__ */ React__namespace.createElement("div", { className: "flex gap-4 p-4" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "shrink-0" }, /* @__PURE__ */ React__namespace.createElement(BadgeEmblem, { iconURL: props.imageURL, alt: props.title, size: "xs" })), /* @__PURE__ */ React__namespace.createElement("div", { className: "min-w-0 flex-1" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "text-sm font-bold text-dark-blue-400" }, props.title), props.description && /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-1.5 text-xs text-slate-500" }, props.description), /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-3 flex items-center gap-2.5" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "h-1.5 flex-1" }, /* @__PURE__ */ React__namespace.createElement(Progress, { rounded: true, color: progress, start: value, end: target })), /* @__PURE__ */ React__namespace.createElement("div", { className: "whitespace-nowrap text-[10.5px] font-semibold text-slate-400" }, value, "/", target, " badges"))))
6260
+ /* @__PURE__ */ React__namespace.createElement("div", { className: "flex gap-4 p-4" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "shrink-0" }, /* @__PURE__ */ React__namespace.createElement(BadgeEmblem, { iconURL: props.imageURL, alt: props.title, size: "sm" })), /* @__PURE__ */ React__namespace.createElement("div", { className: "min-w-0 flex-1" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "text-sm font-bold text-dark-blue-400" }, props.title), props.description && /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-1.5 text-xs text-slate-500" }, props.description), /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-3 flex items-center gap-2.5" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "h-1.5 flex-1" }, /* @__PURE__ */ React__namespace.createElement(Progress, { rounded: true, color: progress, start: value, end: target })), /* @__PURE__ */ React__namespace.createElement("div", { className: "whitespace-nowrap text-[10.5px] font-semibold text-slate-400" }, value, "/", target, " badges"))))
6252
6261
  );
6253
6262
  };
6254
6263
 
@@ -6343,7 +6352,15 @@ const PathwayDetail = (props) => {
6343
6352
  const completedCount = badges.filter((b) => b.completedAt).length;
6344
6353
  const target = badges.length;
6345
6354
  const anyStarted = badges.some((b) => b.startedAt);
6346
- const status = target > 0 && completedCount === target ? "Completed" : anyStarted || completedCount > 0 ? "In Progress" : "Available";
6355
+ const criteriaEntries = Object.entries(props.rawCriteria || {});
6356
+ const hasCriteria = criteriaEntries.length > 0;
6357
+ const criteriaMet = hasCriteria && criteriaEntries.every(
6358
+ ([categoryId, threshold]) => {
6359
+ var _a2;
6360
+ return (((_a2 = props.points) == null ? void 0 : _a2[categoryId]) || 0) >= threshold;
6361
+ }
6362
+ );
6363
+ const status = hasCriteria ? criteriaMet ? "Completed" : anyStarted || completedCount > 0 ? "In Progress" : "Available" : target > 0 && completedCount === target ? "Completed" : anyStarted || completedCount > 0 ? "In Progress" : "Available";
6347
6364
  const { border, shadow, pillAccent } = STATUS_CLASSNAMES[status];
6348
6365
  const categoryIds = Object.keys(props.rawCriteria || {});
6349
6366
  const [catFilter, setCatFilter] = React__namespace.useState(null);
@@ -6352,7 +6369,7 @@ const PathwayDetail = (props) => {
6352
6369
  var _a2;
6353
6370
  return (_a2 = b.categories) == null ? void 0 : _a2.includes(catFilter);
6354
6371
  }) : badges;
6355
- return /* @__PURE__ */ React__namespace.createElement("div", { className: "flex max-w-2xl flex-col gap-3.5" }, props.onBack && /* @__PURE__ */ React__namespace.createElement("div", { onClick: props.onBack, className: "w-max cursor-pointer text-xs font-bold text-sky-blue-400" }, "\u2190 Back to My Pathways"), /* @__PURE__ */ React__namespace.createElement("div", { className: `overflow-hidden rounded-2xl border bg-white ${border} ${shadow}` }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex gap-4 p-5" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "shrink-0" }, /* @__PURE__ */ React__namespace.createElement(BadgeEmblem, { iconURL: props.imageURL, alt: props.title, size: "sm" })), /* @__PURE__ */ React__namespace.createElement("div", { className: "flex-1" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "text-lg font-extrabold text-dark-blue-400" }, props.title), !!(props.displayTags && props.displayTags.length) && /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-2 flex flex-wrap gap-1.5" }, props.displayTags.map((tag) => /* @__PURE__ */ React__namespace.createElement(Pill, { key: tag, label: tag, accent: pillAccent }))), !!props.description && /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-2 text-xs text-slate-500" }, props.description), /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-2.5" }, /* @__PURE__ */ React__namespace.createElement(Pill, { label: status, accent: pillAccent }))))), /* @__PURE__ */ React__namespace.createElement("div", { className: `rounded-2xl border bg-white p-5 ${border} ${shadow}` }, /* @__PURE__ */ React__namespace.createElement("div", { className: "text-sm font-bold text-dark-blue-400" }, "Pathway Badges & Criteria"), /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-1.5 text-xs text-slate-500" }, "This pathway is comprised of ", target, " badge", target === 1 ? "" : "s", ". It includes required and elective programming."), !!((_a = props.allCategories) == null ? void 0 : _a.length) && /* @__PURE__ */ React__namespace.createElement(
6372
+ return /* @__PURE__ */ React__namespace.createElement("div", { className: "flex max-w-2xl flex-col gap-3.5" }, props.onBack && /* @__PURE__ */ React__namespace.createElement("div", { onClick: props.onBack, className: "w-max cursor-pointer text-xs font-bold text-sky-blue-400" }, "\u2190 Back to My Pathways"), /* @__PURE__ */ React__namespace.createElement("div", { className: `overflow-hidden rounded-2xl border bg-white ${border} ${shadow}` }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex gap-4 p-5" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "shrink-0" }, /* @__PURE__ */ React__namespace.createElement(BadgeEmblem, { iconURL: props.imageURL, alt: props.title, size: "lg" })), /* @__PURE__ */ React__namespace.createElement("div", { className: "flex-1" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "text-lg font-extrabold text-dark-blue-400" }, props.title), !!(props.displayTags && props.displayTags.length) && /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-2 flex flex-wrap gap-1.5" }, props.displayTags.map((tag) => /* @__PURE__ */ React__namespace.createElement(Pill, { key: tag, label: tag, accent: pillAccent }))), !!props.description && /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-2 text-xs text-slate-500" }, props.description), /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-2.5" }, /* @__PURE__ */ React__namespace.createElement(Pill, { label: status, accent: pillAccent }))))), /* @__PURE__ */ React__namespace.createElement("div", { className: `rounded-2xl border bg-white p-5 ${border} ${shadow}` }, /* @__PURE__ */ React__namespace.createElement("div", { className: "text-sm font-bold text-dark-blue-400" }, "Pathway Badges & Criteria"), /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-1.5 text-xs text-slate-500" }, "This pathway is comprised of ", target, " badge", target === 1 ? "" : "s", ". It includes required and elective programming."), !!((_a = props.allCategories) == null ? void 0 : _a.length) && /* @__PURE__ */ React__namespace.createElement(
6356
6373
  "button",
6357
6374
  {
6358
6375
  onClick: () => setCategoriesOpen(true),