@descope/web-components-ui 1.0.230 → 1.0.231

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.
@@ -4273,14 +4273,14 @@ class RawLink extends createBaseClass({ componentName: componentName$m, baseSele
4273
4273
  }
4274
4274
  }
4275
4275
 
4276
- const selectors$1 = {
4276
+ const selectors$2 = {
4277
4277
  host: { selector: () => ':host' },
4278
4278
  anchor: {},
4279
4279
  wrapper: { selector: () => ':host > div' },
4280
4280
  text: { selector: () => TextClass.componentName },
4281
4281
  };
4282
4282
 
4283
- const { anchor, text: text$1, host: host$a, wrapper: wrapper$1 } = selectors$1;
4283
+ const { anchor, text: text$1, host: host$a, wrapper: wrapper$1 } = selectors$2;
4284
4284
 
4285
4285
  const LinkClass = compose(
4286
4286
  createStyleMixin({
@@ -4724,12 +4724,12 @@ class RawLoaderLinear extends createBaseClass({ componentName: componentName$i,
4724
4724
  }
4725
4725
  }
4726
4726
 
4727
- const selectors = {
4727
+ const selectors$1 = {
4728
4728
  after: { selector: '::after' },
4729
4729
  host: { selector: () => ':host' },
4730
4730
  };
4731
4731
 
4732
- const { after, host: host$7 } = selectors;
4732
+ const { after, host: host$7 } = selectors$1;
4733
4733
 
4734
4734
  const LoaderLinearClass = compose(
4735
4735
  createStyleMixin({
@@ -8356,7 +8356,7 @@ const notificationCardMixin = (superclass) =>
8356
8356
  // if animation is not applied to the element, the node will not be removed
8357
8357
  // from the DOM. We should avoid that. So, if in any case we allow
8358
8358
  // customizing the animation - we should check if animation is applied
8359
- // and if it's not applied - remove the elemnt from the DOM and dispatch
8359
+ // and if it's not applied - remove the element from the DOM and dispatch
8360
8360
  // `card-closed` event.
8361
8361
  this.baseElement.addEventListener('animationend', () => {
8362
8362
  this.remove();
@@ -8365,38 +8365,68 @@ const notificationCardMixin = (superclass) =>
8365
8365
 
8366
8366
  this.setAttribute('opened', 'false');
8367
8367
  }
8368
+
8369
+ constructor() {
8370
+ super();
8371
+
8372
+ this.baseElement.innerHTML = `
8373
+ <div part="root">
8374
+ <div part="content">
8375
+ <slot></slot>
8376
+ </div>
8377
+ <div part="close">
8378
+ <slot name="close"></slot>
8379
+ </div>
8380
+ </div>
8381
+ `;
8382
+
8383
+ this.closeEle = this.shadowRoot.querySelector('[part="close"]');
8384
+ }
8385
+
8386
+ init() {
8387
+ super.init?.();
8388
+
8389
+ this.closeEle.onclick = () => {
8390
+ this.close();
8391
+ };
8392
+ }
8368
8393
  };
8369
8394
 
8395
+ const selectors = {
8396
+ content: () => 'vaadin-notification-card::part(content)',
8397
+ overlay: () => 'vaadin-notification-card::part(overlay)',
8398
+ };
8399
+
8370
8400
  const NotificationCardClass = compose(
8371
8401
  createStyleMixin({
8372
8402
  mappings: {
8373
- hostMinWidth: { selector: () => '::part(content)', property: 'min-width' },
8403
+ hostMinWidth: { selector: selectors.content, property: 'min-width' },
8374
8404
  fontFamily: {},
8375
8405
  fontSize: {},
8376
- backgroundColor: { selector: () => '::part(content)' },
8406
+ backgroundColor: { selector: selectors.content },
8377
8407
  textColor: { property: 'color' },
8378
8408
  boxShadow: {},
8379
- borderWidth: { selector: () => '::part(content)', property: 'border-width' },
8380
- borderColor: { selector: () => '::part(content)', property: 'border-color' },
8381
- borderStyle: { selector: () => '::part(content)', property: 'border-style' },
8409
+ borderWidth: { selector: selectors.content, property: 'border-width' },
8410
+ borderColor: { selector: selectors.content, property: 'border-color' },
8411
+ borderStyle: { selector: selectors.content, property: 'border-style' },
8382
8412
  borderRadius: [
8383
- { selector: () => '::part(content)', property: 'border-radius' },
8384
- { selector: () => '::part(overlay)', property: 'border-radius' },
8413
+ { selector: selectors.content, property: 'border-radius' },
8414
+ { selector: selectors.overlay, property: 'border-radius' },
8385
8415
  ],
8386
8416
  verticalPadding: [
8387
- { selector: () => '::part(content)', property: 'padding-top' },
8388
- { selector: () => '::part(content)', property: 'padding-bottom' },
8417
+ { selector: selectors.content, property: 'padding-top' },
8418
+ { selector: selectors.content, property: 'padding-bottom' },
8389
8419
  ],
8390
8420
  horizontalPadding: [
8391
- { selector: () => '::part(content)', property: 'padding-right' },
8392
- { selector: () => '::part(content)', property: 'padding-left' },
8421
+ { selector: selectors.content, property: 'padding-right' },
8422
+ { selector: selectors.content, property: 'padding-left' },
8393
8423
  ],
8394
8424
  },
8395
8425
  }),
8396
8426
  notificationCardMixin
8397
8427
  )(
8398
8428
  createProxy({
8399
- slots: [''],
8429
+ slots: [],
8400
8430
  wrappedEleName: 'vaadin-notification-card',
8401
8431
  style: () => `
8402
8432
  vaadin-notification-card {
@@ -8406,6 +8436,24 @@ const NotificationCardClass = compose(
8406
8436
  box-shadow: none;
8407
8437
  background: none;
8408
8438
  }
8439
+
8440
+ [part="close"] {
8441
+ cursor: pointer;
8442
+ display: flex;
8443
+ }
8444
+
8445
+ [part="content"] {
8446
+ display: flex;
8447
+ align-items: center;
8448
+ flex-grow: 1;
8449
+ }
8450
+
8451
+ [part="root"] {
8452
+ display: flex;
8453
+ align-items: center;
8454
+ justify-content: space-between;
8455
+ width: 100%;
8456
+ }
8409
8457
  `,
8410
8458
  excludeAttrsSync: ['tabindex'],
8411
8459
  componentName: componentName$2,
@@ -8693,7 +8741,7 @@ const NotificationMixin = (superclass) =>
8693
8741
  if (!NotificationMixinClass._container.isConnected) {
8694
8742
  // Then, we're adding the container to the parentNode, which is the desired location
8695
8743
  // for us on the DOM
8696
- that.parentNode.appendChild(NotificationMixinClass._container);
8744
+ setTimeout(() => that.parentNode.appendChild(NotificationMixinClass._container));
8697
8745
  }
8698
8746
 
8699
8747
  return NotificationMixinClass._container;
@@ -8706,13 +8754,12 @@ const NotificationMixin = (superclass) =>
8706
8754
  },
8707
8755
  });
8708
8756
 
8709
- // we want to replace the card with vaadin's notification card, so the notification removal process
8710
- // will work properly.
8711
- const origAnimatedRemoveNotificationCard = this.baseElement._animatedRemoveNotificationCard;
8712
- this.baseElement._animatedRemoveNotificationCard = () => {
8713
- this.#card = this.#card.shadowRoot.querySelector('vaadin-notification-card');
8714
- origAnimatedRemoveNotificationCard.call(this.baseElement);
8715
- };
8757
+ // we want to replace the card with vaadin's remove notification so it will not throw
8758
+ this.baseElement._removeNotificationCard = this.close.bind(this);
8759
+ }
8760
+
8761
+ close() {
8762
+ this.#card.close();
8716
8763
  }
8717
8764
 
8718
8765
  init() {
@@ -8728,8 +8775,9 @@ const NotificationMixin = (superclass) =>
8728
8775
  };
8729
8776
  }
8730
8777
 
8778
+ // eslint-disable-next-line class-methods-use-this
8731
8779
  get isContainerEmpty() {
8732
- return !this.baseElement._container.children.length;
8780
+ return !NotificationMixinClass._container.children.length;
8733
8781
  }
8734
8782
 
8735
8783
  // eslint-disable-next-line class-methods-use-this