@genesislcap/foundation-notifications 14.50.2-alpha-f13a8e3.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 (135) hide show
  1. package/README.md +66 -0
  2. package/dist/dts/banner/banner-builder.d.ts +35 -0
  3. package/dist/dts/banner/banner-builder.d.ts.map +1 -0
  4. package/dist/dts/banner/banner-launcher.d.ts +11 -0
  5. package/dist/dts/banner/banner-launcher.d.ts.map +1 -0
  6. package/dist/dts/banner/index.d.ts +3 -0
  7. package/dist/dts/banner/index.d.ts.map +1 -0
  8. package/dist/dts/dialog/dialog-builder.d.ts +35 -0
  9. package/dist/dts/dialog/dialog-builder.d.ts.map +1 -0
  10. package/dist/dts/dialog/dialog-launcher.d.ts +10 -0
  11. package/dist/dts/dialog/dialog-launcher.d.ts.map +1 -0
  12. package/dist/dts/dialog/index.d.ts +3 -0
  13. package/dist/dts/dialog/index.d.ts.map +1 -0
  14. package/dist/dts/index.d.ts +9 -0
  15. package/dist/dts/index.d.ts.map +1 -0
  16. package/dist/dts/index.federated.d.ts +1 -0
  17. package/dist/dts/index.federated.d.ts.map +1 -0
  18. package/dist/dts/logger.d.ts +2 -0
  19. package/dist/dts/logger.d.ts.map +1 -0
  20. package/dist/dts/notification-builder.d.ts +83 -0
  21. package/dist/dts/notification-builder.d.ts.map +1 -0
  22. package/dist/dts/notification-launcher.d.ts +11 -0
  23. package/dist/dts/notification-launcher.d.ts.map +1 -0
  24. package/dist/dts/notification-util.d.ts +32 -0
  25. package/dist/dts/notification-util.d.ts.map +1 -0
  26. package/dist/dts/snackbar/index.d.ts +3 -0
  27. package/dist/dts/snackbar/index.d.ts.map +1 -0
  28. package/dist/dts/snackbar/snackbar-builder.d.ts +34 -0
  29. package/dist/dts/snackbar/snackbar-builder.d.ts.map +1 -0
  30. package/dist/dts/snackbar/snackbar-launcher.d.ts +10 -0
  31. package/dist/dts/snackbar/snackbar-launcher.d.ts.map +1 -0
  32. package/dist/dts/toast/index.d.ts +3 -0
  33. package/dist/dts/toast/index.d.ts.map +1 -0
  34. package/dist/dts/toast/toast-builder.d.ts +49 -0
  35. package/dist/dts/toast/toast-builder.d.ts.map +1 -0
  36. package/dist/dts/toast/toast-launcher.d.ts +10 -0
  37. package/dist/dts/toast/toast-launcher.d.ts.map +1 -0
  38. package/dist/dts/tsdoc-metadata.json +11 -0
  39. package/dist/dts/types.d.ts +106 -0
  40. package/dist/dts/types.d.ts.map +1 -0
  41. package/dist/esm/banner/banner-builder.js +49 -0
  42. package/dist/esm/banner/banner-launcher.js +23 -0
  43. package/dist/esm/banner/index.js +2 -0
  44. package/dist/esm/dialog/dialog-builder.js +49 -0
  45. package/dist/esm/dialog/dialog-launcher.js +16 -0
  46. package/dist/esm/dialog/index.js +2 -0
  47. package/dist/esm/index.federated.js +1 -0
  48. package/dist/esm/index.js +8 -0
  49. package/dist/esm/logger.js +2 -0
  50. package/dist/esm/notification-builder.js +133 -0
  51. package/dist/esm/notification-launcher.js +36 -0
  52. package/dist/esm/notification-util.js +67 -0
  53. package/dist/esm/snackbar/index.js +2 -0
  54. package/dist/esm/snackbar/snackbar-builder.js +48 -0
  55. package/dist/esm/snackbar/snackbar-launcher.js +15 -0
  56. package/dist/esm/toast/index.js +2 -0
  57. package/dist/esm/toast/toast-builder.js +70 -0
  58. package/dist/esm/toast/toast-launcher.js +54 -0
  59. package/dist/esm/types.js +8 -0
  60. package/dist/foundation-notifications.api.json +2531 -0
  61. package/dist/foundation-notifications.d.ts +435 -0
  62. package/docs/.gitattributes +2 -0
  63. package/docs/api/foundation-notifications.banner.confirmingactions.md +11 -0
  64. package/docs/api/foundation-notifications.banner.dismissingaction.md +11 -0
  65. package/docs/api/foundation-notifications.banner.md +21 -0
  66. package/docs/api/foundation-notifications.bannerbuilder.build.md +19 -0
  67. package/docs/api/foundation-notifications.bannerbuilder.md +22 -0
  68. package/docs/api/foundation-notifications.bannerbuilder.withconfirmingaction.md +25 -0
  69. package/docs/api/foundation-notifications.bannerbuilder.withdismissingaction.md +25 -0
  70. package/docs/api/foundation-notifications.confirmingaction.action.md +11 -0
  71. package/docs/api/foundation-notifications.confirmingaction.label.md +11 -0
  72. package/docs/api/foundation-notifications.confirmingaction.md +21 -0
  73. package/docs/api/foundation-notifications.dialog.confirmingactions.md +11 -0
  74. package/docs/api/foundation-notifications.dialog.dismissingaction.md +11 -0
  75. package/docs/api/foundation-notifications.dialog.md +21 -0
  76. package/docs/api/foundation-notifications.dialogbuilder.build.md +19 -0
  77. package/docs/api/foundation-notifications.dialogbuilder.md +22 -0
  78. package/docs/api/foundation-notifications.dialogbuilder.withconfirmingaction.md +25 -0
  79. package/docs/api/foundation-notifications.dialogbuilder.withdismissingaction.md +25 -0
  80. package/docs/api/foundation-notifications.dismissingaction.action.md +11 -0
  81. package/docs/api/foundation-notifications.dismissingaction.label.md +11 -0
  82. package/docs/api/foundation-notifications.dismissingaction.md +21 -0
  83. package/docs/api/foundation-notifications.getbanneranchor.md +13 -0
  84. package/docs/api/foundation-notifications.getbannerbuilder.md +13 -0
  85. package/docs/api/foundation-notifications.getdialogbuilder.md +13 -0
  86. package/docs/api/foundation-notifications.getloglevel.md +13 -0
  87. package/docs/api/foundation-notifications.getnotificationbuilder.md +13 -0
  88. package/docs/api/foundation-notifications.getnotificationcontainer.md +13 -0
  89. package/docs/api/foundation-notifications.getnotificationdetails.md +13 -0
  90. package/docs/api/foundation-notifications.getsnackbarbuilder.md +13 -0
  91. package/docs/api/foundation-notifications.gettoastbuilder.md +13 -0
  92. package/docs/api/foundation-notifications.md +58 -0
  93. package/docs/api/foundation-notifications.notificationbuilder.build.md +18 -0
  94. package/docs/api/foundation-notifications.notificationbuilder.md +28 -0
  95. package/docs/api/foundation-notifications.notificationbuilder.withalert.md +25 -0
  96. package/docs/api/foundation-notifications.notificationbuilder.withbanner.md +25 -0
  97. package/docs/api/foundation-notifications.notificationbuilder.withbody.md +25 -0
  98. package/docs/api/foundation-notifications.notificationbuilder.withdialog.md +25 -0
  99. package/docs/api/foundation-notifications.notificationbuilder.withloglevel.md +25 -0
  100. package/docs/api/foundation-notifications.notificationbuilder.withsnackbar.md +25 -0
  101. package/docs/api/foundation-notifications.notificationbuilder.withtitle.md +25 -0
  102. package/docs/api/foundation-notifications.notificationbuilder.withtoast.md +25 -0
  103. package/docs/api/foundation-notifications.notificationevent.md +20 -0
  104. package/docs/api/foundation-notifications.notificationstructure.body.md +11 -0
  105. package/docs/api/foundation-notifications.notificationstructure.config.md +18 -0
  106. package/docs/api/foundation-notifications.notificationstructure.loglevel.md +11 -0
  107. package/docs/api/foundation-notifications.notificationstructure.md +23 -0
  108. package/docs/api/foundation-notifications.notificationstructure.title.md +11 -0
  109. package/docs/api/foundation-notifications.notificationtype.md +13 -0
  110. package/docs/api/foundation-notifications.showbanner.md +13 -0
  111. package/docs/api/foundation-notifications.shownotification.md +13 -0
  112. package/docs/api/foundation-notifications.snackbar.confirmingactions.md +11 -0
  113. package/docs/api/foundation-notifications.snackbar.md +21 -0
  114. package/docs/api/foundation-notifications.snackbar.type.md +11 -0
  115. package/docs/api/foundation-notifications.snackbarbuilder.build.md +19 -0
  116. package/docs/api/foundation-notifications.snackbarbuilder.md +22 -0
  117. package/docs/api/foundation-notifications.snackbarbuilder.withconfirmingaction.md +25 -0
  118. package/docs/api/foundation-notifications.snackbarbuilder.withtype.md +23 -0
  119. package/docs/api/foundation-notifications.snackbartype.md +13 -0
  120. package/docs/api/foundation-notifications.toast.autoclose.md +11 -0
  121. package/docs/api/foundation-notifications.toast.closetimeout.md +11 -0
  122. package/docs/api/foundation-notifications.toast.md +23 -0
  123. package/docs/api/foundation-notifications.toast.position.md +11 -0
  124. package/docs/api/foundation-notifications.toast.type.md +11 -0
  125. package/docs/api/foundation-notifications.toastbuilder.build.md +19 -0
  126. package/docs/api/foundation-notifications.toastbuilder.md +23 -0
  127. package/docs/api/foundation-notifications.toastbuilder.withautoclose.md +25 -0
  128. package/docs/api/foundation-notifications.toastbuilder.withclosetimeout.md +25 -0
  129. package/docs/api/foundation-notifications.toastbuilder.withposition.md +25 -0
  130. package/docs/api/foundation-notifications.toastbuilder.withtype.md +25 -0
  131. package/docs/api/foundation-notifications.toastposition.md +13 -0
  132. package/docs/api/index.md +12 -0
  133. package/docs/api-report.md +203 -0
  134. package/license.txt +46 -0
  135. package/package.json +57 -0
