@local-civics/mgmt-ui 0.1.12 → 0.1.14

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.
Files changed (46) hide show
  1. package/dist/components/banners/PlaceholderBanner/PlaceholderBanner.d.ts +11 -8
  2. package/dist/components/{charts → data}/AreaChart/AreaChart.d.ts +9 -7
  3. package/dist/components/{stats → data}/StatsGrid/StatsGrid.d.ts +0 -0
  4. package/dist/components/{stats → data}/StatsGroup/StatsGroup.d.ts +0 -0
  5. package/dist/components/data/Timeline/Timeline.d.ts +11 -7
  6. package/dist/components/navigation/Navbar/Navbar.d.ts +4 -3
  7. package/dist/components/users/UserInfo/UserInfo.d.ts +3 -7
  8. package/dist/index.d.ts +13 -3
  9. package/dist/index.es.js +1 -1
  10. package/dist/index.js +1 -1
  11. package/dist/pages/{Badges/Badge → Badge}/Badge.d.ts +16 -21
  12. package/dist/pages/{Badges/Badge → Badge}/Table.d.ts +3 -2
  13. package/dist/pages/{Badges/Badge → Badge}/component.stories.d.ts +0 -0
  14. package/dist/pages/Badges/Badges.d.ts +3 -12
  15. package/dist/pages/Badges/Table.d.ts +1 -1
  16. package/dist/pages/DataBreakdown/DataBreakdown.d.ts +24 -0
  17. package/dist/pages/{Dashboard/Breakdown → DataBreakdown}/Table.d.ts +3 -3
  18. package/dist/pages/DataDashboard/DataDashboard.d.ts +31 -0
  19. package/dist/pages/{Dashboard → DataDashboard}/component.stories.d.ts +3 -3
  20. package/dist/pages/DataOverview/DataOverview.d.ts +27 -0
  21. package/dist/pages/Group/Group.d.ts +26 -0
  22. package/dist/pages/Group/Table.d.ts +31 -0
  23. package/dist/pages/GroupUser/GroupUser.d.ts +28 -0
  24. package/dist/pages/Groups/Groups.d.ts +7 -26
  25. package/dist/pages/Groups/GroupsStack.d.ts +6 -6
  26. package/dist/pages/Home/Home.d.ts +24 -45
  27. package/dist/pages/Lesson/Lesson.d.ts +38 -0
  28. package/dist/pages/Lesson/Table.d.ts +25 -0
  29. package/dist/pages/{Lessons/Lesson → Lesson}/component.stories.d.ts +0 -0
  30. package/dist/pages/Lessons/LessonTable.d.ts +1 -1
  31. package/dist/pages/Lessons/Lessons.d.ts +4 -22
  32. package/dist/providers/AdminProvider/AdminProvider.d.ts +14 -0
  33. package/dist/shells/App/App.d.ts +20 -0
  34. package/dist/shells/{Mgmt → App}/SwitchAccount/SwitchAccount.d.ts +10 -12
  35. package/dist/shells/{Mgmt → App}/SwitchAccount/component.stories.d.ts +0 -0
  36. package/dist/shells/{Mgmt → App}/component.stories.d.ts +3 -3
  37. package/package.json +1 -1
  38. package/dist/pages/Dashboard/Breakdown/Breakdown.d.ts +0 -25
  39. package/dist/pages/Dashboard/Dashboard.d.ts +0 -40
  40. package/dist/pages/Dashboard/Overview/Overview.d.ts +0 -40
  41. package/dist/pages/Groups/Group/Group.d.ts +0 -69
  42. package/dist/pages/Groups/Group/GroupUserTable.d.ts +0 -30
  43. package/dist/pages/Lessons/Lesson/Lesson.d.ts +0 -39
  44. package/dist/pages/Lessons/Lesson/LessonUserTable.d.ts +0 -24
  45. package/dist/providers/MgmtProvider/MgmtProvider.d.ts +0 -14
  46. package/dist/shells/Mgmt/Mgmt.d.ts +0 -77
@@ -1,54 +1,33 @@
1
1
  /// <reference types="react" />
