@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
package/dist/index.esm.js CHANGED
@@ -6819,7 +6819,7 @@ const ButtonClass = compose$1(
6819
6819
  padding: 0;
6820
6820
  }
6821
6821
  `,
6822
- excludeAttrsSync: ['tabindex', 'class', 'style'],
6822
+ excludeAttrsSync: ['tabindex', 'class', 'style', 'role'],
6823
6823
  componentName: componentName$1p,
6824
6824
  }),
6825
6825
  );
@@ -8059,6 +8059,7 @@ const customMixin$h = (superclass) =>
8059
8059
  renderCopyToClipboard(shouldRender) {
8060
8060
  if (!shouldRender) {
8061
8061
  this.icon?.remove();
8062
+ this.copyLiveRegion?.remove();
8062
8063
  return;
8063
8064
  }
8064
8065
 
@@ -8074,20 +8075,53 @@ const customMixin$h = (superclass) =>
8074
8075
  style: 'cursor: initial',
8075
8076
  };
8076
8077
 
8078
+ const setIconState = (config) => {
8079
+ Object.assign(this.icon, config);
8080
+ this.icon.setAttribute('aria-label', config.title);
8081
+ };
8082
+
8077
8083
  this.icon = Object.assign(document.createElement('vaadin-icon'), {
8078
8084
  slot: 'suffix',
8079
- ...iconInitConfig,
8085
+ tabIndex: 0,
8080
8086
  });
8087
+ this.icon.setAttribute('role', 'button');
8088
+ setIconState(iconInitConfig);
8089
+
8090
+ // visually hidden live region, so screen readers announce the copy
8091
+ this.copyLiveRegion = document.createElement('span');
8092
+ this.copyLiveRegion.setAttribute('aria-live', 'polite');
8093
+ this.copyLiveRegion.style.cssText =
8094
+ 'position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;';
8081
8095
 
8082
8096
  this.baseElement.appendChild(this.icon);
8083
- this.icon.addEventListener('click', () => {
8084
- navigator.clipboard.writeText(this.value);
8085
- Object.assign(this.icon, iconCopiedConfig);
8097
+ this.shadowRoot.appendChild(this.copyLiveRegion);
8086
8098
 
8087
- // we want the icon to go back to the initial state after 5 seconds
8088
- setTimeout(() => {
8089
- Object.assign(this.icon, iconInitConfig);
8090
- }, 5000);
8099
+ let resetTimer;
8100
+ const copy = async () => {
8101
+ try {
8102
+ await navigator.clipboard.writeText(this.value);
8103
+ } catch {
8104
+ return;
8105
+ }
8106
+ setIconState(iconCopiedConfig);
8107
+ this.copyLiveRegion.textContent = 'Copied';
8108
+
8109
+ // we want the icon to go back to the initial state after 3 seconds
8110
+ // a repeated copy restarts the countdown
8111
+ clearTimeout(resetTimer);
8112
+ resetTimer = setTimeout(() => {
8113
+ setIconState(iconInitConfig);
8114
+ this.copyLiveRegion.textContent = '';
8115
+ }, 3000);
8116
+ };
8117
+
8118
+ this.icon.addEventListener('click', copy);
8119
+ this.icon.addEventListener('keydown', (e) => {
8120
+ if (e.key !== 'Enter' && e.key !== ' ') return;
8121
+ e.preventDefault();
8122
+ // the SDK submits the flow on any Enter that reaches the flow root
8123
+ e.stopPropagation();
8124
+ copy();
8091
8125
  });
8092
8126
  }
8093
8127
 
@@ -9622,7 +9656,7 @@ class PasscodeInternal extends BaseInputClass$f {
9622
9656
  }
9623
9657
 
9624
9658
  initInputs() {
9625
- this.inputs.forEach((input) => {
9659
+ this.inputs.forEach((input, idx) => {
9626
9660
  // During debounced input we hide the value with a mask.
9627
9661
  // This allows us to hide the multiple population of the first input
9628
9662
  // in case of an automated input (e.g. Safari OTP Autofill or paste).
@@ -9711,7 +9745,9 @@ class PasscodeInternal extends BaseInputClass$f {
9711
9745
  };
9712
9746
 
9713
9747
  forwardAttrs(this, input, { includeAttrs: forwardAttributes });
9714
- input.shadowRoot.querySelector('input').setAttribute('aria-label', 'passcode digit');
9748
+ input.shadowRoot
9749
+ .querySelector('input')
9750
+ .setAttribute('aria-label', `Digit ${idx + 1} of ${this.inputs.length}`);
9715
9751
  });
9716
9752
 
9717
9753
  this.handleFocusEventsDispatching(this.inputs);
@@ -9790,6 +9826,7 @@ const customMixin$g = (superclass) =>
9790
9826
  tabindex="-1"
9791
9827
  slot="input"
9792
9828
  role="textbox"
9829
+ aria-label="passcode"
9793
9830
  ><slot></slot></${componentName$1g}>
9794
9831
  `;
