@local-civics/hub-ui 0.1.234 → 0.1.236

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.d.ts CHANGED
@@ -329,7 +329,6 @@ type BadgeDetailProps = {
329
329
  choices?: BadgeActivityProps[];
330
330
  canSubmit?: boolean;
331
331
  finishedAt?: string;
332
- onPathwayClick?: () => void;
333
332
  onSubmit?: () => void;
334
333
  };
335
334
  /**
package/dist/index.js CHANGED
@@ -3933,7 +3933,7 @@ const BadgeDetail = (props) => {
3933
3933
  const status = props.finishedAt ? "Completed" : anyStarted || xp > 0 ? "In Progress" : "Available";
3934
3934
  const { border, shadow, pillAccent } = STATUS_CLASSNAMES$1[status];
3935
3935
  const showSubmit = !props.finishedAt && criteria.length > 0;
3936
- return /* @__PURE__ */ React__namespace.createElement("div", { className: "flex w-full flex-col gap-3.5" }, props.onPathwayClick && /* @__PURE__ */ React__namespace.createElement("div", { onClick: props.onPathwayClick, className: "w-max cursor-pointer text-xs font-bold text-sky-blue-400" }, "\u2190 Go to Pathway"), /* @__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(
3936
+ return /* @__PURE__ */ React__namespace.createElement("div", { className: "flex w-full flex-col gap-3.5" }, /* @__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(
3937
3937
  BadgeEmblem,
3938
3938
  {
3939
3939
  icon: props.icon,
@@ -6577,7 +6577,22 @@ const PathwayDetail = (props) => {
6577
6577
  );
6578
6578
  const status = hasCriteria ? criteriaMet ? "Completed" : anyStarted || completedCount > 0 ? "In Progress" : "Available" : target > 0 && completedCount === target ? "Completed" : anyStarted || completedCount > 0 ? "In Progress" : "Available";
6579
6579
  const { border, shadow, pillAccent } = STATUS_CLASSNAMES[status];
6580
- const categoryIds = Object.keys(props.rawCriteria || {});
6580
+ const rootCategoryIds = new Set(
6581
+ (props.allCategories || []).filter((c) => !c.parentCategoryId).map((c) => c.categoryId)
6582
+ );
6583
+ const parentById = new Map((props.allCategories || []).map((c) => [c.categoryId, c.parentCategoryId]));
6584
+ const depthOf = (id) => {
6585
+ let depth = 0;
6586
+ let current = id;
6587
+ const seen = /* @__PURE__ */ new Set();
6588
+ while (parentById.get(current) && !seen.has(current)) {
6589
+ seen.add(current);
6590
+ current = parentById.get(current);
6591
+ depth++;
6592
+ }
6593
+ return depth;
6594
+ };
6595
+ const categoryIds = Object.keys(props.rawCriteria || {}).filter((id) => !rootCategoryIds.has(id)).sort((a, b) => depthOf(a) - depthOf(b));
6581
6596
  const [catFilter, setCatFilter] = React__namespace.useState(null);
6582
6597
  const [categoriesOpen, setCategoriesOpen] = React__namespace.useState(false);
6583
6598
  const filteredBadges = catFilter ? badges.filter((b) => {
@@ -6585,7 +6600,7 @@ const PathwayDetail = (props) => {
6585
6600
  return (_a2 = b.categories) == null ? void 0 : _a2.includes(catFilter);
6586
6601
  }) : badges;
6587
6602
  const pillIds = catFilter && !categoryIds.includes(catFilter) ? [...categoryIds, catFilter] : categoryIds;
6588
- return /* @__PURE__ */ React__namespace.createElement("div", { className: "flex w-full 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 max-w-prose 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 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__namespace.createElement(
6603
+ return /* @__PURE__ */ React__namespace.createElement("div", { className: "flex w-full 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"), /* @__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 max-w-prose 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 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__namespace.createElement(
6589
6604
  "button",
6590
6605
  {
6591
6606
  onClick: () => setCategoriesOpen(true),
@@ -7015,7 +7030,7 @@ const withDisabled = (config, disabled) => {
7015
7030
 
7016
7031
  const DashboardTopBar = (props) => {
7017
7032
  var _a;
7018
- return /* @__PURE__ */ React__namespace.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__namespace.createElement("div", null, !!((_a = props.breadcrumb) == null ? void 0 : _a.length) && /* @__PURE__ */ React__namespace.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__namespace.createElement(React__namespace.Fragment, { key: i }, i > 0 && /* @__PURE__ */ React__namespace.createElement("span", { className: "text-slate-300" }, "\u203A"), seg.onClick ? /* @__PURE__ */ React__namespace.createElement("button", { type: "button", onClick: seg.onClick, className: "hover:text-sky-blue-400 hover:underline" }, seg.label) : /* @__PURE__ */ React__namespace.createElement("span", { className: "text-slate-500" }, seg.label)))), props.eyebrow && /* @__PURE__ */ React__namespace.createElement("p", { className: "text-[10px] font-bold uppercase tracking-wide text-slate-400" }, props.eyebrow), /* @__PURE__ */ React__namespace.createElement("h1", { className: "text-lg font-extrabold text-dark-blue-400" }, props.title), props.subtitle && /* @__PURE__ */ React__namespace.createElement("p", { className: "text-xs font-medium text-slate-400" }, props.subtitle)), /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center gap-3" }, props.onNotifications && /* @__PURE__ */ React__namespace.createElement(
7033
+ return /* @__PURE__ */ React__namespace.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__namespace.createElement("div", null, props.eyebrow && /* @__PURE__ */ React__namespace.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__namespace.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__namespace.createElement(React__namespace.Fragment, { key: i }, i > 0 && /* @__PURE__ */ React__namespace.createElement("span", { className: "text-slate-300" }, "\u203A"), seg.onClick ? /* @__PURE__ */ React__namespace.createElement("button", { type: "button", onClick: seg.onClick, className: "hover:text-sky-blue-400 hover:underline" }, seg.label) : /* @__PURE__ */ React__namespace.createElement("span", { className: "text-slate-500" }, seg.label)))), /* @__PURE__ */ React__namespace.createElement("h1", { className: "text-lg font-extrabold text-dark-blue-400" }, props.title), props.subtitle && /* @__PURE__ */ React__namespace.createElement("p", { className: "text-xs font-medium text-slate-400" }, props.subtitle)), /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center gap-3" }, props.onNotifications && /* @__PURE__ */ React__namespace.createElement(
7019
7034
  "button",
7020
7035
  {
7021
7036
  type: "button",