@local-civics/hub-ui 0.1.234 → 0.1.235

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.mjs CHANGED
@@ -6557,7 +6557,22 @@ const PathwayDetail = (props) => {
6557
6557
  );
6558
6558
  const status = hasCriteria ? criteriaMet ? "Completed" : anyStarted || completedCount > 0 ? "In Progress" : "Available" : target > 0 && completedCount === target ? "Completed" : anyStarted || completedCount > 0 ? "In Progress" : "Available";
6559
6559
  const { border, shadow, pillAccent } = STATUS_CLASSNAMES[status];
6560
- const categoryIds = Object.keys(props.rawCriteria || {});
6560
+ const rootCategoryIds = new Set(
6561
+ (props.allCategories || []).filter((c) => !c.parentCategoryId).map((c) => c.categoryId)
6562
+ );
6563
+ const parentById = new Map((props.allCategories || []).map((c) => [c.categoryId, c.parentCategoryId]));
6564
+ const depthOf = (id) => {
6565
+ let depth = 0;
6566
+ let current = id;
6567
+ const seen = /* @__PURE__ */ new Set();
6568
+ while (parentById.get(current) && !seen.has(current)) {
6569
+ seen.add(current);
6570
+ current = parentById.get(current);
6571
+ depth++;
6572
+ }
6573
+ return depth;
6574
+ };
6575
+ const categoryIds = Object.keys(props.rawCriteria || {}).filter((id) => !rootCategoryIds.has(id)).sort((a, b) => depthOf(a) - depthOf(b));
6561
6576
  const [catFilter, setCatFilter] = React.useState(null);
6562
6577
  const [categoriesOpen, setCategoriesOpen] = React.useState(false);
