@local-civics/mgmt-ui 0.1.92 → 0.1.94

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
@@ -611,12 +611,19 @@ declare const TrialHome: (props: TrialHomeProps) => JSX.Element;
611
611
  * TrialRegistrationProps
612
612
  */
613
613
  type TrialRegistrationProps = {
614
- onBegin: (data: {
615
- firstName: string;
616
- lastName: string;
617
- schoolName: string;
618
- interests: string[];
619
- }) => void;
614
+ organizations: {
615
+ organizationId: string;
616
+ displayName: string;
617
+ }[];
618
+ onBegin: (data: NewTrialRegistration) => void;
619
+ onQueryOrganizations: (name: string) => void;
620
+ };
621
+ type NewTrialRegistration = {
622
+ firstName: string;
623
+ lastName: string;
624
+ organizationId: string;
625
+ organizationName: string;
626
+ interests: string[];
620
627
  };
621
628
  /**
622
629
  * TrialRegistration
@@ -657,4 +664,4 @@ type AppProps = {
657
664
  */
658
665
  declare const App: (props: AppProps) => JSX.Element;
659
666
 
660
- export { AccountItem, AdminProvider, AdminProviderProps, App, AppProps, Badge, BadgeClass, BadgeItem, BadgeProps, BadgeUserItem, Badges, BadgesProps, Class, ClassItem, ClassProps, Classes, ClassesProps, Dashboard, DashboardClass, DashboardProps, Home, HomeProps, Lesson, LessonClass, LessonItem, LessonProps, LessonUserItem, Lessons, LessonsProps, MemberItem, Navbar, NavbarProps, Organization, OrganizationProps, People, PeopleProps, StartAnonymousLesson, StartAnonymousLessonProps, Student, StudentProps, SwitchAccount, SwitchAccountProps, TrialHome, TrialHomeProps, TrialRegistration, TrialRegistrationProps, UserItem };
667
+ export { AccountItem, AdminProvider, AdminProviderProps, App, AppProps, Badge, BadgeClass, BadgeItem, BadgeProps, BadgeUserItem, Badges, BadgesProps, Class, ClassItem, ClassProps, Classes, ClassesProps, Dashboard, DashboardClass, DashboardProps, Home, HomeProps, Lesson, LessonClass, LessonItem, LessonProps, LessonUserItem, Lessons, LessonsProps, MemberItem, Navbar, NavbarProps, NewTrialRegistration, Organization, OrganizationProps, People, PeopleProps, StartAnonymousLesson, StartAnonymousLessonProps, Student, StudentProps, SwitchAccount, SwitchAccountProps, TrialHome, TrialHomeProps, TrialRegistration, TrialRegistrationProps, UserItem };
package/dist/index.js CHANGED
@@ -1721,7 +1721,15 @@ const useStyles$a = core.createStyles((theme) => ({
1721
1721
  const SplitButton$1 = (props) => {
1722
1722
  const { classes, theme } = useStyles$a();
1723
1723
  const menuIconColor = theme.colors[theme.primaryColor][theme.colorScheme === "dark" ? 5 : 6];
1724
- return /* @__PURE__ */ React__namespace.createElement(core.Group, { noWrap: true, spacing: 0 }, /* @__PURE__ */ React__namespace.createElement(
1724
+ return /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "sm" }, /* @__PURE__ */ React__namespace.createElement(
1725
+ core.Button,
1726
+ {
1727
+ variant: "gradient",
1728
+ leftIcon: /* @__PURE__ */ React__namespace.createElement(icons.IconClipboardCopy, { size: 14 }),
1729
+ onClick: props.onCopyLinkClick
1730
+ },
1731
+ "Assign"
1732
+ ), /* @__PURE__ */ React__namespace.createElement(core.Group, { noWrap: true, spacing: 0 }, /* @__PURE__ */ React__namespace.createElement(
1725
1733
  core.Button,
1726
1734
  {
1727
1735
  component: reactRouterDom.Link,
@@ -1739,21 +1747,14 @@ const SplitButton$1 = (props) => {
1739
1747
  className: classes.menuControl
1740
1748
  },
1741
1749
  /* @__PURE__ */ React__namespace.createElement(icons.IconChevronDown, { size: 16, stroke: 1.5 })
1742
- )), /* @__PURE__ */ React__namespace.createElement(core.Menu.Dropdown, null, /* @__PURE__ */ React__namespace.createElement(
1743
- core.Menu.Item,
1744
- {
1745
- icon: /* @__PURE__ */ React__namespace.createElement(icons.IconClipboardCopy, { size: 16, stroke: 1.5, color: menuIconColor }),
1746
- onClick: props.onCopyLinkClick
1747
- },
1748
- "Copy link"
1749
- ), !props.noExport && /* @__PURE__ */ React__namespace.createElement(
1750
+ )), /* @__PURE__ */ React__namespace.createElement(core.Menu.Dropdown, null, !props.noExport && /* @__PURE__ */ React__namespace.createElement(
1750
1751
  core.Menu.Item,
1751
1752
  {
1752
1753
  icon: /* @__PURE__ */ React__namespace.createElement(icons.IconTableExport, { size: 16, stroke: 1.5, color: menuIconColor }),
1753
1754
  onClick: props.onExportDataClick
1754
1755
  },
1755
1756
  "Export data (.csv)"
1756
- ))));
1757
+ )))));
1757
1758
  };
