@local-civics/mgmt-ui 0.1.239 → 0.1.241

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
@@ -147,6 +147,7 @@ type BadgeProps = {
147
147
  lessonsCompleted?: number;
148
148
  pathwayId?: string;
149
149
  breadcrumb?: PageHeaderBreadcrumbSegment[];
150
+ linkState?: any;
150
151
  onBackClick: () => void;
151
152
  onClassChange: (classId: string) => void;
152
153
  onCopyLinkClick: () => void;
@@ -520,6 +521,7 @@ type LessonProps = {
520
521
  name: string;
521
522
  }[];
522
523
  breadcrumb?: PageHeaderBreadcrumbSegment[];
524
+ linkState?: any;
523
525
  onBackClick: () => void;
524
526
  onClassChange: (classId: string) => void;
525
527
  onCopyLinkClick: () => void;
@@ -857,6 +859,7 @@ type PathwayProps = {
857
859
  trial?: boolean;
858
860
  badgesCompleted?: number;
859
861
  breadcrumb?: PageHeaderBreadcrumbSegment[];
862
+ linkState?: any;
860
863
  onBackClick: () => void;
861
864
  onClassChange: (classId: string) => void;
862
865
  onCopyLinkClick: () => void;
package/dist/index.js CHANGED
@@ -487,7 +487,7 @@ function Stack$4(props) {
487
487
  if (props.items.length === 0) {
488
488
  return null;
489
489
  }
490
- return /* @__PURE__ */ React__namespace.createElement("div", { className: "flex flex-col gap-2" }, props.items.map((row) => /* @__PURE__ */ React__namespace.createElement("div", { key: row.lessonName, className: "flex items-center justify-between gap-4 py-1.5" }, /* @__PURE__ */ React__namespace.createElement(reactRouterDom.Link, { to: row.href, className: "text-sm font-bold text-dark-blue-400 no-underline hover:underline" }, row.lessonName), row.completion >= 1 && /* @__PURE__ */ React__namespace.createElement("span", { className: "shrink-0 rounded-full bg-mint-100 px-2.5 py-1 text-[10px] font-bold text-dark-blue-400" }, "Complete"), row.completion === 0 && !row.isStarted && /* @__PURE__ */ React__namespace.createElement("span", { className: "shrink-0 rounded-full bg-slate-100 px-2.5 py-1 text-[10px] font-bold text-slate-500" }, "Not started"), row.completion > 0 && row.completion < 1 && /* @__PURE__ */ React__namespace.createElement("span", { className: "shrink-0 rounded-full bg-gold-100 px-2.5 py-1 text-[10px] font-bold text-dark-blue-400" }, Math.round((row.completion + Number.EPSILON) * 100), "% Complete"))));
490
+ return /* @__PURE__ */ React__namespace.createElement("div", { className: "flex flex-col gap-2" }, props.items.map((row) => /* @__PURE__ */ React__namespace.createElement("div", { key: row.lessonName, className: "flex items-center justify-between gap-4 py-1.5" }, /* @__PURE__ */ React__namespace.createElement(reactRouterDom.Link, { to: row.href, state: props.state, className: "text-sm font-bold text-dark-blue-400 no-underline hover:underline" }, row.lessonName), row.completion >= 1 && /* @__PURE__ */ React__namespace.createElement("span", { className: "shrink-0 rounded-full bg-mint-100 px-2.5 py-1 text-[10px] font-bold text-dark-blue-400" }, "Complete"), row.completion === 0 && !row.isStarted && /* @__PURE__ */ React__namespace.createElement("span", { className: "shrink-0 rounded-full bg-slate-100 px-2.5 py-1 text-[10px] font-bold text-slate-500" }, "Not started"), row.completion > 0 && row.completion < 1 && /* @__PURE__ */ React__namespace.createElement("span", { className: "shrink-0 rounded-full bg-gold-100 px-2.5 py-1 text-[10px] font-bold text-dark-blue-400" }, Math.round((row.completion + Number.EPSILON) * 100), "% Complete"))));
491
491
  }
492
492
 
493
493
  function useSortableData(items, config = { key: "", direction: null }) {
@@ -579,7 +579,7 @@ function Table$k(props) {
579
579
  /* @__PURE__ */ React__namespace.createElement("div", { className: "flex min-w-0 flex-1 items-center gap-3" }, row.avatar ? /* @__PURE__ */ React__namespace.createElement("img", { src: row.avatar, className: "h-9 w-9 shrink-0 rounded-full object-cover", alt: "" }) : /* @__PURE__ */ React__namespace.createElement("div", { className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-mint-400/20 text-xs font-bold text-dark-blue-400" }, initials), /* @__PURE__ */ React__namespace.createElement("div", { className: "min-w-0" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "truncate text-sm font-bold text-dark-blue-400" }, row.name), /* @__PURE__ */ React__namespace.createElement("div", { className: "truncate text-xs text-slate-400" }, row.email))),
580
580
  /* @__PURE__ */ React__namespace.createElement("div", { className: "w-28 shrink-0 text-center" }, row.isComplete ? /* @__PURE__ */ React__namespace.createElement("span", { className: "rounded-full bg-mint-100 px-2.5 py-1 text-[10px] font-bold text-dark-blue-400" }, "Complete") : /* @__PURE__ */ React__namespace.createElement("span", { className: "rounded-full bg-slate-100 px-2.5 py-1 text-[10px] font-bold text-slate-500" }, "Incomplete")),
581
581
  /* @__PURE__ */ React__namespace.createElement(icons.IconChevronDown, { size: 15, stroke: 2.3, className: `shrink-0 text-slate-400 transition-transform ${isOpen ? "rotate-180" : ""}` })
582
- ), isOpen && /* @__PURE__ */ React__namespace.createElement("div", { className: "border-t border-slate-100 px-4 py-3" }, /* @__PURE__ */ React__namespace.createElement(Stack$4, { items: row.lessons })));
582
+ ), isOpen && /* @__PURE__ */ React__namespace.createElement("div", { className: "border-t border-slate-100 px-4 py-3" }, /* @__PURE__ */ React__namespace.createElement(Stack$4, { items: row.lessons, state: props.linkState })));
583
583
  }));
