@local-civics/mgmt-ui 0.1.91 → 0.1.93
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 +14 -7
- package/dist/index.js +53 -35
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +54 -36
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useState } 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, UnstyledButton, Card, Modal, Loader, SimpleGrid, Tabs as Tabs$1, Button, Menu, ActionIcon, Title, Grid, Table as Table$h, Container, Stack as Stack$3, LoadingOverlay, Select, Autocomplete, Drawer, Divider, TextInput, Tooltip, Paper, Overlay, Anchor, Progress, Checkbox, createEmotionCache, MantineProvider, AppShell } from '@mantine/core';
|
|
4
|
-
import { IconChevronRight, IconChevronLeft, IconSwitchHorizontal, IconLogout, IconHome2, IconGauge, IconCategory2, IconAlbum, IconLambda, IconBuilding, IconBatteryEco, IconBooks, IconBackpack, IconChevronDown, IconClipboardCopy, IconTableExport, IconArrowLeft, IconPlaylistAdd, IconCheck, IconTrash, IconDownload, IconX, IconCloudUpload, IconInfoCircle, IconColorSwatch, IconPointer, IconBadge,
|
|
4
|
+
import { IconChevronRight, IconChevronLeft, IconSwitchHorizontal, IconLogout, IconHome2, IconGauge, IconCategory2, IconAlbum, IconLambda, IconBuilding, IconBatteryEco, IconBooks, IconBackpack, IconChevronDown, IconClipboardCopy, IconTableExport, IconArrowLeft, IconPlaylistAdd, IconCheck, IconTrash, IconDownload, IconX, IconCloudUpload, IconInfoCircle, IconColorSwatch, IconPointer, IconBadge, IconScribble, IconSchool, IconPodium, IconBriefcase, IconPresentation, IconNews, IconTools, IconBrandInstagram, IconBrandLinkedin, IconBrandFacebook } from '@tabler/icons';
|
|
5
5
|
import { Link } from 'react-router-dom';
|
|
6
6
|
import { NotificationsProvider } from '@mantine/notifications';
|
|
7
7
|
export { showNotification, updateNotification } from '@mantine/notifications';
|
|
@@ -1701,7 +1701,15 @@ const useStyles$a = createStyles((theme) => ({
|
|
|
1701
1701
|
const SplitButton$1 = (props) => {
|
|
1702
1702
|
const { classes, theme } = useStyles$a();
|
|
1703
1703
|
const menuIconColor = theme.colors[theme.primaryColor][theme.colorScheme === "dark" ? 5 : 6];
|
|
1704
|
-
return /* @__PURE__ */ React.createElement(
|
|
1704
|
+
return /* @__PURE__ */ React.createElement(Stack$3, { spacing: "sm" }, /* @__PURE__ */ React.createElement(
|
|
1705
|
+
Button,
|
|
1706
|
+
{
|
|
1707
|
+
variant: "gradient",
|
|
1708
|
+
leftIcon: /* @__PURE__ */ React.createElement(IconClipboardCopy, { size: 14 }),
|
|
1709
|
+
onClick: props.onCopyLinkClick
|
|
1710
|
+
},
|
|
1711
|
+
"Assign"
|
|
1712
|
+
), /* @__PURE__ */ React.createElement(Group, { noWrap: true, spacing: 0 }, /* @__PURE__ */ React.createElement(
|
|
1705
1713
|
Button,
|
|
1706
1714
|
{
|
|
1707
1715
|
component: Link,
|
|
@@ -1719,21 +1727,14 @@ const SplitButton$1 = (props) => {
|
|
|
1719
1727
|
className: classes.menuControl
|
|
1720
1728
|
},
|
|
1721
1729
|
/* @__PURE__ */ React.createElement(IconChevronDown, { size: 16, stroke: 1.5 })
|
|
1722
|
-
)), /* @__PURE__ */ React.createElement(Menu.Dropdown, null, /* @__PURE__ */ React.createElement(
|
|
1723
|
-
Menu.Item,
|
|
1724
|
-
{
|
|
1725
|
-
icon: /* @__PURE__ */ React.createElement(IconClipboardCopy, { size: 16, stroke: 1.5, color: menuIconColor }),
|
|
1726
|
-
onClick: props.onCopyLinkClick
|
|
1727
|
-
},
|
|
1728
|
-
"Copy link"
|
|
1729
|
-
), !props.noExport && /* @__PURE__ */ React.createElement(
|
|
1730
|
+
)), /* @__PURE__ */ React.createElement(Menu.Dropdown, null, !props.noExport && /* @__PURE__ */ React.createElement(
|
|
1730
1731
|
Menu.Item,
|
|
1731
1732
|
{
|
|
1732
1733
|
icon: /* @__PURE__ */ React.createElement(IconTableExport, { size: 16, stroke: 1.5, color: menuIconColor }),
|
|
1733
1734
|
onClick: props.onExportDataClick
|
|
1734
1735
|
},
|
|
1735
1736
|
"Export data (.csv)"
|
|
1736
|
-
))));
|
|
1737
|
+
)))));
|
|
1737
1738
|
};
|
|
1738
1739
|
|
|
1739
1740
|
function Stack$1(props) {
|
|
@@ -1897,6 +1898,14 @@ const Lesson = (props) => {
|
|
|
1897
1898
|
});
|
|
1898
1899
|
avatars.push(/* @__PURE__ */ React.createElement(Avatar, { src, radius: "xl" }));
|
|
1899
1900
|
}
|
|
1901
|
+
const tabs = props.trial ? [
|
|
1902
|
+
{ label: "By question", value: "question" },
|
|
1903
|
+
{ label: "By student", value: "students" }
|
|
1904
|
+
] : [
|
|
1905
|
+
{ label: "By question", value: "question" },
|
|
1906
|
+
{ label: "By student", value: "students" },
|
|
1907
|
+
{ label: "By reflection", value: "reflections" }
|
|
1908
|
+
];
|
|
1900
1909
|
return /* @__PURE__ */ React.createElement(Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React.createElement(Stack$3, { spacing: "md" }, /* @__PURE__ */ React.createElement(Grid, null, /* @__PURE__ */ React.createElement(Grid.Col, { sm: "auto" }, /* @__PURE__ */ React.createElement(UnstyledButton, { onClick: props.onBackClick }, /* @__PURE__ */ React.createElement(
|
|
1901
1910
|
Badge$1,
|
|
1902
1911
|
{
|
|
@@ -1939,30 +1948,26 @@ const Lesson = (props) => {
|
|
|
1939
1948
|
return { value: g.classId, label: g.name };
|
|
1940
1949
|
})
|
|
1941
1950
|
}
|
|
1942
|
-
), /* @__PURE__ */ React.createElement(Stack$3, { spacing: 0 },
|
|
1951
|
+
), /* @__PURE__ */ React.createElement(Stack$3, { spacing: 0 }, /* @__PURE__ */ React.createElement(
|
|
1943
1952
|
Tabs,
|
|
1944
1953
|
{
|
|
1945
1954
|
value: tab,
|
|
1946
|
-
data:
|
|
1947
|
-
{ label: "By question", value: "question" },
|
|
1948
|
-
{ label: "By student", value: "students" },
|
|
1949
|
-
{ label: "By reflection", value: "reflections" }
|
|
1950
|
-
],
|
|
1955
|
+
data: tabs,
|
|
1951
1956
|
onChange: setTab
|
|
1952
1957
|
}
|
|
1953
|
-
),
|
|
1958
|
+
), tab === "question" && /* @__PURE__ */ React.createElement(
|
|
1954
1959
|
Stack,
|
|
1955
1960
|
{
|
|
1956
1961
|
loading: props.loading,
|
|
1957
1962
|
items: props.questions
|
|
1958
1963
|
}
|
|
1959
|
-
),
|
|
1964
|
+
), tab === "reflections" && /* @__PURE__ */ React.createElement(
|
|
1960
1965
|
Table$3,
|
|
1961
1966
|
{
|
|
1962
1967
|
loading: props.loading,
|
|
1963
1968
|
items: props.reflections
|
|
1964
1969
|
}
|
|
1965
|
-
),
|
|
1970
|
+
), tab === "students" && /* @__PURE__ */ React.createElement(
|
|
1966
1971
|
Table$2,
|
|
1967
1972
|
{
|
|
1968
1973
|
loading: props.loading,
|
|
@@ -2626,7 +2631,7 @@ function ImageCheckbox(_a) {
|
|
|
2626
2631
|
onClick: () => handleChange(!value),
|
|
2627
2632
|
className: cx(classes.button, className)
|
|
2628
2633
|
}),
|
|
2629
|
-
/* @__PURE__ */ React.createElement(ThemeIcon, { variant: "light", size: "lg", color: "blue" }, /* @__PURE__ */ React.createElement(Icon, { size:
|
|
2634
|
+
/* @__PURE__ */ React.createElement(ThemeIcon, { variant: "light", size: "lg", color: "blue" }, /* @__PURE__ */ React.createElement(Icon, { size: 25 })),
|
|
2630
2635
|
/* @__PURE__ */ React.createElement("div", { className: classes.body }, /* @__PURE__ */ React.createElement(Text, { weight: 500, size: "sm", sx: { lineHeight: 1 } }, title)),
|
|
2631
2636
|
/* @__PURE__ */ React.createElement(
|
|
2632
2637
|
Checkbox,
|
|
@@ -2682,8 +2687,7 @@ var __spreadValues$1 = (a, b) => {
|
|
|
2682
2687
|
var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
|
|
2683
2688
|
const useStyles$1 = createStyles((theme) => ({
|
|
2684
2689
|
wrapper: {
|
|
2685
|
-
minHeight:
|
|
2686
|
-
height: "100%",
|
|
2690
|
+
minHeight: "100%",
|
|
2687
2691
|
boxSizing: "border-box",
|
|
2688
2692
|
backgroundImage: `linear-gradient(-60deg, #4e5561 0%, #222a39 100%)`,
|
|
2689
2693
|
padding: theme.spacing.xl * 2.5,
|
|
@@ -2733,19 +2737,21 @@ const useStyles$1 = createStyles((theme) => ({
|
|
|
2733
2737
|
}
|
|
2734
2738
|
}));
|
|
2735
2739
|
const OPTIONS = [
|
|
2736
|
-
{ description: "
|
|
2737
|
-
{ description: "
|
|
2738
|
-
{ description: "
|
|
2739
|
-
{ description: "project-based learning", title: "Project-based learning", icon: IconTools },
|
|
2740
|
+
{ description: "elementary", title: "Elementary (K-5)", icon: IconScribble },
|
|
2741
|
+
{ description: "middle", title: "Middle (6-8)", icon: IconBackpack },
|
|
2742
|
+
{ description: "high school", title: "High School (9-12)", icon: IconSchool },
|
|
2740
2743
|
{ description: "college", title: "College", icon: IconPodium },
|
|
2741
|
-
{ description: "career", title: "Career", icon:
|
|
2742
|
-
{ description: "
|
|
2744
|
+
{ description: "career", title: "Career", icon: IconBriefcase },
|
|
2745
|
+
{ description: "work-based learning", title: "Work-Based Learning", icon: IconPresentation },
|
|
2746
|
+
{ description: "student leadership", title: "Student Leadership", icon: IconPodium },
|
|
2747
|
+
{ description: "civics", title: "Civics", icon: IconNews },
|
|
2748
|
+
{ description: "project-based learning", title: "Project-Based Learning", icon: IconTools }
|
|
2743
2749
|
];
|
|
2744
2750
|
const TrialRegistration = (props) => {
|
|
2745
2751
|
const { classes } = useStyles$1();
|
|
2746
2752
|
const [firstName, setFirstName] = React.useState("");
|
|
2747
2753
|
const [lastName, setLastName] = React.useState("");
|
|
2748
|
-
const [
|
|
2754
|
+
const [organization, setOrganization] = React.useState({ organizationId: "", displayName: "" });
|
|
2749
2755
|
const [interests, setInterests] = React.useState({});
|
|
2750
2756
|
return /* @__PURE__ */ React.createElement("div", { className: classes.wrapper }, /* @__PURE__ */ React.createElement(SimpleGrid, { maw: 1300, ml: "auto", mr: "auto", cols: 2, spacing: 50, breakpoints: [{ maxWidth: "md", cols: 1 }] }, /* @__PURE__ */ React.createElement(Group, { spacing: "sm" }, /* @__PURE__ */ React.createElement(
|
|
2751
2757
|
Image,
|
|
@@ -2783,14 +2789,20 @@ const TrialRegistration = (props) => {
|
|
|
2783
2789
|
onChange: (e) => setLastName(e.target.value)
|
|
2784
2790
|
}
|
|
2785
2791
|
), /* @__PURE__ */ React.createElement(
|
|
2786
|
-
|
|
2792
|
+
Autocomplete,
|
|
2787
2793
|
{
|
|
2788
|
-
label: "School Name
|
|
2794
|
+
label: "School/Organization Name",
|
|
2789
2795
|
placeholder: "What's the name of your school?",
|
|
2790
|
-
|
|
2791
|
-
|
|
2796
|
+
data: props.organizations.map((o) => {
|
|
2797
|
+
return __spreadProps$1(__spreadValues$1({}, o), { value: o.displayName });
|
|
2798
|
+
}),
|
|
2799
|
+
onItemSubmit: (item) => setOrganization({ organizationId: item.organizationId, displayName: item.displayName }),
|
|
2800
|
+
onChange: (next) => {
|
|
2801
|
+
setOrganization({ organizationId: "", displayName: next });
|
|
2802
|
+
return props.onQueryOrganizations(next);
|
|
2803
|
+
}
|
|
2792
2804
|
}
|
|
2793
|
-
)), /* @__PURE__ */ React.createElement(Text, { size: 14, weight: 500, mb: "md", mt: "xl" }, "
|
|
2805
|
+
)), /* @__PURE__ */ React.createElement(Text, { size: 14, weight: 500, mb: "md", mt: "xl" }, "Where do you want to start? (Select as many as you want)"), /* @__PURE__ */ React.createElement(
|
|
2794
2806
|
SelectGrid,
|
|
2795
2807
|
{
|
|
2796
2808
|
items: OPTIONS,
|
|
@@ -2800,7 +2812,13 @@ const TrialRegistration = (props) => {
|
|
|
2800
2812
|
Button,
|
|
2801
2813
|
{
|
|
2802
2814
|
disabled: !firstName || !lastName,
|
|
2803
|
-
onClick: () => props.onBegin({
|
|
2815
|
+
onClick: () => props.onBegin({
|
|
2816
|
+
firstName,
|
|
2817
|
+
lastName,
|
|
2818
|
+
organizationId: organization.organizationId,
|
|
2819
|
+
organizationName: organization.displayName,
|
|
2820
|
+
interests: Object.keys(interests)
|
|
2821
|
+
}),
|
|
2804
2822
|
className: classes.control
|
|
2805
2823
|
},
|
|
2806
2824
|
"Begin trial"
|