@fluentui/web-components 3.0.0-rc.10 → 3.0.0-rc.11

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 (85) hide show
  1. package/CHANGELOG.md +11 -2
  2. package/custom-elements.json +125 -140
  3. package/dist/esm/anchor-button/anchor-button.base.js +1 -0
  4. package/dist/esm/anchor-button/anchor-button.base.js.map +1 -1
  5. package/dist/esm/avatar/avatar.base.d.ts +64 -10
  6. package/dist/esm/avatar/avatar.base.js +100 -27
  7. package/dist/esm/avatar/avatar.base.js.map +1 -1
  8. package/dist/esm/avatar/avatar.styles.js +20 -3
  9. package/dist/esm/avatar/avatar.styles.js.map +1 -1
  10. package/dist/esm/avatar/avatar.template.js +4 -3
  11. package/dist/esm/avatar/avatar.template.js.map +1 -1
  12. package/dist/esm/button/button.base.d.ts +15 -1
  13. package/dist/esm/button/button.base.js +27 -24
  14. package/dist/esm/button/button.base.js.map +1 -1
  15. package/dist/esm/button/button.template.d.ts +3 -3
  16. package/dist/esm/button/button.template.js.map +1 -1
  17. package/dist/esm/dialog/dialog.d.ts +8 -3
  18. package/dist/esm/dialog/dialog.js +26 -20
  19. package/dist/esm/dialog/dialog.js.map +1 -1
  20. package/dist/esm/drawer/drawer.js +0 -1
  21. package/dist/esm/drawer/drawer.js.map +1 -1
  22. package/dist/esm/dropdown/dropdown.base.d.ts +1 -0
  23. package/dist/esm/dropdown/dropdown.base.js +24 -15
  24. package/dist/esm/dropdown/dropdown.base.js.map +1 -1
  25. package/dist/esm/listbox/listbox.d.ts +12 -7
  26. package/dist/esm/listbox/listbox.js +27 -17
  27. package/dist/esm/listbox/listbox.js.map +1 -1
  28. package/dist/esm/listbox/listbox.template.js +2 -3
  29. package/dist/esm/listbox/listbox.template.js.map +1 -1
  30. package/dist/esm/menu/menu.d.ts +7 -0
  31. package/dist/esm/menu/menu.js +22 -17
  32. package/dist/esm/menu/menu.js.map +1 -1
  33. package/dist/esm/option/option.js +1 -1
  34. package/dist/esm/option/option.js.map +1 -1
  35. package/dist/esm/progress-bar/progress-bar.base.d.ts +19 -4
  36. package/dist/esm/progress-bar/progress-bar.base.js +37 -19
  37. package/dist/esm/progress-bar/progress-bar.base.js.map +1 -1
  38. package/dist/esm/radio/radio.options.d.ts +9 -0
  39. package/dist/esm/radio/radio.options.js +12 -1
  40. package/dist/esm/radio/radio.options.js.map +1 -1
  41. package/dist/esm/radio-group/radio-group.d.ts +13 -7
  42. package/dist/esm/radio-group/radio-group.js +14 -21
  43. package/dist/esm/radio-group/radio-group.js.map +1 -1
  44. package/dist/esm/radio-group/radio-group.template.js +2 -2
  45. package/dist/esm/radio-group/radio-group.template.js.map +1 -1
  46. package/dist/esm/rating-display/rating-display.base.d.ts +11 -1
  47. package/dist/esm/rating-display/rating-display.base.js +24 -11
  48. package/dist/esm/rating-display/rating-display.base.js.map +1 -1
  49. package/dist/esm/slider/slider.d.ts +7 -3
  50. package/dist/esm/slider/slider.js +46 -28
  51. package/dist/esm/slider/slider.js.map +1 -1
  52. package/dist/esm/tab/tab.d.ts +13 -1
  53. package/dist/esm/tab/tab.js +16 -2
  54. package/dist/esm/tab/tab.js.map +1 -1
  55. package/dist/esm/tablist/tablist.base.d.ts +2 -1
  56. package/dist/esm/tablist/tablist.base.js +109 -95
  57. package/dist/esm/tablist/tablist.base.js.map +1 -1
  58. package/dist/esm/tablist/tablist.d.ts +2 -1
  59. package/dist/esm/tablist/tablist.js +2 -2
  60. package/dist/esm/tablist/tablist.js.map +1 -1
  61. package/dist/esm/text-input/text-input.base.js +12 -5
  62. package/dist/esm/text-input/text-input.base.js.map +1 -1
  63. package/dist/esm/text-input/text-input.template.d.ts +1 -1
  64. package/dist/esm/text-input/text-input.template.js +2 -8
  65. package/dist/esm/text-input/text-input.template.js.map +1 -1
  66. package/dist/esm/textarea/textarea.base.d.ts +7 -3
  67. package/dist/esm/textarea/textarea.base.js +38 -23
  68. package/dist/esm/textarea/textarea.base.js.map +1 -1
  69. package/dist/esm/tree/tree.base.d.ts +8 -0
  70. package/dist/esm/tree/tree.base.js +16 -2
  71. package/dist/esm/tree/tree.base.js.map +1 -1
  72. package/dist/esm/tree-item/tree-item.base.d.ts +7 -0
  73. package/dist/esm/tree-item/tree-item.base.js +14 -12
  74. package/dist/esm/tree-item/tree-item.base.js.map +1 -1
  75. package/dist/esm/utils/focusable-element.js +2 -1
  76. package/dist/esm/utils/focusable-element.js.map +1 -1
  77. package/dist/esm/utils/request-idle-callback.js +4 -9
  78. package/dist/esm/utils/request-idle-callback.js.map +1 -1
  79. package/dist/esm/utils/typings.d.ts +8 -0
  80. package/dist/esm/utils/typings.js +15 -1
  81. package/dist/esm/utils/typings.js.map +1 -1
  82. package/dist/web-components.d.ts +196 -43
  83. package/dist/web-components.js +537 -314
  84. package/dist/web-components.min.js +212 -212
  85. package/package.json +1 -1
@@ -4108,6 +4108,15 @@ const getDirection = rootNode => {
4108
4108
  return rootNode.closest("[dir]")?.dir === "rtl" ? Direction.rtl : Direction.ltr;
4109
4109
  };
4110
4110
 
