@local-civics/mgmt-ui 0.1.195 → 0.1.197

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
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { useState, useMemo } from 'react';
3
3
  import { createStyles, Group, Avatar, Text, Box, Badge as Badge$1, ThemeIcon, Collapse, Navbar as Navbar$1, Center, Image, Code, Burger, ScrollArea, Modal, Loader, Container, Button, Title, UnstyledButton, Card, SimpleGrid, Tabs as Tabs$1, Stack as Stack$5, Grid, ActionIcon, LoadingOverlay, Select, Table as Table$l, Autocomplete, Drawer, Divider, TextInput, Tooltip, Paper, Overlay, Anchor, Menu, Checkbox, createEmotionCache, MantineProvider, AppShell } from '@mantine/core';
4
- import { IconChevronRight, IconChevronLeft, IconVideo, IconSwitchHorizontal, IconLogout, IconHome2, IconGauge, IconCategory2, IconRoute, IconAlbum, IconLambda, IconClipboard, IconBuilding, IconBatteryEco, IconBooks, IconBackpack, IconClipboardCopy, IconTableExport, IconArrowLeft, IconPlaylistAdd, IconCheck, IconTrash, IconDownload, IconX, IconCloudUpload, IconChevronUp, IconChevronDown, IconSelector, IconInfoCircle, IconColorSwatch, IconPointer, IconScribble, IconSchool, IconPodium, IconBriefcase, IconPresentation, IconNews, IconTools, IconBrandInstagram, IconBrandLinkedin, IconBrandFacebook } from '@tabler/icons';
4
+ import { IconChevronRight, IconChevronLeft, IconVideo, IconSwitchHorizontal, IconLogout, IconHome2, IconGauge, IconCategory2, IconRoute, IconAlbum, IconLambda, IconClipboard, IconBuilding, IconBatteryEco, IconBooks, IconBackpack, IconClipboardCopy, IconTableExport, IconArrowLeft, IconPlaylistAdd, IconCheck, IconTrash, IconDownload, IconX, IconCloudUpload, IconInfoCircle, IconColorSwatch, IconPointer, IconChevronDown, IconScribble, IconSchool, IconPodium, IconBriefcase, IconPresentation, IconNews, IconTools, IconBrandInstagram, IconBrandLinkedin, IconBrandFacebook } from '@tabler/icons';
5
5
  import { Link } from 'react-router-dom';
6
6
  import { showNotification, NotificationsProvider } from '@mantine/notifications';
7
7
  export { showNotification, updateNotification } from '@mantine/notifications';
@@ -42,7 +42,7 @@ var __objRest$2 = (source, exclude) => {
42
42
  }
43
43
  return target;
44
44
  };
