@descope/web-components-ui 3.27.3 → 3.27.5

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 (74) hide show
  1. package/dist/cjs/index.cjs.js +88 -11
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +92 -13
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/9439.js +1 -1
  6. package/dist/umd/9439.js.map +1 -1
  7. package/dist/umd/DescopeDev.js +1 -1
  8. package/dist/umd/DescopeDev.js.map +1 -1
  9. package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-index-js.js +1 -1
  10. package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-index-js.js.map +1 -1
  11. package/dist/umd/button-selection-group-fields-descope-button-selection-group-index-js.js +1 -1
  12. package/dist/umd/button-selection-group-fields-descope-button-selection-group-index-js.js.map +1 -1
  13. package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js +1 -1
  14. package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js.map +1 -1
  15. package/dist/umd/descope-button.js +1 -1
  16. package/dist/umd/descope-button.js.map +1 -1
  17. package/dist/umd/descope-collapsible-container.js +1 -1
  18. package/dist/umd/descope-collapsible-container.js.map +1 -1
  19. package/dist/umd/descope-date-field-descope-calendar-index-js.js +1 -1
  20. package/dist/umd/descope-date-field-descope-calendar-index-js.js.map +1 -1
  21. package/dist/umd/descope-hybrid-field-index-js.js +3 -3
  22. package/dist/umd/descope-hybrid-field-index-js.js.map +1 -1
  23. package/dist/umd/descope-multi-line-mappings.js +1 -1
  24. package/dist/umd/descope-multi-line-mappings.js.map +1 -1
  25. package/dist/umd/descope-multi-sso.js +1 -1
  26. package/dist/umd/descope-multi-sso.js.map +1 -1
  27. package/dist/umd/descope-new-password-index-js.js +1 -1
  28. package/dist/umd/descope-new-password-index-js.js.map +1 -1
  29. package/dist/umd/descope-outbound-app-button.js +1 -1
  30. package/dist/umd/descope-outbound-app-button.js.map +1 -1
  31. package/dist/umd/descope-outbound-apps.js +1 -1
  32. package/dist/umd/descope-outbound-apps.js.map +1 -1
  33. package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js +1 -1
  34. package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js.map +1 -1
  35. package/dist/umd/descope-passcode-index-js.js +1 -1
  36. package/dist/umd/descope-passcode-index-js.js.map +1 -1
  37. package/dist/umd/descope-recovery-codes.js +1 -1
  38. package/dist/umd/descope-recovery-codes.js.map +1 -1
  39. package/dist/umd/descope-security-questions-setup-index-js.js +1 -1
  40. package/dist/umd/descope-security-questions-setup-index-js.js.map +1 -1
  41. package/dist/umd/descope-security-questions-verify-index-js.js +1 -1
  42. package/dist/umd/descope-security-questions-verify-index-js.js.map +1 -1
  43. package/dist/umd/descope-text-field.js +1 -1
  44. package/dist/umd/descope-text-field.js.map +1 -1
  45. package/dist/umd/descope-timer-button.js +1 -1
  46. package/dist/umd/descope-timer-button.js.map +1 -1
  47. package/dist/umd/descope-tooltip.js +1 -1
  48. package/dist/umd/descope-tooltip.js.map +1 -1
  49. package/dist/umd/descope-upload-file-index-js.js +1 -1
  50. package/dist/umd/descope-upload-file-index-js.js.map +1 -1
  51. package/dist/umd/descope-user-attribute-index-js.js +1 -1
  52. package/dist/umd/descope-user-attribute-index-js.js.map +1 -1
  53. package/dist/umd/descope-user-auth-method-index-js.js +1 -1
  54. package/dist/umd/descope-user-auth-method-index-js.js.map +1 -1
  55. package/dist/umd/descope-user-passkeys.js +1 -1
  56. package/dist/umd/descope-user-passkeys.js.map +1 -1
  57. package/dist/umd/index.js +1 -1
  58. package/dist/umd/index.js.map +1 -1
  59. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
  60. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js.map +1 -1
  61. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
  62. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js.map +1 -1
  63. package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -1
  64. package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js.map +1 -1
  65. package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -1
  66. package/dist/umd/phone-fields-descope-phone-field-index-js.js.map +1 -1
  67. package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js +1 -1
  68. package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js.map +1 -1
  69. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +1 -1
  70. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js.map +1 -1
  71. package/package.json +46 -46
  72. package/src/components/descope-passcode/PasscodeClass.js +1 -0
  73. package/src/components/descope-passcode/descope-passcode-internal/PasscodeInternal.js +4 -2
  74. package/src/components/descope-upload-file/UploadFileClass.js +1 -1
