@descope/web-components-ui 2.2.2 → 2.2.4

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
@@ -6268,19 +6268,6 @@ const newDate = (date, isUtcTime) => {
6268
6268
  }
6269
6269
  if (typeof date === 'string') {
6270
6270
  const d = new Date(date.replace(/-/g, '/'));
6271
- if (isUtcTime) {
6272
- return new Date(
6273
- Date.UTC(
6274
- d.getFullYear(),
6275
- d.getMonth(),
6276
- d.getDate(),
6277
- d.getHours(),
6278
- d.getMinutes(),
6279
- d.getSeconds(),
6280
- d.getMilliseconds()
6281
- )
6282
- );
6283
- }
6284
6271
  return new Date(d);
6285
6272
  }
6286
6273
  return new Date();
@@ -6378,9 +6365,16 @@ const parseDateString = (val, format) => {
6378
6365
  };
6379
6366
 
6380
6367
  const dateToEpoch = (date, isUtc) => {
6368
+ // If it's already a number (epoch), return it directly - no conversion needed
6369
+ if (typeof date === 'number') {
6370
+ return date;
6371
+ }
6372
+
6381
6373
  if (isUtc) {
6382
- return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate())).getTime();
6374
+ return Date.UTC(date.getFullYear(), date.getMonth(), date.getDate());
6383
6375
  }
6376
+
6377
+ // Default: return epoch in local timezone
6384
6378
  return date.getTime();
6385
6379
  };
6386
6380
 
@@ -7642,7 +7636,7 @@ class RawDateFieldClass extends BaseInputClass$b {
7642
7636
 
7643
7637
  updateValue() {
7644
7638
  if (this.isCountersOutOfRange) {
7645
- this.updateEpoch('');
7639
+ this.resetEpoch();
7646
7640
  } else {
7647
7641
  const date = formats[this.format].getDate(this.inputElement.value);
7648
7642
  this.updateEpoch(dateToEpoch(date, this.isUtcTime));
@@ -7656,12 +7650,8 @@ class RawDateFieldClass extends BaseInputClass$b {
7656
7650
  this.#dispatchInput();
7657
7651
  };
7658
7652
 
7659
- updateEpoch(epochOrDate) {
7660
- if (Number.isNaN(epochOrDate) || !epochOrDate.toString()?.length) {
7661
- this.epoch = '';
7662
- } else {
7663
- this.epoch = dateToEpoch(newDate(epochOrDate, this.isUtcTime), this.isUtcTime);
7664
- }
7653
+ updateEpoch(epoch) {
7654
+ this.epoch = dateToEpoch(epoch, this.isUtcTime);
7665
7655
  }
7666
7656
 
7667
7657
  dateCounters = [
@@ -7792,14 +7782,18 @@ class RawDateFieldClass extends BaseInputClass$b {
7792
7782
  let value = parseInt(val, 10);
7793
7783
  if (!Number.isNaN(value)) {
7794
7784
  this.updateEpoch(value);
7795
- this.updateDateCounters(newDate(value));
7785
+ this.updateDateCounters(new Date(value));
7796
7786
  } else {
7797
- this.updateEpoch('');
7787
+ this.resetEpoch();
7798
7788
  this.resetDateCounters();
7799
7789
  this.clearInputEle();
7800
7790
  }
7801
7791
  }
7802
7792
 
7793
+ resetEpoch() {
7794
+ this.epoch = '';
7795
+ }
7796
+
7803
7797
  get isCountersEmpty() {
7804
7798
  return this.dateCounters.every((dc) => dc.isEmpty);
7805
7799
  }
@@ -8373,7 +8367,7 @@ class RawDateFieldClass extends BaseInputClass$b {
8373
8367
  }
8374
8368
 
8375
8369
  try {
8376
- const date = this.isUtcTime ? new Date(this.epoch) : newDate(this.epoch);
8370
+ const date = new Date(this.epoch);
8377
8371
 
8378
8372
  if (this.isUtcTime) {
8379
8373
  ret.month = date.getUTCMonth() + 1;
@@ -15719,9 +15713,13 @@ const customMixin$7 = (superclass) =>
15719
15713
  const ModalClass = compose(
15720
15714
  createStyleMixin({
15721
15715
  mappings: {
15716
+ overlayBackdropColor: { property: () => ModalClass.cssVarList.overlay.backdropColor },
15722
15717
  overlayBackgroundColor: { property: () => ModalClass.cssVarList.overlay.backgroundColor },
15723
15718
  overlayShadow: { property: () => ModalClass.cssVarList.overlay.shadow },
15724
15719
  overlayWidth: { property: () => ModalClass.cssVarList.overlay.width },
15720
+ overlayBorderWidth: { property: () => ModalClass.cssVarList.overlay.borderWidth },
15721
+ overlayBorderStyle: { property: () => ModalClass.cssVarList.overlay.borderStyle },
15722
+ overlayBorderColor: { property: () => ModalClass.cssVarList.overlay.borderColor },
15725
15723
  },
15726
15724
  }),
15727
15725
  portalMixin({
@@ -15737,6 +15735,22 @@ const ModalClass = compose(
15737
15735
  { selector: () => '::part(content)', property: 'background-color' },
15738
15736
  { selector: () => '::part(overlay)', property: 'background-color' },
15739
15737
  ],
15738
+ backdropColor: {
15739
+ selector: () => '::part(backdrop)',
15740
+ property: 'background-color',
15741
+ },
15742
+ borderStyle: {
15743
+ selector: () => '::part(content)',
15744
+ property: 'border-style',
15745
+ },
15746
+ borderWidth: {
15747
+ selector: () => '::part(content)',
15748
+ property: 'border-width',
15749
+ },
15750
+ borderColor: {
15751
+ selector: () => '::part(content)',
15752
+ property: 'border-color',
15753
+ },
15740
15754
  width: { selector: () => '::part(overlay)', property: 'width' },
15741
15755
  shadow: { selector: () => '::part(overlay)', property: 'box-shadow' },
15742
15756
  },
@@ -21440,6 +21454,7 @@ const modal = {
21440
21454
  [compVars$5.overlayBackgroundColor]: globalRefs$p.colors.surface.main,
21441
21455
  [compVars$5.overlayShadow]: globalRefs$p.shadow.wide['2xl'],
21442
21456
  [compVars$5.overlayWidth]: '540px',
21457
+ [compVars$5.overlayBackdropColor]: 'hsla(214, 53%, 23%, 0.16)',
21443
21458
  };
21444
21459
 
21445
21460
  const vars$C = {