@planningcenter/topbar 8.2.0-rc.2 → 8.2.1-alpha.0

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/README.md +4 -2
  2. package/dist/modules/apps_provider.d.ts +1 -1
  3. package/dist/modules/client_storage.d.ts +1 -1
  4. package/dist/modules/color_app_squircles.d.ts +1 -0
  5. package/dist/modules/colors.d.ts +46 -0
  6. package/dist/modules/components/conditional_wrap.d.ts +7 -0
  7. package/dist/modules/components/notification_item.d.ts +5 -1
  8. package/dist/modules/components/notifications_menu.d.ts +11 -3
  9. package/dist/modules/components/notifications_menu_blank_state.d.ts +8 -0
  10. package/dist/modules/components/notifications_menu_wrapper.d.ts +7 -0
  11. package/dist/modules/components/popover_root.d.ts +6 -0
  12. package/dist/modules/components/spinner.d.ts +4 -0
  13. package/dist/modules/connected_people_provider.d.ts +1 -1
  14. package/dist/modules/display_switch.d.ts +1 -1
  15. package/dist/modules/hooks/use_hover.d.ts +3 -0
  16. package/dist/modules/hooks/use_notifications.d.ts +15 -0
  17. package/dist/modules/medium_topbar.d.ts +34 -38
  18. package/dist/modules/mono_app_symbols.d.ts +4 -0
  19. package/dist/modules/mono_app_text.d.ts +5 -0
  20. package/dist/modules/not_small_topbar.d.ts +38 -61
  21. package/dist/modules/small_topbar.d.ts +39 -42
  22. package/dist/modules/symbols.d.ts +19 -0
  23. package/dist/topbar.js +1 -1
  24. package/dist/topbar.js.map +1 -1
  25. package/dist/topbar.modern.css +2 -0
  26. package/dist/topbar.modern.css.map +1 -0
  27. package/dist/topbar.modern.js +1 -1
  28. package/dist/topbar.modern.js.map +1 -1
  29. package/dist/topbar.module.css +2 -0
  30. package/dist/topbar.module.css.map +1 -0
  31. package/dist/topbar.module.js +1 -1
  32. package/dist/topbar.module.js.map +1 -1
  33. package/dist/topbar.umd.js +1 -1
  34. package/dist/topbar.umd.js.map +1 -1
  35. package/dist/{modules → types/modules}/dummy_data.d.ts +1 -0
  36. package/dist/types/modules/dummy_data.d.ts.map +1 -0
  37. package/dist/types/modules/hooks/use_local_notifications.d.ts +9 -0
  38. package/dist/types/modules/hooks/use_local_notifications.d.ts.map +1 -0
  39. package/dist/types/modules/hooks/use_notifications.d.ts.map +1 -1
  40. package/dist/types/modules/medium_topbar.d.ts +39 -0
  41. package/dist/types/modules/medium_topbar.d.ts.map +1 -0
  42. package/dist/types/modules/profile_container.d.ts +10 -0
  43. package/dist/types/modules/profile_container.d.ts.map +1 -0
  44. package/dist/types/modules/small_topbar.d.ts.map +1 -1
  45. package/package.json +2 -2
  46. package/CHANGELOG.md +0 -157
package/README.md CHANGED
@@ -34,8 +34,10 @@ If a Jolt connection is not shared with topbar, it will gladly initiate its own
34
34
  To reuse your app's Jolt connection, topbar requires a Promise that resolves into a [Jolt client](https://github.com/ministrycentered/jolt-client/) connection.
35
35
  If nothing is passed—or if a Promise is passed that resolves to `undefined` or `void`—topbar will initiate its own connection.
36
36
 