@@ -3843,7 +3843,7 @@ const ButtonClass = compose(
3843
3843
  padding: 0;
3844
3844
  }
3845
3845
  `,
3846
- excludeAttrsSync: ['tabindex', 'class', 'style'],
3846
+ excludeAttrsSync: ['tabindex', 'class', 'style', 'role'],
3847
3847
  componentName: componentName$1u,
3848
3848
  }),
3849
3849
  );
@@ -9550,7 +9550,7 @@ class RawCollapsibleContainer extends createBaseClass$1({
9550
9550
  baseSelector: 'slot',
9551
9551
  }) {
9552
9552
  static get observedAttributes() {
9553
- return ['collapsed', 'collapsible', 'text'];
9553
+ return ['collapsed', 'collapsible', 'text', 'aria-label'];
9554
9554
  }
9555
9555
 
9556
9556
  constructor() {
@@ -9661,7 +9661,31 @@ class RawCollapsibleContainer extends createBaseClass$1({
9661
9661
  this.setAttribute('collapsed', this.isCollapsed ? 'false' : 'true');
9662
9662
  }
9663
9663
 
9664
+ // header acts as a disclosure button only when the container is collapsible
9665
+ updateHeaderA11y() {
9666
+ if (!this.isCollapsible) {
9667
+ ['role', 'tabindex', 'aria-expanded', 'aria-label'].forEach((attr) =>
9668
+ this.header.removeAttribute(attr),
9669
+ );
9670
+ return;
9671
+ }
9672
+ this.header.setAttribute('role', 'button');
9673
+ this.header.setAttribute('tabindex', '0');
9674
+ this.header.setAttribute('aria-expanded', String(!this.isCollapsed));
9675
+ // without header text the button has no name, so fall back to a label
9676
+ if (this.getAttribute('text')) {
9677
+ this.header.removeAttribute('aria-label');
9678
+ } else {
9679
+ this.header.setAttribute(
9680
+ 'aria-label',
9681
+ this.getAttribute('aria-label') || 'Toggle section',
9682
+ );
9683
+ }
9684
+ }
9685
+
9664
9686
  collapse(animated = false) {
9687
+ // keep collapsed content out of the tab order and the a11y tree
9688
+ this.content.inert = true;
9665
9689
  const final = () => {
9666
9690
  this.content.style.maxHeight = '0px';
9667
9691
  };
@@ -9673,6 +9697,7 @@ class RawCollapsibleContainer extends createBaseClass$1({
9673
9697
  }
9674
9698
 
9675
9699
  expand(animated = false) {
9700
+ this.content.inert = false;
9676
9701
  const final = () => {
9677
9702
  this.content.style.maxHeight = '';
9678
9703
  };
@@ -9695,6 +9720,13 @@ class RawCollapsibleContainer extends createBaseClass$1({
9695
9720
  if (!this.isCollapsible) return;
9696
9721
  this.toggle();
9697
9722
  });
9723
+ this.header.addEventListener('keydown', (e) => {
9724
+ if (!this.isCollapsible || (e.key !== 'Enter' && e.key !== ' ')) return;
9725
+ e.preventDefault();
9726
+ // the SDK submits the flow on any Enter that reaches the flow root
9727
+ e.stopPropagation();
9728
+ this.toggle();
9729
+ });
9698
9730
  forwardAttrs(this, this.textComponent, {
9699
9731
  includeAttrs: ['text-align', 'text-variant', 'text-mode'],
9700
9732
  mapAttrs: { 'text-mode': 'mode', 'text-variant': 'variant' },
@@ -9709,8 +9741,14 @@ class RawCollapsibleContainer extends createBaseClass$1({
9709
9741
  attributeChangedCallback(name, oldValue, newValue) {
9710
9742
  if (name === 'text') {
9711
9743
  this.updateHeaderText();
9744
+ this.updateHeaderA11y();
9745
+ return;
9746
+ }
9747
+ if (name === 'aria-label') {
9748
+ this.updateHeaderA11y();
9712
9749
  return;
9713
9750
  }
9751
+ this.updateHeaderA11y();
9714
9752
  const collapsed = this.isCollapsed && this.isCollapsible;
9715
9753
  if (collapsed) {
9716
9754
  this.collapse(this.#isComponentMounted);
@@ -12392,6 +12430,10 @@ class RawTooltip extends createBaseClass$1({
12392
12430
  this,
12393
12431
  );
12394
12432
 
12433
+ // vaadin links the target via aria-describedby to its sr-label, which lives in our shadow root,
12434
+ // so a slotted target would reference an ID from another DOM tree.
12435
+ this.tooltip.ariaTarget = this.anchored;
12436
+
12395
12437
  this.defaultSlot.addEventListener('slotchange', () =>
12396
12438
  this.#setTooltipTarget(),
12397
12439
  );
@@ -14874,6 +14916,7 @@ const customMixin$b = (superclass) =>
14874
14916
  renderCopyToClipboard(shouldRender) {
14875
14917
  if (!shouldRender) {
14876
14918
  this.icon?.remove();
14919
+ this.copyLiveRegion?.remove();
14877
14920
  return;
14878
14921
  }
14879
14922
 
@@ -14889,20 +14932,53 @@ const customMixin$b = (superclass) =>
14889
14932
  style: 'cursor: initial',
14890
14933
  };
14891
14934
 
14935
+ const setIconState = (config) => {
14936
+ Object.assign(this.icon, config);
14937
+ this.icon.setAttribute('aria-label', config.title);
14938
+ };
14939
+
14892
14940
  this.icon = Object.assign(document.createElement('vaadin-icon'), {
14893
14941
  slot: 'suffix',
14894
- ...iconInitConfig,
14942
+ tabIndex: 0,
14895
14943
  });
14944
+ this.icon.setAttribute('role', 'button');
14945
+ setIconState(iconInitConfig);
14946
+
14947
+ // visually hidden live region, so screen readers announce the copy
14948
+ this.copyLiveRegion = document.createElement('span');
14949
+ this.copyLiveRegion.setAttribute('aria-live', 'polite');
14950
+ this.copyLiveRegion.style.cssText =
14951
+ 'position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;';
14896
14952
 
14897
14953
  this.baseElement.appendChild(this.icon);
14898
- this.icon.addEventListener('click', () => {
14899
- navigator.clipboard.writeText(this.value);
14900
- Object.assign(this.icon, iconCopiedConfig);
14954
+ this.shadowRoot.appendChild(this.copyLiveRegion);
14901
14955
 
14902
- // we want the icon to go back to the initial state after 5 seconds
14903
- setTimeout(() => {
14904
- Object.assign(this.icon, iconInitConfig);
14905
- }, 5000);
14956
+ let resetTimer;
14957
+ const copy = async () => {
14958
+ try {
14959
+ await navigator.clipboard.writeText(this.value);
14960
+ } catch {
14961
+ return;
14962
+ }
14963
+ setIconState(iconCopiedConfig);
14964
+ this.copyLiveRegion.textContent = 'Copied';
14965
+
14966
+ // we want the icon to go back to the initial state after 3 seconds
14967
+ // a repeated copy restarts the countdown
14968
+ clearTimeout(resetTimer);
14969
+ resetTimer = setTimeout(() => {
14970
+ setIconState(iconInitConfig);
14971
+ this.copyLiveRegion.textContent = '';
14972
+ }, 3000);
14973
+ };
14974
+
14975
+ this.icon.addEventListener('click', copy);
14976
+ this.icon.addEventListener('keydown', (e) => {
14977
+ if (e.key !== 'Enter' && e.key !== ' ') return;
14978
+ e.preventDefault();
14979
+ // the SDK submits the flow on any Enter that reaches the flow root
14980
+ e.stopPropagation();
14981
+ copy();
14906
14982
  });
14907
14983
  }
14908
14984
 
@@ -22508,6 +22584,7 @@ const customMixin$7 = (superclass) =>
22508
22584
  tabindex="-1"
22509
22585
  slot="input"
22510
22586
  role="textbox"
22587
+ aria-label="passcode"
22511
22588
  ><slot></slot></${componentName$F}>
22512
22589
  `;
22513
22590
 
@@ -25465,7 +25542,7 @@ class RawUploadFile extends BaseInputClass$4 {
25465
25542
  </div>
25466
25543
  <div class="description"></div>
25467
25544
  <div class="button-wrapper">
25468
- <input type="file" tabindex="-1" aria-labelledby="button"/>
25545
+ <input type="file" tabindex="-1" aria-hidden="true"/>
25469
25546
  <descope-button id="button"></descope-button>
25470
25547
  </div>
25471
25548
  </div>