@local-civics/mgmt-ui 0.1.83 → 0.1.85

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
@@ -16,6 +16,7 @@ interface NavbarProps {
16
16
  hidden?: boolean;
17
17
  }>;
18
18
  trial?: boolean;
19
+ loading?: boolean;
19
20
  onLogout: () => void;
20
21
  onSwitchAccounts?: () => void;
21
22
  }
@@ -613,6 +614,7 @@ type TrialRegistrationProps = {
613
614
  onBegin: (data: {
614
615
  firstName: string;
615
616
  lastName: string;
617
+ schoolName: string;
616
618
  interests: string[];
617
619
  }) => void;
618
620
  };
package/dist/index.js CHANGED
@@ -308,6 +308,9 @@ function Navbar(props) {
308
308
  if (context.hidden || props.trial && TRIAL_PAGES.indexOf(item.label) === -1) {
309
309
  return null;
310
310
  }
311
+ if (props.loading && item.label !== "Home") {
312
+ return null;
313
+ }
311
314
  return /* @__PURE__ */ React__namespace.createElement(
312
315
  LinksGroup,
313
316
  __spreadProps$5(__spreadValues$8(__spreadValues$8({
@@ -320,7 +323,7 @@ function Navbar(props) {
320
323
  })
321
324
  );
322
325
  });
323
- 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(
326
+ 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 }) }, !props.loading && /* @__PURE__ */ React__namespace.createElement(
324
327
  UserButton,
325
328
  {
326
329
  className: classes.user,
@@ -328,7 +331,7 @@ function Navbar(props) {
328
331
  name: props.name,
329
332
  email: props.email
330
333
  }
331
- ), /* @__PURE__ */ React__namespace.createElement(core.Navbar.Section, { grow: true, className: classes.links, component: core.ScrollArea }, /* @__PURE__ */ React__namespace.createElement("div", { className: classes.linksInner }, links)), /* @__PURE__ */ React__namespace.createElement(core.Navbar.Section, { className: classes.footer }, !!props.onSwitchAccounts && /* @__PURE__ */ React__namespace.createElement("a", { href: "#", className: classes.link, onClick: (event) => {
334
+ ), /* @__PURE__ */ React__namespace.createElement(core.Navbar.Section, { grow: true, className: classes.links, component: core.ScrollArea }, /* @__PURE__ */ React__namespace.createElement("div", { className: classes.linksInner }, links)), !props.loading && /* @__PURE__ */ React__namespace.createElement(core.Navbar.Section, { className: classes.footer }, !!props.onSwitchAccounts && /* @__PURE__ */ React__namespace.createElement("a", { href: "#", className: classes.link, onClick: (event) => {
332
335
  event.preventDefault();
333
336
  props.onSwitchAccounts && props.onSwitchAccounts();
334
337
  } }, /* @__PURE__ */ React__namespace.createElement(icons.IconSwitchHorizontal, { className: classes.linkIcon, stroke: 1.5 }), /* @__PURE__ */ React__namespace.createElement("span", null, "Change account")), /* @__PURE__ */ React__namespace.createElement("a", { href: "#", className: classes.link, onClick: (event) => {
@@ -2398,40 +2401,55 @@ const DropzoneButton = (props) => {
2398
2401
  };
2399
2402
 
2400
2403
  const useStyles$3 = core.createStyles((theme) => ({
2401
- wrapper: {
2402
- minHeight: 400,
2403
- boxSizing: "border-box",
2404
- backgroundImage: `linear-gradient(-60deg, ${theme.colors[theme.primaryColor][4]} 0%, ${theme.colors[theme.primaryColor][7]} 100%)`,
2404
+ form: {
2405
+ backgroundColor: theme.white,
2406
+ padding: theme.spacing.xl,
2407
+ border: `1px solid ${theme.colorScheme === "dark" ? theme.colors.dark[8] : theme.colors.gray[3]}`,
2405
2408
  borderRadius: theme.radius.md,
2406
- padding: theme.spacing.xl * 2.5,
2407
- [`@media (max-width: ${theme.breakpoints.sm}px)`]: {
2408
- padding: theme.spacing.xl * 1.5
2409
+ boxShadow: theme.shadows.lg,
2410
+ minWidth: 300,
2411
+ height: "fit-content"
2412
+ },
2413
+ wrapper: {
2414
+ position: "relative",
2415
+ paddingTop: 180,
2416
+ paddingBottom: 130
2417
+ },
2418
+ content: {
2419
+ maxWidth: 480,
2420
+ marginRight: theme.spacing.xl * 3,
2421
+ [theme.fn.smallerThan("md")]: {
2422
+ maxWidth: "100%",
2423
+ marginRight: 0
2409
2424
  }
2410
2425
  },
2411
2426
  title: {
2427
+ color: theme.colorScheme === "dark" ? theme.white : theme.black,
2412
2428
  fontFamily: `Greycliff CF, ${theme.fontFamily}`,
2413
- color: theme.white,
2414
- lineHeight: 1
2415
- },
2416
- description: {
2417
- color: theme.colors[theme.primaryColor][0],
2418
- maxWidth: 300,
2419
- [`@media (max-width: ${theme.breakpoints.sm}px)`]: {
2420
- maxWidth: "100%"
2429
+ fontSize: 44,
2430
+ lineHeight: 1.2,
2431
+ fontWeight: 900,
2432
+ [theme.fn.smallerThan("xs")]: {
2433
+ fontSize: 28
2421
2434
  }
2422
2435
  },
2423
- form: {
2424
- backgroundColor: theme.white,
2425
- padding: theme.spacing.xl,
2426
- borderRadius: theme.radius.md,
2427
- boxShadow: theme.shadows.lg
2436
+ control: {
2437
+ [theme.fn.smallerThan("xs")]: {
2438
+ flex: 1
2439
+ }
2428
2440
  },
2429
- social: {
2430
- color: theme.white,
2431
- "&:hover": {
2432
- color: theme.colors[theme.primaryColor][1]
2441
+ image: {
2442
+ flex: 1,
2443
+ [theme.fn.smallerThan("md")]: {
2444
+ display: "none"
2433
2445
  }
2434
2446
  },
2447
+ highlight: {
2448
+ position: "relative",
2449
+ backgroundColor: theme.fn.variant({ variant: "light", color: theme.primaryColor }).background,
2450
+ borderRadius: theme.radius.sm,
2451
+ padding: "4px 12px"
2452
+ },
2435
2453
  input: {
2436
2454
  backgroundColor: theme.white,
2437
2455
  borderColor: theme.colors.gray[4],
@@ -2442,14 +2460,12 @@ const useStyles$3 = core.createStyles((theme) => ({
2442
2460
  },
2443
2461
  inputLabel: {
2444
2462
  color: theme.black
2445
- },
2446
- control: {
2447
- backgroundColor: theme.colors[theme.primaryColor][6]
2448
2463
  }
2449
2464
  }));
2450
2465
  const StartAnonymousLesson = (props) => {
2451
2466
  const { classes } = useStyles$3();
2452
- return /* @__PURE__ */ React__namespace.createElement("div", { className: classes.wrapper }, /* @__PURE__ */ React__namespace.createElement(core.SimpleGrid, { cols: 2, spacing: 50, breakpoints: [{ maxWidth: "sm", cols: 1 }] }, /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(core.Title, { className: classes.title }, props.title), /* @__PURE__ */ React__namespace.createElement(core.Text, { weight: "bold", className: classes.description, mt: "sm", mb: 30 }, "Instructor: ", props.educatorName), /* @__PURE__ */ React__namespace.createElement(core.Text, { className: classes.description, mt: "sm", mb: 30 }, props.description)), /* @__PURE__ */ React__namespace.createElement("div", { className: classes.form }, /* @__PURE__ */ React__namespace.createElement(
2467
+ const [name, setName] = React__namespace.useState("");
2468
+ return /* @__PURE__ */ React__namespace.createElement("div", { className: classes.wrapper }, /* @__PURE__ */ React__namespace.createElement(core.Container, null, /* @__PURE__ */ React__namespace.createElement(core.SimpleGrid, { maw: 960, cols: 2, spacing: 15, breakpoints: [{ maxWidth: "sm", cols: 1 }] }, /* @__PURE__ */ React__namespace.createElement("div", { className: classes.content }, /* @__PURE__ */ React__namespace.createElement(core.Badge, { color: "violet" }, "Anonymous"), /* @__PURE__ */ React__namespace.createElement(core.Title, { className: classes.title }, props.title), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", mt: "md" }, props.description), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", mt: "md" }, "Instructed by ", props.educatorName, ".")), /* @__PURE__ */ React__namespace.createElement("div", { className: classes.form }, /* @__PURE__ */ React__namespace.createElement(
2453
2469
  core.TextInput,
2454
2470
  {
2455
2471
  label: "Name",
@@ -2457,9 +2473,10 @@ const StartAnonymousLesson = (props) => {
2457
2473
  defaultValue: props.studentName,
2458
2474
  readOnly: !!props.studentName,
2459
2475
  required: true,
2476
+ onChange: (e) => setName(e.target.value),
2460
2477
  classNames: { input: classes.input, label: classes.inputLabel }
2461
2478
  }
2462
- ), /* @__PURE__ */ React__namespace.createElement(core.Group, { position: "right", mt: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Button, { onClick: props.onStart, className: classes.control }, !props.studentName ? "Start lesson" : "Continue lesson")))));
2479
+ ), /* @__PURE__ */ React__namespace.createElement(core.Group, { position: "right", mt: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Button, { disabled: !name && !props.studentName, onClick: props.onStart, className: classes.control }, !props.studentName ? "Start lesson" : "Continue lesson"))))));
2463
2480
  };
2464
2481
 
2465
2482
  var __defProp$3 = Object.defineProperty;
@@ -2571,7 +2588,7 @@ const useStyles$2 = core.createStyles((theme, { checked }) => ({
2571
2588
  transition: "background-color 150ms ease, border-color 150ms ease",
2572
2589
  border: `1px solid ${checked ? theme.fn.variant({ variant: "outline", color: theme.primaryColor }).border : theme.colorScheme === "dark" ? theme.colors.dark[8] : theme.colors.gray[3]}`,
2573
2590
  borderRadius: theme.radius.sm,
2574
- padding: theme.spacing.lg,
2591
+ padding: theme.spacing.xl,
2575
2592
  backgroundColor: checked ? theme.fn.variant({ variant: "light", color: theme.primaryColor }).background : theme.colorScheme === "dark" ? theme.colors.dark[8] : theme.white
2576
2593
  },
2577
2594
  body: {
@@ -2611,7 +2628,7 @@ function ImageCheckbox(_a) {
2611
2628
  className: cx(classes.button, className)
2612
2629
  }),
2613
2630
  /* @__PURE__ */ React__namespace.createElement(core.ThemeIcon, { variant: "light", size: "lg", color: "blue" }, /* @__PURE__ */ React__namespace.createElement(Icon, { size: 40 })),
2614
- /* @__PURE__ */ React__namespace.createElement("div", { className: classes.body }, /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", size: "xs", sx: { lineHeight: 1 }, mb: 5 }, description), /* @__PURE__ */ React__namespace.createElement(core.Text, { weight: 500, size: "sm", sx: { lineHeight: 1 } }, title)),
2631
+ /* @__PURE__ */ React__namespace.createElement("div", { className: classes.body }, /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", size: "xs", sx: { lineHeight: 1 }, mb: 5 }, description), /* @__PURE__ */ React__namespace.createElement(core.Text, { weight: 500, size: "md", sx: { lineHeight: 1 } }, title)),
2615
2632
  /* @__PURE__ */ React__namespace.createElement(
2616
2633
  core.Checkbox,
2617
2634
  {
@@ -2669,7 +2686,7 @@ const useStyles$1 = core.createStyles((theme) => ({
2669
2686
  minHeight: 400,
2670
2687
  height: "100%",
2671
2688
  boxSizing: "border-box",
2672
- backgroundImage: `linear-gradient(-60deg, ${theme.colors[theme.primaryColor][4]} 0%, ${theme.colors[theme.primaryColor][7]} 100%)`,
2689
+ backgroundImage: `linear-gradient(-60deg, #4e5561 0%, #222a39 100%)`,
2673
2690
  padding: theme.spacing.xl * 2.5,
2674
2691
  [`@media (max-width: ${theme.breakpoints.sm}px)`]: {
2675
2692
  padding: theme.spacing.xl * 1.5
@@ -2727,6 +2744,7 @@ const TrialRegistration = (props) => {
2727
2744
  const { classes } = useStyles$1();
2728
2745
  const [firstName, setFirstName] = React__namespace.useState("");
2729
2746
  const [lastName, setLastName] = React__namespace.useState("");
2747
+ const [schoolName, setSchoolName] = React__namespace.useState("");
2730
2748
  const [interests, setInterests] = React__namespace.useState({});
2731
2749
  return /* @__PURE__ */ React__namespace.createElement("div", { className: classes.wrapper }, /* @__PURE__ */ React__namespace.createElement(core.SimpleGrid, { maw: 960, ml: "auto", mr: "auto", cols: 1, spacing: 15, breakpoints: [{ maxWidth: "sm", cols: 1 }] }, /* @__PURE__ */ React__namespace.createElement(core.Group, { spacing: "sm" }, /* @__PURE__ */ React__namespace.createElement(
2732
2750
  core.Image,
@@ -2736,11 +2754,20 @@ const TrialRegistration = (props) => {
2736
2754
  fit: "contain",
2737
2755
  src: "https://cdn.localcivics.io/brand/l.png"
2738
2756
  }
2739
- ), /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(core.Title, { className: classes.title }, "Trial Educator"), /* @__PURE__ */ React__namespace.createElement(core.Text, { className: classes.description, mt: "sm" }, "Try out a few of the features we can bring to your classroom. No commitment required."))), /* @__PURE__ */ React__namespace.createElement("div", { className: classes.form }, /* @__PURE__ */ React__namespace.createElement(core.Group, { mb: "md", spacing: "md", grow: true }, /* @__PURE__ */ React__namespace.createElement(
2757
+ ), /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(core.Title, { className: classes.title }, "Are you an", " ", /* @__PURE__ */ React__namespace.createElement(
2758
+ core.Text,
2759
+ {
2760
+ component: "span",
2761
+ inherit: true,
2762
+ variant: "gradient",
2763
+ gradient: { from: "pink", to: "yellow" }
2764
+ },
2765
+ "educator"
2766
+ ), " ", "interested in a free trial?"), /* @__PURE__ */ React__namespace.createElement(core.Text, { className: classes.description, mt: "sm" }, "Try out a few of the features we can bring to your classroom. No commitment required."))), /* @__PURE__ */ React__namespace.createElement("div", { className: classes.form }, /* @__PURE__ */ React__namespace.createElement(core.SimpleGrid, { cols: 2, spacing: 15, breakpoints: [{ maxWidth: "sm", cols: 1 }] }, /* @__PURE__ */ React__namespace.createElement(
2740
2767
  core.TextInput,
2741
2768
  {
2742
2769
  label: "First Name",
2743
- placeholder: "John",
2770
+ placeholder: "Your first name",
2744
2771
  required: true,
2745
2772
  classNames: { input: classes.input, label: classes.inputLabel },
2746
2773
  onChange: (e) => setFirstName(e.target.value)
@@ -2749,11 +2776,19 @@ const TrialRegistration = (props) => {
2749
2776
  core.TextInput,
2750
2777
  {
2751
2778
  label: "Last Name",
2752
- placeholder: "Doe",
2779
+ placeholder: "Your last name",
2753
2780
  required: true,
2754
2781
  classNames: { input: classes.input, label: classes.inputLabel },
2755
2782
  onChange: (e) => setLastName(e.target.value)
2756
2783
  }
2784
+ ), /* @__PURE__ */ React__namespace.createElement(
2785
+ core.TextInput,
2786
+ {
2787
+ label: "School Name (Optional)",
2788
+ placeholder: "What school, if any, are you associated with?",
2789
+ classNames: { input: classes.input, label: classes.inputLabel },
2790
+ onChange: (e) => setSchoolName(e.target.value)
2791
+ }
2757
2792
  )), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: 14, weight: 500, mb: "md", mt: "xl" }, "What are you interested in teaching?"), /* @__PURE__ */ React__namespace.createElement(
2758
2793
  SelectGrid,
2759
2794
  {
@@ -2763,7 +2798,8 @@ const TrialRegistration = (props) => {
2763
2798
  ), /* @__PURE__ */ React__namespace.createElement(core.Group, { position: "right", mt: "md" }, /* @__PURE__ */ React__namespace.createElement(
2764
2799
  core.Button,
2765
2800
  {
2766
- onClick: () => props.onBegin({ firstName, lastName, interests: Object.keys(interests) }),
2801
+ disabled: !firstName || !lastName,
2802
+ onClick: () => props.onBegin({ firstName, lastName, schoolName, interests: Object.keys(interests) }),
2767
2803
  className: classes.control
2768
2804
  },
2769
2805
  "Begin trial"