@fluentui/web-components 3.0.0-rc.1 → 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 (177) hide show
  1. package/CHANGELOG.md +93 -2
  2. package/custom-elements.json +773 -1306
  3. package/dist/esm/anchor-button/anchor-button.base.js +4 -0
  4. package/dist/esm/anchor-button/anchor-button.base.js.map +1 -1
  5. package/dist/esm/avatar/avatar.base.d.ts +75 -1
  6. package/dist/esm/avatar/avatar.base.js +110 -1
  7. package/dist/esm/avatar/avatar.base.js.map +1 -1
  8. package/dist/esm/avatar/avatar.js +1 -1
  9. package/dist/esm/avatar/avatar.js.map +1 -1
  10. package/dist/esm/avatar/avatar.styles.js +24 -7
  11. package/dist/esm/avatar/avatar.styles.js.map +1 -1
  12. package/dist/esm/avatar/avatar.template.js +4 -3
  13. package/dist/esm/avatar/avatar.template.js.map +1 -1
  14. package/dist/esm/badge/badge.options.d.ts +3 -1
  15. package/dist/esm/badge/badge.options.js.map +1 -1
  16. package/dist/esm/button/button.base.d.ts +15 -1
  17. package/dist/esm/button/button.base.js +27 -24
  18. package/dist/esm/button/button.base.js.map +1 -1
  19. package/dist/esm/button/button.template.d.ts +3 -3
  20. package/dist/esm/button/button.template.js.map +1 -1
  21. package/dist/esm/compound-button/compound-button.styles.js +1 -1
  22. package/dist/esm/compound-button/compound-button.styles.js.map +1 -1
  23. package/dist/esm/counter-badge/counter-badge.d.ts +2 -1
  24. package/dist/esm/counter-badge/counter-badge.js +2 -1
  25. package/dist/esm/counter-badge/counter-badge.js.map +1 -1
  26. package/dist/esm/dialog/dialog.d.ts +31 -11
  27. package/dist/esm/dialog/dialog.js +41 -26
  28. package/dist/esm/dialog/dialog.js.map +1 -1
  29. package/dist/esm/dialog/dialog.template.js.map +1 -1
  30. package/dist/esm/dialog-body/dialog-body.js +1 -1
  31. package/dist/esm/dialog-body/dialog-body.js.map +1 -1
  32. package/dist/esm/drawer/drawer.d.ts +18 -9
  33. package/dist/esm/drawer/drawer.js +12 -7
  34. package/dist/esm/drawer/drawer.js.map +1 -1
  35. package/dist/esm/drawer-body/drawer-body.js +1 -1
  36. package/dist/esm/drawer-body/drawer-body.js.map +1 -1
  37. package/dist/esm/dropdown/dropdown.base.d.ts +1 -0
  38. package/dist/esm/dropdown/dropdown.base.js +24 -15
  39. package/dist/esm/dropdown/dropdown.base.js.map +1 -1
  40. package/dist/esm/index-rollup.d.ts +1 -2
  41. package/dist/esm/index-rollup.js +1 -2
  42. package/dist/esm/index-rollup.js.map +1 -1
  43. package/dist/esm/index.d.ts +2 -4
  44. package/dist/esm/index.js +0 -2
  45. package/dist/esm/index.js.map +1 -1
  46. package/dist/esm/listbox/listbox.d.ts +12 -7
  47. package/dist/esm/listbox/listbox.js +27 -17
  48. package/dist/esm/listbox/listbox.js.map +1 -1
  49. package/dist/esm/listbox/listbox.template.js +2 -3
  50. package/dist/esm/listbox/listbox.template.js.map +1 -1
  51. package/dist/esm/menu/menu.d.ts +7 -0
  52. package/dist/esm/menu/menu.js +22 -17
  53. package/dist/esm/menu/menu.js.map +1 -1
  54. package/dist/esm/menu-list/menu-list.js +4 -4
  55. package/dist/esm/menu-list/menu-list.js.map +1 -1
  56. package/dist/esm/message-bar/message-bar.d.ts +2 -1
  57. package/dist/esm/message-bar/message-bar.js +2 -1
  58. package/dist/esm/message-bar/message-bar.js.map +1 -1
  59. package/dist/esm/message-bar/message-bar.options.d.ts +6 -3
  60. package/dist/esm/message-bar/message-bar.options.js +6 -3
  61. package/dist/esm/message-bar/message-bar.options.js.map +1 -1
  62. package/dist/esm/option/option.js +1 -1
  63. package/dist/esm/option/option.js.map +1 -1
  64. package/dist/esm/progress-bar/progress-bar.base.d.ts +35 -8
  65. package/dist/esm/progress-bar/progress-bar.base.js +41 -20
  66. package/dist/esm/progress-bar/progress-bar.base.js.map +1 -1
  67. package/dist/esm/progress-bar/progress-bar.d.ts +8 -2
  68. package/dist/esm/progress-bar/progress-bar.js.map +1 -1
  69. package/dist/esm/radio/radio.options.d.ts +9 -0
  70. package/dist/esm/radio/radio.options.js +12 -1
  71. package/dist/esm/radio/radio.options.js.map +1 -1
  72. package/dist/esm/radio-group/radio-group.d.ts +13 -7
  73. package/dist/esm/radio-group/radio-group.js +14 -21
  74. package/dist/esm/radio-group/radio-group.js.map +1 -1
  75. package/dist/esm/radio-group/radio-group.template.js +2 -2
  76. package/dist/esm/radio-group/radio-group.template.js.map +1 -1
  77. package/dist/esm/rating-display/rating-display.base.d.ts +11 -1
  78. package/dist/esm/rating-display/rating-display.base.js +24 -11
  79. package/dist/esm/rating-display/rating-display.base.js.map +1 -1
  80. package/dist/esm/slider/slider.d.ts +7 -3
  81. package/dist/esm/slider/slider.js +46 -28
  82. package/dist/esm/slider/slider.js.map +1 -1
  83. package/dist/esm/styles/partials/badge.partials.d.ts +2 -1
  84. package/dist/esm/styles/partials/badge.partials.js +2 -1
  85. package/dist/esm/styles/partials/badge.partials.js.map +1 -1
  86. package/dist/esm/tab/tab.d.ts +13 -1
  87. package/dist/esm/tab/tab.js +16 -2
  88. package/dist/esm/tab/tab.js.map +1 -1
  89. package/dist/esm/tablist/tablist.base.d.ts +2 -1
  90. package/dist/esm/tablist/tablist.base.js +109 -95
  91. package/dist/esm/tablist/tablist.base.js.map +1 -1
  92. package/dist/esm/tablist/tablist.d.ts +2 -1
  93. package/dist/esm/tablist/tablist.js +2 -2
  94. package/dist/esm/tablist/tablist.js.map +1 -1
  95. package/dist/esm/text-input/text-input.base.js +12 -5
  96. package/dist/esm/text-input/text-input.base.js.map +1 -1
  97. package/dist/esm/text-input/text-input.template.d.ts +1 -1
  98. package/dist/esm/text-input/text-input.template.js +2 -8
  99. package/dist/esm/text-input/text-input.template.js.map +1 -1
  100. package/dist/esm/textarea/textarea.base.d.ts +12 -3
  101. package/dist/esm/textarea/textarea.base.js +42 -24
  102. package/dist/esm/textarea/textarea.base.js.map +1 -1
  103. package/dist/esm/textarea/textarea.template.js +1 -1
  104. package/dist/esm/textarea/textarea.template.js.map +1 -1
  105. package/dist/esm/theme/design-tokens.d.ts +115 -0
  106. package/dist/esm/theme/design-tokens.js +115 -0
  107. package/dist/esm/theme/design-tokens.js.map +1 -1
  108. package/dist/esm/theme/set-theme.d.ts +2 -2
  109. package/dist/esm/theme/set-theme.js +1 -1
  110. package/dist/esm/tree/tree.base.d.ts +9 -1
  111. package/dist/esm/tree/tree.base.js +17 -3
  112. package/dist/esm/tree/tree.base.js.map +1 -1
  113. package/dist/esm/tree/tree.d.ts +8 -2
  114. package/dist/esm/tree/tree.js +8 -2
  115. package/dist/esm/tree/tree.js.map +1 -1
  116. package/dist/esm/tree-item/tree-item.base.d.ts +15 -2
  117. package/dist/esm/tree-item/tree-item.base.js +22 -14
  118. package/dist/esm/tree-item/tree-item.base.js.map +1 -1
  119. package/dist/esm/utils/focusable-element.js +2 -1
  120. package/dist/esm/utils/focusable-element.js.map +1 -1
  121. package/dist/esm/utils/request-idle-callback.js +4 -9
  122. package/dist/esm/utils/request-idle-callback.js.map +1 -1
  123. package/dist/esm/utils/typings.d.ts +8 -0
  124. package/dist/esm/utils/typings.js +15 -1
  125. package/dist/esm/utils/typings.js.map +1 -1
  126. package/dist/web-components.d.ts +443 -318
  127. package/dist/web-components.js +1374 -1427
  128. package/dist/web-components.min.js +254 -248
  129. package/package.json +5 -6
  130. package/dist/esm/tab-panel/define.d.ts +0 -1
  131. package/dist/esm/tab-panel/define.js +0 -7
  132. package/dist/esm/tab-panel/define.js.map +0 -1
  133. package/dist/esm/tab-panel/index.d.ts +0 -4
  134. package/dist/esm/tab-panel/index.js +0 -5
  135. package/dist/esm/tab-panel/index.js.map +0 -1
  136. package/dist/esm/tab-panel/tab-panel.bench.d.ts +0 -3
  137. package/dist/esm/tab-panel/tab-panel.bench.js +0 -13
  138. package/dist/esm/tab-panel/tab-panel.bench.js.map +0 -1
  139. package/dist/esm/tab-panel/tab-panel.d.ts +0 -8
  140. package/dist/esm/tab-panel/tab-panel.definition.d.ts +0 -5
  141. package/dist/esm/tab-panel/tab-panel.definition.js +0 -13
  142. package/dist/esm/tab-panel/tab-panel.definition.js.map +0 -1
  143. package/dist/esm/tab-panel/tab-panel.js +0 -9
  144. package/dist/esm/tab-panel/tab-panel.js.map +0 -1
  145. package/dist/esm/tab-panel/tab-panel.styles.d.ts +0 -1
  146. package/dist/esm/tab-panel/tab-panel.styles.js +0 -12
  147. package/dist/esm/tab-panel/tab-panel.styles.js.map +0 -1
  148. package/dist/esm/tab-panel/tab-panel.template.d.ts +0 -7
  149. package/dist/esm/tab-panel/tab-panel.template.js +0 -13
  150. package/dist/esm/tab-panel/tab-panel.template.js.map +0 -1
  151. package/dist/esm/tabs/define.d.ts +0 -1
  152. package/dist/esm/tabs/define.js +0 -7
  153. package/dist/esm/tabs/define.js.map +0 -1
  154. package/dist/esm/tabs/index.d.ts +0 -6
  155. package/dist/esm/tabs/index.js +0 -6
  156. package/dist/esm/tabs/index.js.map +0 -1
  157. package/dist/esm/tabs/tabs.base.d.ts +0 -90
  158. package/dist/esm/tabs/tabs.base.js +0 -279
  159. package/dist/esm/tabs/tabs.base.js.map +0 -1
  160. package/dist/esm/tabs/tabs.bench.d.ts +0 -3
  161. package/dist/esm/tabs/tabs.bench.js +0 -32
  162. package/dist/esm/tabs/tabs.bench.js.map +0 -1
  163. package/dist/esm/tabs/tabs.d.ts +0 -100
  164. package/dist/esm/tabs/tabs.definition.d.ts +0 -5
  165. package/dist/esm/tabs/tabs.definition.js +0 -13
  166. package/dist/esm/tabs/tabs.definition.js.map +0 -1
  167. package/dist/esm/tabs/tabs.js +0 -180
  168. package/dist/esm/tabs/tabs.js.map +0 -1
  169. package/dist/esm/tabs/tabs.options.d.ts +0 -32
  170. package/dist/esm/tabs/tabs.options.js +0 -16
  171. package/dist/esm/tabs/tabs.options.js.map +0 -1
  172. package/dist/esm/tabs/tabs.styles.d.ts +0 -1
  173. package/dist/esm/tabs/tabs.styles.js +0 -230
  174. package/dist/esm/tabs/tabs.styles.js.map +0 -1
  175. package/dist/esm/tabs/tabs.template.d.ts +0 -8
  176. package/dist/esm/tabs/tabs.template.js +0 -19
  177. package/dist/esm/tabs/tabs.template.js.map +0 -1
@@ -3943,70 +3943,70 @@ const FASTElement = Object.assign(createFASTElement(HTMLElement), {
3943
3943
  compose
3944
3944
  });
3945
3945
 