package/README.md ADDED
@@ -0,0 +1,66 @@
1
+ # Genesis Foundation UI Notifications
2
+
3
+ [![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)
4
+ [![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](https://www.typescriptlang.org/)
5
+
6
+ ### [API Docs](./docs/api/index.md)
7
+
8
+ ### Usage
9
+
10
+ * The App need to create notification-listener at top of the component tree.
11
+
12
+ * Any child under notification-listener component can dispatch custom NotificationEvent event
13
+
14
+ * The custom event is handled by notification-listener component and based on event payload
15
+ it displays notification component according to payload
16
+
17
+ ### Current Implementation support following Notification Components
18
+
19
+ * Alert
20
+ * Toast
21
+ * Banner
22
+ * Snack bar
23
+ * Dialog
24
+
25
+ ## Set-up
26
+
27
+ ### Basic install
28
+
29
+ To enable this module in your application, follow the steps below.
30
+
31
+ 1. Add `@genesislcap/foundation-notifications` as a dependency in your **package.json** file. Whenever you change the dependencies of your project, ensure you run the `$ npm run bootstrap` command again. You can find more information in the [package.json basics](https://learn.genesis.global/secure/web/basics/package-json-basics/) page.
32
+
33
+ ```javascript
34
+ {
35
+ ...
36
+ "dependencies": {
37
+ "@genesislcap/foundation-notifications": "latest"
38
+ },
39
+ ...
40
+ }
41
+ ```
42
+ ### Creating and dispatching Notification Events
43
+
44
+ Creating and dispatching Notification event with payload to show in Toast component
45
+
46
+ ```javascript
47
+ $emit(
48
+ NotificationEvent.NOTIFICATION_EVENT,
49
+ getToastBuilder()
50
+ .withTitle('Important message')
51
+ .withBody('Lorem ipsum')
52
+ .withToast(
53
+ getToastBuilder()
54
+ .withType('warning')
55
+ .withAutoClose(true)
56
+ .withCloseTimeout(notificationCloseTimeout)
57
+ .build()
58
+ )
59
+ .build())
60
+ ```
61
+ ## License
62
+
63
+ Note: this project provides front end dependencies and uses licensed components listed in the next section, thus licenses for those components are required during development. Contact [Genesis Global](https://genesis.global/contact-us/) for more details.
64
+
65
+ ### Licensed components
66
+ Genesis low-code platform
@@ -0,0 +1,35 @@
1
+ import { Banner, DismissingAction, ConfirmingAction } from '../types';
2
+ /**
3
+ * BannerBuilder
4
+ * @public
5
+ */
6
+ export declare class BannerBuilder {
7
+ private dismissingAction;
8
+ private confirmingActions;
9
+ /**
10
+ * Add dismissing action to Banner
11
+ * @public
12
+ * @param dismissingAction - {@link DismissingAction}
13
+ * @returns
14
+ */
15
+ withDismissingAction(dismissingAction: DismissingAction): BannerBuilder;
16
+ /**
17
+ * Add confirming action to Banner
18
+ * @public
19
+ * @param confirmingAction - {@link ConfirmingAction}
20
+ * @returns
21
+ */
22
+ withConfirmingAction(confirmingAction: ConfirmingAction): BannerBuilder;
23
+ /**
24
+ * Build Banner
25
+ * @public
26
+ * @returns Banner
27
+ */
28
+ build(): Banner;
29
+ }
30
+ /**
31
+ * Get banner builder instance
32
+ * @public
33
+ */
34
+ export declare const getBannerBuilder: () => BannerBuilder;
35
+ //# sourceMappingURL=banner-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"banner-builder.d.ts","sourceRoot":"","sources":["../../../src/banner/banner-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEtE;;;GAGG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,iBAAiB,CAA0B;IAEnD;;;;;OAKG;IACI,oBAAoB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,aAAa;IAK9E;;;;;OAKG;IACI,oBAAoB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,aAAa;IAQ9E;;;;OAIG;IACI,KAAK,IAAI,MAAM;CAYvB;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,QAAO,aAAoC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { NotificationStructure } from '../types';
2
+ /**
3
+ * Shows the notificationStructure dialog
4
+ * @public
5
+ * @param notificationStructure - The NotificationStructure object
6
+ * @param tagName - The tag name to create prefix for the design system provider & notificationStructure component
7
+ * @param notificationBoundary - target listener for the notification
8
+ * @returns
9
+ * */
10
+ export declare const showBanner: (notificationStructure: NotificationStructure, tagName: String, notificationBoundary: HTMLElement) => void;
11
+ //# sourceMappingURL=banner-launcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"banner-launcher.d.ts","sourceRoot":"","sources":["../../../src/banner/banner-launcher.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAiB,MAAM,UAAU,CAAC;AAEhE;;;;;;;KAOK;AACL,eAAO,MAAM,UAAU,0BACE,qBAAqB,WACnC,MAAM,wBACO,WAAW,KAChC,IAaF,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './banner-builder';
2
+ export * from './banner-launcher';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/banner/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { Dialog, DismissingAction, ConfirmingAction } from '../types';
2
+ /**
3
+ * DialogBuilder class
4
+ * @public
5
+ */
6
+ export declare class DialogBuilder {
7
+ private dismissingAction;
8
+ private confirmingActions;
9
+ /**
10
+ * Add dismissing action to Dialog
11
+ * @public
12
+ * @param dismissingAction - {@link DismissingAction}
13
+ * @returns
14
+ */
15
+ withDismissingAction(dismissingAction: DismissingAction): DialogBuilder;
16
+ /**
17
+ * Add confirming action to Dialog
18
+ * @public
19
+ * @param confirmingAction - {@link ConfirmingAction}
20
+ * @returns
21
+ */
22
+ withConfirmingAction(confirmingAction: ConfirmingAction): DialogBuilder;
23
+ /**
24
+ * Build Dialog
25
+ * @public
26
+ * @returns Dialog
27
+ */
28
+ build(): Dialog;
29
+ }
30
+ /**
31
+ * Returns an instance of DialogBuilder
32
+ * @public
33
+ */
34
+ export declare const getDialogBuilder: () => DialogBuilder;
35
+ //# sourceMappingURL=dialog-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog-builder.d.ts","sourceRoot":"","sources":["../../../src/dialog/dialog-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEtE;;;GAGG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,iBAAiB,CAA0B;IAEnD;;;;;OAKG;IACI,oBAAoB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,aAAa;IAK9E;;;;;OAKG;IACI,oBAAoB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,aAAa;IAQ9E;;;;OAIG;IACI,KAAK,IAAI,MAAM;CAUvB;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,QAAO,aAAoC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { NotificationStructure } from '../types';
2
+ /**
3
+ * Shows the dialog
4
+ * @internal
5
+ * @param notification - The NotificationStructure object
6
+ * @param tagName - The tag name to create prefix for the design system provider & notification component
7
+ * @returns
8
+ * */
9
+ export declare const showDialog: (notification: NotificationStructure, tagName: String) => void;
10
+ //# sourceMappingURL=dialog-launcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog-launcher.d.ts","sourceRoot":"","sources":["../../../src/dialog/dialog-launcher.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAiB,MAAM,UAAU,CAAC;AAEhE;;;;;;KAMK;AACL,eAAO,MAAM,UAAU,iBAAkB,qBAAqB,WAAW,MAAM,KAAG,IAOjF,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './dialog-builder';
2
+ export * from './dialog-launcher';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dialog/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,9 @@
1
+ export * from './types';
2
+ export * from './notification-builder';
3
+ export * from './toast';
4
+ export * from './banner';
5
+ export * from './dialog';
6
+ export * from './snackbar';
7
+ export * from './notification-util';
8
+ export * from './notification-launcher';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=index.federated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.federated.d.ts","sourceRoot":"","sources":["../../src/index.federated.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export declare const logger: import("@genesislcap/foundation-utils").Logger;
2
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,gDAA2C,CAAC"}
@@ -0,0 +1,83 @@
1
+ import { LogLevel } from '@genesislcap/foundation-utils';
2
+ import { NotificationStructure, Banner, Dialog, Toast, Snackbar } from './types';
3
+ /**
4
+ * NotificationBuilder to build NotificationStructure
5
+ * @public
6
+ */
7
+ export declare class NotificationBuilder {
8
+ private title;
9
+ private body;
10
+ private logLevel;
11
+ private alert;
12
+ private toast;
13
+ private banner;
14
+ private snackbar;
15
+ private dialog;
16
+ /**
17
+ * Add title to notification
18
+ * @public
19
+ * @param title - string
20
+ * @returns
21
+ */
22
+ withTitle(title: string): NotificationBuilder;
23
+ /**
24
+ * Add body details to notification
25
+ * @public
26
+ * @param body - string
27
+ * @returns
28
+ */
29
+ withBody(body: string): NotificationBuilder;
30
+ /**
31
+ * Add log level to notification
32
+ * @public
33
+ * @returns
34
+ */
35
+ withLogLevel(logLevel: LogLevel): NotificationBuilder;
36
+ /**
37
+ * Add alert to notification
38
+ * @public
39
+ * @param alert - boolean
40
+ * @returns
41
+ */
42
+ withAlert(alert: boolean): NotificationBuilder;
43
+ /**
44
+ * Add toast to notification
45
+ * @public
46
+ * @param notification - {@link Toast}
47
+ * @returns
48
+ */
49
+ withToast(toast: Toast): NotificationBuilder;
50
+ /**
51
+ * Add banner to notification
52
+ * @public
53
+ * @param banner - {@link Banner}
54
+ * @returns
55
+ */
56
+ withBanner(banner: Banner): NotificationBuilder;
57
+ /**
58
+ * Add snackbar to notification
59
+ * @public
60
+ * @param snackbar - {@link Snackbar}
61
+ * @returns
62
+ */
63
+ withSnackbar(snackbar: Snackbar): NotificationBuilder;
64
+ /**
65
+ * Add dialog to notification
66
+ * @public
67
+ * @param dialog - {@link Dialog}
68
+ * @returns
69
+ */
70
+ withDialog(dialog: Dialog): NotificationBuilder;
71
+ /**
72
+ * Build NotificationStructure
73
+ * @public
74
+ * @returns
75
+ */
76
+ build(): NotificationStructure;
77
+ }
78
+ /**
79
+ * Returns a new NotificationBuilder instance
80
+ * @public
81
+ */
82
+ export declare const getNotificationBuilder: () => NotificationBuilder;
83
+ //# sourceMappingURL=notification-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-builder.d.ts","sourceRoot":"","sources":["../../src/notification-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEjF;;;GAGG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,KAAK,CAAU;IACvB,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,MAAM,CAAS;IAEvB;;;;;OAKG;IACI,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,mBAAmB;IAKpD;;;;;OAKG;IACI,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB;IAKlD;;;;OAIG;IACI,YAAY,CAAC,QAAQ,EAAE,QAAQ,GAAG,mBAAmB;IAK5D;;;;;OAKG;IACI,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,mBAAmB;IAKrD;;;;;OAKG;IACI,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,mBAAmB;IAKnD;;;;;OAKG;IACI,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,mBAAmB;IAKtD;;;;;OAKG;IACI,YAAY,CAAC,QAAQ,EAAE,QAAQ,GAAG,mBAAmB;IAK5D;;;;;OAKG;IACI,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,mBAAmB;IAKtD;;;;OAIG;IACI,KAAK,IAAI,qBAAqB;CA8CtC;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,QAAO,mBAAgD,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { NotificationStructure } from './types';
2
+ /**
3
+ * Shows the notificationStructure in the appropriate component
4
+ * @public
5
+ * @param notificationStructure - The NotificationStructure object
6
+ * @param tagName - The tag name to create prefix for the design system provider *
7
+ * @param notificationBoundary - The notificationStructure boundary element
8
+ * @returns
9
+ * */
10
+ export declare const showNotification: (notificationStructure: NotificationStructure, tagName: String, notificationBoundary?: HTMLElement) => void;
11
+ //# sourceMappingURL=notification-launcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-launcher.d.ts","sourceRoot":"","sources":["../../src/notification-launcher.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAchD;;;;;;;KAOK;AACL,eAAO,MAAM,gBAAgB,0BACJ,qBAAqB,WACnC,MAAM,yBACQ,WAAW,KACjC,IAWF,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { LogLevel } from '@genesislcap/foundation-utils';
2
+ import { NotificationStructure } from './types';
3
+ /**
4
+ * Retrieves the notification details from an NotificationStructure object
5
+ * @public
6
+ * @param details - The NotificationStructure object
7
+ * @returns The title and body concatenated as a string, or default values ('Error: Something went wrong') if not present
8
+ */
9
+ export declare const getNotificationDetails: (details: NotificationStructure) => string;
10
+ /**
11
+ * Retrieves the log level from an NotificationStructure object
12
+ * @public
13
+ * @param details - The NotificationStructure object
14
+ * @returns The log level or the default value (LogLevel.Debug) if not present
15
+ */
16
+ export declare const getLoglevel: (details: NotificationStructure) => LogLevel;
17
+ /**
18
+ * Get/Create the error container in the DOM
19
+ * @public
20
+ * @param id - The id of the container
21
+ * @param tagName - The tag name to create prefix for the design system provider
22
+ * @returns
23
+ */
24
+ export declare const getNotificationContainer: (id: string, tagName: String) => HTMLElement;
25
+ /**
26
+ * Get the banner anchor to attach the banner to
27
+ * @public
28
+ * @param element - The element to start searching from
29
+ * @returns
30
+ */
31
+ export declare const getBannerAnchor: (element: any) => HTMLElement | null;
32
+ //# sourceMappingURL=notification-util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-util.d.ts","sourceRoot":"","sources":["../../src/notification-util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEhD;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,YAAa,qBAAqB,KAAG,MAIvE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,WAAW,YAAa,qBAAqB,KAAG,QAE5D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,OAAQ,MAAM,WAAW,MAAM,KAAG,WAatE,CAAC;AAEF;;;;;GAKG;AAEH,eAAO,MAAM,eAAe,YAAa,GAAG,KAAG,WAAW,GAAG,IAU5D,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './snackbar-builder';
2
+ export * from './snackbar-launcher';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/snackbar/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { Snackbar, ConfirmingAction, SnackbarType } from '../types';
2
+ /**
3
+ * SnackbarBuilder to build Snackbar
4
+ * @public
5
+ */
6
+ export declare class SnackbarBuilder {
7
+ private confirmingActions;
8
+ private type;
9
+ /**
10
+ * @public
11
+ * @param type - {@link SnackbarType}
12
+ * @returns
13
+ */
14
+ withType(type: SnackbarType): SnackbarBuilder;
15
+ /**
16
+ * Add confirming action to snackbar
17
+ * @public
18
+ * @param confirmingAction - {@link ConfirmingAction}
19
+ * @returns
20
+ */
21
+ withConfirmingAction(confirmingAction: ConfirmingAction): SnackbarBuilder;
22
+ /**
23
+ * Build snackbar
24
+ * @public
25
+ * @returns Snackbar
26
+ */
27
+ build(): Snackbar;
28
+ }
29
+ /**
30
+ * Get snackbar builder instance
31
+ * @public
32
+ */
33
+ export declare const getSnackbarBuilder: () => SnackbarBuilder;
34
+ //# sourceMappingURL=snackbar-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snackbar-builder.d.ts","sourceRoot":"","sources":["../../../src/snackbar/snackbar-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEpE;;;GAGG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,iBAAiB,CAA0B;IACnD,OAAO,CAAC,IAAI,CAAe;IAE3B;;;;OAIG;IACI,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,eAAe;IAKpD;;;;;OAKG;IACI,oBAAoB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,eAAe;IAQhF;;;;OAIG;IACI,KAAK,IAAI,QAAQ;CAUzB;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAAO,eAAwC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { NotificationStructure } from '../types';
2
+ /**
3
+ * Shows the snackbar
4
+ * @internal
5
+ * @param notification - The NotificationStructure object
6
+ * @param tagName - The tag name to create prefix for the design system provider & notification component
7
+ * @returns
8
+ * */
9
+ export declare const showSnackbar: (notification: NotificationStructure, tagName: String) => void;
10
+ //# sourceMappingURL=snackbar-launcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snackbar-launcher.d.ts","sourceRoot":"","sources":["../../../src/snackbar/snackbar-launcher.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAuB,MAAM,UAAU,CAAC;AAEtE;;;;;;KAMK;AACL,eAAO,MAAM,YAAY,iBAAkB,qBAAqB,WAAW,MAAM,KAAG,IAMnF,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './toast-builder';
2
+ export * from './toast-launcher';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/toast/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,49 @@
1
+ import { Toast, ToastPosition, NotificationType } from '../types';
2
+ /**
3
+ * @public
4
+ */
5
+ export declare class ToastBuilder {
6
+ private position;
7
+ private autoClose;
8
+ private closeTimeout;
9
+ private type;
10
+ /**
11
+ * Add position to toast
12
+ * @public
13
+ * @param position - {@link ToastPosition}
14
+ * @returns
15
+ */
16
+ withPosition(position: ToastPosition): ToastBuilder;
17
+ /**
18
+ * Add auto close to notification
19
+ * @public
20
+ * @param autoClose - boolean
21
+ * @returns
22
+ */
23
+ withAutoClose(autoClose: boolean): ToastBuilder;
24
+ /**
25
+ * Add close timeout to notification
26
+ * @public
27
+ * @param closeTimeout - number
28
+ * @returns
29
+ */
30
+ withCloseTimeout(closeTimeout: number): ToastBuilder;
31
+ /**
32
+ * Add type to notification, if the type is anything other than 'warning' or 'success' do not add it
33
+ * @public
34
+ * @param type - {@link NotificationType}
35
+ * @returns
36
+ */
37
+ withType(type: NotificationType): ToastBuilder;
38
+ /**
39
+ * Build notification
40
+ * @returns Toast
41
+ */
42
+ build(): Toast;
43
+ }
44
+ /**
45
+ * Get notification builder instance
46
+ * @public
47
+ */
48
+ export declare const getToastBuilder: () => ToastBuilder;
49
+ //# sourceMappingURL=toast-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toast-builder.d.ts","sourceRoot":"","sources":["../../../src/toast/toast-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAElE;;GAEG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAgB;IAChC,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,IAAI,CAAmB;IAE/B;;;;;OAKG;IACI,YAAY,CAAC,QAAQ,EAAE,aAAa,GAAG,YAAY;IAK1D;;;;;OAKG;IACI,aAAa,CAAC,SAAS,EAAE,OAAO,GAAG,YAAY;IAKtD;;;;;OAKG;IACI,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,YAAY;IAK3D;;;;;OAKG;IACI,QAAQ,CAAC,IAAI,EAAE,gBAAgB,GAAG,YAAY;IAKrD;;;OAGG;IACI,KAAK,IAAI,KAAK;CAgBtB;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAO,YAAkC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { NotificationStructure } from '../types';
2
+ /**
3
+ * Shows the notificationStructure
4
+ * @internal
5
+ * @param notificationStructure - The NotificationStructure object
6
+ * @param tagName - The tag name to create prefix for the design system provider & notificationStructure component
7
+ * @returns
8
+ * */
9
+ export declare const showToast: (notificationStructure: NotificationStructure, tagName: String) => void;
10
+ //# sourceMappingURL=toast-launcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toast-launcher.d.ts","sourceRoot":"","sources":["../../../src/toast/toast-launcher.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEjD;;;;;;KAMK;AACL,eAAO,MAAM,SAAS,0BAA2B,qBAAqB,WAAW,MAAM,KAAG,IAqDzF,CAAC"}
@@ -0,0 +1,11 @@
1
+ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
+ // It should be published with your NPM package. It should not be tracked by Git.
3
+ {
4
+ "tsdocVersion": "0.12",
5
+ "toolPackages": [
6
+ {
7
+ "packageName": "@microsoft/api-extractor",
8
+ "packageVersion": "7.34.9"
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,106 @@
1
+ import { LogLevel } from '@genesislcap/foundation-utils';
2
+ /**
3
+ * @public
4
+ * enum for different types of notification events
5
+ */
6
+ export declare enum NotificationEvent {
7
+ NOTIFICATION_EVENT = "notification-event"
8
+ }
9
+ /**
10
+ * @public
11
+ * type for notification
12
+ */
13
+ export type NotificationType = 'error' | 'warning' | 'success';
14
+ /**
15
+ * @public
16
+ * type for notification position
17
+ */
18
+ export type ToastPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
19
+ /**
20
+ * Interface for Toast configuration
21
+ * @public
22
+ */
23
+ export interface Toast {
24
+ readonly position?: ToastPosition;
25
+ readonly type?: NotificationType;
26
+ readonly autoClose?: boolean;
27
+ readonly closeTimeout?: number;
28
+ }
29
+ /**
30
+ * Interface for Dismissing Action configuration
31
+ * @public
32
+ */
33
+ export interface DismissingAction {
34
+ readonly label: String;
35
+ readonly action?: Function;
36
+ }
37
+ /**
38
+ * Interface for Confirming Action configuration
39
+ * @public
40
+ */
41
+ export interface ConfirmingAction {
42
+ readonly label: String;
43
+ readonly action: Function;
44
+ }
45
+ /**
46
+ * Interface for Dialog configuration
47
+ * @public
48
+ */
49
+ export interface Dialog {
50
+ readonly confirmingActions?: Array<ConfirmingAction>;
51
+ readonly dismissingAction?: DismissingAction;
52
+ }
53
+ /**
54
+ * Interface for Banner configuration
55
+ * @public
56
+ */
57
+ export interface Banner {
58
+ readonly dismissingAction?: DismissingAction;
59
+ readonly confirmingActions?: Array<ConfirmingAction>;
60
+ }
61
+ /**
62
+ * @public
63
+ * type for snackbar type
64
+ */
65
+ export type SnackbarType = 'error';
66
+ /**
67
+ * Interface for Snackbar configuration
68
+ * @public
69
+ */
70
+ export interface Snackbar {
71
+ readonly type?: SnackbarType;
72
+ readonly confirmingActions?: Array<ConfirmingAction>;
73
+ }
74
+ /**
75
+ * Interface for Structure
76
+ * @public
77
+ */
78
+ export interface NotificationStructure {
79
+ readonly title: string;
80
+ readonly body: string;
81
+ readonly logLevel?: LogLevel;
82
+ readonly config?: {
83
+ /**
84
+ * @deprecated Use logLevel from the top level instead
85
+ */
86
+ readonly logLevel?: LogLevel;
87
+ readonly alert?: boolean;
88
+ readonly toast?: Toast;
89
+ readonly banner?: Banner;
90
+ readonly snackbar?: Snackbar;
91
+ readonly dialog?: Dialog;
92
+ };
93
+ }
94
+ /**
95
+ * @internal
96
+ */
97
+ export type NotificationElement = HTMLElement & {
98
+ notification: NotificationStructure;
99
+ };
100
+ /**
101
+ * @internal
102
+ */
103
+ export type DialogElement = NotificationElement & {
104
+ show: Function;
105
+ };
106
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEzD;;;GAGG;AACH,oBAAY,iBAAiB;IAC3B,kBAAkB,uBAAuB;CAC1C;AAED;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AAE/D;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;AAEtF;;;GAGG;AACH,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC;IAClC,QAAQ,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC;CAC5B;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,iBAAiB,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACrD,QAAQ,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CAC9C;AAED;;;GAGG;AACH,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IAC7C,QAAQ,CAAC,iBAAiB,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;CACtD;AAED;;;GAGG;AAEH,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC;AACnC;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;CACtD;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE;QAChB;;WAEG;QACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;QAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;QACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;QACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;QAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;CACH;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG;IAAE,YAAY,EAAE,qBAAqB,CAAA;CAAE,CAAC;AAExF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC"}