@aurodesignsystem-dev/auro-formkit 0.0.0-pr1492.4 → 0.0.0-pr1493.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.
Files changed (153) hide show
  1. package/components/bibtemplate/dist/auro-bibtemplate.d.ts +7 -0
  2. package/components/bibtemplate/dist/index.js +9 -1
  3. package/components/bibtemplate/dist/registered.js +9 -1
  4. package/components/checkbox/demo/css-only.html +57 -0
  5. package/components/checkbox/demo/css-only.md +146 -0
  6. package/components/checkbox/demo/customize.min.js +2 -2
  7. package/components/checkbox/demo/getting-started.min.js +2 -2
  8. package/components/checkbox/demo/index.min.js +2 -2
  9. package/components/checkbox/demo/pages.json +1 -1
  10. package/components/checkbox/demo/styles.min.css +1 -1
  11. package/components/checkbox/demo/why-checkbox.html +57 -0
  12. package/components/checkbox/demo/why-checkbox.md +86 -0
  13. package/components/checkbox/dist/index.js +2 -2
  14. package/components/checkbox/dist/registered.js +2 -2
  15. package/components/combobox/demo/css-only.html +57 -0
  16. package/components/combobox/demo/css-only.md +209 -0
  17. package/components/combobox/demo/customize.md +7 -3
  18. package/components/combobox/demo/customize.min.js +1846 -1804
  19. package/components/combobox/demo/getting-started.min.js +1846 -1804
  20. package/components/combobox/demo/index.min.js +1846 -1804
  21. package/components/combobox/demo/pages.json +1 -1
  22. package/components/combobox/demo/styles.min.css +1 -1
  23. package/components/combobox/demo/why-combobox.html +57 -0
  24. package/components/combobox/demo/why-combobox.md +113 -0
  25. package/components/combobox/dist/auro-combobox.d.ts +5 -0
  26. package/components/combobox/dist/index.js +796 -179
  27. package/components/combobox/dist/registered.js +796 -179
  28. package/components/counter/demo/css-only.html +57 -0
  29. package/components/counter/demo/css-only.md +184 -0
  30. package/components/counter/demo/customize.min.js +276 -16
  31. package/components/counter/demo/index.min.js +276 -16
  32. package/components/counter/demo/keyboard-behavior.md +1 -0
  33. package/components/counter/demo/pages.json +1 -1
  34. package/components/counter/demo/styles.min.css +1 -1
  35. package/components/counter/demo/why-counter.html +57 -0
  36. package/components/counter/demo/why-counter.md +108 -0
  37. package/components/counter/dist/index.js +5457 -193
  38. package/components/counter/dist/registered.js +5457 -193
  39. package/components/datepicker/demo/accessibility.md +54 -3
  40. package/components/datepicker/demo/api.md +65 -55
  41. package/components/datepicker/demo/css-only.html +57 -0
  42. package/components/datepicker/demo/css-only.md +151 -0
  43. package/components/datepicker/demo/customize.html +2 -0
  44. package/components/datepicker/demo/customize.js +19 -0
  45. package/components/datepicker/demo/customize.md +474 -298
  46. package/components/datepicker/demo/customize.min.js +36243 -0
  47. package/components/datepicker/demo/design.md +5 -3
  48. package/components/datepicker/demo/getting-started.md +6 -6
  49. package/components/datepicker/demo/index.js +5 -1
  50. package/components/datepicker/demo/index.md +113 -16
  51. package/components/datepicker/demo/index.min.js +2736 -398
  52. package/components/datepicker/demo/keyboard-behavior.md +201 -2
  53. package/components/datepicker/demo/pages.json +1 -1
  54. package/components/datepicker/demo/styles.min.css +1 -1
  55. package/components/datepicker/demo/voiceover.md +21 -12
  56. package/components/datepicker/demo/why-datepicker.html +57 -0
  57. package/components/datepicker/demo/why-datepicker.md +133 -0
  58. package/components/datepicker/dist/index.js +2650 -399
  59. package/components/datepicker/dist/registered.js +2650 -399
  60. package/components/datepicker/dist/src/auro-calendar-cell.d.ts +116 -14
  61. package/components/datepicker/dist/src/auro-calendar-month.d.ts +54 -1
  62. package/components/datepicker/dist/src/auro-calendar.d.ts +264 -0
  63. package/components/datepicker/dist/src/auro-datepicker.d.ts +189 -53
  64. package/components/datepicker/dist/src/datepickerKeyboardStrategy.d.ts +5 -3
  65. package/components/datepicker/dist/src/utilities.d.ts +0 -14
  66. package/components/dropdown/demo/accessibility.md +11 -0
  67. package/components/dropdown/demo/api.md +1 -0
  68. package/components/dropdown/demo/css-only.html +57 -0
  69. package/components/dropdown/demo/css-only.md +219 -0
  70. package/components/dropdown/demo/customize.md +3 -0
  71. package/components/dropdown/demo/customize.min.js +265 -13
  72. package/components/dropdown/demo/getting-started.min.js +265 -13
  73. package/components/dropdown/demo/index.min.js +265 -13
  74. package/components/dropdown/demo/keyboard-behavior.md +1 -0
  75. package/components/dropdown/demo/pages.json +1 -1
  76. package/components/dropdown/demo/styles.min.css +1 -1
  77. package/components/dropdown/demo/why-dropdown.html +57 -0
  78. package/components/dropdown/demo/why-dropdown.md +97 -0
  79. package/components/dropdown/dist/auro-dropdown.d.ts +36 -1
  80. package/components/dropdown/dist/index.js +265 -13
  81. package/components/dropdown/dist/registered.js +265 -13
  82. package/components/form/demo/css-only.html +57 -0
  83. package/components/form/demo/css-only.md +156 -0
  84. package/components/form/demo/customize.min.js +11085 -8074
  85. package/components/form/demo/getting-started.min.js +11085 -8074
  86. package/components/form/demo/index.min.js +11085 -8074
  87. package/components/form/demo/pages.json +1 -1
  88. package/components/form/demo/registerDemoDeps.min.js +11084 -8073
  89. package/components/form/demo/styles.min.css +1 -1
  90. package/components/form/demo/why-form.html +57 -0
  91. package/components/form/demo/why-form.md +101 -0
  92. package/components/input/demo/css-only.html +57 -0
  93. package/components/input/demo/css-only.md +199 -0
  94. package/components/input/demo/customize.md +625 -636
  95. package/components/input/demo/customize.min.js +150 -75
  96. package/components/input/demo/getting-started.md +16 -6
  97. package/components/input/demo/getting-started.min.js +150 -75
  98. package/components/input/demo/index.min.js +150 -75
  99. package/components/input/demo/pages.json +1 -1
  100. package/components/input/demo/styles.min.css +1 -1
  101. package/components/input/demo/why-input.html +57 -0
  102. package/components/input/demo/why-input.md +121 -0
  103. package/components/input/dist/auro-input-util.d.ts +1 -1
  104. package/components/input/dist/base-input.d.ts +16 -0
  105. package/components/input/dist/index.js +150 -75
  106. package/components/input/dist/registered.js +150 -75
  107. package/components/input/dist/utilities.d.ts +1 -2
  108. package/components/menu/demo/api.md +41 -45
  109. package/components/menu/demo/css-only.html +57 -0
  110. package/components/menu/demo/css-only.md +166 -0
  111. package/components/menu/demo/customize.md +0 -28
  112. package/components/menu/demo/index.min.js +779 -1354
  113. package/components/menu/demo/pages.json +1 -1
  114. package/components/menu/demo/styles.min.css +1 -1
  115. package/components/menu/demo/why-menu.html +57 -0
  116. package/components/menu/demo/why-menu.md +104 -0
  117. package/components/menu/dist/auro-menu.d.ts +95 -110
  118. package/components/menu/dist/auro-menuoption.d.ts +32 -138
  119. package/components/menu/dist/index.js +753 -1308
  120. package/components/menu/dist/registered.js +765 -1308
  121. package/components/radio/demo/css-only.html +57 -0
  122. package/components/radio/demo/css-only.md +151 -0
  123. package/components/radio/demo/customize.min.js +1764 -0
  124. package/components/radio/demo/demo-support.min.js +55807 -0
  125. package/components/radio/demo/getting-started.js +1 -1
  126. package/components/radio/demo/getting-started.md +1 -1
  127. package/components/radio/demo/getting-started.min.js +1783 -0
  128. package/components/radio/demo/index.min.js +2 -2
  129. package/components/radio/demo/pages.json +1 -1
  130. package/components/radio/demo/styles.min.css +1 -1
  131. package/components/radio/demo/why-radio.html +57 -0
  132. package/components/radio/demo/why-radio.md +92 -0
  133. package/components/radio/dist/index.js +2 -2
  134. package/components/radio/dist/registered.js +2 -2
  135. package/components/select/demo/api.md +1 -0
  136. package/components/select/demo/css-only.html +57 -0
  137. package/components/select/demo/css-only.md +203 -0
  138. package/components/select/demo/customize.md +78 -3
  139. package/components/select/demo/customize.min.js +1341 -1533
  140. package/components/select/demo/getting-started.min.js +1341 -1533
  141. package/components/select/demo/index.min.js +1341 -1533
  142. package/components/select/demo/keyboard-behavior.md +19 -0
  143. package/components/select/demo/pages.json +1 -1
  144. package/components/select/demo/styles.min.css +1 -1
  145. package/components/select/demo/why-select.html +57 -0
  146. package/components/select/demo/why-select.md +128 -0
  147. package/components/select/dist/auro-select.d.ts +38 -2
  148. package/components/select/dist/index.js +435 -52
  149. package/components/select/dist/registered.js +435 -52
  150. package/components/select/dist/selectUtils.d.ts +12 -0
  151. package/custom-elements.json +3051 -2553
  152. package/package.json +8 -8
  153. package/components/menu/dist/auro-menu.context.d.ts +0 -238