3946
- var __defProp$R = Object.defineProperty;
3947
- var __getOwnPropDesc$R = Object.getOwnPropertyDescriptor;
3948
- var __decorateClass$R = (decorators, target, key, kind) => {
3949
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$R(target, key) : target;
3946
+ var __defProp$P = Object.defineProperty;
3947
+ var __getOwnPropDesc$P = Object.getOwnPropertyDescriptor;
3948
+ var __decorateClass$P = (decorators, target, key, kind) => {
3949
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$P(target, key) : target;
3950
3950
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
3951
- if (kind && result) __defProp$R(target, key, result);
3951
+ if (kind && result) __defProp$P(target, key, result);
3952
3952
  return result;
3953
3953
  };
3954
3954
  class ARIAGlobalStatesAndProperties {}
3955
- __decorateClass$R([attr({
3955
+ __decorateClass$P([attr({
3956
3956
  attribute: "aria-atomic"
3957
3957
  })], ARIAGlobalStatesAndProperties.prototype, "ariaAtomic", 2);
3958
- __decorateClass$R([attr({
3958
+ __decorateClass$P([attr({
3959
3959
  attribute: "aria-busy"
3960
3960
  })], ARIAGlobalStatesAndProperties.prototype, "ariaBusy", 2);
3961
- __decorateClass$R([attr({
3961
+ __decorateClass$P([attr({
3962
3962
  attribute: "aria-controls"
3963
3963
  })], ARIAGlobalStatesAndProperties.prototype, "ariaControls", 2);
3964
- __decorateClass$R([attr({
3964
+ __decorateClass$P([attr({
3965
3965
  attribute: "aria-current"
3966
3966
  })], ARIAGlobalStatesAndProperties.prototype, "ariaCurrent", 2);
3967
- __decorateClass$R([attr({
3967
+ __decorateClass$P([attr({
3968
3968
  attribute: "aria-describedby"
3969
3969
  })], ARIAGlobalStatesAndProperties.prototype, "ariaDescribedby", 2);
3970
- __decorateClass$R([attr({
3970
+ __decorateClass$P([attr({
3971
3971
  attribute: "aria-details"
3972
3972
  })], ARIAGlobalStatesAndProperties.prototype, "ariaDetails", 2);
3973
- __decorateClass$R([attr({
3973
+ __decorateClass$P([attr({
3974
3974
  attribute: "aria-disabled"
3975
3975
  })], ARIAGlobalStatesAndProperties.prototype, "ariaDisabled", 2);
3976
- __decorateClass$R([attr({
3976
+ __decorateClass$P([attr({
3977
3977
  attribute: "aria-errormessage"
3978
3978
  })], ARIAGlobalStatesAndProperties.prototype, "ariaErrormessage", 2);
3979
- __decorateClass$R([attr({
3979
+ __decorateClass$P([attr({
3980
3980
  attribute: "aria-flowto"
3981
3981
  })], ARIAGlobalStatesAndProperties.prototype, "ariaFlowto", 2);
3982
- __decorateClass$R([attr({
3982
+ __decorateClass$P([attr({
3983
3983
  attribute: "aria-haspopup"
3984
3984
  })], ARIAGlobalStatesAndProperties.prototype, "ariaHaspopup", 2);
3985
- __decorateClass$R([attr({
3985
+ __decorateClass$P([attr({
3986
3986
  attribute: "aria-hidden"
3987
3987
  })], ARIAGlobalStatesAndProperties.prototype, "ariaHidden", 2);
3988
- __decorateClass$R([attr({
3988
+ __decorateClass$P([attr({
3989
3989
  attribute: "aria-invalid"
3990
3990
  })], ARIAGlobalStatesAndProperties.prototype, "ariaInvalid", 2);
3991
- __decorateClass$R([attr({
3991
+ __decorateClass$P([attr({
3992
3992
  attribute: "aria-keyshortcuts"
3993
3993
  })], ARIAGlobalStatesAndProperties.prototype, "ariaKeyshortcuts", 2);
3994
- __decorateClass$R([attr({
3994
+ __decorateClass$P([attr({
3995
3995
  attribute: "aria-label"
3996
3996
  })], ARIAGlobalStatesAndProperties.prototype, "ariaLabel", 2);
3997
- __decorateClass$R([attr({
3997
+ __decorateClass$P([attr({
3998
3998
  attribute: "aria-labelledby"
3999
3999
  })], ARIAGlobalStatesAndProperties.prototype, "ariaLabelledby", 2);
4000
- __decorateClass$R([attr({
4000
+ __decorateClass$P([attr({
4001
4001
  attribute: "aria-live"
4002
4002
  })], ARIAGlobalStatesAndProperties.prototype, "ariaLive", 2);
4003
- __decorateClass$R([attr({
4003
+ __decorateClass$P([attr({
4004
4004
  attribute: "aria-owns"
4005
4005
  })], ARIAGlobalStatesAndProperties.prototype, "ariaOwns", 2);
4006
- __decorateClass$R([attr({
4006
+ __decorateClass$P([attr({
4007
4007
  attribute: "aria-relevant"
4008
4008
  })], ARIAGlobalStatesAndProperties.prototype, "ariaRelevant", 2);
4009
- __decorateClass$R([attr({
4009
+ __decorateClass$P([attr({
4010
4010
  attribute: "aria-roledescription"
4011
4011
  })], ARIAGlobalStatesAndProperties.prototype, "ariaRoledescription", 2);
4012
4012
 
@@ -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;
@@ -4273,12 +4282,12 @@ function applyMixins(derivedCtor, ...baseCtors) {
4273
4282
  });
4274
4283
  }
4275
4284
 
4276
- var __defProp$Q = Object.defineProperty;
4277
- var __getOwnPropDesc$Q = Object.getOwnPropertyDescriptor;
4278
- var __decorateClass$Q = (decorators, target, key, kind) => {
4279
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$Q(target, key) : target;
4285
+ var __defProp$O = Object.defineProperty;
4286
+ var __getOwnPropDesc$O = Object.getOwnPropertyDescriptor;
4287
+ var __decorateClass$O = (decorators, target, key, kind) => {
4288
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$O(target, key) : target;
4280
4289
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
4281
- if (kind && result) __defProp$Q(target, key, result);
4290
+ if (kind && result) __defProp$O(target, key, result);
4282
4291
  return result;
4283
4292
  };
4284
4293
  class BaseAccordionItem extends FASTElement {
@@ -4296,25 +4305,25 @@ class BaseAccordionItem extends FASTElement {
4296
4305
  this.id = uniqueId$1("accordion-");
4297
4306
  }
4298
4307
  }
4299
- __decorateClass$Q([attr({
4308
+ __decorateClass$O([attr({
4300
4309
  attribute: "heading-level",
4301
4310
  mode: "fromView",
4302
4311
  converter: nullableNumberConverter
4303
4312
  })], BaseAccordionItem.prototype, "headinglevel", 2);
4304
- __decorateClass$Q([attr({
4313
+ __decorateClass$O([attr({
4305
4314
  mode: "boolean"
4306
4315
  })], BaseAccordionItem.prototype, "expanded", 2);
4307
- __decorateClass$Q([attr({
4316
+ __decorateClass$O([attr({
4308
4317
  mode: "boolean"
4309
4318
  })], BaseAccordionItem.prototype, "disabled", 2);
4310
- __decorateClass$Q([attr], BaseAccordionItem.prototype, "id", 2);
4319
+ __decorateClass$O([attr], BaseAccordionItem.prototype, "id", 2);
4311
4320
 
4312
- var __defProp$P = Object.defineProperty;
4313
- var __getOwnPropDesc$P = Object.getOwnPropertyDescriptor;
4314
- var __decorateClass$P = (decorators, target, key, kind) => {
4315
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$P(target, key) : target;
4321
+ var __defProp$N = Object.defineProperty;
4322
+ var __getOwnPropDesc$N = Object.getOwnPropertyDescriptor;
4323
+ var __decorateClass$N = (decorators, target, key, kind) => {
4324
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$N(target, key) : target;
4316
4325
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
4317
- if (kind && result) __defProp$P(target, key, result);
4326
+ if (kind && result) __defProp$N(target, key, result);
4318
4327
  return result;
4319
4328
  };
4320
4329
  class AccordionItem extends BaseAccordionItem {
@@ -4323,11 +4332,11 @@ class AccordionItem extends BaseAccordionItem {
4323
4332
  this.block = false;
4324
4333
  }
4325
4334
  }
4326
- __decorateClass$P([attr], AccordionItem.prototype, "size", 2);
4327
- __decorateClass$P([attr({
4335
+ __decorateClass$N([attr], AccordionItem.prototype, "size", 2);
4336
+ __decorateClass$N([attr({
4328
4337
  attribute: "marker-position"
4329
4338
  })], AccordionItem.prototype, "markerPosition", 2);
4330
- __decorateClass$P([attr({
4339
+ __decorateClass$N([attr({
4331
4340
  mode: "boolean"
4332
4341
  })], AccordionItem.prototype, "block", 2);
4333
4342
  applyMixins(AccordionItem, StartEnd);
@@ -4578,7 +4587,7 @@ const curveEasyEaseMax = "var(--curveEasyEaseMax)";
4578
4587
  const curveEasyEase = "var(--curveEasyEase)";
4579
4588
  const curveLinear = "var(--curveLinear)";
4580
4589
 
4581
- const styles$G = css`
4590
+ const styles$E = css`
4582
4591
  ${display("block")}
4583
4592
 
4584
4593
  :host{max-width:fit-content;contain:content}.heading{height:44px;display:grid;position:relative;padding-inline:${spacingHorizontalM} ${spacingHorizontalMNudge};border-radius:${borderRadiusMedium};font-family:${fontFamilyBase};font-size:${fontSizeBase300};font-weight:${fontWeightRegular};line-height:${lineHeightBase300};grid-template-columns:auto auto 1fr auto}.button{appearance:none;background:${colorTransparentBackground};border:none;box-sizing:border-box;color:${colorNeutralForeground1};cursor:pointer;font:inherit;grid-column:auto / span 2;grid-row:1;height:44px;outline:none;padding:0;text-align:start}.button::before{content:'';position:absolute;inset:0px;cursor:pointer;border-radius:${borderRadiusSmall}}:where(.default-marker-collapsed,.default-marker-expanded),::slotted(:is([slot='marker-collapsed'],[slot='marker-expanded'])){display:flex;align-items:center;justify-content:center;pointer-events:none;position:relative;height:100%;padding-inline-end:${spacingHorizontalS};grid-column:1 / span 1;grid-row:1}.content{margin:0 ${spacingHorizontalM}}::slotted([slot='start']){display:flex;justify-content:center;align-items:center;padding-right:${spacingHorizontalS};grid-column:2 / span 1;grid-row:1}button:focus-visible::after{content:'';position:absolute;inset:0px;cursor:pointer;border-radius:${borderRadiusSmall};outline:none;border:2px solid ${colorStrokeFocus1};box-shadow:inset 0 0 0 1px ${colorStrokeFocus2}}:host([disabled]) .button{color:${colorNeutralForegroundDisabled}}:host([disabled]) svg{filter:invert(89%) sepia(0%) saturate(569%) hue-rotate(155deg) brightness(88%) contrast(87%)}:host([expanded]) .content{display:block}:host([expanded]) .default-marker-collapsed,:host([expanded]) ::slotted([slot='marker-collapsed']),:host(:not([expanded])) :is(.default-marker-expanded,.content),:host(:not([expanded])) ::slotted([slot='marker-expanded']){display:none}:host([expanded]) ::slotted([slot='marker-expanded']),:host(:not([expanded])) ::slotted([slot='marker-collapsed']){display:flex}.heading{font-size:${fontSizeBase300};line-height:${lineHeightBase300}}:host([size='small']) .heading{font-size:${fontSizeBase200};line-height:${lineHeightBase200}}:host([size='large']) .heading{font-size:${fontSizeBase400};line-height:${lineHeightBase400}}:host([size='extra-large']) .heading{font-size:${fontSizeBase500};line-height:${lineHeightBase500}}:host([marker-position='end']) ::slotted([slot='start']){grid-column:1 / span 1}:host([marker-position='end']) :is(.default-marker-collapsed,.default-marker-expanded){grid-column:4 / span 1;padding-inline-start:${spacingHorizontalS};padding-inline-end:0}:host([marker-position='end']) .button{grid-column:2 / span 3}:host([block]){max-width:100%}:host([marker-position='end']) .heading{grid-template-columns:auto auto 28px;padding-inline:${spacingHorizontalM}}:host([marker-position='end']:has([slot='start'])) .heading{padding-inline:${spacingHorizontalMNudge} ${spacingHorizontalM}}:host([block][marker-position='end']) .heading{grid-template-columns:auto 1fr}:host([marker-position='end']) :is(.default-marker-collapsed,.default-marker-expanded){grid-column:5 / span 1}`;
@@ -4614,30 +4623,30 @@ const chevronDown20Filled = html.partial(`<svg
4614
4623
  function accordionItemTemplate(options = {}) {
4615
4624
  return html`<div class="heading" part="heading" role="heading" aria-level="${x => x.headinglevel}"><button class="button" part="button" ${ref("expandbutton")} ?disabled="${x => x.disabled ? "true" : void 0}" aria-expanded="${x => x.expanded}" aria-controls="${x => x.id}-panel" id="${x => x.id}"><slot name="heading"></slot></button>${startSlotTemplate(options)}<slot name="marker-expanded">${staticallyCompose(options.expandedIcon)}</slot><slot name="marker-collapsed">${staticallyCompose(options.collapsedIcon)}</slot></div><div class="content" part="content" id="${x => x.id}-panel" role="region" aria-labelledby="${x => x.id}"><slot></slot></div>`;
4616
4625
  }
4617
- const template$H = accordionItemTemplate({
4626
+ const template$F = accordionItemTemplate({
4618
4627
  collapsedIcon: chevronRight20Filled,
4619
4628
  expandedIcon: chevronDown20Filled
4620
4629
  });
4621
4630
 
4622
- const definition$H = AccordionItem.compose({
4631
+ const definition$F = AccordionItem.compose({
4623
4632
  name: `${FluentDesignSystem.prefix}-accordion-item`,
4624
- template: template$H,
4625
- styles: styles$G
4633
+ template: template$F,
4634
+ styles: styles$E
4626
4635
  });
4627
4636
 
4628
- definition$H.define(FluentDesignSystem.registry);
4637
+ definition$F.define(FluentDesignSystem.registry);
4629
4638
 
4630
4639
  const AccordionExpandMode = {
4631
4640
  single: "single",
4632
4641
  multi: "multi"
4633
4642
  };
4634
4643
 
4635
- var __defProp$O = Object.defineProperty;
4636
- var __getOwnPropDesc$O = Object.getOwnPropertyDescriptor;
4637
- var __decorateClass$O = (decorators, target, key, kind) => {
4638
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$O(target, key) : target;
4644
+ var __defProp$M = Object.defineProperty;
4645
+ var __getOwnPropDesc$M = Object.getOwnPropertyDescriptor;
4646
+ var __decorateClass$M = (decorators, target, key, kind) => {
4647
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$M(target, key) : target;
4639
4648
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
4640
- if (kind && result) __defProp$O(target, key, result);
4649
+ if (kind && result) __defProp$M(target, key, result);
4641
4650
  return result;
4642
4651
  };
4643
4652
  class Accordion extends FASTElement {
@@ -4774,12 +4783,12 @@ class Accordion extends FASTElement {
4774
4783
  });
4775
4784
  }
4776
4785
  }
4777
- __decorateClass$O([attr({
4786
+ __decorateClass$M([attr({
4778
4787
  attribute: "expand-mode"
4779
4788
  })], Accordion.prototype, "expandmode", 2);
4780
- __decorateClass$O([observable], Accordion.prototype, "slottedAccordionItems", 2);
4789
+ __decorateClass$M([observable], Accordion.prototype, "slottedAccordionItems", 2);
4781
4790
 
4782
- const styles$F = css`
4791
+ const styles$D = css`
4783
4792
  ${display("flex")}
4784
4793
 
4785
4794
  :host{flex-direction:column;width:100%;contain:content}`;
@@ -4790,15 +4799,15 @@ function accordionTemplate() {
4790
4799
  filter: elements()
4791
4800
  })}></slot></template>`;
4792
4801
  }
4793
- const template$G = accordionTemplate();
4802
+ const template$E = accordionTemplate();
4794
4803
 
4795
- const definition$G = Accordion.compose({
4804
+ const definition$E = Accordion.compose({
4796
4805
  name: `${FluentDesignSystem.prefix}-accordion`,
4797
- template: template$G,
4798
- styles: styles$F
4806
+ template: template$E,
4807
+ styles: styles$D
4799
4808
  });
4800
4809
 
4801
- definition$G.define(FluentDesignSystem.registry);
4810
+ definition$E.define(FluentDesignSystem.registry);
4802
4811
 
4803
4812
  const statesMap = /* @__PURE__ */new Map();
4804
4813
  function stateSelector(state) {
@@ -4873,12 +4882,12 @@ const AnchorAttributes = {
4873
4882
  type: "type"
4874
4883
  };
4875
4884
 
4876
- var __defProp$N = Object.defineProperty;
4877
- var __getOwnPropDesc$N = Object.getOwnPropertyDescriptor;
4878
- var __decorateClass$N = (decorators, target, key, kind) => {
4879
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$N(target, key) : target;
4885
+ var __defProp$L = Object.defineProperty;
4886
+ var __getOwnPropDesc$L = Object.getOwnPropertyDescriptor;
4887
+ var __decorateClass$L = (decorators, target, key, kind) => {
4888
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$L(target, key) : target;
4880
4889
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
4881
- if (kind && result) __defProp$N(target, key, result);
4890
+ if (kind && result) __defProp$L(target, key, result);
4882
4891
  return result;
4883
4892
  };
4884
4893
  class BaseAnchor extends FASTElement {
@@ -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);
@@ -4937,6 +4947,9 @@ class BaseAnchor extends FASTElement {
4937
4947
  clickHandler(e) {
4938
4948
  if (this.href) {
4939
4949
  const newTab = !this.isMac ? e.ctrlKey : e.metaKey;
4950
+ if (newTab) {
4951
+ e.preventDefault();
4952
+ }
4940
4953
  this.handleNavigation(newTab);
4941
4954
  }
4942
4955
  return true;
@@ -4986,21 +4999,21 @@ class BaseAnchor extends FASTElement {
4986
4999
  return proxy;
4987
5000
  }
4988
5001
  }
4989
- __decorateClass$N([attr], BaseAnchor.prototype, "download", 2);
4990
- __decorateClass$N([attr], BaseAnchor.prototype, "href", 2);
4991
- __decorateClass$N([attr], BaseAnchor.prototype, "hreflang", 2);
4992
- __decorateClass$N([attr], BaseAnchor.prototype, "ping", 2);
4993
- __decorateClass$N([attr], BaseAnchor.prototype, "referrerpolicy", 2);
4994
- __decorateClass$N([attr], BaseAnchor.prototype, "rel", 2);
4995
- __decorateClass$N([attr], BaseAnchor.prototype, "target", 2);
4996
- __decorateClass$N([attr], BaseAnchor.prototype, "type", 2);
5002
+ __decorateClass$L([attr], BaseAnchor.prototype, "download", 2);
5003
+ __decorateClass$L([attr], BaseAnchor.prototype, "href", 2);
5004
+ __decorateClass$L([attr], BaseAnchor.prototype, "hreflang", 2);
5005
+ __decorateClass$L([attr], BaseAnchor.prototype, "ping", 2);
5006
+ __decorateClass$L([attr], BaseAnchor.prototype, "referrerpolicy", 2);
5007
+ __decorateClass$L([attr], BaseAnchor.prototype, "rel", 2);
5008
+ __decorateClass$L([attr], BaseAnchor.prototype, "target", 2);
5009
+ __decorateClass$L([attr], BaseAnchor.prototype, "type", 2);
4997
5010
 
4998
- var __defProp$M = Object.defineProperty;
4999
- var __getOwnPropDesc$M = Object.getOwnPropertyDescriptor;
5000
- var __decorateClass$M = (decorators, target, key, kind) => {
5001
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$M(target, key) : target;
5011
+ var __defProp$K = Object.defineProperty;
5012
+ var __getOwnPropDesc$K = Object.getOwnPropertyDescriptor;
5013
+ var __decorateClass$K = (decorators, target, key, kind) => {
5014
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$K(target, key) : target;
5002
5015
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
5003
- if (kind && result) __defProp$M(target, key, result);
5016
+ if (kind && result) __defProp$K(target, key, result);
5004
5017
  return result;
5005
5018
  };
5006
5019
  class AnchorButton extends BaseAnchor {
@@ -5041,10 +5054,10 @@ class AnchorButton extends BaseAnchor {
5041
5054
  toggleState(this.elementInternals, "icon", !!next);
5042
5055
  }
5043
5056
  }
5044
- __decorateClass$M([attr], AnchorButton.prototype, "appearance", 2);
5045
- __decorateClass$M([attr], AnchorButton.prototype, "shape", 2);
5046
- __decorateClass$M([attr], AnchorButton.prototype, "size", 2);
5047
- __decorateClass$M([attr({
5057
+ __decorateClass$K([attr], AnchorButton.prototype, "appearance", 2);
5058
+ __decorateClass$K([attr], AnchorButton.prototype, "shape", 2);
5059
+ __decorateClass$K([attr], AnchorButton.prototype, "size", 2);
5060
+ __decorateClass$K([attr({
5048
5061
  attribute: "icon-only",
5049
5062
  mode: "boolean"
5050
5063
  })], AnchorButton.prototype, "iconOnly", 2);
@@ -5054,13 +5067,13 @@ const baseButtonStyles = css`
5054
5067
  ${display("inline-flex")}
5055
5068
 
5056
5069
  :host{--icon-spacing:${spacingHorizontalSNudge};position:relative;contain:layout style;vertical-align:middle;align-items:center;box-sizing:border-box;justify-content:center;text-align:center;text-decoration-line:none;margin:0;min-height:32px;outline-style:none;background-color:${colorNeutralBackground1};color:${colorNeutralForeground1};border:${strokeWidthThin} solid ${colorNeutralStroke1};padding:0 ${spacingHorizontalM};min-width:96px;border-radius:${borderRadiusMedium};font-size:${fontSizeBase300};font-family:${fontFamilyBase};font-weight:${fontWeightSemibold};line-height:${lineHeightBase300};transition-duration:${durationFaster};transition-property:background,border,color;transition-timing-function:${curveEasyEase};cursor:pointer;user-select:none}.content{display:inherit}:host(:hover){background-color:${colorNeutralBackground1Hover};color:${colorNeutralForeground1Hover};border-color:${colorNeutralStroke1Hover}}:host(:hover:active){background-color:${colorNeutralBackground1Pressed};border-color:${colorNeutralStroke1Pressed};color:${colorNeutralForeground1Pressed};outline-style:none}:host(:focus-visible){border-color:${colorTransparentStroke};outline:${strokeWidthThick} solid ${colorTransparentStroke};box-shadow:${shadow4},0 0 0 2px ${colorStrokeFocus2}}@media screen and (prefers-reduced-motion:reduce){:host{transition-duration:0.01ms}}::slotted(svg){font-size:20px;height:20px;width:20px;fill:currentColor}::slotted([slot='start']){margin-inline-end:var(--icon-spacing)}::slotted([slot='end']),[slot='end']{flex-shrink:0;margin-inline-start:var(--icon-spacing)}:host([icon-only]){min-width:32px;max-width:32px}:host([size='small']){--icon-spacing:${spacingHorizontalXS};min-height:24px;min-width:64px;padding:0 ${spacingHorizontalS};border-radius:${borderRadiusSmall};font-size:${fontSizeBase200};line-height:${lineHeightBase200};font-weight:${fontWeightRegular}}:host([size='small'][icon-only]){min-width:24px;max-width:24px}:host([size='large']){min-height:40px;border-radius:${borderRadiusLarge};padding:0 ${spacingHorizontalL};font-size:${fontSizeBase400};line-height:${lineHeightBase400}}:host([size='large'][icon-only]){min-width:40px;max-width:40px}:host([size='large']) ::slotted(svg){font-size:24px;height:24px;width:24px}:host(:is([shape='circular'],[shape='circular']:focus-visible)){border-radius:${borderRadiusCircular}}:host(:is([shape='square'],[shape='square']:focus-visible)){border-radius:${borderRadiusNone}}:host([appearance='primary']){background-color:${colorBrandBackground};color:${colorNeutralForegroundOnBrand};border-color:transparent}:host([appearance='primary']:hover){background-color:${colorBrandBackgroundHover}}:host([appearance='primary']:is(:hover,:hover:active):not(:focus-visible)){border-color:transparent}:host([appearance='primary']:is(:hover,:hover:active)){color:${colorNeutralForegroundOnBrand}}:host([appearance='primary']:hover:active){background-color:${colorBrandBackgroundPressed}}:host([appearance='primary']:focus-visible){border-color:${colorNeutralForegroundOnBrand};box-shadow:${shadow2},0 0 0 2px ${colorStrokeFocus2}}:host([appearance='outline']){background-color:${colorTransparentBackground}}:host([appearance='outline']:hover){background-color:${colorTransparentBackgroundHover}}:host([appearance='outline']:hover:active){background-color:${colorTransparentBackgroundPressed}}:host([appearance='subtle']){background-color:${colorSubtleBackground};color:${colorNeutralForeground2};border-color:transparent}:host([appearance='subtle']:hover){background-color:${colorSubtleBackgroundHover};color:${colorNeutralForeground2Hover};border-color:transparent}:host([appearance='subtle']:hover:active){background-color:${colorSubtleBackgroundPressed};color:${colorNeutralForeground2Pressed};border-color:transparent}:host([appearance='subtle']:hover) ::slotted(svg){fill:${colorNeutralForeground2BrandHover}}:host([appearance='subtle']:hover:active) ::slotted(svg){fill:${colorNeutralForeground2BrandPressed}}:host([appearance='transparent']){background-color:${colorTransparentBackground};color:${colorNeutralForeground2}}:host([appearance='transparent']:hover){background-color:${colorTransparentBackgroundHover};color:${colorNeutralForeground2BrandHover}}:host([appearance='transparent']:hover:active){background-color:${colorTransparentBackgroundPressed};color:${colorNeutralForeground2BrandPressed}}:host(:is([appearance='transparent'],[appearance='transparent']:is(:hover,:active))){border-color:transparent}`;
5057
- const styles$E = css`
5070
+ const styles$C = css`
5058
5071
  ${baseButtonStyles}
5059
5072
 
5060
5073
  :host(:is(:disabled,[disabled-focusable],[appearance]:disabled,[appearance][disabled-focusable])),:host(:is(:disabled,[disabled-focusable],[appearance]:disabled,[appearance][disabled-focusable]):hover),:host(:is(:disabled,[disabled-focusable],[appearance]:disabled,[appearance][disabled-focusable]):hover:active){background-color:${colorNeutralBackgroundDisabled};border-color:${colorNeutralStrokeDisabled};color:${colorNeutralForegroundDisabled};cursor:not-allowed}:host([appearance='primary']:is(:disabled,[disabled-focusable])),:host([appearance='primary']:is(:disabled,[disabled-focusable]):is(:hover,:hover:active)){border-color:transparent}:host([appearance='outline']:is(:disabled,[disabled-focusable])),:host([appearance='outline']:is(:disabled,[disabled-focusable]):is(:hover,:hover:active)){background-color:${colorTransparentBackground}}:host([appearance='subtle']:is(:disabled,[disabled-focusable])),:host([appearance='subtle']:is(:disabled,[disabled-focusable]):is(:hover,:hover:active)){background-color:${colorTransparentBackground};border-color:transparent}:host([appearance='transparent']:is(:disabled,[disabled-focusable])),:host([appearance='transparent']:is(:disabled,[disabled-focusable]):is(:hover,:hover:active)){border-color:transparent;background-color:${colorTransparentBackground}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
5061
5074
  :host{background-color:ButtonFace;color:ButtonText}:host(:is(:hover,:focus-visible)){border-color:Highlight !important}:host([appearance='primary']:not(:is(:hover,:focus-visible))){background-color:Highlight;color:HighlightText;forced-color-adjust:none}:host(:is(:disabled,[disabled-focusable],[appearance]:disabled,[appearance][disabled-focusable])){background-color:ButtonFace;color:GrayText;border-color:ButtonText}`));
5062
5075
 
5063
- const styles$D = css`
5076
+ const styles$B = css`
5064
5077
  ${baseButtonStyles}
5065
5078
 
5066
5079
  ::slotted(a){position:absolute;inset:0}`.withBehaviors(forcedColorsStylesheetBehavior(css`
@@ -5069,15 +5082,15 @@ const styles$D = css`
5069
5082
  function anchorTemplate$1(options = {}) {
5070
5083
  return html`<template tabindex="0" @click="${(x, c) => x.clickHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}">${startSlotTemplate(options)}<span class="content" part="content"><slot></slot></span>${endSlotTemplate(options)}</template>`;
5071
5084
  }
5072
- const template$F = anchorTemplate$1();
5085
+ const template$D = anchorTemplate$1();
5073
5086
 
5074
- const definition$F = AnchorButton.compose({
5087
+ const definition$D = AnchorButton.compose({
5075
5088
  name: `${FluentDesignSystem.prefix}-anchor-button`,
5076
- template: template$F,
5077
- styles: styles$D
5089
+ template: template$D,
5090
+ styles: styles$B
5078
5091
  });
5079
5092
 
5080
- definition$F.define(FluentDesignSystem.registry);
5093
+ definition$D.define(FluentDesignSystem.registry);
5081
5094
 
5082
5095
  const UNWANTED_ENCLOSURES_REGEX = /[\(\[\{][^\)\]\}]*[\)\]\}]/g;
5083
5096
  const UNWANTED_CHARS_REGEX = /[\0-\u001F\!-/:-@\[-`\{-\u00BF\u0250-\u036F\uD800-\uFFFF]/g;
@@ -5120,17 +5133,18 @@ function getInitials(displayName, isRtl, options) {
5120
5133
  return getInitialsLatin(displayName, isRtl, options?.firstInitialOnly);
5121
5134
  }
5122
5135
 
5123
- var __defProp$L = Object.defineProperty;
5124
- var __getOwnPropDesc$L = Object.getOwnPropertyDescriptor;
5125
- var __decorateClass$L = (decorators, target, key, kind) => {
5126
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$L(target, key) : target;
5136
+ var __defProp$J = Object.defineProperty;
5137
+ var __getOwnPropDesc$J = Object.getOwnPropertyDescriptor;
5138
+ var __decorateClass$J = (decorators, target, key, kind) => {
5139
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$J(target, key) : target;
5127
5140
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
5128
- if (kind && result) __defProp$L(target, key, result);
5141
+ if (kind && result) __defProp$J(target, key, result);
5129
5142
  return result;
5130
5143
  };
5131
5144
  class BaseAvatar extends FASTElement {
5132
5145
  constructor() {
5133
5146
  super();
5147
+ this.slottedDefaults = [];
5134
5148
  /**
5135
5149
  * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
5136
5150
  *
@@ -5139,9 +5153,105 @@ class BaseAvatar extends FASTElement {
5139
5153
  this.elementInternals = this.attachInternals();
5140
5154
  this.elementInternals.role = "img";
5141
5155
  }
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
+ });
5174
+ }
5175
+ /**
5176
+ * Updates the monogram text content when the ref is captured.
5177
+ *
5178
+ * @internal
5179
+ */
5180
+ monogramChanged() {
5181
+ this.updateMonogram();
5182
+ }
5183
+ /**
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.
5233
+ *
5234
+ * @internal
5235
+ */
5236
+ cleanupSlottedContent() {
5237
+ this.normalize();
5238
+ if (!CSS.supports("selector(:has-slotted)")) {
5239
+ this.defaultSlot.classList.toggle("has-slotted", !!this.slottedDefaults.length);
5240
+ }
5241
+ if (!this.innerText.trim()) {
5242
+ this.slottedDefaults.forEach(node => {
5243
+ if (node.nodeType === Node.TEXT_NODE) {
5244
+ node.remove();
5245
+ }
5246
+ });
5247
+ }
5248
+ }
5142
5249
  }
5143
- __decorateClass$L([attr], BaseAvatar.prototype, "name", 2);
5144
- __decorateClass$L([attr], BaseAvatar.prototype, "initials", 2);
5250
+ __decorateClass$J([observable], BaseAvatar.prototype, "defaultSlot", 2);
5251
+ __decorateClass$J([observable], BaseAvatar.prototype, "monogram", 2);
5252
+ __decorateClass$J([observable], BaseAvatar.prototype, "slottedDefaults", 2);
5253
+ __decorateClass$J([attr], BaseAvatar.prototype, "name", 2);
5254
+ __decorateClass$J([attr], BaseAvatar.prototype, "initials", 2);
5145
5255
 
5146
5256
  const AvatarNamedColor = {
5147
5257
  darkRed: "dark-red",
@@ -5182,12 +5292,12 @@ const AvatarColor = {
5182
5292
  ...AvatarNamedColor
5183
5293
  };
5184
5294
 
5185
- var __defProp$K = Object.defineProperty;
5186
- var __getOwnPropDesc$K = Object.getOwnPropertyDescriptor;
5187
- var __decorateClass$K = (decorators, target, key, kind) => {
5188
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$K(target, key) : target;
5295
+ var __defProp$I = Object.defineProperty;
5296
+ var __getOwnPropDesc$I = Object.getOwnPropertyDescriptor;
5297
+ var __decorateClass$I = (decorators, target, key, kind) => {
5298
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$I(target, key) : target;
5189
5299
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
5190
- if (kind && result) __defProp$K(target, key, result);
5300
+ if (kind && result) __defProp$I(target, key, result);
5191
5301
  return result;
5192
5302
  };
5193
5303
  const _Avatar = class _Avatar extends BaseAvatar {
@@ -5214,7 +5324,7 @@ const _Avatar = class _Avatar extends BaseAvatar {
5214
5324
  return;
5215
5325
  }
5216
5326
  const size = this.size ?? 32;
5217
- return this.initials ?? getInitials(this.name, window.getComputedStyle(this).direction === "rtl", {
5327
+ return this.initials || getInitials(this.name, window.getComputedStyle(this).direction === "rtl", {
5218
5328
  firstInitialOnly: size <= 16
5219
5329
  });
5220
5330
  }
@@ -5242,14 +5352,14 @@ const _Avatar = class _Avatar extends BaseAvatar {
5242
5352
  * An array of the available Avatar named colors
5243
5353
  */
5244
5354
  _Avatar.colors = Object.values(AvatarNamedColor);
5245
- __decorateClass$K([attr], _Avatar.prototype, "active", 2);
5246
- __decorateClass$K([attr], _Avatar.prototype, "shape", 2);
5247
- __decorateClass$K([attr], _Avatar.prototype, "appearance", 2);
5248
- __decorateClass$K([attr({
5355
+ __decorateClass$I([attr], _Avatar.prototype, "active", 2);
5356
+ __decorateClass$I([attr], _Avatar.prototype, "shape", 2);
5357
+ __decorateClass$I([attr], _Avatar.prototype, "appearance", 2);
5358
+ __decorateClass$I([attr({
5249
5359
  converter: nullableNumberConverter
5250
5360
  })], _Avatar.prototype, "size", 2);
5251
- __decorateClass$K([attr], _Avatar.prototype, "color", 2);
5252
- __decorateClass$K([attr({
5361
+ __decorateClass$I([attr], _Avatar.prototype, "color", 2);
5362
+ __decorateClass$I([attr({
5253
5363
  attribute: "color-id"
5254
5364
  })], _Avatar.prototype, "colorId", 2);
5255
5365
  let Avatar = _Avatar;
@@ -5274,22 +5384,22 @@ const animations = {
5274
5384
  normalEase: curveEasyEase,
5275
5385
  nullEasing: curveLinear
5276
5386
  };
5277
- const styles$C = css`
5278
- ${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}}`;
5387
+ const styles$A = css`
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}}`;
5279
5389
 
5280
- 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>`;
5281
5391
  function avatarTemplate() {
5282
- return html`<slot>${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>`;
5283
5393
  }
5284
- const template$E = avatarTemplate();
5394
+ const template$C = avatarTemplate();
5285
5395
 
5286
- const definition$E = Avatar.compose({
5396
+ const definition$C = Avatar.compose({
5287
5397
  name: `${FluentDesignSystem.prefix}-avatar`,
5288
- template: template$E,
5289
- styles: styles$C
5398
+ template: template$C,
5399
+ styles: styles$A
5290
5400
  });
5291
5401
 
5292
- definition$E.define(FluentDesignSystem.registry);
5402
+ definition$C.define(FluentDesignSystem.registry);
5293
5403
 
5294
5404
  const BadgeAppearance = {
5295
5405
  filled: "filled",
@@ -5308,12 +5418,12 @@ const BadgeColor = {
5308
5418
  warning: "warning"
5309
5419
  };
5310
5420
 
5311
- var __defProp$J = Object.defineProperty;
5312
- var __getOwnPropDesc$J = Object.getOwnPropertyDescriptor;
5313
- var __decorateClass$J = (decorators, target, key, kind) => {
5314
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$J(target, key) : target;
5421
+ var __defProp$H = Object.defineProperty;
5422
+ var __getOwnPropDesc$H = Object.getOwnPropertyDescriptor;
5423
+ var __decorateClass$H = (decorators, target, key, kind) => {
5424
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$H(target, key) : target;
5315
5425
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
5316
- if (kind && result) __defProp$J(target, key, result);
5426
+ if (kind && result) __defProp$H(target, key, result);
5317
5427
  return result;
5318
5428
  };
5319
5429
  class Badge extends FASTElement {
@@ -5323,10 +5433,10 @@ class Badge extends FASTElement {
5323
5433
  this.color = BadgeColor.brand;
5324
5434
  }
5325
5435
  }
5326
- __decorateClass$J([attr], Badge.prototype, "appearance", 2);
5327
- __decorateClass$J([attr], Badge.prototype, "color", 2);
5328
- __decorateClass$J([attr], Badge.prototype, "shape", 2);
5329
- __decorateClass$J([attr], Badge.prototype, "size", 2);
5436
+ __decorateClass$H([attr], Badge.prototype, "appearance", 2);
5437
+ __decorateClass$H([attr], Badge.prototype, "color", 2);
5438
+ __decorateClass$H([attr], Badge.prototype, "shape", 2);
5439
+ __decorateClass$H([attr], Badge.prototype, "size", 2);
5330
5440
  applyMixins(Badge, StartEnd);
5331
5441
 
5332
5442
  const badgeBaseStyles = css.partial`
@@ -5680,7 +5790,7 @@ css.partial`
5680
5790
  font-weight: ${fontWeightSemibold};
5681
5791
  `;
5682
5792
 
5683
- const styles$B = css`
5793
+ const styles$z = css`
5684
5794
  :host([shape='square']){border-radius:${borderRadiusNone}}:host([shape='rounded']){border-radius:${borderRadiusMedium}}:host([shape='rounded']:is([size='tiny'],[size='extra-small'],[size='small'])){border-radius:${borderRadiusSmall}}${badgeTintStyles}
5685
5795
  ${badgeOutlineStyles}
5686
5796
  ${badgeGhostStyles}
@@ -5693,28 +5803,27 @@ const styles$B = css`
5693
5803
  function badgeTemplate(options = {}) {
5694
5804
  return html` ${startSlotTemplate(options)}<slot>${staticallyCompose(options.defaultContent)}</slot>${endSlotTemplate(options)} `;
5695
5805
  }
5696
- const template$D = badgeTemplate();
5806
+ const template$B = badgeTemplate();
5697
5807
 
5698
- const definition$D = Badge.compose({
5808
+ const definition$B = Badge.compose({
5699
5809
  name: `${FluentDesignSystem.prefix}-badge`,
5700
- template: template$D,
5701
- styles: styles$B
5810
+ template: template$B,
5811
+ styles: styles$z
5702
5812
  });
5703
5813
 
5704
- definition$D.define(FluentDesignSystem.registry);
5814
+ definition$B.define(FluentDesignSystem.registry);
5705
5815
 
5706
- var __defProp$I = Object.defineProperty;
5707
- var __getOwnPropDesc$I = Object.getOwnPropertyDescriptor;
5708
- var __decorateClass$I = (decorators, target, key, kind) => {
5709
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$I(target, key) : target;
5816
+ var __defProp$G = Object.defineProperty;
5817
+ var __getOwnPropDesc$G = Object.getOwnPropertyDescriptor;
5818
+ var __decorateClass$G = (decorators, target, key, kind) => {
5819
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$G(target, key) : target;
5710
5820
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
5711
- if (kind && result) __defProp$I(target, key, result);
5821
+ if (kind && result) __defProp$G(target, key, result);
5712
5822
  return result;
5713
5823
  };
5714
5824
  class BaseButton extends FASTElement {
5715
5825
  constructor() {
5716
5826
  super();
5717
- this.disabled = false;
5718
5827
  this.disabledFocusable = false;
5719
5828
  /**
5720
5829
  * The internal {@link https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
@@ -5724,15 +5833,16 @@ class BaseButton extends FASTElement {
5724
5833
  this.elementInternals = this.attachInternals();
5725
5834
  this.elementInternals.role = "button";
5726
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
+ */
5727
5844
  disabledChanged() {
5728
- if (!this.$fastController.isConnected) {
5729
- return;
5730
- }
5731
- if (this.disabled) {
5732
- this.removeAttribute("tabindex");
5733
- } else {
5734
- this.tabIndex = Number(this.getAttribute("tabindex") ?? 0) < 0 ? -1 : 0;
5735
- }
5845
+ this.setTabIndex();
5736
5846
  }
5737
5847
  /**
5738
5848
  * Sets the element's internal disabled state when the element is focusable while disabled.
@@ -5742,7 +5852,7 @@ class BaseButton extends FASTElement {
5742
5852
  * @internal
5743
5853
  */
5744
5854
  disabledFocusableChanged(previous, next) {
5745
- if (this.$fastController.isConnected) {
5855
+ if (this.elementInternals) {
5746
5856
  this.elementInternals.ariaDisabled = `${!!next}`;
5747
5857
  }
5748
5858
  }
@@ -5792,7 +5902,7 @@ class BaseButton extends FASTElement {
5792
5902
  connectedCallback() {
5793
5903
  super.connectedCallback();
5794
5904
  this.elementInternals.ariaDisabled = `${!!this.disabledFocusable}`;
5795
- this.disabledChanged();
5905
+ this.setTabIndex();
5796
5906
  }
5797
5907
  /**
5798
5908
  * This fallback creates a new slot, then creates a submit button to mirror the custom element's
@@ -5893,6 +6003,18 @@ class BaseButton extends FASTElement {
5893
6003
  resetForm() {
5894
6004
  this.elementInternals.form?.reset();
5895
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
+ }
5896
6018
  /**
5897
6019
  * Submits the associated form.
5898
6020
  *
@@ -5923,46 +6045,46 @@ class BaseButton extends FASTElement {
5923
6045
  * @public
5924
6046
  */
5925
6047
  BaseButton.formAssociated = true;
5926
- __decorateClass$I([attr({
6048
+ __decorateClass$G([attr({
5927
6049
  mode: "boolean"
5928
6050
  })], BaseButton.prototype, "autofocus", 2);
5929
- __decorateClass$I([observable], BaseButton.prototype, "defaultSlottedContent", 2);
5930
- __decorateClass$I([attr({
6051
+ __decorateClass$G([observable], BaseButton.prototype, "defaultSlottedContent", 2);
6052
+ __decorateClass$G([attr({
5931
6053
  mode: "boolean"
5932
6054
  })], BaseButton.prototype, "disabled", 2);
5933
- __decorateClass$I([attr({
6055
+ __decorateClass$G([attr({
5934
6056
  attribute: "disabled-focusable",
5935
6057
  mode: "boolean"
5936
6058
  })], BaseButton.prototype, "disabledFocusable", 2);
5937
- __decorateClass$I([attr({
6059
+ __decorateClass$G([attr({
5938
6060
  attribute: "formaction"
5939
6061
  })], BaseButton.prototype, "formAction", 2);
5940
- __decorateClass$I([attr({
6062
+ __decorateClass$G([attr({
5941
6063
  attribute: "form"
5942
6064
  })], BaseButton.prototype, "formAttribute", 2);
5943
- __decorateClass$I([attr({
6065
+ __decorateClass$G([attr({
5944
6066
  attribute: "formenctype"
5945
6067
  })], BaseButton.prototype, "formEnctype", 2);
5946
- __decorateClass$I([attr({
6068
+ __decorateClass$G([attr({
5947
6069
  attribute: "formmethod"
5948
6070
  })], BaseButton.prototype, "formMethod", 2);
5949
- __decorateClass$I([attr({
6071
+ __decorateClass$G([attr({
5950
6072
  attribute: "formnovalidate",
5951
6073
  mode: "boolean"
5952
6074
  })], BaseButton.prototype, "formNoValidate", 2);
5953
- __decorateClass$I([attr({
6075
+ __decorateClass$G([attr({
5954
6076
  attribute: "formtarget"
5955
6077
  })], BaseButton.prototype, "formTarget", 2);
5956
- __decorateClass$I([attr], BaseButton.prototype, "name", 2);
5957
- __decorateClass$I([attr], BaseButton.prototype, "type", 2);
5958
- __decorateClass$I([attr], BaseButton.prototype, "value", 2);
6078
+ __decorateClass$G([attr], BaseButton.prototype, "name", 2);
6079
+ __decorateClass$G([attr], BaseButton.prototype, "type", 2);
6080
+ __decorateClass$G([attr], BaseButton.prototype, "value", 2);
5959
6081
 
5960
- var __defProp$H = Object.defineProperty;
5961
- var __getOwnPropDesc$H = Object.getOwnPropertyDescriptor;
5962
- var __decorateClass$H = (decorators, target, key, kind) => {
5963
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$H(target, key) : target;
6082
+ var __defProp$F = Object.defineProperty;
6083
+ var __getOwnPropDesc$F = Object.getOwnPropertyDescriptor;
6084
+ var __decorateClass$F = (decorators, target, key, kind) => {
6085
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$F(target, key) : target;
5964
6086
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
5965
- if (kind && result) __defProp$H(target, key, result);
6087
+ if (kind && result) __defProp$F(target, key, result);
5966
6088
  return result;
5967
6089
  };
5968
6090
  class Button extends BaseButton {
@@ -5971,10 +6093,10 @@ class Button extends BaseButton {
5971
6093
  this.iconOnly = false;
5972
6094
  }
5973
6095
  }
5974
- __decorateClass$H([attr], Button.prototype, "appearance", 2);
5975
- __decorateClass$H([attr], Button.prototype, "shape", 2);
5976
- __decorateClass$H([attr], Button.prototype, "size", 2);
5977
- __decorateClass$H([attr({
6096
+ __decorateClass$F([attr], Button.prototype, "appearance", 2);
6097
+ __decorateClass$F([attr], Button.prototype, "shape", 2);
6098
+ __decorateClass$F([attr], Button.prototype, "size", 2);
6099
+ __decorateClass$F([attr({
5978
6100
  attribute: "icon-only",
5979
6101
  mode: "boolean"
5980
6102
  })], Button.prototype, "iconOnly", 2);
@@ -5983,22 +6105,22 @@ applyMixins(Button, StartEnd);
5983
6105
  function buttonTemplate$1(options = {}) {
5984
6106
  return html`<template @click="${(x, c) => x.clickHandler(c.event)}" @keypress="${(x, c) => x.keypressHandler(c.event)}">${startSlotTemplate(options)}<span class="content" part="content"><slot ${slotted("defaultSlottedContent")}></slot></span>${endSlotTemplate(options)}</template>`;
5985
6107
  }
5986
- const template$C = buttonTemplate$1();
6108
+ const template$A = buttonTemplate$1();
5987
6109
 
5988
- const definition$C = Button.compose({
6110
+ const definition$A = Button.compose({
5989
6111
  name: `${FluentDesignSystem.prefix}-button`,
5990
- template: template$C,
5991
- styles: styles$E
6112
+ template: template$A,
6113
+ styles: styles$C
5992
6114
  });
5993
6115
 
5994
- definition$C.define(FluentDesignSystem.registry);
6116
+ definition$A.define(FluentDesignSystem.registry);
5995
6117
 
5996
- var __defProp$G = Object.defineProperty;
5997
- var __getOwnPropDesc$G = Object.getOwnPropertyDescriptor;
5998
- var __decorateClass$G = (decorators, target, key, kind) => {
5999
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$G(target, key) : target;
6118
+ var __defProp$E = Object.defineProperty;
6119
+ var __getOwnPropDesc$E = Object.getOwnPropertyDescriptor;
6120
+ var __decorateClass$E = (decorators, target, key, kind) => {
6121
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$E(target, key) : target;
6000
6122
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6001
- if (kind && result) __defProp$G(target, key, result);
6123
+ if (kind && result) __defProp$E(target, key, result);
6002
6124
  return result;
6003
6125
  };
6004
6126
  class BaseCheckbox extends FASTElement {
@@ -6349,36 +6471,36 @@ class BaseCheckbox extends FASTElement {
6349
6471
  * @public
6350
6472
  */
6351
6473
  BaseCheckbox.formAssociated = true;
6352
- __decorateClass$G([attr({
6474
+ __decorateClass$E([attr({
6353
6475
  mode: "boolean"
6354
6476
  })], BaseCheckbox.prototype, "autofocus", 2);
6355
- __decorateClass$G([observable], BaseCheckbox.prototype, "disabled", 2);
6356
- __decorateClass$G([attr({
6477
+ __decorateClass$E([observable], BaseCheckbox.prototype, "disabled", 2);
6478
+ __decorateClass$E([attr({
6357
6479
  attribute: "disabled",
6358
6480
  mode: "boolean"
6359
6481
  })], BaseCheckbox.prototype, "disabledAttribute", 2);
6360
- __decorateClass$G([attr({
6482
+ __decorateClass$E([attr({
6361
6483
  attribute: "form"
6362
6484
  })], BaseCheckbox.prototype, "formAttribute", 2);
6363
- __decorateClass$G([attr({
6485
+ __decorateClass$E([attr({
6364
6486
  attribute: "checked",
6365
6487
  mode: "boolean"
6366
6488
  })], BaseCheckbox.prototype, "initialChecked", 2);
6367
- __decorateClass$G([attr({
6489
+ __decorateClass$E([attr({
6368
6490
  attribute: "value",
6369
6491
  mode: "fromView"
6370
6492
  })], BaseCheckbox.prototype, "initialValue", 2);
6371
- __decorateClass$G([attr], BaseCheckbox.prototype, "name", 2);
6372
- __decorateClass$G([attr({
6493
+ __decorateClass$E([attr], BaseCheckbox.prototype, "name", 2);
6494
+ __decorateClass$E([attr({
6373
6495
  mode: "boolean"
6374
6496
  })], BaseCheckbox.prototype, "required", 2);
6375
6497
 
6376
- var __defProp$F = Object.defineProperty;
6377
- var __getOwnPropDesc$F = Object.getOwnPropertyDescriptor;
6378
- var __decorateClass$F = (decorators, target, key, kind) => {
6379
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$F(target, key) : target;
6498
+ var __defProp$D = Object.defineProperty;
6499
+ var __getOwnPropDesc$D = Object.getOwnPropertyDescriptor;
6500
+ var __decorateClass$D = (decorators, target, key, kind) => {
6501
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$D(target, key) : target;
6380
6502
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6381
- if (kind && result) __defProp$F(target, key, result);
6503
+ if (kind && result) __defProp$D(target, key, result);
6382
6504
  return result;
6383
6505
  };
6384
6506
  class Checkbox extends BaseCheckbox {
@@ -6421,9 +6543,9 @@ class Checkbox extends BaseCheckbox {
6421
6543
  super.toggleChecked(force);
6422
6544
  }
6423
6545
  }
6424
- __decorateClass$F([observable], Checkbox.prototype, "indeterminate", 2);
6425
- __decorateClass$F([attr], Checkbox.prototype, "shape", 2);
6426
- __decorateClass$F([attr], Checkbox.prototype, "size", 2);
6546
+ __decorateClass$D([observable], Checkbox.prototype, "indeterminate", 2);
6547
+ __decorateClass$D([attr], Checkbox.prototype, "shape", 2);
6548
+ __decorateClass$D([attr], Checkbox.prototype, "size", 2);
6427
6549
 
6428
6550
  const activeState = stateSelector("active");
6429
6551
  const badInputState = stateSelector("bad-input");
@@ -6454,7 +6576,7 @@ const userInvalidState = stateSelector("user-invalid");
6454
6576
  const validState = stateSelector("valid");
6455
6577
  const valueMissingState = stateSelector("value-missing");
6456
6578
 
6457
- const styles$A = css`
6579
+ const styles$y = css`
6458
6580
  ${display("inline-flex")}
6459
6581
 
6460
6582
  :host{--size:16px;background-color:${colorNeutralBackground1};border-radius:${borderRadiusSmall};border:${strokeWidthThin} solid ${colorNeutralStrokeAccessible};box-sizing:border-box;cursor:pointer;position:relative;width:var(--size)}:host,.indeterminate-indicator,.checked-indicator{aspect-ratio:1}:host(:hover){border-color:${colorNeutralStrokeAccessibleHover}}:host(:active){border-color:${colorNeutralStrokeAccessiblePressed}}:host(${checkedState}:hover){background-color:${colorCompoundBrandBackgroundHover};border-color:${colorCompoundBrandStrokeHover}}:host(${checkedState}:active){background-color:${colorCompoundBrandBackgroundPressed};border-color:${colorCompoundBrandStrokePressed}}:host(:focus-visible){outline:none}:host(:not([slot='input']))::after{content:'';position:absolute;inset:-8px;box-sizing:border-box;outline:none;border:${strokeWidthThick} solid ${colorTransparentStroke};border-radius:${borderRadiusMedium}}:host(:not([slot='input']):focus-visible)::after{border-color:${colorStrokeFocus2}}.indeterminate-indicator,.checked-indicator{color:${colorNeutralForegroundInverted};inset:0;margin:auto;position:absolute}::slotted([slot='checked-indicator']),.checked-indicator{fill:currentColor;display:inline-flex;flex:1 0 auto;width:12px}:host(:not(${checkedState})) *:is(::slotted([slot='checked-indicator']),.checked-indicator){display:none}:host(${checkedState}),:host(${indeterminateState}){border-color:${colorCompoundBrandStroke}}:host(${checkedState}),:host(${indeterminateState}) .indeterminate-indicator{background-color:${colorCompoundBrandBackground}}:host(${indeterminateState}) .indeterminate-indicator{border-radius:${borderRadiusSmall};position:absolute;width:calc(var(--size) / 2);inset:0}:host([size='large']){--size:20px}:host([size='large']) ::slotted([slot='checked-indicator']),:host([size='large']) .checked-indicator{width:16px}:host([shape='circular']),:host([shape='circular']) .indeterminate-indicator{border-radius:${borderRadiusCircular}}:host([disabled]),:host([disabled]${checkedState}){background-color:${colorNeutralBackgroundDisabled};border-color:${colorNeutralStrokeDisabled}}:host([disabled]){cursor:unset}:host([disabled]${indeterminateState}) .indeterminate-indicator{background-color:${colorNeutralStrokeDisabled}}:host([disabled]${checkedState}) .checked-indicator{color:${colorNeutralStrokeDisabled}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
@@ -6480,23 +6602,23 @@ const indeterminateIndicator = html.partial(/* html */
6480
6602
  function checkboxTemplate(options = {}) {
6481
6603
  return html`<template @click="${(x, c) => x.clickHandler(c.event)}" @input="${(x, c) => x.inputHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}" @keyup="${(x, c) => x.keyupHandler(c.event)}"><slot name="checked-indicator">${staticallyCompose(options.checkedIndicator)}</slot><slot name="indeterminate-indicator">${staticallyCompose(options.indeterminateIndicator)}</slot></template>`;
6482
6604
  }
6483
- const template$B = checkboxTemplate({
6605
+ const template$z = checkboxTemplate({
6484
6606
  checkedIndicator: checkedIndicator$2,
6485
6607
  indeterminateIndicator
6486
6608
  });
6487
6609
 
6488
- const definition$B = Checkbox.compose({
6610
+ const definition$z = Checkbox.compose({
6489
6611
  name: `${FluentDesignSystem.prefix}-checkbox`,
6490
- template: template$B,
6491
- styles: styles$A
6612
+ template: template$z,
6613
+ styles: styles$y
6492
6614
  });
6493
6615
 
6494
- definition$B.define(FluentDesignSystem.registry);
6616
+ definition$z.define(FluentDesignSystem.registry);
6495
6617
 
6496
6618
  class CompoundButton extends Button {}
6497
6619
 
6498
- const styles$z = css`
6499
- ${styles$E}
6620
+ const styles$x = css`
6621
+ ${styles$C}
6500
6622
 
6501
6623
  :host,:host(:is([size])){gap:12px;height:auto;padding-top:14px;padding-inline:12px;padding-bottom:16px;font-size:${fontSizeBase300};line-height:${lineHeightBase300}}.content{display:flex;flex-direction:column;text-align:start}::slotted([slot='description']){color:${colorNeutralForeground2};line-height:100%;font-size:${fontSizeBase200};font-weight:${fontWeightRegular}}::slotted(svg),:host([size='large']) ::slotted(svg){font-size:40px;height:40px;width:40px}:host(:hover) ::slotted([slot='description']){color:${colorNeutralForeground2Hover}}:host(:active) ::slotted([slot='description']){color:${colorNeutralForeground2Pressed}}:host(:is([appearance='primary'],[appearance='primary']:is(:hover,:active))) ::slotted([slot='description']){color:${colorNeutralForegroundOnBrand}}:host(:is([appearance='transparent'],[appearance='subtle'],[appearance='subtle']:is(:hover,:active)))
6502
6624
  ::slotted([slot='description']){color:${colorNeutralForeground2}}:host([appearance='transparent']:hover) ::slotted([slot='description']){color:${colorNeutralForeground2BrandHover}}:host([appearance='transparent']:active) ::slotted([slot='description']){color:${colorNeutralForeground2BrandPressed}}:host(:is(:disabled,:disabled[appearance],[disabled-focusable],[disabled-focusable][appearance]))
@@ -6507,22 +6629,22 @@ const styles$z = css`
6507
6629
  function buttonTemplate(options = {}) {
6508
6630
  return html`<template ?disabled="${x => x.disabled}" tabindex="${x => x.disabled ? null : x.tabIndex ?? 0}">${startSlotTemplate(options)}<span class="content" part="content"><slot ${slotted("defaultSlottedContent")}></slot><slot name="description"></slot></span>${endSlotTemplate(options)}</template>`;
6509
6631
  }
6510
- const template$A = buttonTemplate();
6632
+ const template$y = buttonTemplate();
6511
6633
 
6512
- const definition$A = CompoundButton.compose({
6634
+ const definition$y = CompoundButton.compose({
6513
6635
  name: `${FluentDesignSystem.prefix}-compound-button`,
6514
- template: template$A,
6515
- styles: styles$z
6636
+ template: template$y,
6637
+ styles: styles$x
6516
6638
  });
6517
6639
 
6518
- definition$A.define(FluentDesignSystem.registry);
6640
+ definition$y.define(FluentDesignSystem.registry);
6519
6641
 
6520
- var __defProp$E = Object.defineProperty;
6521
- var __getOwnPropDesc$E = Object.getOwnPropertyDescriptor;
6522
- var __decorateClass$E = (decorators, target, key, kind) => {
6523
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$E(target, key) : target;
6642
+ var __defProp$C = Object.defineProperty;
6643
+ var __getOwnPropDesc$C = Object.getOwnPropertyDescriptor;
6644
+ var __decorateClass$C = (decorators, target, key, kind) => {
6645
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$C(target, key) : target;
6524
6646
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6525
- if (kind && result) __defProp$E(target, key, result);
6647
+ if (kind && result) __defProp$C(target, key, result);
6526
6648
  return result;
6527
6649
  };
6528
6650
  class CounterBadge extends FASTElement {
@@ -6546,10 +6668,11 @@ class CounterBadge extends FASTElement {
6546
6668
  this.setCount();
6547
6669
  }
6548
6670
  /**
6549
- * @internal
6550
6671
  * Function to set the count
6551
6672
  * This is the default slotted content for the counter badge
6552
6673
  * If children are slotted, that will override the value returned
6674
+ *
6675
+ * @internal
6553
6676
  */
6554
6677
  setCount() {
6555
6678
  const count = this.count ?? 0;
@@ -6559,27 +6682,27 @@ class CounterBadge extends FASTElement {
6559
6682
  return;
6560
6683
  }
6561
6684
  }
6562
- __decorateClass$E([attr], CounterBadge.prototype, "appearance", 2);
6563
- __decorateClass$E([attr], CounterBadge.prototype, "color", 2);
6564
- __decorateClass$E([attr], CounterBadge.prototype, "shape", 2);
6565
- __decorateClass$E([attr], CounterBadge.prototype, "size", 2);
6566
- __decorateClass$E([attr({
6685
+ __decorateClass$C([attr], CounterBadge.prototype, "appearance", 2);
6686
+ __decorateClass$C([attr], CounterBadge.prototype, "color", 2);
6687
+ __decorateClass$C([attr], CounterBadge.prototype, "shape", 2);
6688
+ __decorateClass$C([attr], CounterBadge.prototype, "size", 2);
6689
+ __decorateClass$C([attr({
6567
6690
  converter: nullableNumberConverter
6568
6691
  })], CounterBadge.prototype, "count", 2);
6569
- __decorateClass$E([attr({
6692
+ __decorateClass$C([attr({
6570
6693
  attribute: "overflow-count",
6571
6694
  converter: nullableNumberConverter
6572
6695
  })], CounterBadge.prototype, "overflowCount", 2);
6573
- __decorateClass$E([attr({
6696
+ __decorateClass$C([attr({
6574
6697
  attribute: "show-zero",
6575
6698
  mode: "boolean"
6576
6699
  })], CounterBadge.prototype, "showZero", 2);
6577
- __decorateClass$E([attr({
6700
+ __decorateClass$C([attr({
6578
6701
  mode: "boolean"
6579
6702
  })], CounterBadge.prototype, "dot", 2);
6580
6703
  applyMixins(CounterBadge, StartEnd);
6581
6704
 
6582
- const styles$y = css`
6705
+ const styles$w = css`
6583
6706
  :host([shape='rounded']){border-radius:${borderRadiusMedium}}:host([shape='rounded']:is([size='tiny'],[size='extra-small'],[size='small'])){border-radius:${borderRadiusSmall}}${badgeSizeStyles}
6584
6707
  ${badgeFilledStyles}
6585
6708
  ${badgeGhostStyles}
@@ -6592,15 +6715,15 @@ function composeTemplate(options = {}) {
6592
6715
  defaultContent: html`${x => x.setCount()}`
6593
6716
  });
6594
6717
  }
6595
- const template$z = composeTemplate();
6718
+ const template$x = composeTemplate();
6596
6719
 
6597
- const definition$z = CounterBadge.compose({
6720
+ const definition$x = CounterBadge.compose({
6598
6721
  name: `${FluentDesignSystem.prefix}-counter-badge`,
6599
- template: template$z,
6600
- styles: styles$y
6722
+ template: template$x,
6723
+ styles: styles$w
6601
6724
  });
6602
6725
 
6603
- definition$z.define(FluentDesignSystem.registry);
6726
+ definition$x.define(FluentDesignSystem.registry);
6604
6727
 
6605
6728
  const DialogType = {
6606
6729
  modal: "modal",
@@ -6614,12 +6737,12 @@ function isDialog(element, tagName = "-dialog") {
6614
6737
  return element.tagName.toLowerCase().endsWith(tagName);
6615
6738
  }
6616
6739
 
6617
- var __defProp$D = Object.defineProperty;
6618
- var __getOwnPropDesc$D = Object.getOwnPropertyDescriptor;
6619
- var __decorateClass$D = (decorators, target, key, kind) => {
6620
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$D(target, key) : target;
6740
+ var __defProp$B = Object.defineProperty;
6741
+ var __getOwnPropDesc$B = Object.getOwnPropertyDescriptor;
6742
+ var __decorateClass$B = (decorators, target, key, kind) => {
6743
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$B(target, key) : target;
6621
6744
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6622
- if (kind && result) __defProp$D(target, key, result);
6745
+ if (kind && result) __defProp$B(target, key, result);
6623
6746
  return result;
6624
6747
  };
6625
6748
  class Dialog extends FASTElement {
@@ -6627,9 +6750,10 @@ class Dialog extends FASTElement {
6627
6750
  super(...arguments);
6628
6751
  this.type = DialogType.modal;
6629
6752
  /**
6630
- * @public
6631
6753
  * Method to emit an event before the dialog's open state changes
6632
6754
  * HTML spec proposal: https://github.com/whatwg/html/issues/9733
6755
+ *
6756
+ * @public
6633
6757
  */
6634
6758
  this.emitBeforeToggle = () => {
6635
6759
  this.$emit("beforetoggle", {
@@ -6638,9 +6762,10 @@ class Dialog extends FASTElement {
6638
6762
  });
6639
6763
  };
6640
6764
  /**
6641
- * @public
6642
6765
  * Method to emit an event after the dialog's open state changes
6643
6766
  * HTML spec proposal: https://github.com/whatwg/html/issues/9733
6767
+ *
6768
+ * @public
6644
6769
  */
6645
6770
  this.emitToggle = () => {
6646
6771
  this.$emit("toggle", {
@@ -6649,29 +6774,16 @@ class Dialog extends FASTElement {
6649
6774
  });
6650
6775
  };
6651
6776
  }
6652
- typeChanged(prev, next) {
6653
- if (!this.dialog) {
6654
- return;
6655
- }
6656
- if (next === DialogType.alert) {
6657
- this.dialog.setAttribute("role", "alertdialog");
6658
- } else {
6659
- this.dialog.removeAttribute("role");
6660
- }
6661
- if (next !== DialogType.nonModal) {
6662
- this.dialog.setAttribute("aria-modal", "true");
6663
- } else {
6664
- this.dialog.removeAttribute("aria-modal");
6665
- }
6777
+ dialogChanged() {
6778
+ this.updateDialogAttributes();
6666
6779
  }
6667
- /** @internal */
6668
- connectedCallback() {
6669
- super.connectedCallback();
6670
- this.typeChanged(void 0, this.type);
6780
+ typeChanged(prev, next) {
6781
+ this.updateDialogAttributes();
6671
6782
  }
6672
6783
  /**
6673
- * @public
6674
6784
  * Method to show the dialog
6785
+ *
6786
+ * @public
6675
6787
  */
6676
6788
  show() {
6677
6789
  Updates.enqueue(() => {
@@ -6685,8 +6797,9 @@ class Dialog extends FASTElement {
6685
6797
  });
6686
6798
  }
6687
6799
  /**
6688
- * @public
6689
6800
  * Method to hide the dialog
6801
+ *
6802
+ * @public
6690
6803
  */
6691
6804
  hide() {
6692
6805
  this.emitBeforeToggle();
@@ -6694,8 +6807,9 @@ class Dialog extends FASTElement {
6694
6807
  this.emitToggle();
6695
6808
  }
6696
6809
  /**
6697
- * @public
6698
6810
  * Handles click events on the dialog overlay for light-dismiss
6811
+ *
6812
+ * @public
6699
6813
  * @param event - The click event
6700
6814
  * @returns boolean
6701
6815
  */
@@ -6705,29 +6819,52 @@ class Dialog extends FASTElement {
6705
6819
  }
6706
6820
  return true;
6707
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
+ }
6708
6842
  }
6709
- __decorateClass$D([observable], Dialog.prototype, "dialog", 2);
6710
- __decorateClass$D([attr({
6843
+ __decorateClass$B([observable], Dialog.prototype, "dialog", 2);
6844
+ __decorateClass$B([attr({
6711
6845
  attribute: "aria-describedby"
6712
6846
  })], Dialog.prototype, "ariaDescribedby", 2);
6713
- __decorateClass$D([attr({
6847
+ __decorateClass$B([attr({
6714
6848
  attribute: "aria-labelledby"
6715
6849
  })], Dialog.prototype, "ariaLabelledby", 2);
6716
- __decorateClass$D([attr], Dialog.prototype, "type", 2);
6850
+ __decorateClass$B([attr({
6851
+ attribute: "aria-label"
6852
+ })], Dialog.prototype, "ariaLabel", 2);
6853
+ __decorateClass$B([attr], Dialog.prototype, "type", 2);
6717
6854
 
6718
- const template$y = html`<dialog class="dialog" part="dialog" aria-describedby="${x => x.ariaDescribedby}" aria-labelledby="${x => x.ariaLabelledby}" aria-label="${x => x.ariaLabel}" @click="${(x, c) => x.clickHandler(c.event)}" @cancel="${x => x.hide()}" ${ref("dialog")}><slot></slot></dialog>`;
6855
+ const template$w = html`<dialog class="dialog" part="dialog" aria-describedby="${x => x.ariaDescribedby}" aria-labelledby="${x => x.ariaLabelledby}" aria-label="${x => x.ariaLabel}" @click="${(x, c) => x.clickHandler(c.event)}" @cancel="${x => x.hide()}" ${ref("dialog")}><slot></slot></dialog>`;
6719
6856
 
6720
- const styles$x = css`
6857
+ const styles$v = css`
6721
6858
  @layer base{:host{--dialog-backdrop:${colorBackgroundOverlay};--dialog-starting-scale:0.85}::backdrop{background:var(--dialog-backdrop,rgba(0,0,0,0.4))}dialog{background:${colorNeutralBackground1};border-radius:${borderRadiusXLarge};border:none;box-shadow:${shadow64};color:${colorNeutralForeground1};max-height:100vh;padding:0;width:100%;max-width:600px}:host([type='non-modal']) dialog{inset:0;position:fixed;z-index:2;overflow:auto}@supports (max-height:1dvh){dialog{max-height:100dvh}}}@layer animations{@media (prefers-reduced-motion:no-preference){dialog,::backdrop{transition:display allow-discrete,opacity,overlay allow-discrete,scale;transition-duration:${durationGentle};transition-timing-function:${curveDecelerateMid};opacity:0}::backdrop{transition-timing-function:${curveLinear}}[open],[open]::backdrop{opacity:1}dialog:not([open]){scale:var(--dialog-starting-scale);transition-timing-function:${curveAccelerateMid}}}@starting-style{[open],[open]::backdrop{opacity:0}dialog{scale:var(--dialog-starting-scale)}}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
6722
6859
  @layer base{dialog{border:${strokeWidthThin} solid ${colorTransparentStroke}}}`));
6723
6860
 
6724
- const definition$y = Dialog.compose({
6861
+ const definition$w = Dialog.compose({
6725
6862
  name: `${FluentDesignSystem.prefix}-dialog`,
6726
- template: template$y,
6727
- styles: styles$x
6863
+ template: template$w,
6864
+ styles: styles$v
6728
6865
  });
6729
6866
 
6730
- definition$y.define(FluentDesignSystem.registry);
6867
+ definition$w.define(FluentDesignSystem.registry);
6731
6868
 
6732
6869
  class DialogBody extends FASTElement {
6733
6870
  /**
@@ -6747,20 +6884,20 @@ class DialogBody extends FASTElement {
6747
6884
  }
6748
6885
  }
6749
6886
 
6750
- const template$x = html`<template><div class="title" part="title"><slot name="title"></slot><slot name="title-action"></slot><slot name="close" @click="${(x, c) => x.clickHandler(c.event)}"></slot></div><div class="content" part="content"><slot></slot></div><div class="actions" part="actions"><slot name="action"></slot></div></template>`;
6887
+ const template$v = html`<template><div class="title" part="title"><slot name="title"></slot><slot name="title-action"></slot><slot name="close" @click="${(x, c) => x.clickHandler(c.event)}"></slot></div><div class="content" part="content"><slot></slot></div><div class="actions" part="actions"><slot name="action"></slot></div></template>`;
6751
6888
 
6752
- const styles$w = css`
6889
+ const styles$u = css`
6753
6890
  ${display("grid")}
6754
6891
 
6755
6892
  :host{background:${colorNeutralBackground1};box-sizing:border-box;gap:${spacingVerticalS};padding:${spacingVerticalXXL} ${spacingHorizontalXXL};container:dialog-body / inline-size}.title{box-sizing:border-box;align-items:flex-start;background:${colorNeutralBackground1};color:${colorNeutralForeground1};column-gap:8px;display:flex;font-family:${fontFamilyBase};font-size:${fontSizeBase500};font-weight:${fontWeightSemibold};inset-block-start:0;justify-content:space-between;line-height:${lineHeightBase500};margin-block-end:calc(${spacingVerticalS} * -1);margin-block-start:calc(${spacingVerticalXXL} * -1);padding-block-end:${spacingVerticalS};padding-block-start:${spacingVerticalXXL}}.content{box-sizing:border-box;color:${colorNeutralForeground1};font-family:${fontFamilyBase};font-size:${fontSizeBase300};font-weight:${fontWeightRegular};line-height:${lineHeightBase300};min-height:32px}.actions{box-sizing:border-box;background:${colorNeutralBackground1};display:flex;flex-direction:column;gap:${spacingVerticalS};inset-block-end:0;margin-block-end:calc(${spacingVerticalXXL} * -1);padding-block-end:${spacingVerticalXXL};padding-block-start:${spacingVerticalL}}::slotted([slot='title-action']){margin-inline-start:auto}::slotted([slot='title']){font:inherit;padding:0;margin:0}:not(:has(:is([slot='title'],[slot='title-action']))) .title{justify-content:end}@container (min-width:480px){.actions{align-items:center;flex-direction:row;justify-content:flex-end;margin-block-start:calc(${spacingVerticalS} * -1);padding-block-start:${spacingVerticalS}}}@media (min-height:480px){.title{position:sticky;z-index:1}.actions{position:sticky;z-index:2}`;
6756
6893
 
6757
- const definition$x = DialogBody.compose({
6894
+ const definition$v = DialogBody.compose({
6758
6895
  name: `${FluentDesignSystem.prefix}-dialog-body`,
6759
- template: template$x,
6760
- styles: styles$w
6896
+ template: template$v,
6897
+ styles: styles$u
6761
6898
  });
6762
6899
 
6763
- definition$x.define(FluentDesignSystem.registry);
6900
+ definition$v.define(FluentDesignSystem.registry);
6764
6901
 
6765
6902
  const DividerRole = {
6766
6903
  /**
@@ -6774,12 +6911,12 @@ const DividerRole = {
6774
6911
  };
6775
6912
  const DividerOrientation = Orientation;
6776
6913
 
6777
- var __defProp$C = Object.defineProperty;
6778
- var __getOwnPropDesc$C = Object.getOwnPropertyDescriptor;
6779
- var __decorateClass$C = (decorators, target, key, kind) => {
6780
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$C(target, key) : target;
6914
+ var __defProp$A = Object.defineProperty;
6915
+ var __getOwnPropDesc$A = Object.getOwnPropertyDescriptor;
6916
+ var __decorateClass$A = (decorators, target, key, kind) => {
6917
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$A(target, key) : target;
6781
6918
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6782
- if (kind && result) __defProp$C(target, key, result);
6919
+ if (kind && result) __defProp$A(target, key, result);
6783
6920
  return result;
6784
6921
  };
6785
6922
  class BaseDivider extends FASTElement {
@@ -6826,44 +6963,44 @@ class BaseDivider extends FASTElement {
6826
6963
  swapStates(this.elementInternals, previous, next, DividerOrientation);
6827
6964
  }
6828
6965
  }
6829
- __decorateClass$C([attr], BaseDivider.prototype, "role", 2);
6830
- __decorateClass$C([attr], BaseDivider.prototype, "orientation", 2);
6966
+ __decorateClass$A([attr], BaseDivider.prototype, "role", 2);
6967
+ __decorateClass$A([attr], BaseDivider.prototype, "orientation", 2);
6831
6968
 
6832
- var __defProp$B = Object.defineProperty;
6833
- var __getOwnPropDesc$B = Object.getOwnPropertyDescriptor;
6834
- var __decorateClass$B = (decorators, target, key, kind) => {
6835
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$B(target, key) : target;
6969
+ var __defProp$z = Object.defineProperty;
6970
+ var __getOwnPropDesc$z = Object.getOwnPropertyDescriptor;
6971
+ var __decorateClass$z = (decorators, target, key, kind) => {
6972
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$z(target, key) : target;
6836
6973
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6837
- if (kind && result) __defProp$B(target, key, result);
6974
+ if (kind && result) __defProp$z(target, key, result);
6838
6975
  return result;
6839
6976
  };
6840
6977
  class Divider extends BaseDivider {}
6841
- __decorateClass$B([attr({
6978
+ __decorateClass$z([attr({
6842
6979
  attribute: "align-content"
6843
6980
  })], Divider.prototype, "alignContent", 2);
6844
- __decorateClass$B([attr], Divider.prototype, "appearance", 2);
6845
- __decorateClass$B([attr({
6981
+ __decorateClass$z([attr], Divider.prototype, "appearance", 2);
6982
+ __decorateClass$z([attr({
6846
6983
  mode: "boolean"
6847
6984
  })], Divider.prototype, "inset", 2);
6848
6985
 
6849
6986
  function dividerTemplate() {
6850
6987
  return html`<slot></slot>`;
6851
6988
  }
6852
- const template$w = dividerTemplate();
6989
+ const template$u = dividerTemplate();
6853
6990
 
6854
- const styles$v = css`
6991
+ const styles$t = css`
6855
6992
  ${display("flex")}
6856
6993
 
6857
6994
  :host{contain:content}:host::after,:host::before{align-self:center;background:${colorNeutralStroke2};box-sizing:border-box;content:'';display:flex;flex-grow:1;height:${strokeWidthThin}}:host([inset]){padding:0 12px}:host ::slotted(*){color:${colorNeutralForeground2};font-family:${fontFamilyBase};font-size:${fontSizeBase200};font-weight:${fontWeightRegular};margin:0;padding:0 12px}:host([align-content='start'])::before,:host([align-content='end'])::after{flex-basis:12px;flex-grow:0;flex-shrink:0}:host([orientation='vertical']){align-items:center;flex-direction:column;height:100%;min-height:84px}:host([orientation='vertical']):empty{min-height:20px}:host([orientation='vertical'][inset])::before{margin-top:12px}:host([orientation='vertical'][inset])::after{margin-bottom:12px}:host([orientation='vertical']):empty::before,:host([orientation='vertical']):empty::after{height:10px;min-height:10px;flex-grow:0}:host([orientation='vertical'])::before,:host([orientation='vertical'])::after{width:${strokeWidthThin};min-height:20px;height:100%}:host([orientation='vertical']) ::slotted(*){display:flex;flex-direction:column;padding:12px 0;line-height:20px}:host([orientation='vertical'][align-content='start'])::before{min-height:8px}:host([orientation='vertical'][align-content='end'])::after{min-height:8px}:host([appearance='strong'])::before,:host([appearance='strong'])::after{background:${colorNeutralStroke1}}:host([appearance='strong']) ::slotted(*){color:${colorNeutralForeground1}}:host([appearance='brand'])::before,:host([appearance='brand'])::after{background:${colorBrandStroke1}}:host([appearance='brand']) ::slotted(*){color:${colorBrandForeground1}}:host([appearance='subtle'])::before,:host([appearance='subtle'])::after{background:${colorNeutralStroke3}}:host([appearance='subtle']) ::slotted(*){color:${colorNeutralForeground3}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
6858
6995
  :host([appearance='strong'])::before,:host([appearance='strong'])::after,:host([appearance='brand'])::before,:host([appearance='brand'])::after,:host([appearance='subtle'])::before,:host([appearance='subtle'])::after,:host::after,:host::before{background:WindowText;color:WindowText}`));
6859
6996
 
6860
- const definition$w = Divider.compose({
6997
+ const definition$u = Divider.compose({
6861
6998
  name: `${FluentDesignSystem.prefix}-divider`,
6862
- template: template$w,
6863
- styles: styles$v
6999
+ template: template$u,
7000
+ styles: styles$t
6864
7001
  });
6865
7002
 
6866
- definition$w.define(FluentDesignSystem.registry);
7003
+ definition$u.define(FluentDesignSystem.registry);
6867
7004
 
6868
7005
  const DrawerPosition = {
6869
7006
  start: "start",
@@ -6881,12 +7018,12 @@ const DrawerType = {
6881
7018
  inline: "inline"
6882
7019
  };
6883
7020
 
6884
- var __defProp$A = Object.defineProperty;
6885
- var __getOwnPropDesc$A = Object.getOwnPropertyDescriptor;
6886
- var __decorateClass$A = (decorators, target, key, kind) => {
6887
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$A(target, key) : target;
7021
+ var __defProp$y = Object.defineProperty;
7022
+ var __getOwnPropDesc$y = Object.getOwnPropertyDescriptor;
7023
+ var __decorateClass$y = (decorators, target, key, kind) => {
7024
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$y(target, key) : target;
6888
7025
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6889
- if (kind && result) __defProp$A(target, key, result);
7026
+ if (kind && result) __defProp$y(target, key, result);
6890
7027
  return result;
6891
7028
  };
6892
7029
  class Drawer extends FASTElement {
@@ -6896,9 +7033,10 @@ class Drawer extends FASTElement {
6896
7033
  this.position = DrawerPosition.start;
6897
7034
  this.size = DrawerSize.medium;
6898
7035
  /**
6899
- * @public
6900
7036
  * Method to emit an event after the dialog's open state changes
6901
7037
  * HTML spec proposal: https://github.com/whatwg/html/issues/9733
7038
+ *
7039
+ * @public
6902
7040
  */
6903
7041
  this.emitToggle = () => {
6904
7042
  this.$emit("toggle", {
@@ -6907,9 +7045,10 @@ class Drawer extends FASTElement {
6907
7045
  });
6908
7046
  };
6909
7047
  /**
6910
- * @public
6911
7048
  * Method to emit an event before the dialog's open state changes
6912
7049
  * HTML spec proposal: https://github.com/whatwg/html/issues/9733
7050
+ *
7051
+ * @public
6913
7052
  */
6914
7053
  this.emitBeforeToggle = () => {
6915
7054
  this.$emit("beforetoggle", {
@@ -6941,8 +7080,9 @@ class Drawer extends FASTElement {
6941
7080
  this.roleAttrObserver.disconnect();
6942
7081
  }
6943
7082
  /**
6944
- * @public
6945
7083
  * Method to show the drawer
7084
+ *
7085
+ * @public
6946
7086
  */
6947
7087
  show() {
6948
7088
  Updates.enqueue(() => {
@@ -6956,8 +7096,9 @@ class Drawer extends FASTElement {
6956
7096
  });
6957
7097
  }
6958
7098
  /**
6959
- * @public
6960
7099
  * Method to hide the drawer
7100
+ *
7101
+ * @public
6961
7102
  */
6962
7103
  hide() {
6963
7104
  this.emitBeforeToggle();
@@ -6978,8 +7119,9 @@ class Drawer extends FASTElement {
6978
7119
  return true;
6979
7120
  }
6980
7121
  /**
6981
- * @public
6982
7122
  * Handles cancel events on the drawer.
7123
+ *
7124
+ * @public
6983
7125
  */
6984
7126
  cancelHandler() {
6985
7127
  this.hide();
@@ -6997,27 +7139,26 @@ class Drawer extends FASTElement {
6997
7139
  });
6998
7140
  }
6999
7141
  updateDialogRole() {
7000
- console.log(this.role);
7001
7142
  if (!this.dialog) {
7002
7143
  return;
7003
7144
  }
7004
7145
  this.dialog.role = this.type === DrawerType.modal ? "dialog" : this.role;
7005
7146
  }
7006
7147
  }
7007
- __decorateClass$A([attr], Drawer.prototype, "type", 2);
7008
- __decorateClass$A([attr({
7148
+ __decorateClass$y([attr], Drawer.prototype, "type", 2);
7149
+ __decorateClass$y([attr({
7009
7150
  attribute: "aria-labelledby"
7010
7151
  })], Drawer.prototype, "ariaLabelledby", 2);
7011
- __decorateClass$A([attr({
7152
+ __decorateClass$y([attr({
7012
7153
  attribute: "aria-describedby"
7013
7154
  })], Drawer.prototype, "ariaDescribedby", 2);
7014
- __decorateClass$A([attr], Drawer.prototype, "position", 2);
7015
- __decorateClass$A([attr({
7155
+ __decorateClass$y([attr], Drawer.prototype, "position", 2);
7156
+ __decorateClass$y([attr({
7016
7157
  attribute: "size"
7017
7158
  })], Drawer.prototype, "size", 2);
7018
- __decorateClass$A([observable], Drawer.prototype, "dialog", 2);
7159
+ __decorateClass$y([observable], Drawer.prototype, "dialog", 2);
7019
7160
 
7020
- const styles$u = css`
7161
+ const styles$s = css`
7021
7162
  ${display("block")}
7022
7163
 
7023
7164
  :host{--dialog-backdrop:${colorBackgroundOverlay}}:host([type='non-modal']) dialog[open]::backdrop{display:none}:host([type='non-modal']) dialog{position:fixed;top:0;bottom:0}:host([type='inline']){height:100%;width:fit-content}:host([type='inline']) dialog[open]{box-shadow:none;position:relative}:host([size='small']) dialog{width:320px;max-width:320px}:host([size='large']) dialog{width:940px;max-width:940px}:host([size='full']) dialog{width:100%;max-width:100%}:host([position='end']) dialog{margin-inline-start:auto;margin-inline-end:0}dialog{box-sizing:border-box;z-index:var(--drawer-elevation,1000);font-size:${fontSizeBase300};line-height:${lineHeightBase300};font-family:${fontFamilyBase};font-weight:${fontWeightRegular};color:${colorNeutralForeground1};max-width:var(--drawer-width,592px);max-height:100vh;height:100%;margin-inline-start:0;margin-inline-end:auto;border-inline-end-color:${colorTransparentStroke};border-inline-start-color:var(--drawer-separator,${colorTransparentStroke});outline:none;top:0;bottom:0;width:var(--drawer-width,592px);border-radius:0;padding:0;max-width:var(--drawer-width,592px);box-shadow:${shadow64};border:${strokeWidthThin} solid ${colorTransparentStroke};background:${colorNeutralBackground1}}dialog::backdrop{background:var(--dialog-backdrop)}@layer animations{@media (prefers-reduced-motion:no-preference){dialog{transition:display allow-discrete,opacity,overlay allow-discrete,transform;transition-duration:${durationGentle};transition-timing-function:${curveDecelerateMid}}:host dialog:not([open]){transform:translateX(-100%);transition-timing-function:${curveAccelerateMid}}:host([position='end']) dialog:not([open]){transform:translateX(100%);transition-timing-function:${curveAccelerateMid}}dialog[open]{transform:translateX(0)}dialog::backdrop{transition:display allow-discrete,opacity,overlay allow-discrete,scale;transition-duration:${durationGentle};transition-timing-function:${curveDecelerateMid};background:var(--dialog-backdrop,${colorBackgroundOverlay});opacity:0}dialog[open]::backdrop{opacity:1}dialog::backdrop{transition-timing-function:${curveLinear}}}@starting-style{dialog[open]{transform:translateX(-100%)}:host([position='end']) dialog[open]{transform:translateX(100%)}dialog[open]::backdrop{opacity:0}}}`;
@@ -7025,15 +7166,15 @@ const styles$u = css`
7025
7166
  function drawerTemplate() {
7026
7167
  return html`<dialog class="dialog" part="dialog" aria-describedby="${x => x.ariaDescribedby}" aria-labelledby="${x => x.ariaLabelledby}" aria-label="${x => x.ariaLabel}" size="${x => x.size}" position="${x => x.position}" @click="${(x, c) => x.clickHandler(c.event)}" @cancel="${x => x.cancelHandler()}" ${ref("dialog")}><slot></slot></dialog>`;
7027
7168
  }
7028
- const template$v = drawerTemplate();
7169
+ const template$t = drawerTemplate();
7029
7170
 
7030
- const definition$v = Drawer.compose({
7171
+ const definition$t = Drawer.compose({
7031
7172
  name: `${FluentDesignSystem.prefix}-drawer`,
7032
- template: template$v,
7033
- styles: styles$u
7173
+ template: template$t,
7174
+ styles: styles$s
7034
7175
  });
7035
7176
 
7036
- definition$v.define(FluentDesignSystem.registry);
7177
+ definition$t.define(FluentDesignSystem.registry);
7037
7178
 
7038
7179
  class DrawerBody extends FASTElement {
7039
7180
  /**
@@ -7053,22 +7194,22 @@ class DrawerBody extends FASTElement {
7053
7194
  }
7054
7195
  }
7055
7196
 
7056
- const styles$t = css`
7197
+ const styles$r = css`
7057
7198
  ${display("grid")}
7058
7199
  :host{box-sizing:border-box;grid-template-rows:min-content auto min-content;position:relative;height:100%;padding:${spacingHorizontalXL};max-height:100svh}.header{display:flex;justify-content:space-between;align-items:center;${typographySubtitle1Styles}}.footer{display:flex;justify-content:flex-start;gap:${spacingHorizontalM}}::slotted([slot='title']){font:inherit;padding:0;margin:0}`;
7059
7200
 
7060
7201
  function drawerBodyTemplate() {
7061
7202
  return html`<div class="header" part="header"><slot name="title"></slot><slot name="close" @click="${(x, c) => x.clickHandler(c.event)}"></slot></div><div class="content" part="content"><slot></slot></div><div class="footer" part="footer"><slot name="footer"></slot></div>`;
7062
7203
  }
7063
- const template$u = drawerBodyTemplate();
7204
+ const template$s = drawerBodyTemplate();
7064
7205
 
7065
- const definition$u = DrawerBody.compose({
7206
+ const definition$s = DrawerBody.compose({
7066
7207
  name: `${FluentDesignSystem.prefix}-drawer-body`,
7067
- template: template$u,
7068
- styles: styles$t
7208
+ template: template$s,
7209
+ styles: styles$r
7069
7210
  });
7070
7211
 
7071
- definition$u.define(FluentDesignSystem.registry);
7212
+ definition$s.define(FluentDesignSystem.registry);
7072
7213
 
7073
7214
  function isListbox(element, tagName = "-listbox") {
7074
7215
  if (element?.nodeType !== Node.ELEMENT_NODE) {
@@ -7088,12 +7229,6 @@ function getLanguage(rootNode) {
7088
7229
  return rootNode.closest("[lang]")?.lang ?? "en";
7089
7230
  }
7090
7231
 
7091
- let uniqueIdCounter = 0;
7092
- function uniqueId(prefix = "id-") {
7093
- const str = `${prefix}${uniqueIdCounter++}`;
7094
- return document.getElementById(str) ? uniqueId(prefix) : str;
7095
- }
7096
-
7097
7232
  function requestIdleCallback(callback, options) {
7098
7233
  if ("requestIdleCallback" in globalThis) {
7099
7234
  return globalThis.requestIdleCallback(callback, options);
@@ -7106,34 +7241,28 @@ function requestIdleCallback(callback, options) {
7106
7241
  });
7107
7242
  }, 1);
7108
7243
  }
7109
- function cancelIdleCallback(id) {
7110
- if ("cancelIdleCallback" in globalThis) {
7111
- globalThis.cancelIdleCallback(id);
7112
- } else {
7113
- clearTimeout(id);
7114
- }
7115
- }
7116
7244
  function waitForConnectedDescendants(target, callback, options) {
7117
- let idleCallbackId;
7118
7245
  const shallow = options?.shallow ?? false;
7119
- const query = `${shallow ? ":scope > " : ""}:not(:defined)`;
7120
7246
  const timeout = options?.timeout ?? 50;
7247
+ const selector = `${shallow ? ":scope > " : ""}:not(:defined)`;
7121
7248
  const scheduleCheck = deadline => {
7122
- if (idleCallbackId) {
7123
- cancelIdleCallback(idleCallbackId);
7124
- idleCallbackId = void 0;
7125
- }
7126
- if (!target.querySelector(query) || deadline && deadline.timeRemaining() <= 0) {
7127
- callback();
7249
+ if (target.querySelector(selector) === null || deadline && deadline.timeRemaining() <= 0) {
7250
+ requestAnimationFrame(callback);
7128
7251
  return;
7129
7252
  }
7130
- idleCallbackId = requestIdleCallback(scheduleCheck, {
7253
+ requestIdleCallback(scheduleCheck, {
7131
7254
  timeout
7132
7255
  });
7133
7256
  };
7134
7257
  scheduleCheck();
7135
7258
  }
7136
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
+
7137
7266
  const DropdownAppearance = {
7138
7267
  filledDarker: "filled-darker",
7139
7268
  filledLighter: "filled-lighter",
@@ -7152,16 +7281,16 @@ const dropdownButtonTemplate = html`<button aria-activedescendant="${x => x.acti
7152
7281
  function dropdownTemplate(options = {}) {
7153
7282
  return html`<template @click="${(x, c) => x.clickHandler(c.event)}" @focusout="${(x, c) => x.focusoutHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}" @mousedown="${(x, c) => x.mousedownHandler(c.event)}"><div class="control"><slot name="control" ${ref("controlSlot")}></slot><slot name="indicator" ${ref("indicatorSlot")}>${staticallyCompose(options.indicator)}</slot></div><slot @slotchange="${(x, c) => x.slotchangeHandler(c.event)}"></slot></template>`;
7154
7283
  }
7155
- const template$t = dropdownTemplate({
7284
+ const template$r = dropdownTemplate({
7156
7285
  indicator: dropdownIndicatorTemplate
7157
7286
  });
7158
7287
 
7159
- var __defProp$z = Object.defineProperty;
7160
- var __getOwnPropDesc$z = Object.getOwnPropertyDescriptor;
7161
- var __decorateClass$z = (decorators, target, key, kind) => {
7162
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$z(target, key) : target;
7288
+ var __defProp$x = Object.defineProperty;
7289
+ var __getOwnPropDesc$x = Object.getOwnPropertyDescriptor;
7290
+ var __decorateClass$x = (decorators, target, key, kind) => {
7291
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$x(target, key) : target;
7163
7292
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7164
- if (kind && result) __defProp$z(target, key, result);
7293
+ if (kind && result) __defProp$x(target, key, result);
7165
7294
  return result;
7166
7295
  };
7167
7296
  const _BaseDropdown = class _BaseDropdown extends FASTElement {
@@ -7204,9 +7333,6 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
7204
7333
  */
7205
7334
  this.elementInternals = this.attachInternals();
7206
7335
  this.elementInternals.role = "presentation";
7207
- Updates.enqueue(() => {
7208
- this.insertControl();
7209
- });
7210
7336
  }
7211
7337
  get activeDescendant() {
7212
7338
  if (this.open) {
@@ -7255,11 +7381,13 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
7255
7381
  * @param next - the current disabled state
7256
7382
  */
7257
7383
  disabledChanged(prev, next) {
7258
- Updates.enqueue(() => {
7259
- this.options.forEach(option => {
7260
- 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
+ });
7261
7389
  });
7262
- });
7390
+ }
7263
7391
  }
7264
7392
  get displayValue() {
7265
7393
  if (!this.$fastController.isConnected || !this.control || this.isCombobox && this.multiple) {
@@ -7297,10 +7425,12 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
7297
7425
  next.tabIndex = -1;
7298
7426
  const notifier = Observable.getNotifier(this);
7299
7427
  notifier.subscribe(next);
7300
- for (const key of ["disabled", "multiple"]) {
7301
- notifier.notify(key);
7302
- }
7428
+ notifier.notify("multiple");
7303
7429
  Updates.enqueue(() => {
7430
+ this.options.forEach(option => {
7431
+ option.disabled = option.disabledAttribute || this.disabled;
7432
+ option.name = this.name;
7433
+ });
7304
7434
  this.enabledOptions.filter(x => x.defaultSelected).forEach((x, i) => {
7305
7435
  x.selected = this.multiple || i === 0;
7306
7436
  });
@@ -7332,11 +7462,13 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
7332
7462
  * @param next - the current name
7333
7463
  */
7334
7464
  nameChanged(prev, next) {
7335
- Updates.enqueue(() => {
7336
- this.options.forEach(option => {
7337
- option.name = next;
7465
+ if (this.listbox) {
7466
+ Updates.enqueue(() => {
7467
+ this.options.forEach(option => {
7468
+ option.name = next;
7469
+ });
7338
7470
  });
7339
- });
7471
+ }
7340
7472
  }
7341
7473
  /**
7342
7474
  * Handles the open state of the dropdown.
@@ -7814,6 +7946,12 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
7814
7946
  this.freeformOption.value = value;
7815
7947
  this.freeformOption.hidden = false;
7816
7948
  }
7949
+ connectedCallback() {
7950
+ super.connectedCallback();
7951
+ Updates.enqueue(() => {
7952
+ this.insertControl();
7953
+ });
7954
+ }
7817
7955
  disconnectedCallback() {
7818
7956
  _BaseDropdown.AnchorPositionFallbackObserver?.disconnect();
7819
7957
  this.debounceController?.abort();
@@ -7877,48 +8015,48 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
7877
8015
  * @public
7878
8016
  */
7879
8017
  _BaseDropdown.formAssociated = true;
7880
- __decorateClass$z([volatile], _BaseDropdown.prototype, "activeDescendant", 1);
7881
- __decorateClass$z([observable], _BaseDropdown.prototype, "activeIndex", 2);
7882
- __decorateClass$z([attr({
8018
+ __decorateClass$x([volatile], _BaseDropdown.prototype, "activeDescendant", 1);
8019
+ __decorateClass$x([observable], _BaseDropdown.prototype, "activeIndex", 2);
8020
+ __decorateClass$x([attr({
7883
8021
  attribute: "aria-labelledby",
7884
8022
  mode: "fromView"
7885
8023
  })], _BaseDropdown.prototype, "ariaLabelledBy", 2);
7886
- __decorateClass$z([observable], _BaseDropdown.prototype, "control", 2);
7887
- __decorateClass$z([attr({
8024
+ __decorateClass$x([observable], _BaseDropdown.prototype, "control", 2);
8025
+ __decorateClass$x([attr({
7888
8026
  mode: "boolean"
7889
8027
  })], _BaseDropdown.prototype, "disabled", 2);
7890
- __decorateClass$z([volatile], _BaseDropdown.prototype, "displayValue", 1);
7891
- __decorateClass$z([attr({
8028
+ __decorateClass$x([volatile], _BaseDropdown.prototype, "displayValue", 1);
8029
+ __decorateClass$x([attr({
7892
8030
  attribute: "id"
7893
8031
  })], _BaseDropdown.prototype, "id", 2);
7894
- __decorateClass$z([observable], _BaseDropdown.prototype, "indicator", 2);
7895
- __decorateClass$z([observable], _BaseDropdown.prototype, "indicatorSlot", 2);
7896
- __decorateClass$z([attr({
8032
+ __decorateClass$x([observable], _BaseDropdown.prototype, "indicator", 2);
8033
+ __decorateClass$x([observable], _BaseDropdown.prototype, "indicatorSlot", 2);
8034
+ __decorateClass$x([attr({
7897
8035
  attribute: "value",
7898
8036
  mode: "fromView"
7899
8037
  })], _BaseDropdown.prototype, "initialValue", 2);
7900
- __decorateClass$z([observable], _BaseDropdown.prototype, "listbox", 2);
7901
- __decorateClass$z([attr({
8038
+ __decorateClass$x([observable], _BaseDropdown.prototype, "listbox", 2);
8039
+ __decorateClass$x([attr({
7902
8040
  mode: "boolean"
7903
8041
  })], _BaseDropdown.prototype, "multiple", 2);
7904
- __decorateClass$z([attr], _BaseDropdown.prototype, "name", 2);
7905
- __decorateClass$z([observable], _BaseDropdown.prototype, "open", 2);
7906
- __decorateClass$z([attr], _BaseDropdown.prototype, "placeholder", 2);
7907
- __decorateClass$z([attr({
8042
+ __decorateClass$x([attr], _BaseDropdown.prototype, "name", 2);
8043
+ __decorateClass$x([observable], _BaseDropdown.prototype, "open", 2);
8044
+ __decorateClass$x([attr], _BaseDropdown.prototype, "placeholder", 2);
8045
+ __decorateClass$x([attr({
7908
8046
  mode: "boolean"
7909
8047
  })], _BaseDropdown.prototype, "required", 2);
7910
- __decorateClass$z([attr], _BaseDropdown.prototype, "type", 2);
7911
- __decorateClass$z([attr({
8048
+ __decorateClass$x([attr], _BaseDropdown.prototype, "type", 2);
8049
+ __decorateClass$x([attr({
7912
8050
  attribute: "value"
7913
8051
  })], _BaseDropdown.prototype, "valueAttribute", 2);
7914
8052
  let BaseDropdown = _BaseDropdown;
7915
8053
 
7916
- var __defProp$y = Object.defineProperty;
7917
- var __getOwnPropDesc$y = Object.getOwnPropertyDescriptor;
7918
- var __decorateClass$y = (decorators, target, key, kind) => {
7919
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$y(target, key) : target;
8054
+ var __defProp$w = Object.defineProperty;
8055
+ var __getOwnPropDesc$w = Object.getOwnPropertyDescriptor;
8056
+ var __decorateClass$w = (decorators, target, key, kind) => {
8057
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$w(target, key) : target;
7920
8058
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7921
- if (kind && result) __defProp$y(target, key, result);
8059
+ if (kind && result) __defProp$w(target, key, result);
7922
8060
  return result;
7923
8061
  };
7924
8062
  class Dropdown extends BaseDropdown {
@@ -7927,21 +8065,21 @@ class Dropdown extends BaseDropdown {
7927
8065
  this.appearance = DropdownAppearance.outline;
7928
8066
  }
7929
8067
  }
7930
- __decorateClass$y([attr], Dropdown.prototype, "appearance", 2);
7931
- __decorateClass$y([attr], Dropdown.prototype, "size", 2);
8068
+ __decorateClass$w([attr], Dropdown.prototype, "appearance", 2);
8069
+ __decorateClass$w([attr], Dropdown.prototype, "size", 2);
7932
8070
 
7933
- const styles$s = css`
8071
+ const styles$q = css`
7934
8072
  ${display("inline-flex")}
7935
8073
 
7936
8074
  :host{anchor-name:--dropdown-trigger;box-sizing:border-box;color:${colorNeutralForeground1};cursor:pointer}:host(${placeholderShownState}){color:${colorNeutralForeground4}}.control{appearance:none;background-color:${colorNeutralBackground1};border-radius:${borderRadiusMedium};border:${strokeWidthThin} solid ${colorTransparentStroke};box-shadow:inset 0 0 0 ${strokeWidthThin} var(--control-border-color);box-sizing:border-box;color:inherit;column-gap:${spacingHorizontalXXS};display:inline-flex;justify-content:space-between;min-width:160px;overflow:hidden;padding:${spacingVerticalSNudge} ${spacingHorizontalMNudge};position:relative;text-align:start;width:100%;z-index:1;${typographyBody1Styles}}:host([size='small']) .control{column-gap:${spacingHorizontalXXS};padding:${spacingVerticalXS} ${spacingHorizontalSNudge};${typographyCaption1Styles}}:host([size='large']) .control{column-gap:${spacingHorizontalS};padding:${spacingVerticalS} ${spacingHorizontalM};${typographyBody2Styles}}::slotted(:is(input,button)){all:unset;flex:1 1 auto}::slotted(button){cursor:pointer}::slotted(input){cursor:text}:where(slot[name='indicator'] > *,::slotted([slot='indicator'])){all:unset;align-items:center;appearance:none;aspect-ratio:1;color:${colorNeutralForeground3};display:inline-flex;justify-content:center;width:20px}:host([size='small']) :where(slot[name='indicator'] > *,::slotted([slot='indicator'])){width:16px}:host([size='large']) :where(slot[name='indicator'] > *,::slotted([slot='indicator'])){width:24px}.control::after,.control::before{content:'' / '';inset:auto 0 0;pointer-events:none;position:absolute}.control::before{height:${strokeWidthThin}}.control::after{background-color:${colorCompoundBrandStroke};height:${strokeWidthThick};scale:0 1;transition:scale ${durationUltraFast} ${curveDecelerateMid}}:host(:where(:focus-within)) .control{border-radius:${borderRadiusMedium};box-shadow:inset 0 0 0 1px ${colorStrokeFocus1};outline:${strokeWidthThick} solid ${colorStrokeFocus2}}:host(:where(${openState},:focus-within)) .control::after{scale:1 1;transition-duration:${durationNormal};transition-timing-function:${curveAccelerateMid}}:host(:where([appearance='outline'],[appearance='transparent'])) .control::before{background-color:${colorNeutralStrokeAccessible}}:host([appearance='transparent']) .control{--control-border-color:${colorTransparentStrokeInteractive};background-color:${colorTransparentBackground};border-radius:${borderRadiusNone}}:host([appearance='outline']) .control{--control-border-color:${colorNeutralStroke1}}:host([appearance='outline']) .control:hover{--control-border-color:${colorNeutralStroke1Hover}}:host(:where([appearance='outline'],[appearance='transparent'])) .control:hover::before{background-color:${colorNeutralStrokeAccessibleHover}}:host([appearance='outline']) .control:hover::after{background-color:${colorCompoundBrandBackgroundHover}}:host([appearance='outline']) .control:active{--control-border-color:${colorNeutralStroke1Pressed}}:host(:where([appearance='outline'],[appearance='transparent'])) .control:active::before{background-color:${colorNeutralStrokeAccessiblePressed}}:host(:where([appearance='outline'],[appearance='transparent'])) .control:active::after{background-color:${colorCompoundBrandBackgroundPressed}}:host([appearance='filled-darker']) .control{background-color:${colorNeutralBackground3}}:host(:where([appearance='filled-lighter'],[appearance='filled-darker'])) .control{--control-border-color:${colorTransparentStroke}}:host(:disabled),:host(:disabled) ::slotted(:where(button,input)){cursor:not-allowed}:host(:disabled) .control::before,:host(:disabled) .control::after{content:none}:host(:disabled) .control:is(*,:active,:hover),:host(:disabled) :where(slot[name='indicator'] > *,::slotted([slot='indicator'])){--control-border-color:${colorNeutralStrokeDisabled};background-color:${colorNeutralBackgroundDisabled};color:${colorNeutralForegroundDisabled}}::slotted([popover]:not(:popover-open)){display:none}@supports not (anchor-name:--anchor){:host{--listbox-max-height:50vh;--margin-offset:calc(${lineHeightBase300} + (${spacingVerticalSNudge} * 2) + ${strokeWidthThin})}:host([size='small']){--margin-offset:calc(${lineHeightBase200} + (${spacingVerticalXS} * 2) + ${strokeWidthThin})}:host([size='large']){--margin-offset:calc(${lineHeightBase400} + (${spacingVerticalS} * 2) + ${strokeWidthThin})}}@media (forced-colors:active){:host(:disabled) .control{border-color:GrayText}:host(:disabled) :where(slot[name='indicator'] > *,::slotted([slot='indicator'])){color:GrayText}`;
7937
8075
 
7938
- const definition$t = Dropdown.compose({
8076
+ const definition$r = Dropdown.compose({
7939
8077
  name: `${FluentDesignSystem.prefix}-dropdown`,
7940
- template: template$t,
7941
- styles: styles$s
8078
+ template: template$r,
8079
+ styles: styles$q
7942
8080
  });
7943
8081
 
7944
- definition$t.define(FluentDesignSystem.registry);
8082
+ definition$r.define(FluentDesignSystem.registry);
7945
8083
 
7946
8084
  const LabelPosition = {
7947
8085
  above: "above",
@@ -7962,12 +8100,12 @@ const ValidationFlags = {
7962
8100
  valid: "valid"
7963
8101
  };
7964
8102
 
7965
- var __defProp$x = Object.defineProperty;
7966
- var __getOwnPropDesc$x = Object.getOwnPropertyDescriptor;
7967
- var __decorateClass$x = (decorators, target, key, kind) => {
7968
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$x(target, key) : target;
8103
+ var __defProp$v = Object.defineProperty;
8104
+ var __getOwnPropDesc$v = Object.getOwnPropertyDescriptor;
8105
+ var __decorateClass$v = (decorators, target, key, kind) => {
8106
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$v(target, key) : target;
7969
8107
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7970
- if (kind && result) __defProp$x(target, key, result);
8108
+ if (kind && result) __defProp$v(target, key, result);
7971
8109
  return result;
7972
8110
  };
7973
8111
  class BaseField extends FASTElement {
@@ -8146,17 +8284,17 @@ class BaseField extends FASTElement {
8146
8284
  }
8147
8285
  }
8148
8286
  }
8149
- __decorateClass$x([observable], BaseField.prototype, "labelSlot", 2);
8150
- __decorateClass$x([observable], BaseField.prototype, "messageSlot", 2);
8151
- __decorateClass$x([observable], BaseField.prototype, "slottedInputs", 2);
8152
- __decorateClass$x([observable], BaseField.prototype, "input", 2);
8287
+ __decorateClass$v([observable], BaseField.prototype, "labelSlot", 2);
8288
+ __decorateClass$v([observable], BaseField.prototype, "messageSlot", 2);
8289
+ __decorateClass$v([observable], BaseField.prototype, "slottedInputs", 2);
8290
+ __decorateClass$v([observable], BaseField.prototype, "input", 2);
8153
8291
 
8154
- var __defProp$w = Object.defineProperty;
8155
- var __getOwnPropDesc$w = Object.getOwnPropertyDescriptor;
8156
- var __decorateClass$w = (decorators, target, key, kind) => {
8157
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$w(target, key) : target;
8292
+ var __defProp$u = Object.defineProperty;
8293
+ var __getOwnPropDesc$u = Object.getOwnPropertyDescriptor;
8294
+ var __decorateClass$u = (decorators, target, key, kind) => {
8295
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$u(target, key) : target;
8158
8296
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8159
- if (kind && result) __defProp$w(target, key, result);
8297
+ if (kind && result) __defProp$u(target, key, result);
8160
8298
  return result;
8161
8299
  };
8162
8300
  class Field extends BaseField {
@@ -8165,71 +8303,71 @@ class Field extends BaseField {
8165
8303
  this.labelPosition = LabelPosition.above;
8166
8304
  }
8167
8305
  }
8168
- __decorateClass$w([attr({
8306
+ __decorateClass$u([attr({
8169
8307
  attribute: "label-position"
8170
8308
  })], Field.prototype, "labelPosition", 2);
8171
8309
 
8172
- const styles$r = css`
8310
+ const styles$p = css`
8173
8311
  ${display("inline-grid")}
8174
8312
 
8175
8313
  :host{color:${colorNeutralForeground1};align-items:center;gap:0 ${spacingHorizontalM};justify-items:start}:has([slot='message']){color:${colorNeutralForeground1};row-gap:${spacingVerticalS}}:not(::slotted([slot='label'])){gap:0}:host([label-position='before']){grid-template-areas:'label input' 'label message'}:host([label-position='after']){gap:0;grid-template-areas:'input label' 'message message';grid-template-columns:auto 1fr}:host([label-position='after']) ::slotted([slot='input']){margin-inline-end:${spacingHorizontalM}}:host([label-position='above']){grid-template-areas:'label' 'input' 'message';row-gap:${spacingVerticalXXS}}:host([label-position='below']){grid-template-areas:'input' 'label' 'message';justify-items:center}:host([label-position='below']) ::slotted([slot='label']){margin-block-start:${spacingVerticalM}}:host(${requiredState}) ::slotted([slot='label'])::after{content:'*' / '';color:${colorPaletteRedForeground1};margin-inline-start:${spacingHorizontalXS}}::slotted([slot='input']){grid-area:input}::slotted([slot='message']){color:${colorNeutralForeground3};font-family:${fontFamilyBase};font-size:${fontSizeBase200};font-weight:${fontWeightRegular};grid-area:message;line-height:${lineHeightBase200};margin-block-start:${spacingVerticalXXS}}:host(${focusVisibleState}:focus-within){border-radius:${borderRadiusMedium};outline:${strokeWidthThick} solid ${colorStrokeFocus2}}::slotted(label),::slotted([slot='label']){cursor:inherit;display:inline-flex;font-family:${fontFamilyBase};font-size:${fontSizeBase300};font-weight:${fontWeightRegular};grid-area:label;line-height:${lineHeightBase300};justify-self:stretch;user-select:none}:host([size='small']) ::slotted(label){font-size:${fontSizeBase200};line-height:${lineHeightBase200}}:host([size='large']) ::slotted(label){font-size:${fontSizeBase400};line-height:${lineHeightBase400}}:host([size='large']) ::slotted(label),:host([weight='semibold']) ::slotted(label){font-weight:${fontWeightSemibold}}:host(${disabledState}){cursor:default}::slotted([flag]){display:none}:host(${badInputState}) ::slotted([flag='${ValidationFlags.badInput}']),:host(${customErrorState}) ::slotted([flag='${ValidationFlags.customError}']),:host(${patternMismatchState}) ::slotted([flag='${ValidationFlags.patternMismatch}']),:host(${rangeOverflowState}) ::slotted([flag='${ValidationFlags.rangeOverflow}']),:host(${rangeUnderflowState}) ::slotted([flag='${ValidationFlags.rangeUnderflow}']),:host(${stepMismatchState}) ::slotted([flag='${ValidationFlags.stepMismatch}']),:host(${tooLongState}) ::slotted([flag='${ValidationFlags.tooLong}']),:host(${tooShortState}) ::slotted([flag='${ValidationFlags.tooShort}']),:host(${typeMismatchState}) ::slotted([flag='${ValidationFlags.typeMismatch}']),:host(${valueMissingState}) ::slotted([flag='${ValidationFlags.valueMissing}']),:host(${validState}) ::slotted([flag='${ValidationFlags.valid}']){display:block}`;
8176
8314
 
8177
- const template$s = html`<template @click="${(x, c) => x.clickHandler(c.event)}" @change="${(x, c) => x.changeHandler(c.event)}" @focusin="${(x, c) => x.focusinHandler(c.event)}" @focusout="${(x, c) => x.focusoutHandler(c.event)}"><slot name="label" part="label" ${slotted("labelSlot")}></slot><slot name="input" part="input" ${slotted("slottedInputs")}></slot><slot name="message" part="message" ${slotted({
8315
+ const template$q = html`<template @click="${(x, c) => x.clickHandler(c.event)}" @change="${(x, c) => x.changeHandler(c.event)}" @focusin="${(x, c) => x.focusinHandler(c.event)}" @focusout="${(x, c) => x.focusoutHandler(c.event)}"><slot name="label" part="label" ${slotted("labelSlot")}></slot><slot name="input" part="input" ${slotted("slottedInputs")}></slot><slot name="message" part="message" ${slotted({
8178
8316
  property: "messageSlot",
8179
8317
  filter: elements("[flag]")
8180
8318
  })}></slot></template>`;
8181
8319
 
8182
- const definition$s = Field.compose({
8320
+ const definition$q = Field.compose({
8183
8321
  name: `${FluentDesignSystem.prefix}-field`,
8184
- template: template$s,
8185
- styles: styles$r,
8322
+ template: template$q,
8323
+ styles: styles$p,
8186
8324
  shadowOptions: {
8187
8325
  delegatesFocus: true
8188
8326
  }
8189
8327
  });
8190
8328
 
8191
- definition$s.define(FluentDesignSystem.registry);
8329
+ definition$q.define(FluentDesignSystem.registry);
8192
8330
 
8193
- var __defProp$v = Object.defineProperty;
8194
- var __getOwnPropDesc$v = Object.getOwnPropertyDescriptor;
8195
- var __decorateClass$v = (decorators, target, key, kind) => {
8196
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$v(target, key) : target;
8331
+ var __defProp$t = Object.defineProperty;
8332
+ var __getOwnPropDesc$t = Object.getOwnPropertyDescriptor;
8333
+ var __decorateClass$t = (decorators, target, key, kind) => {
8334
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$t(target, key) : target;
8197
8335
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8198
- if (kind && result) __defProp$v(target, key, result);
8336
+ if (kind && result) __defProp$t(target, key, result);
8199
8337
  return result;
8200
8338
  };
8201
8339
  class Image extends FASTElement {}
8202
- __decorateClass$v([attr({
8340
+ __decorateClass$t([attr({
8203
8341
  mode: "boolean"
8204
8342
  })], Image.prototype, "block", 2);
8205
- __decorateClass$v([attr({
8343
+ __decorateClass$t([attr({
8206
8344
  mode: "boolean"
8207
8345
  })], Image.prototype, "bordered", 2);
8208
- __decorateClass$v([attr({
8346
+ __decorateClass$t([attr({
8209
8347
  mode: "boolean"
8210
8348
  })], Image.prototype, "shadow", 2);
8211
- __decorateClass$v([attr], Image.prototype, "fit", 2);
8212
- __decorateClass$v([attr], Image.prototype, "shape", 2);
8349
+ __decorateClass$t([attr], Image.prototype, "fit", 2);
8350
+ __decorateClass$t([attr], Image.prototype, "shape", 2);
8213
8351
 
8214
- const template$r = html`<slot></slot>`;
8352
+ const template$p = html`<slot></slot>`;
8215
8353
 
8216
- const styles$q = css`
8354
+ const styles$o = css`
8217
8355
  :host{contain:content}:host ::slotted(img){box-sizing:border-box;min-height:8px;min-width:8px;display:inline-block}:host([block]) ::slotted(img){width:100%;height:auto}:host([bordered]) ::slotted(img){border:${strokeWidthThin} solid ${colorNeutralStroke2}}:host([fit='none']) ::slotted(img){object-fit:none;object-position:top left;height:100%;width:100%}:host([fit='center']) ::slotted(img){object-fit:none;object-position:center;height:100%;width:100%}:host([fit='contain']) ::slotted(img){object-fit:contain;object-position:center;height:100%;width:100%}:host([fit='cover']) ::slotted(img){object-fit:cover;object-position:center;height:100%;width:100%}:host([shadow]) ::slotted(img){box-shadow:${shadow4}}:host([shape='circular']) ::slotted(img){border-radius:${borderRadiusCircular}}:host([shape='rounded']) ::slotted(img){border-radius:${borderRadiusMedium}}`;
8218
8356
 
8219
- const definition$r = Image.compose({
8357
+ const definition$p = Image.compose({
8220
8358
  name: `${FluentDesignSystem.prefix}-image`,
8221
- template: template$r,
8222
- styles: styles$q
8359
+ template: template$p,
8360
+ styles: styles$o
8223
8361
  });
8224
8362
 
8225
- definition$r.define(FluentDesignSystem.registry);
8363
+ definition$p.define(FluentDesignSystem.registry);
8226
8364
 
8227
- var __defProp$u = Object.defineProperty;
8228
- var __getOwnPropDesc$u = Object.getOwnPropertyDescriptor;
8229
- var __decorateClass$u = (decorators, target, key, kind) => {
8230
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$u(target, key) : target;
8365
+ var __defProp$s = Object.defineProperty;
8366
+ var __getOwnPropDesc$s = Object.getOwnPropertyDescriptor;
8367
+ var __decorateClass$s = (decorators, target, key, kind) => {
8368
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$s(target, key) : target;
8231
8369
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8232
- if (kind && result) __defProp$u(target, key, result);
8370
+ if (kind && result) __defProp$s(target, key, result);
8233
8371
  return result;
8234
8372
  };
8235
8373
  class Label extends FASTElement {
@@ -8239,16 +8377,16 @@ class Label extends FASTElement {
8239
8377
  this.required = false;
8240
8378
  }
8241
8379
  }
8242
- __decorateClass$u([attr], Label.prototype, "size", 2);
8243
- __decorateClass$u([attr], Label.prototype, "weight", 2);
8244
- __decorateClass$u([attr({
8380
+ __decorateClass$s([attr], Label.prototype, "size", 2);
8381
+ __decorateClass$s([attr], Label.prototype, "weight", 2);
8382
+ __decorateClass$s([attr({
8245
8383
  mode: "boolean"
8246
8384
  })], Label.prototype, "disabled", 2);
8247
- __decorateClass$u([attr({
8385
+ __decorateClass$s([attr({
8248
8386
  mode: "boolean"
8249
8387
  })], Label.prototype, "required", 2);
8250
8388
 
8251
- const styles$p = css`
8389
+ const styles$n = css`
8252
8390
  ${display("inline-flex")}
8253
8391
 
8254
8392
  :host{color:${colorNeutralForeground1};cursor:pointer;font-family:${fontFamilyBase};font-size:${fontSizeBase300};font-weight:${fontWeightRegular};line-height:${lineHeightBase300};user-select:none}.asterisk{color:${colorPaletteRedForeground1};margin-inline-start:${spacingHorizontalXS}}:host([size='small']){font-size:${fontSizeBase200};line-height:${lineHeightBase200}}:host([size='large']){font-size:${fontSizeBase400};line-height:${lineHeightBase400}}:host(:is([size='large'],[weight='semibold'])){font-weight:${fontWeightSemibold}}:host([disabled]),:host([disabled]) .asterisk{color:${colorNeutralForegroundDisabled}}`;
@@ -8256,22 +8394,22 @@ const styles$p = css`
8256
8394
  function labelTemplate() {
8257
8395
  return html`<slot></slot><span part="asterisk" class="asterisk" aria-hidden="true" ?hidden="${x => !x.required}">*</span>`;
8258
8396
  }
8259
- const template$q = labelTemplate();
8397
+ const template$o = labelTemplate();
8260
8398
 
8261
- const definition$q = Label.compose({
8399
+ const definition$o = Label.compose({
8262
8400
  name: `${FluentDesignSystem.prefix}-label`,
8263
- template: template$q,
8264
- styles: styles$p
8401
+ template: template$o,
8402
+ styles: styles$n
8265
8403
  });
8266
8404
 
8267
- definition$q.define(FluentDesignSystem.registry);
8405
+ definition$o.define(FluentDesignSystem.registry);
8268
8406
 
8269
- var __defProp$t = Object.defineProperty;
8270
- var __getOwnPropDesc$t = Object.getOwnPropertyDescriptor;
8271
- var __decorateClass$t = (decorators, target, key, kind) => {
8272
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$t(target, key) : target;
8407
+ var __defProp$r = Object.defineProperty;
8408
+ var __getOwnPropDesc$r = Object.getOwnPropertyDescriptor;
8409
+ var __decorateClass$r = (decorators, target, key, kind) => {
8410
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$r(target, key) : target;
8273
8411
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8274
- if (kind && result) __defProp$t(target, key, result);
8412
+ if (kind && result) __defProp$r(target, key, result);
8275
8413
  return result;
8276
8414
  };
8277
8415
  class Link extends BaseAnchor {
@@ -8280,12 +8418,12 @@ class Link extends BaseAnchor {
8280
8418
  this.inline = false;
8281
8419
  }
8282
8420
  }
8283
- __decorateClass$t([attr], Link.prototype, "appearance", 2);
8284
- __decorateClass$t([attr({
8421
+ __decorateClass$r([attr], Link.prototype, "appearance", 2);
8422
+ __decorateClass$r([attr({
8285
8423
  mode: "boolean"
8286
8424
  })], Link.prototype, "inline", 2);
8287
8425
 
8288
- const styles$o = css`
8426
+ const styles$m = css`
8289
8427
  ${display("inline")}
8290
8428
 
8291
8429
  :host{position:relative;box-sizing:border-box;background-color:transparent;color:${colorBrandForegroundLink};cursor:pointer;font-family:${fontFamilyBase};font-size:${fontSizeBase300};font-weight:${fontWeightRegular};overflow:inherit;text-align:start;text-decoration:none;text-decoration-thickness:${strokeWidthThin};text-overflow:inherit;user-select:text}:host(:is(:hover,:focus-visible)){outline:none;text-decoration-line:underline}@media (hover:hover){:host(:hover){color:${colorBrandForegroundLinkHover}}:host(:active){color:${colorBrandForegroundLinkPressed}}:host([appearance='subtle']:hover){color:${colorNeutralForeground2LinkHover}}:host([appearance='subtle']:active){color:${colorNeutralForeground2LinkPressed}}}:host([appearance='subtle']){color:${colorNeutralForeground2Link}}:host-context(:is(h1,h2,h3,h4,h5,h6,p,fluent-text)),:host([inline]){font:inherit;text-decoration:underline}:host(:not([href])){color:inherit;text-decoration:none}::slotted(a){position:absolute;inset:0}`.withBehaviors(forcedColorsStylesheetBehavior(css`
@@ -8294,28 +8432,27 @@ const styles$o = css`
8294
8432
  function anchorTemplate() {
8295
8433
  return html`<template tabindex="0" @click="${(x, c) => x.clickHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}"><slot></slot></template>`;
8296
8434
  }
8297
- const template$p = anchorTemplate();
8435
+ const template$n = anchorTemplate();
8298
8436
 
8299
- const definition$p = Link.compose({
8437
+ const definition$n = Link.compose({
8300
8438
  name: `${FluentDesignSystem.prefix}-link`,
8301
- template: template$p,
8302
- styles: styles$o
8439
+ template: template$n,
8440
+ styles: styles$m
8303
8441
  });
8304
8442
 
8305
- definition$p.define(FluentDesignSystem.registry);
8443
+ definition$n.define(FluentDesignSystem.registry);
8306
8444
 
8307
- var __defProp$s = Object.defineProperty;
8308
- var __getOwnPropDesc$s = Object.getOwnPropertyDescriptor;
8309
- var __decorateClass$s = (decorators, target, key, kind) => {
8310
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$s(target, key) : target;
8445
+ var __defProp$q = Object.defineProperty;
8446
+ var __getOwnPropDesc$q = Object.getOwnPropertyDescriptor;
8447
+ var __decorateClass$q = (decorators, target, key, kind) => {
8448
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$q(target, key) : target;
8311
8449
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8312
- if (kind && result) __defProp$s(target, key, result);
8450
+ if (kind && result) __defProp$q(target, key, result);
8313
8451
  return result;
8314
8452
  };
8315
8453
  class Listbox extends FASTElement {
8316
8454
  constructor() {
8317
8455
  super();
8318
- this.id = uniqueId("listbox-");
8319
8456
  /**
8320
8457
  * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
8321
8458
  *
@@ -8324,6 +8461,15 @@ class Listbox extends FASTElement {
8324
8461
  this.elementInternals = this.attachInternals();
8325
8462
  this.elementInternals.role = "listbox";
8326
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
+ }
8327
8473
  /**
8328
8474
  * Updates the multiple selection state of the listbox and its options.
8329
8475
  *
@@ -8403,6 +8549,14 @@ class Listbox extends FASTElement {
8403
8549
  }
8404
8550
  return true;
8405
8551
  }
8552
+ connectedCallback() {
8553
+ super.connectedCallback();
8554
+ waitForConnectedDescendants(this, () => {
8555
+ this.id = this.id || uniqueId("listbox-");
8556
+ }, {
8557
+ shallow: true
8558
+ });
8559
+ }
8406
8560
  /**
8407
8561
  * Handles observable subscriptions for the listbox.
8408
8562
  *
@@ -8450,43 +8604,41 @@ class Listbox extends FASTElement {
8450
8604
  * @public
8451
8605
  */
8452
8606
  slotchangeHandler(e) {
8453
- const target = e.target;
8454
8607
  waitForConnectedDescendants(this, () => {
8455
- const options = target.assignedElements().filter(option => isDropdownOption(option));
8456
- this.options = options;
8608
+ if (this.defaultSlot) {
8609
+ const options = this.defaultSlot.assignedElements().filter(option => isDropdownOption(option));
8610
+ this.options = options;
8611
+ }
8457
8612
  });
8458
8613
  }
8459
8614
  }
8460
- __decorateClass$s([attr({
8461
- attribute: "id",
8462
- mode: "fromView"
8463
- })], Listbox.prototype, "id", 2);
8464
- __decorateClass$s([observable], Listbox.prototype, "multiple", 2);
8465
- __decorateClass$s([observable], Listbox.prototype, "options", 2);
8466
- __decorateClass$s([observable], Listbox.prototype, "selectedIndex", 2);
8467
- __decorateClass$s([observable], Listbox.prototype, "dropdown", 2);
8615
+ __decorateClass$q([observable], Listbox.prototype, "defaultSlot", 2);
8616
+ __decorateClass$q([observable], Listbox.prototype, "multiple", 2);
8617
+ __decorateClass$q([observable], Listbox.prototype, "options", 2);
8618
+ __decorateClass$q([observable], Listbox.prototype, "selectedIndex", 2);
8619
+ __decorateClass$q([observable], Listbox.prototype, "dropdown", 2);
8468
8620
 
8469
- const styles$n = css`
8621
+ const styles$l = css`
8470
8622
  ${display("inline-flex")}
8471
8623
 
8472
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%}}`;
8473
8625
 
8474
8626
  function listboxTemplate() {
8475
- 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>`;
8476
8628
  }
8477
- const template$o = listboxTemplate();
8629
+ const template$m = listboxTemplate();
8478
8630
 
8479
- const definition$o = Listbox.compose({
8631
+ const definition$m = Listbox.compose({
8480
8632
  name: `${FluentDesignSystem.prefix}-listbox`,
8481
- template: template$o,
8482
- styles: styles$n
8633
+ template: template$m,
8634
+ styles: styles$l
8483
8635
  });
8484
8636
 
8485
- definition$o.define(FluentDesignSystem.registry);
8637
+ definition$m.define(FluentDesignSystem.registry);
8486
8638
 
8487
8639
  class MenuButton extends Button {}
8488
8640
 
8489
- const template$n = buttonTemplate$1({
8641
+ const template$l = buttonTemplate$1({
8490
8642
  end: html.partial(/* html */
8491
8643
  `
8492
8644
  <svg slot="end" fill="currentColor" aria-hidden="true" width="1em" height="1em" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
@@ -8495,13 +8647,13 @@ const template$n = buttonTemplate$1({
8495
8647
  `)
8496
8648
  });
8497
8649
 
8498
- const definition$n = MenuButton.compose({
8650
+ const definition$l = MenuButton.compose({
8499
8651
  name: `${FluentDesignSystem.prefix}-menu-button`,
8500
- template: template$n,
8501
- styles: styles$E
8652
+ template: template$l,
8653
+ styles: styles$C
8502
8654
  });
8503
8655
 
8504
- definition$n.define(FluentDesignSystem.registry);
8656
+ definition$l.define(FluentDesignSystem.registry);
8505
8657
 
8506
8658
  const MenuItemRole = {
8507
8659
  /**
@@ -8529,12 +8681,12 @@ function isMenuItem(element, tagName = "-menu-item") {
8529
8681
  return element.tagName.toLowerCase().endsWith(tagName);
8530
8682
  }
8531
8683
 
8532
- var __defProp$r = Object.defineProperty;
8533
- var __getOwnPropDesc$r = Object.getOwnPropertyDescriptor;
8534
- var __decorateClass$r = (decorators, target, key, kind) => {
8535
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$r(target, key) : target;
8684
+ var __defProp$p = Object.defineProperty;
8685
+ var __getOwnPropDesc$p = Object.getOwnPropertyDescriptor;
8686
+ var __decorateClass$p = (decorators, target, key, kind) => {
8687
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$p(target, key) : target;
8536
8688
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8537
- if (kind && result) __defProp$r(target, key, result);
8689
+ if (kind && result) __defProp$p(target, key, result);
8538
8690
  return result;
8539
8691
  };
8540
8692
  class MenuItem extends FASTElement {
@@ -8723,21 +8875,21 @@ class MenuItem extends FASTElement {
8723
8875
  this.elementInternals.ariaChecked = this.role !== MenuItemRole.menuitem ? `${!!this.checked}` : null;
8724
8876
  }
8725
8877
  }
8726
- __decorateClass$r([attr({
8878
+ __decorateClass$p([attr({
8727
8879
  mode: "boolean"
8728
8880
  })], MenuItem.prototype, "disabled", 2);
8729
- __decorateClass$r([attr], MenuItem.prototype, "role", 2);
8730
- __decorateClass$r([attr({
8881
+ __decorateClass$p([attr], MenuItem.prototype, "role", 2);
8882
+ __decorateClass$p([attr({
8731
8883
  mode: "boolean"
8732
8884
  })], MenuItem.prototype, "checked", 2);
8733
- __decorateClass$r([attr({
8885
+ __decorateClass$p([attr({
8734
8886
  mode: "boolean"
8735
8887
  })], MenuItem.prototype, "hidden", 2);
8736
- __decorateClass$r([observable], MenuItem.prototype, "slottedSubmenu", 2);
8737
- __decorateClass$r([observable], MenuItem.prototype, "submenu", 2);
8888
+ __decorateClass$p([observable], MenuItem.prototype, "slottedSubmenu", 2);
8889
+ __decorateClass$p([observable], MenuItem.prototype, "submenu", 2);
8738
8890
  applyMixins(MenuItem, StartEnd);
8739
8891
 
8740
- const styles$m = css`
8892
+ const styles$k = css`
8741
8893
  ${display("grid")}
8742
8894
 
8743
8895
  :host{--indent:0;align-items:center;background:${colorNeutralBackground1};border-radius:${borderRadiusMedium};color:${colorNeutralForeground2};contain:layout;cursor:pointer;flex-shrink:0;font:${fontWeightRegular} ${fontSizeBase300} / ${lineHeightBase300} ${fontFamilyBase};grid-gap:4px;grid-template-columns:20px 20px auto 20px;height:32px;overflow:visible;padding:0 10px}:host(:hover){background:${colorNeutralBackground1Hover};color:${colorNeutralForeground2Hover}}:host(:active){background-color:${colorNeutralBackground1Selected};color:${colorNeutralForeground2Pressed}}:host(:active) ::slotted([slot='start']){color:${colorCompoundBrandForeground1Pressed}}:host(${disabledState}){background-color:${colorNeutralBackgroundDisabled};color:${colorNeutralForegroundDisabled}}:host(${disabledState}) ::slotted([slot='start']),:host(${disabledState}) ::slotted([slot='end']){color:${colorNeutralForegroundDisabled}}:host(:focus-visible){border-radius:${borderRadiusMedium};outline:2px solid ${colorStrokeFocus2}}.content{white-space:nowrap;flex-grow:1;grid-column:auto / span 2;padding:0 2px}:host(:not(${checkedState})) .indicator,:host(:not(${checkedState})) ::slotted([slot='indicator']),:host(:not(${submenuState})) .submenu-glyph,:host(:not(${submenuState})) ::slotted([slot='submenu-glyph']){display:none}::slotted([slot='end']){color:${colorNeutralForeground3};font:${fontWeightRegular} ${fontSizeBase200} / ${lineHeightBase200} ${fontFamilyBase};white-space:nowrap}:host([data-indent='1']){--indent:1}:host([data-indent='2']){--indent:2;grid-template-columns:20px 20px auto auto}:host(${submenuState}){grid-template-columns:20px auto auto 20px}:host([data-indent='2']${submenuState}){grid-template-columns:20px 20px auto auto 20px}.indicator,::slotted([slot='indicator']){grid-column:1 / span 1;width:20px}::slotted([slot='start']){display:inline-flex;grid-column:calc(var(--indent)) / span 1}.content{grid-column:calc(var(--indent) + 1) / span 1}::slotted([slot='end']){grid-column:calc(var(--indent) + 2) / span 1;justify-self:end}.submenu-glyph,::slotted([slot='submenu-glyph']){grid-column:-2 / span 1;justify-self:end}@layer popover{:host{anchor-name:--menu-trigger;position:relative}::slotted([popover]){margin:0;max-height:var(--menu-max-height,auto);position:absolute;position-anchor:--menu-trigger;position-area:inline-end span-block-end;position-try-fallbacks:flip-inline,block-start,block-end;z-index:1}::slotted([popover]:not(:popover-open)){display:none}::slotted([popover]:popover-open){inset:unset}@supports not (anchor-name:--menu-trigger){::slotted([popover]){align-self:start}}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
@@ -8750,25 +8902,25 @@ function menuItemTemplate(options = {}) {
8750
8902
  property: "slottedSubmenu"
8751
8903
  })}></slot></template>`;
8752
8904
  }
8753
- const template$m = menuItemTemplate({
8905
+ const template$k = menuItemTemplate({
8754
8906
  indicator: Checkmark16Filled,
8755
8907
  submenuGlyph: chevronRight16Filled
8756
8908
  });
8757
8909
 
8758
- const definition$m = MenuItem.compose({
8910
+ const definition$k = MenuItem.compose({
8759
8911
  name: `${FluentDesignSystem.prefix}-menu-item`,
8760
- template: template$m,
8761
- styles: styles$m
8912
+ template: template$k,
8913
+ styles: styles$k
8762
8914
  });
8763
8915
 
8764
- definition$m.define(FluentDesignSystem.registry);
8916
+ definition$k.define(FluentDesignSystem.registry);
8765
8917
 
8766
- var __defProp$q = Object.defineProperty;
8767
- var __getOwnPropDesc$q = Object.getOwnPropertyDescriptor;
8768
- var __decorateClass$q = (decorators, target, key, kind) => {
8769
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$q(target, key) : target;
8918
+ var __defProp$o = Object.defineProperty;
8919
+ var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor;
8920
+ var __decorateClass$o = (decorators, target, key, kind) => {
8921
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$o(target, key) : target;
8770
8922
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8771
- if (kind && result) __defProp$q(target, key, result);
8923
+ if (kind && result) __defProp$o(target, key, result);
8772
8924
  return result;
8773
8925
  };
8774
8926
  const _MenuList = class _MenuList extends FASTElement {
@@ -8826,7 +8978,7 @@ const _MenuList = class _MenuList extends FASTElement {
8826
8978
  if (changedMenuItem.role === "menuitemradio" && changedMenuItem.checked === true) {
8827
8979
  for (let i = changeItemIndex - 1; i >= 0; --i) {
8828
8980
  const item = this.menuItems[i];
8829
- const role = item.getAttribute("role");
8981
+ const role = item.role;
8830
8982
  if (role === MenuItemRole.menuitemradio) {
8831
8983
  item.checked = false;
8832
8984
  }
@@ -8837,7 +8989,7 @@ const _MenuList = class _MenuList extends FASTElement {
8837
8989
  const maxIndex = this.menuItems.length - 1;
8838
8990
  for (let i = changeItemIndex + 1; i <= maxIndex; ++i) {
8839
8991
  const item = this.menuItems[i];
8840
- const role = item.getAttribute("role");
8992
+ const role = item.role;
8841
8993
  if (role === MenuItemRole.menuitemradio) {
8842
8994
  item.checked = false;
8843
8995
  }
@@ -8851,7 +9003,7 @@ const _MenuList = class _MenuList extends FASTElement {
8851
9003
  * check if the item is a menu item
8852
9004
  */
8853
9005
  this.isMenuItemElement = el => {
8854
- return isMenuItem(el) || isHTMLElement(el) && el.getAttribute("role") in _MenuList.focusableElementRoles;
9006
+ return isMenuItem(el) || isHTMLElement(el) && !!el.role && el.role in _MenuList.focusableElementRoles;
8855
9007
  };
8856
9008
  /**
8857
9009
  * check if the item is focusable
@@ -8924,7 +9076,7 @@ const _MenuList = class _MenuList extends FASTElement {
8924
9076
  });
8925
9077
  }
8926
9078
  static elementIndent(el) {
8927
- const role = el.getAttribute("role");
9079
+ const role = el.role;
8928
9080
  const startSlot = el.querySelector("[slot=start]");
8929
9081
  if (role && role !== MenuItemRole.menuitem) {
8930
9082
  return startSlot ? 2 : 1;
@@ -8982,10 +9134,10 @@ const _MenuList = class _MenuList extends FASTElement {
8982
9134
  }
8983
9135
  };
8984
9136
  _MenuList.focusableElementRoles = MenuItemRole;
8985
- __decorateClass$q([observable], _MenuList.prototype, "items", 2);
9137
+ __decorateClass$o([observable], _MenuList.prototype, "items", 2);
8986
9138
  let MenuList = _MenuList;
8987
9139
 
8988
- const styles$l = css`
9140
+ const styles$j = css`
8989
9141
  ${display("flex")}
8990
9142
 
8991
9143
  :host{flex-direction:column;height:fit-content;max-width:300px;min-width:160px;width:auto;background-color:${colorNeutralBackground1};border:1px solid ${colorTransparentStroke};border-radius:${borderRadiusMedium};box-shadow:${shadow16};padding:4px;row-gap:2px}`;
@@ -8993,29 +9145,27 @@ const styles$l = css`
8993
9145
  function menuTemplate$1() {
8994
9146
  return html`<template slot="${x => x.slot ? x.slot : x.isNestedMenu() ? "submenu" : void 0}" @keydown="${(x, c) => x.handleMenuKeyDown(c.event)}" @focusout="${(x, c) => x.handleFocusOut(c.event)}"><slot ${slotted("items")}></slot></template>`;
8995
9147
  }
8996
- const template$l = menuTemplate$1();
9148
+ const template$j = menuTemplate$1();
8997
9149
 
8998
- const definition$l = MenuList.compose({
9150
+ const definition$j = MenuList.compose({
8999
9151
  name: `${FluentDesignSystem.prefix}-menu-list`,
9000
- template: template$l,
9001
- styles: styles$l
9152
+ template: template$j,
9153
+ styles: styles$j
9002
9154
  });
9003
9155
 
9004
- definition$l.define(FluentDesignSystem.registry);
9156
+ definition$j.define(FluentDesignSystem.registry);
9005
9157
 
9006
- var __defProp$p = Object.defineProperty;
9007
- var __getOwnPropDesc$p = Object.getOwnPropertyDescriptor;
9008
- var __decorateClass$p = (decorators, target, key, kind) => {
9009
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$p(target, key) : target;
9158
+ var __defProp$n = Object.defineProperty;
9159
+ var __getOwnPropDesc$n = Object.getOwnPropertyDescriptor;
9160
+ var __decorateClass$n = (decorators, target, key, kind) => {
9161
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$n(target, key) : target;
9010
9162
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9011
- if (kind && result) __defProp$p(target, key, result);
9163
+ if (kind && result) __defProp$n(target, key, result);
9012
9164
  return result;
9013
9165
  };
9014
9166
  class Menu extends FASTElement {
9015
9167
  constructor() {
9016
9168
  super(...arguments);
9017
- this.slottedMenuList = [];
9018
- this.slottedTriggers = [];
9019
9169
  /**
9020
9170
  * Defines whether the menu is open or not.
9021
9171
  * @internal
@@ -9103,6 +9253,15 @@ class Menu extends FASTElement {
9103
9253
  }
9104
9254
  };
9105
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
+ }
9106
9265
  /**
9107
9266
  * Called when the element is connected to the DOM.
9108
9267
  * Sets up the component.
@@ -9110,9 +9269,7 @@ class Menu extends FASTElement {
9110
9269
  */
9111
9270
  connectedCallback() {
9112
9271
  super.connectedCallback();
9113
- queueMicrotask(() => {
9114
- this.setComponent();
9115
- });
9272
+ this.setComponent();
9116
9273
  }
9117
9274
  /**
9118
9275
  * Called when the element is disconnected from the DOM.
@@ -9129,14 +9286,23 @@ class Menu extends FASTElement {
9129
9286
  * @public
9130
9287
  */
9131
9288
  setComponent() {
9132
- if (this.$fastController.isConnected && this.slottedMenuList.length && this.slottedTriggers.length) {
9133
- this._trigger = this.slottedTriggers[0];
9134
- 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;
9135
9298
  this._trigger.setAttribute("aria-haspopup", "true");
9136
9299
  this._trigger.setAttribute("aria-expanded", `${this._open}`);
9137
9300
  this._menuList.setAttribute("popover", this.openOnContext ? "manual" : "");
9301
+ this.removeListeners();
9138
9302
  this.addListeners();
9139
- }
9303
+ }, {
9304
+ shallow: true
9305
+ });
9140
9306
  }
9141
9307
  /**
9142
9308
  * Focuses on the menu list.
@@ -9292,30 +9458,30 @@ class Menu extends FASTElement {
9292
9458
  }
9293
9459
  }
9294
9460
  }
9295
- __decorateClass$p([attr({
9461
+ __decorateClass$n([attr({
9296
9462
  attribute: "open-on-hover",
9297
9463
  mode: "boolean"
9298
9464
  })], Menu.prototype, "openOnHover", 2);
9299
- __decorateClass$p([attr({
9465
+ __decorateClass$n([attr({
9300
9466
  attribute: "open-on-context",
9301
9467
  mode: "boolean"
9302
9468
  })], Menu.prototype, "openOnContext", 2);
9303
- __decorateClass$p([attr({
9469
+ __decorateClass$n([attr({
9304
9470
  attribute: "close-on-scroll",
9305
9471
  mode: "boolean"
9306
9472
  })], Menu.prototype, "closeOnScroll", 2);
9307
- __decorateClass$p([attr({
9473
+ __decorateClass$n([attr({
9308
9474
  attribute: "persist-on-item-click",
9309
9475
  mode: "boolean"
9310
9476
  })], Menu.prototype, "persistOnItemClick", 2);
9311
- __decorateClass$p([attr({
9477
+ __decorateClass$n([attr({
9312
9478
  mode: "boolean"
9313
9479
  })], Menu.prototype, "split", 2);
9314
- __decorateClass$p([observable], Menu.prototype, "slottedMenuList", 2);
9315
- __decorateClass$p([observable], Menu.prototype, "slottedTriggers", 2);
9316
- __decorateClass$p([observable], Menu.prototype, "primaryAction", 2);
9480
+ __decorateClass$n([observable], Menu.prototype, "slottedMenuList", 2);
9481
+ __decorateClass$n([observable], Menu.prototype, "slottedTriggers", 2);
9482
+ __decorateClass$n([observable], Menu.prototype, "primaryAction", 2);
9317
9483
 
9318
- const styles$k = css`
9484
+ const styles$i = css`
9319
9485
  ${display("inline-block")}
9320
9486
 
9321
9487
  ::slotted([slot='trigger']){anchor-name:--menu-trigger}::slotted([popover]){margin:0;max-height:var(--menu-max-height,auto);position-anchor:--menu-trigger;position-area:block-end span-inline-end;position-try-fallbacks:flip-block;position:absolute;z-index:1}:host([split]) ::slotted([popover]){position-area:block-end span-inline-start}::slotted([popover]:popover-open){inset:unset}::slotted([popover]:not(:popover-open)){display:none}:host([split]){display:inline-flex}:host([split]) ::slotted([slot='primary-action']){border-inline-end:${strokeWidthThin} solid ${colorNeutralStroke1};border-start-end-radius:0;border-end-end-radius:0}:host([split]) ::slotted([slot='primary-action']:focus-visible){z-index:1}:host([split]) ::slotted([slot='primary-action'][appearance='primary']){border-inline-end:${strokeWidthThin} solid white}:host([split]) ::slotted([slot='trigger']){border-inline-start:0;border-start-start-radius:0;border-end-start-radius:0}`;
@@ -9329,22 +9495,22 @@ function menuTemplate() {
9329
9495
  filter: elements()
9330
9496
  })}></slot></template>`;
9331
9497
  }
9332
- const template$k = menuTemplate();
9498
+ const template$i = menuTemplate();
9333
9499
 
9334
- const definition$k = Menu.compose({
9500
+ const definition$i = Menu.compose({
9335
9501
  name: `${FluentDesignSystem.prefix}-menu`,
9336
- template: template$k,
9337
- styles: styles$k
9502
+ template: template$i,
9503
+ styles: styles$i
9338
9504
  });
9339
9505
 
9340
- definition$k.define(FluentDesignSystem.registry);
9506
+ definition$i.define(FluentDesignSystem.registry);
9341
9507
 
9342
- var __defProp$o = Object.defineProperty;
9343
- var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor;
9344
- var __decorateClass$o = (decorators, target, key, kind) => {
9345
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$o(target, key) : target;
9508
+ var __defProp$m = Object.defineProperty;
9509
+ var __getOwnPropDesc$m = Object.getOwnPropertyDescriptor;
9510
+ var __decorateClass$m = (decorators, target, key, kind) => {
9511
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$m(target, key) : target;
9346
9512
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9347
- if (kind && result) __defProp$o(target, key, result);
9513
+ if (kind && result) __defProp$m(target, key, result);
9348
9514
  return result;
9349
9515
  };
9350
9516
  class MessageBar extends FASTElement {
@@ -9357,8 +9523,9 @@ class MessageBar extends FASTElement {
9357
9523
  */
9358
9524
  this.elementInternals = this.attachInternals();
9359
9525
  /**
9360
- * @public
9361
9526
  * Method to emit a `dismiss` event when the message bar is dismissed
9527
+ *
9528
+ * @public
9362
9529
  */
9363
9530
  this.dismissMessageBar = () => {
9364
9531
  this.$emit("dismiss", {});
@@ -9366,36 +9533,36 @@ class MessageBar extends FASTElement {
9366
9533
  this.elementInternals.role = "status";
9367
9534
  }
9368
9535
  }
9369
- __decorateClass$o([attr], MessageBar.prototype, "shape", 2);
9370
- __decorateClass$o([attr], MessageBar.prototype, "layout", 2);
9371
- __decorateClass$o([attr], MessageBar.prototype, "intent", 2);
9536
+ __decorateClass$m([attr], MessageBar.prototype, "shape", 2);
9537
+ __decorateClass$m([attr], MessageBar.prototype, "layout", 2);
9538
+ __decorateClass$m([attr], MessageBar.prototype, "intent", 2);
9372
9539
 
9373
- const styles$j = css`
9540
+ const styles$h = css`
9374
9541
  :host{display:grid;box-sizing:border-box;font-family:${fontFamilyBase};font-size:${fontSizeBase200};line-height:${lineHeightBase200};width:100%;background:${colorNeutralBackground3};border:1px solid ${colorNeutralStroke1};padding-inline:${spacingHorizontalM};border-radius:${borderRadiusMedium};min-height:36px;align-items:center;grid-template:'icon body actions dismiss' / auto 1fr auto auto;contain:layout style paint}:host([shape='square']){border-radius:0}:host([intent='success']){background-color:${colorPaletteGreenBackground1};border-color:${colorPaletteGreenBorder1}}:host([intent='warning']){background-color:${colorPaletteDarkOrangeBackground1};border-color:${colorPaletteDarkOrangeBorder1}}:host([intent='error']){background-color:${colorPaletteRedBackground1};border-color:${colorPaletteRedBorder1}}:host([layout='multiline']){grid-template-areas:'icon body dismiss'
9375
9542
  'actions actions actions';grid-template-columns:auto 1fr auto;grid-template-rows:auto auto 1fr;padding-block:${spacingVerticalMNudge};padding-inline:${spacingHorizontalM}}.content{grid-area:body;max-width:520px;padding-block:${spacingVerticalMNudge};padding-inline:0}:host([layout='multiline']) .content{padding:0}::slotted([slot='icon']){display:flex;grid-area:icon;flex-direction:column;align-items:center;color:${colorNeutralForeground3};margin-inline-end:${spacingHorizontalS}}:host([layout='multiline']) ::slotted([slot='icon']){align-items:start;height:100%}::slotted([slot='dismiss']){grid-area:dismiss}.actions{grid-area:actions;display:flex;justify-self:end;margin-inline-end:${spacingHorizontalS};gap:${spacingHorizontalS}}:host([layout='multiline']) .actions{margin-block-start:${spacingVerticalMNudge};margin-inline-end:0}:host([layout='multiline']) ::slotted([slot='dismiss']){align-items:start;height:100%;padding-block-start:${spacingVerticalS}}::slotted(*){font-size:inherit}`;
9376
9543
 
9377
9544
  function messageBarTemplate() {
9378
9545
  return html`<slot name="icon"></slot><div class="content"><slot></slot></div><div class="actions"><slot name="actions"></slot></div><slot name="dismiss"></slot>`;
9379
9546
  }
9380
- const template$j = messageBarTemplate();
9547
+ const template$h = messageBarTemplate();
9381
9548
 
9382
- const definition$j = MessageBar.compose({
9549
+ const definition$h = MessageBar.compose({
9383
9550
  name: `${FluentDesignSystem.prefix}-message-bar`,
9384
- template: template$j,
9385
- styles: styles$j,
9551
+ template: template$h,
9552
+ styles: styles$h,
9386
9553
  shadowOptions: {
9387
9554
  mode: FluentDesignSystem.shadowRootMode
9388
9555
  }
9389
9556
  });
9390
9557
 
9391
- definition$j.define(FluentDesignSystem.registry);
9558
+ definition$h.define(FluentDesignSystem.registry);
9392
9559
 
9393
- var __defProp$n = Object.defineProperty;
9394
- var __getOwnPropDesc$n = Object.getOwnPropertyDescriptor;
9395
- var __decorateClass$n = (decorators, target, key, kind) => {
9396
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$n(target, key) : target;
9560
+ var __defProp$l = Object.defineProperty;
9561
+ var __getOwnPropDesc$l = Object.getOwnPropertyDescriptor;
9562
+ var __decorateClass$l = (decorators, target, key, kind) => {
9563
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$l(target, key) : target;
9397
9564
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9398
- if (kind && result) __defProp$n(target, key, result);
9565
+ if (kind && result) __defProp$l(target, key, result);
9399
9566
  return result;
9400
9567
  };
9401
9568
  class DropdownOption extends FASTElement {
@@ -9529,7 +9696,7 @@ class DropdownOption extends FASTElement {
9529
9696
  set selected(next) {
9530
9697
  this.currentSelected = next;
9531
9698
  Updates.enqueue(() => {
9532
- if (this.$fastController.isConnected) {
9699
+ if (this.elementInternals) {
9533
9700
  this.setFormValue(next ? this.value : null);
9534
9701
  this.elementInternals.ariaSelected = next ? "true" : "false";
9535
9702
  toggleState(this.elementInternals, "selected", next);
@@ -9606,43 +9773,43 @@ class DropdownOption extends FASTElement {
9606
9773
  * @public
9607
9774
  */
9608
9775
  DropdownOption.formAssociated = true;
9609
- __decorateClass$n([observable], DropdownOption.prototype, "active", 2);
9610
- __decorateClass$n([attr({
9776
+ __decorateClass$l([observable], DropdownOption.prototype, "active", 2);
9777
+ __decorateClass$l([attr({
9611
9778
  attribute: "current-selected",
9612
9779
  mode: "boolean"
9613
9780
  })], DropdownOption.prototype, "currentSelected", 2);
9614
- __decorateClass$n([attr({
9781
+ __decorateClass$l([attr({
9615
9782
  attribute: "selected",
9616
9783
  mode: "boolean"
9617
9784
  })], DropdownOption.prototype, "defaultSelected", 2);
9618
- __decorateClass$n([observable], DropdownOption.prototype, "descriptionSlot", 2);
9619
- __decorateClass$n([observable], DropdownOption.prototype, "disabled", 2);
9620
- __decorateClass$n([attr({
9785
+ __decorateClass$l([observable], DropdownOption.prototype, "descriptionSlot", 2);
9786
+ __decorateClass$l([observable], DropdownOption.prototype, "disabled", 2);
9787
+ __decorateClass$l([attr({
9621
9788
  attribute: "disabled",
9622
9789
  mode: "boolean"
9623
9790
  })], DropdownOption.prototype, "disabledAttribute", 2);
9624
- __decorateClass$n([attr({
9791
+ __decorateClass$l([attr({
9625
9792
  attribute: "form"
9626
9793
  })], DropdownOption.prototype, "formAttribute", 2);
9627
- __decorateClass$n([attr({
9794
+ __decorateClass$l([attr({
9628
9795
  mode: "boolean"
9629
9796
  })], DropdownOption.prototype, "freeform", 2);
9630
- __decorateClass$n([attr({
9797
+ __decorateClass$l([attr({
9631
9798
  attribute: "id"
9632
9799
  })], DropdownOption.prototype, "id", 2);
9633
- __decorateClass$n([attr({
9800
+ __decorateClass$l([attr({
9634
9801
  attribute: "value",
9635
9802
  mode: "fromView"
9636
9803
  })], DropdownOption.prototype, "initialValue", 2);
9637
- __decorateClass$n([observable], DropdownOption.prototype, "multiple", 2);
9638
- __decorateClass$n([attr], DropdownOption.prototype, "name", 2);
9639
- __decorateClass$n([observable], DropdownOption.prototype, "start", 2);
9640
- __decorateClass$n([attr({
9804
+ __decorateClass$l([observable], DropdownOption.prototype, "multiple", 2);
9805
+ __decorateClass$l([attr], DropdownOption.prototype, "name", 2);
9806
+ __decorateClass$l([observable], DropdownOption.prototype, "start", 2);
9807
+ __decorateClass$l([attr({
9641
9808
  attribute: "text",
9642
9809
  mode: "fromView"
9643
9810
  })], DropdownOption.prototype, "textAttribute", 2);
9644
9811
 
9645
- const styles$i = css`
9812
+ const styles$g = css`
9646
9813
  ${display("inline-grid")}
9647
9814
 
9648
9815
  :host{-webkit-tap-highlight-color:transparent;${typographyBody1Styles}
@@ -9668,17 +9835,17 @@ function dropdownOptionTemplate(options = {}) {
9668
9835
  filter: elements("output")
9669
9836
  })}></slot></div><div class="description" part="description"><slot name="description" ${slotted("descriptionSlot")}></slot></div>`;
9670
9837
  }
9671
- const template$i = dropdownOptionTemplate({
9838
+ const template$g = dropdownOptionTemplate({
9672
9839
  checkedIndicator: checkedIndicator$1
9673
9840
  });
9674
9841
 
9675
- const definition$i = DropdownOption.compose({
9842
+ const definition$g = DropdownOption.compose({
9676
9843
  name: `${FluentDesignSystem.prefix}-option`,
9677
- template: template$i,
9678
- styles: styles$i
9844
+ template: template$g,
9845
+ styles: styles$g
9679
9846
  });
9680
9847
 
9681
- definition$i.define(FluentDesignSystem.registry);
9848
+ definition$g.define(FluentDesignSystem.registry);
9682
9849
 
9683
9850
  const ProgressBarValidationState = {
9684
9851
  success: "success",
@@ -9686,12 +9853,12 @@ const ProgressBarValidationState = {
9686
9853
  error: "error"
9687
9854
  };
9688
9855
 
9689
- var __defProp$m = Object.defineProperty;
9690
- var __getOwnPropDesc$m = Object.getOwnPropertyDescriptor;
9691
- var __decorateClass$m = (decorators, target, key, kind) => {
9692
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$m(target, key) : target;
9856
+ var __defProp$k = Object.defineProperty;
9857
+ var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor;
9858
+ var __decorateClass$k = (decorators, target, key, kind) => {
9859
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$k(target, key) : target;
9693
9860
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9694
- if (kind && result) __defProp$m(target, key, result);
9861
+ if (kind && result) __defProp$k(target, key, result);
9695
9862
  return result;
9696
9863
  };
9697
9864
  class BaseProgressBar extends FASTElement {
@@ -9706,6 +9873,13 @@ class BaseProgressBar extends FASTElement {
9706
9873
  this.validationState = null;
9707
9874
  this.elementInternals.role = "progressbar";
9708
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
+ }
9709
9883
  /**
9710
9884
  * Handles changes to validation-state attribute custom states
9711
9885
  * @param prev - the previous state
@@ -9720,7 +9894,9 @@ class BaseProgressBar extends FASTElement {
9720
9894
  * @internal
9721
9895
  */
9722
9896
  valueChanged(prev, next) {
9723
- this.elementInternals.ariaValueNow = typeof next === "number" ? `${next}` : null;
9897
+ if (this.elementInternals) {
9898
+ this.elementInternals.ariaValueNow = typeof next === "number" ? `${next}` : null;
9899
+ }
9724
9900
  this.setIndicatorWidth();
9725
9901
  }
9726
9902
  /**
@@ -9730,7 +9906,9 @@ class BaseProgressBar extends FASTElement {
9730
9906
  * @param next - The current min value
9731
9907
  */
9732
9908
  minChanged(prev, next) {
9733
- this.elementInternals.ariaValueMin = typeof next === "number" ? `${next}` : null;
9909
+ if (this.elementInternals) {
9910
+ this.elementInternals.ariaValueMin = typeof next === "number" ? `${next}` : null;
9911
+ }
9734
9912
  this.setIndicatorWidth();
9735
9913
  }
9736
9914
  /**
@@ -9741,56 +9919,63 @@ class BaseProgressBar extends FASTElement {
9741
9919
  * @internal
9742
9920
  */
9743
9921
  maxChanged(prev, next) {
9744
- this.elementInternals.ariaValueMax = typeof next === "number" ? `${next}` : null;
9745
- this.setIndicatorWidth();
9746
- }
9747
- connectedCallback() {
9748
- super.connectedCallback();
9922
+ if (this.elementInternals) {
9923
+ this.elementInternals.ariaValueMax = typeof next === "number" ? `${next}` : null;
9924
+ }
9749
9925
  this.setIndicatorWidth();
9750
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
+ */
9751
9934
  setIndicatorWidth() {
9752
- if (!this.$fastController.isConnected || CSS.supports("width: attr(value type(<number>))")) {
9753
- return;
9754
- }
9755
- if (typeof this.value !== "number") {
9756
- this.indicator.style.removeProperty("width");
9935
+ if (CSS.supports("width: attr(value type(<number>))")) {
9757
9936
  return;
9758
9937
  }
9759
- const min = this.min ?? 0;
9760
- const max = this.max ?? 100;
9761
- const value = this.value ?? 0;
9762
- const range = max - min;
9763
- const width = range === 0 ? 0 : Math.fround((value - min) / range * 100);
9764
- 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
+ });
9765
9950
  }
9766
9951
  }
9767
- __decorateClass$m([observable], BaseProgressBar.prototype, "indicator", 2);
9768
- __decorateClass$m([attr({
9952
+ __decorateClass$k([observable], BaseProgressBar.prototype, "indicator", 2);
9953
+ __decorateClass$k([attr({
9769
9954
  attribute: "validation-state"
9770
9955
  })], BaseProgressBar.prototype, "validationState", 2);
9771
- __decorateClass$m([attr({
9956
+ __decorateClass$k([attr({
9772
9957
  converter: nullableNumberConverter
9773
9958
  })], BaseProgressBar.prototype, "value", 2);
9774
- __decorateClass$m([attr({
9959
+ __decorateClass$k([attr({
9775
9960
  converter: nullableNumberConverter
9776
9961
  })], BaseProgressBar.prototype, "min", 2);
9777
- __decorateClass$m([attr({
9962
+ __decorateClass$k([attr({
9778
9963
  converter: nullableNumberConverter
9779
9964
  })], BaseProgressBar.prototype, "max", 2);
9780
9965
 
9781
- var __defProp$l = Object.defineProperty;
9782
- var __getOwnPropDesc$l = Object.getOwnPropertyDescriptor;
9783
- var __decorateClass$l = (decorators, target, key, kind) => {
9784
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$l(target, key) : target;
9966
+ var __defProp$j = Object.defineProperty;
9967
+ var __getOwnPropDesc$j = Object.getOwnPropertyDescriptor;
9968
+ var __decorateClass$j = (decorators, target, key, kind) => {
9969
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$j(target, key) : target;
9785
9970
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9786
- if (kind && result) __defProp$l(target, key, result);
9971
+ if (kind && result) __defProp$j(target, key, result);
9787
9972
  return result;
9788
9973
  };
9789
9974
  class ProgressBar extends BaseProgressBar {}
9790
- __decorateClass$l([attr], ProgressBar.prototype, "thickness", 2);
9791
- __decorateClass$l([attr], ProgressBar.prototype, "shape", 2);
9975
+ __decorateClass$j([attr], ProgressBar.prototype, "thickness", 2);
9976
+ __decorateClass$j([attr], ProgressBar.prototype, "shape", 2);
9792
9977
 
9793
- const styles$h = css`
9978
+ const styles$f = css`
9794
9979
  ${display("block")}
9795
9980
 
9796
9981
  :host{width:100%;height:2px;overflow-x:hidden;background-color:${colorNeutralBackground6};border-radius:${borderRadiusMedium};contain:content;@supports (width:attr(value type(<number>))){--max:attr(max type(<number>),100);--min:attr(min type(<number>),0);--value:attr(value type(<number>),0);--indicator-width:clamp(0%,calc((var(--value) - var(--min)) / (var(--max) - var(--min)) * 100%),100%)}}:host([thickness='large']){height:4px}:host([shape='square']){border-radius:${borderRadiusNone}}.indicator{background-color:${colorCompoundBrandBackground};border-radius:inherit;height:100%}:host([value]) .indicator{transition:all 0.2s ease-in-out;@supports (width:attr(value type(<number>))){width:var(--indicator-width)}}:host(:not([value])) .indicator{position:relative;width:33%;background-image:linear-gradient(
@@ -9801,80 +9986,18 @@ const styles$h = css`
9801
9986
  function progressTemplate() {
9802
9987
  return html`<div class="indicator" part="indicator" ${ref("indicator")}></div>`;
9803
9988
  }
9804
- const template$h = progressTemplate();
9989
+ const template$f = progressTemplate();
9805
9990
 
9806
- const definition$h = ProgressBar.compose({
9991
+ const definition$f = ProgressBar.compose({
9807
9992
  name: `${FluentDesignSystem.prefix}-progress-bar`,
9808
- template: template$h,
9809
- styles: styles$h
9993
+ template: template$f,
9994
+ styles: styles$f
9810
9995
  });
9811
9996
 
9812
- definition$h.define(FluentDesignSystem.registry);
9997
+ definition$f.define(FluentDesignSystem.registry);
9813
9998
 
9814
- class Radio extends BaseCheckbox {
9815
- constructor() {
9816
- super();
9817
- this.elementInternals.role = "radio";
9818
- }
9819
- /**
9820
- * Toggles the disabled state when the user changes the `disabled` property.
9821
- *
9822
- * @param prev - the previous value of the `disabled` property
9823
- * @param next - the current value of the `disabled` property
9824
- * @internal
9825
- * @override
9826
- */
9827
- disabledChanged(prev, next) {
9828
- super.disabledChanged(prev, next);
9829
- this.$emit("disabled", next, {
9830
- bubbles: true
9831
- });
9832
- }
9833
- /**
9834
- * This method is a no-op for the radio component.
9835
- *
9836
- * @internal
9837
- * @override
9838
- * @remarks
9839
- * To make a group of radio controls required, see {@link RadioGroup.required}.
9840
- */
9841
- requiredChanged() {
9842
- return;
9843
- }
9844
- /**
9845
- * This method is a no-op for the radio component.
9846
- *
9847
- * @internal
9848
- * @override
9849
- * @remarks
9850
- * The radio form value is controlled by the `RadioGroup` component.
9851
- */
9852
- setFormValue() {
9853
- return;
9854
- }
9855
- /**
9856
- * Sets the validity of the control.
9857
- *
9858
- * @internal
9859
- * @override
9860
- * @remarks
9861
- * The radio component does not have a `required` attribute, so this method always sets the validity to `true`.
9862
- */
9863
- setValidity() {
9864
- this.elementInternals.setValidity({});
9865
- }
9866
- /**
9867
- * Toggles the checked state of the control.
9868
- *
9869
- * @param force - Forces the element to be checked or unchecked
9870
- * @public
9871
- * @override
9872
- * @remarks
9873
- * The radio checked state is controlled by the `RadioGroup` component, so the `force` parameter defaults to `true`.
9874
- */
9875
- toggleChecked(force = true) {
9876
- super.toggleChecked(force);
9877
- }
9999
+ function isRadio(element, tagName = "-radio") {
10000
+ return isCustomElement(tagName)(element);
9878
10001
  }
9879
10002
 
9880
10003
  function getRootActiveElement(element) {
@@ -9887,12 +10010,12 @@ function getRootActiveElement(element) {
9887
10010
 
9888
10011
  const RadioGroupOrientation = Orientation;
9889
10012
 
9890
- var __defProp$k = Object.defineProperty;
9891
- var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor;
9892
- var __decorateClass$k = (decorators, target, key, kind) => {
9893
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$k(target, key) : target;
10013
+ var __defProp$i = Object.defineProperty;
10014
+ var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor;
10015
+ var __decorateClass$i = (decorators, target, key, kind) => {
10016
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$i(target, key) : target;
9894
10017
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9895
- if (kind && result) __defProp$k(target, key, result);
10018
+ if (kind && result) __defProp$i(target, key, result);
9896
10019
  return result;
9897
10020
  };
9898
10021
  class RadioGroup extends FASTElement {
@@ -9902,7 +10025,6 @@ class RadioGroup extends FASTElement {
9902
10025
  * Indicates that the value has been changed by the user.
9903
10026
  */
9904
10027
  this.dirtyState = false;
9905
- this.disabled = false;
9906
10028
  /**
9907
10029
  * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
9908
10030
  *
@@ -9933,7 +10055,7 @@ class RadioGroup extends FASTElement {
9933
10055
  * @internal
9934
10056
  */
9935
10057
  disabledChanged(prev, next) {
9936
- if (this.$fastController.isConnected) {
10058
+ if (this.radios) {
9937
10059
  this.checkedIndex = -1;
9938
10060
  this.radios?.forEach(radio => {
9939
10061
  radio.disabled = !!radio.disabledAttribute || !!this.disabled;
@@ -10029,6 +10151,15 @@ class RadioGroup extends FASTElement {
10029
10151
  this.elementInternals.ariaRequired = next ? "true" : null;
10030
10152
  this.setValidity();
10031
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
+ }
10032
10163
  /**
10033
10164
  * A collection of child radios that are not disabled.
10034
10165
  *
@@ -10336,17 +10467,6 @@ class RadioGroup extends FASTElement {
10336
10467
  });
10337
10468
  }
10338
10469
  }
10339
- /**
10340
- * Updates the collection of child radios when the slot changes.
10341
- *
10342
- * @param e - the slot change event
10343
- * @internal
10344
- */
10345
- slotchangeHandler(e) {
10346
- Updates.enqueue(() => {
10347
- this.radios = [...this.querySelectorAll("*")].filter(x => x instanceof Radio);
10348
- });
10349
- }
10350
10470
  }
10351
10471
  /**
10352
10472
  * The form-associated flag.
@@ -10355,92 +10475,159 @@ class RadioGroup extends FASTElement {
10355
10475
  * @public
10356
10476
  */
10357
10477
  RadioGroup.formAssociated = true;
10358
- __decorateClass$k([observable], RadioGroup.prototype, "checkedIndex", 2);
10359
- __decorateClass$k([attr({
10478
+ __decorateClass$i([observable], RadioGroup.prototype, "checkedIndex", 2);
10479
+ __decorateClass$i([attr({
10360
10480
  attribute: "disabled",
10361
10481
  mode: "boolean"
10362
10482
  })], RadioGroup.prototype, "disabled", 2);
10363
- __decorateClass$k([attr({
10483
+ __decorateClass$i([attr({
10364
10484
  attribute: "value",
10365
10485
  mode: "fromView"
10366
10486
  })], RadioGroup.prototype, "initialValue", 2);
10367
- __decorateClass$k([attr], RadioGroup.prototype, "name", 2);
10368
- __decorateClass$k([attr], RadioGroup.prototype, "orientation", 2);
10369
- __decorateClass$k([observable], RadioGroup.prototype, "radios", 2);
10370
- __decorateClass$k([attr({
10487
+ __decorateClass$i([attr], RadioGroup.prototype, "name", 2);
10488
+ __decorateClass$i([attr], RadioGroup.prototype, "orientation", 2);
10489
+ __decorateClass$i([observable], RadioGroup.prototype, "radios", 2);
10490
+ __decorateClass$i([attr({
10371
10491
  mode: "boolean"
10372
10492
  })], RadioGroup.prototype, "required", 2);
10493
+ __decorateClass$i([observable], RadioGroup.prototype, "slottedRadios", 2);
10373
10494
 
10374
- const styles$g = css`
10495
+ const styles$e = css`
10375
10496
  ${display("flex")}
10376
10497
 
10377
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}}`;
10378
10499
 
10379
10500
  function radioGroupTemplate() {
10380
- 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>`;
10381
10502
  }
10382
- const template$g = radioGroupTemplate();
10503
+ const template$e = radioGroupTemplate();
10383
10504
 
10384
- const definition$g = RadioGroup.compose({
10505
+ const definition$e = RadioGroup.compose({
10385
10506
  name: `${FluentDesignSystem.prefix}-radio-group`,
10386
- template: template$g,
10387
- styles: styles$g
10388
- });
10389
-
10390
- definition$g.define(FluentDesignSystem.registry);
10391
-
10392
- const styles$f = css`
10393
- ${display("inline-flex")}
10394
-
10395
- :host{--size:16px;aspect-ratio:1;background-color:${colorNeutralBackground1};border:${strokeWidthThin} solid ${colorNeutralStrokeAccessible};border-radius:${borderRadiusCircular};box-sizing:border-box;position:relative;width:var(--size)}:host([size='large']){--size:20px}.checked-indicator{aspect-ratio:1;border-radius:${borderRadiusCircular};color:${colorNeutralForegroundInverted};inset:0;margin:auto;position:absolute;width:calc(var(--size) * 0.625)}:host(:not([slot='input']))::after{content:'' / '';position:absolute;display:block;inset:-8px;box-sizing:border-box;outline:none;border:${strokeWidthThick} solid ${colorTransparentStroke};border-radius:${borderRadiusMedium}}:host(:not([slot='input']):focus-visible)::after{border-color:${colorStrokeFocus2}}:host(:hover){border-color:${colorNeutralStrokeAccessibleHover}}:host(${checkedState}){border-color:${colorCompoundBrandStroke}}:host(${checkedState}) .checked-indicator{background-color:${colorCompoundBrandBackground}}:host(${checkedState}:hover) .checked-indicator{background-color:${colorCompoundBrandBackgroundHover}}:host(:active){border-color:${colorNeutralStrokeAccessiblePressed}}:host(${checkedState}:active) .checked-indicator{background-color:${colorCompoundBrandBackgroundPressed}}:host(:focus-visible){outline:none}:host(${disabledState}){background-color:${colorNeutralBackgroundDisabled};border-color:${colorNeutralStrokeDisabled}}:host(${checkedState}${disabledState}) .checked-indicator{background-color:${colorNeutralStrokeDisabled}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
10396
- :host{border-color:FieldText}:host(:not([slot='input']:focus-visible))::after{border-color:Canvas}:host(:not(${disabledState}):hover),:host(:not([slot='input']):focus-visible)::after{border-color:Highlight}.checked-indicator{color:HighlightText}:host(${checkedState}) .checked-indicator{background-color:FieldText}:host(${checkedState}:not(${disabledState}):hover) .checked-indicator{background-color:Highlight}:host(${disabledState}){border-color:GrayText;color:GrayText}:host(${disabledState}${checkedState}) .checked-indicator{background-color:GrayText}`));
10397
-
10398
- const checkedIndicator = html.partial(/* html */
10399
- `
10400
- <span part="checked-indicator" class="checked-indicator" role="presentation"></span>
10401
- `);
10402
- function radioTemplate(options = {}) {
10403
- return html`<template @click="${(x, c) => x.clickHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}" @keyup="${(x, c) => x.keyupHandler(c.event)}"><slot name="checked-indicator">${staticallyCompose(options.checkedIndicator)}</slot></template>`;
10404
- }
10405
- const template$f = radioTemplate({
10406
- checkedIndicator
10407
- });
10408
-
10409
- const definition$f = Radio.compose({
10410
- name: `${FluentDesignSystem.prefix}-radio`,
10411
- template: template$f,
10412
- styles: styles$f
10507
+ template: template$e,
10508
+ styles: styles$e
10413
10509
  });
10414
10510
 
10415
- definition$f.define(FluentDesignSystem.registry);
10511
+ definition$e.define(FluentDesignSystem.registry);
10416
10512
 
10417
- var __defProp$j = Object.defineProperty;
10418
- var __getOwnPropDesc$j = Object.getOwnPropertyDescriptor;
10419
- var __decorateClass$j = (decorators, target, key, kind) => {
10420
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$j(target, key) : target;
10421
- for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
10422
- if (kind && result) __defProp$j(target, key, result);
10423
- return result;
10424
- };
10425
- const SUPPORTS_ATTR_TYPE = CSS.supports("width: attr(value type(<number>))");
10426
- const CUSTOM_PROPERTY_NAME = {
10427
- max: "--_attr-max",
10428
- value: "--_attr-value",
10429
- maskImageFilled: "--_mask-image-filled",
10430
- maskImageOutlined: "--_mask-image-outlined"
10431
- };
10432
- function svgToDataURI(svg) {
10433
- if (!svg) {
10434
- return "";
10435
- }
10436
- return ["data:image/svg+xml", encodeURIComponent(svg.replace(/\n/g, "").replace(/\s+/g, " "))].join(",");
10437
- }
10438
- class BaseRatingDisplay extends FASTElement {
10513
+ class Radio extends BaseCheckbox {
10439
10514
  constructor() {
10440
10515
  super();
10441
- /**
10442
- * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
10443
- *
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
+
10579
+ const styles$d = css`
10580
+ ${display("inline-flex")}
10581
+
10582
+ :host{--size:16px;aspect-ratio:1;background-color:${colorNeutralBackground1};border:${strokeWidthThin} solid ${colorNeutralStrokeAccessible};border-radius:${borderRadiusCircular};box-sizing:border-box;position:relative;width:var(--size)}:host([size='large']){--size:20px}.checked-indicator{aspect-ratio:1;border-radius:${borderRadiusCircular};color:${colorNeutralForegroundInverted};inset:0;margin:auto;position:absolute;width:calc(var(--size) * 0.625)}:host(:not([slot='input']))::after{content:'' / '';position:absolute;display:block;inset:-8px;box-sizing:border-box;outline:none;border:${strokeWidthThick} solid ${colorTransparentStroke};border-radius:${borderRadiusMedium}}:host(:not([slot='input']):focus-visible)::after{border-color:${colorStrokeFocus2}}:host(:hover){border-color:${colorNeutralStrokeAccessibleHover}}:host(${checkedState}){border-color:${colorCompoundBrandStroke}}:host(${checkedState}) .checked-indicator{background-color:${colorCompoundBrandBackground}}:host(${checkedState}:hover) .checked-indicator{background-color:${colorCompoundBrandBackgroundHover}}:host(:active){border-color:${colorNeutralStrokeAccessiblePressed}}:host(${checkedState}:active) .checked-indicator{background-color:${colorCompoundBrandBackgroundPressed}}:host(:focus-visible){outline:none}:host(${disabledState}){background-color:${colorNeutralBackgroundDisabled};border-color:${colorNeutralStrokeDisabled}}:host(${checkedState}${disabledState}) .checked-indicator{background-color:${colorNeutralStrokeDisabled}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
10583
+ :host{border-color:FieldText}:host(:not([slot='input']:focus-visible))::after{border-color:Canvas}:host(:not(${disabledState}):hover),:host(:not([slot='input']):focus-visible)::after{border-color:Highlight}.checked-indicator{color:HighlightText}:host(${checkedState}) .checked-indicator{background-color:FieldText}:host(${checkedState}:not(${disabledState}):hover) .checked-indicator{background-color:Highlight}:host(${disabledState}){border-color:GrayText;color:GrayText}:host(${disabledState}${checkedState}) .checked-indicator{background-color:GrayText}`));
10584
+
10585
+ const checkedIndicator = html.partial(/* html */
10586
+ `
10587
+ <span part="checked-indicator" class="checked-indicator" role="presentation"></span>
10588
+ `);
10589
+ function radioTemplate(options = {}) {
10590
+ return html`<template @click="${(x, c) => x.clickHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}" @keyup="${(x, c) => x.keyupHandler(c.event)}"><slot name="checked-indicator">${staticallyCompose(options.checkedIndicator)}</slot></template>`;
10591
+ }
10592
+ const template$d = radioTemplate({
10593
+ checkedIndicator
10594
+ });
10595
+
10596
+ const definition$d = Radio.compose({
10597
+ name: `${FluentDesignSystem.prefix}-radio`,
10598
+ template: template$d,
10599
+ styles: styles$d
10600
+ });
10601
+
10602
+ definition$d.define(FluentDesignSystem.registry);
10603
+
10604
+ var __defProp$h = Object.defineProperty;
10605
+ var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
10606
+ var __decorateClass$h = (decorators, target, key, kind) => {
10607
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$h(target, key) : target;
10608
+ for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
10609
+ if (kind && result) __defProp$h(target, key, result);
10610
+ return result;
10611
+ };
10612
+ const SUPPORTS_ATTR_TYPE = CSS.supports("width: attr(value type(<number>))");
10613
+ const CUSTOM_PROPERTY_NAME = {
10614
+ max: "--_attr-max",
10615
+ value: "--_attr-value",
10616
+ maskImageFilled: "--_mask-image-filled",
10617
+ maskImageOutlined: "--_mask-image-outlined"
10618
+ };
10619
+ function svgToDataURI(svg) {
10620
+ if (!svg) {
10621
+ return "";
10622
+ }
10623
+ return ["data:image/svg+xml", encodeURIComponent(svg.replace(/\n/g, "").replace(/\s+/g, " "))].join(",");
10624
+ }
10625
+ class BaseRatingDisplay extends FASTElement {
10626
+ constructor() {
10627
+ super();
10628
+ /**
10629
+ * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
10630
+ *
10444
10631
  * @internal
10445
10632
  */
10446
10633
  this.elementInternals = this.attachInternals();
@@ -10448,6 +10635,14 @@ class BaseRatingDisplay extends FASTElement {
10448
10635
  this.elementInternals.role = "img";
10449
10636
  this.numberFormatter = new Intl.NumberFormat();
10450
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
+ }
10451
10646
  maxChanged() {
10452
10647
  this.setCustomPropertyValue("max");
10453
10648
  }
@@ -10497,36 +10692,39 @@ class BaseRatingDisplay extends FASTElement {
10497
10692
  this.display.style.setProperty(CUSTOM_PROPERTY_NAME.maskImageOutlined, `url(${svgToDataURI(customSvgOutlined)})`);
10498
10693
  }
10499
10694
  setCustomPropertyValue(propertyName) {
10500
- if (!this.display || SUPPORTS_ATTR_TYPE) {
10501
- return;
10502
- }
10503
- const propertyValue = this[propertyName];
10504
- if (typeof propertyValue !== "number" || Number.isNaN(propertyValue)) {
10505
- this.display.style.removeProperty(CUSTOM_PROPERTY_NAME[propertyName]);
10506
- } else {
10507
- this.display.style.setProperty(CUSTOM_PROPERTY_NAME[propertyName], `${propertyValue}`);
10508
- }
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
+ });
10509
10706
  }
10510
10707
  }
10511
- __decorateClass$j([attr({
10708
+ __decorateClass$h([observable], BaseRatingDisplay.prototype, "iconSlot", 2);
10709
+ __decorateClass$h([attr({
10512
10710
  converter: nullableNumberConverter
10513
10711
  })], BaseRatingDisplay.prototype, "count", 2);
10514
- __decorateClass$j([attr({
10712
+ __decorateClass$h([attr({
10515
10713
  attribute: "icon-view-box"
10516
10714
  })], BaseRatingDisplay.prototype, "iconViewBox", 2);
10517
- __decorateClass$j([attr({
10715
+ __decorateClass$h([attr({
10518
10716
  converter: nullableNumberConverter
10519
10717
  })], BaseRatingDisplay.prototype, "max", 2);
10520
- __decorateClass$j([attr({
10718
+ __decorateClass$h([attr({
10521
10719
  converter: nullableNumberConverter
10522
10720
  })], BaseRatingDisplay.prototype, "value", 2);
10523
10721
 
10524
- var __defProp$i = Object.defineProperty;
10525
- var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor;
10526
- var __decorateClass$i = (decorators, target, key, kind) => {
10527
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$i(target, key) : target;
10722
+ var __defProp$g = Object.defineProperty;
10723
+ var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
10724
+ var __decorateClass$g = (decorators, target, key, kind) => {
10725
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target;
10528
10726
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
10529
- if (kind && result) __defProp$i(target, key, result);
10727
+ if (kind && result) __defProp$g(target, key, result);
10530
10728
  return result;
10531
10729
  };
10532
10730
  class RatingDisplay extends BaseRatingDisplay {
@@ -10535,9 +10733,9 @@ class RatingDisplay extends BaseRatingDisplay {
10535
10733
  this.compact = false;
10536
10734
  }
10537
10735
  }
10538
- __decorateClass$i([attr], RatingDisplay.prototype, "color", 2);
10539
- __decorateClass$i([attr], RatingDisplay.prototype, "size", 2);
10540
- __decorateClass$i([attr({
10736
+ __decorateClass$g([attr], RatingDisplay.prototype, "color", 2);
10737
+ __decorateClass$g([attr], RatingDisplay.prototype, "size", 2);
10738
+ __decorateClass$g([attr({
10541
10739
  mode: "boolean"
10542
10740
  })], RatingDisplay.prototype, "compact", 2);
10543
10741
 
@@ -10553,9 +10751,9 @@ const defaultIconOutlined = `
10553
10751
  function ratingDisplayTemplate() {
10554
10752
  return html`<div ${ref("display")} class="display" aria-hidden="true"></div><slot name="icon" ${ref("iconSlot")} @slotchange="${x => x.handleSlotChange()}"></slot><slot name="value"><span class="value-label" aria-hidden="true">${x => x.value}</span></slot><slot name="count"><span class="count-label" aria-hidden="true">${x => x.formattedCount}</span></slot>`;
10555
10753
  }
10556
- const template$e = ratingDisplayTemplate();
10754
+ const template$c = ratingDisplayTemplate();
10557
10755
 
10558
- const styles$e = css`
10756
+ const styles$c = css`
10559
10757
  ${display("inline-flex")}
10560
10758
 
10561
10759
  :host{--_icon-size:16px;--_icon-gradient-degree:90deg;--_icon-color-value:${colorPaletteMarigoldBorderActive};--_icon-color-empty:${colorPaletteMarigoldBackground2};--_default-value:0;--_default-max:5;--_mask-image-filled:url(${svgToDataURI(defaultIconFilled)});--_mask-image-outlined:url(${svgToDataURI(defaultIconOutlined)});--_mask-position-x:left;align-items:center;color:${colorNeutralForeground1};font-family:${fontFamilyBase};font-size:${fontSizeBase200};line-height:${lineHeightBase200};contain:layout style;user-select:none}:host(:dir(rtl)){--_icon-gradient-degree:-90deg;--_mask-position-x:right}:host([size='small']){--_icon-size:12px}:host([size='large']){--_icon-size:20px;font-size:${fontSizeBase300};line-height:${lineHeightBase300}}::slotted([slot='icon']){display:none}:host([color='neutral']){--_icon-color-value:${colorNeutralForeground1};--_icon-color-empty:${colorNeutralBackground6}}:host([color='brand']){--_icon-color-value:${colorBrandForeground1};--_icon-color-empty:${colorBrandBackground2}}@supports (width:attr(value type(<number>))){:host{--_attr-value:attr(value type(<number>));--_attr-max:attr(max type(<number>))}}:host([compact]) .display{--_max:1}.display{--_value:max(0,round(var(--_attr-value,var(--_default-value)) * 2) / 2);--_max:max(1,var(--_attr-max,var(--_default-max)));--_mask-inline-size:calc(var(--_icon-size) + ${spacingHorizontalXXS});--_icon-gradient-stop-visual-adjustment:0px;--_icon-gradient-stop:calc(
@@ -10565,18 +10763,13 @@ const styles$e = css`
10565
10763
  );block-size:var(--_icon-size);display:grid;inline-size:calc(var(--_max) * var(--_mask-inline-size) - ${spacingHorizontalXXS} / 2);mask-image:var(--_mask-image-filled);mask-repeat:repeat no-repeat;mask-size:var(--_mask-inline-size) var(--_icon-size);mask-position:var(--_mask-position-x) center}.value-label,::slotted([slot='value']){display:block;margin-inline-start:${spacingHorizontalXS};font-weight:${fontWeightSemibold}}:host([size='small']) .value-label,:host([size='small']) ::slotted([slot='value']){margin-inline-start:${spacingHorizontalXXS}}:host([size='large']) .value-label,:host([size='large']) ::slotted([slot='value']){margin-inline-start:${spacingHorizontalSNudge}}:host(:not([count])) .count-label{display:none}.count-label::before,::slotted([slot='count'])::before{content:'·';margin-inline:${spacingHorizontalXS}}:host([size='small']) .count-label::before,:host([size='small']) ::slotted([slot='count'])::before{margin-inline:${spacingHorizontalXXS}}:host([size='large']) .count-label::before,:host([size='large']) ::slotted([slot='count'])::before{margin-inline:${spacingHorizontalSNudge}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
10566
10764
  .display{--_icon-color-value:CanvasText;--_icon-color-empty:Canvas;--_icon-gradient-stop-visual-adjustment:0.5px;forced-color-adjust:none}.display::before{background-color:var(--_icon-color-value);content:'';grid-area:1 / 1 / -1 / -1;mask:inherit;mask-image:var(--_mask-image-outlined)}`));
10567
10765
 
10568
- const definition$e = RatingDisplay.compose({
10766
+ const definition$c = RatingDisplay.compose({
10569
10767
  name: `${FluentDesignSystem.prefix}-rating-display`,
10570
- template: template$e,
10571
- styles: styles$e
10768
+ template: template$c,
10769
+ styles: styles$c
10572
10770
  });
10573
10771
 
10574
- definition$e.define(FluentDesignSystem.registry);
10575
-
10576
- const SliderOrientation = Orientation;
10577
- const SliderMode = {
10578
- singleValue: "single-value"
10579
- };
10772
+ definition$c.define(FluentDesignSystem.registry);
10580
10773
 
10581
10774
  function convertPixelToPercent(pixelPos, minPosition, maxPosition, direction) {
10582
10775
  let pct = limit(0, 1, (pixelPos - minPosition) / (maxPosition - minPosition));
@@ -10586,12 +10779,17 @@ function convertPixelToPercent(pixelPos, minPosition, maxPosition, direction) {
10586
10779
  return pct;
10587
10780
  }
10588
10781
 
10589
- var __defProp$h = Object.defineProperty;
10590
- var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
10591
- var __decorateClass$h = (decorators, target, key, kind) => {
10592
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$h(target, key) : target;
10782
+ const SliderOrientation = Orientation;
10783
+ const SliderMode = {
10784
+ singleValue: "single-value"
10785
+ };
10786
+
10787
+ var __defProp$f = Object.defineProperty;
10788
+ var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
10789
+ var __decorateClass$f = (decorators, target, key, kind) => {
10790
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key) : target;
10593
10791
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
10594
- if (kind && result) __defProp$h(target, key, result);
10792
+ if (kind && result) __defProp$f(target, key, result);
10595
10793
  return result;
10596
10794
  };
10597
10795
  class Slider extends FASTElement {
@@ -10632,6 +10830,9 @@ class Slider extends FASTElement {
10632
10830
  * If the event handler is null it removes the events
10633
10831
  */
10634
10832
  this.handleThumbPointerDown = event => {
10833
+ if (this.isDisabled) {
10834
+ return true;
10835
+ }
10635
10836
  const windowFn = event !== null ? window.addEventListener : window.removeEventListener;
10636
10837
  windowFn("pointerup", this.handleWindowPointerUp);
10637
10838
  windowFn("pointermove", this.handlePointerMove, {
@@ -10648,7 +10849,7 @@ class Slider extends FASTElement {
10648
10849
  * Handle mouse moves during a thumb drag operation
10649
10850
  */
10650
10851
  this.handlePointerMove = event => {
10651
- if (this.disabled || event.defaultPrevented) {
10852
+ if (this.isDisabled || event.defaultPrevented) {
10652
10853
  return;
10653
10854
  }
10654
10855
  const sourceEvent = window.TouchEvent && event instanceof TouchEvent ? event.touches[0] : event;
@@ -10672,7 +10873,7 @@ class Slider extends FASTElement {
10672
10873
  * @param event - PointerEvent or null. If there is no event handler it will remove the events
10673
10874
  */
10674
10875
  this.handlePointerDown = event => {
10675
- if (event === null || !this.disabled) {
10876
+ if (event === null || !this.isDisabled) {
10676
10877
  const windowFn = event !== null ? window.addEventListener : window.removeEventListener;
10677
10878
  const documentFn = event !== null ? document.addEventListener : document.removeEventListener;
10678
10879
  windowFn("pointerup", this.handleWindowPointerUp);
@@ -10807,7 +11008,7 @@ class Slider extends FASTElement {
10807
11008
  */
10808
11009
  setValidity(flags, message, anchor) {
10809
11010
  if (this.$fastController.isConnected) {
10810
- if (this.disabled) {
11011
+ if (this.isDisabled) {
10811
11012
  this.elementInternals.setValidity({});
10812
11013
  return;
10813
11014
  }
@@ -10898,6 +11099,15 @@ class Slider extends FASTElement {
10898
11099
  disabledChanged() {
10899
11100
  this.setDisabledSideEffect(this.disabled);
10900
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
+ }
10901
11111
  minChanged() {
10902
11112
  this.elementInternals.ariaValueMin = `${this.minAsNumber}`;
10903
11113
  if (this.$fastController.isConnected && this.minAsNumber > this.valueAsNumber) {
@@ -10964,30 +11174,34 @@ class Slider extends FASTElement {
10964
11174
  this.setSliderPosition();
10965
11175
  }
10966
11176
  }
10967
- /**
10968
- * @internal
10969
- */
10970
11177
  connectedCallback() {
10971
11178
  super.connectedCallback();
10972
- this.direction = getDirection(this);
10973
- this.setDisabledSideEffect(this.disabled);
10974
- this.updateStepMultiplier();
10975
- this.setupTrackConstraints();
10976
- this.setupDefaultValue();
10977
- this.setSliderPosition();
10978
- Observable.getNotifier(this).subscribe(this, "max");
10979
- Observable.getNotifier(this).subscribe(this, "min");
10980
- Observable.getNotifier(this).subscribe(this, "step");
10981
- 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
+ });
10982
11195
  }
10983
11196
  /**
10984
11197
  * @internal
10985
11198
  */
10986
11199
  disconnectedCallback() {
10987
11200
  super.disconnectedCallback();
10988
- Observable.getNotifier(this).unsubscribe(this, "max");
10989
- Observable.getNotifier(this).unsubscribe(this, "min");
10990
- 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");
10991
11205
  }
10992
11206
  /**
10993
11207
  * Increment the value by the step
@@ -11012,7 +11226,7 @@ class Slider extends FASTElement {
11012
11226
  this.value = decrementedValString;
11013
11227
  }
11014
11228
  handleKeydown(event) {
11015
- if (this.disabled) {
11229
+ if (this.isDisabled) {
11016
11230
  return true;
11017
11231
  }
11018
11232
  switch (event.key) {
@@ -11097,12 +11311,11 @@ class Slider extends FASTElement {
11097
11311
  /**
11098
11312
  * Makes sure the side effects of set up when the disabled state changes.
11099
11313
  */
11100
- setDisabledSideEffect(disabled) {
11101
- if (!this.$fastController.isConnected) {
11102
- return;
11103
- }
11104
- this.elementInternals.ariaDisabled = disabled.toString();
11105
- 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
+ });
11106
11319
  }
11107
11320
  }
11108
11321
  /**
@@ -11112,36 +11325,36 @@ class Slider extends FASTElement {
11112
11325
  * @public
11113
11326
  */
11114
11327
  Slider.formAssociated = true;
11115
- __decorateClass$h([attr], Slider.prototype, "size", 2);
11116
- __decorateClass$h([attr({
11328
+ __decorateClass$f([attr], Slider.prototype, "size", 2);
11329
+ __decorateClass$f([attr({
11117
11330
  attribute: "value",
11118
11331
  mode: "fromView"
11119
11332
  })], Slider.prototype, "initialValue", 2);
11120
- __decorateClass$h([observable], Slider.prototype, "direction", 2);
11121
- __decorateClass$h([observable], Slider.prototype, "isDragging", 2);
11122
- __decorateClass$h([observable], Slider.prototype, "position", 2);
11123
- __decorateClass$h([observable], Slider.prototype, "trackWidth", 2);
11124
- __decorateClass$h([observable], Slider.prototype, "trackMinWidth", 2);
11125
- __decorateClass$h([observable], Slider.prototype, "trackHeight", 2);
11126
- __decorateClass$h([observable], Slider.prototype, "trackLeft", 2);
11127
- __decorateClass$h([observable], Slider.prototype, "trackMinHeight", 2);
11128
- __decorateClass$h([observable], Slider.prototype, "valueTextFormatter", 2);
11129
- __decorateClass$h([attr({
11333
+ __decorateClass$f([observable], Slider.prototype, "direction", 2);
11334
+ __decorateClass$f([observable], Slider.prototype, "isDragging", 2);
11335
+ __decorateClass$f([observable], Slider.prototype, "position", 2);
11336
+ __decorateClass$f([observable], Slider.prototype, "trackWidth", 2);
11337
+ __decorateClass$f([observable], Slider.prototype, "trackMinWidth", 2);
11338
+ __decorateClass$f([observable], Slider.prototype, "trackHeight", 2);
11339
+ __decorateClass$f([observable], Slider.prototype, "trackLeft", 2);
11340
+ __decorateClass$f([observable], Slider.prototype, "trackMinHeight", 2);
11341
+ __decorateClass$f([observable], Slider.prototype, "valueTextFormatter", 2);
11342
+ __decorateClass$f([attr({
11130
11343
  mode: "boolean"
11131
11344
  })], Slider.prototype, "disabled", 2);
11132
- __decorateClass$h([attr({
11345
+ __decorateClass$f([attr({
11133
11346
  converter: numberLikeStringConverter
11134
11347
  })], Slider.prototype, "min", 2);
11135
- __decorateClass$h([attr({
11348
+ __decorateClass$f([attr({
11136
11349
  converter: numberLikeStringConverter
11137
11350
  })], Slider.prototype, "max", 2);
11138
- __decorateClass$h([attr({
11351
+ __decorateClass$f([attr({
11139
11352
  converter: numberLikeStringConverter
11140
11353
  })], Slider.prototype, "step", 2);
11141
- __decorateClass$h([attr], Slider.prototype, "orientation", 2);
11142
- __decorateClass$h([attr], Slider.prototype, "mode", 2);
11354
+ __decorateClass$f([attr], Slider.prototype, "orientation", 2);
11355
+ __decorateClass$f([attr], Slider.prototype, "mode", 2);
11143
11356
 
11144
- const styles$d = css`
11357
+ const styles$b = css`
11145
11358
  ${display("inline-grid")}
11146
11359
 
11147
11360
  :host{--thumb-size:20px;--track-margin-inline:calc(var(--thumb-size) / 2);--track-size:4px;--track-overhang:calc(var(--track-size) / -2);--rail-color:${colorCompoundBrandBackground};--track-color:${colorNeutralStrokeAccessible};--slider-direction:90deg;--border-radius:${borderRadiusMedium};--step-marker-inset:var(--track-overhang) -1px;position:relative;align-items:center;justify-content:center;box-sizing:border-box;outline:none;user-select:none;touch-action:none;min-width:120px;min-height:32px;grid-template-rows:1fr var(--thumb-size) 1fr;grid-template-columns:var(--track-margin-inline) 1fr var(--track-margin-inline)}:host(:hover){--rail-color:${colorCompoundBrandBackgroundHover}}:host(:active){--rail-color:${colorCompoundBrandBackgroundPressed}}:host(:disabled){--rail-color:${colorNeutralForegroundDisabled};--track-color:${colorNeutralBackgroundDisabled}}:host(:not(:disabled)){cursor:pointer}:host(:dir(rtl)){--slider-direction:-90deg}:host([size='small']){--thumb-size:16px;--track-overhang:-1px;--track-size:2px;--border-radius:${borderRadiusSmall}}:host([orientation='vertical']){--slider-direction:0deg;--step-marker-inset:-1px var(--track-overhang);min-height:120px;grid-template-rows:var(--track-margin-inline) 1fr var(--track-margin-inline);grid-template-columns:1fr var(--thumb-size) 1fr;width:unset;min-width:32px;justify-items:center}:host(:not([slot='input']):focus-visible){box-shadow:0 0 0 2pt ${colorStrokeFocus2};outline:1px solid ${colorStrokeFocus1}}:host:after,.track{height:var(--track-size);width:100%}:host:after{background-image:linear-gradient(
@@ -11154,17 +11367,17 @@ const styles$d = css`
11154
11367
  function sliderTemplate(options = {}) {
11155
11368
  return html`<template @pointerdown="${(x, c) => x.handlePointerDown(c.event)}" @keydown="${(x, c) => x.handleKeydown(c.event)}"><div ${ref("track")} part="track-container" class="track" style="${x => x.position}"></div><div ${ref("thumb")} part="thumb-container" class="thumb-container" style="${x => x.position}" @pointerdown="${(x, c) => x.handleThumbPointerDown(c.event)}"><slot name="thumb">${staticallyCompose(options.thumb)}</slot></div></template>`;
11156
11369
  }
11157
- const template$d = sliderTemplate({
11370
+ const template$b = sliderTemplate({
11158
11371
  thumb: `<div class="thumb"></div>`
11159
11372
  });
11160
11373
 
11161
- const definition$d = Slider.compose({
11374
+ const definition$b = Slider.compose({
11162
11375
  name: `${FluentDesignSystem.prefix}-slider`,
11163
- template: template$d,
11164
- styles: styles$d
11376
+ template: template$b,
11377
+ styles: styles$b
11165
11378
  });
11166
11379
 
11167
- definition$d.define(FluentDesignSystem.registry);
11380
+ definition$b.define(FluentDesignSystem.registry);
11168
11381
 
11169
11382
  class BaseSpinner extends FASTElement {
11170
11383
  constructor() {
@@ -11179,33 +11392,33 @@ class BaseSpinner extends FASTElement {
11179
11392
  }
11180
11393
  }
11181
11394
 
11182
- var __defProp$g = Object.defineProperty;
11183
- var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
11184
- var __decorateClass$g = (decorators, target, key, kind) => {
11185
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target;
11395
+ var __defProp$e = Object.defineProperty;
11396
+ var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
11397
+ var __decorateClass$e = (decorators, target, key, kind) => {
11398
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
11186
11399
  for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11187
- if (kind && result) __defProp$g(target, key, result);
11400
+ if (kind && result) __defProp$e(target, key, result);
11188
11401
  return result;
11189
11402
  };
11190
11403
  class Spinner extends BaseSpinner {}
11191
- __decorateClass$g([attr], Spinner.prototype, "size", 2);
11192
- __decorateClass$g([attr], Spinner.prototype, "appearance", 2);
11404
+ __decorateClass$e([attr], Spinner.prototype, "size", 2);
11405
+ __decorateClass$e([attr], Spinner.prototype, "appearance", 2);
11193
11406
 
11194
- const styles$c = css`
11407
+ const styles$a = css`
11195
11408
  ${display("inline-flex")}
11196
11409
 
11197
11410
  :host{--duration:1.5s;--indicatorSize:${strokeWidthThicker};--size:32px;height:var(--size);width:var(--size);contain:strict;content-visibility:auto}:host([size='tiny']){--indicatorSize:${strokeWidthThick};--size:20px}:host([size='extra-small']){--indicatorSize:${strokeWidthThick};--size:24px}:host([size='small']){--indicatorSize:${strokeWidthThick};--size:28px}:host([size='large']){--indicatorSize:${strokeWidthThicker};--size:36px}:host([size='extra-large']){--indicatorSize:${strokeWidthThicker};--size:40px}:host([size='huge']){--indicatorSize:${strokeWidthThickest};--size:44px}.progress,.background,.spinner,.start,.end,.indicator{position:absolute;inset:0}.progress,.spinner,.indicator{animation:none var(--duration) infinite ${curveEasyEase}}.progress{animation-timing-function:linear;animation-name:spin-linear}.background{border:var(--indicatorSize) solid ${colorBrandStroke2};border-radius:50%}:host([appearance='inverted']) .background{border-color:rgba(255,255,255,0.2)}.spinner{animation-name:spin-swing}.start{overflow:hidden;right:50%}.end{overflow:hidden;left:50%}.indicator{color:${colorBrandStroke1};box-sizing:border-box;border-radius:50%;border:var(--indicatorSize) solid transparent;border-block-start-color:currentcolor;border-right-color:currentcolor}:host([appearance='inverted']) .indicator{color:${colorNeutralStrokeOnBrand2}}.start .indicator{rotate:135deg;inset:0 -100% 0 0;animation-name:spin-start}.end .indicator{rotate:135deg;inset:0 0 0 -100%;animation-name:spin-end}@keyframes spin-linear{100%{transform:rotate(360deg)}}@keyframes spin-swing{0%{transform:rotate(-135deg)}50%{transform:rotate(0deg)}100%{transform:rotate(225deg)}}@keyframes spin-start{0%,100%{transform:rotate(0deg)}50%{transform:rotate(-80deg)}}@keyframes spin-end{0%,100%{transform:rotate(0deg)}50%{transform:rotate(70deg)}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
11198
11411
  .background{display:none}.indicator{border-color:Canvas;border-block-start-color:Highlight;border-right-color:Highlight}`));
11199
11412
 
11200
- const template$c = html`<slot name="indicator"><div class="background"></div><div class="progress"><div class="spinner"><div class="start"><div class="indicator"></div></div><div class="end"><div class="indicator"></div></div></div></div></slot>`;
11413
+ const template$a = html`<slot name="indicator"><div class="background"></div><div class="progress"><div class="spinner"><div class="start"><div class="indicator"></div></div><div class="end"><div class="indicator"></div></div></div></div></slot>`;
11201
11414
 
11202
- const definition$c = Spinner.compose({
11415
+ const definition$a = Spinner.compose({
11203
11416
  name: `${FluentDesignSystem.prefix}-spinner`,
11204
- template: template$c,
11205
- styles: styles$c
11417
+ template: template$a,
11418
+ styles: styles$a
11206
11419
  });
11207
11420
 
11208
- definition$c.define(FluentDesignSystem.registry);
11421
+ definition$a.define(FluentDesignSystem.registry);
11209
11422
 
11210
11423
  class Switch extends BaseCheckbox {
11211
11424
  constructor() {
@@ -11217,530 +11430,90 @@ class Switch extends BaseCheckbox {
11217
11430
  function switchTemplate(options = {}) {
11218
11431
  return html`<template @click="${(x, c) => x.clickHandler(c.event)}" @input="${(x, c) => x.inputHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}" @keyup="${(x, c) => x.keyupHandler(c.event)}"><slot name="switch">${staticallyCompose(options.switch)}</slot></template>`;
11219
11432
  }
11220
- const template$b = switchTemplate({
11433
+ const template$9 = switchTemplate({
11221
11434
  switch: `<span class="checked-indicator" part="checked-indicator"></span>`
11222
11435
  });
11223
11436
 
11224
- const styles$b = css`
11437
+ const styles$9 = css`
11225
11438
  ${display("inline-flex")}
11226
11439
 
11227
11440
  :host{box-sizing:border-box;align-items:center;flex-direction:row;outline:none;user-select:none;contain:content;padding:0 ${spacingHorizontalXXS};width:40px;height:20px;background-color:${colorTransparentBackground};border:1px solid ${colorNeutralStrokeAccessible};border-radius:${borderRadiusCircular}}:host(:enabled){cursor:pointer}:host(:hover){background:none;border-color:${colorNeutralStrokeAccessibleHover}}:host(:active){border-color:${colorNeutralStrokeAccessiblePressed}}:host(:disabled),:host([readonly]){border:1px solid ${colorNeutralStrokeDisabled};background-color:none;pointer:default}:host(${checkedState}){background:${colorCompoundBrandBackground};border-color:${colorCompoundBrandBackground}}:host(${checkedState}:hover){background:${colorCompoundBrandBackgroundHover};border-color:${colorCompoundBrandBackgroundHover}}:host(${checkedState}:active){background:${colorCompoundBrandBackgroundPressed};border-color:${colorCompoundBrandBackgroundPressed}}:host(${checkedState}:disabled){background:${colorNeutralBackgroundDisabled};border-color:${colorNeutralStrokeDisabled}}.checked-indicator{height:14px;width:14px;border-radius:50%;margin-inline-start:0;background-color:${colorNeutralForeground3};transition-duration:${durationNormal};transition-timing-function:${curveEasyEase};transition-property:margin-inline-start}:host(${checkedState}) .checked-indicator{background-color:${colorNeutralForegroundInverted};margin-inline-start:calc(100% - 14px)}:host(${checkedState}:hover) .checked-indicator{background:${colorNeutralForegroundInvertedHover}}:host(${checkedState}:active) .checked-indicator{background:${colorNeutralForegroundInvertedPressed}}:host(:hover) .checked-indicator{background-color:${colorNeutralForeground3Hover}}:host(:active) .checked-indicator{background-color:${colorNeutralForeground3Pressed}}:host(:disabled) .checked-indicator,:host([readonly]) .checked-indicator{background:${colorNeutralForegroundDisabled}}:host(${checkedState}:disabled) .checked-indicator{background:${colorNeutralForegroundDisabled}}:host(:focus-visible){outline:none}:host(:not([slot='input']):focus-visible){border-color:${colorTransparentStroke};outline:${strokeWidthThick} solid ${colorTransparentStroke};outline-offset:1px;box-shadow:${shadow4},0 0 0 2px ${colorStrokeFocus2}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
11228
11441
  :host{border-color:InactiveBorder}:host(${checkedState}),:host(${checkedState}:active),:host(${checkedState}:hover){background:Highlight;border-color:Highlight}.checked-indicator,:host(:hover) .checked-indicator,:host(:active) .checked-indicator{background-color:ActiveCaption}:host(${checkedState}) .checked-indicator,:host(${checkedState}:hover) .checked-indicator,:host(${checkedState}:active) .checked-indicator{background-color:ButtonFace}:host(:disabled) .checked-indicator,:host(${checkedState}:disabled) .checked-indicator{background-color:GrayText}`));
11229
11442
 
11230
- const definition$b = Switch.compose({
11443
+ const definition$9 = Switch.compose({
11231
11444
  name: `${FluentDesignSystem.prefix}-switch`,
11232
- template: template$b,
11233
- styles: styles$b
11234
- });
11235
-
11236
- definition$b.define(FluentDesignSystem.registry);
11237
-
11238
- class TabPanel extends FASTElement {}
11239
-
11240
- function tabPanelTemplate() {
11241
- return html`<template slot="tabpanel" role="tabpanel"><slot></slot></template>`;
11242
- }
11243
- const template$a = tabPanelTemplate();
11244
-
11245
- const styles$a = css`
11246
- ${display("block")}
11247
-
11248
- :host{box-sizing:border-box;padding:${spacingHorizontalM} ${spacingHorizontalMNudge}}`;
11249
-
11250
- const definition$a = TabPanel.compose({
11251
- name: `${FluentDesignSystem.prefix}-tab-panel`,
11252
- template: template$a,
11253
- styles: styles$a
11254
- });
11255
-
11256
- definition$a.define(FluentDesignSystem.registry);
11257
-
11258
- var __defProp$f = Object.defineProperty;
11259
- var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
11260
- var __decorateClass$f = (decorators, target, key, kind) => {
11261
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key) : target;
11262
- for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11263
- if (kind && result) __defProp$f(target, key, result);
11264
- return result;
11265
- };
11266
- class Tab extends FASTElement {
11267
- connectedCallback() {
11268
- super.connectedCallback();
11269
- if (this.styles !== void 0) {
11270
- this.$fastController.removeStyles(this.styles);
11271
- }
11272
- this.styles = css`
11273
- :host{--textContent:'${this.textContent}'}`;
11274
- this.$fastController.addStyles(this.styles);
11275
- }
11276
- }
11277
- __decorateClass$f([attr({
11278
- mode: "boolean"
11279
- })], Tab.prototype, "disabled", 2);
11280
- applyMixins(Tab, StartEnd);
11281
-
11282
- function tabTemplate(options = {}) {
11283
- return html`<template slot="tab" role="tab" aria-disabled="${x => x.disabled}">${startSlotTemplate(options)}<span class="tab-content"><slot></slot></span>${endSlotTemplate(options)}</template>`;
11284
- }
11285
- const template$9 = tabTemplate({});
11286
-
11287
- const styles$9 = css`
11288
- ${display("inline-flex")}
11289
-
11290
- :host{position:relative;flex-direction:row;align-items:center;cursor:pointer;box-sizing:border-box;justify-content:center;line-height:${lineHeightBase300};font-family:${fontFamilyBase};font-size:${fontSizeBase300};color:${colorNeutralForeground2};fill:currentcolor;grid-row:1;padding:${spacingHorizontalM} ${spacingHorizontalMNudge};border-radius:${borderRadiusMedium};gap:4px}:host .tab-content{display:inline-flex;flex-direction:column;padding:0 2px}:host([aria-selected='true']){color:${colorNeutralForeground1};font-weight:${fontWeightSemibold}}:host .tab-content::after{content:var(--textContent);visibility:hidden;height:0;line-height:${lineHeightBase300};font-weight:${fontWeightSemibold}}:host([aria-selected='true'])::after{background-color:${colorCompoundBrandStroke};border-radius:${borderRadiusCircular};content:'';inset:0;position:absolute;z-index:2}:host([aria-selected='false']:hover)::after{background-color:${colorNeutralStroke1Hover};border-radius:${borderRadiusCircular};content:'';inset:0;position:absolute;z-index:1}:host([aria-selected='true'][disabled])::after{background-color:${colorNeutralForegroundDisabled}}::slotted([slot='start']),::slotted([slot='end']){display:flex}:host([disabled]){cursor:not-allowed;fill:${colorNeutralForegroundDisabled};color:${colorNeutralForegroundDisabled}}:host([disabled]:hover)::after{background-color:unset}:host(:focus){outline:none}:host(:focus-visible){border-radius:${borderRadiusSmall};box-shadow:0 0 0 3px ${colorStrokeFocus2};outline:1px solid ${colorStrokeFocus1}}:host([data-hasIndent]){display:grid;grid-template-columns:20px 1fr auto}:host([data-hasIndent]) .tab-content{grid-column:2}`.withBehaviors(forcedColorsStylesheetBehavior(css`
11291
- :host([aria-selected='true'])::after{background-color:Highlight}`));
11292
-
11293
- const definition$9 = Tab.compose({
11294
- name: `${FluentDesignSystem.prefix}-tab`,
11295
11445
  template: template$9,
11296
11446
  styles: styles$9
11297
11447
  });
11298
11448
 
11299
11449
  definition$9.define(FluentDesignSystem.registry);
11300
11450
 
11301
- const TabsAppearance = {
11302
- subtle: "subtle",
11303
- transparent: "transparent"
11304
- };
11305
- const TabsOrientation = Orientation;
11306
-
11307
- var __defProp$e = Object.defineProperty;
11308
- var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
11309
- var __decorateClass$e = (decorators, target, key, kind) => {
11310
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
11311
- for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11312
- if (kind && result) __defProp$e(target, key, result);
11313
- return result;
11314
- };
11315
- class BaseTabs extends FASTElement {
11316
- constructor() {
11317
- super(...arguments);
11318
- this.orientation = TabsOrientation.horizontal;
11319
- this.prevActiveTabIndex = 0;
11320
- this.activeTabIndex = 0;
11321
- this.change = () => {
11322
- this.$emit("change", this.activetab);
11323
- };
11324
- this.isDisabledElement = el => {
11325
- return el.getAttribute("aria-disabled") === "true";
11326
- };
11327
- this.isHiddenElement = el => {
11328
- return el.hasAttribute("hidden");
11329
- };
11330
- this.isFocusableElement = el => {
11331
- return !this.isDisabledElement(el) && !this.isHiddenElement(el);
11332
- };
11333
- this.handleTabClick = event => {
11334
- const selectedTab = event.currentTarget;
11335
- if (selectedTab.nodeType === 1 && this.isFocusableElement(selectedTab)) {
11336
- this.prevActiveTabIndex = this.activeTabIndex;
11337
- this.activeTabIndex = this.tabs.indexOf(selectedTab);
11338
- this.setComponent();
11339
- }
11340
- };
11341
- this.handleTabKeyDown = event => {
11342
- if (this.isHorizontal()) {
11343
- switch (event.key) {
11344
- case keyArrowLeft:
11345
- event.preventDefault();
11346
- this.adjustBackward(event);
11347
- break;
11348
- case keyArrowRight:
11349
- event.preventDefault();
11350
- this.adjustForward(event);
11351
- break;
11352
- }
11353
- } else {
11354
- switch (event.key) {
11355
- case keyArrowUp:
11356
- event.preventDefault();
11357
- this.adjustBackward(event);
11358
- break;
11359
- case keyArrowDown:
11360
- event.preventDefault();
11361
- this.adjustForward(event);
11362
- break;
11363
- }
11364
- }
11365
- switch (event.key) {
11366
- case keyHome:
11367
- event.preventDefault();
11368
- this.adjust(-this.activeTabIndex);
11369
- break;
11370
- case keyEnd:
11371
- event.preventDefault();
11372
- this.adjust(this.tabs.length - this.activeTabIndex - 1);
11373
- break;
11374
- }
11375
- };
11376
- }
11377
- /**
11378
- * @internal
11379
- */
11380
- orientationChanged() {
11381
- if (this.$fastController.isConnected) {
11382
- this.setTabs();
11383
- }
11384
- }
11385
- /**
11386
- * @internal
11387
- */
11388
- activeidChanged(oldValue, newValue) {
11389
- if (this.$fastController.isConnected && this.tabs.length <= this.tabpanels.length) {
11390
- this.prevActiveTabIndex = this.tabs.findIndex(item => item.id === oldValue);
11391
- this.setTabs();
11392
- }
11393
- }
11394
- /**
11395
- * @internal
11396
- */
11397
- tabsChanged() {
11398
- if (this.$fastController.isConnected && this.tabs.length <= this.tabpanels.length) {
11399
- this.tabIds = this.getTabIds();
11400
- this.tabpanelIds = this.getTabPanelIds();
11401
- this.setTabs();
11402
- }
11403
- }
11404
- /**
11405
- * @internal
11406
- */
11407
- tabpanelsChanged() {
11408
- if (this.$fastController.isConnected && this.tabpanels.length <= this.tabs.length) {
11409
- this.tabIds = this.getTabIds();
11410
- this.tabpanelIds = this.getTabPanelIds();
11411
- this.setTabs();
11412
- }
11413
- }
11414
- getActiveIndex() {
11415
- const id = this.activeid;
11416
- if (id !== void 0) {
11417
- return this.tabIds.indexOf(this.activeid) === -1 ? 0 : this.tabIds.indexOf(this.activeid);
11418
- } else {
11419
- return 0;
11420
- }
11421
- }
11422
- /**
11423
- * Function that is invoked whenever the selected tab or the tab collection changes.
11424
- *
11425
- * @public
11426
- */
11427
- setTabs() {
11428
- const gridHorizontalProperty = "gridColumn";
11429
- const gridVerticalProperty = "gridRow";
11430
- const gridProperty = this.isHorizontal() ? gridHorizontalProperty : gridVerticalProperty;
11431
- this.activeTabIndex = this.getActiveIndex();
11432
- this.tabs.forEach((tab, index) => {
11433
- if (tab.slot === "tab") {
11434
- const isActiveTab = this.activeTabIndex === index && this.isFocusableElement(tab);
11435
- const tabId = this.tabIds[index];
11436
- const tabpanelId = this.tabpanelIds[index];
11437
- tab.setAttribute("id", tabId);
11438
- tab.setAttribute("aria-selected", isActiveTab ? "true" : "false");
11439
- tab.setAttribute("aria-controls", tabpanelId);
11440
- tab.addEventListener("click", this.handleTabClick);
11441
- tab.addEventListener("keydown", this.handleTabKeyDown);
11442
- tab.setAttribute("tabindex", isActiveTab ? "0" : "-1");
11443
- if (isActiveTab) {
11444
- this.activetab = tab;
11445
- this.activeid = tabId;
11446
- }
11447
- }
11448
- tab.style[gridHorizontalProperty] = "";
11449
- tab.style[gridVerticalProperty] = "";
11450
- tab.style[gridProperty] = `${index + 1}`;
11451
- !this.isHorizontal() ? tab.classList.add("vertical") : tab.classList.remove("vertical");
11452
- });
11453
- this.setTabPanels();
11454
- }
11455
- setTabPanels() {
11456
- this.tabpanels.forEach((tabpanel, index) => {
11457
- const tabId = this.tabIds[index];
11458
- const tabpanelId = this.tabpanelIds[index];
11459
- tabpanel.setAttribute("id", tabpanelId);
11460
- tabpanel.setAttribute("aria-labelledby", tabId);
11461
- this.activeTabIndex !== index ? tabpanel.setAttribute("hidden", "") : tabpanel.removeAttribute("hidden");
11462
- });
11463
- }
11464
- getTabIds() {
11465
- return this.tabs.map(tab => {
11466
- return tab.getAttribute("id") ?? `tab-${uniqueId$1()}`;
11467
- });
11468
- }
11469
- getTabPanelIds() {
11470
- return this.tabpanels.map(tabPanel => {
11471
- return tabPanel.getAttribute("id") ?? `panel-${uniqueId$1()}`;
11472
- });
11473
- }
11474
- setComponent() {
11475
- if (this.activeTabIndex !== this.prevActiveTabIndex) {
11476
- this.activeid = this.tabIds[this.activeTabIndex];
11477
- this.focusTab();
11478
- this.change();
11479
- }
11480
- }
11481
- isHorizontal() {
11482
- return this.orientation === TabsOrientation.horizontal;
11483
- }
11484
- /**
11485
- * The adjust method for FASTTabs
11486
- * @public
11487
- * @remarks
11488
- * This method allows the active index to be adjusted by numerical increments
11489
- */
11490
- adjust(adjustment) {
11491
- const focusableTabs = this.tabs.filter(t => this.isFocusableElement(t));
11492
- const currentActiveTabIndex = focusableTabs.indexOf(this.activetab);
11493
- const nextTabIndex = limit(0, focusableTabs.length - 1, currentActiveTabIndex + adjustment);
11494
- const nextIndex = this.tabs.indexOf(focusableTabs[nextTabIndex]);
11495
- if (nextIndex > -1) {
11496
- this.moveToTabByIndex(this.tabs, nextIndex);
11497
- }
11498
- }
11499
- adjustForward(e) {
11500
- const group = this.tabs;
11501
- let index = 0;
11502
- index = this.activetab ? group.indexOf(this.activetab) + 1 : 1;
11503
- if (index === group.length) {
11504
- index = 0;
11505
- }
11506
- while (index < group.length && group.length > 1) {
11507
- if (this.isFocusableElement(group[index])) {
11508
- this.moveToTabByIndex(group, index);
11509
- break;
11510
- } else if (this.activetab && index === group.indexOf(this.activetab)) {
11511
- break;
11512
- } else if (index + 1 >= group.length) {
11513
- index = 0;
11514
- } else {
11515
- index += 1;
11516
- }
11517
- }
11518
- }
11519
- adjustBackward(e) {
11520
- const group = this.tabs;
11521
- let index = 0;
11522
- index = this.activetab ? group.indexOf(this.activetab) - 1 : 0;
11523
- index = index < 0 ? group.length - 1 : index;
11524
- while (index >= 0 && group.length > 1) {
11525
- if (this.isFocusableElement(group[index])) {
11526
- this.moveToTabByIndex(group, index);
11527
- break;
11528
- } else if (index - 1 < 0) {
11529
- index = group.length - 1;
11530
- } else {
11531
- index -= 1;
11532
- }
11533
- }
11534
- }
11535
- moveToTabByIndex(group, index) {
11536
- const tab = group[index];
11537
- this.activetab = tab;
11538
- this.prevActiveTabIndex = this.activeTabIndex;
11539
- this.activeTabIndex = index;
11540
- tab.focus();
11541
- this.setComponent();
11542
- }
11543
- focusTab() {
11544
- this.tabs[this.activeTabIndex].focus();
11545
- }
11546
- /**
11547
- * @internal
11548
- */
11549
- connectedCallback() {
11550
- super.connectedCallback();
11551
- this.tabIds = this.getTabIds();
11552
- this.tabpanelIds = this.getTabPanelIds();
11553
- this.activeTabIndex = this.getActiveIndex();
11554
- }
11555
- }
11556
- __decorateClass$e([attr], BaseTabs.prototype, "orientation", 2);
11557
- __decorateClass$e([attr], BaseTabs.prototype, "activeid", 2);
11558
- __decorateClass$e([observable], BaseTabs.prototype, "tabs", 2);
11559
- __decorateClass$e([observable], BaseTabs.prototype, "tabpanels", 2);
11560
-
11561
11451
  var __defProp$d = Object.defineProperty;
11562
11452
  var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
11563
11453
  var __decorateClass$d = (decorators, target, key, kind) => {
11564
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target;
11565
- for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11566
- if (kind && result) __defProp$d(target, key, result);
11567
- return result;
11568
- };
11569
- class Tabs extends BaseTabs {
11570
- constructor() {
11571
- super(...arguments);
11572
- /**
11573
- * activeTabData
11574
- * The positional coordinates and size dimensions of the active tab. Used for calculating the offset and scale of the tab active indicator.
11575
- */
11576
- this.activeTabData = {
11577
- x: 0,
11578
- y: 0,
11579
- height: 0,
11580
- width: 0
11581
- };
11582
- /**
11583
- * previousActiveTabData
11584
- * The positional coordinates and size dimensions of the active tab. Used for calculating the offset and scale of the tab active indicator.
11585
- */
11586
- this.previousActiveTabData = {
11587
- x: 0,
11588
- y: 0,
11589
- height: 0,
11590
- width: 0
11591
- };
11592
- /**
11593
- * activeTabOffset
11594
- * Used to position the active indicator for animations of the active indicator on active tab changes.
11595
- */
11596
- this.activeTabOffset = 0;
11454
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target;
11455
+ for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11456
+ if (kind && result) __defProp$d(target, key, result);
11457
+ return result;
11458
+ };
11459
+ class Tab extends FASTElement {
11460
+ constructor() {
11461
+ super();
11597
11462
  /**
11598
- * activeTabScale
11599
- * Used to scale the tab active indicator up or down as animations of the active indicator occur.
11463
+ * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
11464
+ *
11465
+ * @internal
11600
11466
  */
11601
- this.activeTabScale = 1;
11602
- this.appearance = TabsAppearance.transparent;
11603
- }
11604
- /**
11605
- * calculateAnimationProperties
11606
- *
11607
- * Recalculates the active tab offset and scale.
11608
- * These values will be applied to css variables that control the tab active indicator position animations
11609
- */
11610
- calculateAnimationProperties(tab) {
11611
- this.activeTabOffset = this.getTabPosition(tab);
11612
- this.activeTabScale = this.getTabScale(tab);
11613
- }
11614
- /**
11615
- * getSelectedTabPosition - gets the x or y coordinates of the tab
11616
- */
11617
- getTabPosition(tab) {
11618
- if (this.orientation === TabsOrientation.horizontal) {
11619
- return this.previousActiveTabData.x - (tab.getBoundingClientRect().x - this.getBoundingClientRect().x);
11620
- } else return this.previousActiveTabData.y - (tab.getBoundingClientRect().y - this.getBoundingClientRect().y);
11621
- }
11622
- /**
11623
- * getSelectedTabScale - gets the scale of the tab
11624
- */
11625
- getTabScale(tab) {
11626
- if (this.orientation === TabsOrientation.horizontal) {
11627
- return this.previousActiveTabData.width / tab.getBoundingClientRect().width;
11628
- } else return this.previousActiveTabData.height / tab.getBoundingClientRect().height;
11629
- }
11630
- /**
11631
- * Calculates and applies updated values to CSS variables.
11632
- *
11633
- * @param tab - the tab element to apply the updated values to
11634
- * @internal
11635
- */
11636
- applyUpdatedCSSValues(tab) {
11637
- this.calculateAnimationProperties(tab);
11638
- this.setTabScaleCSSVar();
11639
- this.setTabOffsetCSSVar();
11640
- }
11641
- /**
11642
- * Runs through all the operations required for setting the tab active indicator to its starting location, ending
11643
- * location, and applying the animated css class to the tab.
11644
- *
11645
- * @param tab - the tab element to apply the updated values to
11646
- * @internal
11647
- */
11648
- animationLoop(tab) {
11649
- tab.setAttribute("data-animate", "false");
11650
- this.applyUpdatedCSSValues(tab);
11651
- this.previousActiveTabData = this.activeTabData;
11652
- this.applyUpdatedCSSValues(tab);
11653
- tab.setAttribute("data-animate", "true");
11654
- }
11655
- /**
11656
- * Gets the position data for a tab element relative to its parent
11657
- * @param tab - The tab element to get position data for
11658
- * @returns The position data for the tab
11659
- */
11660
- getTabPositionData(tab) {
11661
- const rect = tab.getBoundingClientRect();
11662
- const parentRect = this.getBoundingClientRect();
11663
- return {
11664
- x: rect.x - parentRect.x,
11665
- y: rect.y - parentRect.y,
11666
- height: rect.height,
11667
- width: rect.width
11668
- };
11467
+ this.elementInternals = this.attachInternals();
11468
+ this.elementInternals.role = "tab";
11669
11469
  }
11670
- /**
11671
- * Sets the data from the active tab onto the class. used for making all the animation calculations for the active
11672
- * tab indicator.
11673
- *
11674
- * @internal
11675
- */
11676
- setTabData() {
11677
- if (this.tabs && this.tabs.length > 0) {
11678
- const tabs = this.tabs;
11679
- const activeTab = this.activetab || tabs[0];
11680
- this.activeTabData = this.getTabPositionData(activeTab);
11681
- if (this.previousActiveTabData?.x !== this.activeTabData?.x && this.previousActiveTabData?.y !== this.activeTabData?.y) {
11682
- this.previousActiveTabData = this.activeTabData;
11683
- }
11470
+ connectedCallback() {
11471
+ super.connectedCallback();
11472
+ this.slot || (this.slot = "tab");
11473
+ if (this.disabled) {
11474
+ this.setAttribute("aria-disabled", "true");
11475
+ }
11476
+ if (this.styles) {
11477
+ this.$fastController.removeStyles(this.styles);
11684
11478
  }
11685
- }
11686
- setTabOffsetCSSVar() {
11687
- this.styles = css`
11688
- :host{--tabIndicatorOffset:${this.activeTabOffset.toString()}px}`;
11689
- this.$fastController.addStyles(this.styles);
11690
- }
11691
- setTabScaleCSSVar() {
11692
11479
  this.styles = css`
11693
- :host{--tabIndicatorScale:${this.activeTabScale.toString()}}`;
11480
+ :host{--textContent:'${this.textContent}'}`;
11694
11481
  this.$fastController.addStyles(this.styles);
11695
11482
  }
11696
- activeidChanged(oldValue, newValue) {
11697
- if (oldValue && this.tabs) {
11698
- const oldTab = this.tabs.find(tab => tab.id === oldValue);
11699
- if (oldTab) {
11700
- this.previousActiveTabData = this.getTabPositionData(oldTab);
11701
- }
11702
- }
11703
- super.activeidChanged(oldValue, newValue);
11704
- this.setTabData();
11705
- if (this.activetab) {
11706
- this.animationLoop(this.activetab);
11707
- }
11708
- }
11709
- tabsChanged() {
11710
- super.tabsChanged();
11711
- this.setTabData();
11712
- if (this.activetab) {
11713
- this.animationLoop(this.activetab);
11714
- }
11715
- }
11716
11483
  }
11717
- __decorateClass$d([attr], Tabs.prototype, "appearance", 2);
11718
11484
  __decorateClass$d([attr({
11719
11485
  mode: "boolean"
11720
- })], Tabs.prototype, "disabled", 2);
11721
- __decorateClass$d([attr], Tabs.prototype, "size", 2);
11722
- applyMixins(Tabs, StartEnd);
11486
+ })], Tab.prototype, "disabled", 2);
11487
+ applyMixins(Tab, StartEnd);
11723
11488
 
11724
- function tabsTemplate(options = {}) {
11725
- return html` ${startSlotTemplate(options)}<div class="tablist" part="tablist" role="tablist"><slot name="tab" ${slotted("tabs")}></slot></div>${endSlotTemplate(options)}<div class="tabpanel" part="tabpanel"><slot name="tabpanel" ${slotted("tabpanels")}></slot></div>`;
11489
+ function tabTemplate(options = {}) {
11490
+ return html`<template slot="tab" role="tab" aria-disabled="${x => x.disabled}">${startSlotTemplate(options)}<span class="tab-content"><slot></slot></span>${endSlotTemplate(options)}</template>`;
11726
11491
  }
11727
- const template$8 = tabsTemplate({});
11492
+ const template$8 = tabTemplate({});
11728
11493
 
11729
11494
  const styles$8 = css`
11730
- ${display("grid")}
11495
+ ${display("inline-flex")}
11731
11496
 
11732
- :host{box-sizing:border-box;font-family:${fontFamilyBase};font-size:${fontSizeBase300};line-height:${lineHeightBase300};color:${colorNeutralForeground2};grid-template-columns:auto 1fr auto;grid-template-rows:auto 1fr}:host([disabled]){cursor:not-allowed;color:${colorNeutralForegroundDisabled}}:host([disabled]) ::slotted(fluent-tab){pointer-events:none;cursor:not-allowed;color:${colorNeutralForegroundDisabled}}:host([disabled]) ::slotted(fluent-tab:after){background-color:${colorNeutralForegroundDisabled}}:host([disabled]) ::slotted(fluent-tab[aria-selected='true'])::after{background-color:${colorNeutralForegroundDisabled}}:host([disabled]) ::slotted(fluent-tab:hover):before{content:unset}:host ::slotted(fluent-tab){border-radius:${borderRadiusMedium}}:host ::slotted(fluent-tab[aria-selected='true'])::before{background-color:${colorNeutralForegroundDisabled}}.tablist{display:grid;grid-template-rows:auto auto;grid-template-columns:auto;position:relative;width:max-content;align-self:end;box-sizing:border-box}::slotted([slot='start']),::slotted([slot='end']){display:flex;align-self:center}::slotted([slot='start']){margin-inline-end:11px}::slotted([slot='end']){margin-inline-start:11px}.tabpanel{grid-row:2;grid-column-start:1;grid-column-end:4;position:relative}:host([orientation='vertical']){grid-template-rows:auto 1fr auto;grid-template-columns:auto 1fr}:host([orientation='vertical']) .tablist{grid-row-start:2;grid-row-end:2;display:grid;grid-template-rows:auto;grid-template-columns:auto 1fr;position:relative;width:max-content;justify-self:end;align-self:flex-start;width:100%}:host([orientation='vertical']) .tabpanel{grid-column:2;grid-row-start:1;grid-row-end:4}:host([orientation='vertical']) ::slotted([slot='end']){grid-row:3}:host([appearance='subtle']) ::slotted(fluent-tab:hover){background-color:${colorSubtleBackgroundHover};color:${colorNeutralForeground1Hover};fill:${colorCompoundBrandForeground1Hover}}:host([appearance='subtle']) ::slotted(fluent-tab:active){background-color:${colorSubtleBackgroundPressed};fill:${colorSubtleBackgroundPressed};color:${colorNeutralForeground1}}:host([size='small']) ::slotted(fluent-tab){font-size:${fontSizeBase300};line-height:${lineHeightBase300};padding:${spacingVerticalSNudge} ${spacingHorizontalSNudge}}:host([size='large']) ::slotted(fluent-tab){font-size:${fontSizeBase400};line-height:${lineHeightBase400};padding:${spacingVerticalL} ${spacingHorizontalMNudge}}:host ::slotted(fluent-tab[data-animate='true'])::after{transition-property:transform;transition-duration:${durationSlow};transition-timing-function:${curveDecelerateMax}}:host ::slotted(fluent-tab)::after{height:${strokeWidthThicker};margin-top:auto;transform-origin:left;transform:translateX(var(--tabIndicatorOffset)) scaleX(var(--tabIndicatorScale))}:host([orientation='vertical']) ::slotted(fluent-tab)::after{width:${strokeWidthThicker};height:unset;margin-top:unset;transform-origin:top;transform:translateY(var(--tabIndicatorOffset)) scaleY(var(--tabIndicatorScale))}:host ::slotted(fluent-tab)::before{height:${strokeWidthThicker};border-radius:${borderRadiusCircular};content:'';inset:0;position:absolute;margin-top:auto}:host([orientation='vertical']) ::slotted(fluent-tab)::before{height:unset;width:${strokeWidthThicker};margin-inline-end:auto;transform-origin:top}:host ::slotted(fluent-tab[aria-selected='false']:hover)::after{height:${strokeWidthThicker};margin-top:auto;transform-origin:left}:host([orientation='vertical']) ::slotted(fluent-tab[aria-selected='false']:hover)::after{height:unset;margin-inline-end:auto;transform-origin:top;width:${strokeWidthThicker}}:host([orientation='vertical']) ::slotted(fluent-tab){align-items:flex-start;grid-column:2;padding-top:${spacingVerticalSNudge};padding-bottom:${spacingVerticalSNudge}}:host([orientation='vertical'][size='small']) ::slotted(fluent-tab){padding-top:${spacingVerticalXXS};padding-bottom:${spacingVerticalXXS}}:host([orientation='vertical'][size='large']) ::slotted(fluent-tab){padding-top:${spacingVerticalS};padding-bottom:${spacingVerticalS}}:host([size='small']) ::slotted(fluent-tab)::after,:host([size='small']) ::slotted(fluent-tab)::before,:host([size='small']) ::slotted(fluent-tab:hover)::after{right:${spacingHorizontalSNudge};left:${spacingHorizontalSNudge}}:host ::slotted(fluent-tab)::after,:host ::slotted(fluent-tab)::before,:host ::slotted(fluent-tab:hover)::after{right:${spacingHorizontalMNudge};left:${spacingHorizontalMNudge}}:host([size='large']) ::slotted(fluent-tab)::after,:host([size='large']) ::slotted(fluent-tab)::before,:host([size='large']) ::slotted(fluent-tab:hover)::after{right:${spacingHorizontalMNudge};left:${spacingHorizontalMNudge}}:host([orientation='vertical'][size='small']) ::slotted(fluent-tab)::after,:host([orientation='vertical'][size='small']) ::slotted(fluent-tab)::before,:host([orientation='vertical'][size='small']) ::slotted(fluent-tab:hover)::after{right:0;left:0;top:${spacingVerticalSNudge};bottom:${spacingVerticalSNudge}}:host([orientation='vertical']) ::slotted(fluent-tab)::after,:host([orientation='vertical']) ::slotted(fluent-tab)::before,:host([orientation='vertical']) ::slotted(fluent-tab:hover)::after{right:0;left:0;top:${spacingVerticalS};bottom:${spacingVerticalS}}:host([orientation='vertical'][size='large']) ::slotted(fluent-tab)::after,:host([orientation='vertical'][size='large']) ::slotted(fluent-tab)::before,:host([orientation='vertical'][size='large']) ::slotted(fluent-tab:hover)::after{right:0;left:0;top:${spacingVerticalMNudge};bottom:${spacingVerticalMNudge}}`;
11497
+ :host{position:relative;flex-direction:row;align-items:center;cursor:pointer;box-sizing:border-box;justify-content:center;line-height:${lineHeightBase300};font-family:${fontFamilyBase};font-size:${fontSizeBase300};color:${colorNeutralForeground2};fill:currentcolor;grid-row:1;padding:${spacingHorizontalM} ${spacingHorizontalMNudge};border-radius:${borderRadiusMedium};gap:4px}:host .tab-content{display:inline-flex;flex-direction:column;padding:0 2px}:host([aria-selected='true']){color:${colorNeutralForeground1};font-weight:${fontWeightSemibold}}:host .tab-content::after{content:var(--textContent);visibility:hidden;height:0;line-height:${lineHeightBase300};font-weight:${fontWeightSemibold}}:host([aria-selected='true'])::after{background-color:${colorCompoundBrandStroke};border-radius:${borderRadiusCircular};content:'';inset:0;position:absolute;z-index:2}:host([aria-selected='false']:hover)::after{background-color:${colorNeutralStroke1Hover};border-radius:${borderRadiusCircular};content:'';inset:0;position:absolute;z-index:1}:host([aria-selected='true'][disabled])::after{background-color:${colorNeutralForegroundDisabled}}::slotted([slot='start']),::slotted([slot='end']){display:flex}:host([disabled]){cursor:not-allowed;fill:${colorNeutralForegroundDisabled};color:${colorNeutralForegroundDisabled}}:host([disabled]:hover)::after{background-color:unset}:host(:focus){outline:none}:host(:focus-visible){border-radius:${borderRadiusSmall};box-shadow:0 0 0 3px ${colorStrokeFocus2};outline:1px solid ${colorStrokeFocus1}}:host([data-hasIndent]){display:grid;grid-template-columns:20px 1fr auto}:host([data-hasIndent]) .tab-content{grid-column:2}`.withBehaviors(forcedColorsStylesheetBehavior(css`
11498
+ :host([aria-selected='true'])::after{background-color:Highlight}`));
11733
11499
 
11734
- const definition$8 = Tabs.compose({
11735
- name: `${FluentDesignSystem.prefix}-tabs`,
11500
+ const definition$8 = Tab.compose({
11501
+ name: `${FluentDesignSystem.prefix}-tab`,
11736
11502
  template: template$8,
11737
11503
  styles: styles$8
11738
11504
  });
11739
11505
 
11740
11506
  definition$8.define(FluentDesignSystem.registry);
11741
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
+
11742
11515
  const isARIADisabledElement = el => {
11743
- return el.getAttribute("aria-disabled") === "true";
11516
+ return el.getAttribute("aria-disabled") === "true" || el.elementInternals?.ariaDisabled === "true";
11744
11517
  };
11745
11518
  const isHiddenElement = el => {
11746
11519
  return el.hasAttribute("hidden");
@@ -11749,13 +11522,6 @@ const isFocusableElement = el => {
11749
11522
  return !isARIADisabledElement(el) && !isHiddenElement(el);
11750
11523
  };
11751
11524
 
11752
- function isTab(element, tagName = "-tab") {
11753
- if (element?.nodeType !== Node.ELEMENT_NODE) {
11754
- return false;
11755
- }
11756
- return element.tagName.toLowerCase().endsWith(tagName);
11757
- }
11758
-
11759
11525
  const TablistAppearance = {
11760
11526
  subtle: "subtle",
11761
11527
  transparent: "transparent"
@@ -11772,7 +11538,7 @@ var __decorateClass$c = (decorators, target, key, kind) => {
11772
11538
  };
11773
11539
  class BaseTablist extends FASTElement {
11774
11540
  constructor() {
11775
- super(...arguments);
11541
+ super();
11776
11542
  /**
11777
11543
  * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
11778
11544
  *
@@ -11789,6 +11555,9 @@ class BaseTablist extends FASTElement {
11789
11555
  };
11790
11556
  this.handleTabClick = event => {
11791
11557
  const selectedTab = event.currentTarget;
11558
+ if (selectedTab.disabled || this.disabled) {
11559
+ return;
11560
+ }
11792
11561
  if (selectedTab.nodeType === Node.ELEMENT_NODE && isFocusableElement(selectedTab)) {
11793
11562
  this.prevActiveTabIndex = this.activeTabIndex;
11794
11563
  this.activeTabIndex = this.tabs.indexOf(selectedTab);
@@ -11796,6 +11565,9 @@ class BaseTablist extends FASTElement {
11796
11565
  }
11797
11566
  };
11798
11567
  this.handleTabKeyDown = event => {
11568
+ if (this.disabled) {
11569
+ return;
11570
+ }
11799
11571
  const dir = getDirection(this);
11800
11572
  switch (event.key) {
11801
11573
  case keyArrowLeft:
@@ -11836,6 +11608,8 @@ class BaseTablist extends FASTElement {
11836
11608
  break;
11837
11609
  }
11838
11610
  };
11611
+ this.elementInternals.role = "tablist";
11612
+ this.elementInternals.ariaOrientation = this.orientation ?? TablistOrientation.horizontal;
11839
11613
  }
11840
11614
  /**
11841
11615
  * Handles disabled changes
@@ -11846,25 +11620,23 @@ class BaseTablist extends FASTElement {
11846
11620
  */
11847
11621
  disabledChanged(prev, next) {
11848
11622
  toggleState(this.elementInternals, "disabled", next);
11849
- if (this.$fastController.isConnected) {
11850
- this.setTabs();
11851
- }
11623
+ this.setTabs();
11852
11624
  }
11853
11625
  /**
11854
11626
  * @internal
11855
11627
  */
11856
11628
  orientationChanged(prev, next) {
11857
- this.elementInternals.ariaOrientation = next ?? TablistOrientation.horizontal;
11858
- swapStates(this.elementInternals, prev, next, TablistOrientation);
11859
- if (this.$fastController.isConnected) {
11860
- this.setTabs();
11629
+ if (this.elementInternals) {
11630
+ this.elementInternals.ariaOrientation = next ?? TablistOrientation.horizontal;
11631
+ swapStates(this.elementInternals, prev, next, TablistOrientation);
11861
11632
  }
11633
+ this.setTabs();
11862
11634
  }
11863
11635
  /**
11864
11636
  * @internal
11865
11637
  */
11866
11638
  activeidChanged(oldValue, newValue) {
11867
- if (this.$fastController.isConnected && this.tabs.length > 0) {
11639
+ if (this.tabs?.length > 0) {
11868
11640
  this.prevActiveTabIndex = this.tabs.findIndex(item => item.id === oldValue);
11869
11641
  this.setTabs();
11870
11642
  if (oldValue) {
@@ -11895,8 +11667,14 @@ class BaseTablist extends FASTElement {
11895
11667
  /**
11896
11668
  * @internal
11897
11669
  */
11898
- tabsChanged() {
11899
- 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) {
11900
11678
  this.tabIds = this.getTabIds();
11901
11679
  this.setTabs();
11902
11680
  for (const tab of this.tabs) {
@@ -11926,12 +11704,11 @@ class BaseTablist extends FASTElement {
11926
11704
  */
11927
11705
  setTabs() {
11928
11706
  this.activeTabIndex = this.getActiveIndex();
11929
- const hasStartSlot = this.tabs.some(tab => !!tab.querySelector("[slot='start']"));
11930
- this.tabs.forEach((tab, index) => {
11707
+ const hasStartSlot = this.tabs?.some(tab => !!tab.querySelector("[slot='start']"));
11708
+ this.tabs?.forEach((tab, index) => {
11931
11709
  if (tab.slot === "tab") {
11932
11710
  const isActiveTab = this.activeTabIndex === index && isFocusableElement(tab);
11933
11711
  const tabId = this.tabIds[index];
11934
- console.log("disabled", this.disabled);
11935
11712
  if (!tab.disabled) {
11936
11713
  this.disabled ? tab.setAttribute("aria-disabled", "true") : tab.removeAttribute("aria-disabled");
11937
11714
  }
@@ -11995,8 +11772,10 @@ class BaseTablist extends FASTElement {
11995
11772
  */
11996
11773
  connectedCallback() {
11997
11774
  super.connectedCallback();
11998
- this.tabIds = this.getTabIds();
11999
- this.activeTabIndex = this.getActiveIndex();
11775
+ waitForConnectedDescendants(this, () => {
11776
+ this.tabIds = this.getTabIds();
11777
+ this.setTabs();
11778
+ });
12000
11779
  }
12001
11780
  }
12002
11781
  __decorateClass$c([attr({
@@ -12146,8 +11925,8 @@ class Tablist extends BaseTablist {
12146
11925
  /**
12147
11926
  * Initiates the active tab indicator animation loop when tabs change.
12148
11927
  */
12149
- tabsChanged() {
12150
- super.tabsChanged();
11928
+ tabsChanged(prev, next) {
11929
+ super.tabsChanged(prev, next);
12151
11930
  this.setTabData();
12152
11931
  if (this.activetab) {
12153
11932
  this.animationLoop(this.activetab);
@@ -12213,6 +11992,24 @@ class BaseTextArea extends FASTElement {
12213
11992
  this.resize = TextAreaResize.none;
12214
11993
  this.spellcheck = false;
12215
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
+ }
12216
12013
  defaultSlottedNodesChanged() {
12217
12014
  const next = this.getContent();
12218
12015
  this.defaultValue = next;
@@ -12254,6 +12051,9 @@ class BaseTextArea extends FASTElement {
12254
12051
  }
12255
12052
  readOnlyChanged() {
12256
12053
  this.elementInternals.ariaReadOnly = `${!!this.readOnly}`;
12054
+ if (this.$fastController.isConnected) {
12055
+ this.setValidity();
12056
+ }
12257
12057
  }
12258
12058
  requiredChanged() {
12259
12059
  this.elementInternals.ariaRequired = `${!!this.required}`;
@@ -12354,10 +12154,19 @@ class BaseTextArea extends FASTElement {
12354
12154
  */
12355
12155
  connectedCallback() {
12356
12156
  super.connectedCallback();
12357
- this.setDefaultValue();
12358
- this.maybeCreateAutoSizerEl();
12359
- this.bindEvents();
12360
- 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
+ });
12361
12170
  }
12362
12171
  /**
12363
12172
  * @internal
@@ -12452,18 +12261,6 @@ class BaseTextArea extends FASTElement {
12452
12261
  select() {
12453
12262
  this.controlEl.select();
12454
12263
  }
12455
- setDefaultValue() {
12456
- this.defaultValue = this.innerHTML.trim() || this.preConnectControlEl.defaultValue || "";
12457
- this.value = this.preConnectControlEl.value || this.defaultValue;
12458
- this.setFormValue(this.value);
12459
- this.setValidity();
12460
- this.preConnectControlEl = null;
12461
- }
12462
- bindEvents() {
12463
- this.controlEl.addEventListener("input", () => this.userInteracted = true, {
12464
- once: true
12465
- });
12466
- }
12467
12264
  /**
12468
12265
  * Gets the content inside the light DOM, if any HTML element is present, use its `outerHTML` value.
12469
12266
  */
@@ -12479,15 +12276,6 @@ class BaseTextArea extends FASTElement {
12479
12276
  }
12480
12277
  }).join("") || "";
12481
12278
  }
12482
- observeControlElAttrs() {
12483
- this.controlElAttrObserver = new MutationObserver(() => {
12484
- this.setValidity();
12485
- });
12486
- this.controlElAttrObserver.observe(this.controlEl, {
12487
- attributes: true,
12488
- attributeFilter: ["disabled", "required", "readonly", "maxlength", "minlength"]
12489
- });
12490
- }
12491
12279
  setDisabledSideEffect(disabled) {
12492
12280
  this.elementInternals.ariaDisabled = `${disabled}`;
12493
12281
  if (this.controlEl) {
@@ -12518,7 +12306,7 @@ class BaseTextArea extends FASTElement {
12518
12306
  this.autoSizerEl.classList.add("auto-sizer");
12519
12307
  this.autoSizerEl.ariaHidden = "true";
12520
12308
  }
12521
- this.shadowRoot.prepend(this.autoSizerEl);
12309
+ this.rootEl?.prepend(this.autoSizerEl);
12522
12310
  if (!this.autoSizerObserver) {
12523
12311
  this.autoSizerObserver = new ResizeObserver((_, observer) => {
12524
12312
  const blockSizePropName = window.getComputedStyle(this).writingMode.startsWith("horizontal") ? "height" : "width";
@@ -12561,6 +12349,7 @@ class BaseTextArea extends FASTElement {
12561
12349
  * @public
12562
12350
  */
12563
12351
  BaseTextArea.formAssociated = true;
12352
+ __decorateClass$a([observable], BaseTextArea.prototype, "controlEl", 2);
12564
12353
  __decorateClass$a([observable], BaseTextArea.prototype, "defaultSlottedNodes", 2);
12565
12354
  __decorateClass$a([observable], BaseTextArea.prototype, "labelSlottedNodes", 2);
12566
12355
  __decorateClass$a([attr], BaseTextArea.prototype, "autocomplete", 2);
@@ -12667,7 +12456,7 @@ const styles$6 = css`
12667
12456
  :host{--border-color:FieldText;--border-block-end-color:FieldText;--focus-indicator-color:Highlight;--placeholder-color:FieldText}:host(:hover),:host(:active),:host(:focus-within){--border-color:Highlight;--border-block-end-color:Highlight}:host(:disabled){--color:GrayText;--border-color:GrayText;--border-block-end-color:GrayText;--placeholder-color:GrayText}`));
12668
12457
 
12669
12458
  function textAreaTemplate() {
12670
- return html`<template><label ${ref("labelEl")} for="control" part="label"><slot name="label" ${slotted("labelSlottedNodes")}></slot></label><div class="root" part="root"><textarea ${ref("controlEl")} id="control" class="control" part="control" ?required="${x => x.required}" ?disabled="${x => x.disabled}" ?readonly="${x => x.readOnly}" ?spellcheck="${x => x.spellcheck}" autocomplete="${x => x.autocomplete}" maxlength="${x => x.maxLength}" minlength="${x => x.minLength}" placeholder="${x => x.placeholder}" @change="${x => x.handleControlChange()}" @select="${x => x.handleControlSelect()}" @input="${x => x.handleControlInput()}"></textarea></div><div hidden><slot ${slotted("defaultSlottedNodes")}></slot></div></template>`;
12459
+ return html`<template><label ${ref("labelEl")} for="control" part="label"><slot name="label" ${slotted("labelSlottedNodes")}></slot></label><div class="root" part="root" ${ref("rootEl")}><textarea ${ref("controlEl")} id="control" class="control" part="control" ?required="${x => x.required}" ?disabled="${x => x.disabled}" ?readonly="${x => x.readOnly}" ?spellcheck="${x => x.spellcheck}" autocomplete="${x => x.autocomplete}" maxlength="${x => x.maxLength}" minlength="${x => x.minLength}" placeholder="${x => x.placeholder}" @change="${x => x.handleControlChange()}" @select="${x => x.handleControlSelect()}" @input="${x => x.handleControlInput()}"></textarea></div><div hidden><slot ${slotted("defaultSlottedNodes")}></slot></div></template>`;
12671
12460
  }
12672
12461
  const template$6 = textAreaTemplate();
12673
12462
 
@@ -12733,9 +12522,11 @@ class BaseTextInput extends FASTElement {
12733
12522
  * @internal
12734
12523
  */
12735
12524
  defaultSlottedNodesChanged(prev, next) {
12736
- if (this.$fastController.isConnected) {
12737
- this.controlLabel.hidden = !next?.length;
12738
- }
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
+ });
12739
12530
  }
12740
12531
  /**
12741
12532
  * Sets the value of the element to the initial value.
@@ -12779,7 +12570,11 @@ class BaseTextInput extends FASTElement {
12779
12570
  * @internal
12780
12571
  */
12781
12572
  controlChanged(prev, next) {
12782
- this.setValidity();
12573
+ Updates.enqueue(() => {
12574
+ if (this.$fastController.isConnected) {
12575
+ this.setValidity();
12576
+ }
12577
+ });
12783
12578
  }
12784
12579
  /**
12785
12580
  * The element's validity state.
@@ -12888,6 +12683,7 @@ class BaseTextInput extends FASTElement {
12888
12683
  }
12889
12684
  connectedCallback() {
12890
12685
  super.connectedCallback();
12686
+ this.tabIndex = Number(this.getAttribute("tabindex") ?? 0) < 0 ? -1 : 0;
12891
12687
  this.setFormValue(this.value);
12892
12688
  this.setValidity();
12893
12689
  }
@@ -13101,10 +12897,7 @@ const styles$5 = css`
13101
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}}`;
13102
12898
 
13103
12899
  function textInputTemplate(options = {}) {
13104
- 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({
13105
- property: "defaultSlottedNodes",
13106
- filter: whitespaceFilter
13107
- })}></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>`;
13108
12901
  }
13109
12902
  const template$5 = textInputTemplate();
13110
12903
 
@@ -13242,7 +13035,7 @@ __decorateClass$5([attr({
13242
13035
  })], ToggleButton.prototype, "mixed", 2);
13243
13036
 
13244
13037
  const styles$3 = css`
13245
- ${styles$E}
13038
+ ${styles$C}
13246
13039
 
13247
13040
  :host(${pressedState}){border-color:${colorNeutralStroke1};background-color:${colorNeutralBackground1Selected};color:${colorNeutralForeground1};border-width:${strokeWidthThin}}:host(${pressedState}:hover){border-color:${colorNeutralStroke1Hover};background-color:${colorNeutralBackground1Hover}}:host(${pressedState}:active){border-color:${colorNeutralStroke1Pressed};background-color:${colorNeutralBackground1Pressed}}:host(${pressedState}[appearance='primary']:not(:focus-visible)){border-color:transparent}:host(${pressedState}[appearance='primary']){background-color:${colorBrandBackgroundSelected};color:${colorNeutralForegroundOnBrand}}:host(${pressedState}[appearance='primary']:hover){background-color:${colorBrandBackgroundHover}}:host(${pressedState}[appearance='primary']:active){background-color:${colorBrandBackgroundPressed}}:host(${pressedState}[appearance='subtle']){border-color:transparent;background-color:${colorSubtleBackgroundSelected};color:${colorNeutralForeground2Selected}}:host(${pressedState}[appearance='subtle']:hover){background-color:${colorSubtleBackgroundHover};color:${colorNeutralForeground2Hover}}:host(${pressedState}[appearance='subtle']:active){background-color:${colorSubtleBackgroundPressed};color:${colorNeutralForeground2Pressed}}:host(${pressedState}[appearance='outline']),:host(${pressedState}[appearance='transparent']){background-color:${colorTransparentBackgroundSelected}}:host(${pressedState}[appearance='outline']:hover),:host(${pressedState}[appearance='transparent']:hover){background-color:${colorTransparentBackgroundHover}}:host(${pressedState}[appearance='outline']:active),:host(${pressedState}[appearance='transparent']:active){background-color:${colorTransparentBackgroundPressed}}:host(${pressedState}[appearance='transparent']){border-color:transparent;color:${colorNeutralForeground2BrandSelected}}:host(${pressedState}[appearance='transparent']:hover){color:${colorNeutralForeground2BrandHover}}:host(${pressedState}[appearance='transparent']:active){color:${colorNeutralForeground2BrandPressed}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
13248
13041
  :host(${pressedState}),:host(
@@ -13507,9 +13300,21 @@ class BaseTree extends FASTElement {
13507
13300
  * @internal
13508
13301
  */
13509
13302
  this.elementInternals = this.attachInternals();
13510
- this.childTreeItems = [];
13511
13303
  this.elementInternals.role = "tree";
13512
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
+ }
13513
13318
  /** @internal */
13514
13319
  childTreeItemsChanged() {
13515
13320
  this.updateCurrentSelected();
@@ -13703,6 +13508,7 @@ class BaseTree extends FASTElement {
13703
13508
  }
13704
13509
  }
13705
13510
  __decorateClass$3([observable], BaseTree.prototype, "currentSelected", 2);
13511
+ __decorateClass$3([observable], BaseTree.prototype, "defaultSlot", 2);
13706
13512
  __decorateClass$3([observable], BaseTree.prototype, "childTreeItems", 2);
13707
13513
 
13708
13514
  var __defProp$2 = Object.defineProperty;
@@ -13783,11 +13589,19 @@ class BaseTreeItem extends FASTElement {
13783
13589
  */
13784
13590
  this.elementInternals = this.attachInternals();
13785
13591
  this.expanded = false;
13786
- this.selected = false;
13787
13592
  this.empty = false;
13788
13593
  this.childTreeItems = [];
13789
13594
  this.elementInternals.role = "treeitem";
13790
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
+ }
13791
13605
  /**
13792
13606
  * Handles changes to the expanded attribute
13793
13607
  * @param prev - the previous state
@@ -13837,7 +13651,9 @@ class BaseTreeItem extends FASTElement {
13837
13651
  }
13838
13652
  connectedCallback() {
13839
13653
  super.connectedCallback();
13840
- this.updateTabindexBySelected();
13654
+ Updates.enqueue(() => {
13655
+ this.updateTabindexBySelected();
13656
+ });
13841
13657
  }
13842
13658
  /**
13843
13659
  * Updates the childrens indent
@@ -13880,9 +13696,7 @@ class BaseTreeItem extends FASTElement {
13880
13696
  return isTreeItem(this.parentElement);
13881
13697
  }
13882
13698
  updateTabindexBySelected() {
13883
- if (this.$fastController.isConnected) {
13884
- this.tabIndex = this.selected ? 0 : -1;
13885
- }
13699
+ this.tabIndex = this.selected ? 0 : -1;
13886
13700
  }
13887
13701
  /** @internal */
13888
13702
  handleItemSlotChange() {
@@ -13977,3 +13791,136 @@ const definition = TreeItem.compose({
13977
13791
  });
13978
13792
 
13979
13793
  definition.define(FluentDesignSystem.registry);
13794
+
13795
+ const SUPPORTS_ADOPTED_STYLE_SHEETS = "adoptedStyleSheets" in document;
13796
+ const SUPPORTS_CSS_SCOPE = "CSSScopeRule" in window;
13797
+ const themeStyleTextMap = /* @__PURE__ */new Map();
13798
+ const scopedThemeKeyMap = /* @__PURE__ */new Map();
13799
+ const shadowAdoptedStyleSheetMap = /* @__PURE__ */new Map();
13800
+ const elementThemeMap = /* @__PURE__ */new Map();
13801
+ const globalThemeStyleSheet = new CSSStyleSheet();
13802
+ function setTheme(theme, node = document) {
13803
+ if (!node || !isThemeableNode(node)) {
13804
+ return;
13805
+ }
13806
+ if (!SUPPORTS_ADOPTED_STYLE_SHEETS || node instanceof HTMLElement && !node.shadowRoot && !SUPPORTS_CSS_SCOPE) {
13807
+ const target = node === document ? document.documentElement : node;
13808
+ setThemePropertiesOnElement(theme, target);
13809
+ return;
13810
+ }
13811
+ if ([document, document.documentElement, document.body].includes(node)) {
13812
+ setGlobalTheme(theme);
13813
+ } else {
13814
+ setLocalTheme(theme, node);
13815
+ }
13816
+ }
13817
+ function getThemeStyleText(theme) {
13818
+ if (!themeStyleTextMap.has(theme)) {
13819
+ const tokenDeclarations = [];
13820
+ for (const [tokenName, tokenValue] of Object.entries(theme)) {
13821
+ tokenDeclarations.push(`--${tokenName}:${tokenValue.toString()};`);
13822
+ }
13823
+ themeStyleTextMap.set(theme, tokenDeclarations.join(""));
13824
+ }
13825
+ return themeStyleTextMap.get(theme);
13826
+ }
13827
+ function isThemeableNode(node) {
13828
+ return [document, document.documentElement].includes(node) || node instanceof HTMLElement && !!node.closest("body");
13829
+ }
13830
+ function setGlobalTheme(theme) {
13831
+ if (theme === null) {
13832
+ if (document.adoptedStyleSheets.includes(globalThemeStyleSheet)) {
13833
+ globalThemeStyleSheet.replaceSync("");
13834
+ }
13835
+ return;
13836
+ }
13837
+ globalThemeStyleSheet.replaceSync(`
13838
+ html {
13839
+ ${getThemeStyleText(theme)}
13840
+ }
13841
+ `);
13842
+ if (!document.adoptedStyleSheets.includes(globalThemeStyleSheet)) {
13843
+ document.adoptedStyleSheets.push(globalThemeStyleSheet);
13844
+ }
13845
+ }
13846
+ function setLocalTheme(theme, element) {
13847
+ if (theme === null) {
13848
+ if (element.shadowRoot && shadowAdoptedStyleSheetMap.has(element)) {
13849
+ shadowAdoptedStyleSheetMap.get(element).replaceSync("");
13850
+ } else {
13851
+ delete element.dataset.fluentTheme;
13852
+ forceRepaint(element);
13853
+ }
13854
+ return;
13855
+ }
13856
+ if (element.shadowRoot) {
13857
+ getShadowAdoptedStyleSheet(element).replaceSync(`
13858
+ :host {
13859
+ ${getThemeStyleText(theme)}
13860
+ }
13861
+ `);
13862
+ } else {
13863
+ element.dataset.fluentTheme = getScopedThemeKey(theme);
13864
+ forceRepaint(element);
13865
+ }
13866
+ }
13867
+ function getShadowAdoptedStyleSheet(element) {
13868
+ if (!shadowAdoptedStyleSheetMap.has(element)) {
13869
+ const shadowAdoptedStyleSheet = new CSSStyleSheet();
13870
+ shadowAdoptedStyleSheetMap.set(element, shadowAdoptedStyleSheet);
13871
+ element.shadowRoot?.adoptedStyleSheets.push(shadowAdoptedStyleSheet);
13872
+ }
13873
+ return shadowAdoptedStyleSheetMap.get(element);
13874
+ }
13875
+ function getScopedThemeKey(theme) {
13876
+ if (!scopedThemeKeyMap.has(theme)) {
13877
+ const themeKey = uniqueId$1("fluent-theme-");
13878
+ const scopedThemeStyleSheet = new CSSStyleSheet();
13879
+ scopedThemeKeyMap.set(theme, themeKey);
13880
+ scopedThemeStyleSheet.replaceSync(`
13881
+ @scope ([data-fluent-theme="${themeKey}"]) {
13882
+ :scope {
13883
+ ${getThemeStyleText(theme)}
13884
+ }
13885
+ }
13886
+ `);
13887
+ document.adoptedStyleSheets.push(scopedThemeStyleSheet);
13888
+ }
13889
+ return scopedThemeKeyMap.get(theme);
13890
+ }
13891
+ function setThemePropertiesOnElement(theme, element) {
13892
+ let tokens;
13893
+ if (theme === null) {
13894
+ if (!elementThemeMap.has(element)) {
13895
+ return;
13896
+ }
13897
+ tokens = elementThemeMap.get(element);
13898
+ } else {
13899
+ elementThemeMap.set(element, theme);
13900
+ tokens = theme;
13901
+ }
13902
+ for (const [tokenName, tokenValue] of Object.entries(tokens)) {
13903
+ if (theme === null) {
13904
+ element.style.removeProperty(`--${tokenName}`);
13905
+ } else {
13906
+ element.style.setProperty(`--${tokenName}`, tokenValue.toString());
13907
+ }
13908
+ }
13909
+ }
13910
+ const {
13911
+ userAgent: UA
13912
+ } = navigator;
13913
+ const isWebkit = /\bAppleWebKit\/[\d+\.]+\b/.test(UA);
13914
+ function forceRepaint(element) {
13915
+ if (!isWebkit) {
13916
+ return;
13917
+ }
13918
+ const name = "visibility";
13919
+ const tempValue = "hidden";
13920
+ const currentValue = element.style.getPropertyValue(name);
13921
+ element.style.setProperty(name, tempValue);
13922
+ Updates.process();
13923
+ element.style.setProperty(name, currentValue);
13924
+ }
13925
+
13926
+ export { setTheme };