@local-civics/mgmt-ui 0.1.50 → 0.1.52
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 +486 -12
- package/dist/index.js +1742 -1
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1702 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +5 -3
- package/dist/components/banners/PlaceholderBanner/PlaceholderBanner.d.ts +0 -14
- package/dist/components/banners/PlaceholderBanner/component.stories.d.ts +0 -14
- package/dist/components/banners/TenantBanner/TenantBanner.d.ts +0 -23
- package/dist/components/cards/CardGradient.d.ts +0 -10
- package/dist/components/cards/component.stories.d.ts +0 -14
- package/dist/components/data/LineChart/LineChart.d.ts +0 -18
- package/dist/components/data/StatsGrid/StatsGrid.d.ts +0 -14
- package/dist/components/data/StatsGroup/StatsGroup.d.ts +0 -14
- package/dist/components/navigation/Navbar/Navbar.d.ts +0 -15
- package/dist/components/navigation/Navbar/component.stories.d.ts +0 -14
- package/dist/components/navigation/Tabs/Tabs.d.ts +0 -18
- package/dist/components/users/UserInfo/UserInfo.d.ts +0 -11
- package/dist/hooks/notifications.d.ts +0 -1
- package/dist/index.es.js +0 -1
- package/dist/pages/Badge/Badge.d.ts +0 -37
- package/dist/pages/Badge/LessonTable.d.ts +0 -31
- package/dist/pages/Badge/Table.d.ts +0 -33
- package/dist/pages/Badge/component.stories.d.ts +0 -18
- package/dist/pages/Badges/Badges.d.ts +0 -20
- package/dist/pages/Badges/Table.d.ts +0 -31
- package/dist/pages/Badges/component.stories.d.ts +0 -14
- package/dist/pages/Class/Class.d.ts +0 -27
- package/dist/pages/Class/Table.d.ts +0 -31
- package/dist/pages/Class/component.stories.d.ts +0 -18
- package/dist/pages/Classes/Classes.d.ts +0 -21
- package/dist/pages/Classes/Table.d.ts +0 -23
- package/dist/pages/Classes/component.stories.d.ts +0 -18
- package/dist/pages/Dashboard/BadgeTable.d.ts +0 -32
- package/dist/pages/Dashboard/Dashboard.d.ts +0 -38
- package/dist/pages/Dashboard/ImpactTable.d.ts +0 -28
- package/dist/pages/Dashboard/LessonTable.d.ts +0 -32
- package/dist/pages/Dashboard/ReflectionTable.d.ts +0 -30
- package/dist/pages/Dashboard/StudentTable.d.ts +0 -31
- package/dist/pages/Dashboard/component.stories.d.ts +0 -18
- package/dist/pages/Home/Home.d.ts +0 -25
- package/dist/pages/Home/component.stories.d.ts +0 -14
- package/dist/pages/Lesson/Lesson.d.ts +0 -38
- package/dist/pages/Lesson/QuestionStack.d.ts +0 -30
- package/dist/pages/Lesson/ReflectionTable.d.ts +0 -29
- package/dist/pages/Lesson/Table.d.ts +0 -25
- package/dist/pages/Lesson/component.stories.d.ts +0 -18
- package/dist/pages/Lessons/Lessons.d.ts +0 -20
- package/dist/pages/Lessons/Table.d.ts +0 -22
- package/dist/pages/Lessons/component.stories.d.ts +0 -14
- package/dist/pages/Student/AnswerTable.d.ts +0 -32
- package/dist/pages/Student/BadgeTable.d.ts +0 -31
- package/dist/pages/Student/ReflectionTable.d.ts +0 -32
- package/dist/pages/Student/Student.d.ts +0 -21
- package/dist/pages/Student/component.stories.d.ts +0 -18
- package/dist/providers/AdminProvider/AdminProvider.d.ts +0 -14
- package/dist/shells/App/App.d.ts +0 -21
- package/dist/shells/App/SwitchAccount/SwitchAccount.d.ts +0 -23
- package/dist/shells/App/SwitchAccount/component.stories.d.ts +0 -14
- package/dist/shells/App/component.stories.d.ts +0 -14
- package/dist/utils/time.d.ts +0 -11
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DataPoint
|
|
3
|
-
*/
|
|
4
|
-
export type DataPoint = {
|
|
5
|
-
time: string;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* ChartProps
|
|
9
|
-
*/
|
|
10
|
-
export interface LineChartProps {
|
|
11
|
-
points: DataPoint[];
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* LineChart
|
|
15
|
-
* @param props
|
|
16
|
-
* @constructor
|
|
17
|
-
*/
|
|
18
|
-
export declare const LineChart: (props: LineChartProps) => JSX.Element;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
interface StatsGroupProps {
|
|
2
|
-
data: {
|
|
3
|
-
title: string;
|
|
4
|
-
value: number;
|
|
5
|
-
unit?: string;
|
|
6
|
-
}[];
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* StatsGroup
|
|
10
|
-
* @param data
|
|
11
|
-
* @constructor
|
|
12
|
-
*/
|
|
13
|
-
export declare const StatsGroup: ({ data }: StatsGroupProps) => JSX.Element;
|
|
14
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NavbarProps
|
|
3
|
-
*/
|
|
4
|
-
export interface NavbarProps {
|
|
5
|
-
active: string;
|
|
6
|
-
navigate: (to: string) => void;
|
|
7
|
-
onLogout: () => void;
|
|
8
|
-
onSwitchAccounts?: () => void;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Navbar
|
|
12
|
-
* @param props
|
|
13
|
-
* @constructor
|
|
14
|
-
*/
|
|
15
|
-
export declare const Navbar: (props: NavbarProps) => JSX.Element;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { NavbarProps } from "./Navbar";
|
|
2
|
-
import { Story } from "@storybook/react";
|
|
3
|
-
/**
|
|
4
|
-
* Storybook component configuration
|
|
5
|
-
*/
|
|
6
|
-
declare const _default: {
|
|
7
|
-
title: string;
|
|
8
|
-
component: (props: NavbarProps) => JSX.Element;
|
|
9
|
-
};
|
|
10
|
-
export default _default;
|
|
11
|
-
/**
|
|
12
|
-
* Component stories
|
|
13
|
-
*/
|
|
14
|
-
export declare const Component: Story<NavbarProps>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { TabsValue } from '@mantine/core';
|
|
2
|
-
/**
|
|
3
|
-
* TabProps
|
|
4
|
-
*/
|
|
5
|
-
export interface TabsProps {
|
|
6
|
-
data?: {
|
|
7
|
-
label?: string;
|
|
8
|
-
value: string;
|
|
9
|
-
}[];
|
|
10
|
-
value?: TabsValue;
|
|
11
|
-
onChange: (next: string) => void;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Tabs
|
|
15
|
-
* @param props
|
|
16
|
-
* @constructor
|
|
17
|
-
*/
|
|
18
|
-
export declare const Tabs: (props: TabsProps) => JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { showNotification, updateNotification } from '@mantine/notifications';
|
package/dist/index.es.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{NotificationsProvider as e}from"@mantine/notifications";export{showNotification,updateNotification}from"@mantine/notifications";import{jsxs as n,jsx as i,Fragment as t}from"react/jsx-runtime";import{IconArrowLeft as r,IconCategory2 as l,IconCheck as o,IconTrash as a,IconPlaylistAdd as s,IconDownload as c,IconX as d,IconCloudUpload as h,IconInfoCircle as m,IconColorSwatch as u,IconSwitchHorizontal as g,IconLogout as p,IconHome2 as f,IconGauge as v,IconAlbum as b,IconLambda as C,IconBrandInstagram as y,IconBrandLinkedin as k,IconBrandFacebook as x}from"@tabler/icons";import*as N from"react";import{useState as S}from"react";import{createStyles as z,Text as w,Tabs as O,Title as T,Image as L,UnstyledButton as A,Group as B,Avatar as I,Badge as W,ScrollArea as E,Table as P,Container as D,Stack as H,Grid as j,ActionIcon as R,Button as M,LoadingOverlay as F,Select as q,Autocomplete as V,Drawer as G,Divider as U,TextInput as _,Tooltip as Y,Paper as $,ThemeIcon as J,Card as Q,Overlay as K,createEmotionCache as X,MantineProvider as Z,Modal as ee,Navbar as ne,Center as ie,AppShell as te,Loader as re}from"@mantine/core";import{Dropzone as le,MIME_TYPES as oe}from"@mantine/dropzone";import{useForm as ae}from"@mantine/form";import*as se from"papaparse";import{openConfirmModal as ce,ModalsProvider as de}from"@mantine/modals";import{Chart as he}from"react-charts";var me=function(){return me=Object.assign||function(e){for(var n,i=1,t=arguments.length;i<t;i++)for(var r in n=arguments[i])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e},me.apply(this,arguments)};var ue=z((function(e){var n,i;return{root:(n={display:"flex",backgroundImage:"linear-gradient(-60deg, ".concat(e.colors[e.primaryColor][4]," 0%, ").concat(e.colors[e.primaryColor][7]," 100%)"),padding:1.5*e.spacing.xl,borderRadius:e.radius.md},n[e.fn.smallerThan("sm")]={flexDirection:"column"},n),title:{color:e.white,textTransform:"uppercase",fontWeight:700,fontSize:e.fontSizes.sm},count:{color:e.white,fontSize:32,lineHeight:1,fontWeight:700,marginBottom:e.spacing.md,fontFamily:"Greycliff CF, ".concat(e.fontFamily)},description:{color:e.colors[e.primaryColor][0],fontSize:e.fontSizes.sm,marginTop:5},stat:{flex:1,"& + &":(i={paddingLeft:e.spacing.xl,marginLeft:e.spacing.xl,borderLeft:"1px solid ".concat(e.colors[e.primaryColor][3])},i[e.fn.smallerThan("sm")]={paddingLeft:0,marginLeft:0,borderLeft:0,paddingTop:e.spacing.xl,marginTop:e.spacing.xl,borderTop:"1px solid ".concat(e.colors[e.primaryColor][3])},i)}}})),ge=function(e){var t=e.data,r=ue().classes,l=t.map((function(e){var t="%"===e.unit?Math.round(100*(e.value+Number.EPSILON)):e.value;return n("div",me({className:r.stat},{children:[n(w,me({className:r.count},{children:[t.toLocaleString(),e.unit]})),i(w,me({className:r.title},{children:e.title}))]}),e.title)}));return i("div",me({className:r.root},{children:l}))},pe=function(e){var n,t=null===(n=e.data)||void 0===n?void 0:n.map((function(e){return i(O.Tab,me({value:e.value},{children:e.label||e.value}),e.value)}));return i(O,me({value:e.value,onTabChange:e.onChange},{children:i(O.List,{children:t})}))},fe=z((function(e){var n,i,t;return{wrapper:(n={display:"flex",alignItems:"center",padding:2*e.spacing.xl,borderRadius:e.radius.md,backgroundColor:"dark"===e.colorScheme?e.colors.dark[8]:e.white,border:"1px solid ".concat("dark"===e.colorScheme?e.colors.dark[8]:e.colors.gray[3])},n["@media (max-width: ".concat(e.breakpoints.sm,"px)")]={flexDirection:"column-reverse",padding:e.spacing.xl},n),image:(i={maxWidth:"40%"},i["@media (max-width: ".concat(e.breakpoints.sm,"px)")]={maxWidth:"100%"},i),body:(t={paddingRight:4*e.spacing.xl},t["@media (max-width: ".concat(e.breakpoints.sm,"px)")]={paddingRight:0,marginTop:e.spacing.xl},t),title:{color:"dark"===e.colorScheme?e.white:e.black,fontFamily:"Greycliff CF, ".concat(e.fontFamily),lineHeight:1,marginBottom:e.spacing.md},controls:{display:"flex",marginTop:e.spacing.xl},inputWrapper:{width:"100%",flex:"1"},input:{borderTopRightRadius:0,borderBottomRightRadius:0,borderRight:0},control:{borderTopLeftRadius:0,borderBottomLeftRadius:0}}})),ve=function(e){var t=fe().classes,r=e.title||"Nothing to display",l=e.description||"We don't have anything to show you here just yet. Add data, check back later, or adjust your search.";return n("div",me({className:t.wrapper},{children:[n("div",me({className:t.body},{children:[i(T,me({className:t.title},{children:e.loading?"Loading...":r})),i(w,me({size:"sm",color:"dimmed"},{children:e.loading?"Hold on, we're loading your data.":l}))]})),i(L,{src:"https://cdn.localcivics.io/illustrations/".concat(e.icon,".svg"),className:t.image})]}))};function be(e){if(0===e.items.length)return i(ve,{title:"No badges to display",description:"There has not been any badge progress just yet.",loading:e.loading,icon:"badges"});var t=e.items.map((function(t){return n("tr",{children:[i("td",{children:i(A,me({onClick:function(){return e.onClick&&e.onClick(t)}},{children:n(B,me({spacing:"sm"},{children:[i(I,{size:40,src:t.avatar,radius:40}),n("div",{children:[i(w,me({size:"sm",weight:500},{children:t.name})),i(w,me({size:"xs",color:"dimmed"},{children:t.email}))]})]}))}))}),n("td",{children:[!!t.isComplete&&i(W,me({variant:"filled"},{children:"Complete"})),!t.isComplete&&i(W,me({color:"red",variant:"filled"},{children:"Incomplete"}))]})]},t.name)}));return i(E.Autosize,me({maxHeight:500},{children:n(P,me({verticalSpacing:"sm",sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Student Name"}),i("th",{children:"Badge Status"})]})}),i("tbody",{children:t})]}))}))}function Ce(e){if(0===e.items.length)return i(ve,{title:"No lessons to display",description:"There are not lessons in badge.",loading:e.loading,icon:"badges"});var t=e.items.map((function(t){var r=Math.round(100*(t.percentageCompletion+Number.EPSILON));return n("tr",{children:[i("td",{children:i(A,me({onClick:function(){return e.onClick&&e.onClick(t)}},{children:t.lessonName}))}),n("td",{children:[r,"%"]})]},t.lessonName)}));return i(E.Autosize,me({maxHeight:500},{children:n(P,me({verticalSpacing:"sm",sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Lesson Name"}),i("th",{children:"Lesson Completion"})]})}),i("tbody",{children:t})]}))}))}var ye=z((function(e){var n;return{title:(n={fontSize:34,fontWeight:900},n[e.fn.smallerThan("sm")]={fontSize:24},n),description:{maxWidth:600}}})),ke=function(e){var t=ye().classes,o=S("lessons"),a=o[0],s=o[1],c=e.students.length,d=c>0?e.students.filter((function(e){return e.isComplete})).length/c:0;return i(D,me({size:"lg",py:"xl"},{children:n(H,me({spacing:"md"},{children:[i(j,{children:n(j.Col,me({sm:"auto"},{children:[i(W,me({variant:"filled",leftSection:i(R,me({onClick:e.onBackClick,color:"blue",size:"xs",radius:"xl",variant:"filled"},{children:i(r,{size:14})})),size:"lg"},{children:"Badges"})),n(B,{children:[n(H,me({spacing:0},{children:[i(T,me({order:2,className:t.title,mt:"md"},{children:e.displayName||"Badge"})),i(w,me({color:"dimmed",className:t.description,mt:"sm"},{children:e.description||"No description"}))]})),i(H,me({ml:"auto"},{children:i(M,me({variant:"gradient",onClick:e.onPreviewClick},{children:"Preview"}))}))]})]}))}),i("div",{children:n("div",me({style:{position:"relative"}},{children:[i(F,{visible:e.loading,overlayBlur:2}),n(H,{children:[i(ge,{data:[{title:"BADGE COMPLETION",value:d,unit:"%"}]}),i(q,{clearable:!0,clearButtonLabel:"Clear class selection",size:"sm",placeholder:"Select a class",nothingFound:"No options",value:e.classId,onChange:e.onClassChange,icon:i(l,{}),data:e.classes.map((function(e){return{value:e.classId,label:e.name}}))}),n(H,me({spacing:0},{children:[i(pe,{value:a,data:[{label:"By lesson",value:"lessons"},{label:"By student",value:"students"}],onChange:s}),"lessons"===a&&i(Ce,{loading:e.loading,items:e.lessons,onClick:e.onLessonClick}),"students"===a&&i(be,{loading:e.loading,items:e.students,onClick:e.onUserClick})]}))]})]}))})]}))}))};function xe(e){if(0===e.items.length)return i(ve,{title:"No badges to display",description:"We don't have any badges to show you just yet.",loading:e.loading,icon:"badges"});var t=e.items.map((function(t){return i("tr",{children:i("td",{children:i(A,me({sx:function(e){return{display:"block",width:"100%",padding:e.spacing.md,color:"dark"===e.colorScheme?e.colors.dark[0]:e.black,"&:hover":{backgroundColor:"dark"===e.colorScheme?e.colors.dark[8]:e.colors.gray[1]}}},onClick:function(){return e.onClick&&e.onClick(t)}},{children:i(B,{children:n("div",{children:[i(w,me({size:"sm",weight:500},{children:t.name})),i(w,me({size:"xs",color:"dimmed"},{children:t.description}))]})})}))})},t.badgeId)}));return i(E.Autosize,me({maxHeight:500},{children:i(P,me({horizontalSpacing:0,verticalSpacing:0,sx:{minWidth:700}},{children:i("tbody",{children:t})}))}))}var Ne=z((function(e){var n;return{title:(n={fontSize:34,fontWeight:900},n[e.fn.smallerThan("sm")]={fontSize:24},n),description:{maxWidth:600}}})),Se=function(e){var t=Ne().classes;return i(D,me({size:"lg",py:"xl"},{children:n(H,me({spacing:"md"},{children:[i(j,{children:n(j.Col,me({sm:"auto"},{children:[i(W,me({variant:"filled",size:"lg"},{children:"Badges"})),i(T,me({order:2,className:t.title,mt:"md"},{children:"Badges and micro-credentials"})),i(w,me({color:"dimmed",className:t.description,mt:"sm"},{children:"Project-sized skills acquisition and standards alignment."}))]}))}),i(V,{placeholder:"Search for a badge that fits your needs",data:e.badges.map((function(e){return e.name})),onChange:e.onAutocompleteChange}),n("div",me({style:{position:"relative"}},{children:[i(F,{visible:e.loading,overlayBlur:2}),i(xe,{loading:e.loading,items:e.badges,onClick:e.onBadgeClick})]}))]}))}))};function ze(e){if(0===e.items.length)return i(ve,{title:"No students to display",description:"You don't have any students yet, add them and revisit.",loading:e.loading,icon:"groups"});var t=e.items.map((function(t){return n("tr",{children:[i("td",{children:i(A,me({onClick:function(){return e.onViewProfile(t)}},{children:t.studentName}))}),i("td",{children:t.className})]},t.studentName)}));return i(E.Autosize,me({maxHeight:500},{children:n(P,me({verticalSpacing:"sm",sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Student Name"}),i("th",{children:"Class Name"})]})}),i("tbody",{children:t})]}))}))}var we=[{unit:"year",ms:31536e6},{unit:"month",ms:2628e6},{unit:"day",ms:864e5},{unit:"hour",ms:36e5},{unit:"minute",ms:6e4},{unit:"second",ms:1e3}],Oe=new Intl.RelativeTimeFormat("en",{numeric:"auto"});function Te(e,n){return void 0===n&&(n=new Date),e?function(e){for(var n=0,i=we;n<i.length;n++){var t=i[n],r=t.unit,l=t.ms;if(Math.abs(e)>=l||"second"===r)return Oe.format(Math.round(e/l),r)}return""}(e.getTime()-n.getTime()):""}function Le(e){if(0===e.items.length)return i(ve,{title:"No reflections to display",description:"There has not been any lesson progress just yet.",loading:e.loading,icon:"lessons"});var t=e.items.map((function(e){return n("tr",{children:[i("td",{children:e.studentName}),i("td",{children:e.lessonName}),i("td",{children:e.reflection}),i("td",{children:Te(new Date(e.updatedAt))})]},e.studentName+e.lessonName)}));return i(E.Autosize,me({maxHeight:500},{children:n(P,me({verticalSpacing:"sm",sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Student Name"}),i("th",{children:"Lesson Name"}),i("th",{children:"Reflection"}),i("th",{children:"Updated At"})]})}),i("tbody",{children:t})]}))}))}function Ae(e){if(0===e.items.length)return i(ve,{title:"No impact statements to display",description:"There are no students with impact statements yet.",loading:e.loading,icon:"kindergarten"});var t=e.items.map((function(e){return n("tr",{children:[i("td",{children:e.studentName}),i("td",{children:e.impactStatement})]},e.studentName)}));return i(E.Autosize,me({maxHeight:500},{children:n(P,me({verticalSpacing:"sm",sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Student Name"}),i("th",{children:"Impact Statement"})]})}),i("tbody",{children:t})]}))}))}function Be(e){if(0===e.items.length)return i(ve,{title:"No badges to display",description:"We don't have any badges to show you just yet.",loading:e.loading,icon:"badges"});var t=e.items.map((function(t){return n("tr",{children:[i("td",{children:i(A,me({onClick:function(){return e.onClick&&e.onClick(t)}},{children:t.name}))}),i("td",{children:t.description}),n("td",{children:[Math.round(100*(t.percentageCompletion+Number.EPSILON)),"%"]})]},t.badgeId)}));return i(E.Autosize,me({maxHeight:500},{children:n(P,me({verticalSpacing:"sm",sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Badge Name"}),i("th",{children:"Description"}),i("th",{children:"Completion"})]})}),i("tbody",{children:t})]}))}))}function Ie(e){if(0===e.items.length)return i(ve,{title:"No lessons to display",description:"We don't have any lessons to show you just yet.",loading:e.loading,icon:"lessons"});var t=e.items.map((function(t){return n("tr",{children:[i("td",{children:i(A,me({onClick:function(){return e.onClick&&e.onClick(t)}},{children:t.name}))}),i("td",{children:t.description}),n("td",{children:[Math.round(100*(t.percentageCompletion+Number.EPSILON)),"%"]})]},t.lessonId)}));return i(E.Autosize,me({maxHeight:500},{children:n(P,me({verticalSpacing:"sm",sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Lesson Name"}),i("th",{children:"Description"}),i("th",{children:"Completion"})]})}),i("tbody",{children:t})]}))}))}var We=function(e){var t=S("students"),r=t[0],o=t[1];return i(D,me({size:"lg",py:"xl"},{children:n(H,{children:[n(H,me({spacing:0},{children:[i(T,me({size:"h3"},{children:"Dashboard"})),i(w,me({color:"dimmed",size:"sm",mt:"md"},{children:"Fast-track learning for your students."}))]})),i(H,{children:n("div",me({style:{position:"relative"}},{children:[i(F,{visible:e.loading,overlayBlur:2}),n(H,me({spacing:"sm"},{children:[i(ge,{data:[{title:"# OF STUDENTS",value:e.students.length},{title:"ACCOUNT CREATION",value:e.percentageOfAccountsCreated,unit:"%"},{title:"BADGE COMPLETION",value:e.percentageOfBadgesEarned,unit:"%"},{title:"LESSON COMPLETION",value:e.percentageOfLessonsCompleted,unit:"%"}]}),i(q,{clearable:!0,clearButtonLabel:"Clear class selection",size:"sm",placeholder:"Select a class",nothingFound:"No options",value:e.classId,onChange:e.onClassChange,icon:i(l,{}),data:e.classes.map((function(e){return{value:e.classId,label:e.name}}))}),n(H,me({spacing:0},{children:[i(pe,{value:r,data:[{label:"My students",value:"students"},{label:"Impact statements",value:"impact"},{label:"Reflections",value:"reflections"},{label:"Badges",value:"badges"},{label:"Lessons",value:"lessons"}],onChange:o}),"impact"===r&&i(Ae,{loading:e.loading,items:e.impacts}),"reflections"===r&&i(Le,{loading:e.loading,items:e.reflections}),"badges"===r&&i(Be,{loading:e.loading,items:e.badges,onClick:e.onBadgeClick}),"lessons"===r&&i(Ie,{loading:e.loading,items:e.lessons,onClick:e.onLessonClick}),"students"===r&&i(ze,{loading:e.loading,items:e.students,onViewProfile:e.onViewStudentProfile})]}))]}))]}))})]})}))};function Ee(e){if(0===e.items.length)return i(ve,{title:"No students to display",description:"You have not rostered any students yet.",loading:e.loading,icon:"groups"});var t=e.items.map((function(t){return n("tr",{children:[i("td",{children:i(A,me({onClick:function(){return e.onViewProfile&&e.onViewProfile(t)}},{children:n(B,me({spacing:"sm"},{children:[i(I,{size:40,src:t.avatar,radius:40}),n("div",{children:[i(w,me({size:"sm",weight:500},{children:t.givenName&&t.familyName?"".concat(t.givenName," ").concat(t.familyName):t.email})),i(w,me({size:"xs",color:"dimmed"},{children:t.email}))]})]}))}))}),i("td",{children:t.badgesEarned}),i("td",{children:t.lessonsCompleted}),i("td",{children:t.hasAccount&&i(o,{color:"green"})}),i("td",{children:t.lastActivity?Te(t.lastActivity):""}),i("td",{children:i(B,me({noWrap:!0,spacing:0,position:"right"},{children:!t.readonly&&!!e.onDelete&&i(R,me({color:"red"},{children:i(a,{onClick:function(){return ce({title:'Delete "'.concat((n=t).givenName&&n.familyName?"".concat(n.givenName," ").concat(n.familyName):n.email,'"?'),centered:!0,children:i(w,me({size:"sm"},{children:"Are you sure you want to delete this person? This action is destructive and you will have to contact support to restore your data."})),labels:{confirm:"Delete",cancel:"No don't delete them"},confirmProps:{color:"red"},onConfirm:function(){return e.onDelete&&e.onDelete(n)}});var n},size:16,stroke:1.5})}))}))})]},t.email)}));return i(E,{children:n(P,me({verticalSpacing:20,sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Student Name"}),i("th",{children:"Badges Earned"}),i("th",{children:"Lessons Completed"}),i("th",{children:"Account Created?"}),i("th",{children:"Last Active"}),i("th",{})]})}),i("tbody",{children:t})]}))})}var Pe=z((function(e){var n;return{title:(n={fontSize:34,fontWeight:900},n[e.fn.smallerThan("sm")]={fontSize:24},n),description:{maxWidth:600},wrapper:{position:"relative",marginBottom:30},dropzone:{borderWidth:1,paddingBottom:50},icon:{color:"dark"===e.colorScheme?e.colors.dark[3]:e.colors.gray[4]},control:{position:"absolute",width:250,left:"calc(50% - 125px)",bottom:-20}}})),De=function(e){var l=Pe().classes,o=ae({initialValues:{classId:"",studentId:"",email:"",givenName:"",familyName:"",avatar:"",role:"",readonly:!1,lastActivity:null,hasAccount:!1,lessonsCompleted:0,badgesEarned:0},validate:{email:function(n){return/^\S+@\S+$/.test(n)&&0===e.students.filter((function(e){return e.email===n})).length?null:"Invalid email"}}}),a=S(!1),c=a[0],d=a[1];return n(t,{children:[i(G,me({opened:c,onClose:function(){return d(!1)},title:i(T,me({size:"h5"},{children:"Add students"})),padding:"xl",size:"xl"},{children:n(H,me({spacing:"md"},{children:[i(He,me({},e,{close:function(){return d(!1)}})),i(U,{label:"or",labelPosition:"center",my:"md",variant:"dashed"}),i("form",me({onSubmit:o.onSubmit((function(){var n=o.values;o.reset(),d(!1),e.onCreateStudents&&e.onCreateStudents([n])}))},{children:n(H,{children:[i(_,me({withAsterisk:!0,label:"Email",placeholder:"Email"},o.getInputProps("email"))),n(B,me({grow:!0},{children:[i(_,me({label:"Given name",placeholder:"Given name"},o.getInputProps("givenName"))),i(_,me({label:"Family name",placeholder:"Family name"},o.getInputProps("familyName")))]})),i(M,me({type:"submit",fullWidth:!0,mt:"md"},{children:"Submit"}))]})}))]}))})),i(D,me({size:"lg",py:"xl"},{children:n(H,me({spacing:"md"},{children:[n(j,{children:[n(j.Col,me({sm:"auto"},{children:[i(W,me({variant:"filled",leftSection:i(R,me({onClick:e.onBackClick,color:"blue",size:"xs",radius:"xl",variant:"filled"},{children:i(r,{size:14})})),size:"lg"},{children:"Classes"})),i(T,me({order:2,className:l.title,mt:"md"},{children:e.displayName||"Class"})),i(w,me({color:"dimmed",className:l.description,mt:"sm"},{children:e.description||"No description"}))]})),i(j.Col,me({sm:"content"},{children:!e.loading&&i(M,me({onClick:function(){return d(!0)},leftIcon:i(s,{size:14})},{children:"Add students"}))}))]}),n("div",me({style:{position:"relative"}},{children:[i(F,{visible:e.loading,overlayBlur:2}),n(H,me({spacing:"sm"},{children:[i(ge,{data:[{title:"# OF STUDENTS",value:e.students.length},{title:"ACCOUNT CREATION",value:e.percentageOfAccountsCreated,unit:"%"},{title:"BADGE COMPLETION",value:e.percentageOfBadgesEarned,unit:"%"},{title:"LESSON COMPLETION",value:e.percentageOfLessonsCompleted,unit:"%"}]}),i(Ee,{loading:e.loading,items:e.students,onDelete:e.onDeleteStudent,onViewProfile:function(n){return e.onStudentClick(n)}})]}))]}))]}))}))]})},He=function(e){var t=Pe(),r=t.classes,l=t.theme,o=N.useRef(null),a=N.useState(!1),s=a[0],m=a[1],u=N.useCallback((function(n){m(!0),n.forEach((function(n){se.parse(n,{download:!0,header:!0,dynamicTyping:!0,skipEmptyLines:!0,worker:!0,complete:function(n){var i=n.data.filter((function(n){return/^\S+@\S+$/.test(n.email)&&0===e.students.filter((function(e){return e.email===n.email})).length}));i.length>0&&e.onCreateStudents&&e.onCreateStudents(i),m(!1),e.close()}})}))}),[]);return n("div",me({className:r.wrapper},{children:[i(le,me({loading:s,openRef:o,onDrop:u,className:r.dropzone,radius:"md",accept:[oe.csv],maxSize:5*Math.pow(1024,2)},{children:n("div",me({style:{pointerEvents:"none"}},{children:[n(B,me({position:"center"},{children:[i(le.Accept,{children:i(c,{size:50,color:l.colors[l.primaryColor][6],stroke:1.5})}),i(le.Reject,{children:i(d,{size:50,color:l.colors.red[6],stroke:1.5})}),i(le.Idle,{children:i(h,{size:50,color:"dark"===l.colorScheme?l.colors.dark[0]:l.black,stroke:1.5})})]})),n(w,me({align:"center",weight:700,size:"lg",mt:"xl"},{children:[i(le.Accept,{children:"Drop files here"}),i(le.Reject,{children:"Csv file less than 5mb"}),i(le.Idle,{children:"Upload multiple"})]})),n(w,me({align:"center",size:"sm",mt:"xs",color:"dimmed"},{children:["Drag'n'drop files here to upload. We can accept only ",i("i",{children:".csv"})," files that are less than 5mb in size."]}))]}))})),i(M,me({className:r.control,size:"md",radius:"xl",onClick:function(){var e;return null===(e=o.current)||void 0===e?void 0:e.call(o)}},{children:"Select file"}))]}))};function je(e){if(0===e.items.length)return i(ve,{title:"No classes to display",description:"You don't have any classes yet. Try creating one first...",loading:e.loading,icon:"groups"});var t=e.items.map((function(t){return n("tr",{children:[i("td",{children:i(A,me({onClick:function(){return e.onClick(t)}},{children:i(w,me({size:14},{children:t.name}))}))}),i("td",{children:i(w,me({size:14},{children:t.description}))}),i("td",{children:i(B,me({noWrap:!0,spacing:0,position:"right"},{children:i(R,me({color:"red"},{children:i(a,{onClick:function(){return ce({title:'Delete "'.concat((n=t).name,'"?'),centered:!0,children:i(w,me({size:"sm"},{children:"Are you sure you want to delete this class? This action is destructive and you will have to contact support to restore your data."})),labels:{confirm:"Delete class",cancel:"No don't delete it"},confirmProps:{color:"red"},onConfirm:function(){return e.onDeleteClass(n)}});var n},size:16,stroke:1.5})}))}))})]},t.classId)}));return i(E.Autosize,me({maxHeight:300},{children:n(P,me({verticalSpacing:20,sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Class Name"}),i("th",{children:"Description"}),i("th",{})]})}),i("tbody",{children:t})]}))}))}var Re=z((function(e){var n;return{title:(n={fontSize:34,fontWeight:900},n[e.fn.smallerThan("sm")]={fontSize:24},n),description:{maxWidth:600}}})),Me=function(e){var r=Re().classes,l=ae({initialValues:{classId:"",name:"",description:""},validate:{name:function(e){return e.length<=6?"Name should include at least 6 characters":null}}}),o=S(!1),a=o[0],c=o[1];return n(t,{children:[i(G,me({opened:a,onClose:function(){return c(!1)},title:n(B,me({spacing:0},{children:[i(T,me({size:"h5"},{children:"Create a class"})),i(Y,me({label:"Classes settings cannot be modified once created"},{children:i(R,{children:i(m,{color:"#3b82f6",size:14})})}))]})),padding:"xl",size:"xl"},{children:n("form",me({onSubmit:l.onSubmit((function(){var n=l.values;l.reset(),c(!1),e.onCreateClass&&e.onCreateClass(n)}))},{children:[n(H,{children:[i(_,me({withAsterisk:!0,label:"Name",placeholder:"Class name"},l.getInputProps("name"))),i(_,me({label:"Description",placeholder:"A class for my first period English students"},l.getInputProps("description")))]}),i(M,me({type:"submit",fullWidth:!0,mt:"md"},{children:"Submit"}))]}))})),i(D,me({size:"lg",py:"xl"},{children:n(H,me({spacing:"md"},{children:[n(j,{children:[n(j.Col,me({sm:"auto"},{children:[i(W,me({variant:"filled",size:"lg"},{children:"Classes"})),i(T,me({order:2,className:r.title,mt:"md"},{children:"Organize students into classes"})),i(w,me({color:"dimmed",className:r.description,mt:"sm"},{children:"A class can be for a specific period of time, grade, team, or other cohorts."}))]})),i(j.Col,me({sm:"content"},{children:!e.loading&&i(M,me({onClick:function(){return c(!0)},leftIcon:i(s,{size:14})},{children:"Create class"}))}))]}),n("div",me({style:{position:"relative"}},{children:[i(F,{visible:e.loading,overlayBlur:2}),n(H,me({spacing:"sm"},{children:[i(ge,{data:[{title:"# OF CLASSES",value:e.classes.length}]}),i(je,{loading:e.loading,items:e.classes,onDeleteClass:e.onDeleteClass,onClick:e.onClassClick})]}))]}))]}))}))]})},Fe=z((function(e){var n;return{title:(n={fontSize:34,fontWeight:900,marginTop:16},n[e.fn.smallerThan("sm")]={fontSize:24},n),description:{maxWidth:600}}})),qe=function(e){var r=Fe().classes;return n(t,{children:[i(T,me({className:r.title},{children:e.name})),i(w,me({color:"dimmed",className:r.description,mt:"xs"},{children:e.impactStatement}))]})};function Ve(e){if(0===e.items.length)return i(ve,{title:"No badges to display",description:"There has not been any badge progress just yet.",loading:e.loading,icon:"badges"});var t=e.items.map((function(t){return n("tr",{children:[i("td",{children:i(A,me({onClick:function(){return e.onClick(t)}},{children:t.badgeName}))}),n("td",{children:[!!t.isComplete&&i(W,me({variant:"filled"},{children:"Complete"})),!t.isComplete&&i(W,me({color:"red",variant:"filled"},{children:"Incomplete"}))]})]},t.badgeName)}));return i(E.Autosize,me({maxHeight:500},{children:n(P,me({verticalSpacing:"sm",sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Badge Name"}),i("th",{children:"Status"})]})}),i("tbody",{children:t})]}))}))}function Ge(e){if(0===e.items.length)return i(ve,{title:"No answers to display",description:"There has not been any lesson progress just yet.",loading:e.loading,icon:"lessons"});var t=e.items.map((function(t){return n("tr",{children:[i("td",{children:i(A,me({onClick:function(){return e.onClick(t)}},{children:t.lessonName}))}),i("td",{children:t.questionName}),i("td",{children:t.answer.join(",")})]},t.questionName)}));return i(E.Autosize,me({maxHeight:500},{children:n(P,me({verticalSpacing:"sm",sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Lesson Name"}),i("th",{children:"Question"}),i("th",{children:"Answer"})]})}),i("tbody",{children:t})]}))}))}function Ue(e){if(0===e.items.length)return i(ve,{title:"No reflections to display",description:"There has not been any lesson progress just yet.",loading:e.loading,icon:"lessons"});var t=e.items.map((function(t){return n("tr",{children:[i("td",{children:i(A,me({onClick:function(){return e.onClick(t)}},{children:t.lessonName}))}),i("td",{children:t.reflection}),i("td",{children:t.rating.toLocaleString()})]},t.lessonName)}));return i(E.Autosize,me({maxHeight:500},{children:n(P,me({verticalSpacing:"sm",sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Lesson Name"}),i("th",{children:"Reflection"}),i("th",{children:"Rating"})]})}),i("tbody",{children:t})]}))}))}var _e=function(e){var t=S("badges"),l=t[0],o=t[1],a=e.badges.length,s=a>0?e.badges.filter((function(e){return e.isComplete})).length/a:0;return i(D,me({size:"lg",py:"xl"},{children:n(H,me({spacing:"md"},{children:[i(j,me({gutter:"md"},{children:n(j.Col,me({sm:"auto"},{children:[i(W,me({variant:"filled",leftSection:i(R,me({onClick:e.onBackClick,color:"blue",size:"xs",radius:"xl",variant:"filled"},{children:i(r,{size:14})})),size:"lg"},{children:"Students"})),i(qe,{variant:"compact",name:e.name,impactStatement:e.impactStatement})]}))})),n("div",me({style:{position:"relative"}},{children:[i(F,{visible:e.loading,overlayBlur:2}),n(H,me({spacing:"lg"},{children:[i(ge,{data:[{title:"PROBLEMS SOLVED",value:e.numberOfProblemsSolved},{title:"LESSON COMPLETION",value:e.percentageOfLessonsCompleted,unit:"%"},{title:"BADGE COMPLETION",value:s,unit:"%"}]}),n(H,me({spacing:0},{children:[i(pe,{value:l,data:[{label:"My badges",value:"badges"},{label:"My answers",value:"answers"},{label:"My reflections",value:"reflections"}],onChange:o}),"badges"===l&&i(Ve,{loading:e.loading,items:e.badges,onClick:e.onBadgeClick}),"answers"===l&&i(Ge,{loading:e.loading,items:e.answers,onClick:e.onAnswerClick}),"reflections"===l&&i(Ue,{loading:e.loading,items:e.reflections,onClick:e.onReflectionClick})]}))]}))]}))]}))}))},Ye=z((function(e,n){var i=n.from||"blue",t=n.to||"green";return{card:{position:"relative",cursor:"pointer",overflow:"hidden",transition:"transform 150ms ease, box-shadow 100ms ease",padding:e.spacing.xl,paddingLeft:2*e.spacing.xl,"&:hover":{boxShadow:e.shadows.md,transform:"scale(1.02)"},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:0,width:6,backgroundImage:e.fn.linearGradient(0,e.colors[i][6],e.colors[t][6])}}}}));function $e(e){var t=Ye(e).classes,r=e.from||"blue",l=e.to||"green",o=e.icon||i(u,{size:28,stroke:1.5});return n($,me({withBorder:!0,radius:"md",className:t.card,onClick:e.onClick},{children:[i(J,me({size:"xl",radius:"md",variant:"gradient",gradient:{deg:0,from:r,to:l}},{children:o})),i(w,me({size:"xl",weight:500,mt:"md"},{children:e.title})),i(w,me({size:"sm",mt:"sm",color:"dimmed"},{children:e.description}))]}))}var Je=z((function(e){return{card:{height:240,backgroundSize:"cover",backgroundPosition:"center"},content:{position:"absolute",padding:e.spacing.xl,zIndex:1,top:0,bottom:0,right:0,left:0},action:{position:"absolute",bottom:e.spacing.xl,right:e.spacing.xl},title:{color:e.white,marginBottom:e.spacing.xs/2},description:{color:e.white,maxWidth:220}}})),Qe=function(e){var t=e.title,r=e.description,l=e.image,o=e.action,a=e.style,s=e.className,c=function(e,n){var i={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(i[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(t=Object.getOwnPropertySymbols(e);r<t.length;r++)n.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(e,t[r])&&(i[t[r]]=e[t[r]])}return i}(e,["title","description","image","action","style","className"]),d=Je(),h=d.classes,m=d.cx,u=d.theme;return n(Q,me({radius:"md",style:me({backgroundImage:"url(".concat(l,")")},a),className:m(h.card,s)},c,{children:[i(K,{gradient:"linear-gradient(105deg, ".concat(u.black," 20%, #312f2f 50%, ").concat(u.colors.gray[4]," 100%)"),opacity:.55,zIndex:0}),n("div",me({className:h.content},{children:[i(w,me({size:"lg",weight:700,className:h.title},{children:t})),i(w,me({size:"sm",className:h.description},{children:r})),i(M,me({className:h.action,variant:"white",color:"dark",component:"a",size:"xs",href:o.link,target:"_blank"},{children:o.label}))]}))]}))},Ke=function(e){return i(D,me({size:"lg"},{children:n(H,me({spacing:"lg"},{children:[n(j,me({gutter:"md"},{children:[i(j.Col,me({md:6},{children:i(qe,{variant:"compact",name:e.name,impactStatement:e.impactStatement})})),i(j.Col,me({md:6},{children:i(Qe,{title:e.organization.name,description:e.organization.description,image:e.organization.image,action:{label:"Visit website",link:e.organization.website}})}))]})),n(j,me({gutter:"md"},{children:[i(j.Col,{children:i($e,{title:"Dashboard",description:"Track class performance across core areas of focus.",onClick:e.onDashboardClick})}),i(j.Col,{children:i($e,{title:"Classes",description:"Organize students into classes.",onClick:e.onClassesClick})}),i(j.Col,{children:i($e,{title:"Lessons",description:"Explore units of instruction and/or see corresponding class progress.",onClick:e.onLessonsClick})}),i(j.Col,{children:i($e,{title:"Badges",description:"Project-sized skills acquisition and standards alignment.",onClick:e.onBadgesClick})})]}))]}))}))};function Xe(e){if(0===e.items.length)return i(ve,{title:"No reflections to display",description:"There has not been any lesson progress just yet.",loading:e.loading,icon:"lessons"});var t=e.items.map((function(e){return n("tr",{children:[i("td",{children:e.studentName}),i("td",{children:e.reflection}),i("td",{children:e.rating.toLocaleString()})]},e.studentName)}));return i(E.Autosize,me({maxHeight:500},{children:n(P,me({verticalSpacing:"sm",sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Student Name"}),i("th",{children:"Reflection"}),i("th",{children:"Rating"})]})}),i("tbody",{children:t})]}))}))}function Ze(e){if(0===e.items.length)return i(ve,{title:"No students to display",description:"You don't have any student data yet for this lesson",loading:e.loading,icon:"lessons"});var t=e.items.map((function(t){return n("tr",{children:[i("td",{children:i(A,me({onClick:function(){return e.onClick&&e.onClick(t)}},{children:n(B,me({spacing:"sm"},{children:[i(I,{size:40,src:t.avatar,radius:40}),n("div",{children:[i(w,me({size:"sm",weight:500},{children:t.name})),i(w,me({size:"xs",color:"dimmed"},{children:t.email}))]})]}))}))}),n("td",{children:[!!t.isComplete&&i(W,me({variant:"filled"},{children:"Complete"})),!t.isComplete&&!t.isStarted&&i(W,me({color:"red",variant:"filled"},{children:"Not started"})),!t.isComplete&&!!t.isStarted&&i(W,me({color:"violet",variant:"filled"},{children:"In progress"}))]})]},t.name)}));return i(E.Autosize,me({maxHeight:500},{children:n(P,me({verticalSpacing:"sm",sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Lesson Name"}),i("th",{children:"Status"})]})}),i("tbody",{children:t})]}))}))}function en(e){var t=N.useMemo((function(){return{position:"left",getValue:function(e){return e.primary}}}),[]),r=N.useMemo((function(){return[{position:"bottom",getValue:function(e){return e.secondary}}]}),[]);if(0===e.items.length)return i(ve,{title:"No questions to display",description:"There are no questions in this lesson.",loading:e.loading,icon:"lessons"});var l=e.items.map((function(e){if(e.chart){var l={},o=e.choices||[];return o.forEach((function(e){l[e]=0})),e.answers.forEach((function(e){return e.forEach((function(e){e in l&&(l[e]=l[e]?l[e]+1:1)}))})),i(Q,me({withBorder:!0,p:"xl",radius:"md"},{children:n(H,me({spacing:4},{children:[i(T,me({size:"lg"},{children:e.question})),n(w,me({size:"sm"},{children:[e.answers.length," answers"]})),i("div",me({style:{background:"white",height:"300px",width:"100%",position:"relative"}},{children:i(he,{options:{data:[{label:"",data:o.map((function(e){return{primary:nn(e,50),secondary:l[e]}}))}],primaryAxis:t,secondaryAxes:r}})}))]}))}),e.question)}return i(Q,me({withBorder:!0,p:"xl",radius:"md"},{children:n(H,me({spacing:4},{children:[i(T,me({size:"lg"},{children:e.question})),n(w,me({size:"sm"},{children:[e.answers.length," answers"]})),i(E.Autosize,me({maxHeight:500},{children:i(H,me({spacing:4},{children:e.answers.map((function(e){var n=e.join("\n");return i(Q,me({p:5,radius:0,bg:"gray.0"},{children:i(w,{children:n})}),n)}))}))}))]}))}),e.question)}));return i(H,me({py:4,spacing:10,sx:{minWidth:700}},{children:l}))}var nn=function(e,n){return e.substr(0,n-1)+(e.length>n?"…":"")},tn=z((function(e){var n;return{title:(n={fontSize:34,fontWeight:900},n[e.fn.smallerThan("sm")]={fontSize:24},n),description:{maxWidth:600}}})),rn=function(e){var t=tn().classes,o=S("question"),a=o[0],s=o[1],c=e.students.length,d=c>0?e.students.filter((function(e){return e.isComplete})).length/c:0;return i(D,me({size:"lg",py:"xl"},{children:n(H,me({spacing:"md"},{children:[i(j,{children:n(j.Col,me({sm:"auto"},{children:[i(W,me({variant:"filled",leftSection:i(R,me({onClick:e.onBackClick,color:"blue",size:"xs",radius:"xl",variant:"filled"},{children:i(r,{size:14})})),size:"lg"},{children:"Lessons"})),n(B,{children:[n(H,me({spacing:0},{children:[i(T,me({order:2,className:t.title,mt:"md"},{children:e.displayName||"Lesson"})),i(w,me({color:"dimmed",className:t.description,mt:"sm"},{children:e.description||"No description"}))]})),i(H,me({ml:"auto"},{children:i(M,me({variant:"gradient",onClick:e.onPreviewClick},{children:"Preview"}))}))]})]}))}),i("div",{children:n("div",me({style:{position:"relative"}},{children:[i(F,{visible:e.loading,overlayBlur:2}),n(H,{children:[i(ge,{data:[{title:"LESSON COMPLETION",value:d,unit:"%"}]}),i(q,{clearable:!0,clearButtonLabel:"Clear class selection",size:"sm",placeholder:"Select a class",nothingFound:"No options",value:e.classId,onChange:e.onClassChange,icon:i(l,{}),data:e.classes.map((function(e){return{value:e.classId,label:e.name}}))}),n(H,me({spacing:0},{children:[i(pe,{value:a,data:[{label:"By question",value:"question"},{label:"By reflection",value:"reflections"},{label:"By student",value:"students"}],onChange:s}),"question"===a&&i(en,{loading:e.loading,items:e.questions}),"reflections"===a&&i(Xe,{loading:e.loading,items:e.reflections}),"students"===a&&i(Ze,{loading:e.loading,items:e.students,onClick:e.onUserClick})]}))]})]}))})]}))}))};function ln(e){if(0===e.items.length)return i(ve,{title:"No lessons to display",description:"We don't have any lessons to show you just yet.",loading:e.loading,icon:"lessons"});var t=e.items.map((function(t){return i("tr",{children:i("td",{children:i(A,me({sx:function(e){return{display:"block",width:"100%",padding:e.spacing.md,color:"dark"===e.colorScheme?e.colors.dark[0]:e.black,"&:hover":{backgroundColor:"dark"===e.colorScheme?e.colors.dark[8]:e.colors.gray[1]}}},onClick:function(){return e.onClick&&e.onClick(t)}},{children:i(B,{children:n("div",{children:[i(w,me({size:"sm",weight:500},{children:t.name})),i(w,me({size:"xs",color:"dimmed"},{children:t.description}))]})})}))})},t.lessonId)}));return i(E.Autosize,me({maxHeight:500},{children:i(P,me({horizontalSpacing:0,verticalSpacing:0,sx:{minWidth:700}},{children:i("tbody",{children:t})}))}))}var on=z((function(e){var n;return{title:(n={fontSize:34,fontWeight:900},n[e.fn.smallerThan("sm")]={fontSize:24},n),description:{maxWidth:600}}})),an=function(e){var t=on().classes;return i(D,me({size:"lg",py:"xl"},{children:n(H,me({spacing:"md"},{children:[i(j,{children:n(j.Col,me({sm:"auto"},{children:[i(W,me({variant:"filled",size:"lg"},{children:"Lessons"})),i(T,me({order:2,className:t.title,mt:"md"},{children:"Lessons"})),i(w,me({color:"dimmed",className:t.description,mt:"sm"},{children:"Explore units of instruction and/or see corresponding class progress."}))]}))}),i(V,{placeholder:"Search for a lesson that fits your needs",data:e.lessons.map((function(e){return e.name})),onChange:e.onAutocompleteChange}),n("div",me({style:{position:"relative"}},{children:[i(F,{visible:e.loading,overlayBlur:2}),i(ln,{loading:e.loading,items:e.lessons,onClick:e.onLessonClick})]}))]}))}))},sn=X({key:"mantine",prepend:!1}),cn=function(n){return i(Z,me({withNormalizeCSS:!0,withGlobalStyles:!0,emotionCache:sn,theme:{loader:"bars"}},{children:i(e,me({limit:n.notificationLimit||5},{children:i(de,{children:n.children})}))}))},dn=function(e){var t=ae({initialValues:{active:e.account}});return i(ee,me({centered:!0,opened:e.opened,onClose:function(){return e.onClose&&e.onClose()},size:"sm",title:i(T,me({size:"h5"},{children:"Accounts"}))},{children:n("form",me({onSubmit:t.onSubmit((function(){e.onChange&&e.onChange(t.values.active)}))},{children:[i(q,me({required:!0,placeholder:"Select an account",defaultValue:e.account,data:e.accounts.map((function(e){return{value:e.accountId,label:e.name}}))},t.getInputProps("active"))),i(M,me({type:"submit",fullWidth:!0,mt:"xl"},{children:"Switch"}))]}))}))},hn=z((function(e){return{link:{width:50,height:50,borderRadius:e.radius.md,display:"flex",alignItems:"center",justifyContent:"center",color:"dark"===e.colorScheme?e.colors.dark[0]:e.colors.gray[7],"&:hover":{backgroundColor:"dark"===e.colorScheme?e.colors.dark[5]:e.colors.gray[0]}},active:{"&, &:hover":{backgroundColor:e.fn.variant({variant:"light",color:e.primaryColor}).background,color:e.fn.variant({variant:"light",color:e.primaryColor}).color}}}})),mn=[{icon:f,label:"Home",href:"/home"},{icon:v,label:"Dashboard",href:"/dashboard"},{icon:l,label:"Classes",href:"/classes"},{icon:b,label:"Badges",href:"/badges"},{icon:C,label:"Lessons",href:"/lessons"}],un=function(e){var n,t=e.icon,r=e.label,l=e.active,o=e.onClick,a=hn(),s=a.classes,c=a.cx;return i(Y,me({label:r,position:"right",transitionDuration:0},{children:i(A,me({onClick:o,className:c(s.link,(n={},n[s.active]=l,n))},{children:i(t,{stroke:1.5})}))}))},gn=function(e){var t=mn.map((function(n){return i(un,{label:n.label,icon:n.icon,active:n.label===e.active,onClick:function(){return e.navigate(n.href)}},n.label)}));return n(ne,me({width:{base:80},p:"md"},{children:[i(ie,{children:i(I,me({color:"blue",radius:"sm"},{children:i("div",me({style:{width:15,marginLeft:"auto",marginRight:"auto"}},{children:i(L,{fit:"contain",src:"https://cdn.localcivics.io/brand/l.png"})}))}))}),i(ne.Section,me({grow:!0,mt:50},{children:i(H,me({justify:"center",spacing:0},{children:t}))})),i(ne.Section,{children:n(H,me({justify:"center",spacing:0},{children:[i(un,{icon:g,label:"Switch accounts",onClick:e.onSwitchAccounts}),i(un,{icon:p,label:"Logout",onClick:e.onLogout})]}))})]}))},pn=z((function(e){var n,i,t,r,l,o;return{footer:{paddingTop:2*e.spacing.xl,paddingBottom:2*e.spacing.xl,paddingLeft:3*e.spacing.xl,backgroundColor:"dark"===e.colorScheme?e.colors.dark[6]:e.colors.gray[0],borderTop:"1px solid ".concat("dark"===e.colorScheme?e.colors.dark[5]:e.colors.gray[2])},logo:(n={maxWidth:200},n[e.fn.smallerThan("sm")]={display:"flex",flexDirection:"column",alignItems:"center"},n),description:(i={marginTop:5},i[e.fn.smallerThan("sm")]={marginTop:e.spacing.xs,textAlign:"center"},i),inner:(t={display:"flex",justifyContent:"space-between"},t[e.fn.smallerThan("sm")]={flexDirection:"column",alignItems:"center"},t),groups:(r={display:"flex",flexWrap:"wrap"},r[e.fn.smallerThan("sm")]={display:"none"},r),wrapper:{width:160},link:{display:"block",color:"dark"===e.colorScheme?e.colors.dark[1]:e.colors.gray[6],fontSize:e.fontSizes.sm,paddingTop:3,paddingBottom:3,"&:hover":{textDecoration:"underline"}},title:{fontSize:e.fontSizes.md,fontWeight:700,fontFamily:"Greycliff CF, ".concat(e.fontFamily),marginBottom:e.spacing.xs/2,color:"dark"===e.colorScheme?e.white:e.black},afterFooter:(l={display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:e.spacing.xl,paddingTop:e.spacing.xl,paddingBottom:e.spacing.xl,borderTop:"1px solid ".concat("dark"===e.colorScheme?e.colors.dark[4]:e.colors.gray[2])},l[e.fn.smallerThan("sm")]={flexDirection:"column"},l),social:(o={},o[e.fn.smallerThan("sm")]={marginTop:e.spacing.xs},o)}})),fn=function(e){var r=pn().classes,l=vn(e.account,e.accounts,e.onAccountChange);return n(te,me({padding:"xs",navbar:i(gn,{active:e.navbar.props.active,navigate:e.navbar.props.navigate,onLogout:e.navbar.props.onLogout,onSwitchAccounts:function(){return l.setChangeModalOpen(!0)}}),footer:i(t,{children:!l.opened&&n("footer",me({className:r.footer},{children:[n(D,me({className:r.inner},{children:[n("div",me({className:r.logo},{children:[n(B,me({spacing:"xs"},{children:[i("div",me({style:{width:15}},{children:i(L,{fit:"contain",src:"https://cdn.localcivics.io/brand/l.png"})})),i(T,me({color:"dimmed",size:"h5"},{children:"Local Civics"}))]})),i(w,me({size:"xs",color:"dimmed",className:r.description},{children:"We connect students to powerful civic learning experiences."}))]})),i("div",me({className:r.groups},{children:n("div",me({className:r.wrapper},{children:[i(w,me({className:r.link,component:"a",href:"https://www.localcivics.io",target:"_blank"},{children:"About"})),i(w,me({className:r.link,component:"a",href:"https://www.localcivics.io/terms-of-service",target:"_blank"},{children:"Terms"})),i(w,me({className:r.link,component:"a",href:"https://www.localcivics.io/privacy-policy",target:"_blank"},{children:"Privacy"})),i(w,me({className:r.link,component:"a",href:"https://localcivics.notion.site/Help-Center-b52300f587b64fc0a61f512686e7626d",target:"_blank"},{children:"Help Center"}))]}))}))]})),n(D,me({className:r.afterFooter},{children:[n(w,me({color:"dimmed",size:"sm"},{children:["© ",(new Date).getFullYear()," Local Civics. All rights reserved."]})),n(B,me({spacing:0,className:r.social,position:"right",noWrap:!0},{children:[i(R,me({component:"a",target:"_blank",href:"https://www.instagram.com/localcivics/",size:"lg"},{children:i(y,{size:18,stroke:1.5})})),i(R,me({component:"a",target:"_blank",href:"https://www.linkedin.com/company/localcivics",size:"lg"},{children:i(k,{size:18,stroke:1.5})})),i(R,me({component:"a",target:"_blank",href:"https://www.facebook.com/localcivics/",size:"lg"},{children:i(x,{size:18,stroke:1.5})}))]}))]}))]}))}),styles:function(e){return{main:{backgroundColor:"dark"===e.colorScheme?e.colors.dark[8]:e.colors.gray[0]}}}},{children:[n("div",me({style:{position:"relative"}},{children:[(e.loading||l.opened)&&i(ie,me({style:{height:400}},{children:i(re,{})})),!e.loading&&!l.opened&&e.page]})),i(dn,{opened:l.opened,account:l.account,accounts:l.accounts,onChange:l.onAccountChange,onClose:function(){return l.setChangeModalOpen(!1)}})]}))},vn=function(e,n,i){var t=JSON.stringify(n),r=S(!1),l=r[0],o=r[1],a=S(e),s=a[0],c=a[1];return N.useEffect((function(){c(e)}),[e,t]),{opened:l,account:s,accounts:n,setChangeModalOpen:o,onAccountChange:function(e){c(e),o(!1),i(e)}}};export{cn as AdminProvider,fn as App,ke as Badge,Se as Badges,De as Class,Me as Classes,We as Dashboard,Ke as Home,rn as Lesson,an as Lessons,gn as Navbar,_e as Student,dn as SwitchAccount};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Item } from "./Table";
|
|
2
|
-
import { Item as LessonItem } from "./LessonTable";
|
|
3
|
-
/**
|
|
4
|
-
* BadgeUserItem
|
|
5
|
-
*/
|
|
6
|
-
export type BadgeUserItem = Item;
|
|
7
|
-
/**
|
|
8
|
-
* BadgeClass
|
|
9
|
-
*/
|
|
10
|
-
export type BadgeClass = {
|
|
11
|
-
classId: string;
|
|
12
|
-
name: string;
|
|
13
|
-
active: boolean;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* BadgeProps
|
|
17
|
-
*/
|
|
18
|
-
export type BadgeProps = {
|
|
19
|
-
loading: boolean;
|
|
20
|
-
displayName: string;
|
|
21
|
-
description: string;
|
|
22
|
-
classes: BadgeClass[];
|
|
23
|
-
lessons: LessonItem[];
|
|
24
|
-
classId: string;
|
|
25
|
-
students: BadgeUserItem[];
|
|
26
|
-
onBackClick: () => void;
|
|
27
|
-
onClassChange: (classId: string) => void;
|
|
28
|
-
onPreviewClick: () => void;
|
|
29
|
-
onUserClick: (user: BadgeUserItem) => void;
|
|
30
|
-
onLessonClick: (lesson: LessonItem) => void;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* Badge
|
|
34
|
-
* @param props
|
|
35
|
-
* @constructor
|
|
36
|
-
*/
|
|
37
|
-
export declare const Badge: (props: BadgeProps) => JSX.Element;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Item
|
|
3
|
-
*/
|
|
4
|
-
export interface Item {
|
|
5
|
-
lessonId: string;
|
|
6
|
-
lessonName: string;
|
|
7
|
-
percentageCompletion: number;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* TableData
|
|
11
|
-
*/
|
|
12
|
-
export type TableData = {
|
|
13
|
-
loading: boolean;
|
|
14
|
-
items: Item[];
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* TableMethods
|
|
18
|
-
*/
|
|
19
|
-
export type TableMethods = {
|
|
20
|
-
onClick: (item: Item) => void;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* TableProps
|
|
24
|
-
*/
|
|
25
|
-
export type TableProps = TableData & TableMethods;
|
|
26
|
-
/**
|
|
27
|
-
* Table
|
|
28
|
-
* @constructor
|
|
29
|
-
* @param props
|
|
30
|
-
*/
|
|
31
|
-
export declare function Table(props: TableProps): JSX.Element;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Item
|
|
3
|
-
*/
|
|
4
|
-
export interface Item {
|
|
5
|
-
userId: string;
|
|
6
|
-
avatar: string;
|
|
7
|
-
name: string;
|
|
8
|
-
email: string;
|
|
9
|
-
isComplete?: boolean;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* TableData
|
|
13
|
-
*/
|
|
14
|
-
export type TableData = {
|
|
15
|
-
loading: boolean;
|
|
16
|
-
items: Item[];
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* TableMethods
|
|
20
|
-
*/
|
|
21
|
-
export type TableMethods = {
|
|
22
|
-
onClick: (item: Item) => void;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* TableProps
|
|
26
|
-
*/
|
|
27
|
-
export type TableProps = TableData & TableMethods;
|
|
28
|
-
/**
|
|
29
|
-
* Table
|
|
30
|
-
* @constructor
|
|
31
|
-
* @param props
|
|
32
|
-
*/
|
|
33
|
-
export declare function Table(props: TableProps): JSX.Element;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { BadgeProps } from "./Badge";
|
|
2
|
-
import { Story } from "@storybook/react";
|
|
3
|
-
/**
|
|
4
|
-
* Storybook component configuration
|
|
5
|
-
*/
|
|
6
|
-
declare const _default: {
|
|
7
|
-
title: string;
|
|
8
|
-
component: (props: BadgeProps) => JSX.Element;
|
|
9
|
-
};
|
|
10
|
-
export default _default;
|
|
11
|
-
/**
|
|
12
|
-
* Component stories
|
|
13
|
-
*/
|
|
14
|
-
export declare const Component: Story<BadgeProps>;
|
|
15
|
-
/**
|
|
16
|
-
* Component stories
|
|
17
|
-
*/
|
|
18
|
-
export declare const Mock: Story<BadgeProps>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Item } from "./Table";
|
|
2
|
-
/**
|
|
3
|
-
* BadgeItem
|
|
4
|
-
*/
|
|
5
|
-
export type BadgeItem = Item;
|
|
6
|
-
/**
|
|
7
|
-
* BadgesProps
|
|
8
|
-
*/
|
|
9
|
-
export type BadgesProps = {
|
|
10
|
-
loading: boolean;
|
|
11
|
-
badges: BadgeItem[];
|
|
12
|
-
onAutocompleteChange: (value: string) => void;
|
|
13
|
-
onBadgeClick: (badge: BadgeItem) => void;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Badges
|
|
17
|
-
* @param props
|
|
18
|
-
* @constructor
|
|
19
|
-
*/
|
|
20
|
-
export declare const Badges: (props: BadgesProps) => JSX.Element;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Item
|
|
3
|
-
*/
|
|
4
|
-
export interface Item {
|
|
5
|
-
badgeId: string;
|
|
6
|
-
name: string;
|
|
7
|
-
description: string;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* TableData
|
|
11
|
-
*/
|
|
12
|
-
export type TableData = {
|
|
13
|
-
loading: boolean;
|
|
14
|
-
items: Item[];
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* TableMethods
|
|
18
|
-
*/
|
|
19
|
-
export type TableMethods = {
|
|
20
|
-
onClick: (badge: Item) => void;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* TableProps
|
|
24
|
-
*/
|
|
25
|
-
export type TableProps = TableData & TableMethods;
|
|
26
|
-
/**
|
|
27
|
-
* Table
|
|
28
|
-
* @param props
|
|
29
|
-
* @constructor
|
|
30
|
-
*/
|
|
31
|
-
export declare function Table(props: TableProps): JSX.Element;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { BadgesProps } from "./Badges";
|
|
2
|
-
import { Story } from "@storybook/react";
|
|
3
|
-
/**
|
|
4
|
-
* Storybook component configuration
|
|
5
|
-
*/
|
|
6
|
-
declare const _default: {
|
|
7
|
-
title: string;
|
|
8
|
-
component: (props: BadgesProps) => JSX.Element;
|
|
9
|
-
};
|
|
10
|
-
export default _default;
|
|
11
|
-
/**
|
|
12
|
-
* Component stories
|
|
13
|
-
*/
|
|
14
|
-
export declare const Component: Story<BadgesProps>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Item } from "./Table";
|
|
2
|
-
/**
|
|
3
|
-
* StudentItem
|
|
4
|
-
*/
|
|
5
|
-
export type StudentItem = Item;
|
|
6
|
-
/**
|
|
7
|
-
* ClassProps
|
|
8
|
-
*/
|
|
9
|
-
export type ClassProps = {
|
|
10
|
-
loading: boolean;
|
|
11
|
-
displayName: string;
|
|
12
|
-
description: string;
|
|
13
|
-
students: StudentItem[];
|
|
14
|
-
percentageOfAccountsCreated: number;
|
|
15
|
-
percentageOfBadgesEarned: number;
|
|
16
|
-
percentageOfLessonsCompleted: number;
|
|
17
|
-
onBackClick: () => void;
|
|
18
|
-
onCreateStudents: (students: StudentItem[]) => void;
|
|
19
|
-
onDeleteStudent: (student: StudentItem) => void;
|
|
20
|
-
onStudentClick: (student: StudentItem) => void;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Class
|
|
24
|
-
* @param props
|
|
25
|
-
* @constructor
|
|
26
|
-
*/
|
|
27
|
-
export declare const Class: (props: ClassProps) => JSX.Element;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Item
|
|
3
|
-
*/
|
|
4
|
-
export type Item = {
|
|
5
|
-
classId: string;
|
|
6
|
-
studentId: string;
|
|
7
|
-
avatar: string;
|
|
8
|
-
email: string;
|
|
9
|
-
givenName: string;
|
|
10
|
-
familyName: string;
|
|
11
|
-
lastActivity: Date | null;
|
|
12
|
-
readonly: boolean;
|
|
13
|
-
hasAccount: boolean;
|
|
14
|
-
badgesEarned: number;
|
|
15
|
-
lessonsCompleted: number;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* TableProps
|
|
19
|
-
*/
|
|
20
|
-
export interface TableProps {
|
|
21
|
-
loading: boolean;
|
|
22
|
-
items: Item[];
|
|
23
|
-
onViewProfile: (student: Item) => void;
|
|
24
|
-
onDelete?: (student: Item) => void;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Table
|
|
28
|
-
* @param props
|
|
29
|
-
* @constructor
|
|
30
|
-
*/
|
|
31
|
-
export declare function Table(props: TableProps): JSX.Element;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ClassProps } from "./Class";
|
|
2
|
-
import { Story } from "@storybook/react";
|
|
3
|
-
/**
|
|
4
|
-
* Storybook component configuration
|
|
5
|
-
*/
|
|
6
|
-
declare const _default: {
|
|
7
|
-
title: string;
|
|
8
|
-
component: (props: ClassProps) => JSX.Element;
|
|
9
|
-
};
|
|
10
|
-
export default _default;
|
|
11
|
-
/**
|
|
12
|
-
* Component stories
|
|
13
|
-
*/
|
|
14
|
-
export declare const Component: Story<ClassProps>;
|
|
15
|
-
/**
|
|
16
|
-
* Mock stories
|
|
17
|
-
*/
|
|
18
|
-
export declare const Mock: Story<ClassProps>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Item } from "./Table";
|
|
2
|
-
/**
|
|
3
|
-
* ClassItem
|
|
4
|
-
*/
|
|
5
|
-
export type ClassItem = Item;
|
|
6
|
-
/**
|
|
7
|
-
* ClassesProps
|
|
8
|
-
*/
|
|
9
|
-
export type ClassesProps = {
|
|
10
|
-
loading: boolean;
|
|
11
|
-
classes: ClassItem[];
|
|
12
|
-
onCreateClass: (group: ClassItem) => void;
|
|
13
|
-
onDeleteClass: (group: ClassItem) => void;
|
|
14
|
-
onClassClick: (group: ClassItem) => void;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Classes
|
|
18
|
-
* @param props
|
|
19
|
-
* @constructor
|
|
20
|
-
*/
|
|
21
|
-
export declare const Classes: (props: ClassesProps) => JSX.Element;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Item
|
|
3
|
-
*/
|
|
4
|
-
export type Item = {
|
|
5
|
-
classId: string;
|
|
6
|
-
name: string;
|
|
7
|
-
description: string;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* TableProps
|
|
11
|
-
*/
|
|
12
|
-
export interface TableProps {
|
|
13
|
-
loading: boolean;
|
|
14
|
-
items: Item[];
|
|
15
|
-
onClick: (item: Item) => void;
|
|
16
|
-
onDeleteClass: (item: Item) => void;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Table
|
|
20
|
-
* @param props
|
|
21
|
-
* @constructor
|
|
22
|
-
*/
|
|
23
|
-
export declare function Table(props: TableProps): JSX.Element;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ClassesProps } from "./Classes";
|
|
2
|
-
import { Story } from "@storybook/react";
|
|
3
|
-
/**
|
|
4
|
-
* Storybook component configuration
|
|
5
|
-
*/
|
|
6
|
-
declare const _default: {
|
|
7
|
-
title: string;
|
|
8
|
-
component: (props: ClassesProps) => JSX.Element;
|
|
9
|
-
};
|
|
10
|
-
export default _default;
|
|
11
|
-
/**
|
|
12
|
-
* Component stories
|
|
13
|
-
*/
|
|
14
|
-
export declare const Component: Story<ClassesProps>;
|
|
15
|
-
/**
|
|
16
|
-
* Component stories
|
|
17
|
-
*/
|
|
18
|
-
export declare const Mock: Story<ClassesProps>;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Item
|
|
3
|
-
*/
|
|
4
|
-
export interface Item {
|
|
5
|
-
badgeId: string;
|
|
6
|
-
name: string;
|
|
7
|
-
description: string;
|
|
8
|
-
percentageCompletion: number;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* TableData
|
|
12
|
-
*/
|
|
13
|
-
export type TableData = {
|
|
14
|
-
loading: boolean;
|
|
15
|
-
items: Item[];
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* TableMethods
|
|
19
|
-
*/
|
|
20
|
-
export type TableMethods = {
|
|
21
|
-
onClick: (badge: Item) => void;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* TableProps
|
|
25
|
-
*/
|
|
26
|
-
export type TableProps = TableData & TableMethods;
|
|
27
|
-
/**
|
|
28
|
-
* Table
|
|
29
|
-
* @param props
|
|
30
|
-
* @constructor
|
|
31
|
-
*/
|
|
32
|
-
export declare function Table(props: TableProps): JSX.Element;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Item as StudentItem } from "./StudentTable";
|
|
2
|
-
import { Item as ReflectionItem } from "./ReflectionTable";
|
|
3
|
-
import { Item as ImpactItem } from "./ImpactTable";
|
|
4
|
-
import { Item as BadgeItem } from "./BadgeTable";
|
|
5
|
-
import { Item as LessonItem } from "./LessonTable";
|
|
6
|
-
/**
|
|
7
|
-
* DashboardClass
|
|
8
|
-
*/
|
|
9
|
-
export type DashboardClass = {
|
|
10
|
-
classId: string;
|
|
11
|
-
name: string;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* DashboardProps
|
|
15
|
-
*/
|
|
16
|
-
export type DashboardProps = {
|
|
17
|
-
loading: boolean;
|
|
18
|
-
students: StudentItem[];
|
|
19
|
-
impacts: ImpactItem[];
|
|
20
|
-
reflections: ReflectionItem[];
|
|
21
|
-
classes: DashboardClass[];
|
|
22
|
-
badges: BadgeItem[];
|
|
23
|
-
lessons: LessonItem[];
|
|
24
|
-
classId: string;
|
|
25
|
-
percentageOfAccountsCreated: number;
|
|
26
|
-
percentageOfBadgesEarned: number;
|
|
27
|
-
percentageOfLessonsCompleted: number;
|
|
28
|
-
onClassChange: (classId: string) => void;
|
|
29
|
-
onViewStudentProfile: (student: StudentItem) => void;
|
|
30
|
-
onBadgeClick: (badge: BadgeItem) => void;
|
|
31
|
-
onLessonClick: (lesson: LessonItem) => void;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Dashboard
|
|
35
|
-
* @param props
|
|
36
|
-
* @constructor
|
|
37
|
-
*/
|
|
38
|
-
export declare const Dashboard: (props: DashboardProps) => JSX.Element;
|