4111
+ function isCustomElement(tagSuffix) {
4112
+ return element => {
4113
+ if (element?.nodeType !== Node.ELEMENT_NODE) {
4114
+ return false;
4115
+ }
4116
+ return element.tagName.toLowerCase().endsWith(tagSuffix);
4117
+ };
4118
+ }
4119
+
4111
4120
  function staticallyCompose(item) {
4112
4121
  if (!item) {
4113
4122
  return InlineTemplateDirective.empty;
@@ -4904,6 +4913,7 @@ class BaseAnchor extends FASTElement {
4904
4913
  }
4905
4914
  connectedCallback() {
4906
4915
  super.connectedCallback();
4916
+ this.tabIndex = Number(this.getAttribute("tabindex") ?? 0) < 0 ? -1 : 0;
4907
4917
  Observable.getNotifier(this).subscribe(this);
4908
4918
  Object.keys(this.$fastController.definition.attributeLookup).forEach(key => {
4909
4919
  this.handleChange(this, key);
@@ -5134,6 +5144,7 @@ var __decorateClass$J = (decorators, target, key, kind) => {
5134
5144
  class BaseAvatar extends FASTElement {
5135
5145
  constructor() {
5136
5146
  super();
5147
+ this.slottedDefaults = [];
5137
5148
  /**
5138
5149
  * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
5139
5150
  *
@@ -5142,41 +5153,103 @@ class BaseAvatar extends FASTElement {
5142
5153
  this.elementInternals = this.attachInternals();
5143
5154
  this.elementInternals.role = "img";
5144
5155
  }
5145
- connectedCallback() {
5146
- super.connectedCallback();
5147
- this.slotchangeHandler();
5156
+ /**
5157
+ * Handles changes to the default slot element reference.
5158
+ *
5159
+ * Toggles the `has-slotted` class on the slot element for browsers that do not
5160
+ * support the `:has-slotted` CSS selector. Defers cleanup using
5161
+ * `Updates.enqueue` to avoid DOM mutations during hydration that could
5162
+ * corrupt binding markers.
5163
+ *
5164
+ * @internal
5165
+ */
5166
+ defaultSlotChanged() {
5167
+ if (!CSS.supports("selector(:has-slotted)")) {
5168
+ const elements = this.defaultSlot.assignedElements();
5169
+ this.defaultSlot.classList.toggle("has-slotted", elements.length > 0);
5170
+ }
5171
+ Updates.enqueue(() => {
5172
+ this.cleanupSlottedContent();
5173
+ });
5148
5174
  }
5149
- disconnectedCallback() {
5150
- this.abortSignal?.abort();
5151
- this.abortSignal = void 0;
5152
- super.disconnectedCallback();
5175
+ /**
5176
+ * Updates the monogram text content when the ref is captured.
5177
+ *
5178
+ * @internal
5179
+ */
5180
+ monogramChanged() {
5181
+ this.updateMonogram();
5153
5182
  }
5154
5183
  /**
5155
- * Removes any empty text nodes from the default slot when the slotted content changes.
5184
+ * Handles changes to the slotted default content.
5185
+ *
5186
+ * Normalizes the DOM, toggles the `has-slotted` class on the default slot element
5187
+ * for browsers that do not support the `:has-slotted` CSS selector, and removes
5188
+ * empty text nodes from the default slot to keep the DOM clean.
5189
+ *
5190
+ * @internal
5191
+ */
5192
+ slottedDefaultsChanged() {
5193
+ if (!this.defaultSlot) {
5194
+ return;
5195
+ }
5196
+ this.cleanupSlottedContent();
5197
+ }
5198
+ /**
5199
+ * Handles changes to the name attribute.
5200
+ * @internal
5201
+ */
5202
+ nameChanged() {
5203
+ this.updateMonogram();
5204
+ }
5205
+ /**
5206
+ * Handles changes to the initials attribute.
5207
+ * @internal
5208
+ */
5209
+ initialsChanged() {
5210
+ this.updateMonogram();
5211
+ }
5212
+ /**
5213
+ * Generates and sets the initials for the template.
5214
+ * Subclasses should override this to provide custom initials logic.
5215
+ *
5216
+ * @internal
5217
+ */
5218
+ generateInitials() {
5219
+ return this.initials || getInitials(this.name, window.getComputedStyle(this).direction === "rtl");
5220
+ }
5221
+ /**
5222
+ * Updates the monogram element's text content with the generated initials.
5223
+ *
5224
+ * @internal
5225
+ */
5226
+ updateMonogram() {
5227
+ if (this.monogram) {
5228
+ this.monogram.textContent = this.generateInitials() ?? "";
5229
+ }
5230
+ }
5231
+ /**
5232
+ * Normalizes the DOM and removes empty text nodes from the default slot.
5156
5233
  *
5157
- * @param e - The event object
5158
5234
  * @internal
5159
5235
  */
5160
- slotchangeHandler() {
5236
+ cleanupSlottedContent() {
5161
5237
  this.normalize();
5162
- const elements = this.defaultSlot.assignedElements();
5163
- if (!elements.length && !this.innerText.trim()) {
5164
- const nodes = this.defaultSlot.assignedNodes();
5165
- nodes.filter(node => node.nodeType === Node.TEXT_NODE).forEach(node => {
5166
- this.removeChild(node);
5167
- });
5238
+ if (!CSS.supports("selector(:has-slotted)")) {
5239
+ this.defaultSlot.classList.toggle("has-slotted", !!this.slottedDefaults.length);
5168
5240
  }
5169
- Updates.enqueue(() => {
5170
- if (!this.abortSignal || this.abortSignal.signal.aborted) {
5171
- this.abortSignal = new AbortController();
5172
- }
5173
- this.defaultSlot.addEventListener("slotchange", () => this.slotchangeHandler(), {
5174
- once: true,
5175
- signal: this.abortSignal.signal
5241
+ if (!this.innerText.trim()) {
5242
+ this.slottedDefaults.forEach(node => {
5243
+ if (node.nodeType === Node.TEXT_NODE) {
5244
+ node.remove();
5245
+ }
5176
5246
  });
5177
- });
5247
+ }
5178
5248
  }
5179
5249
  }
5250
+ __decorateClass$J([observable], BaseAvatar.prototype, "defaultSlot", 2);
5251
+ __decorateClass$J([observable], BaseAvatar.prototype, "monogram", 2);
5252
+ __decorateClass$J([observable], BaseAvatar.prototype, "slottedDefaults", 2);
5180
5253
  __decorateClass$J([attr], BaseAvatar.prototype, "name", 2);
5181
5254
  __decorateClass$J([attr], BaseAvatar.prototype, "initials", 2);
5182
5255
 
@@ -5312,11 +5385,11 @@ const animations = {
5312
5385
  nullEasing: curveLinear
5313
5386
  };
5314
5387
  const styles$A = css`
5315
- ${display("inline-flex")} :host{position:relative;align-items:center;justify-content:center;flex-shrink:0;width:32px;height:32px;font-family:${fontFamilyBase};font-weight:${fontWeightSemibold};font-size:${fontSizeBase300};border-radius:${borderRadiusCircular};color:${colorNeutralForeground3};background-color:${colorNeutralBackground6};contain:layout style}.default-icon,::slotted(svg){width:20px;height:20px;font-size:20px}::slotted(img){box-sizing:border-box;width:100%;height:100%;border-radius:${borderRadiusCircular}}::slotted([slot='badge']){position:absolute;bottom:0;right:0;box-shadow:0 0 0 ${strokeWidthThin} ${colorNeutralBackground1}}:host([size='64']) ::slotted([slot='badge']),:host([size='72']) ::slotted([slot='badge']),:host([size='96']) ::slotted([slot='badge']),:host([size='120']) ::slotted([slot='badge']),:host([size='128']) ::slotted([slot='badge']){box-shadow:0 0 0 ${strokeWidthThick} ${colorNeutralBackground1}}:host([size='16']),:host([size='20']),:host([size='24']){font-size:${fontSizeBase100};font-weight:${fontWeightRegular}}:host([size='16']){width:16px;height:16px}:host([size='20']){width:20px;height:20px}:host([size='24']){width:24px;height:24px}:host([size='16']) .default-icon,:host([size='16']) ::slotted(svg){width:12px;height:12px;font-size:12px}:host([size='20']) .default-icon,:host([size='24']) .default-icon,:host([size='20']) ::slotted(svg),:host([size='24']) ::slotted(svg){width:16px;height:16px;font-size:16px}:host([size='28']){width:28px;height:28px;font-size:${fontSizeBase200}}:host([size='36']){width:36px;height:36px}:host([size='40']){width:40px;height:40px}:host([size='48']),:host([size='56']){font-size:${fontSizeBase400}}:host([size='48']){width:48px;height:48px}:host([size='48']) .default-icon,:host([size='48']) ::slotted(svg){width:24px;height:24px;font-size:24px}:host([size='56']){width:56px;height:56px}:host([size='56']) .default-icon,:host([size='56']) ::slotted(svg){width:28px;height:28px;font-size:28px}:host([size='64']),:host([size='72']),:host([size='96']){font-size:${fontSizeBase500}}:host([size='64']) .default-icon,:host([size='72']) .default-icon,:host([size='64']) ::slotted(svg),:host([size='72']) ::slotted(svg){width:32px;height:32px;font-size:32px}:host([size='64']){width:64px;height:64px}:host([size='72']){width:72px;height:72px}:host([size='96']){width:96px;height:96px}:host([size='96']) .default-icon,:host([size='120']) .default-icon,:host([size='128']) .default-icon,:host([size='96']) ::slotted(svg),:host([size='120']) ::slotted(svg),:host([size='128']) ::slotted(svg){width:48px;height:48px;font-size:48px}:host([size='120']),:host([size='128']){font-size:${fontSizeBase600}}:host([size='120']){width:120px;height:120px}:host([size='128']){width:128px;height:128px}:host([shape='square']){border-radius:${borderRadiusMedium}}:host([shape='square'][size='20']),:host([shape='square'][size='24']){border-radius:${borderRadiusSmall}}:host([shape='square'][size='56']),:host([shape='square'][size='64']),:host([shape='square'][size='72']){border-radius:${borderRadiusLarge}}:host([shape='square'][size='96']),:host([shape='square'][size='120']),:host([shape='square'][size='128']){border-radius:${borderRadiusXLarge}}:host([data-color='brand']){color:${colorNeutralForegroundStaticInverted};background-color:${colorBrandBackgroundStatic}}:host([data-color='dark-red']){color:${colorPaletteDarkRedForeground2};background-color:${colorPaletteDarkRedBackground2}}:host([data-color='cranberry']){color:${colorPaletteCranberryForeground2};background-color:${colorPaletteCranberryBackground2}}:host([data-color='red']){color:${colorPaletteRedForeground2};background-color:${colorPaletteRedBackground2}}:host([data-color='pumpkin']){color:${colorPalettePumpkinForeground2};background-color:${colorPalettePumpkinBackground2}}:host([data-color='peach']){color:${colorPalettePeachForeground2};background-color:${colorPalettePeachBackground2}}:host([data-color='marigold']){color:${colorPaletteMarigoldForeground2};background-color:${colorPaletteMarigoldBackground2}}:host([data-color='gold']){color:${colorPaletteGoldForeground2};background-color:${colorPaletteGoldBackground2}}:host([data-color='brass']){color:${colorPaletteBrassForeground2};background-color:${colorPaletteBrassBackground2}}:host([data-color='brown']){color:${colorPaletteBrownForeground2};background-color:${colorPaletteBrownBackground2}}:host([data-color='forest']){color:${colorPaletteForestForeground2};background-color:${colorPaletteForestBackground2}}:host([data-color='seafoam']){color:${colorPaletteSeafoamForeground2};background-color:${colorPaletteSeafoamBackground2}}:host([data-color='dark-green']){color:${colorPaletteDarkGreenForeground2};background-color:${colorPaletteDarkGreenBackground2}}:host([data-color='light-teal']){color:${colorPaletteLightTealForeground2};background-color:${colorPaletteLightTealBackground2}}:host([data-color='teal']){color:${colorPaletteTealForeground2};background-color:${colorPaletteTealBackground2}}:host([data-color='steel']){color:${colorPaletteSteelForeground2};background-color:${colorPaletteSteelBackground2}}:host([data-color='blue']){color:${colorPaletteBlueForeground2};background-color:${colorPaletteBlueBackground2}}:host([data-color='royal-blue']){color:${colorPaletteRoyalBlueForeground2};background-color:${colorPaletteRoyalBlueBackground2}}:host([data-color='cornflower']){color:${colorPaletteCornflowerForeground2};background-color:${colorPaletteCornflowerBackground2}}:host([data-color='navy']){color:${colorPaletteNavyForeground2};background-color:${colorPaletteNavyBackground2}}:host([data-color='lavender']){color:${colorPaletteLavenderForeground2};background-color:${colorPaletteLavenderBackground2}}:host([data-color='purple']){color:${colorPalettePurpleForeground2};background-color:${colorPalettePurpleBackground2}}:host([data-color='grape']){color:${colorPaletteGrapeForeground2};background-color:${colorPaletteGrapeBackground2}}:host([data-color='lilac']){color:${colorPaletteLilacForeground2};background-color:${colorPaletteLilacBackground2}}:host([data-color='pink']){color:${colorPalettePinkForeground2};background-color:${colorPalettePinkBackground2}}:host([data-color='magenta']){color:${colorPaletteMagentaForeground2};background-color:${colorPaletteMagentaBackground2}}:host([data-color='plum']){color:${colorPalettePlumForeground2};background-color:${colorPalettePlumBackground2}}:host([data-color='beige']){color:${colorPaletteBeigeForeground2};background-color:${colorPaletteBeigeBackground2}}:host([data-color='mink']){color:${colorPaletteMinkForeground2};background-color:${colorPaletteMinkBackground2}}:host([data-color='platinum']){color:${colorPalettePlatinumForeground2};background-color:${colorPalettePlatinumBackground2}}:host([data-color='anchor']){color:${colorPaletteAnchorForeground2};background-color:${colorPaletteAnchorBackground2}}:host([active]){transform:perspective(1px);transition-property:transform,opacity;transition-duration:${durationUltraSlow},${durationFaster};transition-delay:${animations.fastEase},${animations.nullEasing}}:host([active])::before{content:'';position:absolute;top:0;left:0;bottom:0;right:0;border-radius:inherit;transition-property:margin,opacity;transition-duration:${durationUltraSlow},${durationSlower};transition-delay:${animations.fastEase},${animations.nullEasing}}:host([active])::before{box-shadow:${shadow8};border-style:solid;border-color:${colorBrandBackgroundStatic}}:host([active][appearance='shadow'])::before{border-style:none;border-color:none}:host([active]:not([appearance='shadow']))::before{margin:calc(-2 * ${strokeWidthThick});border-width:${strokeWidthThick}}:host([size='56'][active]:not([appearance='shadow']))::before,:host([size='64'][active]:not([appearance='shadow']))::before{margin:calc(-2 * ${strokeWidthThicker});border-width:${strokeWidthThicker}}:host([size='72'][active]:not([appearance='shadow']))::before,:host([size='96'][active]:not([appearance='shadow']))::before,:host([size='120'][active]:not([appearance='shadow']))::before,:host([size='128'][active]:not([appearance='shadow']))::before{margin:calc(-2 * ${strokeWidthThickest});border-width:${strokeWidthThickest}}:host([size='20'][active][appearance])::before,:host([size='24'][active][appearance])::before,:host([size='28'][active][appearance])::before{box-shadow:${shadow4}}:host([size='56'][active][appearance])::before,:host([size='64'][active][appearance])::before{box-shadow:${shadow16}}:host([size='72'][active][appearance])::before,:host([size='96'][active][appearance])::before,:host([size='120'][active][appearance])::before,:host([size='128'][active][appearance])::before{box-shadow:${shadow28}}:host([active][appearance='ring'])::before{box-shadow:none}:host([active='inactive']){opacity:0.8;transform:scale(0.875);transition-property:transform,opacity;transition-duration:${durationUltraSlow},${durationFaster};transition-delay:${animations.fastOutSlowInMin},${animations.nullEasing}}:host([active='inactive'])::before{margin:0;opacity:0;transition-property:margin,opacity;transition-duration:${durationUltraSlow},${durationSlower};transition-delay:${animations.fastOutSlowInMin},${animations.nullEasing}}@media screen and (prefers-reduced-motion:reduce){:host([active]){transition-duration:0.01ms}:host([active])::before{transition-duration:0.01ms;transition-delay:0.01ms}}`;
5388
+ ${display("inline-grid")} :host{position:relative;place-items:center;place-content:center;grid-template:1fr / 1fr;flex-shrink:0;width:32px;height:32px;font-family:${fontFamilyBase};font-weight:${fontWeightSemibold};font-size:${fontSizeBase300};border-radius:${borderRadiusCircular};color:${colorNeutralForeground3};background-color:${colorNeutralBackground6};contain:layout style}.monogram,.default-icon{grid-area:1 / 1 / -1 / -1}.monogram:empty{display:none}.default-slot:is(.has-slotted,:has-slotted) ~ .default-icon,.default-slot:is(.has-slotted,:has-slotted) ~ .monogram,:host(:is([name]):not([name=''])) .default-icon,:host(:is([initials]):not([initials=''])) .default-icon{display:none}.default-icon,::slotted(svg){width:20px;height:20px;font-size:20px}::slotted(img){box-sizing:border-box;width:100%;height:100%;border-radius:${borderRadiusCircular}}::slotted([slot='badge']){position:absolute;bottom:0;right:0;box-shadow:0 0 0 ${strokeWidthThin} ${colorNeutralBackground1}}:host([size='64']) ::slotted([slot='badge']),:host([size='72']) ::slotted([slot='badge']),:host([size='96']) ::slotted([slot='badge']),:host([size='120']) ::slotted([slot='badge']),:host([size='128']) ::slotted([slot='badge']){box-shadow:0 0 0 ${strokeWidthThick} ${colorNeutralBackground1}}:host([size='16']),:host([size='20']),:host([size='24']){font-size:${fontSizeBase100};font-weight:${fontWeightRegular}}:host([size='16']){width:16px;height:16px}:host([size='20']){width:20px;height:20px}:host([size='24']){width:24px;height:24px}:host([size='16']) .default-icon,:host([size='16']) ::slotted(svg){width:12px;height:12px;font-size:12px}:host([size='20']) .default-icon,:host([size='24']) .default-icon,:host([size='20']) ::slotted(svg),:host([size='24']) ::slotted(svg){width:16px;height:16px;font-size:16px}:host([size='28']){width:28px;height:28px;font-size:${fontSizeBase200}}:host([size='36']){width:36px;height:36px}:host([size='40']){width:40px;height:40px}:host([size='48']),:host([size='56']){font-size:${fontSizeBase400}}:host([size='48']){width:48px;height:48px}:host([size='48']) .default-icon,:host([size='48']) ::slotted(svg){width:24px;height:24px;font-size:24px}:host([size='56']){width:56px;height:56px}:host([size='56']) .default-icon,:host([size='56']) ::slotted(svg){width:28px;height:28px;font-size:28px}:host([size='64']),:host([size='72']),:host([size='96']){font-size:${fontSizeBase500}}:host([size='64']) .default-icon,:host([size='72']) .default-icon,:host([size='64']) ::slotted(svg),:host([size='72']) ::slotted(svg){width:32px;height:32px;font-size:32px}:host([size='64']){width:64px;height:64px}:host([size='72']){width:72px;height:72px}:host([size='96']){width:96px;height:96px}:host([size='96']) .default-icon,:host([size='120']) .default-icon,:host([size='128']) .default-icon,:host([size='96']) ::slotted(svg),:host([size='120']) ::slotted(svg),:host([size='128']) ::slotted(svg){width:48px;height:48px;font-size:48px}:host([size='120']),:host([size='128']){font-size:${fontSizeBase600}}:host([size='120']){width:120px;height:120px}:host([size='128']){width:128px;height:128px}:host([shape='square']){border-radius:${borderRadiusMedium}}:host([shape='square'][size='20']),:host([shape='square'][size='24']){border-radius:${borderRadiusSmall}}:host([shape='square'][size='56']),:host([shape='square'][size='64']),:host([shape='square'][size='72']){border-radius:${borderRadiusLarge}}:host([shape='square'][size='96']),:host([shape='square'][size='120']),:host([shape='square'][size='128']){border-radius:${borderRadiusXLarge}}:host([data-color='brand']){color:${colorNeutralForegroundStaticInverted};background-color:${colorBrandBackgroundStatic}}:host([data-color='dark-red']){color:${colorPaletteDarkRedForeground2};background-color:${colorPaletteDarkRedBackground2}}:host([data-color='cranberry']){color:${colorPaletteCranberryForeground2};background-color:${colorPaletteCranberryBackground2}}:host([data-color='red']){color:${colorPaletteRedForeground2};background-color:${colorPaletteRedBackground2}}:host([data-color='pumpkin']){color:${colorPalettePumpkinForeground2};background-color:${colorPalettePumpkinBackground2}}:host([data-color='peach']){color:${colorPalettePeachForeground2};background-color:${colorPalettePeachBackground2}}:host([data-color='marigold']){color:${colorPaletteMarigoldForeground2};background-color:${colorPaletteMarigoldBackground2}}:host([data-color='gold']){color:${colorPaletteGoldForeground2};background-color:${colorPaletteGoldBackground2}}:host([data-color='brass']){color:${colorPaletteBrassForeground2};background-color:${colorPaletteBrassBackground2}}:host([data-color='brown']){color:${colorPaletteBrownForeground2};background-color:${colorPaletteBrownBackground2}}:host([data-color='forest']){color:${colorPaletteForestForeground2};background-color:${colorPaletteForestBackground2}}:host([data-color='seafoam']){color:${colorPaletteSeafoamForeground2};background-color:${colorPaletteSeafoamBackground2}}:host([data-color='dark-green']){color:${colorPaletteDarkGreenForeground2};background-color:${colorPaletteDarkGreenBackground2}}:host([data-color='light-teal']){color:${colorPaletteLightTealForeground2};background-color:${colorPaletteLightTealBackground2}}:host([data-color='teal']){color:${colorPaletteTealForeground2};background-color:${colorPaletteTealBackground2}}:host([data-color='steel']){color:${colorPaletteSteelForeground2};background-color:${colorPaletteSteelBackground2}}:host([data-color='blue']){color:${colorPaletteBlueForeground2};background-color:${colorPaletteBlueBackground2}}:host([data-color='royal-blue']){color:${colorPaletteRoyalBlueForeground2};background-color:${colorPaletteRoyalBlueBackground2}}:host([data-color='cornflower']){color:${colorPaletteCornflowerForeground2};background-color:${colorPaletteCornflowerBackground2}}:host([data-color='navy']){color:${colorPaletteNavyForeground2};background-color:${colorPaletteNavyBackground2}}:host([data-color='lavender']){color:${colorPaletteLavenderForeground2};background-color:${colorPaletteLavenderBackground2}}:host([data-color='purple']){color:${colorPalettePurpleForeground2};background-color:${colorPalettePurpleBackground2}}:host([data-color='grape']){color:${colorPaletteGrapeForeground2};background-color:${colorPaletteGrapeBackground2}}:host([data-color='lilac']){color:${colorPaletteLilacForeground2};background-color:${colorPaletteLilacBackground2}}:host([data-color='pink']){color:${colorPalettePinkForeground2};background-color:${colorPalettePinkBackground2}}:host([data-color='magenta']){color:${colorPaletteMagentaForeground2};background-color:${colorPaletteMagentaBackground2}}:host([data-color='plum']){color:${colorPalettePlumForeground2};background-color:${colorPalettePlumBackground2}}:host([data-color='beige']){color:${colorPaletteBeigeForeground2};background-color:${colorPaletteBeigeBackground2}}:host([data-color='mink']){color:${colorPaletteMinkForeground2};background-color:${colorPaletteMinkBackground2}}:host([data-color='platinum']){color:${colorPalettePlatinumForeground2};background-color:${colorPalettePlatinumBackground2}}:host([data-color='anchor']){color:${colorPaletteAnchorForeground2};background-color:${colorPaletteAnchorBackground2}}:host([active]){transform:perspective(1px);transition-property:transform,opacity;transition-duration:${durationUltraSlow},${durationFaster};transition-delay:${animations.fastEase},${animations.nullEasing}}:host([active])::before{content:'';position:absolute;top:0;left:0;bottom:0;right:0;border-radius:inherit;transition-property:margin,opacity;transition-duration:${durationUltraSlow},${durationSlower};transition-delay:${animations.fastEase},${animations.nullEasing}}:host([active])::before{box-shadow:${shadow8};border-style:solid;border-color:${colorBrandBackgroundStatic}}:host([active][appearance='shadow'])::before{border-style:none;border-color:none}:host([active]:not([appearance='shadow']))::before{margin:calc(-2 * ${strokeWidthThick});border-width:${strokeWidthThick}}:host([size='56'][active]:not([appearance='shadow']))::before,:host([size='64'][active]:not([appearance='shadow']))::before{margin:calc(-2 * ${strokeWidthThicker});border-width:${strokeWidthThicker}}:host([size='72'][active]:not([appearance='shadow']))::before,:host([size='96'][active]:not([appearance='shadow']))::before,:host([size='120'][active]:not([appearance='shadow']))::before,:host([size='128'][active]:not([appearance='shadow']))::before{margin:calc(-2 * ${strokeWidthThickest});border-width:${strokeWidthThickest}}:host([size='20'][active][appearance])::before,:host([size='24'][active][appearance])::before,:host([size='28'][active][appearance])::before{box-shadow:${shadow4}}:host([size='56'][active][appearance])::before,:host([size='64'][active][appearance])::before{box-shadow:${shadow16}}:host([size='72'][active][appearance])::before,:host([size='96'][active][appearance])::before,:host([size='120'][active][appearance])::before,:host([size='128'][active][appearance])::before{box-shadow:${shadow28}}:host([active][appearance='ring'])::before{box-shadow:none}:host([active='inactive']){opacity:0.8;transform:scale(0.875);transition-property:transform,opacity;transition-duration:${durationUltraSlow},${durationFaster};transition-delay:${animations.fastOutSlowInMin},${animations.nullEasing}}:host([active='inactive'])::before{margin:0;opacity:0;transition-property:margin,opacity;transition-duration:${durationUltraSlow},${durationSlower};transition-delay:${animations.fastOutSlowInMin},${animations.nullEasing}}@media screen and (prefers-reduced-motion:reduce){:host([active]){transition-duration:0.01ms}:host([active])::before{transition-duration:0.01ms;transition-delay:0.01ms}}`;
5316
5389
 
5317
- const defaultIconTemplate = html`<svg width="1em" height="1em" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" class="default-icon" fill="currentcolor" aria-hidden="true"><path d="M10 2a4 4 0 100 8 4 4 0 000-8zM7 6a3 3 0 116 0 3 3 0 01-6 0zm-2 5a2 2 0 00-2 2c0 1.7.83 2.97 2.13 3.8A9.14 9.14 0 0010 18c1.85 0 3.58-.39 4.87-1.2A4.35 4.35 0 0017 13a2 2 0 00-2-2H5zm-1 2a1 1 0 011-1h10a1 1 0 011 1c0 1.3-.62 2.28-1.67 2.95A8.16 8.16 0 0110 17a8.16 8.16 0 01-4.33-1.05A3.36 3.36 0 014 13z"></path></svg>`;
5390
+ const defaultIconTemplate = html`<svg width="1em" height="1em" viewBox="0 0 20 20" class="default-icon" fill="currentcolor" aria-hidden="true"><path d="M10 2a4 4 0 100 8 4 4 0 000-8zM7 6a3 3 0 116 0 3 3 0 01-6 0zm-2 5a2 2 0 00-2 2c0 1.7.83 2.97 2.13 3.8A9.14 9.14 0 0010 18c1.85 0 3.58-.39 4.87-1.2A4.35 4.35 0 0017 13a2 2 0 00-2-2H5zm-1 2a1 1 0 011-1h10a1 1 0 011 1c0 1.3-.62 2.28-1.67 2.95A8.16 8.16 0 0110 17a8.16 8.16 0 01-4.33-1.05A3.36 3.36 0 014 13z"></path></svg>`;
5318
5391
  function avatarTemplate() {
5319
- return html`<slot ${ref("defaultSlot")}>${x => x.name || x.initials ? x.generateInitials() : defaultIconTemplate}</slot><slot name="badge"></slot>`;
5392
+ return html`<slot class="default-slot" ${slotted("slottedDefaults")} ${ref("defaultSlot")}></slot><span class="monogram" ${ref("monogram")}>${x => x.initials}</span>${defaultIconTemplate}<slot name="badge"></slot>`;
5320
5393
  }
5321
5394
  const template$C = avatarTemplate();
5322
5395
 
@@ -5751,7 +5824,6 @@ var __decorateClass$G = (decorators, target, key, kind) => {
5751
5824
  class BaseButton extends FASTElement {
5752
5825
  constructor() {
5753
5826
  super();
5754
- this.disabled = false;
5755
5827
  this.disabledFocusable = false;
5756
5828
  /**
5757
5829
  * The internal {@link https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
@@ -5761,15 +5833,16 @@ class BaseButton extends FASTElement {
5761
5833
  this.elementInternals = this.attachInternals();
5762
5834
  this.elementInternals.role = "button";
5763
5835
  }
5836
+ /**
5837
+ * Handles changes to the disabled attribute. If the button is disabled, it
5838
+ * should not be focusable.
5839
+ *
5840
+ * @param previous - the previous disabled value
5841
+ * @param next - the new disabled value
5842
+ * @internal
5843
+ */
5764
5844
  disabledChanged() {
5765
- if (!this.$fastController.isConnected) {
5766
- return;
5767
- }
5768
- if (this.disabled) {
5769
- this.removeAttribute("tabindex");
5770
- } else {
5771
- this.tabIndex = Number(this.getAttribute("tabindex") ?? 0) < 0 ? -1 : 0;
5772
- }
5845
+ this.setTabIndex();
5773
5846
  }
5774
5847
  /**
5775
5848
  * Sets the element's internal disabled state when the element is focusable while disabled.
@@ -5779,7 +5852,7 @@ class BaseButton extends FASTElement {
5779
5852
  * @internal
5780
5853
  */
5781
5854
  disabledFocusableChanged(previous, next) {
5782
- if (this.$fastController.isConnected) {
5855
+ if (this.elementInternals) {
5783
5856
  this.elementInternals.ariaDisabled = `${!!next}`;
5784
5857
  }
5785
5858
  }
@@ -5829,7 +5902,7 @@ class BaseButton extends FASTElement {
5829
5902
  connectedCallback() {
5830
5903
  super.connectedCallback();
5831
5904
  this.elementInternals.ariaDisabled = `${!!this.disabledFocusable}`;
5832
- this.disabledChanged();
5905
+ this.setTabIndex();
5833
5906
  }
5834
5907
  /**
5835
5908
  * This fallback creates a new slot, then creates a submit button to mirror the custom element's
@@ -5930,6 +6003,18 @@ class BaseButton extends FASTElement {
5930
6003
  resetForm() {
5931
6004
  this.elementInternals.form?.reset();
5932
6005
  }
6006
+ /**
6007
+ * Sets the `tabindex` attribute based on the disabled state of the button.
6008
+ *
6009
+ * @internal
6010
+ */
6011
+ setTabIndex() {
6012
+ if (this.disabled) {
6013
+ this.removeAttribute("tabindex");
6014
+ return;
6015
+ }
6016
+ this.tabIndex = Number(this.getAttribute("tabindex") ?? 0) < 0 ? -1 : 0;
6017
+ }
5933
6018
  /**
5934
6019
  * Submits the associated form.
5935
6020
  *
@@ -6689,25 +6774,11 @@ class Dialog extends FASTElement {
6689
6774
  });
6690
6775
  };
6691
6776
  }
6692
- typeChanged(prev, next) {
6693
- if (!this.dialog) {
6694
- return;
6695
- }
6696
- if (next === DialogType.alert) {
6697
- this.dialog.setAttribute("role", "alertdialog");
6698
- } else {
6699
- this.dialog.removeAttribute("role");
6700
- }
6701
- if (next !== DialogType.nonModal) {
6702
- this.dialog.setAttribute("aria-modal", "true");
6703
- } else {
6704
- this.dialog.removeAttribute("aria-modal");
6705
- }
6777
+ dialogChanged() {
6778
+ this.updateDialogAttributes();
6706
6779
  }
6707
- /** @internal */
6708
- connectedCallback() {
6709
- super.connectedCallback();
6710
- this.typeChanged(void 0, this.type);
6780
+ typeChanged(prev, next) {
6781
+ this.updateDialogAttributes();
6711
6782
  }
6712
6783
  /**
6713
6784
  * Method to show the dialog
@@ -6748,6 +6819,26 @@ class Dialog extends FASTElement {
6748
6819
  }
6749
6820
  return true;
6750
6821
  }
6822
+ /**
6823
+ * Updates the internal dialog element's attributes based on its type.
6824
+ *
6825
+ * @internal
6826
+ */
6827
+ updateDialogAttributes() {
6828
+ if (!this.dialog) {
6829
+ return;
6830
+ }
6831
+ if (this.type === DialogType.alert) {
6832
+ this.dialog.setAttribute("role", "alertdialog");
6833
+ } else {
6834
+ this.dialog.removeAttribute("role");
6835
+ }
6836
+ if (this.type !== DialogType.nonModal) {
6837
+ this.dialog.setAttribute("aria-modal", "true");
6838
+ } else {
6839
+ this.dialog.removeAttribute("aria-modal");
6840
+ }
6841
+ }
6751
6842
  }
6752
6843
  __decorateClass$B([observable], Dialog.prototype, "dialog", 2);
6753
6844
  __decorateClass$B([attr({
@@ -7048,7 +7139,6 @@ class Drawer extends FASTElement {
7048
7139
  });
7049
7140
  }
7050
7141
  updateDialogRole() {
7051
- console.log(this.role);
7052
7142
  if (!this.dialog) {
7053
7143
  return;
7054
7144
  }
@@ -7139,12 +7229,6 @@ function getLanguage(rootNode) {
7139
7229
  return rootNode.closest("[lang]")?.lang ?? "en";
7140
7230
  }
7141
7231
 
7142
- let uniqueIdCounter = 0;
7143
- function uniqueId(prefix = "id-") {
7144
- const str = `${prefix}${uniqueIdCounter++}`;
7145
- return document.getElementById(str) ? uniqueId(prefix) : str;
7146
- }
7147
-
7148
7232
  function requestIdleCallback(callback, options) {
7149
7233
  if ("requestIdleCallback" in globalThis) {
7150
7234
  return globalThis.requestIdleCallback(callback, options);
@@ -7157,34 +7241,28 @@ function requestIdleCallback(callback, options) {
7157
7241
  });
7158
7242
  }, 1);
7159
7243
  }
7160
- function cancelIdleCallback(id) {
7161
- if ("cancelIdleCallback" in globalThis) {
7162
- globalThis.cancelIdleCallback(id);
7163
- } else {
7164
- clearTimeout(id);
7165
- }
7166
- }
7167
7244
  function waitForConnectedDescendants(target, callback, options) {
7168
- let idleCallbackId;
7169
7245
  const shallow = options?.shallow ?? false;
7170
- const query = `${shallow ? ":scope > " : ""}:not(:defined)`;
7171
7246
  const timeout = options?.timeout ?? 50;
7247
+ const selector = `${shallow ? ":scope > " : ""}:not(:defined)`;
7172
7248
  const scheduleCheck = deadline => {
7173
- if (idleCallbackId) {
7174
- cancelIdleCallback(idleCallbackId);
7175
- idleCallbackId = void 0;
7176
- }
7177
- if (!target.querySelector(query) || deadline && deadline.timeRemaining() <= 0) {
7178
- callback();
7249
+ if (target.querySelector(selector) === null || deadline && deadline.timeRemaining() <= 0) {
7250
+ requestAnimationFrame(callback);
7179
7251
  return;
7180
7252
  }
7181
- idleCallbackId = requestIdleCallback(scheduleCheck, {
7253
+ requestIdleCallback(scheduleCheck, {
7182
7254
  timeout
7183
7255
  });
7184
7256
  };
7185
7257
  scheduleCheck();
7186
7258
  }
7187
7259
 
7260
+ let uniqueIdCounter = 0;
7261
+ function uniqueId(prefix = "id-") {
7262
+ const str = `${prefix}${uniqueIdCounter++}`;
7263
+ return document.getElementById(str) ? uniqueId(prefix) : str;
7264
+ }
7265
+
7188
7266
  const DropdownAppearance = {
7189
7267
  filledDarker: "filled-darker",
7190
7268
  filledLighter: "filled-lighter",
@@ -7255,9 +7333,6 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
7255
7333
  */
7256
7334
  this.elementInternals = this.attachInternals();
7257
7335
  this.elementInternals.role = "presentation";
7258
- Updates.enqueue(() => {
7259
- this.insertControl();
7260
- });
7261
7336
  }
7262
7337
  get activeDescendant() {
7263
7338
  if (this.open) {
@@ -7306,11 +7381,13 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
7306
7381
  * @param next - the current disabled state
7307
7382
  */
7308
7383
  disabledChanged(prev, next) {
7309
- Updates.enqueue(() => {
7310
- this.options.forEach(option => {
7311
- option.disabled = option.disabledAttribute || this.disabled;
7384
+ if (this.listbox) {
7385
+ Updates.enqueue(() => {
7386
+ this.options.forEach(option => {
7387
+ option.disabled = option.disabledAttribute || this.disabled;
7388
+ });
7312
7389
  });
7313
- });
7390
+ }
7314
7391
  }
7315
7392
  get displayValue() {
7316
7393
  if (!this.$fastController.isConnected || !this.control || this.isCombobox && this.multiple) {
@@ -7348,10 +7425,12 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
7348
7425
  next.tabIndex = -1;
7349
7426
  const notifier = Observable.getNotifier(this);
7350
7427
  notifier.subscribe(next);
7351
- for (const key of ["disabled", "multiple"]) {
7352
- notifier.notify(key);
7353
- }
7428
+ notifier.notify("multiple");
7354
7429
  Updates.enqueue(() => {
7430
+ this.options.forEach(option => {
7431
+ option.disabled = option.disabledAttribute || this.disabled;
7432
+ option.name = this.name;
7433
+ });
7355
7434
  this.enabledOptions.filter(x => x.defaultSelected).forEach((x, i) => {
7356
7435
  x.selected = this.multiple || i === 0;
7357
7436
  });
@@ -7383,11 +7462,13 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
7383
7462
  * @param next - the current name
7384
7463
  */
7385
7464
  nameChanged(prev, next) {
7386
- Updates.enqueue(() => {
7387
- this.options.forEach(option => {
7388
- option.name = next;
7465
+ if (this.listbox) {
7466
+ Updates.enqueue(() => {
7467
+ this.options.forEach(option => {
7468
+ option.name = next;
7469
+ });
7389
7470
  });
7390
- });
7471
+ }
7391
7472
  }
7392
7473
  /**
7393
7474
  * Handles the open state of the dropdown.
@@ -7865,6 +7946,12 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
7865
7946
  this.freeformOption.value = value;
7866
7947
  this.freeformOption.hidden = false;
7867
7948
  }
7949
+ connectedCallback() {
7950
+ super.connectedCallback();
7951
+ Updates.enqueue(() => {
7952
+ this.insertControl();
7953
+ });
7954
+ }
7868
7955
  disconnectedCallback() {
7869
7956
  _BaseDropdown.AnchorPositionFallbackObserver?.disconnect();
7870
7957
  this.debounceController?.abort();
@@ -8366,7 +8453,6 @@ var __decorateClass$q = (decorators, target, key, kind) => {
8366
8453
  class Listbox extends FASTElement {
8367
8454
  constructor() {
8368
8455
  super();
8369
- this.id = uniqueId("listbox-");
8370
8456
  /**
8371
8457
  * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
8372
8458
  *
@@ -8375,6 +8461,15 @@ class Listbox extends FASTElement {
8375
8461
  this.elementInternals = this.attachInternals();
8376
8462
  this.elementInternals.role = "listbox";
8377
8463
  }
8464
+ /**
8465
+ * Calls the `slotchangeHandler` when the `defaultSlot` element is assigned
8466
+ * via the `ref` directive in the template.
8467
+ *
8468
+ * @internal
8469
+ */
8470
+ defaultSlotChanged() {
8471
+ this.slotchangeHandler();
8472
+ }
8378
8473
  /**
8379
8474
  * Updates the multiple selection state of the listbox and its options.
8380
8475
  *
@@ -8454,6 +8549,14 @@ class Listbox extends FASTElement {
8454
8549
  }
8455
8550
  return true;
8456
8551
  }
8552
+ connectedCallback() {
8553
+ super.connectedCallback();
8554
+ waitForConnectedDescendants(this, () => {
8555
+ this.id = this.id || uniqueId("listbox-");
8556
+ }, {
8557
+ shallow: true
8558
+ });
8559
+ }
8457
8560
  /**
8458
8561
  * Handles observable subscriptions for the listbox.
8459
8562
  *
@@ -8501,17 +8604,15 @@ class Listbox extends FASTElement {
8501
8604
  * @public
8502
8605
  */
8503
8606
  slotchangeHandler(e) {
8504
- const target = e.target;
8505
8607
  waitForConnectedDescendants(this, () => {
8506
- const options = target.assignedElements().filter(option => isDropdownOption(option));
8507
- this.options = options;
8608
+ if (this.defaultSlot) {
8609
+ const options = this.defaultSlot.assignedElements().filter(option => isDropdownOption(option));
8610
+ this.options = options;
8611
+ }
8508
8612
  });
8509
8613
  }
8510
8614
  }
8511
- __decorateClass$q([attr({
8512
- attribute: "id",
8513
- mode: "fromView"
8514
- })], Listbox.prototype, "id", 2);
8615
+ __decorateClass$q([observable], Listbox.prototype, "defaultSlot", 2);
8515
8616
  __decorateClass$q([observable], Listbox.prototype, "multiple", 2);
8516
8617
  __decorateClass$q([observable], Listbox.prototype, "options", 2);
8517
8618
  __decorateClass$q([observable], Listbox.prototype, "selectedIndex", 2);
@@ -8523,7 +8624,7 @@ const styles$l = css`
8523
8624
  :host{background-color:${colorNeutralBackground1};border-radius:${borderRadiusMedium};border:${strokeWidthThin} solid ${colorTransparentStroke};box-shadow:${shadow16};box-sizing:border-box;flex-direction:column;margin:0;min-width:160px;padding:${spacingHorizontalXS};row-gap:${spacingHorizontalXXS};width:auto}:host([popover]){inset:unset;overflow:auto}@supports (anchor-name:--anchor){:host([popover]){position:absolute;margin-block-start:0;max-height:var(--listbox-max-height,calc(50vh - anchor-size(self-block)));min-width:anchor-size(width);position-anchor:--dropdown;position-area:block-end span-inline-end;position-try-fallbacks:flip-inline,flip-block,--flip-block,block-start}@position-try --flip-block{bottom:anchor(top);top:unset}}@supports not (anchor-name:--anchor){:host([popover]){margin-block-start:var(--margin-offset,0);max-height:var(--listbox-max-height,50vh);position:fixed}:host([popover]${flipBlockState}){margin-block-start:revert;translate:0 -100%}}`;
8524
8625
 
8525
8626
  function listboxTemplate() {
8526
- return html`<template id="${x => x.id}" @beforetoggle="${(x, c) => x.beforetoggleHandler(c.event)}" @click="${(x, c) => x.clickHandler(c.event)}"><slot @slotchange="${(x, c) => x.slotchangeHandler(c.event)}"></slot></template>`;
8627
+ return html`<template @beforetoggle="${(x, c) => x.beforetoggleHandler(c.event)}" @click="${(x, c) => x.clickHandler(c.event)}"><slot ${ref("defaultSlot")} @slotchange="${(x, c) => x.slotchangeHandler(c.event)}"></slot></template>`;
8527
8628
  }
8528
8629
  const template$m = listboxTemplate();
8529
8630
 
@@ -9065,8 +9166,6 @@ var __decorateClass$n = (decorators, target, key, kind) => {
9065
9166
  class Menu extends FASTElement {
9066
9167
  constructor() {
9067
9168
  super(...arguments);
9068
- this.slottedMenuList = [];
9069
- this.slottedTriggers = [];
9070
9169
  /**
9071
9170
  * Defines whether the menu is open or not.
9072
9171
  * @internal
@@ -9154,6 +9253,15 @@ class Menu extends FASTElement {
9154
9253
  }
9155
9254
  };
9156
9255
  }
9256
+ /**
9257
+ * Sets up the component when the slotted menu list changes.
9258
+ * @param prev - The previous items in the slotted menu list.
9259
+ * @param next - The new items in the slotted menu list.
9260
+ * @internal
9261
+ */
9262
+ slottedMenuListChanged(prev, next) {
9263
+ this.setComponent();
9264
+ }
9157
9265
  /**
9158
9266
  * Called when the element is connected to the DOM.
9159
9267
  * Sets up the component.
@@ -9161,9 +9269,7 @@ class Menu extends FASTElement {
9161
9269
  */
9162
9270
  connectedCallback() {
9163
9271
  super.connectedCallback();
9164
- queueMicrotask(() => {
9165
- this.setComponent();
9166
- });
9272
+ this.setComponent();
9167
9273
  }
9168
9274
  /**
9169
9275
  * Called when the element is disconnected from the DOM.
@@ -9180,14 +9286,23 @@ class Menu extends FASTElement {
9180
9286
  * @public
9181
9287
  */
9182
9288
  setComponent() {
9183
- if (this.$fastController.isConnected && this.slottedMenuList.length && this.slottedTriggers.length) {
9184
- this._trigger = this.slottedTriggers[0];
9185
- this._menuList = this.slottedMenuList[0];
9289
+ waitForConnectedDescendants(this, () => {
9290
+ const trigger = this.slottedTriggers?.[0];
9291
+ const menuList = this.slottedMenuList?.[0];
9292
+ if (!trigger || !menuList) {
9293
+ this.removeListeners();
9294
+ return;
9295
+ }
9296
+ this._trigger = trigger;
9297
+ this._menuList = menuList;
9186
9298
  this._trigger.setAttribute("aria-haspopup", "true");
9187
9299
  this._trigger.setAttribute("aria-expanded", `${this._open}`);
9188
9300
  this._menuList.setAttribute("popover", this.openOnContext ? "manual" : "");
9301
+ this.removeListeners();
9189
9302
  this.addListeners();
9190
- }
9303
+ }, {
9304
+ shallow: true
9305
+ });
9191
9306
  }
9192
9307
  /**
9193
9308
  * Focuses on the menu list.
@@ -9581,7 +9696,7 @@ class DropdownOption extends FASTElement {
9581
9696
  set selected(next) {
9582
9697
  this.currentSelected = next;
9583
9698
  Updates.enqueue(() => {
9584
- if (this.$fastController.isConnected) {
9699
+ if (this.elementInternals) {
9585
9700
  this.setFormValue(next ? this.value : null);
9586
9701
  this.elementInternals.ariaSelected = next ? "true" : "false";
9587
9702
  toggleState(this.elementInternals, "selected", next);
@@ -9758,6 +9873,13 @@ class BaseProgressBar extends FASTElement {
9758
9873
  this.validationState = null;
9759
9874
  this.elementInternals.role = "progressbar";
9760
9875
  }
9876
+ /**
9877
+ * Updates the indicator width after the element is connected to the DOM via the template.
9878
+ * @internal
9879
+ */
9880
+ indicatorChanged() {
9881
+ this.setIndicatorWidth();
9882
+ }
9761
9883
  /**
9762
9884
  * Handles changes to validation-state attribute custom states
9763
9885
  * @param prev - the previous state
@@ -9772,7 +9894,9 @@ class BaseProgressBar extends FASTElement {
9772
9894
  * @internal
9773
9895
  */
9774
9896
  valueChanged(prev, next) {
9775
- this.elementInternals.ariaValueNow = typeof next === "number" ? `${next}` : null;
9897
+ if (this.elementInternals) {
9898
+ this.elementInternals.ariaValueNow = typeof next === "number" ? `${next}` : null;
9899
+ }
9776
9900
  this.setIndicatorWidth();
9777
9901
  }
9778
9902
  /**
@@ -9782,7 +9906,9 @@ class BaseProgressBar extends FASTElement {
9782
9906
  * @param next - The current min value
9783
9907
  */
9784
9908
  minChanged(prev, next) {
9785
- this.elementInternals.ariaValueMin = typeof next === "number" ? `${next}` : null;
9909
+ if (this.elementInternals) {
9910
+ this.elementInternals.ariaValueMin = typeof next === "number" ? `${next}` : null;
9911
+ }
9786
9912
  this.setIndicatorWidth();
9787
9913
  }
9788
9914
  /**
@@ -9793,27 +9919,34 @@ class BaseProgressBar extends FASTElement {
9793
9919
  * @internal
9794
9920
  */
9795
9921
  maxChanged(prev, next) {
9796
- this.elementInternals.ariaValueMax = typeof next === "number" ? `${next}` : null;
9797
- this.setIndicatorWidth();
9798
- }
9799
- connectedCallback() {
9800
- super.connectedCallback();
9922
+ if (this.elementInternals) {
9923
+ this.elementInternals.ariaValueMax = typeof next === "number" ? `${next}` : null;
9924
+ }
9801
9925
  this.setIndicatorWidth();
9802
9926
  }
9927
+ /**
9928
+ * Sets the width of the indicator element based on the value, min, and max
9929
+ * properties. If the browser supports `width: attr(value)`, this method does
9930
+ * nothing and allows CSS to handle the width.
9931
+ *
9932
+ * @internal
9933
+ */
9803
9934
  setIndicatorWidth() {
9804
- if (!this.$fastController.isConnected || CSS.supports("width: attr(value type(<number>))")) {
9935
+ if (CSS.supports("width: attr(value type(<number>))")) {
9805
9936
  return;
9806
9937
  }
9807
- if (typeof this.value !== "number") {
9808
- this.indicator.style.removeProperty("width");
9809
- return;
9810
- }
9811
- const min = this.min ?? 0;
9812
- const max = this.max ?? 100;
9813
- const value = this.value ?? 0;
9814
- const range = max - min;
9815
- const width = range === 0 ? 0 : Math.fround((value - min) / range * 100);
9816
- this.indicator.style.setProperty("width", `${width}%`);
9938
+ Updates.enqueue(() => {
9939
+ if (typeof this.value !== "number") {
9940
+ this.indicator?.style.removeProperty("width");
9941
+ return;
9942
+ }
9943
+ const min = this.min ?? 0;
9944
+ const max = this.max ?? 100;
9945
+ const value = this.value ?? 0;
9946
+ const range = max - min;
9947
+ const width = range === 0 ? 0 : Math.fround((value - min) / range * 100);
9948
+ this.indicator?.style.setProperty("width", `${width}%`);
9949
+ });
9817
9950
  }
9818
9951
  }
9819
9952
  __decorateClass$k([observable], BaseProgressBar.prototype, "indicator", 2);
@@ -9863,70 +9996,8 @@ const definition$f = ProgressBar.compose({
9863
9996
 
9864
9997
  definition$f.define(FluentDesignSystem.registry);
9865
9998
 
9866
- class Radio extends BaseCheckbox {
9867
- constructor() {
9868
- super();
9869
- this.elementInternals.role = "radio";
9870
- }
9871
- /**
9872
- * Toggles the disabled state when the user changes the `disabled` property.
9873
- *
9874
- * @param prev - the previous value of the `disabled` property
9875
- * @param next - the current value of the `disabled` property
9876
- * @internal
9877
- * @override
9878
- */
9879
- disabledChanged(prev, next) {
9880
- super.disabledChanged(prev, next);
9881
- this.$emit("disabled", next, {
9882
- bubbles: true
9883
- });
9884
- }
9885
- /**
9886
- * This method is a no-op for the radio component.
9887
- *
9888
- * @internal
9889
- * @override
9890
- * @remarks
9891
- * To make a group of radio controls required, see {@link RadioGroup.required}.
9892
- */
9893
- requiredChanged() {
9894
- return;
9895
- }
9896
- /**
9897
- * This method is a no-op for the radio component.
9898
- *
9899
- * @internal
9900
- * @override
9901
- * @remarks
9902
- * The radio form value is controlled by the `RadioGroup` component.
9903
- */
9904
- setFormValue() {
9905
- return;
9906
- }
9907
- /**
9908
- * Sets the validity of the control.
9909
- *
9910
- * @internal
9911
- * @override
9912
- * @remarks
9913
- * The radio component does not have a `required` attribute, so this method always sets the validity to `true`.
9914
- */
9915
- setValidity() {
9916
- this.elementInternals.setValidity({});
9917
- }
9918
- /**
9919
- * Toggles the checked state of the control.
9920
- *
9921
- * @param force - Forces the element to be checked or unchecked
9922
- * @public
9923
- * @override
9924
- * @remarks
9925
- * The radio checked state is controlled by the `RadioGroup` component, so the `force` parameter defaults to `true`.
9926
- */
9927
- toggleChecked(force = true) {
9928
- super.toggleChecked(force);
9929
- }
9999
+ function isRadio(element, tagName = "-radio") {
10000
+ return isCustomElement(tagName)(element);
9930
10001
  }
9931
10002
 
9932
10003
  function getRootActiveElement(element) {
@@ -9954,7 +10025,6 @@ class RadioGroup extends FASTElement {
9954
10025
  * Indicates that the value has been changed by the user.
9955
10026
  */
9956
10027
  this.dirtyState = false;
9957
- this.disabled = false;
9958
10028
  /**
9959
10029
  * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
9960
10030
  *
@@ -9985,7 +10055,7 @@ class RadioGroup extends FASTElement {
9985
10055
  * @internal
9986
10056
  */
9987
10057
  disabledChanged(prev, next) {
9988
- if (this.$fastController.isConnected) {
10058
+ if (this.radios) {
9989
10059
  this.checkedIndex = -1;
9990
10060
  this.radios?.forEach(radio => {
9991
10061
  radio.disabled = !!radio.disabledAttribute || !!this.disabled;
@@ -10081,6 +10151,15 @@ class RadioGroup extends FASTElement {
10081
10151
  this.elementInternals.ariaRequired = next ? "true" : null;
10082
10152
  this.setValidity();
10083
10153
  }
10154
+ /**
10155
+ * Updates the radios collection when the slotted radios change.
10156
+ *
10157
+ * @param prev - the previous slotted radios
10158
+ * @param next - the current slotted radios
10159
+ */
10160
+ slottedRadiosChanged(prev, next) {
10161
+ this.radios = [...this.querySelectorAll("*")].filter(x => isRadio(x));
10162
+ }
10084
10163
  /**
10085
10164
  * A collection of child radios that are not disabled.
10086
10165
  *
@@ -10388,17 +10467,6 @@ class RadioGroup extends FASTElement {
10388
10467
  });
10389
10468
  }
10390
10469
  }
10391
- /**
10392
- * Updates the collection of child radios when the slot changes.
10393
- *
10394
- * @param e - the slot change event
10395
- * @internal
10396
- */
10397
- slotchangeHandler(e) {
10398
- Updates.enqueue(() => {
10399
- this.radios = [...this.querySelectorAll("*")].filter(x => x instanceof Radio);
10400
- });
10401
- }
10402
10470
  }
10403
10471
  /**
10404
10472
  * The form-associated flag.
@@ -10422,6 +10490,7 @@ __decorateClass$i([observable], RadioGroup.prototype, "radios", 2);
10422
10490
  __decorateClass$i([attr({
10423
10491
  mode: "boolean"
10424
10492
  })], RadioGroup.prototype, "required", 2);
10493
+ __decorateClass$i([observable], RadioGroup.prototype, "slottedRadios", 2);
10425
10494
 
10426
10495
  const styles$e = css`
10427
10496
  ${display("flex")}
@@ -10429,7 +10498,7 @@ const styles$e = css`
10429
10498
  :host{-webkit-tap-highlight-color:transparent;cursor:pointer;gap:${spacingVerticalL}}:host([orientation='vertical']){flex-direction:column;justify-content:flex-start}:host([orientation='horizontal']){flex-direction:row}::slotted(*){color:${colorNeutralForeground3}}::slotted(:hover){color:${colorNeutralForeground2}}::slotted(:active){color:${colorNeutralForeground1}}::slotted(${disabledState}){color:${colorNeutralForegroundDisabled}}::slotted(${checkedState}){color:${colorNeutralForeground1}}:host([slot='input']){margin:${spacingVerticalS} ${spacingHorizontalS}}`;
10430
10499
 
10431
10500
  function radioGroupTemplate() {
10432
- return html`<template @disabled="${(x, c) => x.disabledRadioHandler(c.event)}" @change="${(x, c) => x.changeHandler(c.event)}" @click="${(x, c) => x.clickHandler(c.event)}" @focusin="${(x, c) => x.focusinHandler(c.event)}" @focusout="${(x, c) => x.focusoutHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}"><slot @slotchange="${(x, c) => x.slotchangeHandler(c.event)}"></slot></template>`;
10501
+ return html`<template @disabled="${(x, c) => x.disabledRadioHandler(c.event)}" @change="${(x, c) => x.changeHandler(c.event)}" @click="${(x, c) => x.clickHandler(c.event)}" @focusin="${(x, c) => x.focusinHandler(c.event)}" @focusout="${(x, c) => x.focusoutHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}"><slot ${slotted("slottedRadios")}></slot></template>`;
10433
10502
  }
10434
10503
  const template$e = radioGroupTemplate();
10435
10504
 
@@ -10441,6 +10510,72 @@ const definition$e = RadioGroup.compose({
10441
10510
 
10442
10511
  definition$e.define(FluentDesignSystem.registry);
10443
10512
 
10513
+ class Radio extends BaseCheckbox {
10514
+ constructor() {
10515
+ super();
10516
+ this.elementInternals.role = "radio";
10517
+ }
10518
+ /**
10519
+ * Toggles the disabled state when the user changes the `disabled` property.
10520
+ *
10521
+ * @param prev - the previous value of the `disabled` property
10522
+ * @param next - the current value of the `disabled` property
10523
+ * @internal
10524
+ * @override
10525
+ */
10526
+ disabledChanged(prev, next) {
10527
+ super.disabledChanged(prev, next);
10528
+ this.$emit("disabled", next, {
10529
+ bubbles: true
10530
+ });
10531
+ }
10532
+ /**
10533
+ * This method is a no-op for the radio component.
10534
+ *
10535
+ * @internal
10536
+ * @override
10537
+ * @remarks
10538
+ * To make a group of radio controls required, see {@link RadioGroup.required}.
10539
+ */
10540
+ requiredChanged() {
10541
+ return;
10542
+ }
10543
+ /**
10544
+ * This method is a no-op for the radio component.
10545
+ *
10546
+ * @internal
10547
+ * @override
10548
+ * @remarks
10549
+ * The radio form value is controlled by the `RadioGroup` component.
10550
+ */
10551
+ setFormValue() {
10552
+ return;
10553
+ }
10554
+ /**
10555
+ * Sets the validity of the control.
10556
+ *
10557
+ * @internal
10558
+ * @override
10559
+ * @remarks
10560
+ * The radio component does not have a `required` attribute, so this method always sets the validity to `true`.
10561
+ */
10562
+ setValidity() {
10563
+ this.elementInternals.setValidity({});
10564
+ }
10565
+ /**
10566
+ * Toggles the checked state of the control.
10567
+ *
10568
+ * @param force - Forces the element to be checked or unchecked
10569
+ * @public
10570
+ * @override
10571
+ * @remarks
10572
+ * The radio checked state is controlled by the `RadioGroup` component, so the `force` parameter defaults to `true`.
10573
+ */
10574
+ toggleChecked(force = true) {
10575
+ super.toggleChecked(force);
10576
+ }
10577
+ }
10578
+
10444
10579
  const styles$d = css`
10445
10580
  ${display("inline-flex")}
10446
10581
 
@@ -10500,6 +10635,14 @@ class BaseRatingDisplay extends FASTElement {
10500
10635
  this.elementInternals.role = "img";
10501
10636
  this.numberFormatter = new Intl.NumberFormat();
10502
10637
  }
10638
+ /**
10639
+ * Updates the icon when the referenced slot is bound in the template.
10640
+ *
10641
+ * @internal
10642
+ */
10643
+ iconSlotChanged() {
10644
+ this.handleSlotChange();
10645
+ }
10503
10646
  maxChanged() {
10504
10647
  this.setCustomPropertyValue("max");
10505
10648
  }
@@ -10549,17 +10692,20 @@ class BaseRatingDisplay extends FASTElement {
10549
10692
  this.display.style.setProperty(CUSTOM_PROPERTY_NAME.maskImageOutlined, `url(${svgToDataURI(customSvgOutlined)})`);
10550
10693
  }
10551
10694
  setCustomPropertyValue(propertyName) {
10552
- if (!this.display || SUPPORTS_ATTR_TYPE) {
10553
- return;
10554
- }
10555
- const propertyValue = this[propertyName];
10556
- if (typeof propertyValue !== "number" || Number.isNaN(propertyValue)) {
10557
- this.display.style.removeProperty(CUSTOM_PROPERTY_NAME[propertyName]);
10558
- } else {
10559
- this.display.style.setProperty(CUSTOM_PROPERTY_NAME[propertyName], `${propertyValue}`);
10560
- }
10695
+ requestAnimationFrame(() => {
10696
+ if (!this.display || SUPPORTS_ATTR_TYPE) {
10697
+ return;
10698
+ }
10699
+ const propertyValue = this[propertyName];
10700
+ if (typeof propertyValue !== "number" || Number.isNaN(propertyValue)) {
10701
+ this.display.style.removeProperty(CUSTOM_PROPERTY_NAME[propertyName]);
10702
+ } else {
10703
+ this.display.style.setProperty(CUSTOM_PROPERTY_NAME[propertyName], `${propertyValue}`);
10704
+ }
10705
+ });
10561
10706
  }
10562
10707
  }
10708
+ __decorateClass$h([observable], BaseRatingDisplay.prototype, "iconSlot", 2);
10563
10709
  __decorateClass$h([attr({
10564
10710
  converter: nullableNumberConverter
10565
10711
  })], BaseRatingDisplay.prototype, "count", 2);
@@ -10625,11 +10771,6 @@ const definition$c = RatingDisplay.compose({
10625
10771
 
10626
10772
  definition$c.define(FluentDesignSystem.registry);
10627
10773
 
10628
- const SliderOrientation = Orientation;
10629
- const SliderMode = {
10630
- singleValue: "single-value"
10631
- };
10632
-
10633
10774
  function convertPixelToPercent(pixelPos, minPosition, maxPosition, direction) {
10634
10775
  let pct = limit(0, 1, (pixelPos - minPosition) / (maxPosition - minPosition));
10635
10776
  if (direction === Direction.rtl) {
@@ -10638,6 +10779,11 @@ function convertPixelToPercent(pixelPos, minPosition, maxPosition, direction) {
10638
10779
  return pct;
10639
10780
  }
10640
10781
 
10782
+ const SliderOrientation = Orientation;
10783
+ const SliderMode = {
10784
+ singleValue: "single-value"
10785
+ };
10786
+
10641
10787
  var __defProp$f = Object.defineProperty;
10642
10788
  var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
10643
10789
  var __decorateClass$f = (decorators, target, key, kind) => {
@@ -10684,6 +10830,9 @@ class Slider extends FASTElement {
10684
10830
  * If the event handler is null it removes the events
10685
10831
  */
10686
10832
  this.handleThumbPointerDown = event => {
10833
+ if (this.isDisabled) {
10834
+ return true;
10835
+ }
10687
10836
  const windowFn = event !== null ? window.addEventListener : window.removeEventListener;
10688
10837
  windowFn("pointerup", this.handleWindowPointerUp);
10689
10838
  windowFn("pointermove", this.handlePointerMove, {
@@ -10700,7 +10849,7 @@ class Slider extends FASTElement {
10700
10849
  * Handle mouse moves during a thumb drag operation
10701
10850
  */
10702
10851
  this.handlePointerMove = event => {
10703
- if (this.disabled || event.defaultPrevented) {
10852
+ if (this.isDisabled || event.defaultPrevented) {
10704
10853
  return;
10705
10854
  }
10706
10855
  const sourceEvent = window.TouchEvent && event instanceof TouchEvent ? event.touches[0] : event;
@@ -10724,7 +10873,7 @@ class Slider extends FASTElement {
10724
10873
  * @param event - PointerEvent or null. If there is no event handler it will remove the events
10725
10874
  */
10726
10875
  this.handlePointerDown = event => {
10727
- if (event === null || !this.disabled) {
10876
+ if (event === null || !this.isDisabled) {
10728
10877
  const windowFn = event !== null ? window.addEventListener : window.removeEventListener;
10729
10878
  const documentFn = event !== null ? document.addEventListener : document.removeEventListener;
10730
10879
  windowFn("pointerup", this.handleWindowPointerUp);
@@ -10859,7 +11008,7 @@ class Slider extends FASTElement {
10859
11008
  */
10860
11009
  setValidity(flags, message, anchor) {
10861
11010
  if (this.$fastController.isConnected) {
10862
- if (this.disabled) {
11011
+ if (this.isDisabled) {
10863
11012
  this.elementInternals.setValidity({});
10864
11013
  return;
10865
11014
  }
@@ -10950,6 +11099,15 @@ class Slider extends FASTElement {
10950
11099
  disabledChanged() {
10951
11100
  this.setDisabledSideEffect(this.disabled);
10952
11101
  }
11102
+ /**
11103
+ * Returns true if the component is disabled, taking into account the `disabled`
11104
+ * attribute, `aria-disabled` attribute, and the `:disabled` pseudo-class.
11105
+ *
11106
+ * @internal
11107
+ */
11108
+ get isDisabled() {
11109
+ return this.disabled || this.elementInternals?.ariaDisabled === "true" || this.isConnected && this.matches(":disabled");
11110
+ }
10953
11111
  minChanged() {
10954
11112
  this.elementInternals.ariaValueMin = `${this.minAsNumber}`;
10955
11113
  if (this.$fastController.isConnected && this.minAsNumber > this.valueAsNumber) {
@@ -11016,30 +11174,34 @@ class Slider extends FASTElement {
11016
11174
  this.setSliderPosition();
11017
11175
  }
11018
11176
  }
11019
- /**
11020
- * @internal
11021
- */
11022
11177
  connectedCallback() {
11023
11178
  super.connectedCallback();
11024
- this.direction = getDirection(this);
11025
- this.setDisabledSideEffect(this.disabled);
11026
- this.updateStepMultiplier();
11027
- this.setupTrackConstraints();
11028
- this.setupDefaultValue();
11029
- this.setSliderPosition();
11030
- Observable.getNotifier(this).subscribe(this, "max");
11031
- Observable.getNotifier(this).subscribe(this, "min");
11032
- Observable.getNotifier(this).subscribe(this, "step");
11033
- this.handleStepStyles();
11179
+ requestAnimationFrame(() => {
11180
+ if (!this.$fastController.isConnected) {
11181
+ return;
11182
+ }
11183
+ this.direction = getDirection(this);
11184
+ this.setDisabledSideEffect(this.disabled);
11185
+ this.updateStepMultiplier();
11186
+ this.setupTrackConstraints();
11187
+ this.setupDefaultValue();
11188
+ this.setSliderPosition();
11189
+ this.handleStepStyles();
11190
+ const notifier = Observable.getNotifier(this);
11191
+ notifier.subscribe(this, "max");
11192
+ notifier.subscribe(this, "min");
11193
+ notifier.subscribe(this, "step");
11194
+ });
11034
11195
  }
11035
11196
  /**
11036
11197
  * @internal
11037
11198
  */
11038
11199
  disconnectedCallback() {
11039
11200
  super.disconnectedCallback();
11040
- Observable.getNotifier(this).unsubscribe(this, "max");
11041
- Observable.getNotifier(this).unsubscribe(this, "min");
11042
- Observable.getNotifier(this).unsubscribe(this, "step");
11201
+ const notifier = Observable.getNotifier(this);
11202
+ notifier.unsubscribe(this, "max");
11203
+ notifier.unsubscribe(this, "min");
11204
+ notifier.unsubscribe(this, "step");
11043
11205
  }
11044
11206
  /**
11045
11207
  * Increment the value by the step
@@ -11064,7 +11226,7 @@ class Slider extends FASTElement {
11064
11226
  this.value = decrementedValString;
11065
11227
  }
11066
11228
  handleKeydown(event) {
11067
- if (this.disabled) {
11229
+ if (this.isDisabled) {
11068
11230
  return true;
11069
11231
  }
11070
11232
  switch (event.key) {
@@ -11149,12 +11311,11 @@ class Slider extends FASTElement {
11149
11311
  /**
11150
11312
  * Makes sure the side effects of set up when the disabled state changes.
11151
11313
  */
11152
- setDisabledSideEffect(disabled) {
11153
- if (!this.$fastController.isConnected) {
11154
- return;
11155
- }
11156
- this.elementInternals.ariaDisabled = disabled.toString();
11157
- this.tabIndex = disabled ? -1 : 0;
11314
+ setDisabledSideEffect(disabled = this.isDisabled) {
11315
+ Updates.enqueue(() => {
11316
+ this.elementInternals.ariaDisabled = disabled.toString();
11317
+ this.tabIndex = disabled ? -1 : 0;
11318
+ });
11158
11319
  }
11159
11320
  }
11160
11321
  /**
@@ -11296,9 +11457,23 @@ var __decorateClass$d = (decorators, target, key, kind) => {
11296
11457
  return result;
11297
11458
  };
11298
11459
  class Tab extends FASTElement {
11460
+ constructor() {
11461
+ super();
11462
+ /**
11463
+ * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
11464
+ *
11465
+ * @internal
11466
+ */
11467
+ this.elementInternals = this.attachInternals();
11468
+ this.elementInternals.role = "tab";
11469
+ }
11299
11470
  connectedCallback() {
11300
11471
  super.connectedCallback();
11301
- if (this.styles !== void 0) {
11472
+ this.slot || (this.slot = "tab");
11473
+ if (this.disabled) {
11474
+ this.setAttribute("aria-disabled", "true");
11475
+ }
11476
+ if (this.styles) {
11302
11477
  this.$fastController.removeStyles(this.styles);
11303
11478
  }
11304
11479
  this.styles = css`
@@ -11330,8 +11505,15 @@ const definition$8 = Tab.compose({
11330
11505
 
11331
11506
  definition$8.define(FluentDesignSystem.registry);
11332
11507
 
11508
+ function isTab(element, tagName = "-tab") {
11509
+ if (element?.nodeType !== Node.ELEMENT_NODE) {
11510
+ return false;
11511
+ }
11512
+ return element.tagName.toLowerCase().endsWith(tagName);
11513
+ }
11514
+
11333
11515
  const isARIADisabledElement = el => {
11334
- return el.getAttribute("aria-disabled") === "true";
11516
+ return el.getAttribute("aria-disabled") === "true" || el.elementInternals?.ariaDisabled === "true";
11335
11517
  };
11336
11518
  const isHiddenElement = el => {
11337
11519
  return el.hasAttribute("hidden");
@@ -11340,13 +11522,6 @@ const isFocusableElement = el => {
11340
11522
  return !isARIADisabledElement(el) && !isHiddenElement(el);
11341
11523
  };
11342
11524
 
11343
- function isTab(element, tagName = "-tab") {
11344
- if (element?.nodeType !== Node.ELEMENT_NODE) {
11345
- return false;
11346
- }
11347
- return element.tagName.toLowerCase().endsWith(tagName);
11348
- }
11349
-
11350
11525
  const TablistAppearance = {
11351
11526
  subtle: "subtle",
11352
11527
  transparent: "transparent"
@@ -11363,7 +11538,7 @@ var __decorateClass$c = (decorators, target, key, kind) => {
11363
11538
  };
11364
11539
  class BaseTablist extends FASTElement {
11365
11540
  constructor() {
11366
- super(...arguments);
11541
+ super();
11367
11542
  /**
11368
11543
  * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
11369
11544
  *
@@ -11380,6 +11555,9 @@ class BaseTablist extends FASTElement {
11380
11555
  };
11381
11556
  this.handleTabClick = event => {
11382
11557
  const selectedTab = event.currentTarget;
11558
+ if (selectedTab.disabled || this.disabled) {
11559
+ return;
11560
+ }
11383
11561
  if (selectedTab.nodeType === Node.ELEMENT_NODE && isFocusableElement(selectedTab)) {
11384
11562
  this.prevActiveTabIndex = this.activeTabIndex;
11385
11563
  this.activeTabIndex = this.tabs.indexOf(selectedTab);
@@ -11387,6 +11565,9 @@ class BaseTablist extends FASTElement {
11387
11565
  }
11388
11566
  };
11389
11567
  this.handleTabKeyDown = event => {
11568
+ if (this.disabled) {
11569
+ return;
11570
+ }
11390
11571
  const dir = getDirection(this);
11391
11572
  switch (event.key) {
11392
11573
  case keyArrowLeft:
@@ -11427,6 +11608,8 @@ class BaseTablist extends FASTElement {
11427
11608
  break;
11428
11609
  }
11429
11610
  };
11611
+ this.elementInternals.role = "tablist";
11612
+ this.elementInternals.ariaOrientation = this.orientation ?? TablistOrientation.horizontal;
11430
11613
  }
11431
11614
  /**
11432
11615
  * Handles disabled changes
@@ -11437,25 +11620,23 @@ class BaseTablist extends FASTElement {
11437
11620
  */
11438
11621
  disabledChanged(prev, next) {
11439
11622
  toggleState(this.elementInternals, "disabled", next);
11440
- if (this.$fastController.isConnected) {
11441
- this.setTabs();
11442
- }
11623
+ this.setTabs();
11443
11624
  }
11444
11625
  /**
11445
11626
  * @internal
11446
11627
  */
11447
11628
  orientationChanged(prev, next) {
11448
- this.elementInternals.ariaOrientation = next ?? TablistOrientation.horizontal;
11449
- swapStates(this.elementInternals, prev, next, TablistOrientation);
11450
- if (this.$fastController.isConnected) {
11451
- this.setTabs();
11629
+ if (this.elementInternals) {
11630
+ this.elementInternals.ariaOrientation = next ?? TablistOrientation.horizontal;
11631
+ swapStates(this.elementInternals, prev, next, TablistOrientation);
11452
11632
  }
11633
+ this.setTabs();
11453
11634
  }
11454
11635
  /**
11455
11636
  * @internal
11456
11637
  */
11457
11638
  activeidChanged(oldValue, newValue) {
11458
- if (this.$fastController.isConnected && this.tabs.length > 0) {
11639
+ if (this.tabs?.length > 0) {
11459
11640
  this.prevActiveTabIndex = this.tabs.findIndex(item => item.id === oldValue);
11460
11641
  this.setTabs();
11461
11642
  if (oldValue) {
@@ -11486,8 +11667,14 @@ class BaseTablist extends FASTElement {
11486
11667
  /**
11487
11668
  * @internal
11488
11669
  */
11489
- tabsChanged() {
11490
- if (this.$fastController.isConnected && this.tabs.length > 0) {
11670
+ tabsChanged(prev, next) {
11671
+ if (prev?.length) {
11672
+ prev.forEach(tab => {
11673
+ tab.removeEventListener("click", this.handleTabClick);
11674
+ tab.removeEventListener("keydown", this.handleTabKeyDown);
11675
+ });
11676
+ }
11677
+ if (this.tabs.length > 0) {
11491
11678
  this.tabIds = this.getTabIds();
11492
11679
  this.setTabs();
11493
11680
  for (const tab of this.tabs) {
@@ -11517,12 +11704,11 @@ class BaseTablist extends FASTElement {
11517
11704
  */
11518
11705
  setTabs() {
11519
11706
  this.activeTabIndex = this.getActiveIndex();
11520
- const hasStartSlot = this.tabs.some(tab => !!tab.querySelector("[slot='start']"));
11521
- this.tabs.forEach((tab, index) => {
11707
+ const hasStartSlot = this.tabs?.some(tab => !!tab.querySelector("[slot='start']"));
11708
+ this.tabs?.forEach((tab, index) => {
11522
11709
  if (tab.slot === "tab") {
11523
11710
  const isActiveTab = this.activeTabIndex === index && isFocusableElement(tab);
11524
11711
  const tabId = this.tabIds[index];
11525
- console.log("disabled", this.disabled);
11526
11712
  if (!tab.disabled) {
11527
11713
  this.disabled ? tab.setAttribute("aria-disabled", "true") : tab.removeAttribute("aria-disabled");
11528
11714
  }
@@ -11586,8 +11772,10 @@ class BaseTablist extends FASTElement {
11586
11772
  */
11587
11773
  connectedCallback() {
11588
11774
  super.connectedCallback();
11589
- this.tabIds = this.getTabIds();
11590
- this.activeTabIndex = this.getActiveIndex();
11775
+ waitForConnectedDescendants(this, () => {
11776
+ this.tabIds = this.getTabIds();
11777
+ this.setTabs();
11778
+ });
11591
11779
  }
11592
11780
  }
11593
11781
  __decorateClass$c([attr({
@@ -11737,8 +11925,8 @@ class Tablist extends BaseTablist {
11737
11925
  /**
11738
11926
  * Initiates the active tab indicator animation loop when tabs change.
11739
11927
  */
11740
- tabsChanged() {
11741
- super.tabsChanged();
11928
+ tabsChanged(prev, next) {
11929
+ super.tabsChanged(prev, next);
11742
11930
  this.setTabData();
11743
11931
  if (this.activetab) {
11744
11932
  this.animationLoop(this.activetab);
@@ -11804,6 +11992,24 @@ class BaseTextArea extends FASTElement {
11804
11992
  this.resize = TextAreaResize.none;
11805
11993
  this.spellcheck = false;
11806
11994
  }
11995
+ /**
11996
+ * Sets up a mutation observer to watch for changes to the control element's
11997
+ * attributes that could affect validity, and binds an input event listener to detect user interaction.
11998
+ *
11999
+ * @internal
12000
+ */
12001
+ controlElChanged() {
12002
+ this.controlElAttrObserver = new MutationObserver(() => {
12003
+ this.setValidity();
12004
+ });
12005
+ this.controlElAttrObserver.observe(this.controlEl, {
12006
+ attributes: true,
12007
+ attributeFilter: ["disabled", "required", "readonly", "maxlength", "minlength"]
12008
+ });
12009
+ this.controlEl.addEventListener("input", () => this.userInteracted = true, {
12010
+ once: true
12011
+ });
12012
+ }
11807
12013
  defaultSlottedNodesChanged() {
11808
12014
  const next = this.getContent();
11809
12015
  this.defaultValue = next;
@@ -11845,6 +12051,9 @@ class BaseTextArea extends FASTElement {
11845
12051
  }
11846
12052
  readOnlyChanged() {
11847
12053
  this.elementInternals.ariaReadOnly = `${!!this.readOnly}`;
12054
+ if (this.$fastController.isConnected) {
12055
+ this.setValidity();
12056
+ }
11848
12057
  }
11849
12058
  requiredChanged() {
11850
12059
  this.elementInternals.ariaRequired = `${!!this.required}`;
@@ -11945,10 +12154,19 @@ class BaseTextArea extends FASTElement {
11945
12154
  */
11946
12155
  connectedCallback() {
11947
12156
  super.connectedCallback();
11948
- this.setDefaultValue();
11949
- this.maybeCreateAutoSizerEl();
11950
- this.bindEvents();
11951
- this.observeControlElAttrs();
12157
+ requestAnimationFrame(() => {
12158
+ if (!this.$fastController.isConnected) {
12159
+ return;
12160
+ }
12161
+ const preConnect = this.preConnectControlEl;
12162
+ const content = this.getContent();
12163
+ this.defaultValue = content || preConnect?.defaultValue || "";
12164
+ this.value = preConnect?.value || this.defaultValue;
12165
+ this.setFormValue(this.value);
12166
+ this.setValidity();
12167
+ this.preConnectControlEl = null;
12168
+ this.maybeCreateAutoSizerEl();
12169
+ });
11952
12170
  }
11953
12171
  /**
11954
12172
  * @internal
@@ -12043,18 +12261,6 @@ class BaseTextArea extends FASTElement {
12043
12261
  select() {
12044
12262
  this.controlEl.select();
12045
12263
  }
12046
- setDefaultValue() {
12047
- this.defaultValue = this.innerHTML.trim() || this.preConnectControlEl.defaultValue || "";
12048
- this.value = this.preConnectControlEl.value || this.defaultValue;
12049
- this.setFormValue(this.value);
12050
- this.setValidity();
12051
- this.preConnectControlEl = null;
12052
- }
12053
- bindEvents() {
12054
- this.controlEl.addEventListener("input", () => this.userInteracted = true, {
12055
- once: true
12056
- });
12057
- }
12058
12264
  /**
12059
12265
  * Gets the content inside the light DOM, if any HTML element is present, use its `outerHTML` value.
12060
12266
  */
@@ -12070,15 +12276,6 @@ class BaseTextArea extends FASTElement {
12070
12276
  }
12071
12277
  }).join("") || "";
12072
12278
  }
12073
- observeControlElAttrs() {
12074
- this.controlElAttrObserver = new MutationObserver(() => {
12075
- this.setValidity();
12076
- });
12077
- this.controlElAttrObserver.observe(this.controlEl, {
12078
- attributes: true,
12079
- attributeFilter: ["disabled", "required", "readonly", "maxlength", "minlength"]
12080
- });
12081
- }
12082
12279
  setDisabledSideEffect(disabled) {
12083
12280
  this.elementInternals.ariaDisabled = `${disabled}`;
12084
12281
  if (this.controlEl) {
@@ -12152,6 +12349,7 @@ class BaseTextArea extends FASTElement {
12152
12349
  * @public
12153
12350
  */
12154
12351
  BaseTextArea.formAssociated = true;
12352
+ __decorateClass$a([observable], BaseTextArea.prototype, "controlEl", 2);
12155
12353
  __decorateClass$a([observable], BaseTextArea.prototype, "defaultSlottedNodes", 2);
12156
12354
  __decorateClass$a([observable], BaseTextArea.prototype, "labelSlottedNodes", 2);
12157
12355
  __decorateClass$a([attr], BaseTextArea.prototype, "autocomplete", 2);
@@ -12324,9 +12522,11 @@ class BaseTextInput extends FASTElement {
12324
12522
  * @internal
12325
12523
  */
12326
12524
  defaultSlottedNodesChanged(prev, next) {
12327
- if (this.$fastController.isConnected) {
12328
- this.controlLabel.hidden = !next?.length;
12329
- }
12525
+ Updates.enqueue(() => {
12526
+ if (this.controlLabel) {
12527
+ this.controlLabel.hidden = !next?.some(node => node.nodeType === Node.ELEMENT_NODE || node.nodeType === Node.TEXT_NODE && !!node.textContent?.trim());
12528
+ }
12529
+ });
12330
12530
  }
12331
12531
  /**
12332
12532
  * Sets the value of the element to the initial value.
@@ -12370,7 +12570,11 @@ class BaseTextInput extends FASTElement {
12370
12570
  * @internal
12371
12571
  */
12372
12572
  controlChanged(prev, next) {
12373
- this.setValidity();
12573
+ Updates.enqueue(() => {
12574
+ if (this.$fastController.isConnected) {
12575
+ this.setValidity();
12576
+ }
12577
+ });
12374
12578
  }
12375
12579
  /**
12376
12580
  * The element's validity state.
@@ -12479,6 +12683,7 @@ class BaseTextInput extends FASTElement {
12479
12683
  }
12480
12684
  connectedCallback() {
12481
12685
  super.connectedCallback();
12686
+ this.tabIndex = Number(this.getAttribute("tabindex") ?? 0) < 0 ? -1 : 0;
12482
12687
  this.setFormValue(this.value);
12483
12688
  this.setValidity();
12484
12689
  }
@@ -12692,10 +12897,7 @@ const styles$5 = css`
12692
12897
  :host{font-family:${fontFamilyBase};font-size:${fontSizeBase300};font-weight:${fontWeightRegular};line-height:${lineHeightBase300};max-width:400px}.label{display:flex;color:${colorNeutralForeground1};padding-bottom:${spacingVerticalXS};flex-shrink:0;padding-inline-end:${spacingHorizontalXS}}.label[hidden],:host(:empty) .label{display:none}.root{align-items:center;background-color:${colorNeutralBackground1};border:${strokeWidthThin} solid ${colorNeutralStroke1};border-bottom-color:${colorNeutralStrokeAccessible};border-radius:${borderRadiusMedium};box-sizing:border-box;height:32px;display:inline-flex;flex-direction:row;gap:${spacingHorizontalXXS};padding:0 ${spacingHorizontalMNudge};position:relative;width:100%}:has(.control:user-invalid){border-color:${colorPaletteRedBorder2}}.root::after{box-sizing:border-box;content:'';position:absolute;left:-1px;bottom:0px;right:-1px;height:max(2px,${borderRadiusMedium});border-radius:0 0 ${borderRadiusMedium} ${borderRadiusMedium};border-bottom:2px solid ${colorCompoundBrandStroke};clip-path:inset(calc(100% - 2px) 1px 0px);transform:scaleX(0);transition-property:transform;transition-duration:${durationUltraFast};transition-delay:${curveAccelerateMid}}.control{width:100%;height:100%;box-sizing:border-box;color:${colorNeutralForeground1};border-radius:${borderRadiusMedium};background:${colorTransparentBackground};font-family:${fontFamilyBase};font-weight:${fontWeightRegular};font-size:${fontSizeBase300};border:none;vertical-align:center}.control:focus-visible{outline:0;border:0}.control::placeholder{color:${colorNeutralForeground4}}:host ::slotted([slot='start']),:host ::slotted([slot='end']){display:flex;align-items:center;justify-content:center;color:${colorNeutralForeground3};font-size:${fontSizeBase500}}:host ::slotted([slot='start']){padding-right:${spacingHorizontalXXS}}:host ::slotted([slot='end']){padding-left:${spacingHorizontalXXS};gap:${spacingHorizontalXS}}:host(:hover) .root{border-color:${colorNeutralStroke1Hover};border-bottom-color:${colorNeutralStrokeAccessibleHover}}:host(:active) .root{border-color:${colorNeutralStroke1Pressed}}:host(:focus-within) .root{outline:transparent solid 2px;border-bottom:0}:host(:focus-within) .root::after{transform:scaleX(1);transition-property:transform;transition-duration:${durationNormal};transition-delay:${curveDecelerateMid}}:host(:focus-within:active) .root:after{border-bottom-color:${colorCompoundBrandStrokePressed}}:host([appearance='outline']:focus-within) .root{border:${strokeWidthThin} solid ${colorNeutralStroke1}}:host(:focus-within) .control{color:${colorNeutralForeground1}}:host([disabled]) .root{background:${colorTransparentBackground};border:${strokeWidthThin} solid ${colorNeutralStrokeDisabled}}:host([disabled]) .control::placeholder,:host([disabled]) ::slotted([slot='start']),:host([disabled]) ::slotted([slot='end']){color:${colorNeutralForegroundDisabled}}::selection{color:${colorNeutralForegroundInverted};background-color:${colorNeutralBackgroundInverted}}:host([control-size='small']) .control{font-size:${fontSizeBase200};font-weight:${fontWeightRegular};line-height:${lineHeightBase200}}:host([control-size='small']) .root{height:24px;gap:${spacingHorizontalXXS};padding:0 ${spacingHorizontalSNudge}}:host([control-size='small']) ::slotted([slot='start']),:host([control-size='small']) ::slotted([slot='end']){font-size:${fontSizeBase400}}:host([control-size='large']) .control{font-size:${fontSizeBase400};font-weight:${fontWeightRegular};line-height:${lineHeightBase400}}:host([control-size='large']) .root{height:40px;gap:${spacingHorizontalS};padding:0 ${spacingHorizontalM}}:host([control-size='large']) ::slotted([slot='start']),:host([control-size='large']) ::slotted([slot='end']){font-size:${fontSizeBase600}}:host([appearance='underline']) .root{background:${colorTransparentBackground};border:0;border-radius:0;border-bottom:${strokeWidthThin} solid ${colorNeutralStrokeAccessible}}:host([appearance='underline']:hover) .root{border-bottom-color:${colorNeutralStrokeAccessibleHover}}:host([appearance='underline']:active) .root{border-bottom-color:${colorNeutralStrokeAccessiblePressed}}:host([appearance='underline']:focus-within) .root{border:0;border-bottom-color:${colorNeutralStrokeAccessiblePressed}}:host([appearance='underline'][disabled]) .root{border-bottom-color:${colorNeutralStrokeDisabled}}:host([appearance='filled-lighter']) .root,:host([appearance='filled-darker']) .root{border:${strokeWidthThin} solid ${colorTransparentStroke};box-shadow:${shadow2}}:host([appearance='filled-lighter']) .root{background:${colorNeutralBackground1}}:host([appearance='filled-darker']) .root{background:${colorNeutralBackground3}}:host([appearance='filled-lighter']:hover) .root,:host([appearance='filled-darker']:hover) .root{border-color:${colorTransparentStrokeInteractive}}:host([appearance='filled-lighter']:active) .root,:host([appearance='filled-darker']:active) .root{border-color:${colorTransparentStrokeInteractive};background:${colorNeutralBackground3}}`;
12693
12898
 
12694
12899
  function textInputTemplate(options = {}) {
12695
- return html`<template @beforeinput="${(x, c) => x.beforeinputHandler(c.event)}" @focusin="${(x, c) => x.focusinHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}"><label part="label" for="control" class="label" ${ref("controlLabel")}><slot ${slotted({
12696
- property: "defaultSlottedNodes",
12697
- filter: whitespaceFilter
12698
- })}></slot></label><div class="root" part="root">${startSlotTemplate(options)}<input class="control" part="control" id="control" @change="${(x, c) => x.changeHandler(c.event)}" @input="${(x, c) => x.inputHandler(c.event)}" ?autofocus="${x => x.autofocus}" autocomplete="${x => x.autocomplete}" ?disabled="${x => x.disabled}" list="${x => x.list}" maxlength="${x => x.maxlength}" minlength="${x => x.minlength}" ?multiple="${x => x.multiple}" name="${x => x.name}" pattern="${x => x.pattern}" placeholder="${x => x.placeholder}" ?readonly="${x => x.readOnly}" ?required="${x => x.required}" size="${x => x.size}" spellcheck="${x => x.spellcheck}" type="${x => x.type}" value="${x => x.initialValue}" ${ref("control")} />${endSlotTemplate(options)}</div></template>`;
12900
+ return html`<template @beforeinput="${(x, c) => x.beforeinputHandler(c.event)}" @focusin="${(x, c) => x.focusinHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}"><label part="label" for="control" class="label" ${ref("controlLabel")}><slot ${slotted("defaultSlottedNodes")}></slot></label><div class="root" part="root">${startSlotTemplate(options)}<input class="control" part="control" id="control" @change="${(x, c) => x.changeHandler(c.event)}" @input="${(x, c) => x.inputHandler(c.event)}" ?autofocus="${x => x.autofocus}" autocomplete="${x => x.autocomplete}" ?disabled="${x => x.disabled}" list="${x => x.list}" maxlength="${x => x.maxlength}" minlength="${x => x.minlength}" ?multiple="${x => x.multiple}" name="${x => x.name}" pattern="${x => x.pattern}" placeholder="${x => x.placeholder}" ?readonly="${x => x.readOnly}" ?required="${x => x.required}" size="${x => x.size}" spellcheck="${x => x.spellcheck}" type="${x => x.type}" value="${x => x.initialValue}" ${ref("control")} />${endSlotTemplate(options)}</div></template>`;
12699
12901
  }
12700
12902
  const template$5 = textInputTemplate();
12701
12903
 
@@ -13098,9 +13300,21 @@ class BaseTree extends FASTElement {
13098
13300
  * @internal
13099
13301
  */
13100
13302
  this.elementInternals = this.attachInternals();
13101
- this.childTreeItems = [];
13102
13303
  this.elementInternals.role = "tree";
13103
13304
  }
13305
+ /**
13306
+ * Calls the slot change handler when the `defaultSlot` reference is updated
13307
+ * by the template binding.
13308
+ *
13309
+ * @internal
13310
+ */
13311
+ defaultSlotChanged() {
13312
+ this.handleDefaultSlotChange();
13313
+ }
13314
+ connectedCallback() {
13315
+ super.connectedCallback();
13316
+ this.tabIndex = Number(this.getAttribute("tabindex") ?? 0) < 0 ? -1 : 0;
13317
+ }
13104
13318
  /** @internal */
13105
13319
  childTreeItemsChanged() {
13106
13320
  this.updateCurrentSelected();
@@ -13294,6 +13508,7 @@ class BaseTree extends FASTElement {
13294
13508
  }
13295
13509
  }
13296
13510
  __decorateClass$3([observable], BaseTree.prototype, "currentSelected", 2);
13511
+ __decorateClass$3([observable], BaseTree.prototype, "defaultSlot", 2);
13297
13512
  __decorateClass$3([observable], BaseTree.prototype, "childTreeItems", 2);
13298
13513
 
13299
13514
  var __defProp$2 = Object.defineProperty;
@@ -13374,11 +13589,19 @@ class BaseTreeItem extends FASTElement {
13374
13589
  */
13375
13590
  this.elementInternals = this.attachInternals();
13376
13591
  this.expanded = false;
13377
- this.selected = false;
13378
13592
  this.empty = false;
13379
13593
  this.childTreeItems = [];
13380
13594
  this.elementInternals.role = "treeitem";
13381
13595
  }
13596
+ /**
13597
+ * Calls the slot change handler when the `itemSlot` reference is updated
13598
+ * by the template binding.
13599
+ *
13600
+ * @internal
13601
+ */
13602
+ itemSlotChanged() {
13603
+ this.handleItemSlotChange();
13604
+ }
13382
13605
  /**
13383
13606
  * Handles changes to the expanded attribute
13384
13607
  * @param prev - the previous state
@@ -13428,7 +13651,9 @@ class BaseTreeItem extends FASTElement {
13428
13651
  }
13429
13652
  connectedCallback() {
13430
13653
  super.connectedCallback();
13431
- this.updateTabindexBySelected();
13654
+ Updates.enqueue(() => {
13655
+ this.updateTabindexBySelected();
13656
+ });
13432
13657
  }
13433
13658
  /**
13434
13659
  * Updates the childrens indent
@@ -13471,9 +13696,7 @@ class BaseTreeItem extends FASTElement {
13471
13696
  return isTreeItem(this.parentElement);
13472
13697
  }
13473
13698
  updateTabindexBySelected() {
13474
- if (this.$fastController.isConnected) {
13475
- this.tabIndex = this.selected ? 0 : -1;
13476
- }
13699
+ this.tabIndex = this.selected ? 0 : -1;
13477
13700
  }
13478
13701
  /** @internal */
13479
13702
  handleItemSlotChange() {