584
584
  }
585
585
 
@@ -663,7 +663,7 @@ const Badge = (props) => {
663
663
  className: `rounded-lg px-4 py-2 text-xs font-bold ${tab === t.value ? "bg-sky-blue-400/20 text-dark-blue-400" : "text-slate-400 hover:text-slate-600"}`
664
664
  },
665
665
  t.label
666
- ))), (!!props.trial || tab === "lessons") && /* @__PURE__ */ React__namespace.createElement(Table$j, { loading: props.loading, items: props.lessons }), !props.trial && tab === "students" && /* @__PURE__ */ React__namespace.createElement(Table$k, { loading: props.loading, items: props.students })));
666
+ ))), (!!props.trial || tab === "lessons") && /* @__PURE__ */ React__namespace.createElement(Table$j, { loading: props.loading, items: props.lessons }), !props.trial && tab === "students" && /* @__PURE__ */ React__namespace.createElement(Table$k, { loading: props.loading, items: props.students, linkState: props.linkState })));
667
667
  };
668
668
 
669
669
  function Table$i(props) {
@@ -1681,9 +1681,9 @@ const SplitButton$3 = (props) => {
1681
1681
 
1682
1682
  function Stack$3(props) {
1683
1683
  if (props.items.length === 0) {
1684
- return null;
1684
+ return /* @__PURE__ */ React__namespace.createElement(reactRouterDom.Link, { to: props.href, state: props.state, className: "block text-sm font-bold text-dark-blue-400 no-underline hover:underline" }, "No question responses recorded yet - view full response \u2192");
1685
1685
  }
1686
- return /* @__PURE__ */ React__namespace.createElement(reactRouterDom.Link, { to: props.href, className: "flex flex-col gap-4 no-underline" }, props.items.map((row) => /* @__PURE__ */ React__namespace.createElement("div", { key: row.questionName }, /* @__PURE__ */ React__namespace.createElement("div", { className: "text-sm font-bold text-dark-blue-400" }, row.questionName), /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-1 text-sm text-slate-600" }, row.answer.join(", ") || "No answer."))));
1686
+ return /* @__PURE__ */ React__namespace.createElement(reactRouterDom.Link, { to: props.href, state: props.state, className: "flex flex-col gap-4 no-underline" }, props.items.map((row) => /* @__PURE__ */ React__namespace.createElement("div", { key: row.questionName }, /* @__PURE__ */ React__namespace.createElement("div", { className: "text-sm font-bold text-dark-blue-400" }, row.questionName), /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-1 text-sm text-slate-600" }, row.answer.join(", ") || "No answer."))), /* @__PURE__ */ React__namespace.createElement("div", { className: "text-xs font-bold text-dark-blue-400 hover:underline" }, "View full response \u2192"));
1687
1687
  }
1688
1688
 
1689
1689
  var __defProp$d = Object.defineProperty;
@@ -1737,7 +1737,7 @@ function Table$6(props) {
1737
1737
  /* @__PURE__ */ React__namespace.createElement("div", { className: "flex min-w-0 flex-1 items-center gap-3" }, row.avatar ? /* @__PURE__ */ React__namespace.createElement("img", { src: row.avatar, className: "h-9 w-9 shrink-0 rounded-full object-cover", alt: "" }) : /* @__PURE__ */ React__namespace.createElement("div", { className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-mint-400/20 text-xs font-bold text-dark-blue-400" }, initials), /* @__PURE__ */ React__namespace.createElement("div", { className: "min-w-0" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "truncate text-sm font-bold text-dark-blue-400" }, row.name), /* @__PURE__ */ React__namespace.createElement("div", { className: "truncate text-xs text-slate-400" }, row.email))),
1738
1738
  /* @__PURE__ */ React__namespace.createElement("div", { className: "w-28 shrink-0 text-center" }, row.isComplete && /* @__PURE__ */ React__namespace.createElement("span", { className: "rounded-full bg-mint-100 px-2.5 py-1 text-[10px] font-bold text-dark-blue-400" }, "Complete"), !row.isComplete && !row.isStarted && /* @__PURE__ */ React__namespace.createElement("span", { className: "rounded-full bg-slate-100 px-2.5 py-1 text-[10px] font-bold text-slate-500" }, "Not started"), !row.isComplete && !!row.isStarted && /* @__PURE__ */ React__namespace.createElement("span", { className: "rounded-full bg-gold-100 px-2.5 py-1 text-[10px] font-bold text-dark-blue-400" }, "In progress")),
1739
1739
  /* @__PURE__ */ React__namespace.createElement(icons.IconChevronDown, { size: 15, stroke: 2.3, className: `shrink-0 text-slate-400 transition-transform ${isOpen ? "rotate-180" : ""}` })
1740
- ), isOpen && /* @__PURE__ */ React__namespace.createElement("div", { className: "border-t border-slate-100 px-4 py-3" }, /* @__PURE__ */ React__namespace.createElement(Stack$3, { href: row.href, items: row.answers })));
1740
+ ), isOpen && /* @__PURE__ */ React__namespace.createElement("div", { className: "border-t border-slate-100 px-4 py-3" }, /* @__PURE__ */ React__namespace.createElement(Stack$3, { href: row.href, items: row.answers, state: props.linkState })));
1741
1741
  }));
1742
1742
  }
1743
1743
 
@@ -1870,7 +1870,7 @@ const Lesson = (props) => {
1870
1870
  className: `rounded-lg px-4 py-2 text-xs font-bold ${tab === t.value ? "bg-sky-blue-400/20 text-dark-blue-400" : "text-slate-400 hover:text-slate-600"}`
1871
1871
  },
1872
1872
  t.label
1873
- ))), tab === "question" && /* @__PURE__ */ React__namespace.createElement(Stack$2, { loading: props.loading, items: props.questions }), tab === "reflections" && /* @__PURE__ */ React__namespace.createElement(Table$7, { loading: props.loading, items: props.reflections }), tab === "students" && /* @__PURE__ */ React__namespace.createElement(Table$6, { loading: props.loading, items: props.students })));
1873
+ ))), tab === "question" && /* @__PURE__ */ React__namespace.createElement(Stack$2, { loading: props.loading, items: props.questions }), tab === "reflections" && /* @__PURE__ */ React__namespace.createElement(Table$7, { loading: props.loading, items: props.reflections }), tab === "students" && /* @__PURE__ */ React__namespace.createElement(Table$6, { loading: props.loading, items: props.students, linkState: props.linkState })));
1874
1874
  };