45
- const useStyles$w = createStyles((theme) => ({
45
+ const useStyles$v = createStyles((theme) => ({
46
46
  user: {
47
47
  display: "block",
48
48
  width: "100%",
@@ -53,7 +53,7 @@ const useStyles$w = createStyles((theme) => ({
53
53
  }));
54
54
  function UserButton(_a) {
55
55
  var _b = _a, { image, name, email, icon } = _b, others = __objRest$2(_b, ["image", "name", "email", "icon"]);
56
- const { classes } = useStyles$w();
56
+ const { classes } = useStyles$v();
57
57
  return /* @__PURE__ */ React.createElement(Group, __spreadValues$e({ className: classes.user }, others), /* @__PURE__ */ React.createElement(Avatar, { src: image, radius: "xl" }), /* @__PURE__ */ React.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ React.createElement(Text, { size: "sm", weight: 500 }, name), /* @__PURE__ */ React.createElement(Text, { color: "dimmed", size: "xs" }, email)));
58
58
  }
59
59
 
@@ -64,7 +64,7 @@ const compact = (num) => {
64
64
  }).format(num || 0);
65
65
  };
66
66
 
67
- const useStyles$v = createStyles((theme, _params, getRef) => {
67
+ const useStyles$u = createStyles((theme, _params, getRef) => {
68
68
  const icon = getRef("icon");
69
69
  return {
70
70
  control: {
@@ -117,7 +117,7 @@ const useStyles$v = createStyles((theme, _params, getRef) => {
117
117
  };
118
118
  });
119
119
  function LinksGroup({ icon: Icon, href, label, initiallyOpened, links, active, notifications }) {
120
- const { classes, theme, cx } = useStyles$v();
120
+ const { classes, theme, cx } = useStyles$u();
121
121
  const hasLinks = Array.isArray(links) && links.length > 0;
122
122
  const hasActiveLinks = Array.isArray(links) && links.map((l) => !!active && active === `${label}/${l.label}`).reduce((a, b) => a || b, false);
123
123
  const [opened, setOpened] = useState(initiallyOpened || hasActiveLinks || false);
@@ -163,8 +163,8 @@ function LinksGroup({ icon: Icon, href, label, initiallyOpened, links, active, n
163
163
  }
164
164
 
165
165
  var __defProp$d = Object.defineProperty;
166
- var __defProps$a = Object.defineProperties;
167
- var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
166
+ var __defProps$9 = Object.defineProperties;
167
+ var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
168
168
  var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
169
169
  var __hasOwnProp$d = Object.prototype.hasOwnProperty;
170
170
  var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
@@ -180,8 +180,8 @@ var __spreadValues$d = (a, b) => {
180
180
  }
181
181
  return a;
182
182
  };
183
- var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
184
- const useStyles$u = createStyles((theme, _params, getRef) => {
183
+ var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
184
+ const useStyles$t = createStyles((theme, _params, getRef) => {
185
185
  const icon = getRef("icon");
186
186
  return {
187
187
  navbar: {
@@ -212,7 +212,7 @@ const useStyles$u = createStyles((theme, _params, getRef) => {
212
212
  color: theme.colorScheme === "dark" ? theme.white : theme.black,
213
213
  borderBottom: `1px solid ${theme.colorScheme === "dark" ? theme.colors.dark[4] : theme.colors.gray[3]}`
214
214
  },
215
- link: __spreadProps$a(__spreadValues$d({}, theme.fn.focusStyles()), {
215
+ link: __spreadProps$9(__spreadValues$d({}, theme.fn.focusStyles()), {
216
216
  display: "flex",
217
217
  alignItems: "center",
218
218
  textDecoration: "none",
@@ -282,7 +282,7 @@ const TRIAL_PAGES = [
282
282
  "Badges"
283
283
  ];
284
284
  function Navbar(props) {
285
- const { classes, cx } = useStyles$u();
285
+ const { classes, cx } = useStyles$t();
286
286
  const [burgerOpen, setBurgerOpen] = React.useState(false);
287
287
  const toggle = () => setBurgerOpen(!burgerOpen);
288
288
  const links = data.map((item) => {
@@ -295,7 +295,7 @@ function Navbar(props) {
295
295
  }
296
296
  return /* @__PURE__ */ React.createElement(
297
297
  LinksGroup,
298
- __spreadProps$a(__spreadValues$d(__spreadValues$d({
298
+ __spreadProps$9(__spreadValues$d(__spreadValues$d({
299
299
  key: item.label,
300
300
  active: props.active
301
301
  }, item), context), {
@@ -325,7 +325,7 @@ function Navbar(props) {
325
325
  } }, /* @__PURE__ */ React.createElement(IconLogout, { className: classes.linkIcon, stroke: 1.5 }), /* @__PURE__ */ React.createElement("span", null, "Logout"))))));
326
326
  }
327
327
 
328
- const useStyles$t = createStyles((theme) => ({
328
+ const useStyles$s = createStyles((theme) => ({
329
329
  inner: {
330
330
  paddingTop: theme.spacing.xl,
331
331
  paddingBottom: theme.spacing.xl * 4
@@ -361,7 +361,7 @@ const useStyles$t = createStyles((theme) => ({
361
361
  }
362
362
  }));
363
363
  const GettingStarted = (props) => {
364
- const { classes } = useStyles$t();
364
+ const { classes } = useStyles$s();
365
365
  return /* @__PURE__ */ React.createElement(
366
366
  Modal,
367
367
  {
@@ -375,7 +375,7 @@ const GettingStarted = (props) => {
375
375
  );
376
376
  };
377
377
 
378
- const useStyles$s = createStyles((theme) => ({
378
+ const useStyles$r = createStyles((theme) => ({
379
379
  title: {
380
380
  fontSize: 34,
381
381
  fontWeight: 900,
@@ -416,7 +416,7 @@ const useStyles$s = createStyles((theme) => ({
416
416
  }
417
417
  }));
418
418
  const SwitchAccount = (props) => {
419
- const { classes, theme } = useStyles$s();
419
+ const { classes, theme } = useStyles$r();
420
420
  const options = props.accounts.map((a) => {
421
421
  return /* @__PURE__ */ React.createElement(UnstyledButton, { onClick: () => props.onClick && props.onClick(a.accountId), key: a.accountId, p: theme.spacing.md }, /* @__PURE__ */ React.createElement(Card, { withBorder: true, shadow: "md", radius: "md", className: classes.card, p: "xl" }, a.isAdmin && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(IconBatteryEco, { size: 50, stroke: 2, color: theme.fn.primaryColor() })), a.isGroupAdmin && !a.isAdmin && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(IconBooks, { size: 50, stroke: 2, color: theme.fn.primaryColor() })), !a.isAdmin && !a.isGroupAdmin && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(IconBackpack, { size: 50, stroke: 2, color: theme.fn.primaryColor() })), /* @__PURE__ */ React.createElement(Text, { size: "lg", weight: 500, className: classes.cardTitle, mt: "md" }, a.name), /* @__PURE__ */ React.createElement(Text, { size: "sm", color: "dimmed", mt: "sm" }, a.isAdmin ? "Admin" : a.isGroupAdmin ? "Educator" : "Student")));
422
422
  });
@@ -433,7 +433,7 @@ const SwitchAccount = (props) => {
433
433
  );
434
434
  };
435
435
 
436
- const useStyles$r = createStyles((theme) => ({
436
+ const useStyles$q = createStyles((theme) => ({
437
437
  root: {
438
438
  display: "flex",
439
439
  backgroundImage: `linear-gradient(-60deg, ${theme.colors[theme.primaryColor][4]} 0%, ${theme.colors[theme.primaryColor][7]} 100%)`,
@@ -477,7 +477,7 @@ const useStyles$r = createStyles((theme) => ({
477
477
  }
478
478
  }));
479
479
  const StatsGroup = ({ data, footer }) => {
480
- const { classes } = useStyles$r();
480
+ const { classes } = useStyles$q();
481
481
  const stats = data.map((stat) => {
482
482
  const value = (() => {
483
483
  if (stat.unit === "%") {
@@ -497,7 +497,7 @@ const Tabs = (props) => {
497
497
  return /* @__PURE__ */ React.createElement(Tabs$1, { value: props.value, onTabChange: props.onChange }, /* @__PURE__ */ React.createElement(Tabs$1.List, null, tabs));
498
498
  };
499
499
 
500
- const useStyles$q = createStyles((theme) => ({
500
+ const useStyles$p = createStyles((theme) => ({
501
501
  button: {
502
502
  borderTopRightRadius: 0,
503
503
  borderBottomRightRadius: 0,
@@ -512,7 +512,7 @@ const useStyles$q = createStyles((theme) => ({
512
512
  }
513
513
  }));
514
514
  const SplitButton$5 = (props) => {
515
- const { classes, theme } = useStyles$q();
515
+ const { classes, theme } = useStyles$p();
516
516
  theme.colors[theme.primaryColor][theme.colorScheme === "dark" ? 5 : 6];
517
517
  return /* @__PURE__ */ React.createElement(Stack$5, { spacing: "sm" }, /* @__PURE__ */ React.createElement(
518
518
  Button,
@@ -540,7 +540,7 @@ const SplitButton$5 = (props) => {
540
540
  ));
541
541
  };
542
542
 
543
- const useStyles$p = createStyles((theme) => ({
543
+ const useStyles$o = createStyles((theme) => ({
544
544
  wrapper: {
545
545
  display: "flex",
546
546
  alignItems: "center",
@@ -591,7 +591,7 @@ const useStyles$p = createStyles((theme) => ({
591
591
  }
592
592
  }));
593
593
  const PlaceholderBanner = (props) => {
594
- const { classes } = useStyles$p();
594
+ const { classes } = useStyles$o();
595
595
  const title = props.title || "Nothing to display";
596
596
  const description = props.description || "We don't have anything to show you here just yet. Add data, check back later, or adjust your search.";
597
597
  return /* @__PURE__ */ React.createElement("div", { className: classes.wrapper }, /* @__PURE__ */ React.createElement("div", { className: classes.body }, /* @__PURE__ */ React.createElement(Title, { className: classes.title }, props.loading ? "Loading..." : title), /* @__PURE__ */ React.createElement(Text, { size: "sm", color: "dimmed" }, props.loading ? "Hold on, we're loading your data." : description)), /* @__PURE__ */ React.createElement(Image, { src: `https://cdn.localcivics.io/illustrations/${props.icon}.svg`, className: classes.image }));
@@ -637,8 +637,6 @@ function useSortableData(items, config = { key: "", direction: null }) {
637
637
  let direction = "asc";
638
638
  if (sortConfig.key === key && sortConfig.direction === "asc") {
639
639
  direction = "desc";
640
- } else if (sortConfig.key === key && sortConfig.direction === "desc") {
641
- direction = null;
642
640
  }
643
641
  setSortConfig({ key, direction });
644
642
  };
@@ -646,8 +644,8 @@ function useSortableData(items, config = { key: "", direction: null }) {
646
644
  }
647
645
 
648
646
  var __defProp$c = Object.defineProperty;
649
- var __defProps$9 = Object.defineProperties;
650
- var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
647
+ var __defProps$8 = Object.defineProperties;
648
+ var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
651
649
  var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
652
650
  var __hasOwnProp$c = Object.prototype.hasOwnProperty;
653
651
  var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
@@ -663,10 +661,10 @@ var __spreadValues$c = (a, b) => {
663
661
  }
664
662
  return a;
665
663
  };
666
- var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
664
+ var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
667
665
  function Table$k(props) {
668
666
  const preparedItems = React.useMemo(() => {
669
- return props.items.map((item) => __spreadProps$9(__spreadValues$c({}, item), {
667
+ return props.items.map((item) => __spreadProps$8(__spreadValues$c({}, item), {
670
668
  status: item.isComplete ? 1 : 0
671
669
  }));
672
670
  }, [props.items]);
@@ -763,7 +761,7 @@ function Table$j(props) {
763
761
  ));
764
762
  }
765
763
 
766
- const useStyles$o = createStyles((theme) => ({
764
+ const useStyles$n = createStyles((theme) => ({
767
765
  title: {
768
766
  fontSize: 34,
769
767
  fontWeight: 900,
@@ -776,7 +774,7 @@ const useStyles$o = createStyles((theme) => ({
776
774
  }
777
775
  }));
778
776
  const Badge = (props) => {
779
- const { classes } = useStyles$o();
777
+ const { classes } = useStyles$n();
780
778
  const [tab, setTab] = useState("lessons");
781
779
  const numberOfStudents = props.students.length;
782
780
  const numberOfBadges = numberOfStudents > 0 ? props.students.filter((u) => u.isComplete).length : 0;
@@ -874,7 +872,7 @@ function Table$i(props) {
874
872
  return /* @__PURE__ */ React.createElement(ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React.createElement(Table$l, { horizontalSpacing: 0, verticalSpacing: 0, sx: { minWidth: 700 } }, /* @__PURE__ */ React.createElement("tbody", null, rows)));
875
873
  }
876
874
 
877
- const useStyles$n = createStyles((theme) => ({
875
+ const useStyles$m = createStyles((theme) => ({
878
876
  title: {
879
877
  fontSize: 34,
880
878
  fontWeight: 900,
@@ -887,7 +885,7 @@ const useStyles$n = createStyles((theme) => ({
887
885
  }
888
886
  }));
889
887
  const Badges = (props) => {
890
- const { classes } = useStyles$n();
888
+ const { classes } = useStyles$m();
891
889
  return /* @__PURE__ */ React.createElement(Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React.createElement(Stack$5, { spacing: "md" }, /* @__PURE__ */ React.createElement(Grid, null, /* @__PURE__ */ React.createElement(Grid.Col, { sm: "auto" }, /* @__PURE__ */ React.createElement(Badge$1, { variant: "filled", size: "lg" }, "Badges"), /* @__PURE__ */ React.createElement(Title, { order: 2, className: classes.title, mt: "md" }, "Badges and micro-credentials"), /* @__PURE__ */ React.createElement(Text, { color: "dimmed", className: classes.description, mt: "sm" }, "Key milestones that reflect skill development, micro-credentials, or academic progress"))), /* @__PURE__ */ React.createElement(
892
890
  Autocomplete,
893
891
  {
@@ -1118,8 +1116,8 @@ const SplitButton$4 = (props) => {
1118
1116
  };
1119
1117
 
1120
1118
  var __defProp$b = Object.defineProperty;
1121
- var __defProps$8 = Object.defineProperties;
1122
- var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
1119
+ var __defProps$7 = Object.defineProperties;
1120
+ var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
1123
1121
  var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
1124
1122
  var __hasOwnProp$b = Object.prototype.hasOwnProperty;
1125
1123
  var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
@@ -1135,14 +1133,14 @@ var __spreadValues$b = (a, b) => {
1135
1133
  }
1136
1134
  return a;
1137
1135
  };
1138
- var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
1136
+ var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
1139
1137
  function Table$c(props) {
1140
- React.useMemo(() => {
1141
- return props.items.map((item) => __spreadProps$8(__spreadValues$b({}, item), {
1138
+ const preparedItems = React.useMemo(() => {
1139
+ return props.items.map((item) => __spreadProps$7(__spreadValues$b({}, item), {
1142
1140
  fullName: item.givenName && item.familyName ? `${item.givenName} ${item.familyName}`.toLowerCase() : item.email.toLowerCase()
1143
1141
  }));
1144
1142
  }, [props.items]);
1145
- const { items: sortedItems, requestSort, sortConfig } = useSortableData(props.items);
1143
+ const { items: sortedItems, requestSort, sortConfig } = useSortableData(preparedItems);
1146
1144
  if (props.items.length === 0) {
1147
1145
  return /* @__PURE__ */ React.createElement(
1148
1146
  PlaceholderBanner,
@@ -1236,8 +1234,8 @@ function Table$c(props) {
1236
1234
  }
1237
1235
 
1238
1236
  var __defProp$a = Object.defineProperty;
1239
- var __defProps$7 = Object.defineProperties;
1240
- var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
1237
+ var __defProps$6 = Object.defineProperties;
1238
+ var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
1241
1239
  var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
1242
1240
  var __hasOwnProp$a = Object.prototype.hasOwnProperty;
1243
1241
  var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
@@ -1253,8 +1251,8 @@ var __spreadValues$a = (a, b) => {
1253
1251
  }
1254
1252
  return a;
1255
1253
  };
1256
- var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
1257
- const useStyles$m = createStyles((theme) => ({
1254
+ var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
1255
+ const useStyles$l = createStyles((theme) => ({
1258
1256
  title: {
1259
1257
  fontSize: 34,
1260
1258
  fontWeight: 900,
@@ -1287,7 +1285,7 @@ const useStyles$m = createStyles((theme) => ({
1287
1285
  }
1288
1286
  }));
1289
1287
  const Class = (props) => {
1290
- const { classes } = useStyles$m();
1288
+ const { classes } = useStyles$l();
1291
1289
  const form = useForm({
1292
1290
  initialValues: {
1293
1291
  classId: "",
@@ -1319,7 +1317,7 @@ const Class = (props) => {
1319
1317
  padding: "xl",
1320
1318
  size: "xl"
1321
1319
  },
1322
- /* @__PURE__ */ React.createElement(Stack$5, { spacing: "md" }, /* @__PURE__ */ React.createElement(DropzoneButton$1, __spreadProps$7(__spreadValues$a({}, props), { close: () => setOpened(false) })), /* @__PURE__ */ React.createElement(Divider, { label: "or", labelPosition: "center", my: "md", variant: "dashed" }), /* @__PURE__ */ React.createElement("form", { onSubmit: form.onSubmit(() => {
1320
+ /* @__PURE__ */ React.createElement(Stack$5, { spacing: "md" }, /* @__PURE__ */ React.createElement(DropzoneButton$1, __spreadProps$6(__spreadValues$a({}, props), { close: () => setOpened(false) })), /* @__PURE__ */ React.createElement(Divider, { label: "or", labelPosition: "center", my: "md", variant: "dashed" }), /* @__PURE__ */ React.createElement("form", { onSubmit: form.onSubmit(() => {
1323
1321
  const values = form.values;
1324
1322
  form.reset();
1325
1323
  setOpened(false);
@@ -1388,7 +1386,7 @@ const Class = (props) => {
1388
1386
  ))))));
1389
1387
  };
1390
1388
  const DropzoneButton$1 = (props) => {
1391
- const { classes, theme } = useStyles$m();
1389
+ const { classes, theme } = useStyles$l();
1392
1390
  const openRef = React.useRef(null);
1393
1391
  const [loading, setLoading] = React.useState(false);
1394
1392
  const onDrop = React.useCallback((acceptedFiles) => {
@@ -1434,21 +1432,6 @@ const DropzoneButton$1 = (props) => {
1434
1432
  } }, "Select file"));
1435
1433
  };
1436
1434
 
1437
- const useStyles$l = createStyles((theme) => ({
1438
- th: { padding: "0 !important" },
1439
- control: {
1440
- width: "100%",
1441
- padding: `${theme.spacing.xs}px ${theme.spacing.md}px`,
1442
- "&:hover": {
1443
- backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.colors.gray[0]
1444
- }
1445
- }
1446
- }));
1447
- function Th({ children, reversed, sorted, onSort }) {
1448
- const { classes } = useStyles$l();
1449
- const Icon = sorted ? reversed ? IconChevronUp : IconChevronDown : IconSelector;
1450
- return /* @__PURE__ */ React.createElement("th", { className: classes.th }, /* @__PURE__ */ React.createElement(UnstyledButton, { onClick: onSort, className: classes.control }, /* @__PURE__ */ React.createElement(Group, { position: "apart", noWrap: true, spacing: "xs" }, /* @__PURE__ */ React.createElement(Text, { weight: 500, size: "sm", sx: { whiteSpace: "nowrap" } }, children), /* @__PURE__ */ React.createElement(Center, null, /* @__PURE__ */ React.createElement(Icon, { size: 14, stroke: 1.5 })))));
1451
- }
1452
1435
  function Table$b(props) {
1453
1436
  const { items: sortedItems, requestSort, sortConfig } = useSortableData(props.items);
1454
1437
  if (props.items.length === 0) {
@@ -1470,24 +1453,49 @@ function Table$b(props) {
1470
1453
  confirmProps: { color: "red" },
1471
1454
  onConfirm: () => props.onDeleteClass(group)
1472
1455
  });
1473
- const rows = sortedItems.map((row) => /* @__PURE__ */ React.createElement("tr", { key: row.classId }, /* @__PURE__ */ React.createElement("td", null, /* @__PURE__ */ React.createElement(UnstyledButton, { component: Link, to: row.href }, /* @__PURE__ */ React.createElement(Text, { size: 14 }, row.name))), /* @__PURE__ */ React.createElement("td", null, /* @__PURE__ */ React.createElement(Text, { size: 14 }, row.description)), /* @__PURE__ */ React.createElement("td", null, /* @__PURE__ */ React.createElement(Text, { size: 14 }, row.numberOfStudents || 0)), /* @__PURE__ */ React.createElement("td", null, /* @__PURE__ */ React.createElement(Group, { noWrap: true, spacing: 0, position: "right" }, /* @__PURE__ */ React.createElement(ActionIcon, { color: "red" }, /* @__PURE__ */ React.createElement(IconTrash, { onClick: () => openDeleteModal(row), size: 16, stroke: 1.5 }))))));
1474
- return /* @__PURE__ */ React.createElement(ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React.createElement(Table$l, { verticalSpacing: 20, sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React.createElement("thead", null, /* @__PURE__ */ React.createElement("tr", null, /* @__PURE__ */ React.createElement(
1475
- Th,
1476
- {
1477
- sorted: sortConfig.key === "name",
1478
- reversed: sortConfig.direction === "desc",
1479
- onSort: () => requestSort("name")
1480
- },
1481
- "Class Name"
1482
- ), /* @__PURE__ */ React.createElement("th", { style: { padding: "7px 16px" } }, /* @__PURE__ */ React.createElement(Text, { weight: 500, size: "sm" }, "Description")), /* @__PURE__ */ React.createElement(
1483
- Th,
1456
+ const sortStatus = {
1457
+ columnAccessor: sortConfig.key,
1458
+ direction: sortConfig.direction === "desc" ? "desc" : "asc"
1459
+ };
1460
+ return /* @__PURE__ */ React.createElement(ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React.createElement(
1461
+ DataTable,
1484
1462
  {
1485
- sorted: sortConfig.key === "numberOfStudents",
1486
- reversed: sortConfig.direction === "desc",
1487
- onSort: () => requestSort("numberOfStudents")
1488
- },
1489
- "# of Students"
1490
- ), /* @__PURE__ */ React.createElement("th", null))), /* @__PURE__ */ React.createElement("tbody", null, rows)));
1463
+ withBorder: false,
1464
+ borderRadius: "sm",
1465
+ verticalSpacing: "sm",
1466
+ sx: { minWidth: 700 },
1467
+ highlightOnHover: true,
1468
+ striped: true,
1469
+ records: sortedItems,
1470
+ idAccessor: "classId",
1471
+ sortStatus,
1472
+ onSortStatusChange: (status) => requestSort(status.columnAccessor),
1473
+ columns: [
1474
+ {
1475
+ accessor: "name",
1476
+ title: "Class Name",
1477
+ sortable: true,
1478
+ render: (row) => /* @__PURE__ */ React.createElement(UnstyledButton, { component: Link, to: row.href }, /* @__PURE__ */ React.createElement(Text, { size: 14, weight: 500 }, row.name))
1479
+ },
1480
+ {
1481
+ accessor: "description",
1482
+ title: "Description",
1483
+ render: (row) => /* @__PURE__ */ React.createElement(Text, { size: 14 }, row.description)
1484
+ },
1485
+ {
1486
+ accessor: "numberOfStudents",
1487
+ title: "# of Students",
1488
+ sortable: true,
1489
+ render: (row) => /* @__PURE__ */ React.createElement(Text, { size: 14 }, row.numberOfStudents || 0)
1490
+ },
1491
+ {
1492
+ accessor: "actions",
1493
+ title: "",
1494
+ render: (row) => /* @__PURE__ */ React.createElement(Group, { noWrap: true, spacing: 0, position: "right" }, /* @__PURE__ */ React.createElement(ActionIcon, { color: "red", onClick: () => openDeleteModal(row) }, /* @__PURE__ */ React.createElement(IconTrash, { size: 16, stroke: 1.5 })))
1495
+ }
1496
+ ]
1497
+ }
1498
+ ));
1491
1499
  }
1492
1500
 
1493
1501
  var __defProp$9 = Object.defineProperty;
@@ -2052,8 +2060,8 @@ function Stack$3(props) {
2052
2060
  }
2053
2061
 
2054
2062
  var __defProp$7 = Object.defineProperty;
2055
- var __defProps$6 = Object.defineProperties;
2056
- var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
2063
+ var __defProps$5 = Object.defineProperties;
2064
+ var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
2057
2065
  var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
2058
2066
  var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
2059
2067
  var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
@@ -2069,13 +2077,18 @@ var __spreadValues$7 = (a, b) => {
2069
2077
  }
2070
2078
  return a;
2071
2079
  };
2072
- var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
2080
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
2073
2081
  function Table$6(props) {
2074
2082
  const preparedItems = React.useMemo(() => {
2075
- return props.items.map((item) => __spreadProps$6(__spreadValues$7({}, item), {
2083
+ return props.items.map((item) => __spreadProps$5(__spreadValues$7({}, item), {
2076
2084
  status: item.isComplete ? 2 : item.isStarted ? 1 : 0
2077
2085
  }));
2078
2086
  }, [props.items]);
2087
+ const { items: sortedItems, requestSort, sortConfig } = useSortableData(preparedItems);
2088
+ const sortStatus = {
2089
+ columnAccessor: sortConfig.key,
2090
+ direction: sortConfig.direction === "desc" ? "desc" : "asc"
2091
+ };
2079
2092
  if (props.items.length === 0) {
2080
2093
  return /* @__PURE__ */ React.createElement(
2081
2094
  PlaceholderBanner,
@@ -2087,11 +2100,6 @@ function Table$6(props) {
2087
2100
  }
2088
2101
  );
2089
2102
  }
2090
- const { items: sortedItems, requestSort, sortConfig } = useSortableData(preparedItems);
2091
- const sortStatus = {
2092
- columnAccessor: sortConfig.key,
2093
- direction: sortConfig.direction === "desc" ? "desc" : "asc"
2094
- };
2095
2103
  return /* @__PURE__ */ React.createElement(ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React.createElement(
2096
2104
  DataTable,
2097
2105
  {
@@ -2560,8 +2568,8 @@ function Table$4(props) {
2560
2568
  }
2561
2569
 
2562
2570
  var __defProp$6 = Object.defineProperty;
2563
- var __defProps$5 = Object.defineProperties;
2564
- var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
2571
+ var __defProps$4 = Object.defineProperties;
2572
+ var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
2565
2573
  var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
2566
2574
  var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
2567
2575
  var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
@@ -2577,7 +2585,7 @@ var __spreadValues$6 = (a, b) => {
2577
2585
  }
2578
2586
  return a;
2579
2587
  };
2580
- var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
2588
+ var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
2581
2589
  const useStyles$a = createStyles((theme) => ({
2582
2590
  title: {
2583
2591
  fontSize: 34,
@@ -2639,7 +2647,7 @@ const People = (props) => {
2639
2647
  padding: "xl",
2640
2648
  size: "xl"
2641
2649
  },
2642
- /* @__PURE__ */ React.createElement(Stack$5, { spacing: "md" }, /* @__PURE__ */ React.createElement(DropzoneButton, __spreadProps$5(__spreadValues$6({}, props), { close: () => setOpened(false) })), /* @__PURE__ */ React.createElement(Divider, { label: "or", labelPosition: "center", my: "md", variant: "dashed" }), /* @__PURE__ */ React.createElement("form", { onSubmit: form.onSubmit(() => {
2650
+ /* @__PURE__ */ React.createElement(Stack$5, { spacing: "md" }, /* @__PURE__ */ React.createElement(DropzoneButton, __spreadProps$4(__spreadValues$6({}, props), { close: () => setOpened(false) })), /* @__PURE__ */ React.createElement(Divider, { label: "or", labelPosition: "center", my: "md", variant: "dashed" }), /* @__PURE__ */ React.createElement("form", { onSubmit: form.onSubmit(() => {
2643
2651
  const values = form.values;
2644
2652
  form.reset();
2645
2653
  setOpened(false);
@@ -2927,8 +2935,8 @@ const TrialHome = (props) => {
2927
2935
  };
2928
2936
 
2929
2937
  var __defProp$4 = Object.defineProperty;
2930
- var __defProps$4 = Object.defineProperties;
2931
- var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
2938
+ var __defProps$3 = Object.defineProperties;
2939
+ var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
2932
2940
  var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
2933
2941
  var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
2934
2942
  var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
@@ -2944,7 +2952,7 @@ var __spreadValues$4 = (a, b) => {
2944
2952
  }
2945
2953
  return a;
2946
2954
  };
2947
- var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
2955
+ var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
2948
2956
  var __objRest = (source, exclude) => {
2949
2957
  var target = {};
2950
2958
  for (var prop in source)
@@ -3002,7 +3010,7 @@ function ImageCheckbox(_a) {
3002
3010
  const { classes, cx } = useStyles$7({ checked: value });
3003
3011
  return /* @__PURE__ */ React.createElement(
3004
3012
  UnstyledButton,
3005
- __spreadProps$4(__spreadValues$4({}, others), {
3013
+ __spreadProps$3(__spreadValues$4({}, others), {
3006
3014
  onClick: () => handleChange(!value),
3007
3015
  className: cx(classes.button, className)
3008
3016
  }),
@@ -3023,7 +3031,7 @@ function ImageCheckbox(_a) {
3023
3031
  function SelectGrid(props) {
3024
3032
  const items = props.items.map((item) => /* @__PURE__ */ React.createElement(
3025
3033
  ImageCheckbox,
3026
- __spreadProps$4(__spreadValues$4({}, item), {
3034
+ __spreadProps$3(__spreadValues$4({}, item), {
3027
3035
  key: item.title,
3028
3036
  onChange: (checked) => props.onChange(item.title, checked)
3029
3037
  })
@@ -3042,8 +3050,8 @@ function SelectGrid(props) {
3042
3050
  }
3043
3051
 
3044
3052
  var __defProp$3 = Object.defineProperty;
3045
- var __defProps$3 = Object.defineProperties;
3046
- var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
3053
+ var __defProps$2 = Object.defineProperties;
3054
+ var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
3047
3055
  var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
3048
3056
  var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
3049
3057
  var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
@@ -3059,7 +3067,7 @@ var __spreadValues$3 = (a, b) => {
3059
3067
  }
3060
3068
  return a;
3061
3069
  };
3062
- var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
3070
+ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
3063
3071
  const useStyles$6 = createStyles((theme) => ({
3064
3072
  wrapper: {
3065
3073
  minHeight: "100%",
@@ -3169,7 +3177,7 @@ const TrialRegistration = (props) => {
3169
3177
  label: "School/Organization Name",
3170
3178
  placeholder: "What's the name of your school?",
3171
3179
  data: props.organizations.map((o) => {
3172
- return __spreadProps$3(__spreadValues$3({}, o), { value: o.displayName });
3180
+ return __spreadProps$2(__spreadValues$3({}, o), { value: o.displayName });
3173
3181
  }),
3174
3182
  onItemSubmit: (item) => setOrganization({ organizationId: item.organizationId, displayName: item.displayName }),
3175
3183
  onChange: (next) => {
@@ -3181,7 +3189,7 @@ const TrialRegistration = (props) => {
3181
3189
  SelectGrid,
3182
3190
  {
3183
3191
  items: OPTIONS,
3184
- onChange: (e, checked) => setInterests(__spreadProps$3(__spreadValues$3({}, interests), { [e]: checked }))
3192
+ onChange: (e, checked) => setInterests(__spreadProps$2(__spreadValues$3({}, interests), { [e]: checked }))
3185
3193
  }
3186
3194
  ), /* @__PURE__ */ React.createElement(Group, { position: "right", mt: "md" }, /* @__PURE__ */ React.createElement(
3187
3195
  Button,
@@ -3220,8 +3228,8 @@ const AdminProvider = (props) => {
3220
3228
  };
3221
3229
 
3222
3230
  var __defProp$2 = Object.defineProperty;
3223
- var __defProps$2 = Object.defineProperties;
3224
- var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
3231
+ var __defProps$1 = Object.defineProperties;
3232
+ var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
3225
3233
  var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
3226
3234
  var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
3227
3235
  var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
@@ -3237,7 +3245,7 @@ var __spreadValues$2 = (a, b) => {
3237
3245
  }
3238
3246
  return a;
3239
3247
  };
3240
- var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
3248
+ var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
3241
3249
  const useStyles$5 = createStyles((theme, props) => ({
3242
3250
  footer: {
3243
3251
  paddingTop: theme.spacing.md,
@@ -3333,7 +3341,7 @@ const App = (props) => {
3333
3341
  padding: "xs",
3334
3342
  navbar: props.navbar && /* @__PURE__ */ React.createElement(
3335
3343
  Navbar,
3336
- __spreadProps$2(__spreadValues$2({}, props.navbar.props), {
3344
+ __spreadProps$1(__spreadValues$2({}, props.navbar.props), {
3337
3345
  onSwitchAccounts: account.accounts && account.accounts.length > 1 ? () => account.setChangeModalOpen(true) : void 0
3338
3346
  })
3339
3347
  ),
@@ -3527,8 +3535,6 @@ function Stack$1(props) {
3527
3535
  }
3528
3536
 
3529
3537
  var __defProp$1 = Object.defineProperty;
3530
- var __defProps$1 = Object.defineProperties;
3531
- var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
3532
3538
  var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
3533
3539
  var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
3534
3540
  var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
@@ -3544,37 +3550,12 @@ var __spreadValues$1 = (a, b) => {
3544
3550
  }
3545
3551
  return a;
3546
3552
  };
3547
- var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
3548
3553
  function Table$2(props) {
3549
3554
  const preparedItems = React.useMemo(() => {
3550
- var _a, _b;
3551
- console.group("Pathway Table Data Check");
3552
- console.log("Raw items from props:", props);
3553
- console.log("Raw items from prop.itemss:", props.items);
3554
- console.log("Categories available:", props.categories);
3555
- const mapped = props.items.map((item) => {
3556
- const flatItem = __spreadProps$1(__spreadValues$1({}, item), {
3557
- status: item.isComplete ? 1 : 0
3558
- });
3559
- if (item.categoryPoints) {
3560
- Object.keys(item.categoryPoints).forEach((catId) => {
3561
- flatItem[catId] = item.categoryPoints[catId];
3562
- });
3563
- }
3564
- return flatItem;
3565
- });
3566
- console.log("Transformed items (Flat):", mapped);
3567
- const firstCatId = (_b = (_a = props.categories) == null ? void 0 : _a[0]) == null ? void 0 : _b.categoryId;
3568
- if (mapped.length > 0 && firstCatId) {
3569
- console.log(`Matching Check for ID [${firstCatId}]:`, mapped[0][firstCatId] !== void 0 ? "\u2705 FOUND" : "\u274C MISSING");
3570
- console.groupEnd();
3571
- } else if (props.categories) {
3572
- console.groupEnd();
3573
- }
3574
- return mapped;
3575
- }, [props.items, props.categories]);
3555
+ return (props.items || []).map((item) => __spreadValues$1(__spreadValues$1({}, item), item.categoryPoints));
3556
+ }, [props.items]);
3576
3557
  const { items: sortedItems, requestSort, sortConfig } = useSortableData(preparedItems);
3577
- if (props.items.length === 0) {
3558
+ if (props.loading && props.items.length === 0) {
3578
3559
  return /* @__PURE__ */ React.createElement(
3579
3560
  PlaceholderBanner,
3580
3561
  {
@@ -3612,7 +3593,7 @@ function Table$2(props) {
3612
3593
  render: (row) => /* @__PURE__ */ React.createElement(Group, { spacing: "sm", noWrap: true }, /* @__PURE__ */ React.createElement(Avatar, { size: 40, src: row.avatar, radius: 40 }), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Text, { size: "sm", weight: 500 }, row.name), /* @__PURE__ */ React.createElement(Text, { size: "xs", color: "dimmed" }, row.email)))
3613
3594
  },
3614
3595
  {
3615
- accessor: "status",
3596
+ accessor: "isComplete",
3616
3597
  title: "Status",
3617
3598
  sortable: true,
3618
3599
  titleStyle: { whiteSpace: "nowrap" },
@@ -3657,6 +3638,8 @@ function Table$1(props) {
3657
3638
  DataTable,
3658
3639
  {
3659
3640
  verticalSpacing: "sm",
3641
+ withBorder: false,
3642
+ borderRadius: "sm",
3660
3643
  sx: { minWidth: 700 },
3661
3644
  highlightOnHover: true,
3662
3645
  striped: true,
@@ -3669,7 +3652,23 @@ function Table$1(props) {
3669
3652
  accessor: "badgeName",
3670
3653
  title: "Badge Name",
3671
3654
  sortable: true,
3672
- render: (row) => /* @__PURE__ */ React.createElement(Text, { component: Link, to: row.href, color: "blue" }, row.badgeName)
3655
+ render: (row) => /* @__PURE__ */ React.createElement(
3656
+ Text,
3657
+ {
3658
+ component: Link,
3659
+ to: row.href,
3660
+ sx: (theme) => ({
3661
+ color: theme.colorScheme === "dark" ? theme.white : theme.black,
3662
+ textDecoration: "none",
3663
+ fontWeight: 500,
3664
+ "&:hover": {
3665
+ textDecoration: "underline",
3666
+ color: theme.colors.blue[6]
3667
+ }
3668
+ })
3669
+ },
3670
+ row.badgeName
3671
+ )
3673
3672
  },
3674
3673
  {
3675
3674
  accessor: "percentageCompletion",