@descope/web-components-ui 3.19.0 → 3.20.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.
package/dist/index.esm.js CHANGED
@@ -4579,9 +4579,9 @@ const componentName$1x = getComponentName('boolean-field-internal');
4579
4579
 
4580
4580
  const forwardAttributes$1 = ['disabled', 'invalid', 'readonly'];
4581
4581
 
4582
- const BaseInputClass$g = createBaseInputClass({ componentName: componentName$1x, baseSelector: 'div' });
4582
+ const BaseInputClass$h = createBaseInputClass({ componentName: componentName$1x, baseSelector: 'div' });
4583
4583
 
4584
- class BooleanInputInternal extends BaseInputClass$g {
4584
+ class BooleanInputInternal extends BaseInputClass$h {
4585
4585
  static get observedAttributes() {
4586
4586
  return ['readonly', 'label'];
4587
4587
  }
@@ -6897,11 +6897,11 @@ const observedAttrs$8 = [
6897
6897
 
6898
6898
  const calendarUiAttrs = ['calendar-label-submit', 'calendar-label-cancel'];
6899
6899
 
6900
- const BaseInputClass$f = createBaseInputClass({ componentName: componentName$1l, baseSelector: 'div' });
6900
+ const BaseInputClass$g = createBaseInputClass({ componentName: componentName$1l, baseSelector: 'div' });
6901
6901
 
6902
- class RawCalendar extends BaseInputClass$f {
6902
+ class RawCalendar extends BaseInputClass$g {
6903
6903
  static get observedAttributes() {
6904
- return [].concat(BaseInputClass$f.observedAttributes || [], observedAttrs$8, calendarUiAttrs);
6904
+ return [].concat(BaseInputClass$g.observedAttributes || [], observedAttrs$8, calendarUiAttrs);
6905
6905
  }
6906
6906
 
6907
6907
  // preview state epoch
@@ -7961,7 +7961,7 @@ const componentName$1j = getComponentName('date-field');
7961
7961
  // we set baseSelector to `vaadin-popover` as a temporary hack, so our portalMixin will
7962
7962
  // be able to process this component's overlay. The whole process needs refactoring as soon as possible.
7963
7963
  const BASE_SELECTOR$2 = 'vaadin-popover';
7964
- const BaseInputClass$e = createBaseInputClass({ componentName: componentName$1j, baseSelector: BASE_SELECTOR$2 });
7964
+ const BaseInputClass$f = createBaseInputClass({ componentName: componentName$1j, baseSelector: BASE_SELECTOR$2 });
7965
7965
 
7966
7966
  const dateFieldAttrs = [
7967
7967
  'format',
@@ -7974,7 +7974,7 @@ const dateFieldAttrs = [
7974
7974
  const calendarAttrs = ['years-range', 'calendar-months', 'calendar-weekdays'];
7975
7975
  const observedAttrs$6 = [...dateFieldAttrs, ...calendarAttrs];
7976
7976
 
7977
- class RawDateFieldClass extends BaseInputClass$e {
7977
+ class RawDateFieldClass extends BaseInputClass$f {
7978
7978
  epoch = '';
7979
7979
 
7980
7980
  format = DEFAULT_FORMAT$1;
@@ -8012,7 +8012,7 @@ class RawDateFieldClass extends BaseInputClass$e {
8012
8012
  ];
8013
8013
 
8014
8014
  static get observedAttributes() {
8015
- return [].concat(BaseInputClass$e.observedAttributes || [], observedAttrs$6);
8015
+ return [].concat(BaseInputClass$f.observedAttributes || [], observedAttrs$6);
8016
8016
  }
8017
8017
 
8018
8018
  constructor() {
@@ -9240,11 +9240,11 @@ const forwardAttributes = [
9240
9240
  'aria-labelledby',
9241
9241
  ];
9242
9242
 
9243
- const BaseInputClass$d = createBaseInputClass({ componentName: componentName$1c, baseSelector: 'div' });
9243
+ const BaseInputClass$e = createBaseInputClass({ componentName: componentName$1c, baseSelector: 'div' });
9244
9244
 
9245
- class PasscodeInternal extends BaseInputClass$d {
9245
+ class PasscodeInternal extends BaseInputClass$e {
9246
9246
  static get observedAttributes() {
9247
- return observedAttributes$6.concat(BaseInputClass$d.observedAttributes || []);
9247
+ return observedAttributes$6.concat(BaseInputClass$e.observedAttributes || []);
9248
9248
  }
9249
9249
 
9250
9250
  constructor() {
@@ -11404,11 +11404,11 @@ const mapAttrs$1 = {
11404
11404
 
11405
11405
  const inputRelatedAttrs$1 = [].concat(commonAttrs$2, countryAttrs, phoneAttrs, labelTypeAttrs$1);
11406
11406
 
11407
- const BaseInputClass$c = createBaseInputClass({ componentName: componentName$18, baseSelector: 'div' });
11407
+ const BaseInputClass$d = createBaseInputClass({ componentName: componentName$18, baseSelector: 'div' });
11408
11408
 
11409
- let PhoneFieldInternal$1 = class PhoneFieldInternal extends BaseInputClass$c {
11409
+ let PhoneFieldInternal$1 = class PhoneFieldInternal extends BaseInputClass$d {
11410
11410
  static get observedAttributes() {
11411
- return [].concat(BaseInputClass$c.observedAttributes || [], inputRelatedAttrs$1);
11411
+ return [].concat(BaseInputClass$d.observedAttributes || [], inputRelatedAttrs$1);
11412
11412
  }
11413
11413
 
11414
11414
  #ayt;
@@ -12133,11 +12133,11 @@ const mapAttrs = {
12133
12133
  'phone-input-type': 'type',
12134
12134
  };
12135
12135
 
12136
- const BaseInputClass$b = createBaseInputClass({ componentName: componentName$16, baseSelector: 'div' });
12136
+ const BaseInputClass$c = createBaseInputClass({ componentName: componentName$16, baseSelector: 'div' });
12137
12137
 
12138
- class PhoneFieldInternal extends BaseInputClass$b {
12138
+ class PhoneFieldInternal extends BaseInputClass$c {
12139
12139
  static get observedAttributes() {
12140
- return [].concat(BaseInputClass$b.observedAttributes || [], observedAttributes$4);
12140
+ return [].concat(BaseInputClass$c.observedAttributes || [], observedAttributes$4);
12141
12141
  }
12142
12142
 
12143
12143
  #ayt;
@@ -13247,11 +13247,11 @@ const inputRelatedAttrs = [].concat(
13247
13247
  policyPanelAttrs
13248
13248
  );
13249
13249
 
13250
- const BaseInputClass$a = createBaseInputClass({ componentName: componentName$14, baseSelector: 'div' });
13250
+ const BaseInputClass$b = createBaseInputClass({ componentName: componentName$14, baseSelector: 'div' });
13251
13251
 
13252
- class NewPasswordInternal extends BaseInputClass$a {
13252
+ class NewPasswordInternal extends BaseInputClass$b {
13253
13253
  static get observedAttributes() {
13254
- return [].concat(BaseInputClass$a.observedAttributes || [], inputRelatedAttrs);
13254
+ return [].concat(BaseInputClass$b.observedAttributes || [], inputRelatedAttrs);
13255
13255
  }
13256
13256
 
13257
13257
  constructor() {
@@ -13498,13 +13498,19 @@ const componentName$11 = getComponentName('recaptcha');
13498
13498
 
13499
13499
  const observedAttributes$3 = ['enabled', 'site-key', 'action', 'enterprise', 'variant'];
13500
13500
 
13501
- const BaseClass$a = createBaseClass({
13501
+ // The runtime only validates elements carrying a `name` (querySelectorAll('*[name]')).
13502
+ const DEFAULT_FIELD_NAME = 'recaptcha';
13503
+
13504
+ const BaseInputClass$a = createBaseInputClass({
13502
13505
  componentName: componentName$11,
13503
13506
  baseSelector: ':host > div',
13504
13507
  });
13505
- class RawRecaptcha extends BaseClass$a {
13508
+ class RawRecaptcha extends BaseInputClass$a {
13509
+ /** The exact `name` this component wrote itself, or null if the name is not ours. */
13510
+ #ownedFieldName = null;
13511
+
13506
13512
  static get observedAttributes() {
13507
- return observedAttributes$3.concat(BaseClass$a.observedAttributes || []);
13513
+ return observedAttributes$3.concat(BaseInputClass$a.observedAttributes || []);
13508
13514
  }
13509
13515
 
13510
13516
  attributeChangedCallback(attrName, oldValue, newValue) {
@@ -13515,6 +13521,7 @@ class RawRecaptcha extends BaseClass$a {
13515
13521
  }
13516
13522
 
13517
13523
  if (attrName === 'variant') {
13524
+ this.#syncFormField();
13518
13525
  this.updatePreview();
13519
13526
  }
13520
13527
  }
@@ -13530,7 +13537,7 @@ class RawRecaptcha extends BaseClass$a {
13530
13537
  }
13531
13538
 
13532
13539
  displayRecaptcha() {
13533
- if (this.isWidget) {
13540
+ if (this.isWidgetVariant) {
13534
13541
  this.displayWidget();
13535
13542
  } else {
13536
13543
  this.displayDeprecated();
@@ -13625,6 +13632,31 @@ class RawRecaptcha extends BaseClass$a {
13625
13632
  super.init?.();
13626
13633
 
13627
13634
  observeChildren(this, this.updatePreview.bind(this));
13635
+ // avoid any possible conflicts with the inner input element
13636
+ this.inputElement = this.recaptchaWidgetInputEle;
13637
+ this.recaptchaWidgetInputEle.getValidity = null;
13638
+ this.recaptchaWidgetInputEle.checkValidity = null;
13639
+ this.#syncFormField();
13640
+ }
13641
+
13642
+ /**
13643
+ * Only the widget variant is a form field — the others must not carry a name, or the screen
13644
+ * would submit an always-empty value under it.
13645
+ */
13646
+ #syncFormField() {
13647
+ if (this.isWidgetVariant) {
13648
+ if (!this.getAttribute('name')) {
13649
+ this.setAttribute('name', DEFAULT_FIELD_NAME);
13650
+ this.#ownedFieldName = DEFAULT_FIELD_NAME;
13651
+ }
13652
+ } else if (this.#ownedFieldName && this.getAttribute('name') === this.#ownedFieldName) {
13653
+ this.removeAttribute('name');
13654
+ this.#ownedFieldName = null;
13655
+ }
13656
+
13657
+ // Refreshes the mixin's cached validity, which reportValidity answers from. Non-bubbling on
13658
+ // purpose: the flow must not read this as user input.
13659
+ this.dispatchEvent(new Event('change'));
13628
13660
  }
13629
13661
 
13630
13662
  updatePreview() {
@@ -13640,7 +13672,7 @@ class RawRecaptcha extends BaseClass$a {
13640
13672
  }
13641
13673
 
13642
13674
  getValidity() {
13643
- if (!this.isWidget) {
13675
+ if (!this.isWidgetVariant) {
13644
13676
  return {};
13645
13677
  }
13646
13678
 
@@ -13652,7 +13684,7 @@ class RawRecaptcha extends BaseClass$a {
13652
13684
  }
13653
13685
 
13654
13686
  checkValidity() {
13655
- if (!this.isWidget) {
13687
+ if (!this.isWidgetVariant) {
13656
13688
  return true;
13657
13689
  }
13658
13690
 
@@ -13679,7 +13711,7 @@ class RawRecaptcha extends BaseClass$a {
13679
13711
  return this.getAttribute('variant') || 'text';
13680
13712
  }
13681
13713
 
13682
- get isWidget() {
13714
+ get isWidgetVariant() {
13683
13715
  return this.variant === 'widget';
13684
13716
  }
13685
13717
 
@@ -13693,7 +13725,7 @@ class RawRecaptcha extends BaseClass$a {
13693
13725
 
13694
13726
  #toggleRecaptcha(enabled) {
13695
13727
  this.renderRecaptcha(enabled);
13696
- if (this.isWidget) {
13728
+ if (this.isWidgetVariant) {
13697
13729
  // For the interactive widget, scripts are loaded/executed by the runtime (grecaptcha-v2 for the
13698
13730
  // v2 checkbox, grecaptcha for an Enterprise key). This legacy v3/invisible path must be fully
13699
13731
  // skipped — the runtime renders into #recaptcha-widget and fills #recaptcha-widget-input.
@@ -24480,10 +24512,12 @@ class RawCollapsibleContainer extends createBaseClass$1({
24480
24512
  <div class="wrapper">
24481
24513
  <descope-text st-host-direction="ltr">
24482
24514
  <div class="header">
24483
- <div class="icon">
24484
- <descope-icon st-fill="currentcolor" src=${chevronIcon}></descope-icon>
24515
+ <div class="title">
24516
+ <div class="icon">
24517
+ <descope-icon st-fill="currentcolor" src=${chevronIcon}></descope-icon>
24518
+ </div>
24519
+ <span></span>
24485
24520
  </div>
24486
- <span></span>
24487
24521
  </div>
24488
24522
  </descope-text>
24489
24523
  <div class="content">
@@ -24515,6 +24549,16 @@ class RawCollapsibleContainer extends createBaseClass$1({
24515
24549
  display: flex;
24516
24550
  align-items: baseline;
24517
24551
  }
24552
+ .title {
24553
+ display: contents;
24554
+ }
24555
+ :host([attach-icon="true"]) .header {
24556
+ display: block;
24557
+ }
24558
+ :host([attach-icon="true"]) .title {
24559
+ display: inline-flex;
24560
+ align-items: baseline;
24561
+ }
24518
24562
  .icon {
24519
24563
  flex-shrink: 0;
24520
24564
  height: var(${TextClass.cssVarList.textLineHeight});
@@ -24636,6 +24680,7 @@ const selectors = {
24636
24680
  icon: () => 'descope-icon',
24637
24681
  iconWrapper: () => '.icon',
24638
24682
  header: () => '.header',
24683
+ iconAndText: () => '.header, .title',
24639
24684
  text: () => 'span',
24640
24685
  wrapper: () => '.wrapper',
24641
24686
  content: () => 'div.content',
@@ -24676,7 +24721,7 @@ const CollapsibleContainerClass = compose$1(
24676
24721
 
24677
24722
  headerIconOrder: { selector: selectors.iconWrapper, property: 'order' },
24678
24723
  headerCursor: { selector: selectors.header, property: 'cursor' },
24679
- headerGap: { selector: selectors.header, property: 'gap' },
24724
+ headerGap: { selector: selectors.iconAndText, property: 'gap' },
24680
24725
  textGrow: { selector: selectors.text, property: 'flex-grow' },
24681
24726
  textDirection: { selector: selectors.text, property: 'direction' },
24682
24727
  iconAnimationDuration: {
@@ -24701,7 +24746,7 @@ const [helperTheme$4, helperRefs$4, helperVars$4] = createHelperVars$1(
24701
24746
  {
24702
24747
  shadowColor: '#00000020', // if we want to support transparency vars, we should use different color format
24703
24748
  },
24704
- componentName$i
24749
+ componentName$i,
24705
24750
  );
24706
24751
 
24707
24752
  const { shadowColor: shadowColor$6 } = helperRefs$4;
@@ -24782,8 +24827,8 @@ const collapsibleContainer = {
24782
24827
  },
24783
24828
 
24784
24829
  iconPosition: {
24785
- 'left': { [compVars$5.headerIconOrder]: '0' },
24786
- 'right': { [compVars$5.headerIconOrder]: '1' },
24830
+ left: { [compVars$5.headerIconOrder]: '0' },
24831
+ right: { [compVars$5.headerIconOrder]: '1' },
24787
24832
  },
24788
24833
 
24789
24834
  _fillTitle: {
@@ -24798,7 +24843,7 @@ const collapsibleContainer = {
24798
24843
 
24799
24844
  _collapsible: {
24800
24845
  [compVars$5.headerCursor]: 'pointer',
24801
- }
24846
+ },
24802
24847
  };
24803
24848
 
24804
24849
  const vars$U = {
@@ -32292,7 +32337,7 @@ const filter = {
32292
32337
  _fullWidth: {
32293
32338
  [vars$H.hostWidth]: '100%',
32294
32339
  },
32295
- [vars$H.overlay.backgroundColor]: globals.colors.surface.main,
32340
+ [vars$H.overlay.backgroundColor]: globalRefs$o.colors.surface.main,
32296
32341
  [vars$H.overlay.backdropBackgroundColor]: 'transparent',
32297
32342
  [vars$H.overlay.backdropPointerEvents]: 'all',
32298
32343
  [vars$H.overlay.boxShadow]: