@descope/web-components-ui 3.14.10 → 3.15.1

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.
@@ -5873,6 +5873,17 @@ const ListClass = compose(
5873
5873
  selector: () => 'slot[name="empty-state"]',
5874
5874
  property: 'font-family',
5875
5875
  },
5876
+ // allow overriding empty state height and padding from parent list components:
5877
+ emptyStateVerticalPadding: [
5878
+ {
5879
+ selector: () => 'slot[name="empty-state"]',
5880
+ property: 'padding-top',
5881
+ },
5882
+ {
5883
+ selector: () => 'slot[name="empty-state"]',
5884
+ property: 'padding-bottom',
5885
+ },
5886
+ ],
5876
5887
  },
5877
5888
  }),
5878
5889
  draggableMixin$1,
@@ -9890,6 +9901,14 @@ const OutboundAppsClass = compose(
9890
9901
  property: ListClass.cssVarList.horizontalPadding,
9891
9902
  },
9892
9903
  ],
9904
+ emptyStateMinHeight: {
9905
+ selector: () => ListClass.componentName,
9906
+ property: ListClass.cssVarList.minHeight,
9907
+ },
9908
+ emptyStateVerticalPadding: {
9909
+ selector: () => ListClass.componentName,
9910
+ property: ListClass.cssVarList.emptyStateVerticalPadding,
9911
+ },
9893
9912
  },
9894
9913
  }),
9895
9914
  draggableMixin$1,
@@ -9921,6 +9940,8 @@ const outboundApps = {
9921
9940
  [vars$R.listPadding]: '0',
9922
9941
  [vars$R.listBorderWidth]: '0',
9923
9942
  [vars$R.listBoxShadow]: 'none',
9943
+ [vars$R.emptyStateMinHeight]: '0',
9944
+ [vars$R.emptyStateVerticalPadding]: globals.spacing.lg,
9924
9945
 
9925
9946
  size: {
9926
9947
  xs: {
@@ -10417,6 +10438,14 @@ const TrustedDevicesClass = compose(
10417
10438
  property: ListClass.cssVarList.horizontalPadding,
10418
10439
  },
10419
10440
  ],
10441
+ emptyStateMinHeight: {
10442
+ selector: () => ListClass.componentName,
10443
+ property: ListClass.cssVarList.minHeight,
10444
+ },
10445
+ emptyStateVerticalPadding: {
10446
+ selector: () => ListClass.componentName,
10447
+ property: ListClass.cssVarList.emptyStateVerticalPadding,
10448
+ },
10420
10449
 
10421
10450
  itemVerticalPadding: {
10422
10451
  selector: ListItemClass.componentName,
@@ -10521,6 +10550,8 @@ const TrustedDevices = {
10521
10550
  [vars$P.listPadding]: '0',
10522
10551
  [vars$P.listBoxShadow]: 'none',
10523
10552
  [vars$P.listItemsGap]: globals.spacing.lg,
10553
+ [vars$P.emptyStateMinHeight]: '0',
10554
+ [vars$P.emptyStateVerticalPadding]: globals.spacing.lg,
10524
10555
 
10525
10556
  [vars$P.itemBorderColor]: globals.colors.surface.light,
10526
10557
  [vars$P.itemVerticalPadding]: globals.spacing.lg,
@@ -22912,6 +22943,10 @@ const customMixin$3 = (superclass) =>
22912
22943
  return this.getAttribute('opened') === 'true';
22913
22944
  }
22914
22945
 
22946
+ get closeOnOutsideClick() {
22947
+ return this.getAttribute('close-on-outside-click') === 'true';
22948
+ }
22949
+
22915
22950
  handleOpened() {
22916
22951
  if (this.opened) {
22917
22952
  this.style.display = '';
@@ -22977,6 +23012,28 @@ const customMixin$3 = (superclass) =>
22977
23012
  overlay._enterModalState = () => {};
22978
23013
 
22979
23014
  overlay.close = () => false;
23015
+
23016
+ // close the modal when the user clicks/taps the backdrop (outside the modal
23017
+ // box). Vaadin's own outside-click does not fire here because we keep the
23018
+ // overlay in the shadow DOM (see _attachOverlay above), which leaves it out
23019
+ // of Vaadin's overlay stack, so we detect the backdrop click ourselves.
23020
+ // the listener is always attached and reads `closeOnOutsideClick` at click
23021
+ // time, so toggling the attribute after init is respected.
23022
+ overlay.addEventListener('click', (event) => {
23023
+ if (!this.closeOnOutsideClick || !this.opened) return;
23024
+
23025
+ // the visible modal box; clicks inside it (content + its padding) keep
23026
+ // the modal open, only clicks on the dimmed backdrop close it. if we
23027
+ // can't find the box, don't close - safer than closing on an inside click
23028
+ const overlayPart = overlay.shadowRoot?.querySelector('[part="overlay"]');
23029
+ if (!overlayPart || event.composedPath().includes(overlayPart)) {
23030
+ return;
23031
+ }
23032
+
23033
+ // just close ourselves; consumers that need to react (e.g. ModalDriver
23034
+ // resetting the content) observe the `opened` attribute
23035
+ this.removeAttribute('opened');
23036
+ });
22980
23037
  }
22981
23038
  };
22982
23039