6563
6578
  const filteredBadges = catFilter ? badges.filter((b) => {
@@ -6565,7 +6580,7 @@ const PathwayDetail = (props) => {
6565
6580
  return (_a2 = b.categories) == null ? void 0 : _a2.includes(catFilter);
6566
6581
  }) : badges;
6567
6582
  const pillIds = catFilter && !categoryIds.includes(catFilter) ? [...categoryIds, catFilter] : categoryIds;
6568
- return /* @__PURE__ */ React.createElement("div", { className: "flex w-full flex-col gap-3.5" }, props.onBack && /* @__PURE__ */ React.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.createElement("div", { className: `overflow-hidden rounded-2xl border bg-white ${border} ${shadow}` }, /* @__PURE__ */ React.createElement("div", { className: "flex gap-4 p-5" }, /* @__PURE__ */ React.createElement("div", { className: "shrink-0" }, /* @__PURE__ */ React.createElement(BadgeEmblem, { iconURL: props.imageURL, alt: props.title, size: "lg" })), /* @__PURE__ */ React.createElement("div", { className: "flex-1" }, /* @__PURE__ */ React.createElement("div", { className: "text-lg font-extrabold text-dark-blue-400" }, props.title), !!(props.displayTags && props.displayTags.length) && /* @__PURE__ */ React.createElement("div", { className: "mt-2 flex flex-wrap gap-1.5" }, props.displayTags.map((tag) => /* @__PURE__ */ React.createElement(Pill, { key: tag, label: tag, accent: pillAccent }))), !!props.description && /* @__PURE__ */ React.createElement("div", { className: "mt-2 max-w-prose text-xs text-slate-500" }, props.description), /* @__PURE__ */ React.createElement("div", { className: "mt-2.5" }, /* @__PURE__ */ React.createElement(Pill, { label: status, accent: pillAccent }))))), /* @__PURE__ */ React.createElement("div", { className: `rounded-2xl border bg-white p-5 ${border} ${shadow}` }, /* @__PURE__ */ React.createElement("div", { className: "text-sm font-bold text-dark-blue-400" }, "Pathway Badges & Criteria"), /* @__PURE__ */ React.createElement("div", { className: "mt-1.5 max-w-prose 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.createElement(
6583
+ return /* @__PURE__ */ React.createElement("div", { className: "flex w-full flex-col gap-3.5" }, props.onBack && /* @__PURE__ */ React.createElement("div", { onClick: props.onBack, className: "w-max cursor-pointer text-xs font-bold text-sky-blue-400" }, "\u2190 Back"), /* @__PURE__ */ React.createElement("div", { className: `overflow-hidden rounded-2xl border bg-white ${border} ${shadow}` }, /* @__PURE__ */ React.createElement("div", { className: "flex gap-4 p-5" }, /* @__PURE__ */ React.createElement("div", { className: "shrink-0" }, /* @__PURE__ */ React.createElement(BadgeEmblem, { iconURL: props.imageURL, alt: props.title, size: "lg" })), /* @__PURE__ */ React.createElement("div", { className: "flex-1" }, /* @__PURE__ */ React.createElement("div", { className: "text-lg font-extrabold text-dark-blue-400" }, props.title), !!(props.displayTags && props.displayTags.length) && /* @__PURE__ */ React.createElement("div", { className: "mt-2 flex flex-wrap gap-1.5" }, props.displayTags.map((tag) => /* @__PURE__ */ React.createElement(Pill, { key: tag, label: tag, accent: pillAccent }))), !!props.description && /* @__PURE__ */ React.createElement("div", { className: "mt-2 max-w-prose text-xs text-slate-500" }, props.description), /* @__PURE__ */ React.createElement("div", { className: "mt-2.5" }, /* @__PURE__ */ React.createElement(Pill, { label: status, accent: pillAccent }))))), /* @__PURE__ */ React.createElement("div", { className: `rounded-2xl border bg-white p-5 ${border} ${shadow}` }, /* @__PURE__ */ React.createElement("div", { className: "text-sm font-bold text-dark-blue-400" }, "Pathway Badges & Criteria"), /* @__PURE__ */ React.createElement("div", { className: "mt-1.5 max-w-prose 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.createElement(
6569
6584
  "button",
6570
6585
  {
6571
6586
  onClick: () => setCategoriesOpen(true),
@@ -6995,7 +7010,7 @@ const withDisabled = (config, disabled) => {
6995
7010
 
6996
7011
  const DashboardTopBar = (props) => {
6997
7012
  var _a;
6998
- return /* @__PURE__ */ React.createElement("div", { className: "flex shrink-0 items-center justify-between gap-4 border-b border-sky-blue-400/20 bg-white px-5 py-3.5 shadow-[0_2px_10px_rgba(59,208,242,0.08)]" }, /* @__PURE__ */ React.createElement("div", null, !!((_a = props.breadcrumb) == null ? void 0 : _a.length) && /* @__PURE__ */ React.createElement("nav", { className: "mb-0.5 flex flex-wrap items-center gap-1 text-[11px] font-semibold text-slate-400" }, props.breadcrumb.map((seg, i) => /* @__PURE__ */ React.createElement(React.Fragment, { key: i }, i > 0 && /* @__PURE__ */ React.createElement("span", { className: "text-slate-300" }, "\u203A"), seg.onClick ? /* @__PURE__ */ React.createElement("button", { type: "button", onClick: seg.onClick, className: "hover:text-sky-blue-400 hover:underline" }, seg.label) : /* @__PURE__ */ React.createElement("span", { className: "text-slate-500" }, seg.label)))), props.eyebrow && /* @__PURE__ */ React.createElement("p", { className: "text-[10px] font-bold uppercase tracking-wide text-slate-400" }, props.eyebrow), /* @__PURE__ */ React.createElement("h1", { className: "text-lg font-extrabold text-dark-blue-400" }, props.title), props.subtitle && /* @__PURE__ */ React.createElement("p", { className: "text-xs font-medium text-slate-400" }, props.subtitle)), /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-3" }, props.onNotifications && /* @__PURE__ */ React.createElement(
7013
+ return /* @__PURE__ */ React.createElement("div", { className: "flex shrink-0 items-center justify-between gap-4 border-b border-sky-blue-400/20 bg-white px-5 py-3.5 shadow-[0_2px_10px_rgba(59,208,242,0.08)]" }, /* @__PURE__ */ React.createElement("div", null, props.eyebrow && /* @__PURE__ */ React.createElement("p", { className: "text-[10px] font-bold uppercase tracking-wide text-slate-400" }, props.eyebrow), !!((_a = props.breadcrumb) == null ? void 0 : _a.length) && /* @__PURE__ */ React.createElement("nav", { className: "mb-0.5 mt-0.5 flex flex-wrap items-center gap-1 text-[11px] font-semibold text-slate-400" }, props.breadcrumb.map((seg, i) => /* @__PURE__ */ React.createElement(React.Fragment, { key: i }, i > 0 && /* @__PURE__ */ React.createElement("span", { className: "text-slate-300" }, "\u203A"), seg.onClick ? /* @__PURE__ */ React.createElement("button", { type: "button", onClick: seg.onClick, className: "hover:text-sky-blue-400 hover:underline" }, seg.label) : /* @__PURE__ */ React.createElement("span", { className: "text-slate-500" }, seg.label)))), /* @__PURE__ */ React.createElement("h1", { className: "text-lg font-extrabold text-dark-blue-400" }, props.title), props.subtitle && /* @__PURE__ */ React.createElement("p", { className: "text-xs font-medium text-slate-400" }, props.subtitle)), /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-3" }, props.onNotifications && /* @__PURE__ */ React.createElement(
6999
7014
  "button",
7000
7015
  {
7001
7016
  type: "button",