@descope/web-components-ui 1.111.0 → 1.113.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 (28) hide show
  1. package/dist/cjs/index.cjs.js +116 -50
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +124 -57
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/DescopeDev.js +1 -1
  6. package/dist/umd/DescopeDev.js.map +1 -1
  7. package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js +1 -1
  8. package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js.map +1 -1
  9. package/dist/umd/descope-button.js +1 -1
  10. package/dist/umd/descope-button.js.map +1 -1
  11. package/dist/umd/descope-date-field-descope-calendar-index-js.js +1 -1
  12. package/dist/umd/descope-date-field-descope-calendar-index-js.js.map +1 -1
  13. package/dist/umd/descope-outbound-apps.js +1 -1
  14. package/dist/umd/descope-outbound-apps.js.map +1 -1
  15. package/dist/umd/descope-timer-button.js +1 -1
  16. package/dist/umd/descope-timer-button.js.map +1 -1
  17. package/dist/umd/descope-upload-file-index-js.js +1 -1
  18. package/dist/umd/descope-upload-file-index-js.js.map +1 -1
  19. package/dist/umd/descope-user-attribute-index-js.js +1 -1
  20. package/dist/umd/descope-user-attribute-index-js.js.map +1 -1
  21. package/dist/umd/descope-user-auth-method-index-js.js +4 -4
  22. package/dist/umd/descope-user-auth-method-index-js.js.map +1 -1
  23. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
  24. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js.map +1 -1
  25. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
  26. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js.map +1 -1
  27. package/package.json +4 -4
  28. package/src/components/descope-user-auth-method/UserAuthMethodClass.js +72 -18
@@ -1848,7 +1848,7 @@ const inputEventsDispatchingMixin$1 = (superclass) =>
1848
1848
  }
1849
1849
  };
1850
1850
 
1851
- const observedAttributes$7 = ['required', 'pattern'];
1851
+ const observedAttributes$6 = ['required', 'pattern'];
1852
1852
 