2
+ import { TimelineItem } from "../../components/data/Timeline/Timeline";
2
3
  /**
3
- * HomeData
4
+ * HomeUserEvent
4
5
  */
5
- export type HomeData = {
6
- user: {
7
- avatar: string;
8
- givenName: string;
9
- familyName: string;
10
- email: string;
11
- job: string;
12
- quote: string;
13
- };
14
- tenant: {
15
- name: string;
16
- description: string;
17
- image: string;
18
- website: string;
19
- };
20
- stats: {
21
- "PROBLEMS SOLVED": {
22
- value: number;
23
- diff: number;
24
- };
25
- "LESSONS COMPLETED": {
26
- value: number;
27
- diff: number;
28
- };
29
- "BADGES EARNED": {
30
- value: number;
31
- diff: number;
32
- };
33
- };
34
- timeline: {
35
- key: string;
36
- name: string;
37
- link?: string;
38
- description: string;
39
- time: string;
40
- }[];
41
- };
42
- /**
43
- * HomeMethods
44
- */
45
- export type HomeMethods = {
46
- onTimelineScrollBottom: () => void;
47
- };
6
+ export type HomeUserEvent = TimelineItem;
48
7
  /**
49
8
  * HomeProps
50
9
  */
51
- export type HomeProps = HomeData & HomeMethods;
10
+ export type HomeProps = {
11
+ loading: boolean;
12
+ avatarURL: string;
13
+ givenName: string;
14
+ familyName: string;
15
+ email: string;
16
+ job: string;
17
+ impactStatement: string;
18
+ tenantName: string;
19
+ tenantDescription: string;
20
+ tenantImage: string;
21
+ tenantWebsite: string;
22
+ events: HomeUserEvent[];
23
+ problemsSolved: number;
24
+ problemsSolvedDiff: number;
25
+ lessonsCompleted: number;
26
+ lessonsCompletedDiff: number;
27
+ badgesCompleted: number;
28
+ badgesCompletedDiff: number;
29
+ onScrollBottom: () => void;
30
+ };
52
31
  /**
53
32
  * Home
54
33
  * @param props
@@ -0,0 +1,38 @@
1
+ /// <reference types="react" />
2
+ import { TabsValue } from '@mantine/core';
3
+ import { Item } from "./Table";
4
+ /**
5
+ * LessonUserItem
6
+ */
7
+ export type LessonUserItem = Item;
8
+ /**
9
+ * LessonGroup
10
+ */
11
+ export type LessonGroup = {
12
+ name: string;
13
+ active: boolean;
14
+ };
15
+ /**
16
+ * LessonProps
17
+ */
18
+ export type LessonProps = {
19
+ loading: boolean;
20
+ lessonId: string;
21
+ displayName: string;
22
+ description: string;
23
+ group: string;
24
+ groups: LessonGroup[];
25
+ tab: TabsValue;
26
+ users: LessonUserItem[];
27
+ onBackClick: () => void;
28
+ onGroupChange: (group: string) => void;
29
+ onPreviewClick: () => void;
30
+ onTabChange: (tab: TabsValue) => void;
31
+ onUserClick: (user: LessonUserItem) => void;
32
+ };
33
+ /**
34
+ * Lesson
35
+ * @param props
36
+ * @constructor
37
+ */
38
+ export declare const Lesson: (props: LessonProps) => JSX.Element;
@@ -0,0 +1,25 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * Item
4
+ */
5
+ export interface Item {
6
+ lessonId: string;
7
+ userId: string;
8
+ avatar: string;
9
+ name: string;
10
+ email: string;
11
+ }
12
+ /**
13
+ * TableProps
14
+ */
15
+ export interface TableProps {
16
+ loading: boolean;
17
+ items: Item[];
18
+ onClick: (user: Item) => void;
19
+ }
20
+ /**
21
+ * Table
22
+ * @constructor
23
+ * @param props
24
+ */
25
+ export declare function Table(props: TableProps): JSX.Element;
@@ -3,7 +3,7 @@
3
3
  * LessonItem
4
4
  */
5
5
  export interface LessonItem {
6
- key: string;
6
+ lessonId: string;
7
7
  name: string;
8
8
  description: string;
9
9
  }
@@ -1,32 +1,14 @@
1
1
  /// <reference types="react" />
2
- import { TabsValue } from '@mantine/core';
3
- import { LessonData } from "./Lesson/Lesson";
4
- import { LessonUserItem } from "./Lesson/LessonUserTable";
5
2
  import { LessonItem } from "./LessonTable";
6
3
  /**
7
- * LessonsData
4
+ * LessonsProps
8
5
  */
9
- export type LessonsData = {
6
+ export type LessonsProps = {
10
7
  loading: boolean;
11
- lessons: LessonItem[];
12
- lesson: LessonData | null;
13
- };
14
- /**
15
- * LessonsMethods
16
- */
17
- export type LessonsMethods = {
8
+ data: LessonItem[];
18
9
  onAutocompleteChange: (next: string) => void;
19
- onGroupChange: (next: string) => void;
20
- onLessonClick: (lesson: LessonItem) => void;
21
- onPreview: (id: string) => void;
22
- onTabChange: (tab: TabsValue) => void;
23
- onUserClick: (user: LessonUserItem) => void;
24
- onBackClick: () => void;
10
+ onLessonClick: (item: LessonItem) => void;
25
11
  };
26
- /**
27
- * LessonsProps
28
- */
29
- export type LessonsProps = LessonsData & LessonsMethods;
30
12
  /**
31
13
  * Lessons
32
14
  * @param props
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * AdminProviderProps
4
+ */
5
+ export interface AdminProviderProps {
6
+ notificationLimit?: number;
7
+ children: React.ReactNode;
8
+ }
9
+ /**
10
+ * AdminProvider
11
+ * @constructor
12
+ * @param props
13
+ */
14
+ export declare const AdminProvider: (props: AdminProviderProps) => JSX.Element;
@@ -0,0 +1,20 @@
1
+ import * as React from 'react';
2
+ import { AccountItem } from "./SwitchAccount/SwitchAccount";
3
+ import { NavbarProps } from "../../components/navigation/Navbar/Navbar";
4
+ /**
5
+ * AppProps
6
+ */
7
+ export type AppProps = {
8
+ loading: boolean;
9
+ account: string;
10
+ accounts: AccountItem[];
11
+ navbar: React.ReactElement<NavbarProps>;
12
+ page: React.ReactNode;
13
+ onAccountChange: (account: string) => void;
14
+ };
15
+ /**
16
+ * App
17
+ * @param props
18
+ * @constructor
19
+ */
20
+ export declare const App: (props: AppProps) => JSX.Element;
@@ -1,23 +1,21 @@
1
1
  /// <reference types="react" />
2
2
  /**
3
- * AccountData
3
+ * AccountItem
4
4
  */
5
- export interface AccountData {
6
- active: string;
7
- accounts: {
8
- key: string;
9
- name: string;
10
- }[];
11
- }
5
+ export type AccountItem = {
6
+ accountId: string;
7
+ name: string;
8
+ };
12
9
  /**
13
10
  * SwitchAccountProps
14
11
  */
15
- export interface SwitchAccountProps {
12
+ export type SwitchAccountProps = {
16
13
  opened: boolean;
17
- data: AccountData;
18
- onChange: (next: string) => void;
14
+ account: string;
15
+ accounts: AccountItem[];
16
+ onChange: (account: string) => void;
19
17
  onClose: () => void;
20
- }
18
+ };
21
19
  /**
22
20
  * SwitchAccount
23
21
  * @param props
@@ -1,15 +1,15 @@
1
1
  /// <reference types="react" />
2
- import { MgmtProps } from "./Mgmt";
2
+ import { AppProps } from "./App";
3
3
  import { Story } from "@storybook/react";
4
4
  /**
5
5
  * Storybook component configuration
6
6
  */
7
7
  declare const _default: {
8
8
  title: string;
9
- component: (props: MgmtProps) => JSX.Element;
9
+ component: (props: AppProps) => JSX.Element;
10
10
  };
11
11
  export default _default;
12
12
  /**
13
13
  * Component stories
14
14
  */
15
- export declare const Component: Story<MgmtProps>;
15
+ export declare const Component: Story<AppProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@local-civics/mgmt-ui",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.es.js",
6
6
  "scripts": {
@@ -1,25 +0,0 @@
1
- /// <reference types="react" />
2
- /**
3
- * BreakdownData
4
- */
5
- export interface BreakdownData {
6
- metric: string;
7
- users: {
8
- name: string;
9
- email: string;
10
- value: number;
11
- }[];
12
- }
13
- /**
14
- * BreakdownProps
15
- */
16
- export interface BreakdownProps {
17
- data: BreakdownData;
18
- onMetricChange: (next: string) => void;
19
- }
20
- /**
21
- * Breakdown
22
- * @param props
23
- * @constructor
24
- */
25
- export declare const Breakdown: (props: BreakdownProps) => JSX.Element;
@@ -1,40 +0,0 @@
1
- /// <reference types="react" />
2
- import { TabsValue } from '@mantine/core';
3
- import { DateRangePickerValue } from '@mantine/dates';
4
- import { BreakdownData } from "./Breakdown/Breakdown";
5
- import { OverviewData } from "./Overview/Overview";
6
- /**
7
- * DashboardData
8
- */
9
- export type DashboardData = {
10
- loading: boolean;
11
- dateRange: DateRangePickerValue;
12
- overview: OverviewData;
13
- breakdown: BreakdownData;
14
- group: string;
15
- groups: {
16
- name: string;
17
- active?: boolean;
18
- }[];
19
- tab: TabsValue;
20
- };
21
- /**
22
- * DashboardMethods
23
- */
24
- export type DashboardMethods = {
25
- onBreakdownMetricChange: (next: string) => void;
26
- onDateRangeChange: (next: DateRangePickerValue) => void;
27
- onGroupChange: (next: string) => void;
28
- onOverviewMetricChange: (next: string) => void;
29
- onTabChange: (next: TabsValue) => void;
30
- };
31
- /**
32
- * DashboardProps
33
- */
34
- export type DashboardProps = DashboardData & DashboardMethods;
35
- /**
36
- * Dashboard
37
- * @param props
38
- * @constructor
39
- */
40
- export declare const Dashboard: (props: DashboardProps) => JSX.Element;
@@ -1,40 +0,0 @@
1
- /// <reference types="react" />
2
- /**
3
- * OverviewData
4
- */
5
- export interface OverviewData {
6
- stats: {
7
- "PROBLEMS SOLVED": {
8
- value: number;
9
- diff: number;
10
- };
11
- "LESSONS COMPLETED": {
12
- value: number;
13
- diff: number;
14
- };
15
- "BADGES EARNED": {
16
- value: number;
17
- diff: number;
18
- };
19
- };
20
- areaChart: {
21
- metric: string;
22
- points: {
23
- name: string;
24
- value: number;
25
- }[];
26
- };
27
- }
28
- /**
29
- * OverviewProps
30
- */
31
- export interface OverviewProps {
32
- data: OverviewData;
33
- onMetricChange: (next: string) => void;
34
- }
35
- /**
36
- * Overview
37
- * @param props
38
- * @constructor
39
- */
40
- export declare const Overview: (props: OverviewProps) => JSX.Element;
@@ -1,69 +0,0 @@
1
- /// <reference types="react" />
2
- import { GroupUserItem } from "./GroupUserTable";
3
- /**
4
- * GroupData
5
- */
6
- export type GroupData = {
7
- id: string;
8
- loading: boolean;
9
- description: string;
10
- name: string;
11
- user: {
12
- avatar: string;
13
- givenName: string;
14
- familyName: string;
15
- email: string;
16
- job: string;
17
- quote: string;
18
- } | null;
19
- tenant: {
20
- name: string;
21
- description: string;
22
- image: string;
23
- website: string;
24
- };
25
- stats: {
26
- "PROBLEMS SOLVED": {
27
- value: number;
28
- diff: number;
29
- };
30
- "LESSONS COMPLETED": {
31
- value: number;
32
- diff: number;
33
- };
34
- "BADGES EARNED": {
35
- value: number;
36
- diff: number;
37
- };
38
- };
39
- timeline: {
40
- key: string;
41
- name: string;
42
- link?: string;
43
- description: string;
44
- time: string;
45
- }[];
46
- users: GroupUserItem[];
47
- };
48
- /**
49
- * GroupMethods
50
- */
51
- export type GroupMethods = {
52
- onBackClick: () => void;
53
- onCreateUsers: (users: GroupUserItem[]) => void;
54
- onDelete: (user: GroupUserItem) => void;
55
- onRoleChange: (user: GroupUserItem, role: string | null) => void;
56
- onViewProfile: (user: GroupUserItem) => void;
57
- onTimelineScrollBottom: () => void;
58
- onUserBackClick: () => void;
59
- };
60
- /**
61
- * GroupProps
62
- */
63
- export type GroupProps = GroupData & GroupMethods;
64
- /**
65
- * Group
66
- * @param props
67
- * @constructor
68
- */
69
- export declare const Group: (props: GroupProps) => JSX.Element;
@@ -1,30 +0,0 @@
1
- /// <reference types="react" />
2
- /**
3
- * GroupUserItem
4
- */
5
- export type GroupUserItem = {
6
- key: string;
7
- avatar: string;
8
- email: string;
9
- givenName: string;
10
- familyName: string;
11
- role: string;
12
- lastActivity: Date | null;
13
- readonly: boolean;
14
- };
15
- /**
16
- * GroupUserTableProps
17
- */
18
- export interface GroupUserTableProps {
19
- loading: boolean;
20
- data: GroupUserItem[];
21
- onChangeRole: (user: GroupUserItem, role: string | null) => void;
22
- onDelete: (user: GroupUserItem) => void;
23
- onViewProfile: (user: GroupUserItem) => void;
24
- }
25
- /**
26
- * GroupUserTable
27
- * @param props
28
- * @constructor
29
- */
30
- export declare function GroupUserTable(props: GroupUserTableProps): JSX.Element;
@@ -1,39 +0,0 @@
1
- /// <reference types="react" />
2
- import { TabsValue } from '@mantine/core';
3
- import { LessonUserItem } from "./LessonUserTable";
4
- /**
5
- * LessonData
6
- */
7
- export type LessonData = {
8
- loading: boolean;
9
- id: string;
10
- name: string;
11
- description: string;
12
- group: string;
13
- groups: {
14
- name: string;
15
- active?: boolean;
16
- }[];
17
- tab: TabsValue;
18
- users: LessonUserItem[];
19
- };
20
- /**
21
- * LessonMethods
22
- */
23
- export type LessonMethods = {
24
- onBackClick: () => void;
25
- onGroupChange: (value: string) => void;
26
- onPreview: (id: string) => void;
27
- onTabChange: (value: TabsValue) => void;
28
- onUserClick: (item: LessonUserItem) => void;
29
- };
30
- /**
31
- * LessonProps
32
- */
33
- export type LessonProps = LessonData & LessonMethods;
34
- /**
35
- * Lesson
36
- * @param props
37
- * @constructor
38
- */
39
- export declare const Lesson: (props: LessonProps) => JSX.Element;
@@ -1,24 +0,0 @@
1
- /// <reference types="react" />
2
- /**
3
- * LessonUserItem
4
- */
5
- export interface LessonUserItem {
6
- key: string;
7
- avatar: string;
8
- name: string;
9
- email: string;
10
- }
11
- /**
12
- * LessonUserTableProps
13
- */
14
- export interface LessonUserTableProps {
15
- loading: boolean;
16
- data: LessonUserItem[];
17
- onClick: (user: LessonUserItem) => void;
18
- }
19
- /**
20
- * LessonUserTable
21
- * @constructor
22
- * @param props
23
- */
24
- export declare function LessonUserTable(props: LessonUserTableProps): JSX.Element;
@@ -1,14 +0,0 @@
1
- import * as React from 'react';
2
- /**
3
- * MgmtProviderProps
4
- */
5
- export interface MgmtProviderProps {
6
- notificationLimit?: number;
7
- children?: React.ReactNode;
8
- }
9
- /**
10
- * MgmtProvider
11
- * @constructor
12
- * @param props
13
- */
14
- export declare const MgmtProvider: (props: MgmtProviderProps) => JSX.Element;
@@ -1,77 +0,0 @@
1
- /// <reference types="react" />
2
- import { TabsValue } from "@mantine/core";
3
- import { DateRangePickerValue } from "@mantine/dates";
4
- import { BadgeUserItem } from "../../pages/Badges/Badge/Table";
5
- import { BadgesData } from "../../pages/Badges/Badges";
6
- import { BadgeItem } from "../../pages/Badges/Table";
7
- import { GroupStackItem } from "../../pages/Groups/GroupsStack";
8
- import { LessonUserItem } from "../../pages/Lessons/Lesson/LessonUserTable";
9
- import { LessonsData } from "../../pages/Lessons/Lessons";
10
- import { LessonItem } from "../../pages/Lessons/LessonTable";
11
- import { AccountData } from "./SwitchAccount/SwitchAccount";
12
- import { GroupUserItem } from "../../pages/Groups/Group/GroupUserTable";
13
- import { GroupsData } from "../../pages/Groups/Groups";
14
- import { DashboardData } from "../../pages/Dashboard/Dashboard";
15
- import { HomeData } from "../../pages/Home/Home";
16
- /**
17
- * MgmtData
18
- */
19
- export type MgmtData = {
20
- loading: boolean;
21
- navbar: {
22
- active: string;
23
- };
24
- home: HomeData;
25
- dashboard: DashboardData;
26
- groups: GroupsData;
27
- account: AccountData;
28
- lessons: LessonsData;
29
- badges: BadgesData;
30
- };
31
- /**
32
- * MgmtMethods
33
- */
34
- export type MgmtMethods = {
35
- onAccountChange: (next: string) => void;
36
- onDashboardBreakdownMetricChange: (next: string) => void;
37
- onDashboardDateRangeChange: (next: DateRangePickerValue) => void;
38
- onDashboardGroupChange: (next: string) => void;
39
- onDashboardOverviewMetricChange: (next: string) => void;
40
- onDashboardTabChange: (next: TabsValue) => void;
41
- onHomeTimelineScrollBottom: () => void;
42
- onNavbarClick: (label: string) => void;
43
- onCreateGroup: (group: GroupStackItem) => void;
44
- onCreateGroupUsers: (users: GroupUserItem[]) => void;
45
- onDeleteGroup: (group: GroupStackItem) => void;
46
- onDeleteGroupUser: (user: GroupUserItem) => void;
47
- onEditGroup: (group: GroupStackItem) => void;
48
- onViewGroupUser: (user: GroupUserItem) => void;
49
- onGroupBackClick: () => void;
50
- onGroupUserRoleChange: (user: GroupUserItem, next: string | null) => void;
51
- onGroupUserBackClick: () => void;
52
- onLessonAutocompleteChange: (next: string) => void;
53
- onLessonGroupChange: (next: string) => void;
54
- onLessonClick: (lesson: LessonItem) => void;
55
- onLessonPreview: (id: string) => void;
56
- onLessonTabChange: (tab: TabsValue) => void;
57
- onLessonUserClick: (user: LessonUserItem) => void;
58
- onLessonBackClick: () => void;
59
- onGroupUserTimelineScrollBottom: () => void;
60
- onBadgeAutocompleteChange: (next: string) => void;
61
- onBadgePreview: (id: string) => void;
62
- onBadgeGroupChange: (next: string) => void;
63
- onBadgeClick: (badge: BadgeItem) => void;
64
- onBadgeTabChange: (tab: TabsValue) => void;
65
- onBadgeUserClick: (user: BadgeUserItem) => void;
66
- onBadgeBackClick: () => void;
67
- };
68
- /**
69
- * MgmtProps
70
- */
71
- export type MgmtProps = MgmtData & MgmtMethods;
72
- /**
73
- * Mgmt
74
- * @param props
75
- * @constructor
76
- */
77
- export declare const Mgmt: (props: MgmtProps) => JSX.Element;