@@ -3311,7 +3311,7 @@ function applyKeyboardStrategy(component, strategy, options = {}) {
3311
3311
  });
3312
3312
  }
3313
3313
 
3314
- var styleCss$2 = i$2`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}:host dialog{width:auto;max-width:none;height:auto;max-height:none;padding:0;border:none;margin:0;outline:none;transform:translateZ(0)}:host dialog::backdrop{background:transparent}:host(:not([isfullscreen])) dialog{position:relative;inset:unset}:host(:not([isfullscreen])) .container.shape-box{border-radius:unset}:host(:not([isfullscreen])) .container[class*=shape-pill],:host(:not([isfullscreen])) .container[class*=shape-snowflake]{border-radius:30px}:host(:not([isfullscreen])) .container[class*=shape-rounded]{border-radius:16px}:host(:not([matchWidth])) .container{min-width:fit-content}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset;overscroll-behavior:contain}:host([isfullscreen]) .container::backdrop{background:var(--ds-color-background-primary, #fff)}:host(:popover-open){position:fixed;overflow:visible;padding:0;border:none;margin:0;background:transparent;inset:unset;outline:none}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common][isfullscreen]) .container,:host([rounded][isfullscreen]) .container{border-radius:unset;box-shadow:unset}.container{display:inline-block;overflow:auto;box-sizing:border-box;border-radius:var(--ds-border-radius, 0.375rem);margin:var(--ds-size-50, 0.25rem) 0}.util_displayHiddenVisually{position:absolute;overflow:hidden;width:1px;height:1px;padding:0;border:0;margin:-1px;clip-path:inset(50%);white-space:nowrap}`;
3314
+ var styleCss$2 = i$2`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}:host dialog{width:auto;max-width:none;height:auto;max-height:none;padding:0;border:none;margin:0;outline:none;transform:translateZ(0)}:host dialog::backdrop{background:transparent}:host(:not([isfullscreen])) dialog{position:relative;inset:unset}:host(:not([isfullscreen])) .container.shape-box{border-radius:unset}:host(:not([isfullscreen])) .container[class*=shape-pill],:host(:not([isfullscreen])) .container[class*=shape-snowflake]{border-radius:30px}:host(:not([isfullscreen])) .container[class*=shape-rounded]{border-radius:16px}:host([desktopmodal]:popover-open)::backdrop{background:transparent}:host(:not([matchWidth])) .container{min-width:fit-content}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset;overscroll-behavior:contain}:host([isfullscreen]) .container::backdrop{background:var(--ds-color-background-primary, #fff)}:host(:popover-open){position:fixed;overflow:visible;padding:0;border:none;margin:0;background:transparent;inset:unset;outline:none}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common][isfullscreen]) .container,:host([rounded][isfullscreen]) .container{border-radius:unset;box-shadow:unset}.container{display:inline-block;overflow:auto;box-sizing:border-box;border-radius:var(--ds-border-radius, 0.375rem);margin:var(--ds-size-50, 0.25rem) 0}.util_displayHiddenVisually{position:absolute;overflow:hidden;width:1px;height:1px;padding:0;border:0;margin:-1px;clip-path:inset(50%);white-space:nowrap}`;
3315
3315
 