1853
1853
  const errorAttributes$1 = {
1854
1854
  valueMissing: 'data-errormessage-value-missing',
@@ -1867,7 +1867,7 @@ const inputValidationMixin$1 = (superclass) =>
1867
1867
  #validationTarget = validationTargetSymbol$1;
1868
1868
 
1869
1869
  static get observedAttributes() {
1870
- return [...(superclass.observedAttributes || []), ...observedAttributes$7];
1870
+ return [...(superclass.observedAttributes || []), ...observedAttributes$6];
1871
1871
  }
1872
1872
 
1873
1873
  static get formAssociated() {
@@ -2070,7 +2070,7 @@ const inputValidationMixin$1 = (superclass) =>
2070
2070
  attributeChangedCallback(attrName, oldValue, newValue) {
2071
2071
  super.attributeChangedCallback?.(attrName, oldValue, newValue);
2072
2072
 
2073
- if (observedAttributes$7.includes(attrName)) {
2073
+ if (observedAttributes$6.includes(attrName)) {
2074
2074
  this.#setValidity();
2075
2075
  }
2076
2076
  }
@@ -3089,7 +3089,7 @@ const ButtonClass = compose(
3089
3089
  padding: 0;
3090
3090
  }
3091
3091
  `,
3092
- excludeAttrsSync: ['tabindex'],
3092
+ excludeAttrsSync: ['tabindex', 'class'],
3093
3093
  componentName: componentName$1b,
3094
3094
  })
3095
3095
  );
@@ -3790,7 +3790,7 @@ const createProxy = ({
3790
3790
  return ProxyClass;
3791
3791
  };
3792
3792
 
3793
- const observedAttributes$6 = ['required', 'pattern'];
3793
+ const observedAttributes$5 = ['required', 'pattern'];
3794
3794
 
3795
3795
  const errorAttributes = {
3796
3796
  valueMissing: 'data-errormessage-value-missing',
@@ -3809,7 +3809,7 @@ const inputValidationMixin = (superclass) =>
3809
3809
  #validationTarget = validationTargetSymbol;
3810
3810
 
3811
3811
  static get observedAttributes() {
3812
- return [...(superclass.observedAttributes || []), ...observedAttributes$6];
3812
+ return [...(superclass.observedAttributes || []), ...observedAttributes$5];
3813
3813
  }
3814
3814
 
3815
3815
  static get formAssociated() {
@@ -3987,7 +3987,7 @@ const inputValidationMixin = (superclass) =>
3987
3987
  attributeChangedCallback(attrName, oldValue, newValue) {
3988
3988
  super.attributeChangedCallback?.(attrName, oldValue, newValue);
3989
3989
 
3990
- if (observedAttributes$6.includes(attrName)) {
3990
+ if (observedAttributes$5.includes(attrName)) {
3991
3991
  this.#setValidity();
3992
3992
  }
3993
3993
  }
@@ -7596,12 +7596,12 @@ const LoaderRadialClass = compose$1(
7596
7596
 
7597
7597
  const componentName$T = getComponentName$1('passcode');
7598
7598
 
7599
- const observedAttributes$5 = ['digits'];
7599
+ const observedAttributes$4 = ['digits'];
7600
7600
 
7601
7601
  const customMixin$b = (superclass) =>
7602
7602
  class PasscodeMixinClass extends superclass {
7603
7603
  static get observedAttributes() {
7604
- return observedAttributes$5.concat(superclass.observedAttributes || []);
7604
+ return observedAttributes$4.concat(superclass.observedAttributes || []);
7605
7605
  }
7606
7606
 
7607
7607
  get digits() {
@@ -11321,7 +11321,7 @@ const getFilename = (fileObj) => {
11321
11321
 
11322
11322
  const componentName$I = getComponentName$1('upload-file');
11323
11323
 
11324
- const observedAttributes$4 = [
11324
+ const observedAttributes$3 = [
11325
11325
  'title',
11326
11326
  'description',
11327
11327
  'button-label',
@@ -11338,7 +11338,7 @@ const BaseInputClass$4 = createBaseInputClass({ componentName: componentName$I,
11338
11338
 
11339
11339
  class RawUploadFile extends BaseInputClass$4 {
11340
11340
  static get observedAttributes() {
11341
- return observedAttributes$4.concat(BaseInputClass$4.observedAttributes || []);
11341
+ return observedAttributes$3.concat(BaseInputClass$4.observedAttributes || []);
11342
11342
  }
11343
11343
 
11344
11344
  constructor() {
@@ -14679,10 +14679,13 @@ class RawUserAuthMethod extends createBaseClass({
14679
14679
  </div>
14680
14680
 
14681
14681
  <div class="btn-wrapper">
14682
- <descope-button size="sm" variant="link" mode="primary">
14682
+ <descope-button class="btn unfulfilled hidden" size="sm" variant="link" mode="primary">
14683
14683
  <slot name="button-icon"></slot>
14684
14684
  </descope-button>
14685
- <div class="fulfilled-indicator">
14685
+ <descope-button class="btn fulfilled hidden" size="sm" variant="link" mode="primary">
14686
+ <slot name="fulfilled-button-icon"></slot>
14687
+ </descope-button>
14688
+ <div class="status-indicator hidden">
14686
14689
  <vaadin-icon src=${greenVIcon}></vaadin-icon>
14687
14690
  </div>
14688
14691
  <descope-button class="hidden-btn" size="sm" variant="link" mode="primary"></descope-button>
@@ -14731,7 +14734,7 @@ class RawUserAuthMethod extends createBaseClass({
14731
14734
  display: inline-flex;
14732
14735
  }
14733
14736
 
14734
- .fulfilled-indicator {
14737
+ .status-indicator {
14735
14738
  width: 1em;
14736
14739
  height: 1em;
14737
14740
  display: flex;
@@ -14746,6 +14749,8 @@ class RawUserAuthMethod extends createBaseClass({
14746
14749
  .hidden-btn {
14747
14750
  width: 0;
14748
14751
  overflow: hidden;
14752
+ opacity: 0;
14753
+ pointer-events: none;
14749
14754
  }
14750
14755
 
14751
14756
  slot[name="method-icon"]{
@@ -14756,8 +14761,9 @@ class RawUserAuthMethod extends createBaseClass({
14756
14761
  this
14757
14762
  );
14758
14763
 
14759
- this.button = this.shadowRoot.querySelector('descope-button');
14760
- this.fulfilledIndicator = this.shadowRoot.querySelector('.fulfilled-indicator');
14764
+ this.unfulfilledButton = this.shadowRoot.querySelector('.btn.unfulfilled');
14765
+ this.fulfilledButton = this.shadowRoot.querySelector('.btn.fulfilled');
14766
+ this.statusIndicator = this.shadowRoot.querySelector('.status-indicator');
14761
14767
  this.labelText = this.shadowRoot.querySelector('descope-text[data-id="label-text"]');
14762
14768
  }
14763
14769
 
@@ -14766,49 +14772,91 @@ class RawUserAuthMethod extends createBaseClass({
14766
14772
  this.labelText.setAttribute('title', this.label);
14767
14773
  }
14768
14774
 
14769
- onButtonLabelChange() {
14770
- let textSpanEle = this.button.querySelector('span');
14775
+ updateButtonLabel(btnRef, label) {
14776
+ let textSpanEle = btnRef.querySelector('span');
14771
14777
 
14772
- if (this.buttonLabel) {
14778
+ if (label) {
14773
14779
  if (!textSpanEle) {
14774
14780
  textSpanEle = document.createElement('span');
14775
- this.button.appendChild(textSpanEle);
14781
+ btnRef.appendChild(textSpanEle);
14776
14782
  }
14777
- textSpanEle.innerText = this.buttonLabel;
14783
+ textSpanEle.innerText = label;
14778
14784
  } else if (textSpanEle) {
14779
- this.button.removeChild(textSpanEle);
14785
+ btnRef.removeChild(textSpanEle);
14780
14786
  }
14781
14787
  }
14782
14788
 
14783
14789
  onFulfilledChange() {
14784
- this.button.classList.toggle('hidden', this.isFulfilled);
14785
- this.fulfilledIndicator.classList.toggle('hidden', !this.isFulfilled);
14790
+ if (this.isFulfilled) {
14791
+ this.unfulfilledButton.classList.add('hidden');
14792
+ this.handleFulfilled();
14793
+ } else {
14794
+ this.fulfilledButton.classList.add('hidden');
14795
+ this.handleUnfulfilled();
14796
+ }
14797
+ }
14798
+
14799
+ handleFulfilled() {
14800
+ this.fulfilledButton.classList.toggle('hidden', !this.isFulfilledEditable);
14801
+ this.statusIndicator.classList.toggle('hidden', this.isFulfilledEditable);
14802
+ }
14803
+
14804
+ handleUnfulfilled() {
14805
+ this.unfulfilledButton.classList.toggle('hidden', !this.isUnfulfilledEditable);
14806
+ this.statusIndicator.classList.toggle('hidden', this.isUnfulfilledEditable);
14786
14807
  }
14787
14808
 
14788
14809
  get label() {
14789
14810
  return this.getAttribute('label') || '';
14790
14811
  }
14791
14812
 
14792
- get buttonLabel() {
14813
+ get unfulfilledButtonLabel() {
14793
14814
  return this.getAttribute('button-label') || '';
14794
14815
  }
14795
14816
 
14817
+ get fulfilledButtonLabel() {
14818
+ return this.getAttribute('fulfilled-button-label') || '';
14819
+ }
14820
+
14796
14821
  get isFulfilled() {
14797
14822
  return this.getAttribute('fulfilled') === 'true';
14798
14823
  }
14799
14824
 
14825
+ get isFulfilledEditable() {
14826
+ return this.getAttribute('fulfilled-editable') === 'true';
14827
+ }
14828
+
14829
+ get isUnfulfilledEditable() {
14830
+ // this is to keep backward compatibility with previous versions
14831
+ return this.getAttribute('unfulfilled-editable') !== 'false';
14832
+ }
14833
+
14800
14834
  init() {
14801
14835
  this.onLabelChange();
14802
- this.onButtonLabelChange();
14836
+ this.updateButtonLabel(this.fulfilledButton, this.fulfilledButtonLabel);
14837
+ this.updateButtonLabel(this.unfulfilledButton, this.unfulfilledButtonLabel);
14803
14838
  this.onFulfilledChange();
14804
14839
 
14805
- this.button.addEventListener('click', () =>
14840
+ this.unfulfilledButton.addEventListener('click', () =>
14806
14841
  this.dispatchEvent(new CustomEvent('button-clicked', { bubbles: true, composed: true }))
14807
14842
  );
14843
+
14844
+ this.fulfilledButton.addEventListener('click', () => {
14845
+ this.dispatchEvent(
14846
+ new CustomEvent('fulfilled-button-clicked', { bubbles: true, composed: true })
14847
+ );
14848
+ });
14808
14849
  }
14809
14850
 
14810
14851
  static get observedAttributes() {
14811
- return ['label', 'fulfilled'].concat(super.observedAttributes);
14852
+ return [
14853
+ 'label',
14854
+ 'fulfilled',
14855
+ 'button-label',
14856
+ 'fulfilled-button-label',
14857
+ 'fulfilled-editable',
14858
+ 'unfulfilled-editable',
14859
+ ].concat(super.observedAttributes);
14812
14860
  }
14813
14861
 
14814
14862
  attributeChangedCallback(name, oldValue, newValue) {
@@ -14822,7 +14870,13 @@ class RawUserAuthMethod extends createBaseClass({
14822
14870
  } else if (name === 'fulfilled') {
14823
14871
  this.onFulfilledChange();
14824
14872
  } else if (name === 'button-label') {
14825
- this.onButtonLabelChange();
14873
+ this.updateButtonLabel(this.unfulfilledButton, this.unfulfilledButtonLabel);
14874
+ } else if (name === 'fulfilled-button-label') {
14875
+ this.updateButtonLabel(this.fulfilledButton, this.fulfilledButtonLabel);
14876
+ } else if (name === 'fulfilled-editable' && this.isFulfilled) {
14877
+ this.handleFulfilled();
14878
+ } else if (name === 'unfulfilled-editable' && !this.isFulfilled) {
14879
+ this.handleUnfulfilled();
14826
14880
  }
14827
14881
  }
14828
14882
  }
@@ -19806,12 +19860,12 @@ var alert$1 = /*#__PURE__*/Object.freeze({
19806
19860
 
19807
19861
  const componentName$c = getComponentName$1('hcaptcha');
19808
19862
 
19809
- const observedAttributes$3 = ['enabled', 'site-key'];
19863
+ const observedAttributes$2 = ['enabled', 'site-key'];
19810
19864
 
19811
19865
  const BaseInputClass$1 = createBaseInputClass({ componentName: componentName$c, baseSelector: ':host > div' });
19812
19866
  class RawHcaptcha extends BaseInputClass$1 {
19813
19867
  static get observedAttributes() {
19814
- return observedAttributes$3.concat(BaseInputClass$1.observedAttributes || []);
19868
+ return observedAttributes$2.concat(BaseInputClass$1.observedAttributes || []);
19815
19869
  }
19816
19870
 
19817
19871
  attributeChangedCallback(attrName, oldValue, newValue) {
@@ -20649,7 +20703,7 @@ const formatTime = (ms = 0) => {
20649
20703
 
20650
20704
  const componentName$7 = getComponentName('timer');
20651
20705
 
20652
- const observedAttributes$2 = ['seconds', 'hide-icon', 'paused'];
20706
+ const observedAttributes$1 = ['seconds', 'hide-icon', 'paused'];
20653
20707
 
20654
20708
  const BaseClass$3 = createBaseClass$1({
20655
20709
  componentName: componentName$7,
@@ -20664,7 +20718,7 @@ class RawTimer extends BaseClass$3 {
20664
20718
  #intervalId;
20665
20719
 
20666
20720
  static get observedAttributes() {
20667
- return observedAttributes$2.concat(BaseClass$3.observedAttributes || []);
20721
+ return observedAttributes$1.concat(BaseClass$3.observedAttributes || []);
20668
20722
  }
20669
20723
 
20670
20724
  constructor() {
@@ -21770,8 +21824,6 @@ var recoveryCodes$1 = /*#__PURE__*/Object.freeze({
21770
21824
 
21771
21825
  const componentName$2 = getComponentName('outbound-apps');
21772
21826
 
21773
- const observedAttributes$1 = ['connect-button-label', 'disconnect-button-label', 'data'];
21774
-
21775
21827
  const itemRenderer = (
21776
21828
  { name, description, logo, appId, isConnected },
21777
21829
  _,
@@ -21786,22 +21838,21 @@ const itemRenderer = (
21786
21838
  size=${ref.size}
21787
21839
  class="app-logo"
21788
21840
  ></descope-avatar>
21789
- <div class="content">
21790
- <div class="app-title">
21841
+
21842
+ <div class="content">
21791
21843
  <descope-text
21844
+ class="app-title"
21792
21845
  variant="subtitle1"
21793
21846
  mode="primary"
21794
21847
  >${name}</descope-text>
21795
- </div>
21796
21848
  ${
21797
21849
  description
21798
21850
  ? `
21799
- <div class="app-description">
21800
21851
  <descope-text
21852
+ class="app-description"
21801
21853
  variant="body2"
21802
21854
  mode="primary"
21803
21855
  >${description}</descope-text>
21804
- </div>
21805
21856
  `
21806
21857
  : ''
21807
21858
  }
@@ -21821,15 +21872,13 @@ const BaseClass$1 = createBaseClass$1({
21821
21872
  });
21822
21873
 
21823
21874
  class RawOutboundAppsClass extends BaseClass$1 {
21824
- static get observedAttributes() {
21825
- return observedAttributes$1;
21826
- }
21827
-
21828
21875
  constructor() {
21829
21876
  super();
21830
21877
 
21831
21878
  this.attachShadow({ mode: 'open' }).innerHTML = `
21832
- <descope-list></descope-list>
21879
+ <descope-list>
21880
+ <slot name="empty-state" slot="empty-state"></slot>
21881
+ </descope-list>
21833
21882
  `;
21834
21883
 
21835
21884
  this.appsList = this.shadowRoot.querySelector('descope-list');
@@ -21846,6 +21895,13 @@ class RawOutboundAppsClass extends BaseClass$1 {
21846
21895
  }
21847
21896
  .content {
21848
21897
  flex-grow: 1;
21898
+ display: flex;
21899
+ flex-direction: column;
21900
+ }
21901
+ .app-title,
21902
+ .app-description {
21903
+ display: flex;
21904
+ direction: inherit;
21849
21905
  }
21850
21906
  descope-list {
21851
21907
  display: block;
@@ -21863,11 +21919,17 @@ class RawOutboundAppsClass extends BaseClass$1 {
21863
21919
  this.appsList.addEventListener('click', this.onAppsListClick.bind(this));
21864
21920
  }
21865
21921
 
21922
+ get readonly() {
21923
+ return this.getAttribute('readonly') === 'true';
21924
+ }
21925
+
21866
21926
  onAppsListClick(e) {
21867
- const id = e.srcElement.getAttribute('data-outbound-app-id');
21868
- const action = e.srcElement.getAttribute('data-action');
21869
- if (id && action) {
21870
- this.dispatchEvent(new CustomEvent(`${action}-clicked`, { bubbles: true, detail: { id, action } }));
21927
+ if (!this.readonly) {
21928
+ const id = e.srcElement.getAttribute('data-outbound-app-id');
21929
+ const action = e.srcElement.getAttribute('data-action');
21930
+ if (id && action) {
21931
+ this.dispatchEvent(new CustomEvent(`${action}-clicked`, { bubbles: true, detail: { id, action } }));
21932
+ }
21871
21933
  }
21872
21934
  }
21873
21935
 
@@ -21918,6 +21980,10 @@ const OutboundAppsClass = compose(
21918
21980
  selector: () => ' .app-logo',
21919
21981
  property: 'margin-inline-end'
21920
21982
  },
21983
+ contentGap: {
21984
+ selector: () => ' .content',
21985
+ property: 'gap'
21986
+ },
21921
21987
  itemsTextAlign: {
21922
21988
  selector: TextClass.componentName,
21923
21989
  property: TextClass.cssVarList.textAlign,
@@ -21975,6 +22041,7 @@ const outboundApps = {
21975
22041
 
21976
22042
  [vars$1.appLogoBackgroundColor]: 'none',
21977
22043
  [vars$1.appLogoGap]: globals.spacing.md,
22044
+ [vars$1.contentGap]: globals.spacing.xs,
21978
22045
 
21979
22046
  // list-item overrides
21980
22047
  [vars$1.itemCursor]: 'default',
@@ -22559,7 +22626,6 @@ exports.genColors = genColors;
22559
22626
  exports.getThemeRefs = getThemeRefs;
22560
22627
  exports.getThemeVars = getThemeVars;
22561
22628
  exports.globalsThemeToStyle = globalsThemeToStyle;
22562
- exports.observedAttributes = observedAttributes$1;
22563
22629
  exports.themeToCSSVarsObj = themeToCSSVarsObj;
22564
22630
  exports.themeToStyle = themeToStyle;
22565
22631
  exports.themeVars = themeVars;