1875
1875
 
1876
1876
  function Table$5(props) {
@@ -3126,7 +3126,7 @@ function Stack$1(props) {
3126
3126
  if (props.items.length === 0) {
3127
3127
  return null;
3128
3128
  }
3129
- return /* @__PURE__ */ React__namespace.createElement("div", { className: "flex flex-col gap-2" }, props.items.map((row) => /* @__PURE__ */ React__namespace.createElement("div", { key: row.badgeName, className: "flex items-center justify-between gap-4 py-1.5" }, /* @__PURE__ */ React__namespace.createElement(reactRouterDom.Link, { to: row.href, className: "text-sm font-bold text-dark-blue-400 no-underline hover:underline" }, row.badgeName), row.completion >= 1 && /* @__PURE__ */ React__namespace.createElement("span", { className: "shrink-0 rounded-full bg-mint-100 px-2.5 py-1 text-[10px] font-bold text-dark-blue-400" }, "Complete"), row.completion === 0 && !row.isStarted && /* @__PURE__ */ React__namespace.createElement("span", { className: "shrink-0 rounded-full bg-slate-100 px-2.5 py-1 text-[10px] font-bold text-slate-500" }, "Not started"), row.completion > 0 && row.completion < 1 && /* @__PURE__ */ React__namespace.createElement("span", { className: "shrink-0 rounded-full bg-gold-100 px-2.5 py-1 text-[10px] font-bold text-dark-blue-400" }, Math.round((row.completion + Number.EPSILON) * 100), "% Complete"))));
3129
+ return /* @__PURE__ */ React__namespace.createElement("div", { className: "flex flex-col gap-2" }, props.items.map((row) => /* @__PURE__ */ React__namespace.createElement("div", { key: row.badgeName, className: "flex items-center justify-between gap-4 py-1.5" }, /* @__PURE__ */ React__namespace.createElement(reactRouterDom.Link, { to: row.href, state: props.state, className: "text-sm font-bold text-dark-blue-400 no-underline hover:underline" }, row.badgeName), row.completion >= 1 && /* @__PURE__ */ React__namespace.createElement("span", { className: "shrink-0 rounded-full bg-mint-100 px-2.5 py-1 text-[10px] font-bold text-dark-blue-400" }, "Complete"), row.completion === 0 && !row.isStarted && /* @__PURE__ */ React__namespace.createElement("span", { className: "shrink-0 rounded-full bg-slate-100 px-2.5 py-1 text-[10px] font-bold text-slate-500" }, "Not started"), row.completion > 0 && row.completion < 1 && /* @__PURE__ */ React__namespace.createElement("span", { className: "shrink-0 rounded-full bg-gold-100 px-2.5 py-1 text-[10px] font-bold text-dark-blue-400" }, Math.round((row.completion + Number.EPSILON) * 100), "% Complete"))));
3130
3130
  }
3131
3131
 
3132
3132
  var __defProp$5 = Object.defineProperty;
@@ -3183,7 +3183,7 @@ function Table$2(props) {
3183
3183
  return /* @__PURE__ */ React__namespace.createElement("div", { key: category.categoryId, className: "w-24 shrink-0 text-center" }, /* @__PURE__ */ React__namespace.createElement("span", { className: "rounded-full bg-sky-blue-400/15 px-2.5 py-1 text-[10px] font-bold text-dark-blue-400" }, (_a2 = row[category.categoryId]) != null ? _a2 : 0, " pts"));
3184
3184
  }),
