@planningcenter/topbar 7.2.2-people.0 → 7.3.0-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 (122) hide show
  1. package/CHANGELOG.md +14 -2
  2. package/dist/modules/components/NotificationsMenuBlankState.d.ts +12 -7
  3. package/dist/modules/components/apps_menu.d.ts +2 -6
  4. package/dist/modules/components/conditional_wrap.d.ts +1 -1
  5. package/dist/modules/components/notification_item.d.ts +2 -1
  6. package/dist/modules/components/notifications_inbox.d.ts +18 -14
  7. package/dist/modules/components/notifications_menu.d.ts +2 -3
  8. package/dist/modules/components/notifications_menu_blank_state.d.ts +1 -1
  9. package/dist/modules/components/outsider.d.ts +1 -1
  10. package/dist/modules/dummy_data.d.ts +3 -3
  11. package/dist/modules/formatters.d.ts +1 -13
  12. package/dist/modules/hooks/use_local_storage.d.ts +10 -0
  13. package/dist/modules/hooks/use_notifications.d.ts +3 -1
  14. package/dist/modules/hooks/use_topbar_api.d.ts +8 -0
  15. package/dist/modules/topbar_context.d.ts +5 -0
  16. package/dist/topbar.js +1 -1
  17. package/dist/topbar.js.map +1 -1
  18. package/dist/topbar.modern.js +1 -1
  19. package/dist/topbar.modern.js.map +1 -1
  20. package/dist/topbar.module.js +1 -1
  21. package/dist/topbar.module.js.map +1 -1
  22. package/dist/topbar.umd.js +1 -1
  23. package/dist/topbar.umd.js.map +1 -1
  24. package/dist/types/index.d.ts +11 -0
  25. package/dist/types/index.d.ts.map +1 -0
  26. package/dist/types/modules/api_request.d.ts +24 -0
  27. package/dist/types/modules/api_request.d.ts.map +1 -0
  28. package/dist/types/modules/apps_provider.d.ts +13 -0
  29. package/dist/types/modules/apps_provider.d.ts.map +1 -0
  30. package/dist/types/modules/avatar.d.ts +8 -0
  31. package/dist/types/modules/avatar.d.ts.map +1 -0
  32. package/dist/types/modules/client_storage.d.ts +13 -0
  33. package/dist/types/modules/client_storage.d.ts.map +1 -0
  34. package/dist/types/modules/color_app_icon.d.ts +6 -0
  35. package/dist/types/modules/color_app_icon.d.ts.map +1 -0
  36. package/dist/types/modules/color_app_squircles.d.ts +15 -0
  37. package/dist/types/modules/color_app_squircles.d.ts.map +1 -0
  38. package/dist/types/modules/colors.d.ts +47 -0
  39. package/dist/types/modules/colors.d.ts.map +1 -0
  40. package/dist/types/modules/components/apps_button.d.ts +11 -0
  41. package/dist/types/modules/components/apps_button.d.ts.map +1 -0
  42. package/dist/types/modules/components/apps_menu.d.ts +12 -0
  43. package/dist/types/modules/components/apps_menu.d.ts.map +1 -0
  44. package/dist/types/modules/components/conditional_wrap.d.ts +8 -0
  45. package/dist/types/modules/components/conditional_wrap.d.ts.map +1 -0
  46. package/dist/types/modules/components/eyebrow.d.ts +7 -0
  47. package/dist/types/modules/components/eyebrow.d.ts.map +1 -0
  48. package/dist/types/modules/components/hoverable.d.ts +12 -0
  49. package/dist/types/modules/components/hoverable.d.ts.map +1 -0
  50. package/dist/types/modules/components/hoverable_list_item.d.ts +10 -0
  51. package/dist/types/modules/components/hoverable_list_item.d.ts.map +1 -0
  52. package/dist/types/modules/components/notification_bell.d.ts +7 -0
  53. package/dist/types/modules/components/notification_bell.d.ts.map +1 -0
  54. package/dist/types/modules/components/notification_item.d.ts +12 -0
  55. package/dist/types/modules/components/notification_item.d.ts.map +1 -0
  56. package/dist/types/modules/components/notifications_menu.d.ts +18 -0
  57. package/dist/types/modules/components/notifications_menu.d.ts.map +1 -0
  58. package/dist/types/modules/components/notifications_menu_blank_state.d.ts +9 -0
  59. package/dist/types/modules/components/notifications_menu_blank_state.d.ts.map +1 -0
  60. package/dist/types/modules/components/notifications_menu_wrapper.d.ts +8 -0
  61. package/dist/types/modules/components/notifications_menu_wrapper.d.ts.map +1 -0
  62. package/dist/types/modules/components/outsider.d.ts +14 -0
  63. package/dist/types/modules/components/outsider.d.ts.map +1 -0
  64. package/dist/types/modules/components/popover_root.d.ts +7 -0
  65. package/dist/types/modules/components/popover_root.d.ts.map +1 -0
  66. package/dist/types/modules/components/popup.d.ts +10 -0
  67. package/dist/types/modules/components/popup.d.ts.map +1 -0
  68. package/dist/types/modules/components/popup_root.d.ts +7 -0
  69. package/dist/types/modules/components/popup_root.d.ts.map +1 -0
  70. package/dist/types/modules/components/spinner.d.ts +5 -0
  71. package/dist/types/modules/components/spinner.d.ts.map +1 -0
  72. package/dist/types/modules/connected_people_provider.d.ts +22 -0
  73. package/dist/types/modules/connected_people_provider.d.ts.map +1 -0
  74. package/dist/types/modules/display_switch.d.ts +27 -0
  75. package/dist/types/modules/display_switch.d.ts.map +1 -0
  76. package/dist/types/modules/formatters.d.ts +4 -0
  77. package/dist/types/modules/formatters.d.ts.map +1 -0
  78. package/dist/types/modules/get_apps_switch_product_path.d.ts +2 -0
  79. package/dist/types/modules/get_apps_switch_product_path.d.ts.map +1 -0
  80. package/dist/types/modules/hooks/use_hover.d.ts +4 -0
  81. package/dist/types/modules/hooks/use_hover.d.ts.map +1 -0
  82. package/dist/types/modules/hooks/use_local_storage.d.ts +8 -0
  83. package/dist/types/modules/hooks/use_local_storage.d.ts.map +1 -0
  84. package/dist/types/modules/hooks/use_notifications.d.ts +17 -0
  85. package/dist/types/modules/hooks/use_notifications.d.ts.map +1 -0
  86. package/dist/types/modules/hooks/use_topbar_api.d.ts +9 -0
  87. package/dist/types/modules/hooks/use_topbar_api.d.ts.map +1 -0
  88. package/dist/types/modules/interfaces.d.ts +55 -0
  89. package/dist/types/modules/interfaces.d.ts.map +1 -0
  90. package/dist/types/modules/medium_topbar.d.ts +39 -0
  91. package/dist/types/modules/medium_topbar.d.ts.map +1 -0
  92. package/dist/types/modules/mono_app_icon.d.ts +8 -0
  93. package/dist/types/modules/mono_app_icon.d.ts.map +1 -0
  94. package/dist/types/modules/mono_app_name.d.ts +7 -0
  95. package/dist/types/modules/mono_app_name.d.ts.map +1 -0
  96. package/dist/types/modules/mono_app_symbols.d.ts +44 -0
  97. package/dist/types/modules/mono_app_symbols.d.ts.map +1 -0
  98. package/dist/types/modules/mono_app_text.d.ts +54 -0
  99. package/dist/types/modules/mono_app_text.d.ts.map +1 -0
  100. package/dist/types/modules/not_small_topbar.d.ts +45 -0
  101. package/dist/types/modules/not_small_topbar.d.ts.map +1 -0
  102. package/dist/types/modules/platform_announcements.d.ts +32 -0
  103. package/dist/types/modules/platform_announcements.d.ts.map +1 -0
  104. package/dist/types/modules/product_announcement.d.ts +20 -0
  105. package/dist/types/modules/product_announcement.d.ts.map +1 -0
  106. package/dist/types/modules/profile_container.d.ts +10 -0
  107. package/dist/types/modules/profile_container.d.ts.map +1 -0
  108. package/dist/types/modules/small_topbar.d.ts +42 -0
  109. package/dist/types/modules/small_topbar.d.ts.map +1 -0
  110. package/dist/types/modules/styled_root.d.ts +7 -0
  111. package/dist/types/modules/styled_root.d.ts.map +1 -0
  112. package/dist/types/modules/styles.d.ts +10 -0
  113. package/dist/types/modules/styles.d.ts.map +1 -0
  114. package/dist/types/modules/symbols.d.ts +33 -0
  115. package/dist/types/modules/symbols.d.ts.map +1 -0
  116. package/dist/types/modules/topbar_context.d.ts +6 -0
  117. package/dist/types/modules/topbar_context.d.ts.map +1 -0
  118. package/dist/types/modules/unbutton.d.ts +12 -0
  119. package/dist/types/modules/unbutton.d.ts.map +1 -0
  120. package/dist/types/modules/utils.d.ts +2 -0
  121. package/dist/types/modules/utils.d.ts.map +1 -0
  122. package/package.json +29 -21
package/CHANGELOG.md CHANGED
@@ -1,8 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased notifications]
9
+
10
+ ### Added
11
+ - Notification bell, indicator, and dropdown that displayes the current user's read and unread notifications. On initial load, a GET request is sent to the notifications API and its response is used to populate the unread indicator. To use dummy data instead, you can pass `useDummyNotifications={true}` when calling any `Topbar` component.
12
+ - Subscribe to push notifications via Jolt after initial load. This is a naive implementation in that whenever a push event is received, a fresh GET request is sent to the notifications API endpoint to retrieve the current state of ALL of the user's notifications.
13
+ - Set a baseline prettier config
14
+
3
15
  ## [7.2.1] - 2021-12-09
4
16
 
5
- ### FIxed
17
+ ### Fixed
6
18
  - Bug z-stacking Safari bug that caused expanded `smalltopbar` items to show up behind elements [#46](https://github.com/ministrycentered/topbar/pull/46)
7
19
  - Bug causing user settings to be hidden on mobile when Home wasn't enabled for the user [#47](https://github.com/ministrycentered/topbar/pull/47)
8
20
 
@@ -32,7 +44,6 @@
32
44
  ### Added
33
45
  - Add Home to the app switcher dropdown
34
46
 
35
-
36
47
  ## [7.0.0] - 2021-10-01
37
48
 
38
49
  - Add CSRF support to login ([#46](https://github.com/planningcenter/design/pull/46) @danielma)
@@ -83,6 +94,7 @@ Versions entries to this changelog weren't tracked very well and were presented
83
94
 
84
95
 
85
96
 
97
+ [Unreleased notifications]: https://github.com/ministrycentered/topbar/compare/@planningcenter/topbar@7.2.1..notifications
86
98
  [7.2.1]: https://github.com/ministrycentered/topbar/compare/v7.2.0..v7.2.1
87
99
  [7.2.0]: https://github.com/ministrycentered/topbar/compare/v7.1.3..v7.2.0
88
100
  [7.1.3]: https://github.com/ministrycentered/topbar/compare/v7.1.2..v7.1.3
@@ -1,7 +1,12 @@
1
- /// <reference types="react" />
2
- declare const NotificationsMenuBlankState: ({ description, style, title, ...props }: {
3
- description: string;
4
- style?: object;
5
- title?: string;
6
- }) => JSX.Element;
7
- export default NotificationsMenuBlankState;
1
+ /// <reference types="react" />
2
+ declare const NotificationsMenuBlankState: ({
3
+ description,
4
+ style,
5
+ title,
6
+ ...props
7
+ }: {
8
+ description: string
9
+ style?: object
10
+ title?: string
11
+ }) => JSX.Element
12
+ export default NotificationsMenuBlankState
@@ -1,13 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import * as PCO_URL from "@planningcenter/url";
3
+ import { App } from "../interfaces";
3
4
  declare const AppsMenu: ({ appName, apps, env, toggle, visible, }: {
4
5
  appName: string;
5
- apps: {
6
- attributes: {
7
- name: string;
8
- url: string;
9
- };
10
- }[];
6
+ apps: App[];
11
7
  env: PCO_URL.Environment;
12
8
  toggle: any;
13
9
  visible: boolean;
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- declare const ConditionalWrap: ({ children, condition, wrap, ...props }: {
2
+ declare const ConditionalWrap: ({ children, condition, wrap, }: {
3
3
  children: React.ReactNode;
4
4
  condition?: boolean;
5
5
  wrap: any;
@@ -1,8 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { Notification } from "../interfaces";
3
- declare const NotificationItem: ({ mobile, isLast, onToggleRead, showBottomBorder, notification: { appName, createdAt, isRead, link, title }, }: {
3
+ declare const NotificationItem: ({ mobile, isLast, onMarkAsRead, onToggleRead, showBottomBorder, notification, }: {
4
4
  mobile?: boolean;
5
5
  isLast?: boolean;
6
+ onMarkAsRead?: (notification: Notification) => any;
6
7
  onToggleRead: any;
7
8
  showBottomBorder?: boolean;
8
9
  notification: Notification;
@@ -1,14 +1,18 @@
1
- /// <reference types="react" />
2
- import * as PCO_URL from "@planningcenter/url";
3
- import { Notification } from "../interfaces";
4
- declare const NotificationsInbox: ({ env, render, userId, }: {
5
- env: PCO_URL.Environment;
6
- render: (props: {
7
- handleMarkAllAsRead: () => any;
8
- handleToggleRead: (notification: Notification) => any;
9
- read: Notification[];
10
- unread: Notification[];
11
- }) => JSX.Element;
12
- userId: string;
13
- }) => JSX.Element;
14
- export default NotificationsInbox;
1
+ /// <reference types="react" />
2
+ import * as PCO_URL from "@planningcenter/url"
3
+ import { Notification } from "../interfaces"
4
+ declare const NotificationsInbox: ({
5
+ env,
6
+ render,
7
+ userId,
8
+ }: {
9
+ env: PCO_URL.Environment
10
+ render: (props: {
11
+ handleMarkAllAsRead: () => any
12
+ handleToggleRead: (notification: Notification) => any
13
+ read: Notification[]
14
+ unread: Notification[]
15
+ }) => JSX.Element
16
+ userId: string
17
+ }) => JSX.Element
18
+ export default NotificationsInbox
@@ -1,9 +1,8 @@
1
1
  /// <reference types="react" />
2
- import * as PCO_URL from "@planningcenter/url";
3
2
  import { Notification } from "../interfaces";
4
- declare const NotificationsMenu: ({ env, handleMarkAllAsRead, handleToggleRead, hasError, isLoading, mobile, notifications: { read, unread }, toggle, visible, }: {
5
- env: PCO_URL.Environment;
3
+ declare const NotificationsMenu: ({ handleMarkAllAsRead, handleMarkAsRead, handleToggleRead, hasError, isLoading, mobile, notifications: { read, unread }, toggle, visible, }: {
6
4
  handleMarkAllAsRead: () => any;
5
+ handleMarkAsRead: (notification: Notification) => any;
7
6
  handleToggleRead: (notification: Notification) => any;
8
7
  hasError?: boolean;
9
8
  isLoading?: boolean;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- declare const NotificationsMenuBlankState: ({ dark, description, style, title, ...props }: {
2
+ declare const NotificationsMenuBlankState: ({ dark, description, style, title, }: {
3
3
  dark?: boolean;
4
4
  description: string;
5
5
  style?: object;
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  export default class Outsider extends React.Component<{
3
- component: any;
4
3
  cleanup: boolean;
4
+ component: any;
5
5
  onOutsideClick: any;
6
6
  visible: boolean;
7
7
  }, {}> {
@@ -1,3 +1,3 @@
1
- import { Notification } from "./interfaces";
2
- export declare const DUMMY_DATA_UNREAD: Notification[];
3
- export declare const DUMMY_DATA_READ: Notification[];
1
+ import { Notification } from "./interfaces"
2
+ export declare const DUMMY_DATA_UNREAD: Notification[]
3
+ export declare const DUMMY_DATA_READ: Notification[]
@@ -1,15 +1,3 @@
1
- export interface App {
2
- attributes: {
3
- name: string;
4
- url: string;
5
- };
6
- }
7
- export interface ConnectedPerson {
8
- id: number;
9
- attributes: {
10
- name: string;
11
- organization_name: string;
12
- };
13
- }
1
+ import { App, ConnectedPerson } from "./interfaces";
14
2
  export declare const appsMenuFormatter: (apps: App[]) => App[];
15
3
  export declare const connectedPeopleMenuFormatter: (connectedPeople: ConnectedPerson[]) => ConnectedPerson[];
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ declare function useLocalStorage(
3
+ key: string,
4
+ initialValue: any
5
+ ): {
6
+ storedValue: any
7
+ setStoredValue: import("react").Dispatch<any>
8
+ dropKey: () => void
9
+ }
10
+ export default useLocalStorage
@@ -1,10 +1,12 @@
1
1
  import * as PCO_URL from "@planningcenter/url";
2
2
  import { Notification } from "../interfaces";
3
- declare const useNotifications: ({ env, userId, }: {
3
+ declare const useNotifications: ({ disabled, env, userId, }: {
4
+ disabled?: boolean;
4
5
  env: PCO_URL.Environment;
5
6
  userId: string;
6
7
  }) => {
7
8
  handleMarkAllAsRead: () => any;
9
+ handleMarkAsRead: (notification: Notification) => any;
8
10
  handleToggleRead: (notification: Notification) => any;
9
11
  hasError: boolean;
10
12
  isLoading: boolean;
@@ -0,0 +1,8 @@
1
+ import * as PCO_URL from "@planningcenter/url";
2
+ import { Fetch } from "../api_request";
3
+ import { TopbarAPIResponse } from "../interfaces";
4
+ declare const useTopbarAPI: ({ configuredFetch, env, }: {
5
+ configuredFetch: Fetch;
6
+ env: PCO_URL.Environment;
7
+ }) => TopbarAPIResponse;
8
+ export default useTopbarAPI;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ declare const _default: import("react").Context<{
3
+ notificationsDisabled: boolean;
4
+ }>;
5
+ export default _default;