@local-civics/mgmt-ui 0.1.72 → 0.1.73

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
@@ -31,6 +31,7 @@ interface NestedNavbarProps {
31
31
  href: string;
32
32
  hidden?: boolean;
33
33
  }>;
34
+ trial?: boolean;
34
35
  onLogout: () => void;
35
36
  onSwitchAccounts?: () => void;
36
37
  }
@@ -119,6 +120,7 @@ type BadgeProps = {
119
120
  classId: string;
120
121
  students: BadgeUserItem[];
121
122
  href: string;
123
+ trial?: boolean;
122
124
  onBackClick: () => void;
123
125
  onClassChange: (classId: string) => void;
124
126
  onCopyLinkClick: () => void;
@@ -459,6 +461,7 @@ type LessonProps = {
459
461
  students: LessonUserItem[];
460
462
  reflections: Item$5[];
461
463
  questions: Item$2[];
464
+ trial?: boolean;
462
465
  onBackClick: () => void;
463
466
  onClassChange: (classId: string) => void;
464
467
  onCopyLinkClick: () => void;
package/dist/index.js CHANGED
@@ -357,7 +357,7 @@ function NestedNavbar(props) {
357
357
  const toggle = () => setBurgerOpen(!burgerOpen);
358
358
  const links = data.map((item) => {
359
359
  const context = props.links[item.label] || { notifications: 0, href: "" };
360
- if (context.hidden) {
360
+ if (context.hidden || props.trial && item.label !== "Home") {
361
361
  return null;
362
362
  }
363
363
  return /* @__PURE__ */ React__namespace.createElement(
@@ -372,7 +372,7 @@ function NestedNavbar(props) {
372
372
  })
373
373
  );
374
374
  });
375
- return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(core.Navbar, { width: { sm: 300 }, p: "md", className: cx(classes.navbar, { [classes.navHeader]: !burgerOpen }) }, /* @__PURE__ */ React__namespace.createElement(core.Navbar.Section, { className: classes.header }, /* @__PURE__ */ React__namespace.createElement(core.Group, { position: "apart" }, /* @__PURE__ */ React__namespace.createElement(core.Center, null, /* @__PURE__ */ React__namespace.createElement(core.Avatar, { color: "blue", radius: "sm" }, /* @__PURE__ */ React__namespace.createElement("div", { style: { width: 15, marginLeft: "auto", marginRight: "auto" } }, /* @__PURE__ */ React__namespace.createElement(core.Image, { fit: "contain", src: "https://cdn.localcivics.io/brand/l.png" })))), /* @__PURE__ */ React__namespace.createElement(core.Group, { position: "apart" }, /* @__PURE__ */ React__namespace.createElement(core.Code, { sx: { fontWeight: 700 } }, props.version), /* @__PURE__ */ React__namespace.createElement(core.Burger, { opened: burgerOpen, onClick: toggle, className: classes.burger, size: "sm" })))), /* @__PURE__ */ React__namespace.createElement("div", { className: cx({ [classes.navBody]: !burgerOpen }) }, /* @__PURE__ */ React__namespace.createElement(
375
+ return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(core.Navbar, { width: { sm: 300 }, p: "md", className: cx(classes.navbar, { [classes.navHeader]: !burgerOpen }) }, /* @__PURE__ */ React__namespace.createElement(core.Navbar.Section, { className: classes.header }, /* @__PURE__ */ React__namespace.createElement(core.Group, { position: "apart" }, /* @__PURE__ */ React__namespace.createElement(core.Center, null, /* @__PURE__ */ React__namespace.createElement(core.Avatar, { color: "blue", radius: "sm" }, /* @__PURE__ */ React__namespace.createElement("div", { style: { width: 15, marginLeft: "auto", marginRight: "auto" } }, /* @__PURE__ */ React__namespace.createElement(core.Image, { fit: "contain", src: "https://cdn.localcivics.io/brand/l.png" })))), /* @__PURE__ */ React__namespace.createElement(core.Group, { position: "apart" }, /* @__PURE__ */ React__namespace.createElement(core.Code, { sx: { fontWeight: 700 } }, props.version), !!props.trial && /* @__PURE__ */ React__namespace.createElement(core.Badge, { color: "violet", radius: "xs" }, "Trial"), /* @__PURE__ */ React__namespace.createElement(core.Burger, { opened: burgerOpen, onClick: toggle, className: classes.burger, size: "sm" })))), /* @__PURE__ */ React__namespace.createElement("div", { className: cx({ [classes.navBody]: !burgerOpen }) }, /* @__PURE__ */ React__namespace.createElement(
376
376
  UserButton,
377
377
  {
378
378
  className: classes.user,
@@ -712,7 +712,7 @@ const Badge = (props) => {
712
712
  leftSection: /* @__PURE__ */ React__namespace.createElement(core.ActionIcon, { color: "blue", size: "xs", radius: "xl", variant: "filled" }, /* @__PURE__ */ React__namespace.createElement(icons.IconArrowLeft, { size: 14 })),
713
713
  size: "lg"
714
714
  },
715
- "Badges"
715
+ "Go Back"
716
716
  )), /* @__PURE__ */ React__namespace.createElement(core.Group, null, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: 0 }, /* @__PURE__ */ React__namespace.createElement(core.Title, { order: 2, className: classes.title, mt: "md" }, props.displayName || "Badge"), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", className: classes.description, mt: "sm" }, props.description || "No description")), /* @__PURE__ */ React__namespace.createElement(core.Stack, { ml: "auto" }, /* @__PURE__ */ React__namespace.createElement(
717
717
  SplitButton$3,
718
718
  {
@@ -726,7 +726,7 @@ const Badge = (props) => {
726
726
  value: percentageOfBadgesEarned,
727
727
  unit: "%"
728
728
  }
729
- ] }), /* @__PURE__ */ React__namespace.createElement(
729
+ ] }), !props.trial && /* @__PURE__ */ React__namespace.createElement(
730
730
  core.Select,
731
731
  {
732
732
  clearable: true,
@@ -741,7 +741,7 @@ const Badge = (props) => {
741
741
  return { value: g.classId, label: g.name };
742
742
  })
743
743
  }
744
- ), /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: 0 }, /* @__PURE__ */ React__namespace.createElement(
744
+ ), /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: 0 }, !props.trial && /* @__PURE__ */ React__namespace.createElement(
745
745
  Tabs,
746
746
  {
747
747
  value: tab,
@@ -751,13 +751,13 @@ const Badge = (props) => {
751
751
  ],
752
752
  onChange: setTab
753
753
  }
754
- ), tab === "lessons" && /* @__PURE__ */ React__namespace.createElement(
754
+ ), (!!props.trial || tab === "lessons") && /* @__PURE__ */ React__namespace.createElement(
755
755
  Table$f,
756
756
  {
757
757
  loading: props.loading,
758
758
  items: props.lessons
759
759
  }
760
- ), tab === "students" && /* @__PURE__ */ React__namespace.createElement(
760
+ ), !props.trial && tab === "students" && /* @__PURE__ */ React__namespace.createElement(
761
761
  Table$g,
762
762
  {
763
763
  loading: props.loading,
@@ -1182,7 +1182,7 @@ const Class = (props) => {
1182
1182
  leftSection: /* @__PURE__ */ React__namespace.createElement(core.ActionIcon, { color: "blue", size: "xs", radius: "xl", variant: "filled" }, /* @__PURE__ */ React__namespace.createElement(icons.IconArrowLeft, { size: 14 })),
1183
1183
  size: "lg"
1184
1184
  },
1185
- "Classes"
1185
+ "Go Back"
1186
1186
  )), /* @__PURE__ */ React__namespace.createElement(core.Title, { order: 2, className: classes.title, mt: "md" }, props.displayName || "Class"), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", className: classes.description, mt: "sm" }, props.description || "No description")), /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { sm: "content" }, !props.loading && /* @__PURE__ */ React__namespace.createElement(
1187
1187
  SplitButton$2,
1188
1188
  {
@@ -1485,7 +1485,7 @@ const Student = (props) => {
1485
1485
  leftSection: /* @__PURE__ */ React__namespace.createElement(core.ActionIcon, { color: "blue", size: "xs", radius: "xl", variant: "filled" }, /* @__PURE__ */ React__namespace.createElement(icons.IconArrowLeft, { size: 14 })),
1486
1486
  size: "lg"
1487
1487
  },
1488
- "Back"
1488
+ "Go Back"
1489
1489
  )), /* @__PURE__ */ React__namespace.createElement(
1490
1490
  UserInfo,
1491
1491
  {
@@ -1616,7 +1616,8 @@ const useStyles$8 = core.createStyles((theme) => ({
1616
1616
  card: {
1617
1617
  height: 240,
1618
1618
  backgroundSize: "cover",
1619
- backgroundPosition: "center"
1619
+ backgroundPosition: "center",
1620
+ whiteSpace: "pre-line"
1620
1621
  },
1621
1622
  content: {
1622
1623
  position: "absolute",
@@ -1946,7 +1947,7 @@ const Lesson = (props) => {
1946
1947
  leftSection: /* @__PURE__ */ React__namespace.createElement(core.ActionIcon, { color: "blue", size: "xs", radius: "xl", variant: "filled" }, /* @__PURE__ */ React__namespace.createElement(icons.IconArrowLeft, { size: 14 })),
1947
1948
  size: "lg"
1948
1949
  },
1949
- "Lessons"
1950
+ "Go Back"
1950
1951
  )), /* @__PURE__ */ React__namespace.createElement(core.Group, null, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: 0 }, /* @__PURE__ */ React__namespace.createElement(core.Title, { order: 2, className: classes.title, mt: "md" }, props.displayName || "Lesson"), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", className: classes.description, mt: "sm" }, props.description || "No description")), /* @__PURE__ */ React__namespace.createElement(core.Stack, { ml: "auto" }, /* @__PURE__ */ React__namespace.createElement(
1951
1952
  SplitButton$1,
1952
1953
  {
@@ -1960,7 +1961,7 @@ const Lesson = (props) => {
1960
1961
  value: percentageOfLessonsCompleted,
1961
1962
  unit: "%"
1962
1963
  }
1963
- ] }), /* @__PURE__ */ React__namespace.createElement(
1964
+ ] }), !props.trial && /* @__PURE__ */ React__namespace.createElement(
1964
1965
  core.Select,
1965
1966
  {
1966
1967
  clearable: true,
@@ -1975,7 +1976,7 @@ const Lesson = (props) => {
1975
1976
  return { value: g.classId, label: g.name };
1976
1977
  })
1977
1978
  }
