@justeattakeaway/pie-notification 0.21.18 → 0.21.20
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.
- package/custom-elements.json +8 -8
- package/dist/index.js +56 -56
- package/package.json +6 -6
- package/src/index.ts +3 -3
- package/src/notification.scss +11 -5
package/custom-elements.json
CHANGED
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"type": {
|
|
91
91
|
"text": "ActionProps"
|
|
92
92
|
},
|
|
93
|
-
"default": "{\
|
|
93
|
+
"default": "{\n text: '',\n ariaLabel: '',\n size: 'small-productive',\n}"
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
96
|
"kind": "variable",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"type": {
|
|
99
99
|
"text": "DefaultProps"
|
|
100
100
|
},
|
|
101
|
-
"default": "{\
|
|
101
|
+
"default": "{\n variant: 'neutral',\n position: 'inline-content',\n isDismissible: false,\n isCompact: false,\n headingLevel: 'h2',\n hideIcon: false,\n isOpen: true,\n hasStackedActions: false,\n leadingAction: defaultActionButtonProps,\n supportingAction: defaultActionButtonProps,\n}"
|
|
102
102
|
}
|
|
103
103
|
],
|
|
104
104
|
"exports": [
|
|
@@ -302,7 +302,7 @@
|
|
|
302
302
|
"kind": "method",
|
|
303
303
|
"name": "renderFooter",
|
|
304
304
|
"privacy": "private",
|
|
305
|
-
"description": "Template for the footer area\
|
|
305
|
+
"description": "Template for the footer area\nCalled within the main render function."
|
|
306
306
|
},
|
|
307
307
|
{
|
|
308
308
|
"kind": "method",
|
|
@@ -313,7 +313,7 @@
|
|
|
313
313
|
"text": "TemplateResult"
|
|
314
314
|
}
|
|
315
315
|
},
|
|
316
|
-
"description": "Template for the header area\
|
|
316
|
+
"description": "Template for the header area\nCalled within the main render function."
|
|
317
317
|
},
|
|
318
318
|
{
|
|
319
319
|
"kind": "method",
|
|
@@ -330,7 +330,7 @@
|
|
|
330
330
|
"text": "TemplateResult | typeof nothing"
|
|
331
331
|
}
|
|
332
332
|
},
|
|
333
|
-
"description": "Template for the heading icon area.\
|
|
333
|
+
"description": "Template for the heading icon area.\nIt can return an icon provided externally via named slot or it can return a default icon according to the chosen variant if defined.\nCalled within the main render function."
|
|
334
334
|
},
|
|
335
335
|
{
|
|
336
336
|
"kind": "method",
|
|
@@ -341,13 +341,13 @@
|
|
|
341
341
|
"text": "TemplateResult"
|
|
342
342
|
}
|
|
343
343
|
},
|
|
344
|
-
"description": "Template for the close button element. Called within the\
|
|
344
|
+
"description": "Template for the close button element. Called within the\nmain render function."
|
|
345
345
|
},
|
|
346
346
|
{
|
|
347
347
|
"kind": "method",
|
|
348
348
|
"name": "handleCloseButton",
|
|
349
349
|
"privacy": "private",
|
|
350
|
-
"description": "It handles the action when user clicks in the close button.\
|
|
350
|
+
"description": "It handles the action when user clicks in the close button.\nAlso triggers an event when is executed."
|
|
351
351
|
},
|
|
352
352
|
{
|
|
353
353
|
"kind": "method",
|
|
@@ -361,7 +361,7 @@
|
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
363
|
],
|
|
364
|
-
"description": "It handles the action button action.\
|
|
364
|
+
"description": "It handles the action button action.\nAlso triggers an event according to its `actionType`."
|
|
365
365
|
},
|
|
366
366
|
{
|
|
367
367
|
"kind": "method",
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { LitElement as A, unsafeCSS as I, nothing as s } from "lit";
|
|
2
2
|
import { classMap as O } from "lit/directives/class-map.js";
|
|
3
|
-
import { html as
|
|
3
|
+
import { html as f, unsafeStatic as z } from "lit/static-html.js";
|
|
4
4
|
import { validPropertyValues as N, safeCustomElement as _, dispatchCustomEvent as x } from "@justeattakeaway/pie-webc-core";
|
|
5
5
|
import { property as r, queryAssignedElements as S } from "lit/decorators.js";
|
|
6
|
-
import { ifDefined as
|
|
6
|
+
import { ifDefined as g } from "lit/directives/if-defined.js";
|
|
7
7
|
import "@justeattakeaway/pie-button";
|
|
8
8
|
import "@justeattakeaway/pie-icon-button";
|
|
9
9
|
import "@justeattakeaway/pie-icons-webc/dist/IconAlertCircle.js";
|
|
@@ -16,13 +16,13 @@ const y = class y extends A {
|
|
|
16
16
|
this.getAttribute("v") || this.setAttribute("v", y.v);
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
-
y.v = "0.21.
|
|
19
|
+
y.v = "0.21.20";
|
|
20
20
|
let C = y;
|
|
21
|
-
const E = ["neutral", "neutral-alternative", "info", "success", "warning", "error", "translucent"], L = ["h2", "h3", "h4", "h5", "h6"], T = ["inline-content", "full-width"], B = ["small-productive", "xsmall"], t = "pie-notification",
|
|
21
|
+
const E = ["neutral", "neutral-alternative", "info", "success", "warning", "error", "translucent"], L = ["h2", "h3", "h4", "h5", "h6"], T = ["inline-content", "full-width"], B = ["small-productive", "xsmall"], t = "pie-notification", u = "c-notification", D = `${t}-close`, V = `${t}-open`, P = `${t}-leading-action-click`, F = `${t}-supporting-action-click`, $ = {
|
|
22
22
|
text: "",
|
|
23
23
|
ariaLabel: "",
|
|
24
24
|
size: "small-productive"
|
|
25
|
-
},
|
|
25
|
+
}, l = {
|
|
26
26
|
variant: "neutral",
|
|
27
27
|
position: "inline-content",
|
|
28
28
|
isDismissible: !1,
|
|
@@ -33,15 +33,15 @@ const E = ["neutral", "neutral-alternative", "info", "success", "warning", "erro
|
|
|
33
33
|
hasStackedActions: !1,
|
|
34
34
|
leadingAction: $,
|
|
35
35
|
supportingAction: $
|
|
36
|
-
}, j = "*,*:after,*:before{box-sizing:inherit}:host{display:block}.c-notification{--notification-border-radius: var(--dt-radius-rounded-c);--notification-background-color: var(--dt-color-container-subtle);--notification-direction: column;--notification-heading-font-family: var(--dt-font-heading-s-family);--notification-heading-font-size: calc(var(--dt-font-heading-s-size--narrow) * 1px);--notification-heading-line-height: calc(var(--dt-font-heading-s-line-height--narrow) * 1px);--notification-heading-font-weight: var(--dt-font-heading-s-weight);--notification-font-family: var(--dt-font-body-l-family);--notification-font-size: calc(var(--dt-font-body-l-size) * 1px);--notification-line-height: calc(var(--dt-font-body-l-line-height) * 1px);--notification-font-weight: var(--dt-font-body-l-weight);--notification-close-icon-offset: var(--dt-spacing-b);--notification-icon-fill: var(--dt-color-content-inverse);--notification-icon-background-color: var(--dt-color-container-inverse);--icon-size-override: 24px;padding:var(--dt-spacing-d);border-radius:var(--notification-border-radius);background-color:var(--notification-background-color);position:relative;display:flex;flex-direction:var(--notification-direction);gap:var(--dt-spacing-d);font-family:var(--notification-font-family);font-size:var(--notification-font-size);line-height:var(--notification-line-height);font-weight:var(--notification-font-weight);color:var(--dt-color-content-default)}.c-notification.
|
|
37
|
-
var G = Object.defineProperty, H = Object.getOwnPropertyDescriptor, c = (i, o, n,
|
|
38
|
-
for (var e =
|
|
39
|
-
(
|
|
40
|
-
return
|
|
36
|
+
}, j = "*,*:after,*:before{box-sizing:inherit}:host{display:block}.c-notification{--notification-border-radius: var(--dt-radius-rounded-c);--notification-background-color: var(--dt-color-container-subtle);--notification-direction: column;--notification-heading-font-family: var(--dt-font-heading-s-family);--notification-heading-font-size: calc(var(--dt-font-heading-s-size--narrow) * 1px);--notification-heading-line-height: calc(var(--dt-font-heading-s-line-height--narrow) * 1px);--notification-heading-font-weight: var(--dt-font-heading-s-weight);--notification-font-family: var(--dt-font-body-l-family);--notification-font-size: calc(var(--dt-font-body-l-size) * 1px);--notification-line-height: calc(var(--dt-font-body-l-line-height) * 1px);--notification-font-weight: var(--dt-font-body-l-weight);--notification-close-icon-offset: var(--dt-spacing-b);--notification-icon-fill: var(--dt-color-content-inverse);--notification-icon-background-color: var(--dt-color-container-inverse);--icon-size-override: 24px;padding:var(--dt-spacing-d);border-radius:var(--notification-border-radius);background-color:var(--notification-background-color);position:relative;display:flex;flex-direction:var(--notification-direction);gap:var(--dt-spacing-d);font-family:var(--notification-font-family);font-size:var(--notification-font-size);line-height:var(--notification-line-height);font-weight:var(--notification-font-weight);color:var(--dt-color-content-default)}.c-notification.is-compact{--notification-direction: row}.c-notification.c-notification--full-width{--notification-border-radius: var(--dt-radius-rounded-none)}.c-notification.c-notification--neutral-alternative{--notification-background-color: var(--dt-color-container-default)}.c-notification.c-notification--info{--notification-background-color: var(--dt-color-support-info-tonal);--notification-icon-background-color: var(--dt-color-support-info)}.c-notification.c-notification--success{--notification-background-color: var(--dt-color-support-positive-tonal);--notification-icon-background-color: var(--dt-color-support-positive)}.c-notification.c-notification--warning{--notification-background-color: var(--dt-color-support-warning-tonal);--notification-icon-background-color: var(--dt-color-support-warning);--notification-icon-fill: var(--dt-color-content-dark)}.c-notification.c-notification--error{--notification-background-color: var(--dt-color-support-error-tonal);--notification-icon-background-color: var(--dt-color-support-error);--notification-icon-fill: var(--dt-color-content-light)}.c-notification.c-notification--translucent{--notification-background-color: var(--dt-color-container-prominent);-webkit-backdrop-filter:blur(var(--dt-blur-prominent));backdrop-filter:blur(var(--dt-blur-prominent))}.c-notification-heading{margin:0;margin-block-end:var(--dt-spacing-a);font-family:var(--notification-heading-font-family);font-size:var(--notification-heading-font-size);line-height:var(--notification-heading-line-height);font-weight:var(--notification-heading-font-weight)}@media (min-width: 769px){.c-notification-heading{--notification-heading-font-size: calc(var(--dt-font-heading-s-size--wide) * 1px);--notification-heading-line-height: calc(var(--dt-font-heading-s-line-height--wide) * 1px)}}.c-notification-content-section{display:flex;flex-direction:row;align-items:center;gap:var(--dt-spacing-c)}.c-notification-content-section.is-dismissible{max-width:calc(100% - var(--notification-close-icon-offset) - 40px)}.c-notification-icon-close{position:absolute;inset-block-start:var(--notification-close-icon-offset);inset-inline-end:var(--notification-close-icon-offset)}.c-notification-footer{display:flex;flex-direction:row;justify-content:flex-end;gap:var(--dt-spacing-d)}.c-notification-footer.is-compact{align-self:center;margin-inline-start:auto}@media (max-width: 767px){.c-notification-footer.c-notification-footer--stacked{flex-direction:column-reverse}}@media (min-width: 768px){.c-notification-footer.c-notification-footer--stacked>pie-button{width:auto}}.icon,::slotted([slot=icon]){display:inline-flex;align-self:flex-start;background-color:var(--notification-icon-background-color);color:var(--notification-icon-fill);border-radius:var(--dt-radius-rounded-b);padding:var(--dt-spacing-a)}";
|
|
37
|
+
var G = Object.defineProperty, H = Object.getOwnPropertyDescriptor, c = (i, o, n, d) => {
|
|
38
|
+
for (var e = d > 1 ? void 0 : d ? H(o, n) : o, h = i.length - 1, p; h >= 0; h--)
|
|
39
|
+
(p = i[h]) && (e = (d ? p(o, n, e) : p(e)) || e);
|
|
40
|
+
return d && e && G(o, n, e), e;
|
|
41
41
|
};
|
|
42
42
|
let a = class extends C {
|
|
43
43
|
constructor() {
|
|
44
|
-
super(...arguments), this.isOpen =
|
|
44
|
+
super(...arguments), this.isOpen = l.isOpen, this.variant = l.variant, this.position = l.position, this.isDismissible = l.isDismissible, this.isCompact = l.isCompact, this.headingLevel = l.headingLevel, this.hideIcon = l.hideIcon, this.hasStackedActions = l.hasStackedActions;
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
47
|
* Lifecycle method executed when component is updated.
|
|
@@ -61,13 +61,13 @@ let a = class extends C {
|
|
|
61
61
|
leadingAction: i,
|
|
62
62
|
supportingAction: o,
|
|
63
63
|
isCompact: n,
|
|
64
|
-
hasStackedActions:
|
|
64
|
+
hasStackedActions: d
|
|
65
65
|
} = this, e = {
|
|
66
|
-
[`${
|
|
67
|
-
|
|
68
|
-
[`${
|
|
66
|
+
[`${u}-footer`]: !0,
|
|
67
|
+
"is-compact": n,
|
|
68
|
+
[`${u}-footer--stacked`]: d && !n
|
|
69
69
|
};
|
|
70
|
-
return
|
|
70
|
+
return f`
|
|
71
71
|
<footer
|
|
72
72
|
class="${O(e)}"
|
|
73
73
|
data-test-id="${t}-footer">
|
|
@@ -84,9 +84,9 @@ let a = class extends C {
|
|
|
84
84
|
*/
|
|
85
85
|
renderNotificationHeading() {
|
|
86
86
|
const { heading: i, headingLevel: o } = this, n = z(o);
|
|
87
|
-
return
|
|
87
|
+
return f`<${n}
|
|
88
88
|
id="${t}-heading"
|
|
89
|
-
class="${
|
|
89
|
+
class="${u}-heading"
|
|
90
90
|
data-test-id="${t}-heading">
|
|
91
91
|
${i}
|
|
92
92
|
</${n}>`;
|
|
@@ -99,13 +99,13 @@ let a = class extends C {
|
|
|
99
99
|
getDefaultVariantIcon() {
|
|
100
100
|
switch (this.variant) {
|
|
101
101
|
case "info":
|
|
102
|
-
return
|
|
102
|
+
return f`<icon-info-circle class="icon" size="m" data-test-id="${t}-heading-icon-info"></icon-info-circle>`;
|
|
103
103
|
case "success":
|
|
104
|
-
return
|
|
104
|
+
return f`<icon-check-circle class="icon" size="m" data-test-id="${t}-heading-icon-success"></icon-check-circle>`;
|
|
105
105
|
case "warning":
|
|
106
|
-
return
|
|
106
|
+
return f`<icon-alert-triangle class="icon" size="m" data-test-id="${t}-heading-icon-warning"></icon-alert-triangle>`;
|
|
107
107
|
case "error":
|
|
108
|
-
return
|
|
108
|
+
return f`<icon-alert-circle class="icon" size="m" data-test-id="${t}-heading-icon-error"></icon-alert-circle>`;
|
|
109
109
|
default:
|
|
110
110
|
return s;
|
|
111
111
|
}
|
|
@@ -118,7 +118,7 @@ let a = class extends C {
|
|
|
118
118
|
* @private
|
|
119
119
|
*/
|
|
120
120
|
renderIcon() {
|
|
121
|
-
return
|
|
121
|
+
return f`<slot name="icon">${this.getDefaultVariantIcon()}</slot>`;
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
124
|
* Template for the close button element. Called within the
|
|
@@ -128,14 +128,14 @@ let a = class extends C {
|
|
|
128
128
|
*/
|
|
129
129
|
renderCloseButton() {
|
|
130
130
|
var i;
|
|
131
|
-
return
|
|
131
|
+
return f`
|
|
132
132
|
<pie-icon-button
|
|
133
133
|
variant="ghost-secondary"
|
|
134
134
|
size="small"
|
|
135
|
-
class="${
|
|
135
|
+
class="${u}-icon-close"
|
|
136
136
|
data-test-id="${t}-icon-close"
|
|
137
137
|
@click="${this.handleCloseButton}"
|
|
138
|
-
aria-label="${
|
|
138
|
+
aria-label="${g((i = this.aria) == null ? void 0 : i.close)}">
|
|
139
139
|
<icon-close></icon-close>
|
|
140
140
|
</pie-icon-button>`;
|
|
141
141
|
}
|
|
@@ -171,30 +171,30 @@ let a = class extends C {
|
|
|
171
171
|
renderActionButton(i, o) {
|
|
172
172
|
const {
|
|
173
173
|
text: n,
|
|
174
|
-
ariaLabel:
|
|
174
|
+
ariaLabel: d,
|
|
175
175
|
size: e = $.size,
|
|
176
|
-
href:
|
|
177
|
-
target:
|
|
176
|
+
href: h,
|
|
177
|
+
target: p,
|
|
178
178
|
rel: k,
|
|
179
179
|
download: v
|
|
180
180
|
} = i;
|
|
181
181
|
if (!n)
|
|
182
182
|
return s;
|
|
183
|
-
const m = o === "leading" ? "primary" : "ghost", w = e && B.includes(e) ? e : $.size, b = !!
|
|
184
|
-
return
|
|
183
|
+
const m = o === "leading" ? "primary" : "ghost", w = e && B.includes(e) ? e : $.size, b = !!h;
|
|
184
|
+
return f`
|
|
185
185
|
<pie-button
|
|
186
186
|
variant="${m}"
|
|
187
|
-
size="${
|
|
188
|
-
aria-label="${
|
|
187
|
+
size="${g(w)}"
|
|
188
|
+
aria-label="${g(d)}"
|
|
189
189
|
@click="${() => this.handleActionClick(o)}"
|
|
190
190
|
data-test-id="${t}-${o}-action"
|
|
191
191
|
?isFullWidth="${this.hasStackedActions}"
|
|
192
192
|
tag="${b ? "a" : "button"}"
|
|
193
193
|
type="${b ? s : "button"}"
|
|
194
|
-
href="${
|
|
195
|
-
target="${
|
|
196
|
-
rel="${
|
|
197
|
-
download="${
|
|
194
|
+
href="${g(h)}"
|
|
195
|
+
target="${g(p)}"
|
|
196
|
+
rel="${g(k)}"
|
|
197
|
+
download="${g(v)}">
|
|
198
198
|
${n}
|
|
199
199
|
</pie-button>
|
|
200
200
|
`;
|
|
@@ -204,43 +204,43 @@ let a = class extends C {
|
|
|
204
204
|
variant: i,
|
|
205
205
|
position: o,
|
|
206
206
|
heading: n,
|
|
207
|
-
isDismissible:
|
|
207
|
+
isDismissible: d,
|
|
208
208
|
isCompact: e,
|
|
209
|
-
hideIcon:
|
|
210
|
-
leadingAction:
|
|
209
|
+
hideIcon: h,
|
|
210
|
+
leadingAction: p,
|
|
211
211
|
isOpen: k,
|
|
212
212
|
aria: v
|
|
213
213
|
} = this;
|
|
214
214
|
if (!k)
|
|
215
215
|
return s;
|
|
216
|
-
const m =
|
|
217
|
-
[
|
|
218
|
-
[`${
|
|
219
|
-
[`${
|
|
220
|
-
|
|
216
|
+
const m = d && !e, w = {
|
|
217
|
+
[u]: !0,
|
|
218
|
+
[`${u}--${i}`]: !0,
|
|
219
|
+
[`${u}--${o}`]: !0,
|
|
220
|
+
"is-compact": e
|
|
221
221
|
}, b = {
|
|
222
|
-
[`${
|
|
223
|
-
|
|
222
|
+
[`${u}-content-section`]: !0,
|
|
223
|
+
"is-dismissible": m
|
|
224
224
|
};
|
|
225
|
-
return
|
|
225
|
+
return f`
|
|
226
226
|
<div
|
|
227
227
|
data-test-id="${t}"
|
|
228
228
|
class="${O(w)}"
|
|
229
229
|
role="region"
|
|
230
230
|
aria-live="${i === "error" ? "assertive" : "polite"}"
|
|
231
231
|
aria-labelledby="${n ? `${t}-heading` : s}"
|
|
232
|
-
aria-label="${!n &&
|
|
232
|
+
aria-label="${!n && g(v == null ? void 0 : v.label)}">
|
|
233
233
|
${m ? this.renderCloseButton() : s}
|
|
234
234
|
|
|
235
235
|
<section class="${O(b)}">
|
|
236
|
-
${
|
|
236
|
+
${h ? s : this.renderIcon()}
|
|
237
237
|
<article>
|
|
238
238
|
${n ? this.renderNotificationHeading() : s}
|
|
239
239
|
<slot></slot>
|
|
240
240
|
</article>
|
|
241
241
|
</section>
|
|
242
242
|
|
|
243
|
-
${
|
|
243
|
+
${p != null && p.text ? this.renderFooter() : s}
|
|
244
244
|
</div>`;
|
|
245
245
|
}
|
|
246
246
|
};
|
|
@@ -250,11 +250,11 @@ c([
|
|
|
250
250
|
], a.prototype, "isOpen", 2);
|
|
251
251
|
c([
|
|
252
252
|
r({ type: String }),
|
|
253
|
-
N(t, E,
|
|
253
|
+
N(t, E, l.variant)
|
|
254
254
|
], a.prototype, "variant", 2);
|
|
255
255
|
c([
|
|
256
256
|
r({ type: String }),
|
|
257
|
-
N(t, T,
|
|
257
|
+
N(t, T, l.position)
|
|
258
258
|
], a.prototype, "position", 2);
|
|
259
259
|
c([
|
|
260
260
|
r({ type: Boolean })
|
|
@@ -267,7 +267,7 @@ c([
|
|
|
267
267
|
], a.prototype, "heading", 2);
|
|
268
268
|
c([
|
|
269
269
|
r({ type: String }),
|
|
270
|
-
N(t, L,
|
|
270
|
+
N(t, L, l.headingLevel)
|
|
271
271
|
], a.prototype, "headingLevel", 2);
|
|
272
272
|
c([
|
|
273
273
|
r({ type: Boolean })
|
|
@@ -297,10 +297,10 @@ export {
|
|
|
297
297
|
F as ON_NOTIFICATION_SUPPORTING_ACTION_CLICK_EVENT,
|
|
298
298
|
a as PieNotification,
|
|
299
299
|
B as actionSizes,
|
|
300
|
-
|
|
300
|
+
u as componentClass,
|
|
301
301
|
t as componentSelector,
|
|
302
302
|
$ as defaultActionButtonProps,
|
|
303
|
-
|
|
303
|
+
l as defaultProps,
|
|
304
304
|
L as headingLevels,
|
|
305
305
|
T as positions,
|
|
306
306
|
E as variants
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justeattakeaway/pie-notification",
|
|
3
3
|
"description": "PIE Design System Notification built using Web Components",
|
|
4
|
-
"version": "0.21.
|
|
4
|
+
"version": "0.21.20",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/justeattakeaway/pie",
|
|
@@ -45,15 +45,15 @@
|
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@custom-elements-manifest/analyzer": "0.9.0",
|
|
47
47
|
"@justeattakeaway/pie-components-config": "0.21.0",
|
|
48
|
-
"@justeattakeaway/pie-css": "0.
|
|
48
|
+
"@justeattakeaway/pie-css": "1.0.0",
|
|
49
49
|
"@justeattakeaway/pie-monorepo-utils": "0.7.0",
|
|
50
|
-
"@justeattakeaway/pie-wrapper-react": "0.14.
|
|
50
|
+
"@justeattakeaway/pie-wrapper-react": "0.14.4",
|
|
51
51
|
"cem-plugin-module-file-extensions": "0.0.5"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@justeattakeaway/pie-icon-button": "2.7.
|
|
55
|
-
"@justeattakeaway/pie-icons-webc": "1.21.
|
|
56
|
-
"@justeattakeaway/pie-webc-core": "
|
|
54
|
+
"@justeattakeaway/pie-icon-button": "2.7.5",
|
|
55
|
+
"@justeattakeaway/pie-icons-webc": "1.21.2",
|
|
56
|
+
"@justeattakeaway/pie-webc-core": "13.0.0"
|
|
57
57
|
},
|
|
58
58
|
"volta": {
|
|
59
59
|
"extends": "../../../package.json"
|
package/src/index.ts
CHANGED
|
@@ -116,7 +116,7 @@ export class PieNotification extends PieElement implements NotificationProps {
|
|
|
116
116
|
} = this;
|
|
117
117
|
const classes = {
|
|
118
118
|
[`${componentClass}-footer`]: true,
|
|
119
|
-
|
|
119
|
+
'is-compact': isCompact,
|
|
120
120
|
[`${componentClass}-footer--stacked`]: hasStackedActions && !isCompact,
|
|
121
121
|
};
|
|
122
122
|
return html`
|
|
@@ -292,12 +292,12 @@ export class PieNotification extends PieElement implements NotificationProps {
|
|
|
292
292
|
[componentClass]: true,
|
|
293
293
|
[`${componentClass}--${variant}`]: true,
|
|
294
294
|
[`${componentClass}--${position}`]: true,
|
|
295
|
-
|
|
295
|
+
'is-compact': isCompact,
|
|
296
296
|
};
|
|
297
297
|
|
|
298
298
|
const contentSectionClasses = {
|
|
299
299
|
[`${componentClass}-content-section`]: true,
|
|
300
|
-
|
|
300
|
+
'is-dismissible': showCloseButton,
|
|
301
301
|
};
|
|
302
302
|
|
|
303
303
|
return html`
|
package/src/notification.scss
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
font-weight: var(--notification-font-weight);
|
|
36
36
|
color: var(--dt-color-content-default);
|
|
37
37
|
|
|
38
|
-
&.
|
|
38
|
+
&.is-compact {
|
|
39
39
|
--notification-direction: row;
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
align-items: center;
|
|
98
98
|
gap: var(--dt-spacing-c);
|
|
99
99
|
|
|
100
|
-
&.
|
|
100
|
+
&.is-dismissible {
|
|
101
101
|
max-width: calc(100% - var(--notification-close-icon-offset) - 40px); // 40px is the size of the medium icon button
|
|
102
102
|
}
|
|
103
103
|
}
|
|
@@ -114,15 +114,21 @@
|
|
|
114
114
|
justify-content: flex-end;
|
|
115
115
|
gap: var(--dt-spacing-d);
|
|
116
116
|
|
|
117
|
-
&.
|
|
117
|
+
&.is-compact {
|
|
118
118
|
align-self: center;
|
|
119
119
|
margin-inline-start: auto;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
&.c-notification-footer--stacked {
|
|
123
|
+
@include media('<md') {
|
|
124
124
|
flex-direction: column-reverse;
|
|
125
125
|
}
|
|
126
|
+
|
|
127
|
+
@include media('>=md') {
|
|
128
|
+
> pie-button {
|
|
129
|
+
width: auto;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
126
132
|
}
|
|
127
133
|
}
|
|
128
134
|
}
|