@aurodesignsystem-dev/auro-formkit 0.0.0-pr785.1 → 0.0.0-pr785.2

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.
@@ -3006,7 +3006,7 @@ class AuroFloatingUI {
3006
3006
  return;
3007
3007
  }
3008
3008
 
3009
- this.hideBib();
3009
+ this.hideBib("keydown");
3010
3010
  }
3011
3011
 
3012
3012
  setupHideHandlers() {
@@ -3031,7 +3031,7 @@ class AuroFloatingUI {
3031
3031
  document.expandedAuroFormkitDropdown = null;
3032
3032
  document.expandedAuroFloater = this;
3033
3033
  } else {
3034
- this.hideBib();
3034
+ this.hideBib("click");
3035
3035
  }
3036
3036
  }
3037
3037
  };
@@ -3044,7 +3044,7 @@ class AuroFloatingUI {
3044
3044
  // if something else is open, let it handle itself
3045
3045
  return;
3046
3046
  }
3047
- this.hideBib();
3047
+ this.hideBib("keydown");
3048
3048
  }
3049
3049
  };
3050
3050
 
@@ -3127,7 +3127,11 @@ class AuroFloatingUI {
3127
3127
  }
3128
3128
  }
3129
3129
 
3130
- hideBib() {
3130
+ /**
3131
+ * Hides the floating UI element.
3132
+ * @param {String} eventType - The event type that triggered the hiding action.
3133
+ */
3134
+ hideBib(eventType = "unknown") {
3131
3135
  if (!this.element.disabled && !this.element.noToggle) {
3132
3136
  this.lockScroll(false);
3133
3137
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -3138,7 +3142,7 @@ class AuroFloatingUI {
3138
3142
  if (this.showing) {
3139
3143
  this.cleanupHideHandlers();
3140
3144
  this.showing = false;
3141
- this.dispatchEventDropdownToggle();
3145
+ this.dispatchEventDropdownToggle(eventType);
3142
3146
  }
3143
3147
  }
3144
3148
  document.expandedAuroFloater = null;
@@ -3147,11 +3151,13 @@ class AuroFloatingUI {
3147
3151
  /**
3148
3152
  * @private
3149
3153
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
3154
+ * @param {String} eventType - The event type that triggered the toggle action.
3150
3155
  */
3151
- dispatchEventDropdownToggle() {
3156
+ dispatchEventDropdownToggle(eventType) {
3152
3157
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
3153
3158
  detail: {
3154
3159
  expanded: this.showing,
3160
+ eventType: eventType || "unknown",
3155
3161
  },
3156
3162
  composed: true
3157
3163
  });
@@ -3161,7 +3167,7 @@ class AuroFloatingUI {
3161
3167
 
3162
3168
  handleClick() {
3163
3169
  if (this.element.isPopoverVisible) {
3164
- this.hideBib();
3170
+ this.hideBib("click");
3165
3171
  } else {
3166
3172
  this.showBib();
3167
3173
  }
@@ -3197,7 +3203,7 @@ class AuroFloatingUI {
3197
3203
  break;
3198
3204
  case 'mouseleave':
3199
3205
  if (this.element.hoverToggle) {
3200
- this.hideBib();
3206
+ this.hideBib("mouseleave");
3201
3207
  }
3202
3208
  break;
3203
3209
  case 'focus':
@@ -2864,7 +2864,7 @@ class AuroFloatingUI {
2864
2864
  return;
2865
2865
  }
2866
2866
 
2867
- this.hideBib();
2867
+ this.hideBib("keydown");
2868
2868
  }
2869
2869
 
2870
2870
  setupHideHandlers() {
@@ -2889,7 +2889,7 @@ class AuroFloatingUI {
2889
2889
  document.expandedAuroFormkitDropdown = null;
2890
2890
  document.expandedAuroFloater = this;
2891
2891
  } else {
2892
- this.hideBib();
2892
+ this.hideBib("click");
2893
2893
  }
2894
2894
  }
2895
2895
  };
@@ -2902,7 +2902,7 @@ class AuroFloatingUI {
2902
2902
  // if something else is open, let it handle itself
2903
2903
  return;
2904
2904
  }
2905
- this.hideBib();
2905
+ this.hideBib("keydown");
2906
2906
  }
2907
2907
  };
2908
2908
 
@@ -2985,7 +2985,11 @@ class AuroFloatingUI {
2985
2985
  }
2986
2986
  }
2987
2987
 
2988
- hideBib() {
2988
+ /**
2989
+ * Hides the floating UI element.
2990
+ * @param {String} eventType - The event type that triggered the hiding action.
2991
+ */
2992
+ hideBib(eventType = "unknown") {
2989
2993
  if (!this.element.disabled && !this.element.noToggle) {
2990
2994
  this.lockScroll(false);
2991
2995
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -2996,7 +3000,7 @@ class AuroFloatingUI {
2996
3000
  if (this.showing) {
2997
3001
  this.cleanupHideHandlers();
2998
3002
  this.showing = false;
2999
- this.dispatchEventDropdownToggle();
3003
+ this.dispatchEventDropdownToggle(eventType);
3000
3004
  }
3001
3005
  }
3002
3006
  document.expandedAuroFloater = null;
@@ -3005,11 +3009,13 @@ class AuroFloatingUI {
3005
3009
  /**
3006
3010
  * @private
3007
3011
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
3012
+ * @param {String} eventType - The event type that triggered the toggle action.
3008
3013
  */
3009
- dispatchEventDropdownToggle() {
3014
+ dispatchEventDropdownToggle(eventType) {
3010
3015
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
3011
3016
  detail: {
3012
3017
  expanded: this.showing,
3018
+ eventType: eventType || "unknown",
3013
3019
  },
3014
3020
  composed: true
3015
3021
  });
@@ -3019,7 +3025,7 @@ class AuroFloatingUI {
3019
3025
 
3020
3026
  handleClick() {
3021
3027
  if (this.element.isPopoverVisible) {
3022
- this.hideBib();
3028
+ this.hideBib("click");
3023
3029
  } else {
3024
3030
  this.showBib();
3025
3031
  }
@@ -3055,7 +3061,7 @@ class AuroFloatingUI {
3055
3061
  break;
3056
3062
  case 'mouseleave':
3057
3063
  if (this.element.hoverToggle) {
3058
- this.hideBib();
3064
+ this.hideBib("mouseleave");
3059
3065
  }
3060
3066
  break;
3061
3067
  case 'focus':
@@ -2795,7 +2795,7 @@ class AuroFloatingUI {
2795
2795
  return;
2796
2796
  }
2797
2797
 
2798
- this.hideBib();
2798
+ this.hideBib("keydown");
2799
2799
  }
2800
2800
 
2801
2801
  setupHideHandlers() {
@@ -2820,7 +2820,7 @@ class AuroFloatingUI {
2820
2820
  document.expandedAuroFormkitDropdown = null;
2821
2821
  document.expandedAuroFloater = this;
2822
2822
  } else {
2823
- this.hideBib();
2823
+ this.hideBib("click");
2824
2824
  }
2825
2825
  }
2826
2826
  };
@@ -2833,7 +2833,7 @@ class AuroFloatingUI {
2833
2833
  // if something else is open, let it handle itself
2834
2834
  return;
2835
2835
  }
2836
- this.hideBib();
2836
+ this.hideBib("keydown");
2837
2837
  }
2838
2838
  };
2839
2839
 
@@ -2916,7 +2916,11 @@ class AuroFloatingUI {
2916
2916
  }
2917
2917
  }
2918
2918
 
2919
- hideBib() {
2919
+ /**
2920
+ * Hides the floating UI element.
2921
+ * @param {String} eventType - The event type that triggered the hiding action.
2922
+ */
2923
+ hideBib(eventType = "unknown") {
2920
2924
  if (!this.element.disabled && !this.element.noToggle) {
2921
2925
  this.lockScroll(false);
2922
2926
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -2927,7 +2931,7 @@ class AuroFloatingUI {
2927
2931
  if (this.showing) {
2928
2932
  this.cleanupHideHandlers();
2929
2933
  this.showing = false;
2930
- this.dispatchEventDropdownToggle();
2934
+ this.dispatchEventDropdownToggle(eventType);
2931
2935
  }
2932
2936
  }
2933
2937
  document.expandedAuroFloater = null;
@@ -2936,11 +2940,13 @@ class AuroFloatingUI {
2936
2940
  /**
2937
2941
  * @private
2938
2942
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
2943
+ * @param {String} eventType - The event type that triggered the toggle action.
2939
2944
  */
2940
- dispatchEventDropdownToggle() {
2945
+ dispatchEventDropdownToggle(eventType) {
2941
2946
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
2942
2947
  detail: {
2943
2948
  expanded: this.showing,
2949
+ eventType: eventType || "unknown",
2944
2950
  },
2945
2951
  composed: true
2946
2952
  });
@@ -2950,7 +2956,7 @@ class AuroFloatingUI {
2950
2956
 
2951
2957
  handleClick() {
2952
2958
  if (this.element.isPopoverVisible) {
2953
- this.hideBib();
2959
+ this.hideBib("click");
2954
2960
  } else {
2955
2961
  this.showBib();
2956
2962
  }
@@ -2986,7 +2992,7 @@ class AuroFloatingUI {
2986
2992
  break;
2987
2993
  case 'mouseleave':
2988
2994
  if (this.element.hoverToggle) {
2989
- this.hideBib();
2995
+ this.hideBib("mouseleave");
2990
2996
  }
2991
2997
  break;
2992
2998
  case 'focus':
@@ -2795,7 +2795,7 @@ class AuroFloatingUI {
2795
2795
  return;
2796
2796
  }
2797
2797
 
2798
- this.hideBib();
2798
+ this.hideBib("keydown");
2799
2799
  }
2800
2800
 
2801
2801
  setupHideHandlers() {
@@ -2820,7 +2820,7 @@ class AuroFloatingUI {
2820
2820
  document.expandedAuroFormkitDropdown = null;
2821
2821
  document.expandedAuroFloater = this;
2822
2822
  } else {
2823
- this.hideBib();
2823
+ this.hideBib("click");
2824
2824
  }
2825
2825
  }
2826
2826
  };
@@ -2833,7 +2833,7 @@ class AuroFloatingUI {
2833
2833
  // if something else is open, let it handle itself
2834
2834
  return;
2835
2835
  }
2836
- this.hideBib();
2836
+ this.hideBib("keydown");
2837
2837
  }
2838
2838
  };
2839
2839
 
@@ -2916,7 +2916,11 @@ class AuroFloatingUI {
2916
2916
  }
2917
2917
  }
2918
2918
 
2919
- hideBib() {
2919
+ /**
2920
+ * Hides the floating UI element.
2921
+ * @param {String} eventType - The event type that triggered the hiding action.
2922
+ */
2923
+ hideBib(eventType = "unknown") {
2920
2924
  if (!this.element.disabled && !this.element.noToggle) {
2921
2925
  this.lockScroll(false);
2922
2926
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -2927,7 +2931,7 @@ class AuroFloatingUI {
2927
2931
  if (this.showing) {
2928
2932
  this.cleanupHideHandlers();
2929
2933
  this.showing = false;
2930
- this.dispatchEventDropdownToggle();
2934
+ this.dispatchEventDropdownToggle(eventType);
2931
2935
  }
2932
2936
  }
2933
2937
  document.expandedAuroFloater = null;
@@ -2936,11 +2940,13 @@ class AuroFloatingUI {
2936
2940
  /**
2937
2941
  * @private
2938
2942
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
2943
+ * @param {String} eventType - The event type that triggered the toggle action.
2939
2944
  */
2940
- dispatchEventDropdownToggle() {
2945
+ dispatchEventDropdownToggle(eventType) {
2941
2946
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
2942
2947
  detail: {
2943
2948
  expanded: this.showing,
2949
+ eventType: eventType || "unknown",
2944
2950
  },
2945
2951
  composed: true
2946
2952
  });
@@ -2950,7 +2956,7 @@ class AuroFloatingUI {
2950
2956
 
2951
2957
  handleClick() {
2952
2958
  if (this.element.isPopoverVisible) {
2953
- this.hideBib();
2959
+ this.hideBib("click");
2954
2960
  } else {
2955
2961
  this.showBib();
2956
2962
  }
@@ -2986,7 +2992,7 @@ class AuroFloatingUI {
2986
2992
  break;
2987
2993
  case 'mouseleave':
2988
2994
  if (this.element.hoverToggle) {
2989
- this.hideBib();
2995
+ this.hideBib("mouseleave");
2990
2996
  }
2991
2997
  break;
2992
2998
  case 'focus':
@@ -4966,7 +4966,7 @@ class AuroFloatingUI {
4966
4966
  return;
4967
4967
  }
4968
4968
 
4969
- this.hideBib();
4969
+ this.hideBib("keydown");
4970
4970
  }
4971
4971
 
4972
4972
  setupHideHandlers() {
@@ -4991,7 +4991,7 @@ class AuroFloatingUI {
4991
4991
  document.expandedAuroFormkitDropdown = null;
4992
4992
  document.expandedAuroFloater = this;
4993
4993
  } else {
4994
- this.hideBib();
4994
+ this.hideBib("click");
4995
4995
  }
4996
4996
  }
4997
4997
  };
@@ -5004,7 +5004,7 @@ class AuroFloatingUI {
5004
5004
  // if something else is open, let it handle itself
5005
5005
  return;
5006
5006
  }
5007
- this.hideBib();
5007
+ this.hideBib("keydown");
5008
5008
  }
5009
5009
  };
5010
5010
 
@@ -5087,7 +5087,11 @@ class AuroFloatingUI {
5087
5087
  }
5088
5088
  }
5089
5089
 
5090
- hideBib() {
5090
+ /**
5091
+ * Hides the floating UI element.
5092
+ * @param {String} eventType - The event type that triggered the hiding action.
5093
+ */
5094
+ hideBib(eventType = "unknown") {
5091
5095
  if (!this.element.disabled && !this.element.noToggle) {
5092
5096
  this.lockScroll(false);
5093
5097
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -5098,7 +5102,7 @@ class AuroFloatingUI {
5098
5102
  if (this.showing) {
5099
5103
  this.cleanupHideHandlers();
5100
5104
  this.showing = false;
5101
- this.dispatchEventDropdownToggle();
5105
+ this.dispatchEventDropdownToggle(eventType);
5102
5106
  }
5103
5107
  }
5104
5108
  document.expandedAuroFloater = null;
@@ -5107,11 +5111,13 @@ class AuroFloatingUI {
5107
5111
  /**
5108
5112
  * @private
5109
5113
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
5114
+ * @param {String} eventType - The event type that triggered the toggle action.
5110
5115
  */
5111
- dispatchEventDropdownToggle() {
5116
+ dispatchEventDropdownToggle(eventType) {
5112
5117
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
5113
5118
  detail: {
5114
5119
  expanded: this.showing,
5120
+ eventType: eventType || "unknown",
5115
5121
  },
5116
5122
  composed: true
5117
5123
  });
@@ -5121,7 +5127,7 @@ class AuroFloatingUI {
5121
5127
 
5122
5128
  handleClick() {
5123
5129
  if (this.element.isPopoverVisible) {
5124
- this.hideBib();
5130
+ this.hideBib("click");
5125
5131
  } else {
5126
5132
  this.showBib();
5127
5133
  }
@@ -5157,7 +5163,7 @@ class AuroFloatingUI {
5157
5163
  break;
5158
5164
  case 'mouseleave':
5159
5165
  if (this.element.hoverToggle) {
5160
- this.hideBib();
5166
+ this.hideBib("mouseleave");
5161
5167
  }
5162
5168
  break;
5163
5169
  case 'focus':
@@ -4966,7 +4966,7 @@ class AuroFloatingUI {
4966
4966
  return;
4967
4967
  }
4968
4968
 
4969
- this.hideBib();
4969
+ this.hideBib("keydown");
4970
4970
  }
4971
4971
 
4972
4972
  setupHideHandlers() {
@@ -4991,7 +4991,7 @@ class AuroFloatingUI {
4991
4991
  document.expandedAuroFormkitDropdown = null;
4992
4992
  document.expandedAuroFloater = this;
4993
4993
  } else {
4994
- this.hideBib();
4994
+ this.hideBib("click");
4995
4995
  }
4996
4996
  }
4997
4997
  };
@@ -5004,7 +5004,7 @@ class AuroFloatingUI {
5004
5004
  // if something else is open, let it handle itself
5005
5005
  return;
5006
5006
  }
5007
- this.hideBib();
5007
+ this.hideBib("keydown");
5008
5008
  }
5009
5009
  };
5010
5010
 
@@ -5087,7 +5087,11 @@ class AuroFloatingUI {
5087
5087
  }
5088
5088
  }
5089
5089
 
5090
- hideBib() {
5090
+ /**
5091
+ * Hides the floating UI element.
5092
+ * @param {String} eventType - The event type that triggered the hiding action.
5093
+ */
5094
+ hideBib(eventType = "unknown") {
5091
5095
  if (!this.element.disabled && !this.element.noToggle) {
5092
5096
  this.lockScroll(false);
5093
5097
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -5098,7 +5102,7 @@ class AuroFloatingUI {
5098
5102
  if (this.showing) {
5099
5103
  this.cleanupHideHandlers();
5100
5104
  this.showing = false;
5101
- this.dispatchEventDropdownToggle();
5105
+ this.dispatchEventDropdownToggle(eventType);
5102
5106
  }
5103
5107
  }
5104
5108
  document.expandedAuroFloater = null;
@@ -5107,11 +5111,13 @@ class AuroFloatingUI {
5107
5111
  /**
5108
5112
  * @private
5109
5113
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
5114
+ * @param {String} eventType - The event type that triggered the toggle action.
5110
5115
  */
5111
- dispatchEventDropdownToggle() {
5116
+ dispatchEventDropdownToggle(eventType) {
5112
5117
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
5113
5118
  detail: {
5114
5119
  expanded: this.showing,
5120
+ eventType: eventType || "unknown",
5115
5121
  },
5116
5122
  composed: true
5117
5123
  });
@@ -5121,7 +5127,7 @@ class AuroFloatingUI {
5121
5127
 
5122
5128
  handleClick() {
5123
5129
  if (this.element.isPopoverVisible) {
5124
- this.hideBib();
5130
+ this.hideBib("click");
5125
5131
  } else {
5126
5132
  this.showBib();
5127
5133
  }
@@ -5157,7 +5163,7 @@ class AuroFloatingUI {
5157
5163
  break;
5158
5164
  case 'mouseleave':
5159
5165
  if (this.element.hoverToggle) {
5160
- this.hideBib();
5166
+ this.hideBib("mouseleave");
5161
5167
  }
5162
5168
  break;
5163
5169
  case 'focus':
@@ -4919,7 +4919,7 @@ class AuroFloatingUI {
4919
4919
  return;
4920
4920
  }
4921
4921
 
4922
- this.hideBib();
4922
+ this.hideBib("keydown");
4923
4923
  }
4924
4924
 
4925
4925
  setupHideHandlers() {
@@ -4944,7 +4944,7 @@ class AuroFloatingUI {
4944
4944
  document.expandedAuroFormkitDropdown = null;
4945
4945
  document.expandedAuroFloater = this;
4946
4946
  } else {
4947
- this.hideBib();
4947
+ this.hideBib("click");
4948
4948
  }
4949
4949
  }
4950
4950
  };
@@ -4957,7 +4957,7 @@ class AuroFloatingUI {
4957
4957
  // if something else is open, let it handle itself
4958
4958
  return;
4959
4959
  }
4960
- this.hideBib();
4960
+ this.hideBib("keydown");
4961
4961
  }
4962
4962
  };
4963
4963
 
@@ -5040,7 +5040,11 @@ class AuroFloatingUI {
5040
5040
  }
5041
5041
  }
5042
5042
 
5043
- hideBib() {
5043
+ /**
5044
+ * Hides the floating UI element.
5045
+ * @param {String} eventType - The event type that triggered the hiding action.
5046
+ */
5047
+ hideBib(eventType = "unknown") {
5044
5048
  if (!this.element.disabled && !this.element.noToggle) {
5045
5049
  this.lockScroll(false);
5046
5050
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -5051,7 +5055,7 @@ class AuroFloatingUI {
5051
5055
  if (this.showing) {
5052
5056
  this.cleanupHideHandlers();
5053
5057
  this.showing = false;
5054
- this.dispatchEventDropdownToggle();
5058
+ this.dispatchEventDropdownToggle(eventType);
5055
5059
  }
5056
5060
  }
5057
5061
  document.expandedAuroFloater = null;
@@ -5060,11 +5064,13 @@ class AuroFloatingUI {
5060
5064
  /**
5061
5065
  * @private
5062
5066
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
5067
+ * @param {String} eventType - The event type that triggered the toggle action.
5063
5068
  */
5064
- dispatchEventDropdownToggle() {
5069
+ dispatchEventDropdownToggle(eventType) {
5065
5070
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
5066
5071
  detail: {
5067
5072
  expanded: this.showing,
5073
+ eventType: eventType || "unknown",
5068
5074
  },
5069
5075
  composed: true
5070
5076
  });
@@ -5074,7 +5080,7 @@ class AuroFloatingUI {
5074
5080
 
5075
5081
  handleClick() {
5076
5082
  if (this.element.isPopoverVisible) {
5077
- this.hideBib();
5083
+ this.hideBib("click");
5078
5084
  } else {
5079
5085
  this.showBib();
5080
5086
  }
@@ -5110,7 +5116,7 @@ class AuroFloatingUI {
5110
5116
  break;
5111
5117
  case 'mouseleave':
5112
5118
  if (this.element.hoverToggle) {
5113
- this.hideBib();
5119
+ this.hideBib("mouseleave");
5114
5120
  }
5115
5121
  break;
5116
5122
  case 'focus':
@@ -4919,7 +4919,7 @@ class AuroFloatingUI {
4919
4919
  return;
4920
4920
  }
4921
4921
 
4922
- this.hideBib();
4922
+ this.hideBib("keydown");
4923
4923
  }
4924
4924
 
4925
4925
  setupHideHandlers() {
@@ -4944,7 +4944,7 @@ class AuroFloatingUI {
4944
4944
  document.expandedAuroFormkitDropdown = null;
4945
4945
  document.expandedAuroFloater = this;
4946
4946
  } else {
4947
- this.hideBib();
4947
+ this.hideBib("click");
4948
4948
  }
4949
4949
  }
4950
4950
  };
@@ -4957,7 +4957,7 @@ class AuroFloatingUI {
4957
4957
  // if something else is open, let it handle itself
4958
4958
  return;
4959
4959
  }
4960
- this.hideBib();
4960
+ this.hideBib("keydown");
4961
4961
  }
4962
4962
  };
4963
4963
 
@@ -5040,7 +5040,11 @@ class AuroFloatingUI {
5040
5040
  }
5041
5041
  }
5042
5042
 
5043
- hideBib() {
5043
+ /**
5044
+ * Hides the floating UI element.
5045
+ * @param {String} eventType - The event type that triggered the hiding action.
5046
+ */
5047
+ hideBib(eventType = "unknown") {
5044
5048
  if (!this.element.disabled && !this.element.noToggle) {
5045
5049
  this.lockScroll(false);
5046
5050
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -5051,7 +5055,7 @@ class AuroFloatingUI {
5051
5055
  if (this.showing) {
5052
5056
  this.cleanupHideHandlers();
5053
5057
  this.showing = false;
5054
- this.dispatchEventDropdownToggle();
5058
+ this.dispatchEventDropdownToggle(eventType);
5055
5059
  }
5056
5060
  }
5057
5061
  document.expandedAuroFloater = null;
@@ -5060,11 +5064,13 @@ class AuroFloatingUI {
5060
5064
  /**
5061
5065
  * @private
5062
5066
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
5067
+ * @param {String} eventType - The event type that triggered the toggle action.
5063
5068
  */
5064
- dispatchEventDropdownToggle() {
5069
+ dispatchEventDropdownToggle(eventType) {
5065
5070
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
5066
5071
  detail: {
5067
5072
  expanded: this.showing,
5073
+ eventType: eventType || "unknown",
5068
5074
  },
5069
5075
  composed: true
5070
5076
  });
@@ -5074,7 +5080,7 @@ class AuroFloatingUI {
5074
5080
 
5075
5081
  handleClick() {
5076
5082
  if (this.element.isPopoverVisible) {
5077
- this.hideBib();
5083
+ this.hideBib("click");
5078
5084
  } else {
5079
5085
  this.showBib();
5080
5086
  }
@@ -5110,7 +5116,7 @@ class AuroFloatingUI {
5110
5116
  break;
5111
5117
  case 'mouseleave':
5112
5118
  if (this.element.hoverToggle) {
5113
- this.hideBib();
5119
+ this.hideBib("mouseleave");
5114
5120
  }
5115
5121
  break;
5116
5122
  case 'focus':