@local-civics/mgmt-ui 0.1.189 → 0.1.191

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
@@ -397,6 +397,7 @@ type HomeProps = {
397
397
  onPathwaysClick: () => void;
398
398
  onBadgesClick: () => void;
399
399
  onLessonsClick: () => void;
400
+ onFileLockerClick: () => void;
400
401
  };
401
402
  /**
402
403
  * Home
package/dist/index.js CHANGED
@@ -34,30 +34,30 @@ function _interopNamespaceDefault(e) {
34
34
  var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
35
35
  var papa__namespace = /*#__PURE__*/_interopNamespaceDefault(papa);
36
36
 
37
- var __defProp$a = Object.defineProperty;
38
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
39
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
40
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
41
- var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
42
- var __spreadValues$a = (a, b) => {
37
+ var __defProp$c = Object.defineProperty;
38
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
39
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
40
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
41
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
42
+ var __spreadValues$c = (a, b) => {
43
43
  for (var prop in b || (b = {}))
44
- if (__hasOwnProp$a.call(b, prop))
45
- __defNormalProp$a(a, prop, b[prop]);
46
- if (__getOwnPropSymbols$a)
47
- for (var prop of __getOwnPropSymbols$a(b)) {
48
- if (__propIsEnum$a.call(b, prop))
49
- __defNormalProp$a(a, prop, b[prop]);
44
+ if (__hasOwnProp$c.call(b, prop))
45
+ __defNormalProp$c(a, prop, b[prop]);
46
+ if (__getOwnPropSymbols$c)
47
+ for (var prop of __getOwnPropSymbols$c(b)) {
48
+ if (__propIsEnum$c.call(b, prop))
49
+ __defNormalProp$c(a, prop, b[prop]);
50
50
  }
51
51
  return a;
52
52
  };
53
53
  var __objRest$2 = (source, exclude) => {
54
54
  var target = {};
55
55
  for (var prop in source)
56
- if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
56
+ if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
57
57
  target[prop] = source[prop];
58
- if (source != null && __getOwnPropSymbols$a)
59
- for (var prop of __getOwnPropSymbols$a(source)) {
60
- if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
58
+ if (source != null && __getOwnPropSymbols$c)
59
+ for (var prop of __getOwnPropSymbols$c(source)) {
60
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
61
61
  target[prop] = source[prop];
62
62
  }
63
63
  return target;
@@ -74,7 +74,7 @@ const useStyles$w = core.createStyles((theme) => ({
74
74
  function UserButton(_a) {
75
75
  var _b = _a, { image, name, email, icon } = _b, others = __objRest$2(_b, ["image", "name", "email", "icon"]);
76
76
  const { classes } = useStyles$w();
77
- return /* @__PURE__ */ React__namespace.createElement(core.Group, __spreadValues$a({ className: classes.user }, others), /* @__PURE__ */ React__namespace.createElement(core.Avatar, { src: image, radius: "xl" }), /* @__PURE__ */ React__namespace.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "sm", weight: 500 }, name), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", size: "xs" }, email)));
77
+ return /* @__PURE__ */ React__namespace.createElement(core.Group, __spreadValues$c({ className: classes.user }, others), /* @__PURE__ */ React__namespace.createElement(core.Avatar, { src: image, radius: "xl" }), /* @__PURE__ */ React__namespace.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "sm", weight: 500 }, name), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", size: "xs" }, email)));
78
78
  }
79
79
 
80
80
  const compact = (num) => {
@@ -182,25 +182,25 @@ function LinksGroup({ icon: Icon, href, label, initiallyOpened, links, active, n
182
182
  ), hasLinks ? /* @__PURE__ */ React__namespace.createElement(core.Collapse, { in: opened }, items) : null);
183
183
  }
184
184
 
185
- var __defProp$9 = Object.defineProperty;
186
- var __defProps$6 = Object.defineProperties;
187
- var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
188
- var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
189
- var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
190
- var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
191
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
192
- var __spreadValues$9 = (a, b) => {
185
+ var __defProp$b = Object.defineProperty;
186
+ var __defProps$8 = Object.defineProperties;
187
+ var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
188
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
189
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
190
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
191
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
192
+ var __spreadValues$b = (a, b) => {
193
193
  for (var prop in b || (b = {}))
194
- if (__hasOwnProp$9.call(b, prop))
195
- __defNormalProp$9(a, prop, b[prop]);
196
- if (__getOwnPropSymbols$9)
197
- for (var prop of __getOwnPropSymbols$9(b)) {
198
- if (__propIsEnum$9.call(b, prop))
199
- __defNormalProp$9(a, prop, b[prop]);
194
+ if (__hasOwnProp$b.call(b, prop))
195
+ __defNormalProp$b(a, prop, b[prop]);
196
+ if (__getOwnPropSymbols$b)
197
+ for (var prop of __getOwnPropSymbols$b(b)) {
198
+ if (__propIsEnum$b.call(b, prop))
199
+ __defNormalProp$b(a, prop, b[prop]);
200
200
  }
201
201
  return a;
202
202
  };
203
- var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
203
+ var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
204
204
  const useStyles$u = core.createStyles((theme, _params, getRef) => {
205
205
  const icon = getRef("icon");
206
206
  return {
@@ -232,7 +232,7 @@ const useStyles$u = core.createStyles((theme, _params, getRef) => {
232
232
  color: theme.colorScheme === "dark" ? theme.white : theme.black,
233
233
  borderBottom: `1px solid ${theme.colorScheme === "dark" ? theme.colors.dark[4] : theme.colors.gray[3]}`
234
234
  },
235
- link: __spreadProps$6(__spreadValues$9({}, theme.fn.focusStyles()), {
235
+ link: __spreadProps$8(__spreadValues$b({}, theme.fn.focusStyles()), {
236
236
  display: "flex",
237
237
  alignItems: "center",
238
238
  textDecoration: "none",
@@ -286,6 +286,7 @@ const data = [
286
286
  { label: "Pathways", icon: icons.IconRoute },
287
287
  { label: "Badges", icon: icons.IconAlbum },
288
288
  { label: "Lessons", icon: icons.IconLambda },
289
+ { label: "File Locker", icon: icons.IconClipboard },
289
290
  {
290
291
  label: "Organization",
291
292
  icon: icons.IconBuilding,
@@ -314,12 +315,12 @@ function Navbar(props) {
314
315
  }
315
316
  return /* @__PURE__ */ React__namespace.createElement(
316
317
  LinksGroup,
317
- __spreadProps$6(__spreadValues$9(__spreadValues$9({
318
+ __spreadProps$8(__spreadValues$b(__spreadValues$b({
318
319
  key: item.label,
319
320
  active: props.active
320
321
  }, item), context), {
321
322
  links: (item.links || []).map((link) => {
322
- return __spreadValues$9(__spreadValues$9({}, link), props.links[`${item.label}/${link.label}`] || { notifications: 0, href: "" });
323
+ return __spreadValues$b(__spreadValues$b({}, link), props.links[`${item.label}/${link.label}`] || { notifications: 0, href: "" });
323
324
  })
324
325
  })
325
326
  );
@@ -624,7 +625,72 @@ function Stack$3(props) {
624
625
  return /* @__PURE__ */ React__namespace.createElement(core.Grid, { grow: true, gutter: "lg", sx: { padding: 20, minWidth: 700 } }, rows);
625
626
  }
626
627
 
628
+ function useSortableData(items, config = { key: "", direction: null }) {
629
+ const [sortConfig, setSortConfig] = React.useState(config);
630
+ const sortedItems = React.useMemo(() => {
631
+ let sortableItems = [...items];
632
+ if (sortConfig.direction !== null) {
633
+ sortableItems.sort((a, b) => {
634
+ const aValue = a[sortConfig.key];
635
+ const bValue = b[sortConfig.key];
636
+ if (aValue === bValue)
637
+ return 0;
638
+ if (aValue === null || aValue === void 0)
639
+ return 1;
640
+ if (bValue === null || bValue === void 0)
641
+ return -1;
642
+ if (typeof aValue === "number" && typeof bValue === "number") {
643
+ return sortConfig.direction === "asc" ? aValue - bValue : bValue - aValue;
644
+ }
645
+ if (typeof aValue === "boolean" && typeof bValue === "boolean") {
646
+ return sortConfig.direction === "asc" ? aValue === bValue ? 0 : aValue ? 1 : -1 : aValue === bValue ? 0 : aValue ? -1 : 1;
647
+ }
648
+ if (aValue instanceof Date && bValue instanceof Date) {
649
+ return sortConfig.direction === "asc" ? aValue.getTime() - bValue.getTime() : bValue.getTime() - aValue.getTime();
650
+ }
651
+ return sortConfig.direction === "asc" ? String(aValue).localeCompare(String(bValue)) : String(bValue).localeCompare(String(aValue));
652
+ });
653
+ }
654
+ return sortableItems;
655
+ }, [items, sortConfig]);
656
+ const requestSort = (key) => {
657
+ let direction = "asc";
658
+ if (sortConfig.key === key && sortConfig.direction === "asc") {
659
+ direction = "desc";
660
+ } else if (sortConfig.key === key && sortConfig.direction === "desc") {
661
+ direction = null;
662
+ }
663
+ setSortConfig({ key, direction });
664
+ };
665
+ return { items: sortedItems, requestSort, sortConfig };
666
+ }
667
+
668
+ var __defProp$a = Object.defineProperty;
669
+ var __defProps$7 = Object.defineProperties;
670
+ var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
671
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
672
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
673
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
674
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
675
+ var __spreadValues$a = (a, b) => {
676
+ for (var prop in b || (b = {}))
677
+ if (__hasOwnProp$a.call(b, prop))
678
+ __defNormalProp$a(a, prop, b[prop]);
679
+ if (__getOwnPropSymbols$a)
680
+ for (var prop of __getOwnPropSymbols$a(b)) {
681
+ if (__propIsEnum$a.call(b, prop))
682
+ __defNormalProp$a(a, prop, b[prop]);
683
+ }
684
+ return a;
685
+ };
686
+ var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
627
687
  function Table$j(props) {
688
+ const preparedItems = React__namespace.useMemo(() => {
689
+ return props.items.map((item) => __spreadProps$7(__spreadValues$a({}, item), {
690
+ status: item.isComplete ? 1 : 0
691
+ }));
692
+ }, [props.items]);
693
+ const { items: sortedItems, requestSort, sortConfig } = useSortableData(preparedItems);
628
694
  if (props.items.length === 0) {
629
695
  return /* @__PURE__ */ React__namespace.createElement(
630
696
  PlaceholderBanner,
@@ -636,6 +702,10 @@ function Table$j(props) {
636
702
  }
637
703
  );
638
704
  }
705
+ const sortStatus = {
706
+ columnAccessor: sortConfig.key,
707
+ direction: sortConfig.direction === "desc" ? "desc" : "asc"
708
+ };
639
709
  return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(
640
710
  mantineDatatable.DataTable,
641
711
  {
@@ -646,14 +716,19 @@ function Table$j(props) {
646
716
  withColumnBorders: true,
647
717
  striped: true,
648
718
  highlightOnHover: true,
649
- records: props.items,
719
+ records: sortedItems,
720
+ sortStatus,
721
+ onSortStatusChange: (status) => requestSort(status.columnAccessor),
650
722
  idAccessor: "userId",
651
723
  columns: [{
652
724
  accessor: "name",
653
725
  title: "Student Name",
726
+ sortable: true,
654
727
  render: (row) => /* @__PURE__ */ React__namespace.createElement(core.Group, { spacing: "sm" }, /* @__PURE__ */ React__namespace.createElement(core.Avatar, { size: 40, src: row.avatar, radius: 40 }), /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "sm", weight: 500 }, row.name), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "xs", color: "dimmed" }, row.email)))
655
728
  }, {
656
729
  accessor: "status",
730
+ title: "Status",
731
+ sortable: true,
657
732
  render: (row) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, !!row.isComplete && /* @__PURE__ */ React__namespace.createElement(core.Badge, { variant: "filled" }, "Complete"), !row.isComplete && /* @__PURE__ */ React__namespace.createElement(core.Badge, { color: "red", variant: "filled" }, "Incomplete"))
658
733
  }],
659
734
  rowExpansion: {
@@ -664,6 +739,7 @@ function Table$j(props) {
664
739
  }
665
740
 
666
741
  function Table$i(props) {
742
+ const { items: sortedItems, requestSort, sortConfig } = useSortableData(props.items);
667
743
  if (props.items.length === 0) {
668
744
  return /* @__PURE__ */ React__namespace.createElement(
669
745
  PlaceholderBanner,
@@ -675,11 +751,36 @@ function Table$i(props) {
675
751
  }
676
752
  );
677
753
  }
678
- const rows = props.items.map((row) => {
679
- const percentageCompletion = Math.round((row.percentageCompletion + Number.EPSILON) * 100);
680
- return /* @__PURE__ */ React__namespace.createElement("tr", { key: row.lessonName }, /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.Text, { component: reactRouterDom.Link, to: row.href }, row.lessonName)), /* @__PURE__ */ React__namespace.createElement("td", null, percentageCompletion, "%"));
681
- });
682
- return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Lesson Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Lesson Completion"))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
754
+ const sortStatus = {
755
+ columnAccessor: sortConfig.key,
756
+ direction: sortConfig.direction === "desc" ? "desc" : "asc"
757
+ };
758
+ return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(
759
+ mantineDatatable.DataTable,
760
+ {
761
+ verticalSpacing: "sm",
762
+ sx: { minWidth: 700 },
763
+ highlightOnHover: true,
764
+ striped: true,
765
+ records: sortedItems,
766
+ sortStatus,
767
+ onSortStatusChange: (status) => requestSort(status.columnAccessor),
768
+ columns: [
769
+ {
770
+ accessor: "lessonName",
771
+ title: "Lesson Name",
772
+ sortable: true,
773
+ render: (row) => /* @__PURE__ */ React__namespace.createElement(core.Text, { component: reactRouterDom.Link, to: row.href }, row.lessonName)
774
+ },
775
+ {
776
+ accessor: "percentageCompletion",
777
+ title: "Lesson Completion",
778
+ sortable: true,
779
+ render: (row) => `${Math.round((row.percentageCompletion + Number.EPSILON) * 100)}%`
780
+ }
781
+ ]
782
+ }
783
+ ));
683
784
  }
684
785
 
685
786
  const useStyles$o = core.createStyles((theme) => ({
@@ -1036,46 +1137,6 @@ const SplitButton$3 = (props) => {
1036
1137
  ));
1037
1138
  };
1038
1139
 
1039
- function useSortableData(items, config = { key: "", direction: null }) {
1040
- const [sortConfig, setSortConfig] = React.useState(config);
1041
- const sortedItems = React.useMemo(() => {
1042
- let sortableItems = [...items];
1043
- if (sortConfig.direction !== null) {
1044
- sortableItems.sort((a, b) => {
1045
- const aValue = a[sortConfig.key];
1046
- const bValue = b[sortConfig.key];
1047
- if (aValue === bValue)
1048
- return 0;
1049
- if (aValue === null || aValue === void 0)
1050
- return 1;
1051
- if (bValue === null || bValue === void 0)
1052
- return -1;
1053
- if (typeof aValue === "number" && typeof bValue === "number") {
1054
- return sortConfig.direction === "asc" ? aValue - bValue : bValue - aValue;
1055
- }
1056
- if (typeof aValue === "boolean" && typeof bValue === "boolean") {
1057
- return sortConfig.direction === "asc" ? aValue === bValue ? 0 : aValue ? 1 : -1 : aValue === bValue ? 0 : aValue ? -1 : 1;
1058
- }
1059
- if (aValue instanceof Date && bValue instanceof Date) {
1060
- return sortConfig.direction === "asc" ? aValue.getTime() - bValue.getTime() : bValue.getTime() - aValue.getTime();
1061
- }
1062
- return sortConfig.direction === "asc" ? String(aValue).localeCompare(String(bValue)) : String(bValue).localeCompare(String(aValue));
1063
- });
1064
- }
1065
- return sortableItems;
1066
- }, [items, sortConfig]);
1067
- const requestSort = (key) => {
1068
- let direction = "asc";
1069
- if (sortConfig.key === key && sortConfig.direction === "asc") {
1070
- direction = "desc";
1071
- } else if (sortConfig.key === key && sortConfig.direction === "desc") {
1072
- direction = null;
1073
- }
1074
- setSortConfig({ key, direction });
1075
- };
1076
- return { items: sortedItems, requestSort, sortConfig };
1077
- }
1078
-
1079
1140
  const useStyles$m = core.createStyles((theme) => ({
1080
1141
  th: { padding: "0 !important" },
1081
1142
  control: {
@@ -1172,25 +1233,25 @@ function Table$b(props) {
1172
1233
  ), /* @__PURE__ */ React__namespace.createElement("th", null), " ")), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
1173
1234
  }
1174
1235
 
1175
- var __defProp$8 = Object.defineProperty;
1176
- var __defProps$5 = Object.defineProperties;
1177
- var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
1178
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
1179
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
1180
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
1181
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1182
- var __spreadValues$8 = (a, b) => {
1236
+ var __defProp$9 = Object.defineProperty;
1237
+ var __defProps$6 = Object.defineProperties;
1238
+ var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
1239
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
1240
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
1241
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
1242
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1243
+ var __spreadValues$9 = (a, b) => {
1183
1244
  for (var prop in b || (b = {}))
1184
- if (__hasOwnProp$8.call(b, prop))
1185
- __defNormalProp$8(a, prop, b[prop]);
1186
- if (__getOwnPropSymbols$8)
1187
- for (var prop of __getOwnPropSymbols$8(b)) {
1188
- if (__propIsEnum$8.call(b, prop))
1189
- __defNormalProp$8(a, prop, b[prop]);
1245
+ if (__hasOwnProp$9.call(b, prop))
1246
+ __defNormalProp$9(a, prop, b[prop]);
1247
+ if (__getOwnPropSymbols$9)
1248
+ for (var prop of __getOwnPropSymbols$9(b)) {
1249
+ if (__propIsEnum$9.call(b, prop))
1250
+ __defNormalProp$9(a, prop, b[prop]);
1190
1251
  }
1191
1252
  return a;
1192
1253
  };
1193
- var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
1254
+ var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
1194
1255
  const useStyles$l = core.createStyles((theme) => ({
1195
1256
  title: {
1196
1257
  fontSize: 34,
@@ -1256,27 +1317,27 @@ const Class = (props) => {
1256
1317
  padding: "xl",
1257
1318
  size: "xl"
1258
1319
  },
1259
- /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(DropzoneButton$1, __spreadProps$5(__spreadValues$8({}, props), { close: () => setOpened(false) })), /* @__PURE__ */ React__namespace.createElement(core.Divider, { label: "or", labelPosition: "center", my: "md", variant: "dashed" }), /* @__PURE__ */ React__namespace.createElement("form", { onSubmit: form$1.onSubmit(() => {
1320
+ /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(DropzoneButton$1, __spreadProps$6(__spreadValues$9({}, props), { close: () => setOpened(false) })), /* @__PURE__ */ React__namespace.createElement(core.Divider, { label: "or", labelPosition: "center", my: "md", variant: "dashed" }), /* @__PURE__ */ React__namespace.createElement("form", { onSubmit: form$1.onSubmit(() => {
1260
1321
  const values = form$1.values;
1261
1322
  form$1.reset();
1262
1323
  setOpened(false);
1263
1324
  props.onCreateMembers && props.onCreateMembers([values]);
1264
1325
  }) }, /* @__PURE__ */ React__namespace.createElement(core.Stack, null, /* @__PURE__ */ React__namespace.createElement(
1265
1326
  core.TextInput,
1266
- __spreadValues$8({
1327
+ __spreadValues$9({
1267
1328
  withAsterisk: true,
1268
1329
  label: "Email",
1269
1330
  placeholder: "Email"
1270
1331
  }, form$1.getInputProps("email"))
1271
1332
  ), /* @__PURE__ */ React__namespace.createElement(core.Group, { grow: true }, /* @__PURE__ */ React__namespace.createElement(
1272
1333
  core.TextInput,
1273
- __spreadValues$8({
1334
+ __spreadValues$9({
1274
1335
  label: "Given name",
1275
1336
  placeholder: "Given name"
1276
1337
  }, form$1.getInputProps("givenName"))
1277
1338
  ), /* @__PURE__ */ React__namespace.createElement(
1278
1339
  core.TextInput,
1279
- __spreadValues$8({
1340
+ __spreadValues$9({
1280
1341
  label: "Family name",
1281
1342
  placeholder: "Family name"
1282
1343
  }, form$1.getInputProps("familyName"))
@@ -1427,19 +1488,19 @@ function Table$a(props) {
1427
1488
  ), /* @__PURE__ */ React__namespace.createElement("th", null))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
1428
1489
  }
1429
1490
 
1430
- var __defProp$7 = Object.defineProperty;
1431
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
1432
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
1433
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
1434
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1435
- var __spreadValues$7 = (a, b) => {
1491
+ var __defProp$8 = Object.defineProperty;
1492
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
1493
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
1494
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
1495
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1496
+ var __spreadValues$8 = (a, b) => {
1436
1497
  for (var prop in b || (b = {}))
1437
- if (__hasOwnProp$7.call(b, prop))
1438
- __defNormalProp$7(a, prop, b[prop]);
1439
- if (__getOwnPropSymbols$7)
1440
- for (var prop of __getOwnPropSymbols$7(b)) {
1441
- if (__propIsEnum$7.call(b, prop))
1442
- __defNormalProp$7(a, prop, b[prop]);
1498
+ if (__hasOwnProp$8.call(b, prop))
1499
+ __defNormalProp$8(a, prop, b[prop]);
1500
+ if (__getOwnPropSymbols$8)
1501
+ for (var prop of __getOwnPropSymbols$8(b)) {
1502
+ if (__propIsEnum$8.call(b, prop))
1503
+ __defNormalProp$8(a, prop, b[prop]);
1443
1504
  }
1444
1505
  return a;
1445
1506
  };
@@ -1486,14 +1547,14 @@ const Classes = (props) => {
1486
1547
  props.onCreateClass && props.onCreateClass(values);
1487
1548
  }) }, /* @__PURE__ */ React__namespace.createElement(core.Stack, null, /* @__PURE__ */ React__namespace.createElement(
1488
1549
  core.TextInput,
1489
- __spreadValues$7({
1550
+ __spreadValues$8({
1490
1551
  withAsterisk: true,
1491
1552
  label: "Name",
1492
1553
  placeholder: "Class name"
1493
1554
  }, form$1.getInputProps("name"))
1494
1555
  ), /* @__PURE__ */ React__namespace.createElement(
1495
1556
  core.TextInput,
1496
- __spreadValues$7({
1557
+ __spreadValues$8({
1497
1558
  label: "Description",
1498
1559
  placeholder: "A class for my first period English students"
1499
1560
  }, form$1.getInputProps("description"))
@@ -1723,30 +1784,30 @@ function CardGradient(props) {
1723
1784
  ), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "xl", weight: 500, mt: "md" }, props.title), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "sm", mt: "sm", color: "dimmed" }, props.description));
1724
1785
  }
1725
1786
 
1726
- var __defProp$6 = Object.defineProperty;
1727
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
1728
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
1729
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
1730
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1731
- var __spreadValues$6 = (a, b) => {
1787
+ var __defProp$7 = Object.defineProperty;
1788
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
1789
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
1790
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
1791
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1792
+ var __spreadValues$7 = (a, b) => {
1732
1793
  for (var prop in b || (b = {}))
1733
- if (__hasOwnProp$6.call(b, prop))
1734
- __defNormalProp$6(a, prop, b[prop]);
1735
- if (__getOwnPropSymbols$6)
1736
- for (var prop of __getOwnPropSymbols$6(b)) {
1737
- if (__propIsEnum$6.call(b, prop))
1738
- __defNormalProp$6(a, prop, b[prop]);
1794
+ if (__hasOwnProp$7.call(b, prop))
1795
+ __defNormalProp$7(a, prop, b[prop]);
1796
+ if (__getOwnPropSymbols$7)
1797
+ for (var prop of __getOwnPropSymbols$7(b)) {
1798
+ if (__propIsEnum$7.call(b, prop))
1799
+ __defNormalProp$7(a, prop, b[prop]);
1739
1800
  }
1740
1801
  return a;
1741
1802
  };
1742
1803
  var __objRest$1 = (source, exclude) => {
1743
1804
  var target = {};
1744
1805
  for (var prop in source)
1745
- if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
1806
+ if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
1746
1807
  target[prop] = source[prop];
1747
- if (source != null && __getOwnPropSymbols$6)
1748
- for (var prop of __getOwnPropSymbols$6(source)) {
1749
- if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
1808
+ if (source != null && __getOwnPropSymbols$7)
1809
+ for (var prop of __getOwnPropSymbols$7(source)) {
1810
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
1750
1811
  target[prop] = source[prop];
1751
1812
  }
1752
1813
  return target;
@@ -1813,9 +1874,9 @@ const TenantBanner = (_a) => {
1813
1874
  };
1814
1875
  return /* @__PURE__ */ React__namespace.createElement(
1815
1876
  core.Card,
1816
- __spreadValues$6({
1877
+ __spreadValues$7({
1817
1878
  radius: "md",
1818
- style: __spreadValues$6({ backgroundImage: `url(${image})` }, style),
1879
+ style: __spreadValues$7({ backgroundImage: `url(${image})` }, style),
1819
1880
  className: cx(classes.card, className)
1820
1881
  }, others),
1821
1882
  /* @__PURE__ */ React__namespace.createElement(
@@ -1894,10 +1955,18 @@ const Home = (props) => {
1894
1955
  description: "Bite-sized activities and learning experiences accelerating students achievement",
1895
1956
  onClick: props.onLessonsClick
1896
1957
  }
1958
+ )), /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, null, /* @__PURE__ */ React__namespace.createElement(
1959
+ CardGradient,
1960
+ {
1961
+ title: "File Locker",
1962
+ description: "A secure space to view student-submitted work and provide feedback",
1963
+ onClick: props.onFileLockerClick
1964
+ }
1897
1965
  )))));
1898
1966
  };
1899
1967
 
1900
1968
  function Table$6(props) {
1969
+ const { items: sortedItems, requestSort, sortConfig } = useSortableData(props.items);
1901
1970
  if (props.items.length === 0) {
1902
1971
  return /* @__PURE__ */ React__namespace.createElement(
1903
1972
  PlaceholderBanner,
@@ -1909,8 +1978,23 @@ function Table$6(props) {
1909
1978
  }
1910
1979
  );
1911
1980
  }
1912
- const rows = props.items.map((row) => /* @__PURE__ */ React__namespace.createElement("tr", { key: row.studentName }, /* @__PURE__ */ React__namespace.createElement("td", null, row.studentName), /* @__PURE__ */ React__namespace.createElement("td", null, row.reflection), /* @__PURE__ */ React__namespace.createElement("td", null, row.rating.toLocaleString())));
1913
- return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Student Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Reflection"), /* @__PURE__ */ React__namespace.createElement("th", null, "Rating"))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
1981
+ const sortStatus = {
1982
+ columnAccessor: sortConfig.key,
1983
+ direction: sortConfig.direction === "desc" ? "desc" : "asc"
1984
+ };
1985
+ return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(
1986
+ mantineDatatable.DataTable,
1987
+ {
1988
+ records: sortedItems,
1989
+ sortStatus,
1990
+ onSortStatusChange: (status) => requestSort(status.columnAccessor),
1991
+ columns: [
1992
+ { accessor: "studentName", title: "Student Name", sortable: true },
1993
+ { accessor: "reflection", title: "Reflection" },
1994
+ { accessor: "rating", title: "Rating", sortable: true }
1995
+ ]
1996
+ }
1997
+ ));
1914
1998
  }
1915
1999
 
1916
2000
  const useStyles$f = core.createStyles((theme) => ({
@@ -1965,7 +2049,31 @@ function Stack$2(props) {
1965
2049
  return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { component: reactRouterDom.Link, to: props.href }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: 24, sx: { padding: 20, minWidth: 700 } }, rows)));
1966
2050
  }
1967
2051
 
2052
+ var __defProp$6 = Object.defineProperty;
2053
+ var __defProps$5 = Object.defineProperties;
2054
+ var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
2055
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
2056
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
2057
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
2058
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2059
+ var __spreadValues$6 = (a, b) => {
2060
+ for (var prop in b || (b = {}))
2061
+ if (__hasOwnProp$6.call(b, prop))
2062
+ __defNormalProp$6(a, prop, b[prop]);
2063
+ if (__getOwnPropSymbols$6)
2064
+ for (var prop of __getOwnPropSymbols$6(b)) {
2065
+ if (__propIsEnum$6.call(b, prop))
2066
+ __defNormalProp$6(a, prop, b[prop]);
2067
+ }
2068
+ return a;
2069
+ };
2070
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
1968
2071
  function Table$5(props) {
2072
+ const preparedItems = React__namespace.useMemo(() => {
2073
+ return props.items.map((item) => __spreadProps$5(__spreadValues$6({}, item), {
2074
+ status: item.isComplete ? 2 : item.isStarted ? 1 : 0
2075
+ }));
2076
+ }, [props.items]);
1969
2077
  if (props.items.length === 0) {
1970
2078
  return /* @__PURE__ */ React__namespace.createElement(
1971
2079
  PlaceholderBanner,
@@ -1977,6 +2085,11 @@ function Table$5(props) {
1977
2085
  }
1978
2086
  );
1979
2087
  }
2088
+ const { items: sortedItems, requestSort, sortConfig } = useSortableData(preparedItems);
2089
+ const sortStatus = {
2090
+ columnAccessor: sortConfig.key,
2091
+ direction: sortConfig.direction === "desc" ? "desc" : "asc"
2092
+ };
1980
2093
  return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(
1981
2094
  mantineDatatable.DataTable,
1982
2095
  {
@@ -1988,13 +2101,18 @@ function Table$5(props) {
1988
2101
  striped: true,
1989
2102
  highlightOnHover: true,
1990
2103
  idAccessor: "userId",
1991
- records: props.items,
2104
+ records: sortedItems,
2105
+ sortStatus,
2106
+ onSortStatusChange: (status) => requestSort(status.columnAccessor),
1992
2107
  columns: [{
1993
2108
  accessor: "name",
1994
2109
  title: "Student Name",
2110
+ sortable: true,
1995
2111
  render: (row) => /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, null, /* @__PURE__ */ React__namespace.createElement(core.Group, { spacing: "sm" }, /* @__PURE__ */ React__namespace.createElement(core.Avatar, { size: 40, src: row.avatar, radius: 40 }), /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "sm", weight: 500 }, row.name), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "xs", color: "dimmed" }, row.email))))
1996
2112
  }, {
1997
2113
  accessor: "status",
2114
+ title: "Status",
2115
+ sortable: true,
1998
2116
  render: (row) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, !!row.isComplete && /* @__PURE__ */ React__namespace.createElement(core.Badge, { variant: "filled" }, "Complete"), !row.isComplete && !row.isStarted && /* @__PURE__ */ React__namespace.createElement(core.Badge, { color: "red", variant: "filled" }, "Not started"), !row.isComplete && !!row.isStarted && /* @__PURE__ */ React__namespace.createElement(core.Badge, { color: "violet", variant: "filled" }, "In progress"))
1999
2117
  }],
2000
2118
  rowExpansion: {
@@ -3438,7 +3556,7 @@ function Table$1(props) {
3438
3556
  }
3439
3557
  return flatItem;
3440
3558
  });
3441
- }, [props.items]);
3559
+ }, [props.items, props.categories]);
3442
3560
  const { items: sortedItems, requestSort, sortConfig } = useSortableData(preparedItems);
3443
3561
  if (props.items.length === 0) {
3444
3562
  return /* @__PURE__ */ React__namespace.createElement(