@genesislcap/pbc-notify-ui 1.0.64 → 14.309.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 (132) hide show
  1. package/api-extractor.json +4 -0
  2. package/dist/dts/components/foundation-inbox/components/inbox-subscription/inbox-subscription.d.ts.map +1 -1
  3. package/dist/dts/components/foundation-inbox/inbox.utils.d.ts.map +1 -1
  4. package/dist/dts/components/foundation-notification-dashboard/components/rules/columns.d.ts.map +1 -1
  5. package/dist/dts/components/foundation-notification-dashboard/components/templates/columns.d.ts.map +1 -1
  6. package/dist/dts/components/foundation-notification-dashboard/notification-dashboard.utils.d.ts.map +1 -1
  7. package/dist/dts/tsdoc-metadata.json +11 -0
  8. package/dist/dts/utils/gridConfig.d.ts.map +1 -1
  9. package/dist/dts/utils/humanize.d.ts.map +1 -1
  10. package/dist/dts/utils/toBoolean.d.ts.map +1 -1
  11. package/dist/dts/utils/updateArray.d.ts.map +1 -1
  12. package/dist/esm/index.federated.js +0 -1
  13. package/dist/pbc-notify-ui.api.json +889 -0
  14. package/dist/pbc-notify-ui.d.ts +252 -0
  15. package/dist/tsconfig.tsbuildinfo +1 -0
  16. package/docs/api/index.md +30 -0
  17. package/docs/api/pbc-notify-ui.foundationinbox.connectedcallback.md +18 -0
  18. package/docs/api/pbc-notify-ui.foundationinbox.disconnectedcallback.md +18 -0
  19. package/docs/api/pbc-notify-ui.foundationinbox.md +66 -0
  20. package/docs/api/pbc-notify-ui.foundationinboxcounter.connectedcallback.md +15 -0
  21. package/docs/api/pbc-notify-ui.foundationinboxcounter.disconnectedcallback.md +15 -0
  22. package/docs/api/pbc-notify-ui.foundationinboxcounter.inboxservice.md +11 -0
  23. package/docs/api/pbc-notify-ui.foundationinboxcounter.md +116 -0
  24. package/docs/api/pbc-notify-ui.foundationinboxcounter.value.md +11 -0
  25. package/docs/api/pbc-notify-ui.foundationinboxflyout.close.md +15 -0
  26. package/docs/api/pbc-notify-ui.foundationinboxflyout.connectedcallback.md +15 -0
  27. package/docs/api/pbc-notify-ui.foundationinboxflyout.disconnectedcallback.md +15 -0
  28. package/docs/api/pbc-notify-ui.foundationinboxflyout.flyout.md +11 -0
  29. package/docs/api/pbc-notify-ui.foundationinboxflyout.flyoutclosed.md +11 -0
  30. package/docs/api/pbc-notify-ui.foundationinboxflyout.loadremotes.md +15 -0
  31. package/docs/api/pbc-notify-ui.foundationinboxflyout.md +169 -0
  32. package/docs/api/pbc-notify-ui.foundationinboxflyout.open.md +15 -0
  33. package/docs/api/pbc-notify-ui.foundationinboxflyout.ready.md +11 -0
  34. package/docs/api/pbc-notify-ui.foundationnotificationdashboard.auth.md +11 -0
  35. package/docs/api/pbc-notify-ui.foundationnotificationdashboard.connectedcallback.md +15 -0
  36. package/docs/api/pbc-notify-ui.foundationnotificationdashboard.haspermissions.md +11 -0
  37. package/docs/api/pbc-notify-ui.foundationnotificationdashboard.md +122 -0
  38. package/docs/api/pbc-notify-ui.foundationnotificationdashboard.ready.md +11 -0
  39. package/docs/api/pbc-notify-ui.md +60 -0
  40. package/docs/api-report.md.api.md +76 -0
  41. package/license.txt +46 -0
  42. package/package.json +26 -39
  43. package/src/components/components.ts +54 -0
  44. package/src/components/foundation-inbox/components/foundation-inbox-counter/foundation-inbox-counter.styles.ts +30 -0
  45. package/src/components/foundation-inbox/components/foundation-inbox-counter/foundation-inbox-counter.template.ts +16 -0
  46. package/src/components/foundation-inbox/components/foundation-inbox-counter/foundation-inbox-counter.ts +33 -0
  47. package/src/components/foundation-inbox/components/foundation-inbox-flyout/foundation-inbox-flyout.styles.ts +18 -0
  48. package/src/components/foundation-inbox/components/foundation-inbox-flyout/foundation-inbox-flyout.template.ts +22 -0
  49. package/src/components/foundation-inbox/components/foundation-inbox-flyout/foundation-inbox-flyout.ts +43 -0
  50. package/src/components/foundation-inbox/components/inbox-subscription/inbox-subscription.styles.ts +37 -0
  51. package/src/components/foundation-inbox/components/inbox-subscription/inbox-subscription.template.ts +50 -0
  52. package/src/components/foundation-inbox/components/inbox-subscription/inbox-subscription.ts +81 -0
  53. package/src/components/foundation-inbox/components/inbox-subscription/rule-parameter/rule-parameter.styles.ts +25 -0
  54. package/src/components/foundation-inbox/components/inbox-subscription/rule-parameter/rule-parameter.template.ts +96 -0
  55. package/src/components/foundation-inbox/components/inbox-subscription/rule-parameter/rule-parameter.ts +55 -0
  56. package/src/components/foundation-inbox/inbox-base/inbox-base.ts +320 -0
  57. package/src/components/foundation-inbox/inbox.styles.ts +309 -0
  58. package/src/components/foundation-inbox/inbox.template.ts +317 -0
  59. package/src/components/foundation-inbox/inbox.ts +26 -0
  60. package/src/components/foundation-inbox/inbox.types.ts +84 -0
  61. package/src/components/foundation-inbox/inbox.utils.ts +33 -0
  62. package/src/components/foundation-notification-dashboard/components/notify-audit/notify-audit-management.ts +96 -0
  63. package/src/components/foundation-notification-dashboard/components/routes/route-management.ts +56 -0
  64. package/src/components/foundation-notification-dashboard/components/routes/tabs/email-distribution-route-management.ts +58 -0
  65. package/src/components/foundation-notification-dashboard/components/routes/tabs/email-user-route-management.ts +68 -0
  66. package/src/components/foundation-notification-dashboard/components/routes/tabs/log-route-management.ts +43 -0
  67. package/src/components/foundation-notification-dashboard/components/routes/tabs/ms-teams-route-management.ts +48 -0
  68. package/src/components/foundation-notification-dashboard/components/routes/tabs/screen-route-management.ts +73 -0
  69. package/src/components/foundation-notification-dashboard/components/rules/columns.ts +48 -0
  70. package/src/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.template.ts +139 -0
  71. package/src/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.ts +255 -0
  72. package/src/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.types.ts +4 -0
  73. package/src/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.template.ts +159 -0
  74. package/src/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.ts +202 -0
  75. package/src/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.types.ts +28 -0
  76. package/src/components/foundation-notification-dashboard/components/rules/rule-management.ts +72 -0
  77. package/src/components/foundation-notification-dashboard/components/templates/columns.ts +48 -0
  78. package/src/components/foundation-notification-dashboard/components/templates/template-dialog/parameter-builder/parameter-builder.styles.ts +59 -0
  79. package/src/components/foundation-notification-dashboard/components/templates/template-dialog/parameter-builder/parameter-builder.template.ts +95 -0
  80. package/src/components/foundation-notification-dashboard/components/templates/template-dialog/parameter-builder/parameter-builder.ts +124 -0
  81. package/src/components/foundation-notification-dashboard/components/templates/template-dialog/template-condition-builder/template-condition-builder.template.ts +107 -0
  82. package/src/components/foundation-notification-dashboard/components/templates/template-dialog/template-condition-builder/template-condition-builder.ts +185 -0
  83. package/src/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.template.ts +139 -0
  84. package/src/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.ts +246 -0
  85. package/src/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.types.ts +38 -0
  86. package/src/components/foundation-notification-dashboard/components/templates/template-management.ts +72 -0
  87. package/src/components/foundation-notification-dashboard/index.ts +1 -0
  88. package/src/components/foundation-notification-dashboard/notification-dashboard.styles.ts +21 -0
  89. package/src/components/foundation-notification-dashboard/notification-dashboard.tabs.ts +35 -0
  90. package/src/components/foundation-notification-dashboard/notification-dashboard.template.ts +58 -0
  91. package/src/components/foundation-notification-dashboard/notification-dashboard.ts +40 -0
  92. package/src/components/foundation-notification-dashboard/notification-dashboard.utils.ts +295 -0
  93. package/src/components/foundation-notification-dashboard/styles/condition-builder.styles.ts +66 -0
  94. package/src/components/foundation-notification-dashboard/styles/dynamic-rule.styles.ts +159 -0
  95. package/src/components/foundation-notification-dashboard/styles/management.styles.ts +21 -0
  96. package/src/components/foundation-notification-dashboard/types/expression-type.ts +13 -0
  97. package/src/components/foundation-notification-dashboard/types/logical-operator.ts +18 -0
  98. package/src/components/foundation-notification-dashboard/types/param-source-type.ts +11 -0
  99. package/src/components/foundation-notification-dashboard/types/param-type.ts +13 -0
  100. package/src/components/foundation-notification-dashboard/types/right-criteria.ts +6 -0
  101. package/src/components/foundation-notification-dashboard/types/rule-execution-strategy.ts +6 -0
  102. package/src/components/foundation-notification-dashboard/types/severity.ts +13 -0
  103. package/src/globals.d.ts +7 -0
  104. package/src/index.federated.ts +1 -0
  105. package/src/index.ts +4 -0
  106. package/src/notify.types.ts +143 -0
  107. package/src/sandbox.ts +83 -0
  108. package/src/services/alert.service.ts +36 -0
  109. package/src/services/inbox.service.ts +85 -0
  110. package/src/services/notify.service.ts +21 -0
  111. package/src/services/rule.service.ts +129 -0
  112. package/src/services/system.service.ts +43 -0
  113. package/src/services/template.service.ts +71 -0
  114. package/src/styles/scrollbar.styles.ts +15 -0
  115. package/src/utils/eventDetail.ts +5 -0
  116. package/src/utils/gridConfig.ts +14 -0
  117. package/src/utils/humanize.ts +14 -0
  118. package/src/utils/icons.ts +15 -0
  119. package/src/utils/index.ts +6 -0
  120. package/src/utils/logger.ts +3 -0
  121. package/src/utils/notifyPermissions.ts +6 -0
  122. package/src/utils/toBoolean.ts +7 -0
  123. package/src/utils/updateArray.ts +33 -0
  124. package/temp/api-report.md.api.md +76 -0
  125. package/tsconfig.json +11 -0
  126. package/.husky/commit-msg +0 -3
  127. package/.husky/pre-commit +0 -4
  128. package/README.md +0 -31
  129. package/commitlint.config.js +0 -25
  130. package/index.html +0 -28
  131. package/scripts/commitlint.js +0 -24
  132. package/sonar-project.properties +0 -5
