@justeattakeaway/pie-notification 0.24.9 → 0.24.11

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/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { classMap as k } from "lit/directives/class-map.js";
3
3
  import { html as d, unsafeStatic as I } from "lit/static-html.js";
4
4
  import { validPropertyValues as $, safeCustomElement as S, dispatchCustomEvent as z } from "@justeattakeaway/pie-webc-core";
5
5
  import { property as s, queryAssignedElements as _ } from "lit/decorators.js";
6
- import { ifDefined as g } from "lit/directives/if-defined.js";
6
+ import { ifDefined as u } 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,7 +16,7 @@ const y = class y extends O {
16
16
  this.getAttribute("v") || this.setAttribute("v", y.v);
17
17
  }
18
18
  };
19
- y.v = "0.24.9";
19
+ y.v = "0.24.11";
20
20
  let A = y;
21
21
  const E = ["neutral", "neutral-alternative", "info", "success", "warning", "error", "translucent"], L = ["h2", "h3", "h4", "h5", "h6"], T = ["inline-content", "full-width"], B = ["small", "large"], D = ["small-productive", "xsmall"], o = "pie-notification", h = "c-notification", V = `${o}-close`, P = `${o}-open`, F = `${o}-leading-action-click`, j = `${o}-supporting-action-click`, C = {
22
22
  text: "",
@@ -36,8 +36,8 @@ const E = ["neutral", "neutral-alternative", "info", "success", "warning", "erro
36
36
  supportingAction: C
37
37
  }, G = "*,*: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-btn-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);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.c-notification--small{--notification-close-btn-size: 40px;--notification-content-min-height: 20px;--notification-content-min-height-dismissible: 32px}.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-btn-offset) - 40px)}.c-notification-icon-close{position:absolute;inset-block-start:var(--notification-close-btn-offset);inset-inline-end:var(--notification-close-btn-offset)}.c-notification-footer{display:flex;flex-direction:row;justify-content:flex-end;gap:var(--dt-spacing-d)}.c-notification-footer pie-button,.c-notification-footer ::slotted(pie-button){margin-block-start: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;gap:0}.c-notification-footer.c-notification-footer--stacked pie-button,.c-notification-footer.c-notification-footer--stacked ::slotted(pie-button){--btn-inline-size: 100%}}@media(min-width:768px){.c-notification-footer.c-notification-footer--stacked>pie-button{width:auto}}.c-notification-footer ::slotted(:not(pie-button)){display:none}@media(max-width:767px){.c-notification.c-notification--small{--notification-heading-font-family: var(--dt-font-heading-xs-family);--notification-heading-font-size: calc(var(--dt-font-heading-xs-size--narrow) * 1px);--notification-heading-line-height: calc(var(--dt-font-heading-xs-line-height--narrow) * 1px);--notification-heading-font-weight: var(--dt-font-heading-xs-weight);--notification-font-family: var(--dt-font-body-s-family);--notification-font-size: calc(var(--dt-font-body-s-size) * 1px);--notification-line-height: calc(var(--dt-font-body-s-line-height) * 1px);--notification-font-weight: var(--dt-font-body-s-weight);--notification-close-btn-offset: var(--dt-spacing-a);padding:var(--dt-spacing-b);gap:0}.c-notification.c-notification--small.is-compact{gap:var(--dt-spacing-b)}.c-notification.c-notification--small .c-notification-icon-close{inset-block-start:var(--notification-close-btn-offset);inset-inline-end:var(--notification-close-btn-offset)}.c-notification.c-notification--small .c-notification-content-section{gap:var(--dt-spacing-b);min-height:var(--notification-content-min-height)}.c-notification.c-notification--small .c-notification-content-section.is-dismissible{min-height:var(--notification-content-min-height-dismissible);max-width:calc(100% - var(--notification-close-btn-size))}.c-notification.c-notification--small.is-compact .c-notification-content-section{flex:1;min-width:0}.c-notification.c-notification--small .c-notification-footer{align-items:flex-end}.c-notification.c-notification--small .c-notification-footer.is-compact{align-self:stretch;align-items:center}.c-notification.c-notification--small .c-notification-footer pie-button,.c-notification.c-notification--small .c-notification-footer ::slotted(pie-button){margin-block-start:var(--dt-spacing-b)}}:host([isCompact]) .c-notification-footer pie-button,:host([isCompact]) .c-notification-footer ::slotted(pie-button){margin-block-start:0}.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)}";
38
38
  var H = Object.defineProperty, K = Object.getOwnPropertyDescriptor, e = (i, t, a, l) => {
39
- for (var c = l > 1 ? void 0 : l ? K(t, a) : t, p = i.length - 1, u; p >= 0; p--)
40
- (u = i[p]) && (c = (l ? u(t, a, c) : u(c)) || c);
39
+ for (var c = l > 1 ? void 0 : l ? K(t, a) : t, p = i.length - 1, g; p >= 0; p--)
40
+ (g = i[p]) && (c = (l ? g(t, a, c) : g(c)) || c);
41
41
  return l && c && H(t, a, c), c;
42
42
  };
43
43
  let n = class extends A {
@@ -155,7 +155,7 @@ let n = class extends A {
155
155
  class="${h}-icon-close"
156
156
  data-test-id="${o}-icon-close"
157
157
  @click="${this.handleCloseButton}"
158
- aria-label="${g((i = this.aria) == null ? void 0 : i.close)}">
158
+ .aria="${{ label: (i = this.aria) == null ? void 0 : i.close }}">
159
159
  <icon-close></icon-close>
160
160
  </pie-icon-button>`;
161
161
  }
@@ -194,7 +194,7 @@ let n = class extends A {
194
194
  ariaLabel: l,
195
195
  size: c,
196
196
  href: p,
197
- target: u,
197
+ target: g,
198
198
  rel: x,
199
199
  download: v
200
200
  } = i;
@@ -204,17 +204,17 @@ let n = class extends A {
204
204
  return d`
205
205
  <pie-button
206
206
  variant="${m}"
207
- size="${g(w)}"
208
- aria-label="${g(l)}"
207
+ size="${u(w)}"
208
+ aria-label="${u(l)}"
209
209
  @click="${() => this.handleActionClick(t)}"
210
210
  data-test-id="${o}-${t}-action"
211
211
  ?isFullWidth="${this.hasStackedActions}"
212
212
  tag="${b ? "a" : "button"}"
213
213
  type="${b ? f : "button"}"
214
- href="${g(p)}"
215
- target="${g(u)}"
216
- rel="${g(x)}"
217
- download="${g(v)}">
214
+ href="${u(p)}"
215
+ target="${u(g)}"
216
+ rel="${u(x)}"
217
+ download="${u(v)}">
218
218
  ${a}
219
219
  </pie-button>
220
220
  `;
@@ -227,7 +227,7 @@ let n = class extends A {
227
227
  heading: l,
228
228
  isDismissible: c,
229
229
  isCompact: p,
230
- hideIcon: u,
230
+ hideIcon: g,
231
231
  isOpen: x,
232
232
  aria: v
233
233
  } = this;
@@ -250,11 +250,11 @@ let n = class extends A {
250
250
  role="region"
251
251
  aria-live="${i === "error" ? "assertive" : "polite"}"
252
252
  aria-labelledby="${l ? `${o}-heading` : f}"
253
- aria-label="${!l && g(v == null ? void 0 : v.label)}">
253
+ aria-label="${!l && u(v == null ? void 0 : v.label)}">
254
254
  ${m ? this.renderCloseButton() : f}
255
255
 
256
256
  <div class="${k(b)}">
257
- ${u ? f : this.renderIcon()}
257
+ ${g ? f : this.renderIcon()}
258
258
  <div>
259
259
  ${l ? this.renderNotificationHeading() : f}
260
260
  <slot></slot>
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.24.9",
4
+ "version": "0.24.11",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/justeattakeaway/pie",
@@ -49,9 +49,9 @@
49
49
  "@justeattakeaway/pie-wrapper-react": "0.14.5"
50
50
  },
51
51
  "dependencies": {
52
- "@justeattakeaway/pie-icon-button": "2.7.25",
53
- "@justeattakeaway/pie-icons-webc": "1.27.0",
54
- "@justeattakeaway/pie-webc-core": "16.0.0"
52
+ "@justeattakeaway/pie-icon-button": "2.7.26",
53
+ "@justeattakeaway/pie-icons-webc": "1.27.1",
54
+ "@justeattakeaway/pie-webc-core": "16.1.0"
55
55
  },
56
56
  "customElements": "custom-elements.json",
57
57
  "sideEffects": [
package/src/index.ts CHANGED
@@ -238,7 +238,7 @@ export class PieNotification extends PieElement implements NotificationProps {
238
238
  class="${componentClass}-icon-close"
239
239
  data-test-id="${componentSelector}-icon-close"
240
240
  @click="${this.handleCloseButton}"
241
- aria-label="${ifDefined(this.aria?.close)}">
241
+ .aria="${{ label: this.aria?.close }}">
242
242
  <icon-close></icon-close>
243
243
  </pie-icon-button>`;
244
244
  }