1978
- ), /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: 0 }, /* @__PURE__ */ React__namespace.createElement(
1979
+ ), /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: 0 }, !props.trial && /* @__PURE__ */ React__namespace.createElement(
1979
1980
  Tabs,
1980
1981
  {
1981
1982
  value: tab,
@@ -1986,19 +1987,19 @@ const Lesson = (props) => {
1986
1987
  ],
1987
1988
  onChange: setTab
1988
1989
  }
1989
- ), tab === "question" && /* @__PURE__ */ React__namespace.createElement(
1990
+ ), (!!props.trial || tab === "question") && /* @__PURE__ */ React__namespace.createElement(
1990
1991
  Stack,
1991
1992
  {
1992
1993
  loading: props.loading,
1993
1994
  items: props.questions
1994
1995
  }
1995
- ), tab === "reflections" && /* @__PURE__ */ React__namespace.createElement(
1996
+ ), !props.trial && tab === "reflections" && /* @__PURE__ */ React__namespace.createElement(
1996
1997
  Table$3,
1997
1998
  {
1998
1999
  loading: props.loading,
1999
2000
  items: props.reflections
2000
2001
  }
2001
- ), tab === "students" && /* @__PURE__ */ React__namespace.createElement(
2002
+ ), !props.trial && tab === "students" && /* @__PURE__ */ React__namespace.createElement(
2002
2003
  Table$2,
2003
2004
  {
2004
2005
  loading: props.loading,
@@ -2154,7 +2155,7 @@ const Organization = (props) => {
2154
2155
  leftSection: /* @__PURE__ */ React__namespace.createElement(core.ActionIcon, { color: "blue", size: "xs", radius: "xl", variant: "filled" }, /* @__PURE__ */ React__namespace.createElement(icons.IconArrowLeft, { size: 14 })),
2155
2156
  size: "lg"
2156
2157
  },
2157
- "Organization"
2158
+ "Go Back"
2158
2159
  )), /* @__PURE__ */ React__namespace.createElement(core.Title, { order: 2, className: classes.title, mt: "md" }, props.displayName || "Overview"), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", className: classes.description, mt: "sm" }, props.description || "No description"))), /* @__PURE__ */ React__namespace.createElement(AccessCode, { value: props.accessCode, onCopyCode: props.onCopyAccessCode, peopleLink: props.peopleLink }), /* @__PURE__ */ React__namespace.createElement("div", { style: { position: "relative" } }, /* @__PURE__ */ React__namespace.createElement(core.LoadingOverlay, { visible: props.loading, overlayBlur: 2 }), /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "sm" }, /* @__PURE__ */ React__namespace.createElement(StatsGroup, { data: [
2159
2160
  {
2160
2161
  title: "# OF STUDENTS",
@@ -2361,7 +2362,7 @@ const People = (props) => {
2361
2362
  leftSection: /* @__PURE__ */ React__namespace.createElement(core.ActionIcon, { color: "blue", size: "xs", radius: "xl", variant: "filled" }, /* @__PURE__ */ React__namespace.createElement(icons.IconArrowLeft, { size: 14 })),
2362
2363
  size: "lg"
2363
2364
  },
2364
- "Organization"
2365
+ "Go Back"
2365
2366
  )), /* @__PURE__ */ React__namespace.createElement(core.Title, { order: 2, className: classes.title, mt: "md" }, "People"), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", className: classes.description, mt: "sm" }, "Manage members of your organization")), /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { sm: "content" }, !props.loading && /* @__PURE__ */ React__namespace.createElement(
2366
2367
  SplitButton,
2367
2368
  {