3185
3185
  /* @__PURE__ */ React__namespace.createElement(icons.IconChevronDown, { size: 15, stroke: 2.3, className: `shrink-0 text-slate-400 transition-transform ${isOpen ? "rotate-180" : ""}` })
3186
- ), isOpen && /* @__PURE__ */ React__namespace.createElement("div", { className: "border-t border-slate-100 px-4 py-3" }, /* @__PURE__ */ React__namespace.createElement(Stack$1, { items: row.badges })));
3186
+ ), isOpen && /* @__PURE__ */ React__namespace.createElement("div", { className: "border-t border-slate-100 px-4 py-3" }, /* @__PURE__ */ React__namespace.createElement(Stack$1, { items: row.badges, state: props.linkState })));
3187
3187
  }));
3188
3188
  }
3189
3189
 
@@ -3415,7 +3415,7 @@ const Pathway = (props) => {
3415
3415
  className: `rounded-lg px-4 py-2 text-xs font-bold ${tab === t.value ? "bg-sky-blue-400/20 text-dark-blue-400" : "text-slate-400 hover:text-slate-600"}`
3416
3416
  },
3417
3417
  t.label
3418
- ))), (!!props.trial || tab === "badges") && /* @__PURE__ */ React__namespace.createElement(Table$1, { loading: props.loading, badges: props.badges, categories: badgeGroupCategories, activeCategoryId: selectedCategoryId, activeCategoryLabel: selectedCategoryName }), !props.trial && tab === "students" && /* @__PURE__ */ React__namespace.createElement(Table$2, { loading: props.loading, items: props.students, categories: props.categories })), /* @__PURE__ */ React__namespace.createElement(
3418
+ ))), (!!props.trial || tab === "badges") && /* @__PURE__ */ React__namespace.createElement(Table$1, { loading: props.loading, badges: props.badges, categories: badgeGroupCategories, activeCategoryId: selectedCategoryId, activeCategoryLabel: selectedCategoryName }), !props.trial && tab === "students" && /* @__PURE__ */ React__namespace.createElement(Table$2, { loading: props.loading, items: props.students, categories: props.categories, linkState: props.linkState })), /* @__PURE__ */ React__namespace.createElement(
3419
3419
  CategoriesModal,
3420
3420
  {
3421
3421
  opened: categoriesOpen,