@aurodesignsystem-dev/auro-formkit 0.0.0-pr783.0 → 0.0.0-pr783.1

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.
@@ -1555,9 +1555,9 @@ var shapeSizeCss$2 = i$2`.wrapper{overflow:hidden}.shape-classic-xl,.shape-class
1555
1555
 
1556
1556
  var classicLayoutColor = i$2``;
1557
1557
 
1558
- var snowflakeStyle = i$2`.accents{flex-grow:0;flex-shrink:0;display:flex;align-items:center;justify-content:center}.accents.left{padding-right:var(--ds-size-100, 0.5rem)}.accents.right{width:var(--ds-size-400, 2rem)}.mainContent{height:100%;max-height:100%;flex-grow:1;display:flex;flex-direction:column;justify-content:center;align-items:center}.inputSection{display:flex;flex-direction:row;align-items:center;width:100%;max-width:250px;margin:0 auto}.inputSection:not(:is(.disabled,.hasFocus,.hasValue)) .inputDivider{display:none}.inputContainer{display:flex;flex-direction:row;align-items:center;width:100%}.inputContainer:first-of-type{justify-content:flex-end}.inputContainer:last-of-type{justify-content:flex-start}:host([disabled]) .inputSection{display:none}:host([layout*=snowflake]) [auro-input]{flex:1;text-align:center}:host([layout*=snowflake]) [auro-input]::part(label),:host([layout*=snowflake]) [auro-input]::part(accent-left),:host([layout*=snowflake]) [auro-input]::part(accent-right){display:none}:host([layout*=snowflake]) [auro-input]::part(input){padding-bottom:unset;text-align:center;font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);transition:unset}:host([layout*=snowflake]) [auro-input]::part(wrapper){min-height:unset;max-height:unset;box-shadow:unset}:host([layout*=snowflake]) [auro-input]::part(wrapper) .mainContent{padding-bottom:unset}:host([layout*=snowflake]) [auro-input]::part(inputHelpText){display:none}:host([layout*=snowflake]) [auro-dropdown]::part(trigger){width:100%}:host([layout*=snowflake]) .dpTriggerContent{width:100%}:host([layout*=snowflake]) .wrapper{height:60px;width:calc(100% - 48px);display:flex;flex-direction:row;justify-content:space-between;padding-left:24px;padding-right:24px}:host([layout*=snowflake]) label{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);font-weight:450;letter-spacing:0}:host([layout*=snowflake]) label.hasFocus,:host([layout*=snowflake]) label.hasValue{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-height-xs, 1rem)}:host([layout*=snowflake]) .inputDivider{height:18px;margin:4px 12px;width:2px}`;
1558
+ var snowflakeStyle = i$2`.accents{flex-grow:0;flex-shrink:0;display:flex;align-items:center;justify-content:center}.accents.left{padding-right:var(--ds-size-100, 0.5rem)}.accents.right{width:var(--ds-size-400, 2rem)}.mainContent{height:100%;max-height:100%;flex-grow:1;display:flex;flex-direction:column;justify-content:center;align-items:center}.inputSection{display:flex;flex-direction:row;align-items:center;width:100%;max-width:250px;margin:0 auto}.inputSection:not(:is(.disabled,.hasFocus,.hasValue)) .inputDivider{display:none}.inputContainer{display:flex;flex-direction:row;align-items:center;width:100%}.inputContainer:first-of-type{justify-content:flex-end}.inputContainer:last-of-type{justify-content:flex-start}:host([disabled]) .inputSection{display:none}:host([layout*=snowflake]) [auro-input]{flex:1;text-align:center}:host([layout*=snowflake]) [auro-input]::part(label),:host([layout*=snowflake]) [auro-input]::part(accent-left),:host([layout*=snowflake]) [auro-input]::part(accent-right){display:none}:host([layout*=snowflake]) [auro-input]::part(input){padding-bottom:unset;text-align:center;font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);transition:unset}:host([layout*=snowflake]) [auro-input]::part(wrapper){min-height:unset;max-height:unset;box-shadow:unset}:host([layout*=snowflake]) [auro-input]::part(wrapper) .mainContent{padding-bottom:unset}:host([layout*=snowflake]) [auro-input]::part(inputHelpText){display:none}:host([layout*=snowflake]) [auro-input]::part(displayValue){justify-content:center;font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem)}:host([layout*=snowflake]) [auro-dropdown]::part(trigger){width:100%}:host([layout*=snowflake]) .dpTriggerContent{width:100%}:host([layout*=snowflake]) .wrapper{height:60px;width:calc(100% - 48px);display:flex;flex-direction:row;justify-content:space-between;padding-left:24px;padding-right:24px}:host([layout*=snowflake]) label{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);font-weight:450;letter-spacing:0}:host([layout*=snowflake]) label.hasFocus,:host([layout*=snowflake]) label.hasValue{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-height-xs, 1rem)}:host([layout*=snowflake]) .inputDivider{height:18px;margin:4px 12px;width:2px}`;
1559
1559
 
1560
- var snowflakeColors = i$2`:host([layout=snowflake])[disabled] .mainContent label ::slotted(*){color:var(--ds-auro-icon-color)}:host([layout=snowflake]) label{color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([layout=snowflake]) .inputDivider{background-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([layout=snowflake]) .error{color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host([layout=snowflake]) [auro-input]::part(input)::placeholder{color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([layout=snowflake]) [auro-dropdown]:not(:is([error],.hasFocus))::part(wrapper){--ds-auro-dropdown-trigger-border-color: transparent}`;
1560
+ var snowflakeColors = i$2`:host([layout=snowflake])[disabled] .mainContent label ::slotted(*){color:var(--ds-auro-icon-color)}:host([layout=snowflake]) label{color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([layout=snowflake]) .inputDivider{background-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([layout=snowflake]) .error{color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host([layout=snowflake]) [auro-input]::part(input)::placeholder{color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([layout=snowflake]) [auro-input]::part(displayValue){background-color:inherit}:host([layout=snowflake]) [auro-dropdown]:not(:is([error],.hasFocus))::part(wrapper){--ds-auro-dropdown-trigger-border-color: transparent}`;
1561
1561
 
1562
1562
  var styleCss$d = i$2`:host{--calendar-width: 336px;--mobile-footer-height: 150px;--mobile-header-height: 68px;height:100vh;height:100dvh}.calendars{display:flex;flex-direction:row}.calendarNavButtons{position:absolute;top:var(--ds-size-200, 1rem);right:var(--ds-size-50, 0.25rem);left:var(--ds-size-50, 0.25rem)}.calendarNavBtn{display:flex;width:var(--ds-size-500, 2.5rem);height:var(--ds-size-500, 2.5rem);align-items:center;justify-content:center;border-width:1px;border-style:solid;border-radius:50%;cursor:pointer}.prevMonth,.nextMonth{position:absolute;top:0}.prevMonth{left:0}.nextMonth{right:0}.headerActions{padding:0 var(--ds-size-200, 1rem)}.mobileHeader{width:100%;height:var(--mobile-header-height);z-index:1;align-items:center;flex-direction:row}.headerDateFrom{display:flex;height:var(--mobile-header-height);flex:1;flex-direction:column;justify-content:center;padding:0 var(--ds-size-150, 0.75rem) 0 var(--ds-size-200, 1rem)}.mobileDateLabel{font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}.headerDateTo{height:calc(var(--mobile-header-height) - var(--ds-size-300, 1.5rem));padding:var(--ds-size-300, 1.5rem) var(--ds-size-100, 0.5rem) 0 var(--ds-size-200, 1rem)}:host(:not([noRange])) .headerDateTo{position:relative;display:flex;flex:1;flex-direction:column;justify-content:center}:host(:not([noRange])) .headerDateTo:after{position:absolute;top:calc(50% + 10px);left:0;display:block;width:1px;height:var(--ds-size-300, 1.5rem);content:"";transform:translateY(-50%)}.mobileFooter{display:none;width:100%;align-items:flex-end;flex-direction:column;justify-content:flex-end}.mobileFooterActions{position:relative;bottom:0;left:50%;display:none;width:calc(100% - var(--ds-size-200, 1rem)*2);align-items:flex-end;flex-direction:column;justify-content:flex-end;padding:var(--ds-size-150) calc(var(--ds-size-200, 1rem));transform:translateX(-50%)}.mobileFooterActions auro-button{width:100%}:host([isfullscreen]){width:100%;max-height:100dvh;overflow:hidden}:host([isfullscreen]) .prevMonth,:host([isfullscreen]) .nextMonth{display:none}:host([isfullscreen]) .mobileHeader,:host([isfullscreen]) .mobileFooter,:host([isfullscreen]) .mobileFooterActions{display:flex}:host([isfullscreen]) .calendarWrapper{display:flex;flex-direction:column}:host([isfullscreen]) .calendars{display:flex;flex-direction:column;flex:1;align-items:center;width:100%;overscroll-behavior:contain}:host([isfullscreen]) .calendars:after{display:block;width:100%;height:var(--mobile-footer-height);content:""}`;
1563
1563
 
@@ -16105,7 +16105,7 @@ class AuroFloatingUI {
16105
16105
  */
16106
16106
  mirrorSize() {
16107
16107
  // mirror the boxsize from bibSizer
16108
- if (this.element.bibSizer) {
16108
+ if (this.element.bibSizer && this.element.matchWidth) {
16109
16109
  const sizerStyle = window.getComputedStyle(this.element.bibSizer);
16110
16110
  const bibContent = this.element.bib.shadowRoot.querySelector(".container");
16111
16111
  if (sizerStyle.width !== '0px') {
@@ -16317,13 +16317,13 @@ class AuroFloatingUI {
16317
16317
  if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
16318
16318
  return;
16319
16319
  }
16320
-
16320
+
16321
16321
  // if fullscreen bib is in fullscreen mode, do not close
16322
16322
  if (this.element.bib.hasAttribute('isfullscreen')) {
16323
16323
  return;
16324
16324
  }
16325
16325
 
16326
- this.hideBib();
16326
+ this.hideBib("keydown");
16327
16327
  }
16328
16328
 
16329
16329
  setupHideHandlers() {
@@ -16348,7 +16348,7 @@ class AuroFloatingUI {
16348
16348
  document.expandedAuroFormkitDropdown = null;
16349
16349
  document.expandedAuroFloater = this;
16350
16350
  } else {
16351
- this.hideBib();
16351
+ this.hideBib("click");
16352
16352
  }
16353
16353
  }
16354
16354
  };
@@ -16361,7 +16361,7 @@ class AuroFloatingUI {
16361
16361
  // if something else is open, let it handle itself
16362
16362
  return;
16363
16363
  }
16364
- this.hideBib();
16364
+ this.hideBib("keydown");
16365
16365
  }
16366
16366
  };
16367
16367
 
@@ -16444,7 +16444,11 @@ class AuroFloatingUI {
16444
16444
  }
16445
16445
  }
16446
16446
 
16447
- hideBib() {
16447
+ /**
16448
+ * Hides the floating UI element.
16449
+ * @param {String} eventType - The event type that triggered the hiding action.
16450
+ */
16451
+ hideBib(eventType = "unknown") {
16448
16452
  if (!this.element.disabled && !this.element.noToggle) {
16449
16453
  this.lockScroll(false);
16450
16454
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -16455,7 +16459,7 @@ class AuroFloatingUI {
16455
16459
  if (this.showing) {
16456
16460
  this.cleanupHideHandlers();
16457
16461
  this.showing = false;
16458
- this.dispatchEventDropdownToggle();
16462
+ this.dispatchEventDropdownToggle(eventType);
16459
16463
  }
16460
16464
  }
16461
16465
  document.expandedAuroFloater = null;
@@ -16464,11 +16468,13 @@ class AuroFloatingUI {
16464
16468
  /**
16465
16469
  * @private
16466
16470
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
16471
+ * @param {String} eventType - The event type that triggered the toggle action.
16467
16472
  */
16468
- dispatchEventDropdownToggle() {
16473
+ dispatchEventDropdownToggle(eventType) {
16469
16474
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
16470
16475
  detail: {
16471
16476
  expanded: this.showing,
16477
+ eventType: eventType || "unknown",
16472
16478
  },
16473
16479
  composed: true
16474
16480
  });
@@ -16478,7 +16484,7 @@ class AuroFloatingUI {
16478
16484
 
16479
16485
  handleClick() {
16480
16486
  if (this.element.isPopoverVisible) {
16481
- this.hideBib();
16487
+ this.hideBib("click");
16482
16488
  } else {
16483
16489
  this.showBib();
16484
16490
  }
@@ -16505,7 +16511,7 @@ class AuroFloatingUI {
16505
16511
 
16506
16512
  event.preventDefault();
16507
16513
  this.handleClick();
16508
- }
16514
+ }
16509
16515
  break;
16510
16516
  case 'mouseenter':
16511
16517
  if (this.element.hoverToggle) {
@@ -16514,7 +16520,7 @@ class AuroFloatingUI {
16514
16520
  break;
16515
16521
  case 'mouseleave':
16516
16522
  if (this.element.hoverToggle) {
16517
- this.hideBib();
16523
+ this.hideBib("mouseleave");
16518
16524
  }
16519
16525
  break;
16520
16526
  case 'focus':
@@ -17902,6 +17908,9 @@ class AuroDropdown extends AuroElement$4 {
17902
17908
 
17903
17909
  this.parentBorder = false;
17904
17910
 
17911
+ /** @private */
17912
+ this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
17913
+
17905
17914
  this.privateDefaults();
17906
17915
  }
17907
17916
 
@@ -18335,12 +18344,19 @@ class AuroDropdown extends AuroElement$4 {
18335
18344
  if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
18336
18345
  this.handleTriggerContentSlotChange();
18337
18346
  }
18347
+ }
18338
18348
 
18339
- if (changedProperties.has('isPopoverVisible')) {
18340
- this.updateFocusTrap();
18341
- if (!this.isPopoverVisible && this.hasFocus) {
18342
- this.trigger.focus();
18343
- }
18349
+ /**
18350
+ * Handles the custom event `auroDropdown-toggled` to update the visibility of the dropdown bib.
18351
+ * @private
18352
+ * @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
18353
+ */
18354
+ handleDropdownToggle(event) {
18355
+ this.updateFocusTrap();
18356
+ this.isPopoverVisible = event.detail.expanded;
18357
+ const eventType = event.detail.eventType || "unknown";
18358
+ if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
18359
+ this.trigger.focus();
18344
18360
  }
18345
18361
  }
18346
18362
 
@@ -18348,6 +18364,7 @@ class AuroDropdown extends AuroElement$4 {
18348
18364
 
18349
18365
  // Configure the floater to, this will generate the ID for the bib
18350
18366
  this.floater.configure(this, 'auroDropdown');
18367
+ this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
18351
18368
 
18352
18369
  /**
18353
18370
  * @description Let subscribers know that the dropdown ID ha been generated and added.
@@ -27973,6 +27990,15 @@ class AuroDatePicker extends AuroElement$1 {
27973
27990
  this.layout = 'classic';
27974
27991
  this.shape = 'classic';
27975
27992
  this.size = 'lg';
27993
+
27994
+ /**
27995
+ * @private
27996
+ * @property {boolean} delegatesFocus - Whether the shadow root delegates focus.
27997
+ */
27998
+ this.constructor.shadowRootOptions = {
27999
+ ...i.shadowRootOptions,
28000
+ delegatesFocus: true,
28001
+ };
27976
28002
  }
27977
28003
 
27978
28004
  // This function is to define props used within the scope of this component
@@ -28710,6 +28736,7 @@ class AuroDatePicker extends AuroElement$1 {
28710
28736
  }
28711
28737
 
28712
28738
  this.hasFocus = true;
28739
+ this.dropdown.show();
28713
28740
 
28714
28741
  // shadowroot active element is null if we focus the datepicker itself
28715
28742
  if (this.shadowRoot.activeElement === null) {
@@ -29033,6 +29060,9 @@ class AuroDatePicker extends AuroElement$1 {
29033
29060
  `;
29034
29061
  }
29035
29062
 
29063
+ /**
29064
+ * @private
29065
+ */
29036
29066
  renderLayoutFromAttributes() {
29037
29067
  switch (this.layout) {
29038
29068
  case 'snowflake':
@@ -29045,6 +29075,44 @@ class AuroDatePicker extends AuroElement$1 {
29045
29075
  }
29046
29076
  }
29047
29077
 
29078
+ // eslint-disable-next-line no-warning-comments
29079
+ // TODO: move this to date utility when time allows :(
29080
+ /**
29081
+ * Simple formatter that ONLY WORKS FOR US DATES.
29082
+ * Returns formatted date like Apr 21 or Dec 25.
29083
+ * @private
29084
+ * @param {string} date - Date format should be in a format Date constructor accepts, like '2023-04-21' or '2023/04/21'.
29085
+ * @return {string}
29086
+ */
29087
+ formatShortDate(date) {
29088
+ // should render like Apr 21
29089
+ const options = {
29090
+ month: 'short',
29091
+ day: '2-digit'
29092
+ };
29093
+
29094
+ return new Date(date).toLocaleDateString('en-US', options).replace(',', '');
29095
+ }
29096
+
29097
+ /**
29098
+ * Format and render the provided date value.
29099
+ * @private
29100
+ * @param dateValue
29101
+ * @return {TemplateResult}
29102
+ */
29103
+ renderDisplayTextDate(dateValue) {
29104
+ return u$3`
29105
+ <div>
29106
+ <div class="displayValueText">
29107
+ ${dateValue && this.util.validDateStr(dateValue, this.format)
29108
+ ? this.formatShortDate(dateValue)
29109
+ : undefined
29110
+ }
29111
+ </div>
29112
+ </div>
29113
+ `;
29114
+ }
29115
+
29048
29116
  renderHtmlInputs() {
29049
29117
  const inputClasses = {
29050
29118
  "util_displayHiddenVisually": !this.hasValue && !this.hasFocus
@@ -29060,7 +29128,7 @@ class AuroDatePicker extends AuroElement$1 {
29060
29128
  .max="${this.maxDate}"
29061
29129
  .min="${this.minDate}"
29062
29130
  id="${this.generateRandomString(12)}"
29063
- placeholder="MM/DD"
29131
+ .placeholder="${this.placeholder}"
29064
29132
  simple
29065
29133
  bordered
29066
29134
  noValidate
@@ -29076,6 +29144,9 @@ class AuroDatePicker extends AuroElement$1 {
29076
29144
  setCustomValidityRangeUnderflow="${this.setCustomValidityRangeUnderflow}"
29077
29145
  inputmode="${o(this.inputmode)}"
29078
29146
  >
29147
+ <span slot="displayValue">
29148
+ ${this.renderDisplayTextDate(this.value)}
29149
+ </span>
29079
29150
  <span slot="label"><slot name="fromLabel"></slot></span>
29080
29151
  </${this.inputTag}>
29081
29152
  </div>
@@ -29106,6 +29177,9 @@ class AuroDatePicker extends AuroElement$1 {
29106
29177
  setCustomValidityRangeUnderflow="${this.setCustomValidityRangeUnderflow}"
29107
29178
  ?disabled="${this.disabled}"
29108
29179
  part="input">
29180
+ <span slot="displayValue">
29181
+ ${this.renderDisplayTextDate(this.valueEnd)}
29182
+ </span>
29109
29183
  <span slot="label"><slot name="toLabel"></slot></span>
29110
29184
  </${this.inputTag}>
29111
29185
  </div>
@@ -1296,9 +1296,9 @@ var shapeSizeCss$2 = i$2`.wrapper{overflow:hidden}.shape-classic-xl,.shape-class
1296
1296
 
1297
1297
  var classicLayoutColor = i$2``;
1298
1298
 
1299
- var snowflakeStyle = i$2`.accents{flex-grow:0;flex-shrink:0;display:flex;align-items:center;justify-content:center}.accents.left{padding-right:var(--ds-size-100, 0.5rem)}.accents.right{width:var(--ds-size-400, 2rem)}.mainContent{height:100%;max-height:100%;flex-grow:1;display:flex;flex-direction:column;justify-content:center;align-items:center}.inputSection{display:flex;flex-direction:row;align-items:center;width:100%;max-width:250px;margin:0 auto}.inputSection:not(:is(.disabled,.hasFocus,.hasValue)) .inputDivider{display:none}.inputContainer{display:flex;flex-direction:row;align-items:center;width:100%}.inputContainer:first-of-type{justify-content:flex-end}.inputContainer:last-of-type{justify-content:flex-start}:host([disabled]) .inputSection{display:none}:host([layout*=snowflake]) [auro-input]{flex:1;text-align:center}:host([layout*=snowflake]) [auro-input]::part(label),:host([layout*=snowflake]) [auro-input]::part(accent-left),:host([layout*=snowflake]) [auro-input]::part(accent-right){display:none}:host([layout*=snowflake]) [auro-input]::part(input){padding-bottom:unset;text-align:center;font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);transition:unset}:host([layout*=snowflake]) [auro-input]::part(wrapper){min-height:unset;max-height:unset;box-shadow:unset}:host([layout*=snowflake]) [auro-input]::part(wrapper) .mainContent{padding-bottom:unset}:host([layout*=snowflake]) [auro-input]::part(inputHelpText){display:none}:host([layout*=snowflake]) [auro-dropdown]::part(trigger){width:100%}:host([layout*=snowflake]) .dpTriggerContent{width:100%}:host([layout*=snowflake]) .wrapper{height:60px;width:calc(100% - 48px);display:flex;flex-direction:row;justify-content:space-between;padding-left:24px;padding-right:24px}:host([layout*=snowflake]) label{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);font-weight:450;letter-spacing:0}:host([layout*=snowflake]) label.hasFocus,:host([layout*=snowflake]) label.hasValue{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-height-xs, 1rem)}:host([layout*=snowflake]) .inputDivider{height:18px;margin:4px 12px;width:2px}`;
1299
+ var snowflakeStyle = i$2`.accents{flex-grow:0;flex-shrink:0;display:flex;align-items:center;justify-content:center}.accents.left{padding-right:var(--ds-size-100, 0.5rem)}.accents.right{width:var(--ds-size-400, 2rem)}.mainContent{height:100%;max-height:100%;flex-grow:1;display:flex;flex-direction:column;justify-content:center;align-items:center}.inputSection{display:flex;flex-direction:row;align-items:center;width:100%;max-width:250px;margin:0 auto}.inputSection:not(:is(.disabled,.hasFocus,.hasValue)) .inputDivider{display:none}.inputContainer{display:flex;flex-direction:row;align-items:center;width:100%}.inputContainer:first-of-type{justify-content:flex-end}.inputContainer:last-of-type{justify-content:flex-start}:host([disabled]) .inputSection{display:none}:host([layout*=snowflake]) [auro-input]{flex:1;text-align:center}:host([layout*=snowflake]) [auro-input]::part(label),:host([layout*=snowflake]) [auro-input]::part(accent-left),:host([layout*=snowflake]) [auro-input]::part(accent-right){display:none}:host([layout*=snowflake]) [auro-input]::part(input){padding-bottom:unset;text-align:center;font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);transition:unset}:host([layout*=snowflake]) [auro-input]::part(wrapper){min-height:unset;max-height:unset;box-shadow:unset}:host([layout*=snowflake]) [auro-input]::part(wrapper) .mainContent{padding-bottom:unset}:host([layout*=snowflake]) [auro-input]::part(inputHelpText){display:none}:host([layout*=snowflake]) [auro-input]::part(displayValue){justify-content:center;font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem)}:host([layout*=snowflake]) [auro-dropdown]::part(trigger){width:100%}:host([layout*=snowflake]) .dpTriggerContent{width:100%}:host([layout*=snowflake]) .wrapper{height:60px;width:calc(100% - 48px);display:flex;flex-direction:row;justify-content:space-between;padding-left:24px;padding-right:24px}:host([layout*=snowflake]) label{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);font-weight:450;letter-spacing:0}:host([layout*=snowflake]) label.hasFocus,:host([layout*=snowflake]) label.hasValue{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-height-xs, 1rem)}:host([layout*=snowflake]) .inputDivider{height:18px;margin:4px 12px;width:2px}`;
1300
1300
 
1301
- var snowflakeColors = i$2`:host([layout=snowflake])[disabled] .mainContent label ::slotted(*){color:var(--ds-auro-icon-color)}:host([layout=snowflake]) label{color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([layout=snowflake]) .inputDivider{background-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([layout=snowflake]) .error{color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host([layout=snowflake]) [auro-input]::part(input)::placeholder{color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([layout=snowflake]) [auro-dropdown]:not(:is([error],.hasFocus))::part(wrapper){--ds-auro-dropdown-trigger-border-color: transparent}`;
1301
+ var snowflakeColors = i$2`:host([layout=snowflake])[disabled] .mainContent label ::slotted(*){color:var(--ds-auro-icon-color)}:host([layout=snowflake]) label{color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([layout=snowflake]) .inputDivider{background-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([layout=snowflake]) .error{color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host([layout=snowflake]) [auro-input]::part(input)::placeholder{color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([layout=snowflake]) [auro-input]::part(displayValue){background-color:inherit}:host([layout=snowflake]) [auro-dropdown]:not(:is([error],.hasFocus))::part(wrapper){--ds-auro-dropdown-trigger-border-color: transparent}`;
1302
1302
 
1303
1303
  var styleCss$d = i$2`:host{--calendar-width: 336px;--mobile-footer-height: 150px;--mobile-header-height: 68px;height:100vh;height:100dvh}.calendars{display:flex;flex-direction:row}.calendarNavButtons{position:absolute;top:var(--ds-size-200, 1rem);right:var(--ds-size-50, 0.25rem);left:var(--ds-size-50, 0.25rem)}.calendarNavBtn{display:flex;width:var(--ds-size-500, 2.5rem);height:var(--ds-size-500, 2.5rem);align-items:center;justify-content:center;border-width:1px;border-style:solid;border-radius:50%;cursor:pointer}.prevMonth,.nextMonth{position:absolute;top:0}.prevMonth{left:0}.nextMonth{right:0}.headerActions{padding:0 var(--ds-size-200, 1rem)}.mobileHeader{width:100%;height:var(--mobile-header-height);z-index:1;align-items:center;flex-direction:row}.headerDateFrom{display:flex;height:var(--mobile-header-height);flex:1;flex-direction:column;justify-content:center;padding:0 var(--ds-size-150, 0.75rem) 0 var(--ds-size-200, 1rem)}.mobileDateLabel{font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}.headerDateTo{height:calc(var(--mobile-header-height) - var(--ds-size-300, 1.5rem));padding:var(--ds-size-300, 1.5rem) var(--ds-size-100, 0.5rem) 0 var(--ds-size-200, 1rem)}:host(:not([noRange])) .headerDateTo{position:relative;display:flex;flex:1;flex-direction:column;justify-content:center}:host(:not([noRange])) .headerDateTo:after{position:absolute;top:calc(50% + 10px);left:0;display:block;width:1px;height:var(--ds-size-300, 1.5rem);content:"";transform:translateY(-50%)}.mobileFooter{display:none;width:100%;align-items:flex-end;flex-direction:column;justify-content:flex-end}.mobileFooterActions{position:relative;bottom:0;left:50%;display:none;width:calc(100% - var(--ds-size-200, 1rem)*2);align-items:flex-end;flex-direction:column;justify-content:flex-end;padding:var(--ds-size-150) calc(var(--ds-size-200, 1rem));transform:translateX(-50%)}.mobileFooterActions auro-button{width:100%}:host([isfullscreen]){width:100%;max-height:100dvh;overflow:hidden}:host([isfullscreen]) .prevMonth,:host([isfullscreen]) .nextMonth{display:none}:host([isfullscreen]) .mobileHeader,:host([isfullscreen]) .mobileFooter,:host([isfullscreen]) .mobileFooterActions{display:flex}:host([isfullscreen]) .calendarWrapper{display:flex;flex-direction:column}:host([isfullscreen]) .calendars{display:flex;flex-direction:column;flex:1;align-items:center;width:100%;overscroll-behavior:contain}:host([isfullscreen]) .calendars:after{display:block;width:100%;height:var(--mobile-footer-height);content:""}`;
1304
1304
 
@@ -15846,7 +15846,7 @@ class AuroFloatingUI {
15846
15846
  */
15847
15847
  mirrorSize() {
15848
15848
  // mirror the boxsize from bibSizer
15849
- if (this.element.bibSizer) {
15849
+ if (this.element.bibSizer && this.element.matchWidth) {
15850
15850
  const sizerStyle = window.getComputedStyle(this.element.bibSizer);
15851
15851
  const bibContent = this.element.bib.shadowRoot.querySelector(".container");
15852
15852
  if (sizerStyle.width !== '0px') {
@@ -16058,13 +16058,13 @@ class AuroFloatingUI {
16058
16058
  if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
16059
16059
  return;
16060
16060
  }
16061
-
16061
+
16062
16062
  // if fullscreen bib is in fullscreen mode, do not close
16063
16063
  if (this.element.bib.hasAttribute('isfullscreen')) {
16064
16064
  return;
16065
16065
  }
16066
16066
 
16067
- this.hideBib();
16067
+ this.hideBib("keydown");
16068
16068
  }
16069
16069
 
16070
16070
  setupHideHandlers() {
@@ -16089,7 +16089,7 @@ class AuroFloatingUI {
16089
16089
  document.expandedAuroFormkitDropdown = null;
16090
16090
  document.expandedAuroFloater = this;
16091
16091
  } else {
16092
- this.hideBib();
16092
+ this.hideBib("click");
16093
16093
  }
16094
16094
  }
16095
16095
  };
@@ -16102,7 +16102,7 @@ class AuroFloatingUI {
16102
16102
  // if something else is open, let it handle itself
16103
16103
  return;
16104
16104
  }
16105
- this.hideBib();
16105
+ this.hideBib("keydown");
16106
16106
  }
16107
16107
  };
16108
16108
 
@@ -16185,7 +16185,11 @@ class AuroFloatingUI {
16185
16185
  }
16186
16186
  }
16187
16187
 
16188
- hideBib() {
16188
+ /**
16189
+ * Hides the floating UI element.
16190
+ * @param {String} eventType - The event type that triggered the hiding action.
16191
+ */
16192
+ hideBib(eventType = "unknown") {
16189
16193
  if (!this.element.disabled && !this.element.noToggle) {
16190
16194
  this.lockScroll(false);
16191
16195
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -16196,7 +16200,7 @@ class AuroFloatingUI {
16196
16200
  if (this.showing) {
16197
16201
  this.cleanupHideHandlers();
16198
16202
  this.showing = false;
16199
- this.dispatchEventDropdownToggle();
16203
+ this.dispatchEventDropdownToggle(eventType);
16200
16204
  }
16201
16205
  }
16202
16206
  document.expandedAuroFloater = null;
@@ -16205,11 +16209,13 @@ class AuroFloatingUI {
16205
16209
  /**
16206
16210
  * @private
16207
16211
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
16212
+ * @param {String} eventType - The event type that triggered the toggle action.
16208
16213
  */
16209
- dispatchEventDropdownToggle() {
16214
+ dispatchEventDropdownToggle(eventType) {
16210
16215
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
16211
16216
  detail: {
16212
16217
  expanded: this.showing,
16218
+ eventType: eventType || "unknown",
16213
16219
  },
16214
16220
  composed: true
16215
16221
  });
@@ -16219,7 +16225,7 @@ class AuroFloatingUI {
16219
16225
 
16220
16226
  handleClick() {
16221
16227
  if (this.element.isPopoverVisible) {
16222
- this.hideBib();
16228
+ this.hideBib("click");
16223
16229
  } else {
16224
16230
  this.showBib();
16225
16231
  }
@@ -16246,7 +16252,7 @@ class AuroFloatingUI {
16246
16252
 
16247
16253
  event.preventDefault();
16248
16254
  this.handleClick();
16249
- }
16255
+ }
16250
16256
  break;
16251
16257
  case 'mouseenter':
16252
16258
  if (this.element.hoverToggle) {
@@ -16255,7 +16261,7 @@ class AuroFloatingUI {
16255
16261
  break;
16256
16262
  case 'mouseleave':
16257
16263
  if (this.element.hoverToggle) {
16258
- this.hideBib();
16264
+ this.hideBib("mouseleave");
16259
16265
  }
16260
16266
  break;
16261
16267
  case 'focus':
@@ -17643,6 +17649,9 @@ class AuroDropdown extends AuroElement$4 {
17643
17649
 
17644
17650
  this.parentBorder = false;
17645
17651
 
17652
+ /** @private */
17653
+ this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
17654
+
17646
17655
  this.privateDefaults();
17647
17656
  }
17648
17657
 
@@ -18076,12 +18085,19 @@ class AuroDropdown extends AuroElement$4 {
18076
18085
  if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
18077
18086
  this.handleTriggerContentSlotChange();
18078
18087
  }
18088
+ }
18079
18089
 
18080
- if (changedProperties.has('isPopoverVisible')) {
18081
- this.updateFocusTrap();
18082
- if (!this.isPopoverVisible && this.hasFocus) {
18083
- this.trigger.focus();
18084
- }
18090
+ /**
18091
+ * Handles the custom event `auroDropdown-toggled` to update the visibility of the dropdown bib.
18092
+ * @private
18093
+ * @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
18094
+ */
18095
+ handleDropdownToggle(event) {
18096
+ this.updateFocusTrap();
18097
+ this.isPopoverVisible = event.detail.expanded;
18098
+ const eventType = event.detail.eventType || "unknown";
18099
+ if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
18100
+ this.trigger.focus();
18085
18101
  }
18086
18102
  }
18087
18103
 
@@ -18089,6 +18105,7 @@ class AuroDropdown extends AuroElement$4 {
18089
18105
 
18090
18106
  // Configure the floater to, this will generate the ID for the bib
18091
18107
  this.floater.configure(this, 'auroDropdown');
18108
+ this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
18092
18109
 
18093
18110
  /**
18094
18111
  * @description Let subscribers know that the dropdown ID ha been generated and added.
@@ -27714,6 +27731,15 @@ class AuroDatePicker extends AuroElement$1 {
27714
27731
  this.layout = 'classic';
27715
27732
  this.shape = 'classic';
27716
27733
  this.size = 'lg';
27734
+
27735
+ /**
27736
+ * @private
27737
+ * @property {boolean} delegatesFocus - Whether the shadow root delegates focus.
27738
+ */
27739
+ this.constructor.shadowRootOptions = {
27740
+ ...i.shadowRootOptions,
27741
+ delegatesFocus: true,
27742
+ };
27717
27743
  }
27718
27744
 
27719
27745
  // This function is to define props used within the scope of this component
@@ -28451,6 +28477,7 @@ class AuroDatePicker extends AuroElement$1 {
28451
28477
  }
28452
28478
 
28453
28479
  this.hasFocus = true;
28480
+ this.dropdown.show();
28454
28481
 
28455
28482
  // shadowroot active element is null if we focus the datepicker itself
28456
28483
  if (this.shadowRoot.activeElement === null) {
@@ -28774,6 +28801,9 @@ class AuroDatePicker extends AuroElement$1 {
28774
28801
  `;
28775
28802
  }
28776
28803
 
28804
+ /**
28805
+ * @private
28806
+ */
28777
28807
  renderLayoutFromAttributes() {
28778
28808
  switch (this.layout) {
28779
28809
  case 'snowflake':
@@ -28786,6 +28816,44 @@ class AuroDatePicker extends AuroElement$1 {
28786
28816
  }
28787
28817
  }
28788
28818
 
28819
+ // eslint-disable-next-line no-warning-comments
28820
+ // TODO: move this to date utility when time allows :(
28821
+ /**
28822
+ * Simple formatter that ONLY WORKS FOR US DATES.
28823
+ * Returns formatted date like Apr 21 or Dec 25.
28824
+ * @private
28825
+ * @param {string} date - Date format should be in a format Date constructor accepts, like '2023-04-21' or '2023/04/21'.
28826
+ * @return {string}
28827
+ */
28828
+ formatShortDate(date) {
28829
+ // should render like Apr 21
28830
+ const options = {
28831
+ month: 'short',
28832
+ day: '2-digit'
28833
+ };
28834
+
28835
+ return new Date(date).toLocaleDateString('en-US', options).replace(',', '');
28836
+ }
28837
+
28838
+ /**
28839
+ * Format and render the provided date value.
28840
+ * @private
28841
+ * @param dateValue
28842
+ * @return {TemplateResult}
28843
+ */
28844
+ renderDisplayTextDate(dateValue) {
28845
+ return u$3`
28846
+ <div>
28847
+ <div class="displayValueText">
28848
+ ${dateValue && this.util.validDateStr(dateValue, this.format)
28849
+ ? this.formatShortDate(dateValue)
28850
+ : undefined
28851
+ }
28852
+ </div>
28853
+ </div>
28854
+ `;
28855
+ }
28856
+
28789
28857
  renderHtmlInputs() {
28790
28858
  const inputClasses = {
28791
28859
  "util_displayHiddenVisually": !this.hasValue && !this.hasFocus
@@ -28801,7 +28869,7 @@ class AuroDatePicker extends AuroElement$1 {
28801
28869
  .max="${this.maxDate}"
28802
28870
  .min="${this.minDate}"
28803
28871
  id="${this.generateRandomString(12)}"
28804
- placeholder="MM/DD"
28872
+ .placeholder="${this.placeholder}"
28805
28873
  simple
28806
28874
  bordered
28807
28875
  noValidate
@@ -28817,6 +28885,9 @@ class AuroDatePicker extends AuroElement$1 {
28817
28885
  setCustomValidityRangeUnderflow="${this.setCustomValidityRangeUnderflow}"
28818
28886
  inputmode="${o(this.inputmode)}"
28819
28887
  >
28888
+ <span slot="displayValue">
28889
+ ${this.renderDisplayTextDate(this.value)}
28890
+ </span>
28820
28891
  <span slot="label"><slot name="fromLabel"></slot></span>
28821
28892
  </${this.inputTag}>
28822
28893
  </div>
@@ -28847,6 +28918,9 @@ class AuroDatePicker extends AuroElement$1 {
28847
28918
  setCustomValidityRangeUnderflow="${this.setCustomValidityRangeUnderflow}"
28848
28919
  ?disabled="${this.disabled}"
28849
28920
  part="input">
28921
+ <span slot="displayValue">
28922
+ ${this.renderDisplayTextDate(this.valueEnd)}
28923
+ </span>
28850
28924
  <span slot="label"><slot name="toLabel"></slot></span>
28851
28925
  </${this.inputTag}>
28852
28926
  </div>
@@ -524,7 +524,25 @@ export class AuroDatePicker extends AuroElement {
524
524
  * @returns {import("lit").TemplateResult}
525
525
  */
526
526
  private renderSnowflakeLayout;
527
- renderLayoutFromAttributes(): import("lit-html").TemplateResult;
527
+ /**
528
+ * @private
529
+ */
530
+ private renderLayoutFromAttributes;
531
+ /**
532
+ * Simple formatter that ONLY WORKS FOR US DATES.
533
+ * Returns formatted date like Apr 21 or Dec 25.
534
+ * @private
535
+ * @param {string} date - Date format should be in a format Date constructor accepts, like '2023-04-21' or '2023/04/21'.
536
+ * @return {string}
537
+ */
538
+ private formatShortDate;
539
+ /**
540
+ * Format and render the provided date value.
541
+ * @private
542
+ * @param dateValue
543
+ * @return {TemplateResult}
544
+ */
545
+ private renderDisplayTextDate;
528
546
  renderHtmlInputs(): import("lit-html").TemplateResult;
529
547
  renderHtmlActionClear(): import("lit-html").TemplateResult;
530
548
  renderHtmlIconError(): import("lit-html").TemplateResult;