@notificationapi/react 1.6.2 → 1.8.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 (57) hide show
  1. package/dist/assets/Badge.js +4 -3
  2. package/dist/assets/Box.js +26 -24
  3. package/dist/assets/Button.js +20 -18
  4. package/dist/assets/ButtonBase.js +193 -185
  5. package/dist/assets/DefaultPropsProvider.js +416 -4199
  6. package/dist/assets/DefaultPropsProvider2.js +992 -0
  7. package/dist/assets/Divider.js +2 -1
  8. package/dist/assets/GlobalStyles.js +23 -0
  9. package/dist/assets/Grow.js +87 -92
  10. package/dist/assets/IconButton.js +8 -7
  11. package/dist/assets/List.js +12 -11
  12. package/dist/assets/Modal.js +18 -17
  13. package/dist/assets/Notification.js +787 -770
  14. package/dist/assets/Paper.js +6 -6
  15. package/dist/assets/Popover.js +38 -37
  16. package/dist/assets/Portal.js +38 -48
  17. package/dist/assets/Stack.js +32 -30
  18. package/dist/assets/Typography.js +84 -97
  19. package/dist/assets/createSvgIcon.js +25 -24
  20. package/dist/assets/createTheme.js +2828 -0
  21. package/dist/assets/dividerClasses.js +16 -15
  22. package/dist/assets/exactProp.js +13 -0
  23. package/dist/assets/index.js +19 -148
  24. package/dist/assets/index2.js +151 -0
  25. package/dist/assets/useTheme.js +6 -7
  26. package/dist/assets/{useTheme2.js → useThemeWithoutDefault.js} +63 -67
  27. package/dist/assets/utils.js +2 -2
  28. package/dist/components/Notifications/DefaultEmpty.d.ts +0 -1
  29. package/dist/components/Notifications/Inbox.d.ts +0 -1
  30. package/dist/components/Notifications/Inbox.js +592 -582
  31. package/dist/components/Notifications/InboxHeader.js +31 -30
  32. package/dist/components/Notifications/Notification.d.ts +0 -1
  33. package/dist/components/Notifications/Notification.js +4 -2
  34. package/dist/components/Notifications/NotificationCounter.d.ts +0 -1
  35. package/dist/components/Notifications/NotificationFeed.d.ts +0 -1
  36. package/dist/components/Notifications/NotificationFeed.js +40 -32
  37. package/dist/components/Notifications/NotificationLauncher.d.ts +0 -1
  38. package/dist/components/Notifications/NotificationLauncher.js +90 -64
  39. package/dist/components/Notifications/NotificationPopup.d.ts +0 -1
  40. package/dist/components/Notifications/NotificationPopup.js +76 -65
  41. package/dist/components/Notifications/UnreadBadge.d.ts +0 -1
  42. package/dist/components/Preferences/NotificationPreferencesInline.js +57 -39
  43. package/dist/components/Preferences/NotificationPreferencesPopup.js +111 -99
  44. package/dist/components/Preferences/PreferenceInput.d.ts +0 -1
  45. package/dist/components/Preferences/PreferenceInput.js +427 -414
  46. package/dist/components/Preferences/Preferences.js +329 -278
  47. package/dist/components/Preferences/channelUtils.d.ts +0 -1
  48. package/dist/components/Provider/context.d.ts +0 -1
  49. package/dist/components/Provider/index.d.ts +4 -2
  50. package/dist/components/Provider/index.js +986 -375
  51. package/dist/components/Slack/SlackConnect.js +8 -7
  52. package/dist/components/WebPush/WebPushOptInMessage.d.ts +0 -1
  53. package/dist/main.d.ts +2 -1
  54. package/dist/main.js +6 -3
  55. package/dist/utils/theme.d.ts +17 -0
  56. package/dist/utils/theme.js +104 -0
  57. package/package.json +7 -3
@@ -1,4 +1,3 @@
1
1
  import { Channels } from '../Notifications/interface';
2
-
3
2
  export declare const getChannelLabel: (c: Channels) => string;
4
3
  export declare const getChannelIcon: (channel: Channels) => React.ReactElement;
@@ -1,6 +1,5 @@
1
1
  import { NotificationAPIClientSDK } from '@notificationapi/core';
2
2
  import { BaseDeliveryOptions, Channels, DeliveryOptionsForEmail, DeliveryOptionsForInappWeb, GetPreferencesResponse, InAppNotification, UserAccountMetadata } from '@notificationapi/core/dist/interfaces';
3
-
4
3
  export type Context = {
5
4
  notifications?: InAppNotification[];
6
5
  preferences?: GetPreferencesResponse;
@@ -1,8 +1,8 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  import { NotificationAPIClientSDK } from '@notificationapi/core';
3
- import { User, API_REGION, WS_REGION } from '@notificationapi/core/dist/interfaces';
3
+ import { InAppNotification, User, API_REGION, WS_REGION } from '@notificationapi/core/dist/interfaces';
4
4
  import { Context } from './context';
5
-
5
+ import { NotificationAPITheme } from '../../utils/theme';
6
6
  type Props = ({
7
7
  userId: string;
8
8
  } | {
@@ -20,6 +20,8 @@ type Props = ({
20
20
  webPushOptInMessage?: 'AUTOMATIC' | boolean;
21
21
  customServiceWorkerPath?: string;
22
22
  debug?: boolean;
23
+ onNewNotifications?: (notifications: InAppNotification[]) => void;
24
+ theme?: NotificationAPITheme;
23
25
  };
24
26
  export declare const NotificationAPIProvider: React.FunctionComponent<PropsWithChildren<Props>> & {
25
27
  useNotificationAPIContext: typeof useNotificationAPIContext;