37
- Topbar hooks into `pco-page-expired` and will `disconnect` either its internal, or passed in jolt instance when the session is invalidated (i.e. logged out in a different tab).
38
- CSRF tokens are invalidated when the session is invalidated, and non-GET APIv2 requests (i.e. auth/subscribe) require a valid CSRF token and will never succeed in that state.
37
+ Topbar hooks into `pco-page-expired` and will `disconnect` when the session is invalidated (i.e. logged out in a different tab).
38
+ This occurs for `topbar`-created jolt instances as well as jolt instances provided to `topbar` via the `joltPromise` prop.
39
+ CSRF tokens are invalidated when the session is invalidated.
40
+ Non-GET APIv2 requests (i.e. auth/subscribe) require a valid CSRF token and will never succeed in that state.
39
41
 
40
42
  #### Example
41
43
 
@@ -17,7 +17,7 @@ export declare class AppsProvider extends React.Component<{
17
17
  fetch(): void;
18
18
  remove(): void;
19
19
  componentDidMount(): void;
20
- render(): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
20
+ render(): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>;
21
21
  }
22
22
  interface App {
23
23
  attributes: {
@@ -8,5 +8,5 @@ export declare class ClientStorage extends React.Component<{
8
8
  method: string;
9
9
  };
10
10
  update(value: any): void;
11
- render(): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
11
+ render(): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>;
12
12
  }
@@ -6,6 +6,7 @@ export declare function CheckIns(): JSX.Element[];
6
6
  export declare function ChurchCenter(): JSX.Element[];
7
7
  export declare function Giving(): JSX.Element[];
8
8
  export declare function Groups(): JSX.Element[];
9
+ export declare function Home(): JSX.Element[];
9
10
  export declare function People(): JSX.Element[];
10
11
  export declare function Publishing(): JSX.Element[];
11
12
  export declare function Registrations(): JSX.Element[];
@@ -0,0 +1,46 @@
1
+ declare const colors: {
2
+ danger43: string;
3
+ danger45: string;
4
+ danger47: string;
5
+ danger93: string;
6
+ danger97: string;
7
+ darkNeutral07: string;
8
+ darkNeutral12: string;
9
+ darkNeutral15: string;
10
+ darkNeutral17: string;
11
+ darkNeutral19: string;
12
+ darkNeutral24: string;
13
+ darkNeutral32: string;
14
+ darkNeutral50: string;
15
+ darkNeutral68: string;
16
+ darkNeutral88: string;
17
+ darkNeutral98: string;
18
+ interaction45: string;
19
+ interaction50: string;
20
+ interaction55: string;
21
+ interaction66: string;
22
+ interaction91: string;
23
+ interaction93: string;
24
+ lightNeutral100: string;
25
+ lightNeutral12: string;
26
+ lightNeutral24: string;
27
+ lightNeutral45: string;
28
+ lightNeutral62: string;
29
+ lightNeutral81: string;
30
+ lightNeutral88: string;
31
+ lightNeutral93: string;
32
+ lightNeutral95: string;
33
+ lightNeutral97: string;
34
+ lightNeutral98: string;
35
+ success23: string;
36
+ success25: string;
37
+ success27: string;
38
+ success91: string;
39
+ success97: string;
40
+ warning49: string;
41
+ warning55: string;
42
+ warning63: string;
43
+ warning94: string;
44
+ warning97: string;
45
+ };
46
+ export default colors;
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ declare const ConditionalWrap: ({ children, condition, wrap, ...props }: {
3
+ children: React.ReactNode;
4
+ condition?: boolean;
5
+ wrap: any;
6
+ }) => any;
7
+ export default ConditionalWrap;
@@ -1,7 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import { Notification } from "../interfaces";
3
- declare const NotificationItem: ({ isLast, notification: { appName, createdAt, isRead, link, title }, }: {
3
+ declare const NotificationItem: ({ mobile, isLast, onMarkAsRead, onToggleRead, showBottomBorder, notification, }: {
4
+ mobile?: boolean;
4
5
  isLast?: boolean;
6
+ onMarkAsRead?: (notification: Notification) => any;
7
+ onToggleRead: any;
8
+ showBottomBorder?: boolean;
5
9
  notification: Notification;
6
10
  }) => JSX.Element;
7
11
  export default NotificationItem;
@@ -1,11 +1,19 @@
1
1
  /// <reference types="react" />
2
+ import * as PCO_URL from "@planningcenter/url";
2
3
  import { Notification } from "../interfaces";
3
- declare const NotificationsMenu: ({ notifications: { read, unread }, toggle, visible, }: {
4
+ declare const NotificationsMenu: ({ env, handleMarkAllAsRead, handleMarkAsRead, handleToggleRead, hasError, isLoading, mobile, notifications: { read, unread }, toggle, visible, }: {
5
+ env: PCO_URL.Environment;
6
+ handleMarkAllAsRead: () => any;
7
+ handleMarkAsRead: (notification: Notification) => any;
8
+ handleToggleRead: (notification: Notification) => any;
9
+ hasError?: boolean;
10
+ isLoading?: boolean;
11
+ mobile?: boolean;
4
12
  notifications: {
5
13
  read: Notification[];
6
14
  unread: Notification[];
7
15
  };
8
- toggle: any;
9
- visible: boolean;
16
+ toggle?: any;
17
+ visible?: boolean;
10
18
  }) => JSX.Element;
11
19
  export default NotificationsMenu;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ declare const NotificationsMenuBlankState: ({ dark, description, style, title, ...props }: {
3
+ dark?: boolean;
4
+ description: string;
5
+ style?: object;
6
+ title?: string;
7
+ }) => JSX.Element;
8
+ export default NotificationsMenuBlankState;
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ declare const NotificationsMenuWrapper: ({ children, toggle, visible, ...nativeProps }: {
3
+ children: React.ReactNode;
4
+ toggle: any;
5
+ visible: boolean;
6
+ }) => JSX.Element;
7
+ export default NotificationsMenuWrapper;
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ declare const PopupRoot: ({ style, ...nativeProps }: {
3
+ children?: React.ReactNode;
4
+ style?: object;
5
+ }) => JSX.Element;
6
+ export default PopupRoot;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import "./spinner.css";
3
+ declare const Spinner: (props: any) => JSX.Element;
4
+ export default Spinner;
@@ -17,5 +17,5 @@ export declare class ConnectedPeopleProvider extends React.Component<{
17
17
  unlink(): void;
18
18
  switch(toId: string, returnPath: string): void;
19
19
  componentDidMount(): void;
20
- render(): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
20
+ render(): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>;
21
21
  }
@@ -9,7 +9,7 @@ export declare class PointBreak extends React.Component<{
9
9
  componentDidMount(): void;
10
10
  componentWillUnmount(): void;
11
11
  breakpointString(width: any): "xs" | "sm" | "md" | "lg" | "xl";
12
- render(): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
12
+ render(): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>;
13
13
  }
14
14
  export declare class DisplaySwitch extends React.Component<{
15
15
  smallBreakpoints: String[];
@@ -0,0 +1,3 @@
1
+ import { RefObject } from "react";
2
+ declare function useHover<T extends HTMLElement = HTMLElement>(elementRef: RefObject<T>): boolean;
3
+ export default useHover;
@@ -0,0 +1,15 @@
1
+ import * as PCO_URL from "@planningcenter/url";
2
+ import { Notification } from "../interfaces";
3
+ declare const useNotifications: ({ env, userId, }: {
4
+ env: PCO_URL.Environment;
5
+ userId: string;
6
+ }) => {
7
+ handleMarkAllAsRead: () => any;
8
+ handleMarkAsRead: (notification: Notification) => any;
9
+ handleToggleRead: (notification: Notification) => any;
10
+ hasError: boolean;
11
+ isLoading: boolean;
12
+ read: Notification[];
13
+ unread: Notification[];
14
+ };
15
+ export default useNotifications;
@@ -1,46 +1,42 @@
1
- import * as React from "react";
1
+ /// <reference types="react" />
2
2
  import * as PCO_URL from "@planningcenter/url";
3
- export declare class Topbar extends React.Component<{
4
- apps: {
5
- attributes: {
6
- name: string;
7
- url: string;
8
- };
9
- }[];
10
- env: PCO_URL.Environment;
11
- appName: string;
12
- routes: any;
13
- colors: any;
14
- userAvatarPath: string;
15
- userId: string;
16
- userName: string;
17
- orgName: string;
18
- connectedPeople: any;
19
- search?: any;
20
- style?: any;
21
- showOrgName?: boolean;
22
- notifications?: any;
23
- requestAppsFetch: any;
24
- requestConnectedPeopleFetch: any;
25
- requestUnlinkConnectedPeople: any;
26
- requestSwitchConnectedPerson: any;
27
- requestClearAppsCache: any;
28
- requestClearConnectedPeopleCache: any;
29
- linkToProfile?: boolean;
30
- }, {
31
- appsMenuVisible: boolean;
32
- routesMenuVisible: boolean;
33
- userMenuVisible: boolean;
34
- }> {
35
- constructor(props: any);
36
- static defaultProps: {
3
+ declare const Topbar: {
4
+ (props: {
5
+ apps: {
6
+ attributes: {
7
+ name: string;
8
+ url: string;
9
+ };
10
+ }[];
11
+ env: PCO_URL.Environment;
12
+ appName: string;
13
+ routes: any;
14
+ colors: any;
15
+ userAvatarPath: string;
16
+ userId: string;
17
+ userName: string;
18
+ orgName: string;
19
+ connectedPeople: any;
20
+ search?: any;
21
+ style?: any;
22
+ showOrgName?: boolean;
23
+ notifications?: any;
24
+ requestAppsFetch: any;
25
+ requestConnectedPeopleFetch: any;
26
+ requestUnlinkConnectedPeople: any;
27
+ requestSwitchConnectedPerson: any;
28
+ requestClearAppsCache: any;
29
+ requestClearConnectedPeopleCache: any;
30
+ linkToProfile?: boolean;
31
+ }): JSX.Element;
32
+ defaultProps: {
37
33
  currentRouteComponent: (props: any) => JSX.Element;
38
34
  };
39
- render(): JSX.Element;
40
- }
41
- export declare const Route: ({ active, style, name, ...props }: {
35
+ };
36
+ declare const Route: ({ active, style, name, ...props }: {
42
37
  [x: string]: any;
43
38
  active: any;
44
39
  style: any;
45
40
  name?: string;
46
41
  }) => JSX.Element;
42
+ export { Route, Topbar };
@@ -31,6 +31,10 @@ export declare function Groups({ color, ...platformProps }: {
31
31
  [x: string]: any;
32
32
  color: any;
33
33
  }): JSX.Element;
34
+ export declare function Home({ color, ...platformProps }: {
35
+ [x: string]: any;
36
+ color: any;
37
+ }): JSX.Element;
34
38
  export declare function People({ color, ...platformProps }: {
35
39
  [x: string]: any;
36
40
  color: any;
@@ -29,6 +29,11 @@ export declare function Giving({ color, size, ...platformProps }: {
29
29
  color: any;
30
30
  size?: number;
31
31
  }): JSX.Element;
32
+ export declare function Home({ color, size, ...platformProps }: {
33
+ [x: string]: any;
34
+ color: any;
35
+ size?: number;
36
+ }): JSX.Element;
32
37
  export declare function Groups({ color, size, ...platformProps }: {
33
38
  [x: string]: any;
34
39
  color: any;
@@ -1,71 +1,48 @@
1
1
  import * as React from "react";
2
2
  import * as PCO_URL from "@planningcenter/url";
3
- import { Notification } from "./interfaces";
4
- export declare class Topbar extends React.Component<{
5
- apps: {
6
- attributes: {
7
- name: string;
8
- url: string;
9
- };
10
- }[];
11
- activeRoute: string;
12
- env: PCO_URL.Environment;
13
- appName: string;
14
- routes: any;
15
- colors: any;
16
- userAvatarPath: string;
17
- userId: string;
18
- userName: string;
19
- orgName: string;
20
- connectedPeople: any;
21
- search?: any;
22
- style?: any;
23
- showOrgName?: boolean;
24
- requestAppsFetch: any;
25
- requestConnectedPeopleFetch: any;
26
- requestUnlinkConnectedPeople: any;
27
- requestSwitchConnectedPerson: any;
28
- requestClearAppsCache: any;
29
- requestClearConnectedPeopleCache: any;
30
- useDummyNotifications?: boolean;
31
- linkToProfile?: boolean;
32
- }, {
33
- appsMenuVisible: boolean;
34
- notificationsMenuVisible: boolean;
35
- routesVisible: boolean;
36
- userMenuVisible: boolean;
37
- notifications: {
38
- unread: Notification[];
39
- read: Notification[];
40
- };
41
- }> {
42
- static defaultProps: {
3
+ declare const Topbar: {
4
+ (props: {
5
+ apps: {
6
+ attributes: {
7
+ name: string;
8
+ url: string;
9
+ };
10
+ }[];
11
+ activeRoute: string;
12
+ env: PCO_URL.Environment;
13
+ appName: string;
14
+ routes: any;
15
+ colors: any;
16
+ userAvatarPath: string;
17
+ userId: string;
18
+ userName: string;
19
+ orgName: string;
20
+ connectedPeople: any;
21
+ search?: any;
22
+ style?: any;
23
+ showOrgName?: boolean;
24
+ requestAppsFetch: any;
25
+ requestConnectedPeopleFetch: any;
26
+ requestUnlinkConnectedPeople: any;
27
+ requestSwitchConnectedPerson: any;
28
+ requestClearAppsCache: any;
29
+ requestClearConnectedPeopleCache: any;
30
+ useDummyNotifications?: boolean;
31
+ linkToProfile?: boolean;
32
+ onLinkToProfileClick?: () => any;
33
+ }): JSX.Element;
34
+ defaultProps: {
43
35
  search: () => any;
44
36
  linkToProfile: boolean;
45
37
  showOrgName: boolean;
46
38
  useDummyNotifications: boolean;
47
39
  };
48
- constructor(props: any);
49
- hideRoutes(): void;
50
- showRoutes(): void;
51
- getTextColor(): any;
52
- findInIncluded({ type, id }: {
53
- type: any;
54
- id: any;
55
- }, included: any): any;
56
- subscribeToJoltChannel(): void;
57
- componentDidMount(): void;
58
- render(): JSX.Element;
59
- }
60
- export declare class Route extends React.Component<{
40
+ };
41
+ declare const Route: ({ active, colors, style, ...nativeProps }: {
61
42
  active: boolean;
43
+ children: React.ReactNode;
62
44
  colors: any;
63
- style?: object;
64
45
  href?: string;
65
- }, {
66
- entered: boolean;
67
- down: boolean;
68
- }> {
69
- constructor(props: any);
70
- render(): JSX.Element;
71
- }
46
+ style?: object;
47
+ }) => JSX.Element;
48
+ export { Topbar, Route };
@@ -1,48 +1,45 @@
1
- import * as React from "react";
1
+ /// <reference types="react" />
2
2
  import * as PCO_URL from "@planningcenter/url";
3
- export declare class Topbar extends React.Component<{
4
- apps: {
5
- attributes: {
6
- name: string;
7
- url: string;
8
- };
9
- }[];
10
- env: PCO_URL.Environment;
11
- appName: string;
12
- routes: any;
13
- colors: any;
14
- userAvatarPath: string;
15
- userId: string;
16
- userName: string;
17
- orgName: string;
18
- connectedPeople: {
19
- id: number;
20
- attributes: {
21
- name: string;
22
- organization_name: string;
23
- };
24
- }[];
25
- style?: any;
26
- currentRouteComponent?: any;
27
- requestAppsFetch: any;
28
- requestConnectedPeopleFetch: any;
29
- requestUnlinkConnectedPeople: any;
30
- requestSwitchConnectedPerson: any;
31
- requestClearAppsCache: any;
32
- requestClearConnectedPeopleCache: any;
33
- notifications?: any;
34
- }, {
35
- routesMenuVisible: boolean;
36
- userMenuVisible: boolean;
37
- }> {
38
- constructor(props: any);
39
- static defaultProps: {
3
+ declare const Topbar: {
4
+ (props: {
5
+ apps: {
6
+ attributes: {
7
+ name: string;
8
+ url: string;
9
+ };
10
+ }[];
11
+ env: PCO_URL.Environment;
12
+ appName: string;
13
+ routes: any;
14
+ colors: any;
15
+ userAvatarPath: string;
16
+ userId: string;
17
+ userName: string;
18
+ orgName: string;
19
+ connectedPeople: {
20
+ id: number;
21
+ attributes: {
22
+ name: string;
23
+ organization_name: string;
24
+ };
25
+ }[];
26
+ style?: any;
27
+ currentRouteComponent?: any;
28
+ requestAppsFetch: any;
29
+ requestConnectedPeopleFetch: any;
30
+ requestUnlinkConnectedPeople: any;
31
+ requestSwitchConnectedPerson: any;
32
+ requestClearAppsCache: any;
33
+ requestClearConnectedPeopleCache: any;
34
+ useDummyNotifications?: boolean;
35
+ notifications?: any;
36
+ }): JSX.Element;
37
+ defaultProps: {
40
38
  currentRouteComponent: (props: any) => JSX.Element;
41
39
  };
42
- componentDidUpdate(): "" | "hidden";
43
- render(): JSX.Element;
44
- }
45
- export declare const Route: ({ active, ...props }: {
40
+ };
41
+ declare const Route: ({ active, ...props }: {
46
42
  [x: string]: any;
47
43
  active: any;
48
44
  }) => JSX.Element;
45
+ export { Route, Topbar };
@@ -5,6 +5,20 @@ export declare const Bell: ({ dot, dotFill, fill, style, ...props }: {
5
5
  fill?: string;
6
6
  style?: object;
7
7
  }) => JSX.Element;
8
+ export declare const BlankStateIcon: ({ dark, style, ...nativeProps }: {
9
+ dark?: boolean;
10
+ style?: object;
11
+ }) => JSX.Element;
12
+ export declare const ChevronIcon: ({ fill, size, style, ...nativeProps }: {
13
+ fill?: string;
14
+ size?: number;
15
+ style?: object;
16
+ }) => JSX.Element;
17
+ export declare const Cog: ({ fill, size, style, ...nativeProps }: {
18
+ fill?: string;
19
+ size?: number;
20
+ style?: object;
21
+ }) => JSX.Element;
8
22
  export declare const DisclosureChevronIcon: ({ colors, style, ...nativeProps }: {
9
23
  colors: any;
10
24
  style?: object;
@@ -13,6 +27,11 @@ export declare const HelpIcon: ({ colors, style, ...nativeProps }: {
13
27
  colors: any;
14
28
  style?: object;
15
29
  }) => JSX.Element;
30
+ export declare const ExclamationTriangle: ({ fill, size, style, ...nativeProps }: {
31
+ fill?: string;
32
+ size: number;
33
+ style?: object;
34
+ }) => JSX.Element;
16
35
  export declare const Spyglass: ({ fill, style, ...nativeProps }: {
17
36
  fill?: string;
18
37
  style?: object;