@@ -0,0 +1,320 @@
1
+ import { Auth } from '@genesislcap/foundation-comms';
2
+ import {
3
+ CriteriaBuilder,
4
+ Expression,
5
+ ExpressionBuilder,
6
+ Join,
7
+ Serialiser,
8
+ Serialisers,
9
+ } from '@genesislcap/foundation-criteria';
10
+ import { showNotificationDialog } from '@genesislcap/foundation-notifications';
11
+ import type { Tabs } from '@genesislcap/foundation-ui';
12
+ import { GenesisElement, observable } from '@genesislcap/web-core';
13
+ import dayjs from 'dayjs';
14
+ import utc from 'dayjs/plugin/utc';
15
+ import debounce from 'lodash.debounce';
16
+ import { AlertService } from '../../../services/alert.service';
17
+ import { FoundationInboxService, SubscribeCallback } from '../../../services/inbox.service';
18
+ import { RuleService } from '../../../services/rule.service';
19
+ import { TemplateService } from '../../../services/template.service';
20
+ import { logger } from '../../../utils';
21
+ import { showNotificationError } from '../../foundation-notification-dashboard/notification-dashboard.utils';
22
+ import {
23
+ Alert,
24
+ InboxTab,
25
+ NotificationRuleTemplateReply,
26
+ Rule,
27
+ RuleStatus,
28
+ RuleTemplate,
29
+ } from '../inbox.types';
30
+
31
+ dayjs.extend(utc);
32
+
33
+ const criteriaBuilder = (): CriteriaBuilder => new CriteriaBuilder();
34
+
35
+ const expressionBuilder = (field: string, value: unknown, serialiser: Serialiser): Expression => {
36
+ return new ExpressionBuilder()
37
+ .withField(field)
38
+ .withValue(value)
39
+ .withSerialiser(serialiser)
40
+ .build();
41
+ };
42
+
43
+ const DEBOUNCE_TIME = 500;
44
+
45
+ export class FoundationInboxBase extends GenesisElement {
46
+ @Auth auth: Auth;
47
+
48
+ @AlertService alertService: AlertService;
49
+ @FoundationInboxService inboxService: FoundationInboxService;
50
+
51
+ private alertSubscription: SubscribeCallback;
52
+
53
+ @observable private alerts: Alert[] = [];
54
+ @observable alertsFilter: Alert[] = [];
55
+
56
+ @RuleService ruleService: RuleService;
57
+ @observable rules: Rule[] = [];
58
+ @observable rulesFilter: Rule[] = [];
59
+
60
+ @TemplateService templateService: TemplateService;
61
+ @observable templates: RuleTemplate[] = [];
62
+ @observable templatesFilter: RuleTemplate[] = [];
63
+
64
+ @observable searchAlertLog: string = null;
65
+ @observable titleSearchValue: string = null;
66
+ @observable bodySearchValue: string = null;
67
+
68
+ @observable searchSubscribe: string = null;
69
+ @observable ruleTemplateDetails: NotificationRuleTemplateReply = null;
70
+ @observable selectedTab: InboxTab = InboxTab.ALERTS_NEW;
71
+
72
+ @observable fromDatePickerValue: string = null;
73
+ @observable toDatePickerValue: string = null;
74
+
75
+ @observable criteriaMatchAlertStatus: Expression;
76
+ @observable reverse: boolean = false;
77
+ @observable showLoadingIndicator: boolean = false;
78
+
79
+ @observable severityType = [];
80
+
81
+ public tabs: Tabs;
82
+
83
+ async connectedCallback() {
84
+ super.connectedCallback();
85
+
86
+ this.criteriaMatchAlertStatus = expressionBuilder('ALERT_STATUS', 'NEW', Serialisers.equals);
87
+
88
+ this.alertSubscription = ({ store }) => {
89
+ this.alerts = store?.items || [];
90
+ this.showLoadingIndicator = false;
91
+ };
92
+
93
+ this.inboxService.subscribe(
94
+ this.alertSubscription,
95
+ false,
96
+ criteriaBuilder().withExpression(this.criteriaMatchAlertStatus).build(),
97
+ );
98
+
99
+ this.rules = await this.ruleService.getRules();
100
+ this.templates = await this.templateService.getRuleTemplates();
101
+ }
102
+
103
+ disconnectedCallback() {
104
+ super.disconnectedCallback();
105
+ this.inboxService.unsubscribe(this.alertSubscription);
106
+ }
107
+
108
+ // #region Tabs
109
+ async inboxTabChanged(inboxTab: InboxTab) {
110
+ this.selectedTab = inboxTab;
111
+ this.ruleTemplateDetails = null;
112
+
113
+ switch (inboxTab) {
114
+ case InboxTab.ALERTS_NEW:
115
+ this.criteriaMatchAlertStatus = expressionBuilder(
116
+ 'ALERT_STATUS',
117
+ 'NEW',
118
+ Serialisers.equals,
119
+ );
120
+ this.filterSearchAlertLog();
121
+ break;
122
+ case InboxTab.ALERT_HISTORY:
123
+ this.criteriaMatchAlertStatus = expressionBuilder('ALERT_STATUS', 'NEW', Serialisers.NE);
124
+ this.filterSearchAlertLog();
125
+ break;
126
+ case InboxTab.MY_ALERTS:
127
+ this.rules = await this.ruleService.getRules();
128
+ break;
129
+ case InboxTab.SUBSCRIBE:
130
+ this.templates = await this.templateService.getRuleTemplates();
131
+ break;
132
+ default:
133
+ logger.error('Unexpected inboxTab:', inboxTab);
134
+ break;
135
+ }
136
+ }
137
+ // #endregion
138
+
139
+ // #region Changed Events
140
+ alertsChanged = () => (this.alertsFilter = this.alerts);
141
+
142
+ rulesChanged = () => (this.rulesFilter = this.rules);
143
+
144
+ templatesChanged = () => (this.templatesFilter = this.templates);
145
+
146
+ debouncedFilterSearchAlertLog = debounce(this.filterSearchAlertLog, DEBOUNCE_TIME);
147
+
148
+ filterSearchAlertLog() {
149
+ this.showLoadingIndicator = true;
150
+ const filterCriteria = criteriaBuilder();
151
+
152
+ filterCriteria.withExpression(this.criteriaMatchAlertStatus);
153
+
154
+ if (this.titleSearchValue) {
155
+ filterCriteria.withExpression(
156
+ expressionBuilder('HEADER', this.titleSearchValue, Serialisers.containsIgnoreCase),
157
+ );
158
+ }
159
+
160
+ if (this.bodySearchValue) {
161
+ filterCriteria.withExpression(
162
+ expressionBuilder('MESSAGE', this.bodySearchValue, Serialisers.containsIgnoreCase),
163
+ );
164
+ }
165
+
166
+ if (this.severityType.length > 0) {
167
+ const severityExpressions = this.severityType.map((severity) =>
168
+ expressionBuilder('NOTIFY_SEVERITY', severity, Serialisers.equals),
169
+ );
170
+ filterCriteria.withExpression(severityExpressions, { join: Join.Or() });
171
+ }
172
+
173
+ if (this.fromDatePickerValue) {
174
+ filterCriteria.withExpression(
175
+ expressionBuilder(
176
+ 'CREATED_AT',
177
+ this.formatDateStrForMatchCriteria(this.fromDatePickerValue),
178
+ Serialisers.dateIsGreaterEqual,
179
+ ),
180
+ );
181
+ }
182
+
183
+ if (this.toDatePickerValue) {
184
+ filterCriteria.withExpression(
185
+ expressionBuilder(
186
+ 'CREATED_AT',
187
+ this.formatDateStrForMatchCriteria(this.toDatePickerValue),
188
+ Serialisers.dateIsLessEqual,
189
+ ),
190
+ );
191
+ } else {
192
+ // if no toDate is set, then force it to be today
193
+ filterCriteria.withExpression(
194
+ expressionBuilder(
195
+ 'CREATED_AT',
196
+ this.formatDateStrForMatchCriteria(),
197
+ Serialisers.dateIsLessEqual,
198
+ ),
199
+ );
200
+ }
201
+
202
+ // Refresh the data subscription
203
+ this.inboxService.unsubscribe(this.alertSubscription);
204
+
205
+ this.inboxService.subscribe(this.alertSubscription, this.reverse, filterCriteria.build());
206
+ }
207
+
208
+ reverseOrder(reverse: boolean) {
209
+ if (this.reverse != reverse) {
210
+ this.reverse = reverse;
211
+ this.filterSearchAlertLog();
212
+ }
213
+ }
214
+
215
+ filterSearchSubscribe() {
216
+ if (!this.searchSubscribe) {
217
+ this.templatesFilter = this.templates;
218
+ return;
219
+ }
220
+
221
+ this.templatesFilter = this.templates.filter((item) =>
222
+ item.NAME.toLowerCase().startsWith(this.searchSubscribe.toLowerCase()),
223
+ );
224
+ }
225
+
226
+ clearSearch() {
227
+ this.titleSearchValue = '';
228
+ this.bodySearchValue = '';
229
+ this.severityType = [];
230
+ this.fromDatePickerValue = undefined;
231
+ this.toDatePickerValue = undefined;
232
+
233
+ this.filterSearchAlertLog();
234
+ }
235
+
236
+ // #endregion
237
+
238
+ // #region New and History
239
+ dismissAlert(alertId: string) {
240
+ this.alertService.dismissNotifyAlert(alertId);
241
+ }
242
+
243
+ validateResponse(response) {
244
+ if (response.MESSAGE_TYPE === 'EVENT_ACK') {
245
+ this.alertsFilter.splice(0, this.alertsFilter.length);
246
+ return;
247
+ }
248
+
249
+ showNotificationError(response.ERROR);
250
+ }
251
+
252
+ dismissAllAlerts() {
253
+ showNotificationDialog(
254
+ {
255
+ title: 'Confirm Clear All',
256
+ body: `Do you really want to clear all the alerts? This action can't be undone.`,
257
+ dialog: {
258
+ dismissingAction: {
259
+ label: 'Dismiss',
260
+ action: () => null,
261
+ },
262
+ confirmingActions: [
263
+ {
264
+ label: 'Confirm',
265
+ action: () =>
266
+ this.alertService
267
+ .dismissAllNotifyAlerts()
268
+ .then((response) => this.validateResponse(response)),
269
+ },
270
+ ],
271
+ },
272
+ },
273
+ 'rapid',
274
+ );
275
+ }
276
+ // #endregion
277
+
278
+ // #region Subscriptions
279
+ // TODO:
280
+ editAlert() {}
281
+
282
+ async playPauseAlert(ruleClicked: Rule) {
283
+ switch (ruleClicked.RULE_STATUS) {
284
+ case RuleStatus.ENABLED:
285
+ await this.ruleService.disableRule(ruleClicked.ID);
286
+ break;
287
+ case RuleStatus.DISABLED:
288
+ await this.ruleService.enableRule(ruleClicked.ID);
289
+ break;
290
+ default:
291
+ logger.error('Unexpected ruleStatus:', ruleClicked.RULE_STATUS);
292
+ break;
293
+ }
294
+
295
+ this.rules = await this.ruleService.getRules();
296
+ }
297
+
298
+ async deleteAlert(ruleClicked: Rule) {
299
+ await this.ruleService.unsubscribeRule(ruleClicked.ID);
300
+ this.rules = await this.ruleService.getRules();
301
+ }
302
+ // #endregion
303
+
304
+ // #region Subscribe
305
+ async openTemplateSubscription(ruleTemplate: any) {
306
+ if (this.ruleTemplateDetails) {
307
+ // Close
308
+ this.ruleTemplateDetails = null;
309
+ return;
310
+ }
311
+
312
+ // Open
313
+ this.ruleTemplateDetails = await this.templateService.getRuleTemplateDetails(ruleTemplate.ID);
314
+ }
315
+ // #endregion
316
+
317
+ formatDateStrForMatchCriteria(date?: string) {
318
+ return dayjs.utc(date).format('YYYYMMDD');
319
+ }
320
+ }
@@ -0,0 +1,309 @@
1
+ import { css } from '@genesislcap/web-core';
2
+ import { scrollbarStyles } from '../../styles/scrollbar.styles';
3
+
4
+ const tabs = css`
5
+ rapid-tabs {
6
+ display: flex;
7
+ flex-direction: column;
8
+ width: 100%;
9
+ }
10
+
11
+ rapid-tabs::part(tablist) {
12
+ grid-template-columns: none;
13
+ flex: 0;
14
+ width: 100%;
15
+ }
16
+
17
+ rapid-tabs::part(tabpanel) {
18
+ display: flex;
19
+ flex-direction: column;
20
+ flex: 1;
21
+ min-height: 0;
22
+ }
23
+
24
+ rapid-tab-panel {
25
+ padding: 0;
26
+ }
27
+ `;
28
+
29
+ const search = css`
30
+ .search {
31
+ display: flex;
32
+ flex-direction: column;
33
+ flex: 0;
34
+ padding: calc(var(--design-unit) * 3px) calc(var(--design-unit) * 3px);
35
+ border-bottom: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest);
36
+ gap: calc(var(--design-unit) * 2px);
37
+ }
38
+
39
+ .search-input {
40
+ display: flex;
41
+ margin: 0;
42
+ width: 100%;
43
+ }
44
+
45
+ .select-input {
46
+ min-width: 155px;
47
+ margin-right: 5px;
48
+ }
49
+
50
+ .search-input::part(root) {
51
+ width: 100%;
52
+ }
53
+
54
+ .clear-all {
55
+ min-width: 100px;
56
+ margin-right: 10px;
57
+ }
58
+
59
+ .search-label {
60
+ color: var(--neutral-foreground-hint);
61
+ padding-right: 5px;
62
+ min-width: fit-content;
63
+ }
64
+
65
+ .date-input {
66
+ margin-bottom: 0;
67
+ max-width: fit-content;
68
+ }
69
+
70
+ .date-input::part(control) {
71
+ min-width: 120px;
72
+ width: 120px;
73
+ }
74
+
75
+ .sort-button {
76
+ color: var(--accent-foreground-rest);
77
+ font-size: calc(var(--design-unit) * 3px);
78
+ padding-right: 10px;
79
+ text-decoration: none;
80
+ }
81
+
82
+ .sort-button:active {
83
+ color: var(--neutral-foreground-hint);
84
+ }
85
+
86
+ .sort-button-selected {
87
+ text-decoration: underline var(--neutral-foreground-hint);
88
+ }
89
+ `;
90
+
91
+ export const inboxHeader = css`
92
+ .inbox-header {
93
+ display: flex;
94
+ flex: 0;
95
+ align-items: center;
96
+ justify-content: space-between;
97
+ padding: calc(var(--design-unit) * 3px) calc(var(--design-unit) * 3px);
98
+ border-bottom: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest);
99
+ }
100
+
101
+ .inbox-header-title {
102
+ font-size: calc(var(--design-unit) * 4px);
103
+ font-weight: 700;
104
+ padding: 0;
105
+ margin: 0 auto 0 0;
106
+ }
107
+
108
+ .inbox-header-close {
109
+ text-align: center;
110
+ min-width: 30px;
111
+ height: 30px;
112
+ }
113
+
114
+ .inbox-header-close::part(control) {
115
+ padding: 0;
116
+ margin: 0;
117
+ }
118
+
119
+ .inbox-header-close::part(start) {
120
+ margin-inline-end: 0;
121
+ }
122
+ `;
123
+
124
+ export const alertsNewAndAlertsHistory = css`
125
+ .alert-log-tab-panel {
126
+ display: flex;
127
+ flex-direction: column;
128
+ min-height: 0;
129
+ flex: 1;
130
+ }
131
+
132
+ .alert-log-tab-content {
133
+ flex: 1;
134
+ overflow: auto;
135
+ }
136
+
137
+ .toast {
138
+ display: flex;
139
+ flex-direction: row;
140
+ border-bottom: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest);
141
+ }
142
+
143
+ .toast-severity {
144
+ width: calc(var(--design-unit) * 1px);
145
+ background-color: white;
146
+ margin: calc(var(--design-unit) * 2px) calc(var(--design-unit) * 0px)
147
+ calc(var(--design-unit) * 2px) calc(var(--design-unit) * 2px);
148
+ }
149
+
150
+ .toast-header {
151
+ font-weight: bold;
152
+ }
153
+
154
+ .toast-bottom {
155
+ width: 100%;
156
+ display: flex;
157
+ align-items: center;
158
+ justify-content: space-between;
159
+ }
160
+
161
+ .toast-content {
162
+ display: flex;
163
+ position: relative;
164
+ flex-direction: column;
165
+ width: 100%;
166
+ margin: calc(var(--design-unit) * 2px) calc(var(--design-unit) * 0px)
167
+ calc(var(--design-unit) * 2px) calc(var(--design-unit) * 2px);
168
+ }
169
+
170
+ .toast-date {
171
+ color: var(--neutral-foreground-hint);
172
+ font-size: calc(var(--design-unit) * 3px);
173
+ }
174
+
175
+ .no-row-container {
176
+ display: flex;
177
+ justify-content: center;
178
+ align-items: center;
179
+ height: 100%;
180
+ color: var(--neutral-stroke-rest);
181
+ }
182
+
183
+ .loading-indicator {
184
+ border: calc(var(--stroke-width) * 1px) solid var(--neutral-fill-input-rest);
185
+ background: var(--neutral-layer-3);
186
+ color: var(--neutral-foreground-rest);
187
+ padding: calc(var(--design-unit) * 2px);
188
+ border-radius: calc(var(--control-corner-radius) * 1px);
189
+ font-size: var(--type-ramp-minus-1-font-size);
190
+ }
191
+ `;
192
+
193
+ export const subscriptions = css`
194
+ .my-alerts-tab-panel {
195
+ display: flex;
196
+ flex-direction: column;
197
+ min-height: 0;
198
+ flex: 1;
199
+ }
200
+
201
+ .my-alerts-tab-content {
202
+ flex: 1;
203
+ overflow: auto;
204
+ }
205
+ `;
206
+
207
+ export const subscribe = css`
208
+ .subscribe-tab-panel {
209
+ display: flex;
210
+ flex-direction: column;
211
+ min-height: 0;
212
+ flex: 1;
213
+ }
214
+
215
+ .subscribe-tab-content {
216
+ flex: 1;
217
+ overflow: auto;
218
+ }
219
+ `;
220
+
221
+ export const ruleAndTemplate = css`
222
+ .template {
223
+ cursor: pointer;
224
+ }
225
+
226
+ .rule,
227
+ .template {
228
+ border-bottom: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest);
229
+ padding: calc(var(--design-unit) * 2px);
230
+ }
231
+
232
+ .rule-status-actions {
233
+ display: flex;
234
+ flex-direction: row;
235
+ gap: calc(var(--design-unit) * 2px);
236
+ }
237
+
238
+ .rule:hover,
239
+ .template:hover {
240
+ background-color: #2e3034;
241
+ }
242
+
243
+ .rule-actions {
244
+ margin-left: auto;
245
+ display: flex;
246
+ gap: calc(var(--design-unit) * 3px);
247
+ justify-content: space-between;
248
+ visibility: hidden;
249
+ }
250
+
251
+ .rule:hover > .rule-status-actions > .rule-actions {
252
+ visibility: visible;
253
+ }
254
+
255
+ .active {
256
+ color: #7acc79;
257
+ }
258
+
259
+ .paused {
260
+ color: #ffb660;
261
+ }
262
+
263
+ .rule-datetime,
264
+ .template-datetime {
265
+ color: #879ba6;
266
+ }
267
+
268
+ .rule-action-edit,
269
+ .rule-action-enable-disable,
270
+ .rule-action-delete {
271
+ cursor: pointer;
272
+ }
273
+
274
+ .close-icon {
275
+ position: absolute;
276
+ right: calc(var(--design-unit) * 2px);
277
+ cursor: pointer;
278
+ }
279
+ `;
280
+
281
+ /**
282
+ * @public
283
+ */
284
+ export const FoundationInboxStyles = css`
285
+ ${scrollbarStyles}
286
+
287
+ :host {
288
+ display: flex;
289
+ min-height: 0;
290
+ height: 100%;
291
+ width: 96%;
292
+ }
293
+
294
+ ${tabs}
295
+ ${search}
296
+ ${inboxHeader}
297
+ ${alertsNewAndAlertsHistory}
298
+
299
+ .inbox-content {
300
+ flex: 1;
301
+ display: flex;
302
+ min-height: 0;
303
+ }
304
+
305
+ ${alertsNewAndAlertsHistory}
306
+ ${subscriptions}
307
+ ${subscribe}
308
+ ${ruleAndTemplate}
309
+ `;