1758
1759
 
1759
1760
  function Stack$1(props) {
@@ -1917,6 +1918,14 @@ const Lesson = (props) => {
1917
1918
  });
1918
1919
  avatars.push(/* @__PURE__ */ React__namespace.createElement(core.Avatar, { src, radius: "xl" }));
1919
1920
  }
1921
+ const tabs = props.trial ? [
1922
+ { label: "By question", value: "question" },
1923
+ { label: "By student", value: "students" }
1924
+ ] : [
1925
+ { label: "By question", value: "question" },
1926
+ { label: "By student", value: "students" },
1927
+ { label: "By reflection", value: "reflections" }
1928
+ ];
1920
1929
  return /* @__PURE__ */ React__namespace.createElement(core.Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Grid, null, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { sm: "auto" }, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { onClick: props.onBackClick }, /* @__PURE__ */ React__namespace.createElement(
1921
1930
  core.Badge,
1922
1931
  {
@@ -1959,30 +1968,26 @@ const Lesson = (props) => {
1959
1968
  return { value: g.classId, label: g.name };
1960
1969
  })
1961
1970
  }
1962
- ), /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: 0 }, !props.trial && /* @__PURE__ */ React__namespace.createElement(
1971
+ ), /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: 0 }, /* @__PURE__ */ React__namespace.createElement(
1963
1972
  Tabs,
1964
1973
  {
1965
1974
  value: tab,
1966
- data: [
1967
- { label: "By question", value: "question" },
1968
- { label: "By student", value: "students" },
1969
- { label: "By reflection", value: "reflections" }
1970
- ],
1975
+ data: tabs,
1971
1976
  onChange: setTab
1972
1977
  }
1973
- ), (!!props.trial || tab === "question") && /* @__PURE__ */ React__namespace.createElement(
1978
+ ), tab === "question" && /* @__PURE__ */ React__namespace.createElement(
1974
1979
  Stack,
1975
1980
  {
1976
1981
  loading: props.loading,
1977
1982
  items: props.questions
1978
1983
  }
1979
- ), !props.trial && tab === "reflections" && /* @__PURE__ */ React__namespace.createElement(
1984
+ ), tab === "reflections" && /* @__PURE__ */ React__namespace.createElement(
1980
1985
  Table$3,
1981
1986
  {
1982
1987
  loading: props.loading,
1983
1988
  items: props.reflections
1984
1989
  }
1985
- ), !props.trial && tab === "students" && /* @__PURE__ */ React__namespace.createElement(
1990
+ ), tab === "students" && /* @__PURE__ */ React__namespace.createElement(
1986
1991
  Table$2,
1987
1992
  {
1988
1993
  loading: props.loading,
@@ -2646,7 +2651,7 @@ function ImageCheckbox(_a) {
2646
2651
  onClick: () => handleChange(!value),
2647
2652
  className: cx(classes.button, className)
2648
2653
  }),
2649
- /* @__PURE__ */ React__namespace.createElement(core.ThemeIcon, { variant: "light", size: "lg", color: "blue" }, /* @__PURE__ */ React__namespace.createElement(Icon, { size: 40 })),
2654
+ /* @__PURE__ */ React__namespace.createElement(core.ThemeIcon, { variant: "light", size: "lg", color: "blue" }, /* @__PURE__ */ React__namespace.createElement(Icon, { size: 25 })),
2650
2655
  /* @__PURE__ */ React__namespace.createElement("div", { className: classes.body }, /* @__PURE__ */ React__namespace.createElement(core.Text, { weight: 500, size: "sm", sx: { lineHeight: 1 } }, title)),
2651
2656
  /* @__PURE__ */ React__namespace.createElement(
2652
2657
  core.Checkbox,
@@ -2752,19 +2757,21 @@ const useStyles$1 = core.createStyles((theme) => ({
2752
2757
  }
2753
2758
  }));
2754
2759
  const OPTIONS = [
2755
- { description: "high school", title: "High school", icon: icons.IconHistory },
2756
- { description: "k - 8th", title: "K - 8th", icon: icons.IconLego },
2757
- { description: "civics", title: "Civics", icon: icons.IconNews },
2758
- { description: "project-based learning", title: "Project-based learning", icon: icons.IconTools },
2760
+ { description: "elementary", title: "Elementary (K-5)", icon: icons.IconScribble },
2761
+ { description: "middle", title: "Middle (6-8)", icon: icons.IconBackpack },
2762
+ { description: "high school", title: "High School (9-12)", icon: icons.IconSchool },
2759
2763
  { description: "college", title: "College", icon: icons.IconPodium },
2760
- { description: "career", title: "Career", icon: icons.IconAffiliate },
2761
- { description: "student leadership", title: "Student leadership", icon: icons.IconGrowth }
2764
+ { description: "career", title: "Career", icon: icons.IconBriefcase },
2765
+ { description: "work-based learning", title: "Work-Based Learning", icon: icons.IconPresentation },
2766
+ { description: "student leadership", title: "Student Leadership", icon: icons.IconPodium },
2767
+ { description: "civics", title: "Civics", icon: icons.IconNews },
2768
+ { description: "project-based learning", title: "Project-Based Learning", icon: icons.IconTools }
2762
2769
  ];
2763
2770
  const TrialRegistration = (props) => {
2764
2771
  const { classes } = useStyles$1();
2765
2772
  const [firstName, setFirstName] = React__namespace.useState("");
2766
2773
  const [lastName, setLastName] = React__namespace.useState("");
2767
- const [schoolName, setSchoolName] = React__namespace.useState("");
2774
+ const [organization, setOrganization] = React__namespace.useState({ organizationId: "", displayName: "" });
2768
2775
  const [interests, setInterests] = React__namespace.useState({});
2769
2776
  return /* @__PURE__ */ React__namespace.createElement("div", { className: classes.wrapper }, /* @__PURE__ */ React__namespace.createElement(core.SimpleGrid, { maw: 1300, ml: "auto", mr: "auto", cols: 2, spacing: 50, breakpoints: [{ maxWidth: "md", cols: 1 }] }, /* @__PURE__ */ React__namespace.createElement(core.Group, { spacing: "sm" }, /* @__PURE__ */ React__namespace.createElement(
2770
2777
  core.Image,
@@ -2802,14 +2809,20 @@ const TrialRegistration = (props) => {
2802
2809
  onChange: (e) => setLastName(e.target.value)
2803
2810
  }
2804
2811
  ), /* @__PURE__ */ React__namespace.createElement(
2805
- core.TextInput,
2812
+ core.Autocomplete,
2806
2813
  {
2807
- label: "School Name (Optional)",
2814
+ label: "School/Organization Name",
2808
2815
  placeholder: "What's the name of your school?",
2809
- classNames: { input: classes.input, label: classes.inputLabel },
2810
- onChange: (e) => setSchoolName(e.target.value)
2816
+ data: props.organizations.map((o) => {
2817
+ return __spreadProps$1(__spreadValues$1({}, o), { value: o.displayName });
2818
+ }),
2819
+ onItemSubmit: (item) => setOrganization({ organizationId: item.organizationId, displayName: item.displayName }),
2820
+ onChange: (next) => {
2821
+ setOrganization({ organizationId: "", displayName: next });
2822
+ return props.onQueryOrganizations(next);
2823
+ }
2811
2824
  }
2812
- )), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: 14, weight: 500, mb: "md", mt: "xl" }, "What are you interested in teaching?"), /* @__PURE__ */ React__namespace.createElement(
2825
+ )), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: 14, weight: 500, mb: "md", mt: "xl" }, "Where do you want to start? (Select as many as you want)"), /* @__PURE__ */ React__namespace.createElement(
2813
2826
  SelectGrid,
2814
2827
  {
2815
2828
  items: OPTIONS,
@@ -2819,7 +2832,13 @@ const TrialRegistration = (props) => {
2819
2832
  core.Button,
2820
2833
  {
2821
2834
  disabled: !firstName || !lastName,
2822
- onClick: () => props.onBegin({ firstName, lastName, schoolName, interests: Object.keys(interests) }),
2835
+ onClick: () => props.onBegin({
2836
+ firstName,
2837
+ lastName,
2838
+ organizationId: organization.organizationId,
2839
+ organizationName: organization.displayName,
2840
+ interests: Object.keys(interests)
2841
+ }),
2823
2842
  className: classes.control
2824
2843
  },
2825
2844
  "Begin trial"