9795
9832
 
@@ -14161,7 +14198,7 @@ class RawUploadFile extends BaseInputClass$a {
14161
14198
  </div>
14162
14199
  <div class="description"></div>
14163
14200
  <div class="button-wrapper">
14164
- <input type="file" tabindex="-1" aria-labelledby="button"/>
14201
+ <input type="file" tabindex="-1" aria-hidden="true"/>
14165
14202
  <descope-button id="button"></descope-button>
14166
14203
  </div>
14167
14204
  </div>
@@ -25218,7 +25255,7 @@ class RawCollapsibleContainer extends createBaseClass$1({
25218
25255
  baseSelector: 'slot',
25219
25256
  }) {
25220
25257
  static get observedAttributes() {
25221
- return ['collapsed', 'collapsible', 'text'];
25258
+ return ['collapsed', 'collapsible', 'text', 'aria-label'];
25222
25259
  }
25223
25260
 
25224
25261
  constructor() {
@@ -25329,7 +25366,31 @@ class RawCollapsibleContainer extends createBaseClass$1({
25329
25366
  this.setAttribute('collapsed', this.isCollapsed ? 'false' : 'true');
25330
25367
  }
25331
25368
 
25369
+ // header acts as a disclosure button only when the container is collapsible
25370
+ updateHeaderA11y() {
25371
+ if (!this.isCollapsible) {
25372
+ ['role', 'tabindex', 'aria-expanded', 'aria-label'].forEach((attr) =>
25373
+ this.header.removeAttribute(attr),
25374
+ );
25375
+ return;
25376
+ }
25377
+ this.header.setAttribute('role', 'button');
25378
+ this.header.setAttribute('tabindex', '0');
25379
+ this.header.setAttribute('aria-expanded', String(!this.isCollapsed));
25380
+ // without header text the button has no name, so fall back to a label
25381
+ if (this.getAttribute('text')) {
25382
+ this.header.removeAttribute('aria-label');
25383
+ } else {
25384
+ this.header.setAttribute(
25385
+ 'aria-label',
25386
+ this.getAttribute('aria-label') || 'Toggle section',
25387
+ );
25388
+ }
25389
+ }
25390
+
25332
25391
  collapse(animated = false) {
25392
+ // keep collapsed content out of the tab order and the a11y tree
25393
+ this.content.inert = true;
25333
25394
  const final = () => {
25334
25395
  this.content.style.maxHeight = '0px';
25335
25396
  };
@@ -25341,6 +25402,7 @@ class RawCollapsibleContainer extends createBaseClass$1({
25341
25402
  }
25342
25403
 
25343
25404
  expand(animated = false) {
25405
+ this.content.inert = false;
25344
25406
  const final = () => {
25345
25407
  this.content.style.maxHeight = '';
25346
25408
  };
@@ -25363,6 +25425,13 @@ class RawCollapsibleContainer extends createBaseClass$1({
25363
25425
  if (!this.isCollapsible) return;
25364
25426
  this.toggle();
25365
25427
  });
25428
+ this.header.addEventListener('keydown', (e) => {
25429
+ if (!this.isCollapsible || (e.key !== 'Enter' && e.key !== ' ')) return;
25430
+ e.preventDefault();
25431
+ // the SDK submits the flow on any Enter that reaches the flow root
25432
+ e.stopPropagation();
25433
+ this.toggle();
25434
+ });
25366
25435
  forwardAttrs$1(this, this.textComponent, {
25367
25436
  includeAttrs: ['text-align', 'text-variant', 'text-mode'],
25368
25437
  mapAttrs: { 'text-mode': 'mode', 'text-variant': 'variant' },
@@ -25377,8 +25446,14 @@ class RawCollapsibleContainer extends createBaseClass$1({
25377
25446
  attributeChangedCallback(name, oldValue, newValue) {
25378
25447
  if (name === 'text') {
25379
25448
  this.updateHeaderText();
25449
+ this.updateHeaderA11y();
25380
25450
  return;
25381
25451
  }
25452
+ if (name === 'aria-label') {
25453
+ this.updateHeaderA11y();
25454
+ return;
25455
+ }
25456
+ this.updateHeaderA11y();
25382
25457
  const collapsed = this.isCollapsed && this.isCollapsible;
25383
25458
  if (collapsed) {
25384
25459
  this.collapse(this.#isComponentMounted);
@@ -28060,6 +28135,10 @@ class RawTooltip extends createBaseClass$1({
28060
28135
  this,
28061
28136
  );
28062
28137
 
28138
+ // vaadin links the target via aria-describedby to its sr-label, which lives in our shadow root,
28139
+ // so a slotted target would reference an ID from another DOM tree.
28140
+ this.tooltip.ariaTarget = this.anchored;
28141
+
28063
28142
  this.defaultSlot.addEventListener('slotchange', () =>
28064
28143
  this.#setTooltipTarget(),
28065
28144
  );