3316
3316
  var colorCss$2 = i$2`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
3317
3317
 
@@ -3942,7 +3942,7 @@ class AuroHelpText extends i {
3942
3942
  }
3943
3943
  }
3944
3944
 
3945
- var formkitVersion = '202606031929';
3945
+ var formkitVersion = '202606181613';
3946
3946
 
3947
3947
  class AuroElement extends i {
3948
3948
  static get properties() {
@@ -4122,6 +4122,7 @@ class AuroDropdown extends AuroElement {
4122
4122
  _intializeDefaults() {
4123
4123
  this.appearance = 'default';
4124
4124
  this.chevron = false;
4125
+ this.desktopModal = false;
4125
4126
  this.disabled = false;
4126
4127
  this.disableKeyboardHandling = false;
4127
4128
  this.error = false;
@@ -4302,6 +4303,14 @@ class AuroDropdown extends AuroElement {
4302
4303
  reflect: true
4303
4304
  },
4304
4305
 
4306
+ /**
4307
+ * If declared, the dropdown will behave as a modal dialog when in a desktop viewport size.
4308
+ */
4309
+ desktopModal: {
4310
+ type: Boolean,
4311
+ reflect: true
4312
+ },
4313
+
4305
4314
  /**
4306
4315
  * If declared, the dropdown will only show by calling the API .show() public method.
4307
4316
  */
@@ -4589,6 +4598,15 @@ class AuroDropdown extends AuroElement {
4589
4598
 
4590
4599
  disconnectedCallback() {
4591
4600
  super.disconnectedCallback();
4601
+ this._clearPageInert();
4602
+ if (this._bibTabHandler) {
4603
+ this.removeEventListener('keydown', this._bibTabHandler);
4604
+ this._bibTabHandler = undefined;
4605
+ }
4606
+ if (this.focusTrap) {
4607
+ this.focusTrap.disconnect();
4608
+ this.focusTrap = undefined;
4609
+ }
4592
4610
  if (this.floater) {
4593
4611
  this.floater.hideBib('disconnect');
4594
4612
  this.floater.disconnect();
@@ -4616,19 +4634,45 @@ class AuroDropdown extends AuroElement {
4616
4634
  if (this.isPopoverVisible) {
4617
4635
  // Fullscreen: use showModal() for native accessibility (inert outside, focus trap)
4618
4636
  // Desktop: use show() for Floating UI positioning + FocusTrap for focus management
4619
- const useModal = this.isBibFullscreen;
4620
- this.bibElement.value.open(useModal);
4637
+ this.bibElement.value.open(this.isBibFullscreen);
4638
+ this.updateFocusTrap();
4639
+
4640
+ // Desktop modal: make siblings inert so content outside is not interactive
4641
+ if (this.desktopModal && !this.isBibFullscreen) {
4642
+ this._setPageInert();
4643
+ }
4621
4644
  } else {
4622
4645
  this.bibElement.value.close();
4646
+ this._clearPageInert();
4623
4647
  }
4624
4648
  }
4625
4649
 
4626
4650
  // When fullscreen strategy changes while open, re-open dialog with correct mode
4627
4651
  // (e.g. resizing from desktop → mobile while dropdown is open)
4628
4652
  if (changedProperties.has('isBibFullscreen') && this.isPopoverVisible && this.bibElement.value) {
4629
- const useModal = this.isBibFullscreen;
4630
4653
  this.bibElement.value.close();
4631
- this.bibElement.value.open(useModal);
4654
+ this.bibElement.value.open(this.isBibFullscreen);
4655
+
4656
+ // Re-initialize focus management for the new strategy
4657
+ this.updateFocusTrap();
4658
+
4659
+ // Toggle inert: desktop modal needs it, fullscreen showModal() handles it natively
4660
+ if (this.desktopModal && !this.isBibFullscreen) {
4661
+ this._setPageInert();
4662
+ } else {
4663
+ this._clearPageInert();
4664
+ }
4665
+ }
4666
+
4667
+ // Handle desktopModal toggled while the dropdown is already open.
4668
+ // Re-initialize focus trapping and page inert state to match the new mode.
4669
+ if (changedProperties.has('desktopModal') && this.isPopoverVisible && !this.isBibFullscreen) {
4670
+ this.updateFocusTrap();
4671
+ if (this.desktopModal) {
4672
+ this._setPageInert();
4673
+ } else {
4674
+ this._clearPageInert();
4675
+ }
4632
4676
  }
4633
4677
  }
4634
4678
 
@@ -4638,8 +4682,14 @@ class AuroDropdown extends AuroElement {
4638
4682
  * @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
4639
4683
  */
4640
4684
  handleDropdownToggle(event) {
4641
- this.updateFocusTrap();
4642
4685
  this.isPopoverVisible = event.detail.expanded;
4686
+
4687
+ // Tear down FocusTrap when closing. Creation happens in updated()
4688
+ // after the dialog is open so getFocusableElements can find content.
4689
+ if (!this.isPopoverVisible) {
4690
+ this.updateFocusTrap();
4691
+ }
4692
+
4643
4693
  const eventType = event.detail.eventType || "unknown";
4644
4694
  if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
4645
4695
  this.trigger.focus();
@@ -4738,19 +4788,220 @@ class AuroDropdown extends AuroElement {
4738
4788
  * @private
4739
4789
  */
4740
4790
  updateFocusTrap() {
4791
+ // Always clean up existing handlers/traps before setting up new ones
4792
+ // to prevent duplicate listeners on repeated calls.
4793
+ if (this._bibTabHandler) {
4794
+ this.removeEventListener('keydown', this._bibTabHandler);
4795
+ this._bibTabHandler = undefined;
4796
+ }
4797
+
4798
+ if (this.focusTrap) {
4799
+ this.focusTrap.disconnect();
4800
+ this.focusTrap = undefined;
4801
+ }
4802
+
4803
+ // Restore the user-set noHideOnThisFocusLoss value, if we overrode it.
4804
+ if (this._noHideOverridden) {
4805
+ this.noHideOnThisFocusLoss = this._priorNoHide;
4806
+ this._noHideOverridden = false;
4807
+ this._priorNoHide = undefined;
4808
+ }
4809
+
4741
4810
  if (this.isPopoverVisible) {
4742
4811
  if (!this.isBibFullscreen) {
4743
- // Desktop: show() doesn't trap focus, so use FocusTrap
4744
- this.focusTrap = new FocusTrap(this.bibContent);
4745
- this.focusTrap.focusFirstElement();
4812
+ if (this.desktopModal) {
4813
+ // The floater's focus-loss check uses :focus-within, which does not
4814
+ // match the host when focus is on a slotted element projected through
4815
+ // multiple shadow roots. Without this override, focusing a button
4816
+ // inside the bib would be misread as focus leaving the dropdown and
4817
+ // close the bib immediately. desktopModal traps focus inside the
4818
+ // bib and inerts siblings, so suppressing focus-loss dismissal here
4819
+ // is safe — Escape and outside-click still close the bib.
4820
+ this._priorNoHide = this.noHideOnThisFocusLoss;
4821
+ this._noHideOverridden = true;
4822
+ this.noHideOnThisFocusLoss = true;
4823
+
4824
+ // Desktop modal: trap focus only within the bib content.
4825
+ // Can't use FocusTrap on the bib element because keydown events
4826
+ // from slotted content bubble through the dropdown host (light DOM),
4827
+ // not through the bib (shadow projection target). Using FocusTrap
4828
+ // on the dropdown would include the trigger in the tab cycle.
4829
+ // Instead, listen for Tab on the dropdown and manually wrap focus
4830
+ // within the bib's focusable elements.
4831
+ this._bibTabHandler = (event) => {
4832
+ if (event.key !== 'Tab') {
4833
+ return;
4834
+ }
4835
+
4836
+ // Collect focusable elements from the bib content.
4837
+ const focusables = getFocusableElements(this.bibContent);
4838
+
4839
+ // Fallback: try from slotted content directly
4840
+ if (!focusables.length) {
4841
+ const slot = this.shadowRoot.querySelector('.slotContent slot');
4842
+ const assignedNodes = slot.assignedNodes({ flatten: true });
4843
+
4844
+ for (const node of assignedNodes) {
4845
+ if (node.nodeType === Node.ELEMENT_NODE) {
4846
+ focusables.push(...getFocusableElements(node));
4847
+ }
4848
+ }
4849
+ }
4850
+
4851
+ if (!focusables.length) {
4852
+ return;
4853
+ }
4854
+
4855
+ event.preventDefault();
4856
+
4857
+ const direction = event.shiftKey ? -1 : 1; // eslint-disable-line no-magic-numbers
4858
+
4859
+ // Walk the active element chain through shadow roots
4860
+ const actives = this._getActiveElements();
4861
+
4862
+ let idx = focusables.findIndex((el) => actives.includes(el));
4863
+
4864
+ if (idx === -1) { // eslint-disable-line no-magic-numbers
4865
+ // Focus is not on a known element — move to first/last
4866
+ idx = direction === 1 ? -1 : focusables.length; // eslint-disable-line no-magic-numbers
4867
+ }
4868
+
4869
+ // Try each element in order, skipping any that can't receive focus
4870
+ // (e.g. hidden elements, elements in collapsed sections)
4871
+ for (let index = 0; index < focusables.length; index++) { // eslint-disable-line no-plusplus
4872
+ let nextIdx = idx + direction;
4873
+
4874
+ // Wrap around
4875
+ if (nextIdx < 0) {
4876
+ nextIdx = focusables.length - 1;
4877
+ } else if (nextIdx >= focusables.length) {
4878
+ nextIdx = 0;
4879
+ }
4880
+
4881
+ focusables[nextIdx].focus();
4882
+
4883
+ // Verify focus actually moved to the target
4884
+ const newActives = this._getActiveElements();
4885
+
4886
+ if (newActives.includes(focusables[nextIdx])) {
4887
+ return;
4888
+ }
4889
+
4890
+ // Focus didn't stick — skip this element and try the next
4891
+ idx = nextIdx;
4892
+ }
4893
+ };
4894
+ this.addEventListener('keydown', this._bibTabHandler);
4895
+
4896
+ // Move initial focus into the bib content, matching FocusTrap behavior
4897
+ requestAnimationFrame(() => {
4898
+ const focusables = getFocusableElements(this.bibContent);
4899
+ if (focusables.length) {
4900
+ focusables[0].focus();
4901
+ }
4902
+ });
4903
+ } else {
4904
+ // Normal desktop: use FocusTrap on the bib element.
4905
+ // Defer focusFirstElement to the next frame because the popover
4906
+ // is positioned asynchronously by Floating UI — calling focus()
4907
+ // synchronously here would target elements with zero dimensions
4908
+ // and the focus call would be silently ignored.
4909
+ this.focusTrap = new FocusTrap(this.bibContent);
4910
+ requestAnimationFrame(() => {
4911
+ if (this.focusTrap) {
4912
+ this.focusTrap.focusFirstElement();
4913
+ }
4914
+ });
4915
+ }
4746
4916
  }
4747
4917
  // Fullscreen: showModal() provides native focus trapping
4918
+ }
4919
+ }
4920
+
4921
+ /**
4922
+ * Returns the chain of active (focused) elements through shadow roots.
4923
+ * @private
4924
+ * @returns {Array<HTMLElement>}
4925
+ */
4926
+ _getActiveElements() {
4927
+ let { activeElement } = document;
4928
+ const actives = [activeElement];
4929
+
4930
+ while (activeElement?.shadowRoot?.activeElement) {
4931
+ activeElement = activeElement.shadowRoot.activeElement;
4932
+ actives.push(activeElement);
4933
+ }
4934
+
4935
+ return actives;
4936
+ }
4937
+
4938
+ /**
4939
+ * Sets `inert` on sibling elements of the dropdown's top-level host
4940
+ * so that content outside the dropdown is not interactive while the modal is open.
4941
+ * Walks up through shadow DOM boundaries to find the outermost host element
4942
+ * in the light DOM, then sets `inert` on siblings at each ancestor level
4943
+ * to ensure all page content outside the host subtree is inert.
4944
+ * @private
4945
+ */
4946
+ _setPageInert() {
4947
+ if (this._inertSiblings) {
4748
4948
  return;
4749
4949
  }
4750
4950
 
4751
- if (this.focusTrap) {
4752
- this.focusTrap.disconnect();
4753
- this.focusTrap = undefined;
4951
+ this._inertSiblings = [];
4952
+
4953
+ // Walk up through shadow DOM boundaries to find the topmost host
4954
+ // element in the light DOM. For example, if this dropdown is inside
4955
+ // auro-datepicker's shadow DOM, we walk up to the datepicker element
4956
+ // so we set inert on its siblings — not on the datepicker itself.
4957
+ let host = this;
4958
+ while (host.getRootNode() instanceof ShadowRoot) {
4959
+ host = host.getRootNode().host;
4960
+ }
4961
+
4962
+ // Walk up the ancestor chain, inerting siblings at each level
4963
+ // to ensure the entire page outside the host subtree is inert.
4964
+ // Uses a reference counter (data-auro-inert-count) so multiple
4965
+ // simultaneous modal dropdowns share inert state safely.
4966
+ let current = host;
4967
+ while (current.parentElement) {
4968
+ const parent = current.parentElement;
4969
+ for (const sibling of parent.children) {
4970
+ if (sibling !== current) {
4971
+ const count = parseInt(sibling.dataset.auroInertCount || '0', 10);
4972
+ if (count === 0) {
4973
+ sibling.dataset.auroInertWas = sibling.inert ? 'true' : 'false';
4974
+ }
4975
+ sibling.dataset.auroInertCount = String(count + 1);
4976
+ sibling.inert = true;
4977
+ this._inertSiblings.push(sibling);
4978
+ }
4979
+ }
4980
+ current = parent;
4981
+ }
4982
+ }
4983
+
4984
+ /**
4985
+ * Restores `inert` state on siblings that were tracked by `_setPageInert`.
4986
+ * Uses reference counting so inert is only cleared when the last modal
4987
+ * dropdown releases a given element. Preserves the original inert state
4988
+ * so externally-inerted elements are not inadvertently re-enabled.
4989
+ * @private
4990
+ */
4991
+ _clearPageInert() {
4992
+ if (this._inertSiblings) {
4993
+ for (const sibling of this._inertSiblings) {
4994
+ const count = parseInt(sibling.dataset.auroInertCount || '1', 10) - 1;
4995
+ if (count <= 0) {
4996
+ const wasInert = sibling.dataset.auroInertWas === 'true';
4997
+ delete sibling.dataset.auroInertCount;
4998
+ delete sibling.dataset.auroInertWas;
4999
+ sibling.inert = wasInert;
5000
+ } else {
5001
+ sibling.dataset.auroInertCount = String(count);
5002
+ }
5003
+ }
5004
+ this._inertSiblings = undefined;
4754
5005
  }
4755
5006
  }
4756
5007
 
@@ -4989,6 +5240,7 @@ class AuroDropdown extends AuroElement {
4989
5240
  shape="${this.shape}"
4990
5241
  ?data-show="${this.isPopoverVisible}"
4991
5242
  ?isfullscreen="${this.isBibFullscreen}"
5243
+ ?desktopmodal="${this.desktopModal}"
4992
5244
  .dialogLabel="${this.bibDialogLabel}"
4993
5245
  ${n$2(this.bibElement)}
4994
5246
  >