@fluentui/web-components 3.0.0-rc.15 → 3.0.0-rc.16

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 (522) hide show
  1. package/CHANGELOG.md +16 -2
  2. package/custom-elements.json +10963 -11517
  3. package/dist/esm/accordion/accordion.d.ts +4 -7
  4. package/dist/esm/accordion/accordion.definition.js +2 -2
  5. package/dist/esm/accordion/accordion.definition.js.map +1 -1
  6. package/dist/esm/accordion/accordion.js +4 -7
  7. package/dist/esm/accordion/accordion.js.map +1 -1
  8. package/dist/esm/accordion/accordion.options.d.ts +7 -1
  9. package/dist/esm/accordion/accordion.options.js +7 -0
  10. package/dist/esm/accordion/accordion.options.js.map +1 -1
  11. package/dist/esm/accordion/accordion.styles.js +1 -1
  12. package/dist/esm/accordion/accordion.styles.js.map +1 -1
  13. package/dist/esm/accordion/index.d.ts +1 -0
  14. package/dist/esm/accordion/index.js +1 -0
  15. package/dist/esm/accordion/index.js.map +1 -1
  16. package/dist/esm/accordion-item/accordion-item.d.ts +2 -4
  17. package/dist/esm/accordion-item/accordion-item.definition.js +2 -2
  18. package/dist/esm/accordion-item/accordion-item.definition.js.map +1 -1
  19. package/dist/esm/accordion-item/accordion-item.js +1 -1
  20. package/dist/esm/accordion-item/accordion-item.js.map +1 -1
  21. package/dist/esm/accordion-item/accordion-item.options.d.ts +6 -0
  22. package/dist/esm/accordion-item/accordion-item.options.js +7 -0
  23. package/dist/esm/accordion-item/accordion-item.options.js.map +1 -1
  24. package/dist/esm/accordion-item/accordion-item.styles.js +1 -1
  25. package/dist/esm/accordion-item/accordion-item.styles.js.map +1 -1
  26. package/dist/esm/accordion-item/accordion-item.template.js +2 -2
  27. package/dist/esm/accordion-item/accordion-item.template.js.map +1 -1
  28. package/dist/esm/accordion-item/index.d.ts +1 -0
  29. package/dist/esm/accordion-item/index.js +1 -0
  30. package/dist/esm/accordion-item/index.js.map +1 -1
  31. package/dist/esm/anchor-button/anchor-button.base.d.ts +1 -1
  32. package/dist/esm/anchor-button/anchor-button.base.js +7 -7
  33. package/dist/esm/anchor-button/anchor-button.base.js.map +1 -1
  34. package/dist/esm/anchor-button/anchor-button.d.ts +1 -2
  35. package/dist/esm/anchor-button/anchor-button.definition.js +2 -2
  36. package/dist/esm/anchor-button/anchor-button.definition.js.map +1 -1
  37. package/dist/esm/anchor-button/anchor-button.js +1 -1
  38. package/dist/esm/anchor-button/anchor-button.js.map +1 -1
  39. package/dist/esm/anchor-button/anchor-button.options.d.ts +7 -1
  40. package/dist/esm/anchor-button/anchor-button.options.js +7 -0
  41. package/dist/esm/anchor-button/anchor-button.options.js.map +1 -1
  42. package/dist/esm/anchor-button/anchor-button.styles.js +4 -3
  43. package/dist/esm/anchor-button/anchor-button.styles.js.map +1 -1
  44. package/dist/esm/anchor-button/anchor-button.template.js +1 -1
  45. package/dist/esm/anchor-button/anchor-button.template.js.map +1 -1
  46. package/dist/esm/anchor-button/index.d.ts +1 -0
  47. package/dist/esm/anchor-button/index.js +1 -0
  48. package/dist/esm/anchor-button/index.js.map +1 -1
  49. package/dist/esm/avatar/avatar.definition.js +2 -2
  50. package/dist/esm/avatar/avatar.definition.js.map +1 -1
  51. package/dist/esm/avatar/avatar.options.d.ts +7 -1
  52. package/dist/esm/avatar/avatar.options.js +7 -0
  53. package/dist/esm/avatar/avatar.options.js.map +1 -1
  54. package/dist/esm/avatar/avatar.styles.js +1 -1
  55. package/dist/esm/avatar/avatar.styles.js.map +1 -1
  56. package/dist/esm/avatar/index.d.ts +1 -0
  57. package/dist/esm/avatar/index.js +1 -0
  58. package/dist/esm/avatar/index.js.map +1 -1
  59. package/dist/esm/badge/badge.d.ts +1 -1
  60. package/dist/esm/badge/badge.definition.js +2 -2
  61. package/dist/esm/badge/badge.definition.js.map +1 -1
  62. package/dist/esm/badge/badge.js +1 -1
  63. package/dist/esm/badge/badge.js.map +1 -1
  64. package/dist/esm/badge/badge.options.d.ts +9 -2
  65. package/dist/esm/badge/badge.options.js +7 -0
  66. package/dist/esm/badge/badge.options.js.map +1 -1
  67. package/dist/esm/badge/badge.styles.js +5 -4
  68. package/dist/esm/badge/badge.styles.js.map +1 -1
  69. package/dist/esm/badge/badge.template.js +1 -1
  70. package/dist/esm/badge/badge.template.js.map +1 -1
  71. package/dist/esm/badge/index.d.ts +1 -0
  72. package/dist/esm/badge/index.js +1 -0
  73. package/dist/esm/badge/index.js.map +1 -1
  74. package/dist/esm/button/button.d.ts +1 -1
  75. package/dist/esm/button/button.definition.js +2 -2
  76. package/dist/esm/button/button.definition.js.map +1 -1
  77. package/dist/esm/button/button.js +1 -1
  78. package/dist/esm/button/button.js.map +1 -1
  79. package/dist/esm/button/button.options.d.ts +8 -2
  80. package/dist/esm/button/button.options.js +7 -0
  81. package/dist/esm/button/button.options.js.map +1 -1
  82. package/dist/esm/button/button.styles.js +5 -3
  83. package/dist/esm/button/button.styles.js.map +1 -1
  84. package/dist/esm/button/button.template.js +1 -1
  85. package/dist/esm/button/button.template.js.map +1 -1
  86. package/dist/esm/button/index.d.ts +1 -0
  87. package/dist/esm/button/index.js +1 -0
  88. package/dist/esm/button/index.js.map +1 -1
  89. package/dist/esm/checkbox/checkbox.definition.js +2 -2
  90. package/dist/esm/checkbox/checkbox.definition.js.map +1 -1
  91. package/dist/esm/checkbox/checkbox.options.d.ts +6 -0
  92. package/dist/esm/checkbox/checkbox.options.js +7 -0
  93. package/dist/esm/checkbox/checkbox.options.js.map +1 -1
  94. package/dist/esm/checkbox/checkbox.styles.js +4 -3
  95. package/dist/esm/checkbox/checkbox.styles.js.map +1 -1
  96. package/dist/esm/checkbox/index.d.ts +1 -0
  97. package/dist/esm/checkbox/index.js +1 -0
  98. package/dist/esm/checkbox/index.js.map +1 -1
  99. package/dist/esm/compound-button/compound-button.definition.js +2 -2
  100. package/dist/esm/compound-button/compound-button.definition.js.map +1 -1
  101. package/dist/esm/compound-button/compound-button.options.d.ts +7 -1
  102. package/dist/esm/compound-button/compound-button.options.js +7 -0
  103. package/dist/esm/compound-button/compound-button.options.js.map +1 -1
  104. package/dist/esm/compound-button/compound-button.styles.js +4 -3
  105. package/dist/esm/compound-button/compound-button.styles.js.map +1 -1
  106. package/dist/esm/compound-button/compound-button.template.js +1 -1
  107. package/dist/esm/compound-button/compound-button.template.js.map +1 -1
  108. package/dist/esm/compound-button/index.d.ts +1 -0
  109. package/dist/esm/compound-button/index.js +1 -0
  110. package/dist/esm/compound-button/index.js.map +1 -1
  111. package/dist/esm/counter-badge/counter-badge.d.ts +1 -1
  112. package/dist/esm/counter-badge/counter-badge.definition.js +2 -2
  113. package/dist/esm/counter-badge/counter-badge.definition.js.map +1 -1
  114. package/dist/esm/counter-badge/counter-badge.js +1 -1
  115. package/dist/esm/counter-badge/counter-badge.js.map +1 -1
  116. package/dist/esm/counter-badge/counter-badge.options.d.ts +7 -1
  117. package/dist/esm/counter-badge/counter-badge.options.js +7 -0
  118. package/dist/esm/counter-badge/counter-badge.options.js.map +1 -1
  119. package/dist/esm/counter-badge/counter-badge.styles.js +1 -1
  120. package/dist/esm/counter-badge/counter-badge.styles.js.map +1 -1
  121. package/dist/esm/counter-badge/index.d.ts +1 -0
  122. package/dist/esm/counter-badge/index.js +1 -0
  123. package/dist/esm/counter-badge/index.js.map +1 -1
  124. package/dist/esm/dialog/dialog.definition.js +2 -2
  125. package/dist/esm/dialog/dialog.definition.js.map +1 -1
  126. package/dist/esm/dialog/dialog.options.d.ts +7 -1
  127. package/dist/esm/dialog/dialog.options.js +7 -0
  128. package/dist/esm/dialog/dialog.options.js.map +1 -1
  129. package/dist/esm/dialog/dialog.styles.js +4 -3
  130. package/dist/esm/dialog/dialog.styles.js.map +1 -1
  131. package/dist/esm/dialog/index.d.ts +1 -0
  132. package/dist/esm/dialog/index.js +1 -0
  133. package/dist/esm/dialog/index.js.map +1 -1
  134. package/dist/esm/dialog-body/dialog-body.definition.js +2 -2
  135. package/dist/esm/dialog-body/dialog-body.definition.js.map +1 -1
  136. package/dist/esm/dialog-body/dialog-body.options.d.ts +6 -0
  137. package/dist/esm/dialog-body/dialog-body.options.js +8 -0
  138. package/dist/esm/dialog-body/dialog-body.options.js.map +1 -0
  139. package/dist/esm/dialog-body/dialog-body.styles.js +1 -1
  140. package/dist/esm/dialog-body/dialog-body.styles.js.map +1 -1
  141. package/dist/esm/dialog-body/index.d.ts +1 -0
  142. package/dist/esm/dialog-body/index.js +1 -0
  143. package/dist/esm/dialog-body/index.js.map +1 -1
  144. package/dist/esm/divider/divider.definition.js +2 -2
  145. package/dist/esm/divider/divider.definition.js.map +1 -1
  146. package/dist/esm/divider/divider.options.d.ts +7 -1
  147. package/dist/esm/divider/divider.options.js +7 -0
  148. package/dist/esm/divider/divider.options.js.map +1 -1
  149. package/dist/esm/divider/divider.styles.js +5 -3
  150. package/dist/esm/divider/divider.styles.js.map +1 -1
  151. package/dist/esm/divider/index.d.ts +1 -0
  152. package/dist/esm/divider/index.js +1 -0
  153. package/dist/esm/divider/index.js.map +1 -1
  154. package/dist/esm/drawer/drawer.d.ts +8 -7
  155. package/dist/esm/drawer/drawer.definition.js +2 -2
  156. package/dist/esm/drawer/drawer.definition.js.map +1 -1
  157. package/dist/esm/drawer/drawer.js +8 -7
  158. package/dist/esm/drawer/drawer.js.map +1 -1
  159. package/dist/esm/drawer/drawer.options.d.ts +7 -1
  160. package/dist/esm/drawer/drawer.options.js +7 -0
  161. package/dist/esm/drawer/drawer.options.js.map +1 -1
  162. package/dist/esm/drawer/drawer.styles.js +1 -1
  163. package/dist/esm/drawer/drawer.styles.js.map +1 -1
  164. package/dist/esm/drawer/index.d.ts +1 -0
  165. package/dist/esm/drawer/index.js +1 -0
  166. package/dist/esm/drawer/index.js.map +1 -1
  167. package/dist/esm/drawer-body/drawer-body.definition.js +2 -2
  168. package/dist/esm/drawer-body/drawer-body.definition.js.map +1 -1
  169. package/dist/esm/drawer-body/drawer-body.options.d.ts +6 -0
  170. package/dist/esm/drawer-body/drawer-body.options.js +8 -0
  171. package/dist/esm/drawer-body/drawer-body.options.js.map +1 -0
  172. package/dist/esm/drawer-body/drawer-body.styles.js +1 -1
  173. package/dist/esm/drawer-body/drawer-body.styles.js.map +1 -1
  174. package/dist/esm/drawer-body/index.d.ts +1 -0
  175. package/dist/esm/drawer-body/index.js +1 -0
  176. package/dist/esm/drawer-body/index.js.map +1 -1
  177. package/dist/esm/dropdown/dropdown.definition.js +2 -2
  178. package/dist/esm/dropdown/dropdown.definition.js.map +1 -1
  179. package/dist/esm/dropdown/dropdown.options.d.ts +6 -0
  180. package/dist/esm/dropdown/dropdown.options.js +7 -0
  181. package/dist/esm/dropdown/dropdown.options.js.map +1 -1
  182. package/dist/esm/dropdown/index.d.ts +1 -0
  183. package/dist/esm/dropdown/index.js +1 -0
  184. package/dist/esm/dropdown/index.js.map +1 -1
  185. package/dist/esm/field/field.definition.js +2 -2
  186. package/dist/esm/field/field.definition.js.map +1 -1
  187. package/dist/esm/field/field.options.d.ts +6 -0
  188. package/dist/esm/field/field.options.js +7 -0
  189. package/dist/esm/field/field.options.js.map +1 -1
  190. package/dist/esm/field/index.d.ts +1 -0
  191. package/dist/esm/field/index.js +1 -0
  192. package/dist/esm/field/index.js.map +1 -1
  193. package/dist/esm/fluent-design-system.js +1 -1
  194. package/dist/esm/fluent-design-system.js.map +1 -1
  195. package/dist/esm/image/image.definition.js +2 -2
  196. package/dist/esm/image/image.definition.js.map +1 -1
  197. package/dist/esm/image/image.options.d.ts +7 -1
  198. package/dist/esm/image/image.options.js +7 -0
  199. package/dist/esm/image/image.options.js.map +1 -1
  200. package/dist/esm/image/index.d.ts +1 -0
  201. package/dist/esm/image/index.js +1 -0
  202. package/dist/esm/image/index.js.map +1 -1
  203. package/dist/esm/index.d.ts +0 -2
  204. package/dist/esm/index.js +0 -1
  205. package/dist/esm/index.js.map +1 -1
  206. package/dist/esm/label/index.d.ts +1 -0
  207. package/dist/esm/label/index.js +1 -0
  208. package/dist/esm/label/index.js.map +1 -1
  209. package/dist/esm/label/label.definition.js +2 -2
  210. package/dist/esm/label/label.definition.js.map +1 -1
  211. package/dist/esm/label/label.options.d.ts +7 -1
  212. package/dist/esm/label/label.options.js +7 -0
  213. package/dist/esm/label/label.options.js.map +1 -1
  214. package/dist/esm/label/label.styles.js +1 -1
  215. package/dist/esm/label/label.styles.js.map +1 -1
  216. package/dist/esm/link/index.d.ts +1 -0
  217. package/dist/esm/link/index.js +1 -0
  218. package/dist/esm/link/index.js.map +1 -1
  219. package/dist/esm/link/link.definition.js +2 -2
  220. package/dist/esm/link/link.definition.js.map +1 -1
  221. package/dist/esm/link/link.options.d.ts +7 -1
  222. package/dist/esm/link/link.options.js +7 -0
  223. package/dist/esm/link/link.options.js.map +1 -1
  224. package/dist/esm/link/link.styles.js +5 -3
  225. package/dist/esm/link/link.styles.js.map +1 -1
  226. package/dist/esm/listbox/index.d.ts +1 -0
  227. package/dist/esm/listbox/index.js +1 -0
  228. package/dist/esm/listbox/index.js.map +1 -1
  229. package/dist/esm/listbox/listbox.definition.js +2 -2
  230. package/dist/esm/listbox/listbox.definition.js.map +1 -1
  231. package/dist/esm/listbox/listbox.options.d.ts +6 -0
  232. package/dist/esm/listbox/listbox.options.js +7 -0
  233. package/dist/esm/listbox/listbox.options.js.map +1 -1
  234. package/dist/esm/menu/index.d.ts +1 -0
  235. package/dist/esm/menu/index.js +1 -0
  236. package/dist/esm/menu/index.js.map +1 -1
  237. package/dist/esm/menu/menu.definition.js +2 -2
  238. package/dist/esm/menu/menu.definition.js.map +1 -1
  239. package/dist/esm/menu/menu.js +4 -3
  240. package/dist/esm/menu/menu.js.map +1 -1
  241. package/dist/esm/menu/menu.options.d.ts +6 -0
  242. package/dist/esm/menu/menu.options.js +8 -0
  243. package/dist/esm/menu/menu.options.js.map +1 -0
  244. package/dist/esm/menu/menu.styles.js +1 -1
  245. package/dist/esm/menu/menu.styles.js.map +1 -1
  246. package/dist/esm/menu-button/index.d.ts +1 -0
  247. package/dist/esm/menu-button/index.js +1 -0
  248. package/dist/esm/menu-button/index.js.map +1 -1
  249. package/dist/esm/menu-button/menu-button.definition.js +2 -2
  250. package/dist/esm/menu-button/menu-button.definition.js.map +1 -1
  251. package/dist/esm/menu-button/menu-button.options.d.ts +7 -1
  252. package/dist/esm/menu-button/menu-button.options.js +7 -0
  253. package/dist/esm/menu-button/menu-button.options.js.map +1 -1
  254. package/dist/esm/menu-item/index.d.ts +1 -0
  255. package/dist/esm/menu-item/index.js +1 -0
  256. package/dist/esm/menu-item/index.js.map +1 -1
  257. package/dist/esm/menu-item/menu-item.d.ts +3 -1
  258. package/dist/esm/menu-item/menu-item.definition.js +2 -2
  259. package/dist/esm/menu-item/menu-item.definition.js.map +1 -1
  260. package/dist/esm/menu-item/menu-item.js +19 -7
  261. package/dist/esm/menu-item/menu-item.js.map +1 -1
  262. package/dist/esm/menu-item/menu-item.options.d.ts +7 -1
  263. package/dist/esm/menu-item/menu-item.options.js +7 -0
  264. package/dist/esm/menu-item/menu-item.options.js.map +1 -1
  265. package/dist/esm/menu-item/menu-item.styles.js +5 -3
  266. package/dist/esm/menu-item/menu-item.styles.js.map +1 -1
  267. package/dist/esm/menu-item/menu-item.template.js +3 -2
  268. package/dist/esm/menu-item/menu-item.template.js.map +1 -1
  269. package/dist/esm/menu-list/index.d.ts +1 -0
  270. package/dist/esm/menu-list/index.js +1 -0
  271. package/dist/esm/menu-list/index.js.map +1 -1
  272. package/dist/esm/menu-list/menu-list.base.d.ts +5 -24
  273. package/dist/esm/menu-list/menu-list.base.js +20 -125
  274. package/dist/esm/menu-list/menu-list.base.js.map +1 -1
  275. package/dist/esm/menu-list/menu-list.d.ts +5 -1
  276. package/dist/esm/menu-list/menu-list.definition.js +2 -2
  277. package/dist/esm/menu-list/menu-list.definition.js.map +1 -1
  278. package/dist/esm/menu-list/menu-list.js +23 -1
  279. package/dist/esm/menu-list/menu-list.js.map +1 -1
  280. package/dist/esm/menu-list/menu-list.options.d.ts +6 -0
  281. package/dist/esm/menu-list/menu-list.options.js +8 -0
  282. package/dist/esm/menu-list/menu-list.options.js.map +1 -0
  283. package/dist/esm/menu-list/menu-list.styles.js +1 -1
  284. package/dist/esm/menu-list/menu-list.styles.js.map +1 -1
  285. package/dist/esm/menu-list/menu-list.template.js +1 -5
  286. package/dist/esm/menu-list/menu-list.template.js.map +1 -1
  287. package/dist/esm/message-bar/index.d.ts +1 -0
  288. package/dist/esm/message-bar/index.js +1 -0
  289. package/dist/esm/message-bar/index.js.map +1 -1
  290. package/dist/esm/message-bar/message-bar.definition.js +2 -1
  291. package/dist/esm/message-bar/message-bar.definition.js.map +1 -1
  292. package/dist/esm/message-bar/message-bar.options.d.ts +6 -0
  293. package/dist/esm/message-bar/message-bar.options.js +7 -0
  294. package/dist/esm/message-bar/message-bar.options.js.map +1 -1
  295. package/dist/esm/message-bar/message-bar.template.d.ts +3 -3
  296. package/dist/esm/message-bar/message-bar.template.js +3 -3
  297. package/dist/esm/option/index.d.ts +1 -0
  298. package/dist/esm/option/index.js +1 -0
  299. package/dist/esm/option/index.js.map +1 -1
  300. package/dist/esm/option/option.definition.js +2 -2
  301. package/dist/esm/option/option.definition.js.map +1 -1
  302. package/dist/esm/option/option.options.d.ts +6 -0
  303. package/dist/esm/option/option.options.js +7 -0
  304. package/dist/esm/option/option.options.js.map +1 -1
  305. package/dist/esm/patterns/start-end.d.ts +1 -1
  306. package/dist/esm/patterns/start-end.js +1 -1
  307. package/dist/esm/patterns/start-end.js.map +1 -1
  308. package/dist/esm/progress-bar/index.d.ts +1 -0
  309. package/dist/esm/progress-bar/index.js +1 -0
  310. package/dist/esm/progress-bar/index.js.map +1 -1
  311. package/dist/esm/progress-bar/progress-bar.definition.js +2 -2
  312. package/dist/esm/progress-bar/progress-bar.definition.js.map +1 -1
  313. package/dist/esm/progress-bar/progress-bar.options.d.ts +7 -1
  314. package/dist/esm/progress-bar/progress-bar.options.js +7 -0
  315. package/dist/esm/progress-bar/progress-bar.options.js.map +1 -1
  316. package/dist/esm/progress-bar/progress-bar.styles.js +5 -3
  317. package/dist/esm/progress-bar/progress-bar.styles.js.map +1 -1
  318. package/dist/esm/radio/index.d.ts +1 -0
  319. package/dist/esm/radio/index.js +1 -0
  320. package/dist/esm/radio/index.js.map +1 -1
  321. package/dist/esm/radio/radio.d.ts +1 -1
  322. package/dist/esm/radio/radio.definition.js +2 -2
  323. package/dist/esm/radio/radio.definition.js.map +1 -1
  324. package/dist/esm/radio/radio.js +1 -1
  325. package/dist/esm/radio/radio.options.d.ts +6 -0
  326. package/dist/esm/radio/radio.options.js +7 -0
  327. package/dist/esm/radio/radio.options.js.map +1 -1
  328. package/dist/esm/radio/radio.styles.js +4 -3
  329. package/dist/esm/radio/radio.styles.js.map +1 -1
  330. package/dist/esm/radio/radio.template.js +1 -1
  331. package/dist/esm/radio/radio.template.js.map +1 -1
  332. package/dist/esm/radio-group/index.d.ts +1 -0
  333. package/dist/esm/radio-group/index.js +1 -0
  334. package/dist/esm/radio-group/index.js.map +1 -1
  335. package/dist/esm/radio-group/radio-group.base.d.ts +3 -16
  336. package/dist/esm/radio-group/radio-group.base.js +30 -88
  337. package/dist/esm/radio-group/radio-group.base.js.map +1 -1
  338. package/dist/esm/radio-group/radio-group.d.ts +5 -0
  339. package/dist/esm/radio-group/radio-group.definition.js +2 -2
  340. package/dist/esm/radio-group/radio-group.definition.js.map +1 -1
  341. package/dist/esm/radio-group/radio-group.js +22 -0
  342. package/dist/esm/radio-group/radio-group.js.map +1 -1
  343. package/dist/esm/radio-group/radio-group.options.d.ts +7 -1
  344. package/dist/esm/radio-group/radio-group.options.js +7 -0
  345. package/dist/esm/radio-group/radio-group.options.js.map +1 -1
  346. package/dist/esm/radio-group/radio-group.styles.js +1 -1
  347. package/dist/esm/radio-group/radio-group.styles.js.map +1 -1
  348. package/dist/esm/radio-group/radio-group.template.js +1 -1
  349. package/dist/esm/radio-group/radio-group.template.js.map +1 -1
  350. package/dist/esm/rating-display/index.d.ts +1 -0
  351. package/dist/esm/rating-display/index.js +1 -0
  352. package/dist/esm/rating-display/index.js.map +1 -1
  353. package/dist/esm/rating-display/rating-display.definition.js +2 -2
  354. package/dist/esm/rating-display/rating-display.definition.js.map +1 -1
  355. package/dist/esm/rating-display/rating-display.options.d.ts +7 -1
  356. package/dist/esm/rating-display/rating-display.options.js +7 -0
  357. package/dist/esm/rating-display/rating-display.options.js.map +1 -1
  358. package/dist/esm/rating-display/rating-display.styles.js +5 -3
  359. package/dist/esm/rating-display/rating-display.styles.js.map +1 -1
  360. package/dist/esm/slider/index.d.ts +1 -0
  361. package/dist/esm/slider/index.js +1 -0
  362. package/dist/esm/slider/index.js.map +1 -1
  363. package/dist/esm/slider/slider.definition.js +2 -2
  364. package/dist/esm/slider/slider.definition.js.map +1 -1
  365. package/dist/esm/slider/slider.options.d.ts +8 -1
  366. package/dist/esm/slider/slider.options.js +7 -0
  367. package/dist/esm/slider/slider.options.js.map +1 -1
  368. package/dist/esm/slider/slider.styles.js +5 -3
  369. package/dist/esm/slider/slider.styles.js.map +1 -1
  370. package/dist/esm/spinner/index.d.ts +1 -0
  371. package/dist/esm/spinner/index.js +1 -0
  372. package/dist/esm/spinner/index.js.map +1 -1
  373. package/dist/esm/spinner/spinner.definition.js +2 -2
  374. package/dist/esm/spinner/spinner.definition.js.map +1 -1
  375. package/dist/esm/spinner/spinner.options.d.ts +7 -1
  376. package/dist/esm/spinner/spinner.options.js +7 -0
  377. package/dist/esm/spinner/spinner.options.js.map +1 -1
  378. package/dist/esm/spinner/spinner.styles.js +5 -3
  379. package/dist/esm/spinner/spinner.styles.js.map +1 -1
  380. package/dist/esm/styles/index.d.ts +2 -1
  381. package/dist/esm/styles/index.js +2 -1
  382. package/dist/esm/styles/index.js.map +1 -1
  383. package/dist/esm/styles/partials/badge.partials.js +1 -1
  384. package/dist/esm/styles/partials/badge.partials.js.map +1 -1
  385. package/dist/esm/switch/index.d.ts +1 -0
  386. package/dist/esm/switch/index.js +1 -0
  387. package/dist/esm/switch/index.js.map +1 -1
  388. package/dist/esm/switch/switch.d.ts +1 -1
  389. package/dist/esm/switch/switch.definition.js +2 -2
  390. package/dist/esm/switch/switch.definition.js.map +1 -1
  391. package/dist/esm/switch/switch.options.d.ts +7 -1
  392. package/dist/esm/switch/switch.options.js +7 -0
  393. package/dist/esm/switch/switch.options.js.map +1 -1
  394. package/dist/esm/switch/switch.styles.js +4 -3
  395. package/dist/esm/switch/switch.styles.js.map +1 -1
  396. package/dist/esm/switch/switch.template.js +1 -1
  397. package/dist/esm/switch/switch.template.js.map +1 -1
  398. package/dist/esm/tab/index.d.ts +1 -0
  399. package/dist/esm/tab/index.js +1 -0
  400. package/dist/esm/tab/index.js.map +1 -1
  401. package/dist/esm/tab/tab.d.ts +2 -0
  402. package/dist/esm/tab/tab.definition.js +2 -2
  403. package/dist/esm/tab/tab.definition.js.map +1 -1
  404. package/dist/esm/tab/tab.js +13 -3
  405. package/dist/esm/tab/tab.js.map +1 -1
  406. package/dist/esm/tab/tab.options.d.ts +6 -0
  407. package/dist/esm/tab/tab.options.js +7 -0
  408. package/dist/esm/tab/tab.options.js.map +1 -1
  409. package/dist/esm/tab/tab.styles.js +23 -3
  410. package/dist/esm/tab/tab.styles.js.map +1 -1
  411. package/dist/esm/tab/tab.template.js +2 -2
  412. package/dist/esm/tab/tab.template.js.map +1 -1
  413. package/dist/esm/tablist/index.d.ts +1 -0
  414. package/dist/esm/tablist/index.js +1 -0
  415. package/dist/esm/tablist/index.js.map +1 -1
  416. package/dist/esm/tablist/tablist.base.d.ts +13 -45
  417. package/dist/esm/tablist/tablist.base.js +76 -185
  418. package/dist/esm/tablist/tablist.base.js.map +1 -1
  419. package/dist/esm/tablist/tablist.d.ts +5 -73
  420. package/dist/esm/tablist/tablist.definition.js +2 -2
  421. package/dist/esm/tablist/tablist.definition.js.map +1 -1
  422. package/dist/esm/tablist/tablist.js +20 -130
  423. package/dist/esm/tablist/tablist.js.map +1 -1
  424. package/dist/esm/tablist/tablist.options.d.ts +7 -1
  425. package/dist/esm/tablist/tablist.options.js +7 -0
  426. package/dist/esm/tablist/tablist.options.js.map +1 -1
  427. package/dist/esm/tablist/tablist.styles.js +83 -65
  428. package/dist/esm/tablist/tablist.styles.js.map +1 -1
  429. package/dist/esm/tablist/tablist.template.js +5 -1
  430. package/dist/esm/tablist/tablist.template.js.map +1 -1
  431. package/dist/esm/text/index.d.ts +1 -0
  432. package/dist/esm/text/index.js +1 -0
  433. package/dist/esm/text/index.js.map +1 -1
  434. package/dist/esm/text/text.definition.js +2 -2
  435. package/dist/esm/text/text.definition.js.map +1 -1
  436. package/dist/esm/text/text.options.d.ts +7 -1
  437. package/dist/esm/text/text.options.js +7 -0
  438. package/dist/esm/text/text.options.js.map +1 -1
  439. package/dist/esm/text/text.styles.js +1 -1
  440. package/dist/esm/text/text.styles.js.map +1 -1
  441. package/dist/esm/text-input/index.d.ts +1 -0
  442. package/dist/esm/text-input/index.js +1 -0
  443. package/dist/esm/text-input/index.js.map +1 -1
  444. package/dist/esm/text-input/text-input.definition.js +2 -2
  445. package/dist/esm/text-input/text-input.definition.js.map +1 -1
  446. package/dist/esm/text-input/text-input.options.d.ts +6 -0
  447. package/dist/esm/text-input/text-input.options.js +7 -0
  448. package/dist/esm/text-input/text-input.options.js.map +1 -1
  449. package/dist/esm/textarea/index.d.ts +1 -0
  450. package/dist/esm/textarea/index.js +1 -0
  451. package/dist/esm/textarea/index.js.map +1 -1
  452. package/dist/esm/textarea/textarea.base.js +1 -1
  453. package/dist/esm/textarea/textarea.base.js.map +1 -1
  454. package/dist/esm/textarea/textarea.definition.js +2 -2
  455. package/dist/esm/textarea/textarea.definition.js.map +1 -1
  456. package/dist/esm/textarea/textarea.options.d.ts +6 -0
  457. package/dist/esm/textarea/textarea.options.js +7 -0
  458. package/dist/esm/textarea/textarea.options.js.map +1 -1
  459. package/dist/esm/textarea/textarea.styles.js +4 -3
  460. package/dist/esm/textarea/textarea.styles.js.map +1 -1
  461. package/dist/esm/toggle-button/index.d.ts +1 -0
  462. package/dist/esm/toggle-button/index.js +1 -0
  463. package/dist/esm/toggle-button/index.js.map +1 -1
  464. package/dist/esm/toggle-button/toggle-button.definition.js +2 -2
  465. package/dist/esm/toggle-button/toggle-button.definition.js.map +1 -1
  466. package/dist/esm/toggle-button/toggle-button.options.d.ts +8 -2
  467. package/dist/esm/toggle-button/toggle-button.options.js +7 -0
  468. package/dist/esm/toggle-button/toggle-button.options.js.map +1 -1
  469. package/dist/esm/toggle-button/toggle-button.styles.js +4 -3
  470. package/dist/esm/toggle-button/toggle-button.styles.js.map +1 -1
  471. package/dist/esm/tooltip/index.d.ts +1 -0
  472. package/dist/esm/tooltip/index.js +1 -0
  473. package/dist/esm/tooltip/index.js.map +1 -1
  474. package/dist/esm/tooltip/tooltip.d.ts +2 -2
  475. package/dist/esm/tooltip/tooltip.definition.js +2 -2
  476. package/dist/esm/tooltip/tooltip.definition.js.map +1 -1
  477. package/dist/esm/tooltip/tooltip.js +2 -2
  478. package/dist/esm/tooltip/tooltip.options.d.ts +6 -0
  479. package/dist/esm/tooltip/tooltip.options.js +7 -0
  480. package/dist/esm/tooltip/tooltip.options.js.map +1 -1
  481. package/dist/esm/tree/index.d.ts +1 -0
  482. package/dist/esm/tree/index.js +1 -0
  483. package/dist/esm/tree/index.js.map +1 -1
  484. package/dist/esm/tree/tree.base.d.ts +5 -28
  485. package/dist/esm/tree/tree.base.js +20 -105
  486. package/dist/esm/tree/tree.base.js.map +1 -1
  487. package/dist/esm/tree/tree.d.ts +5 -0
  488. package/dist/esm/tree/tree.definition.js +2 -2
  489. package/dist/esm/tree/tree.definition.js.map +1 -1
  490. package/dist/esm/tree/tree.js +23 -0
  491. package/dist/esm/tree/tree.js.map +1 -1
  492. package/dist/esm/tree/tree.options.d.ts +6 -0
  493. package/dist/esm/tree/tree.options.js +8 -0
  494. package/dist/esm/tree/tree.options.js.map +1 -0
  495. package/dist/esm/tree/tree.template.js +2 -3
  496. package/dist/esm/tree/tree.template.js.map +1 -1
  497. package/dist/esm/tree-item/index.d.ts +1 -0
  498. package/dist/esm/tree-item/index.js +1 -0
  499. package/dist/esm/tree-item/index.js.map +1 -1
  500. package/dist/esm/tree-item/tree-item.base.d.ts +6 -3
  501. package/dist/esm/tree-item/tree-item.base.js +31 -11
  502. package/dist/esm/tree-item/tree-item.base.js.map +1 -1
  503. package/dist/esm/tree-item/tree-item.definition.js +2 -2
  504. package/dist/esm/tree-item/tree-item.definition.js.map +1 -1
  505. package/dist/esm/tree-item/tree-item.options.d.ts +6 -0
  506. package/dist/esm/tree-item/tree-item.options.js +7 -0
  507. package/dist/esm/tree-item/tree-item.options.js.map +1 -1
  508. package/dist/esm/tree-item/tree-item.template.js +1 -1
  509. package/dist/esm/tree-item/tree-item.template.js.map +1 -1
  510. package/dist/esm/utils/focusgroup.d.ts +22 -0
  511. package/dist/esm/utils/focusgroup.js +42 -0
  512. package/dist/esm/utils/focusgroup.js.map +1 -0
  513. package/dist/esm/utils/index.d.ts +0 -1
  514. package/dist/esm/utils/index.js +0 -1
  515. package/dist/esm/utils/index.js.map +1 -1
  516. package/dist/web-components.d.ts +70 -339
  517. package/dist/web-components.js +1277 -1317
  518. package/dist/web-components.min.js +242 -259
  519. package/package.json +4 -2
  520. package/dist/esm/utils/behaviors/match-media-stylesheet-behavior.d.ts +0 -124
  521. package/dist/esm/utils/behaviors/match-media-stylesheet-behavior.js +0 -142
  522. package/dist/esm/utils/behaviors/match-media-stylesheet-behavior.js.map +0 -1
@@ -1,9 +1,23 @@
1
1
  const FluentDesignSystem = Object.freeze({
2
2
  prefix: "fluent",
3
3
  shadowRootMode: "open",
4
- registry: customElements
4
+ registry: globalThis.customElements
5
5
  });
6
6
 
7
+ function isCustomElement(tagSuffix) {
8
+ return element => {
9
+ if (element?.nodeType !== Node.ELEMENT_NODE) {
10
+ return false;
11
+ }
12
+ return element.tagName.toLowerCase().endsWith(tagSuffix);
13
+ };
14
+ }
15
+
16
+ function isAccordionItem(element, tagName2 = "-accordion-item") {
17
+ return isCustomElement(tagName2)(element);
18
+ }
19
+ const tagName$F = `${FluentDesignSystem.prefix}-accordion-item`;
20
+
7
21
  let kernelMode;
8
22
  const kernelAttr = "fast-kernel";
9
23
  try {
@@ -3943,180 +3957,6 @@ const FASTElement = Object.assign(createFASTElement(HTMLElement), {
3943
3957
  compose
3944
3958
  });
3945
3959
 
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
- 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$P(target, key, result);
3952
- return result;
3953
- };
3954
- class ARIAGlobalStatesAndProperties {}
3955
- __decorateClass$P([attr({
3956
- attribute: "aria-atomic"
3957
- })], ARIAGlobalStatesAndProperties.prototype, "ariaAtomic", 2);
3958
- __decorateClass$P([attr({
3959
- attribute: "aria-busy"
3960
- })], ARIAGlobalStatesAndProperties.prototype, "ariaBusy", 2);
3961
- __decorateClass$P([attr({
3962
- attribute: "aria-controls"
3963
- })], ARIAGlobalStatesAndProperties.prototype, "ariaControls", 2);
3964
- __decorateClass$P([attr({
3965
- attribute: "aria-current"
3966
- })], ARIAGlobalStatesAndProperties.prototype, "ariaCurrent", 2);
3967
- __decorateClass$P([attr({
3968
- attribute: "aria-describedby"
3969
- })], ARIAGlobalStatesAndProperties.prototype, "ariaDescribedby", 2);
3970
- __decorateClass$P([attr({
3971
- attribute: "aria-details"
3972
- })], ARIAGlobalStatesAndProperties.prototype, "ariaDetails", 2);
3973
- __decorateClass$P([attr({
3974
- attribute: "aria-disabled"
3975
- })], ARIAGlobalStatesAndProperties.prototype, "ariaDisabled", 2);
3976
- __decorateClass$P([attr({
3977
- attribute: "aria-errormessage"
3978
- })], ARIAGlobalStatesAndProperties.prototype, "ariaErrormessage", 2);
3979
- __decorateClass$P([attr({
3980
- attribute: "aria-flowto"
3981
- })], ARIAGlobalStatesAndProperties.prototype, "ariaFlowto", 2);
3982
- __decorateClass$P([attr({
3983
- attribute: "aria-haspopup"
3984
- })], ARIAGlobalStatesAndProperties.prototype, "ariaHaspopup", 2);
3985
- __decorateClass$P([attr({
3986
- attribute: "aria-hidden"
3987
- })], ARIAGlobalStatesAndProperties.prototype, "ariaHidden", 2);
3988
- __decorateClass$P([attr({
3989
- attribute: "aria-invalid"
3990
- })], ARIAGlobalStatesAndProperties.prototype, "ariaInvalid", 2);
3991
- __decorateClass$P([attr({
3992
- attribute: "aria-keyshortcuts"
3993
- })], ARIAGlobalStatesAndProperties.prototype, "ariaKeyshortcuts", 2);
3994
- __decorateClass$P([attr({
3995
- attribute: "aria-label"
3996
- })], ARIAGlobalStatesAndProperties.prototype, "ariaLabel", 2);
3997
- __decorateClass$P([attr({
3998
- attribute: "aria-labelledby"
3999
- })], ARIAGlobalStatesAndProperties.prototype, "ariaLabelledby", 2);
4000
- __decorateClass$P([attr({
4001
- attribute: "aria-live"
4002
- })], ARIAGlobalStatesAndProperties.prototype, "ariaLive", 2);
4003
- __decorateClass$P([attr({
4004
- attribute: "aria-owns"
4005
- })], ARIAGlobalStatesAndProperties.prototype, "ariaOwns", 2);
4006
- __decorateClass$P([attr({
4007
- attribute: "aria-relevant"
4008
- })], ARIAGlobalStatesAndProperties.prototype, "ariaRelevant", 2);
4009
- __decorateClass$P([attr({
4010
- attribute: "aria-roledescription"
4011
- })], ARIAGlobalStatesAndProperties.prototype, "ariaRoledescription", 2);
4012
-
4013
- const numberLikeStringConverter = {
4014
- fromView(value) {
4015
- const valueAsNumber = parseFloat(value);
4016
- return Number.isNaN(valueAsNumber) ? "" : valueAsNumber.toString();
4017
- },
4018
- toView(value) {
4019
- const valueAsNumber = parseFloat(value);
4020
- return Number.isNaN(valueAsNumber) ? void 0 : valueAsNumber.toString();
4021
- }
4022
- };
4023
-
4024
- /**
4025
- * Standard orientation values
4026
- */
4027
- const Orientation = {
4028
- horizontal: "horizontal",
4029
- vertical: "vertical"
4030
- };
4031
-
4032
- /**
4033
- * Returns the index of the last element in the array where predicate is true, and -1 otherwise.
4034
- *
4035
- * @param array - the array to test
4036
- * @param predicate - find calls predicate once for each element of the array, in descending order, until it finds one where predicate returns true. If such an element is found, findLastIndex immediately returns that element index. Otherwise, findIndex returns -1.
4037
- */
4038
- function findLastIndex(array, predicate) {
4039
- let k = array.length;
4040
- while (k--) {
4041
- if (predicate(array[k], k, array)) {
4042
- return k;
4043
- }
4044
- }
4045
- return -1;
4046
- }
4047
-
4048
- /**
4049
- * A test that ensures that all arguments are HTML Elements
4050
- */
4051
- function isHTMLElement(...args) {
4052
- return args.every(arg => arg instanceof HTMLElement);
4053
- }
4054
-
4055
- /**
4056
- * String values for use with KeyboardEvent.key
4057
- */
4058
- const keyArrowDown = "ArrowDown";
4059
- const keyArrowLeft = "ArrowLeft";
4060
- const keyArrowRight = "ArrowRight";
4061
- const keyArrowUp = "ArrowUp";
4062
- const keyEnd = "End";
4063
- const keyEnter = "Enter";
4064
- const keyEscape = "Escape";
4065
- const keyHome = "Home";
4066
- const keySpace = " ";
4067
- const keyTab = "Tab";
4068
-
4069
- /**
4070
- * Expose ltr and rtl strings
4071
- */
4072
- var Direction;
4073
- (function (Direction) {
4074
- Direction["ltr"] = "ltr";
4075
- Direction["rtl"] = "rtl";
4076
- })(Direction || (Direction = {}));
4077
-
4078
- /**
4079
- * This method keeps a given value within the bounds of a min and max value. If the value
4080
- * is larger than the max, the minimum value will be returned. If the value is smaller than the minimum,
4081
- * the maximum will be returned. Otherwise, the value is returned un-changed.
4082
- */
4083
- function wrapInBounds(min, max, value) {
4084
- if (value < min) {
4085
- return max;
4086
- } else if (value > max) {
4087
- return min;
4088
- }
4089
- return value;
4090
- }
4091
- /**
4092
- * Ensures that a value is between a min and max value. If value is lower than min, min will be returned.
4093
- * If value is greater than max, max will be returned.
4094
- */
4095
- function limit(min, max, value) {
4096
- return Math.min(Math.max(value, min), max);
4097
- }
4098
-
4099
- let uniqueIdCounter$1 = 0;
4100
- /**
4101
- * Generates a unique ID based on incrementing a counter.
4102
- */
4103
- function uniqueId$1(prefix = "") {
4104
- return `${prefix}${uniqueIdCounter$1++}`;
4105
- }
4106
-
4107
- const getDirection = rootNode => {
4108
- return rootNode.closest("[dir]")?.dir === "rtl" ? Direction.rtl : Direction.ltr;
4109
- };
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
-
4120
3960
  function staticallyCompose(item) {
4121
3961
  if (!item) {
4122
3962
  return InlineTemplateDirective.empty;
@@ -4130,136 +3970,6 @@ function staticallyCompose(item) {
4130
3970
  return item;
4131
3971
  }
4132
3972
 
4133
- const whitespaceFilter = value => value.nodeType !== Node.TEXT_NODE || !!value.nodeValue?.trim().length;
4134
-
4135
- const hidden = `:host([hidden]){display:none}`;
4136
- function display(displayValue) {
4137
- return `${hidden}:host{display:${displayValue}}`;
4138
- }
4139
-
4140
- class MatchMediaBehavior {
4141
- /**
4142
- *
4143
- * @param query - The media query to operate from.
4144
- */
4145
- constructor(query) {
4146
- /**
4147
- * The behavior needs to operate on element instances but elements might share a behavior instance.
4148
- * To ensure proper attachment / detachment per instance, we construct a listener for
4149
- * each bind invocation and cache the listeners by element reference.
4150
- */
4151
- this.listenerCache = /* @__PURE__ */new WeakMap();
4152
- this.query = query;
4153
- }
4154
- /**
4155
- * Binds the behavior to the element.
4156
- * @param controller - The host controller orchestrating this behavior.
4157
- */
4158
- connectedCallback(controller) {
4159
- const {
4160
- query
4161
- } = this;
4162
- let listener = this.listenerCache.get(controller);
4163
- if (!listener) {
4164
- listener = this.constructListener(controller);
4165
- this.listenerCache.set(controller, listener);
4166
- }
4167
- listener.bind(query)();
4168
- query.addEventListener("change", listener);
4169
- }
4170
- /**
4171
- * Unbinds the behavior from the element.
4172
- * @param controller - The host controller orchestrating this behavior.
4173
- */
4174
- disconnectedCallback(controller) {
4175
- const listener = this.listenerCache.get(controller);
4176
- if (listener) {
4177
- this.query.removeEventListener("change", listener);
4178
- }
4179
- }
4180
- }
4181
- class MatchMediaStyleSheetBehavior extends MatchMediaBehavior {
4182
- /**
4183
- * Constructs a {@link MatchMediaStyleSheetBehavior} instance.
4184
- * @param query - The media query to operate from.
4185
- * @param styles - The styles to coordinate with the query.
4186
- */
4187
- constructor(query, styles) {
4188
- super(query);
4189
- this.styles = styles;
4190
- }
4191
- /**
4192
- * Defines a function to construct {@link MatchMediaStyleSheetBehavior | MatchMediaStyleSheetBehaviors} for
4193
- * a provided query.
4194
- * @param query - The media query to operate from.
4195
- *
4196
- * @public
4197
- * @example
4198
- *
4199
- * ```ts
4200
- * import { css } from "@microsoft/fast-element";
4201
- * import { MatchMediaStyleSheetBehavior } from "@fluentui/web-components";
4202
- *
4203
- * const landscapeBehavior = MatchMediaStyleSheetBehavior.with(
4204
- * window.matchMedia("(orientation: landscape)")
4205
- * );
4206
- *
4207
- * const styles = css`
4208
- * :host {
4209
- * width: 200px;
4210
- * height: 400px;
4211
- * }
4212
- * `
4213
- * .withBehaviors(landscapeBehavior(css`
4214
- * :host {
4215
- * width: 400px;
4216
- * height: 200px;
4217
- * }
4218
- * `))
4219
- * ```
4220
- */
4221
- static with(query) {
4222
- return styles => {
4223
- return new MatchMediaStyleSheetBehavior(query, styles);
4224
- };
4225
- }
4226
- /**
4227
- * Constructs a match-media listener for a provided element.
4228
- * @param source - the element for which to attach or detach styles.
4229
- */
4230
- constructListener(controller) {
4231
- let attached = false;
4232
- const styles = this.styles;
4233
- return function listener() {
4234
- const {
4235
- matches
4236
- } = this;
4237
- if (matches && !attached) {
4238
- controller.addStyles(styles);
4239
- attached = matches;
4240
- } else if (!matches && attached) {
4241
- controller.removeStyles(styles);
4242
- attached = matches;
4243
- }
4244
- };
4245
- }
4246
- /**
4247
- * Unbinds the behavior from the element.
4248
- * @param controller - The host controller orchestrating this behavior.
4249
- * @internal
4250
- */
4251
- removedCallback(controller) {
4252
- controller.removeStyles(this.styles);
4253
- }
4254
- }
4255
- const forcedColorsStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.matchMedia("(forced-colors)"));
4256
- MatchMediaStyleSheetBehavior.with(window.matchMedia("(prefers-color-scheme: dark)"));
4257
- MatchMediaStyleSheetBehavior.with(window.matchMedia("(prefers-color-scheme: light)"));
4258
-
4259
- const AnchorPositioningCSSSupported = CSS.supports("anchor-name: --a");
4260
- const AnchorPositioningHTMLSupported = "anchor" in HTMLElement.prototype;
4261
- const CustomStatesSetSupported = CSS.supports("selector(:state(g))");
4262
-
4263
3973
  class StartEnd {}
4264
3974
  function endSlotTemplate(options) {
4265
3975
  return html`<slot name="end" ${ref("end")}>${staticallyCompose(options.end)}</slot>`.inline();
@@ -4340,6 +4050,11 @@ __decorateClass$N([attr({
4340
4050
  })], AccordionItem.prototype, "block", 2);
4341
4051
  applyMixins(AccordionItem, StartEnd);
4342
4052
 
4053
+ const hidden = `:host([hidden]){display:none}`;
4054
+ function display(displayValue) {
4055
+ return `${hidden}:host{display:${displayValue}}`;
4056
+ }
4057
+
4343
4058
  const colorNeutralForeground1 = "var(--colorNeutralForeground1)";
4344
4059
  const colorNeutralForeground1Hover = "var(--colorNeutralForeground1Hover)";
4345
4060
  const colorNeutralForeground1Pressed = "var(--colorNeutralForeground1Pressed)";
@@ -4628,13 +4343,19 @@ const template$F = accordionItemTemplate({
4628
4343
  });
4629
4344
 
4630
4345
  const definition$F = AccordionItem.compose({
4631
- name: `${FluentDesignSystem.prefix}-accordion-item`,
4346
+ name: tagName$F,
4632
4347
  template: template$F,
4633
4348
  styles: styles$E
4634
4349
  });
4635
4350
 
4636
4351
  definition$F.define(FluentDesignSystem.registry);
4637
4352
 
4353
+ const AccordionExpandMode = {
4354
+ single: "single",
4355
+ multi: "multi"
4356
+ };
4357
+ const tagName$E = `${FluentDesignSystem.prefix}-accordion`;
4358
+
4638
4359
  function requestIdleCallback(callback, options) {
4639
4360
  if ("requestIdleCallback" in globalThis) {
4640
4361
  return globalThis.requestIdleCallback(callback, options);
@@ -4670,15 +4391,6 @@ function waitForConnectedDescendants(target, callback, options) {
4670
4391
  scheduleCheck();
4671
4392
  }
4672
4393
 
4673
- function isAccordionItem(element, tagName = "-accordion-item") {
4674
- return isCustomElement(tagName)(element);
4675
- }
4676
-
4677
- const AccordionExpandMode = {
4678
- single: "single",
4679
- multi: "multi"
4680
- };
4681
-
4682
4394
  var __defProp$M = Object.defineProperty;
4683
4395
  var __getOwnPropDesc$M = Object.getOwnPropertyDescriptor;
4684
4396
  var __decorateClass$M = (decorators, target, key, kind) => {
@@ -4699,7 +4411,6 @@ class Accordion extends FASTElement {
4699
4411
  /**
4700
4412
  * Resets event listeners and sets the `accordionItems` property
4701
4413
  * then rebinds event listeners to each non-disabled item
4702
- * @returns {void}
4703
4414
  */
4704
4415
  this.setItems = () => {
4705
4416
  waitForConnectedDescendants(this, () => {
@@ -4722,7 +4433,7 @@ class Accordion extends FASTElement {
4722
4433
  };
4723
4434
  /**
4724
4435
  * Removes event listeners from the previous accordion items
4725
- * @param oldValue An array of the previous accordion items
4436
+ * @param oldValue - An array of the previous accordion items
4726
4437
  */
4727
4438
  this.removeItemListeners = oldValue => {
4728
4439
  oldValue.forEach((item, index) => {
@@ -4733,7 +4444,7 @@ class Accordion extends FASTElement {
4733
4444
  };
4734
4445
  /**
4735
4446
  * Changes the expanded state of the accordion item
4736
- * @param evt Click event
4447
+ * @param evt - Click event
4737
4448
  * @returns
4738
4449
  */
4739
4450
  this.expandedChangedHandler = evt => {
@@ -4786,7 +4497,6 @@ class Accordion extends FASTElement {
4786
4497
  }
4787
4498
  /**
4788
4499
  * Find the first expanded item in the accordion
4789
- * @returns {void}
4790
4500
  */
4791
4501
  findExpandedItem() {
4792
4502
  if (!this.accordionItems || this.accordionItems?.length === 0) {
@@ -4796,15 +4506,14 @@ class Accordion extends FASTElement {
4796
4506
  }
4797
4507
  /**
4798
4508
  * Checks if the accordion is in single expand mode
4799
- * @returns {boolean}
4509
+ * @returns true if the accordion is in single expand mode.
4800
4510
  */
4801
4511
  isSingleExpandMode() {
4802
4512
  return this.expandmode === AccordionExpandMode.single;
4803
4513
  }
4804
4514
  /**
4805
4515
  * Controls the behavior of the accordion in single expand mode
4806
- * @param expandedItem The item to expand in single expand mode
4807
- * @returns {void}
4516
+ * @param expandedItem - The item to expand in single expand mode
4808
4517
  */
4809
4518
  setSingleExpandMode(expandedItem) {
4810
4519
  if (this.accordionItems.length === 0) {
@@ -4851,13 +4560,55 @@ function accordionTemplate() {
4851
4560
  const template$E = accordionTemplate();
4852
4561
 
4853
4562
  const definition$E = Accordion.compose({
4854
- name: `${FluentDesignSystem.prefix}-accordion`,
4563
+ name: tagName$E,
4855
4564
  template: template$E,
4856
4565
  styles: styles$D
4857
4566
  });
4858
4567
 
4859
4568
  definition$E.define(FluentDesignSystem.registry);
4860
4569
 
4570
+ const ButtonAppearance = {
4571
+ primary: "primary",
4572
+ outline: "outline",
4573
+ subtle: "subtle",
4574
+ transparent: "transparent"
4575
+ };
4576
+ const ButtonShape = {
4577
+ circular: "circular",
4578
+ rounded: "rounded",
4579
+ square: "square"
4580
+ };
4581
+ const ButtonSize = {
4582
+ small: "small",
4583
+ medium: "medium",
4584
+ large: "large"
4585
+ };
4586
+ const ButtonType = {
4587
+ submit: "submit",
4588
+ reset: "reset",
4589
+ button: "button"
4590
+ };
4591
+ const tagName$D = `${FluentDesignSystem.prefix}-button`;
4592
+
4593
+ const AnchorButtonAppearance = ButtonAppearance;
4594
+ const AnchorButtonShape = ButtonShape;
4595
+ const AnchorButtonSize = ButtonSize;
4596
+ const AnchorAttributes = {
4597
+ download: "download",
4598
+ href: "href",
4599
+ hreflang: "hreflang",
4600
+ ping: "ping",
4601
+ referrerpolicy: "referrerpolicy",
4602
+ rel: "rel",
4603
+ target: "target",
4604
+ type: "type"
4605
+ };
4606
+ const tagName$C = `${FluentDesignSystem.prefix}-anchor-button`;
4607
+
4608
+ const AnchorPositioningCSSSupported = CSS.supports("anchor-name: --a");
4609
+ const AnchorPositioningHTMLSupported = "anchor" in HTMLElement.prototype;
4610
+ const CustomStatesSetSupported = CSS.supports("selector(:state(g))");
4611
+
4861
4612
  const statesMap = /* @__PURE__ */new Map();
4862
4613
  function stateSelector(state) {
4863
4614
  return statesMap.get(state) ?? statesMap.set(state, CustomStatesSetSupported ? `:state(${state})` : `[state--${state}]`).get(state);
@@ -4895,41 +4646,80 @@ function swapStates(elementInternals, prev = "", next = "", States, prefix = "")
4895
4646
  }
4896
4647
  }
4897
4648
 
4898
- const ButtonAppearance = {
4899
- primary: "primary",
4900
- outline: "outline",
4901
- subtle: "subtle",
4902
- transparent: "transparent"
4903
- };
4904
- const ButtonShape = {
4905
- circular: "circular",
4906
- rounded: "rounded",
4907
- square: "square"
4908
- };
4909
- const ButtonSize = {
4910
- small: "small",
4911
- medium: "medium",
4912
- large: "large"
4913
- };
4914
- const ButtonType = {
4915
- submit: "submit",
4916
- reset: "reset",
4917
- button: "button"
4649
+ /**
4650
+ * Standard orientation values
4651
+ */
4652
+ const Orientation = {
4653
+ horizontal: "horizontal",
4654
+ vertical: "vertical"
4918
4655
  };
4919
4656
 
4920
- const AnchorButtonAppearance = ButtonAppearance;
4921
- const AnchorButtonShape = ButtonShape;
4922
- const AnchorButtonSize = ButtonSize;
4923
- const AnchorAttributes = {
4924
- download: "download",
4925
- href: "href",
4926
- hreflang: "hreflang",
4927
- ping: "ping",
4928
- referrerpolicy: "referrerpolicy",
4929
- rel: "rel",
4930
- target: "target",
4931
- type: "type"
4932
- };
4657
+ /**
4658
+ * Returns the index of the last element in the array where predicate is true, and -1 otherwise.
4659
+ *
4660
+ * @param array - the array to test
4661
+ * @param predicate - find calls predicate once for each element of the array, in descending order, until it finds one where predicate returns true. If such an element is found, findLastIndex immediately returns that element index. Otherwise, findIndex returns -1.
4662
+ */
4663
+ function findLastIndex(array, predicate) {
4664
+ let k = array.length;
4665
+ while (k--) {
4666
+ if (predicate(array[k], k, array)) {
4667
+ return k;
4668
+ }
4669
+ }
4670
+ return -1;
4671
+ }
4672
+
4673
+ /**
4674
+ * A test that ensures that all arguments are HTML Elements
4675
+ */
4676
+ function isHTMLElement(...args) {
4677
+ return args.every(arg => arg instanceof HTMLElement);
4678
+ }
4679
+
4680
+ /**
4681
+ * String values for use with KeyboardEvent.key
4682
+ */
4683
+ const keyArrowDown = "ArrowDown";
4684
+ const keyArrowLeft = "ArrowLeft";
4685
+ const keyArrowRight = "ArrowRight";
4686
+ const keyArrowUp = "ArrowUp";
4687
+ const keyEnd = "End";
4688
+ const keyEnter = "Enter";
4689
+ const keyEscape = "Escape";
4690
+ const keyHome = "Home";
4691
+ const keySpace = " ";
4692
+ const keyTab = "Tab";
4693
+
4694
+ /**
4695
+ * Expose ltr and rtl strings
4696
+ */
4697
+ var Direction;
4698
+ (function (Direction) {
4699
+ Direction["ltr"] = "ltr";
4700
+ Direction["rtl"] = "rtl";
4701
+ })(Direction || (Direction = {}));
4702
+
4703
+ /**
4704
+ * This method keeps a given value within the bounds of a min and max value. If the value
4705
+ * is larger than the max, the minimum value will be returned. If the value is smaller than the minimum,
4706
+ * the maximum will be returned. Otherwise, the value is returned un-changed.
4707
+ */
4708
+ /**
4709
+ * Ensures that a value is between a min and max value. If value is lower than min, min will be returned.
4710
+ * If value is greater than max, max will be returned.
4711
+ */
4712
+ function limit(min, max, value) {
4713
+ return Math.min(Math.max(value, min), max);
4714
+ }
4715
+
4716
+ let uniqueIdCounter$1 = 0;
4717
+ /**
4718
+ * Generates a unique ID based on incrementing a counter.
4719
+ */
4720
+ function uniqueId$1(prefix = "") {
4721
+ return `${prefix}${uniqueIdCounter$1++}`;
4722
+ }
4933
4723
 
4934
4724
  var __defProp$L = Object.defineProperty;
4935
4725
  var __getOwnPropDesc$L = Object.getOwnPropertyDescriptor;
@@ -4994,11 +4784,12 @@ class BaseAnchor extends FASTElement {
4994
4784
  * @internal
4995
4785
  */
4996
4786
  clickHandler(e) {
4787
+ if (e.composedPath()[0] === this.internalProxyAnchor) {
4788
+ e.stopImmediatePropagation();
4789
+ return true;
4790
+ }
4997
4791
  if (this.href) {
4998
- const newTab = !this.isMac ? e.ctrlKey : e.metaKey;
4999
- if (newTab) {
5000
- e.preventDefault();
5001
- }
4792
+ const newTab = e.ctrlKey || e.metaKey;
5002
4793
  this.handleNavigation(newTab);
5003
4794
  }
5004
4795
  return true;
@@ -5022,7 +4813,7 @@ class BaseAnchor extends FASTElement {
5022
4813
  }
5023
4814
  /**
5024
4815
  * Handles navigation based on input
5025
- * If the metaKey is pressed, opens the href in a new window, if false, uses the click on the proxy
4816
+ * If a modified activation requests a new tab, opens the href in a new window.
5026
4817
  * @internal
5027
4818
  */
5028
4819
  handleNavigation(newTab) {
@@ -5043,8 +4834,7 @@ class BaseAnchor extends FASTElement {
5043
4834
  }
5044
4835
  createProxyElement() {
5045
4836
  const proxy = this.internalProxyAnchor ?? document.createElement("a");
5046
- proxy.ariaHidden = "true";
5047
- proxy.tabIndex = -1;
4837
+ proxy.inert = true;
5048
4838
  return proxy;
5049
4839
  }
5050
4840
  }
@@ -5119,14 +4909,12 @@ const baseButtonStyles = css`
5119
4909
  const styles$C = css`
5120
4910
  ${baseButtonStyles}
5121
4911
 
5122
- :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`
5123
- :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}`));
4912
+ :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}}@media (forced-colors:active){: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}}`;
5124
4913
 
5125
4914
  const styles$B = css`
5126
4915
  ${baseButtonStyles}
5127
4916
 
5128
- ::slotted(a){position:absolute;inset:0}`.withBehaviors(forcedColorsStylesheetBehavior(css`
5129
- :host{border-color:LinkText;color:LinkText}`));
4917
+ ::slotted(a){position:absolute;inset:0}@media (forced-colors:active){:host{border-color:LinkText;color:LinkText}}`;
5130
4918
 
5131
4919
  function anchorTemplate$1(options = {}) {
5132
4920
  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>`;
@@ -5134,13 +4922,53 @@ function anchorTemplate$1(options = {}) {
5134
4922
  const template$D = anchorTemplate$1();
5135
4923
 
5136
4924
  const definition$D = AnchorButton.compose({
5137
- name: `${FluentDesignSystem.prefix}-anchor-button`,
4925
+ name: tagName$C,
5138
4926
  template: template$D,
5139
4927
  styles: styles$B
5140
4928
  });
5141
4929
 
5142
4930
  definition$D.define(FluentDesignSystem.registry);
5143
4931
 
4932
+ const AvatarNamedColor = {
4933
+ darkRed: "dark-red",
4934
+ cranberry: "cranberry",
4935
+ red: "red",
4936
+ pumpkin: "pumpkin",
4937
+ peach: "peach",
4938
+ marigold: "marigold",
4939
+ gold: "gold",
4940
+ brass: "brass",
4941
+ brown: "brown",
4942
+ forest: "forest",
4943
+ seafoam: "seafoam",
4944
+ darkGreen: "dark-green",
4945
+ lightTeal: "light-teal",
4946
+ teal: "teal",
4947
+ steel: "steel",
4948
+ blue: "blue",
4949
+ royalBlue: "royal-blue",
4950
+ cornflower: "cornflower",
4951
+ navy: "navy",
4952
+ lavender: "lavender",
4953
+ purple: "purple",
4954
+ grape: "grape",
4955
+ lilac: "lilac",
4956
+ pink: "pink",
4957
+ magenta: "magenta",
4958
+ plum: "plum",
4959
+ beige: "beige",
4960
+ mink: "mink",
4961
+ platinum: "platinum",
4962
+ anchor: "anchor"
4963
+ };
4964
+ const AvatarColor = {
4965
+ neutral: "neutral",
4966
+ brand: "brand",
4967
+ colorful: "colorful",
4968
+ ...AvatarNamedColor
4969
+ };
4970
+ const tagName$B = `${FluentDesignSystem.prefix}-avatar`;
4971
+
5144
4972
  const UNWANTED_ENCLOSURES_REGEX = /[\(\[\{][^\)\]\}]*[\)\]\}]/g;
5145
4973
  const UNWANTED_CHARS_REGEX = /[\0-\u001F\!-/:-@\[-`\{-\u00BF\u0250-\u036F\uD800-\uFFFF]/g;
5146
4974
  const PHONENUMBER_REGEX = /^\d+[\d\s]*(:?ext|x|)\s*\d+$/i;
@@ -5302,45 +5130,6 @@ __decorateClass$J([observable], BaseAvatar.prototype, "slottedDefaults", 2);
5302
5130
  __decorateClass$J([attr], BaseAvatar.prototype, "name", 2);
5303
5131
  __decorateClass$J([attr], BaseAvatar.prototype, "initials", 2);
5304
5132
 
5305
- const AvatarNamedColor = {
5306
- darkRed: "dark-red",
5307
- cranberry: "cranberry",
5308
- red: "red",
5309
- pumpkin: "pumpkin",
5310
- peach: "peach",
5311
- marigold: "marigold",
5312
- gold: "gold",
5313
- brass: "brass",
5314
- brown: "brown",
5315
- forest: "forest",
5316
- seafoam: "seafoam",
5317
- darkGreen: "dark-green",
5318
- lightTeal: "light-teal",
5319
- teal: "teal",
5320
- steel: "steel",
5321
- blue: "blue",
5322
- royalBlue: "royal-blue",
5323
- cornflower: "cornflower",
5324
- navy: "navy",
5325
- lavender: "lavender",
5326
- purple: "purple",
5327
- grape: "grape",
5328
- lilac: "lilac",
5329
- pink: "pink",
5330
- magenta: "magenta",
5331
- plum: "plum",
5332
- beige: "beige",
5333
- mink: "mink",
5334
- platinum: "platinum",
5335
- anchor: "anchor"
5336
- };
5337
- const AvatarColor = {
5338
- neutral: "neutral",
5339
- brand: "brand",
5340
- colorful: "colorful",
5341
- ...AvatarNamedColor
5342
- };
5343
-
5344
5133
  var __defProp$I = Object.defineProperty;
5345
5134
  var __getOwnPropDesc$I = Object.getOwnPropertyDescriptor;
5346
5135
  var __decorateClass$I = (decorators, target, key, kind) => {
@@ -5443,7 +5232,7 @@ function avatarTemplate() {
5443
5232
  const template$C = avatarTemplate();
5444
5233
 
5445
5234
  const definition$C = Avatar.compose({
5446
- name: `${FluentDesignSystem.prefix}-avatar`,
5235
+ name: tagName$B,
5447
5236
  template: template$C,
5448
5237
  styles: styles$A
5449
5238
  });
@@ -5466,6 +5255,7 @@ const BadgeColor = {
5466
5255
  success: "success",
5467
5256
  warning: "warning"
5468
5257
  };
5258
+ const tagName$A = `${FluentDesignSystem.prefix}-badge`;
5469
5259
 
5470
5260
  var __defProp$H = Object.defineProperty;
5471
5261
  var __getOwnPropDesc$H = Object.getOwnPropertyDescriptor;
@@ -5736,109 +5526,6 @@ const badgeTintStyles = css.partial`
5736
5526
  }
5737
5527
  `;
5738
5528
 
5739
- const typographyBody1Styles = css.partial`
5740
- font-family: ${fontFamilyBase};
5741
- font-size: ${fontSizeBase300};
5742
- line-height: ${lineHeightBase300};
5743
- font-weight: ${fontWeightRegular};
5744
- `;
5745
- css.partial`
5746
- font-family: ${fontFamilyBase};
5747
- font-size: ${fontSizeBase300};
5748
- line-height: ${lineHeightBase300};
5749
- font-weight: ${fontWeightSemibold};
5750
- `;
5751
- css.partial`
5752
- font-family: ${fontFamilyBase};
5753
- font-size: ${fontSizeBase300};
5754
- line-height: ${lineHeightBase300};
5755
- font-weight: ${fontWeightBold};
5756
- `;
5757
- const typographyBody2Styles = css.partial`
5758
- font-family: ${fontFamilyBase};
5759
- font-size: ${fontSizeBase400};
5760
- line-height: ${lineHeightBase400};
5761
- font-weight: ${fontWeightRegular};
5762
- `;
5763
- const typographyCaption1Styles = css.partial`
5764
- font-family: ${fontFamilyBase};
5765
- font-size: ${fontSizeBase200};
5766
- line-height: ${lineHeightBase200};
5767
- font-weight: ${fontWeightRegular};
5768
- `;
5769
- css.partial`
5770
- font-family: ${fontFamilyBase};
5771
- font-size: ${fontSizeBase200};
5772
- line-height: ${lineHeightBase200};
5773
- font-weight: ${fontWeightSemibold};
5774
- `;
5775
- css.partial`
5776
- font-family: ${fontFamilyBase};
5777
- font-size: ${fontSizeBase200};
5778
- line-height: ${lineHeightBase200};
5779
- font-weight: ${fontWeightBold};
5780
- `;
5781
- css.partial`
5782
- font-family: ${fontFamilyBase};
5783
- font-size: ${fontSizeBase100};
5784
- line-height: ${lineHeightBase100};
5785
- font-weight: ${fontWeightRegular};
5786
- `;
5787
- css.partial`
5788
- font-family: ${fontFamilyBase};
5789
- font-size: ${fontSizeBase100};
5790
- line-height: ${lineHeightBase100};
5791
- font-weight: ${fontWeightSemibold};
5792
- `;
5793
- const typographySubtitle1Styles = css.partial`
5794
- font-family: ${fontFamilyBase};
5795
- font-size: ${fontSizeBase500};
5796
- line-height: ${lineHeightBase500};
5797
- font-weight: ${fontWeightSemibold};
5798
- `;
5799
- css.partial`
5800
- font-family: ${fontFamilyBase};
5801
- font-size: ${fontSizeBase400};
5802
- line-height: ${lineHeightBase400};
5803
- font-weight: ${fontWeightSemibold};
5804
- `;
5805
- css.partial`
5806
- font-family: ${fontFamilyBase};
5807
- font-size: ${fontSizeBase400};
5808
- line-height: ${lineHeightBase400};
5809
- font-weight: ${fontWeightBold};
5810
- `;
5811
- css.partial`
5812
- font-family: ${fontFamilyBase};
5813
- font-size: ${fontSizeHero800};
5814
- line-height: ${lineHeightHero800};
5815
- font-weight: ${fontWeightSemibold};
5816
- `;
5817
- css.partial`
5818
- font-family: ${fontFamilyBase};
5819
- font-size: ${fontSizeHero700};
5820
- line-height: ${lineHeightHero700};
5821
- font-weight: ${fontWeightSemibold};
5822
- `;
5823
- css.partial`
5824
- font-family: ${fontFamilyBase};
5825
- font-size: ${fontSizeBase600};
5826
- line-height: ${lineHeightBase600};
5827
- font-weight: ${fontWeightSemibold};
5828
- `;
5829
- css.partial`
5830
- font-family: ${fontFamilyBase};
5831
- font-size: ${fontSizeHero900};
5832
- line-height: ${lineHeightHero900};
5833
- font-weight: ${fontWeightSemibold};
5834
- `;
5835
- css.partial`
5836
- font-family: ${fontFamilyBase};
5837
- font-size: ${fontSizeHero1000};
5838
- line-height: ${lineHeightHero1000};
5839
- font-weight: ${fontWeightSemibold};
5840
- `;
5841
-
5842
5529
  const styles$z = css`
5843
5530
  :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}
5844
5531
  ${badgeOutlineStyles}
@@ -5846,8 +5533,8 @@ const styles$z = css`
5846
5533
  ${badgeFilledStyles}
5847
5534
  ${badgeSizeStyles}
5848
5535
  ${badgeBaseStyles}
5849
- `.withBehaviors(forcedColorsStylesheetBehavior(css`
5850
- :host,:host([appearance='outline']),:host([appearance='tint']){border-color:CanvasText}`));
5536
+
5537
+ @media (forced-colors:active){:host,:host([appearance='outline']),:host([appearance='tint']){border-color:CanvasText}}`;
5851
5538
 
5852
5539
  function badgeTemplate(options = {}) {
5853
5540
  return html` ${startSlotTemplate(options)}<slot>${staticallyCompose(options.defaultContent)}</slot>${endSlotTemplate(options)} `;
@@ -5855,7 +5542,7 @@ function badgeTemplate(options = {}) {
5855
5542
  const template$B = badgeTemplate();
5856
5543
 
5857
5544
  const definition$B = Badge.compose({
5858
- name: `${FluentDesignSystem.prefix}-badge`,
5545
+ name: tagName$A,
5859
5546
  template: template$B,
5860
5547
  styles: styles$z
5861
5548
  });
@@ -6157,13 +5844,15 @@ function buttonTemplate$1(options = {}) {
6157
5844
  const template$A = buttonTemplate$1();
6158
5845
 
6159
5846
  const definition$A = Button.compose({
6160
- name: `${FluentDesignSystem.prefix}-button`,
5847
+ name: tagName$D,
6161
5848
  template: template$A,
6162
5849
  styles: styles$C
6163
5850
  });
6164
5851
 
6165
5852
  definition$A.define(FluentDesignSystem.registry);
6166
5853
 
5854
+ const tagName$z = `${FluentDesignSystem.prefix}-checkbox`;
5855
+
6167
5856
  var __defProp$E = Object.defineProperty;
6168
5857
  var __getOwnPropDesc$E = Object.getOwnPropertyDescriptor;
6169
5858
  var __decorateClass$E = (decorators, target, key, kind) => {
@@ -6628,8 +6317,7 @@ const valueMissingState = stateSelector("value-missing");
6628
6317
  const styles$y = css`
6629
6318
  ${display("inline-flex")}
6630
6319
 
6631
- :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`
6632
- :host{border-color:FieldText}:host(:not([slot='input']:focus-visible))::after{border-color:Canvas}:host(:not([disabled]):hover),:host(${checkedState}:not([disabled]):hover),:host(:not([slot='input']):focus-visible)::after{border-color:Highlight}.indeterminate-indicator,.checked-indicator{color:HighlightText}:host(${checkedState}),:host(${indeterminateState}) .indeterminate-indicator{background-color:FieldText}:host(${checkedState}:not([disabled]):hover),:host(${indeterminateState}:not([disabled]):hover) .indeterminate-indicator{background-color:Highlight}:host([disabled]){border-color:GrayText}:host([disabled]${indeterminateState}) .indeterminate-indicator{background-color:GrayText}:host([disabled]),:host([disabled]${checkedState}) .checked-indicator{color:GrayText}`));
6320
+ :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}}@media (forced-colors:active){:host{border-color:FieldText}:host(:not([slot='input']:focus-visible))::after{border-color:Canvas}:host(:not([disabled]):hover),:host(${checkedState}:not([disabled]):hover),:host(:not([slot='input']):focus-visible)::after{border-color:Highlight}.indeterminate-indicator,.checked-indicator{color:HighlightText}:host(${checkedState}),:host(${indeterminateState}) .indeterminate-indicator{background-color:FieldText}:host(${checkedState}:not([disabled]):hover),:host(${indeterminateState}:not([disabled]):hover) .indeterminate-indicator{background-color:Highlight}:host([disabled]){border-color:GrayText}:host([disabled]${indeterminateState}) .indeterminate-indicator{background-color:GrayText}:host([disabled]),:host([disabled]${checkedState}) .checked-indicator{color:GrayText}}`;
6633
6321
 
6634
6322
  const checkedIndicator$2 = html.partial(/* html */
6635
6323
  `
@@ -6657,13 +6345,15 @@ const template$z = checkboxTemplate({
6657
6345
  });
6658
6346
 
6659
6347
  const definition$z = Checkbox.compose({
6660
- name: `${FluentDesignSystem.prefix}-checkbox`,
6348
+ name: tagName$z,
6661
6349
  template: template$z,
6662
6350
  styles: styles$y
6663
6351
  });
6664
6352
 
6665
6353
  definition$z.define(FluentDesignSystem.registry);
6666
6354
 
6355
+ const tagName$y = `${FluentDesignSystem.prefix}-compound-button`;
6356
+
6667
6357
  class CompoundButton extends Button {}
6668
6358
 
6669
6359
  const styles$x = css`
@@ -6671,9 +6361,8 @@ const styles$x = css`
6671
6361
 
6672
6362
  :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)))
6673
6363
  ::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]))
6674
- ::slotted([slot='description']){color:${colorNeutralForegroundDisabled}}:host([size='small']){padding:8px;padding-bottom:10px}:host([icon-only]){min-width:52px;max-width:52px;padding:${spacingHorizontalSNudge}}:host([icon-only][size='small']){min-width:48px;max-width:48px;padding:${spacingHorizontalXS}}:host([icon-only][size='large']){min-width:56px;max-width:56px;padding:${spacingHorizontalS}}:host([size='large']){padding-top:18px;padding-inline:16px;padding-bottom:20px;font-size:${fontSizeBase400};line-height:${lineHeightBase400}}:host([size='large']) ::slotted([slot='description']){font-size:${fontSizeBase300}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
6675
- :host([appearance='primary']:not(:hover,:focus-visible,:disabled,[disabled-focusable]))
6676
- ::slotted([slot='description']){color:HighlightText}`));
6364
+ ::slotted([slot='description']){color:${colorNeutralForegroundDisabled}}:host([size='small']){padding:8px;padding-bottom:10px}:host([icon-only]){min-width:52px;max-width:52px;padding:${spacingHorizontalSNudge}}:host([icon-only][size='small']){min-width:48px;max-width:48px;padding:${spacingHorizontalXS}}:host([icon-only][size='large']){min-width:56px;max-width:56px;padding:${spacingHorizontalS}}:host([size='large']){padding-top:18px;padding-inline:16px;padding-bottom:20px;font-size:${fontSizeBase400};line-height:${lineHeightBase400}}:host([size='large']) ::slotted([slot='description']){font-size:${fontSizeBase300}}@media (forced-colors:active){:host([appearance='primary']:not(:hover,:focus-visible,:disabled,[disabled-focusable]))
6365
+ ::slotted([slot='description']){color:HighlightText}}`;
6677
6366
 
6678
6367
  function buttonTemplate(options = {}) {
6679
6368
  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>`;
@@ -6681,13 +6370,15 @@ function buttonTemplate(options = {}) {
6681
6370
  const template$y = buttonTemplate();
6682
6371
 
6683
6372
  const definition$y = CompoundButton.compose({
6684
- name: `${FluentDesignSystem.prefix}-compound-button`,
6373
+ name: tagName$y,
6685
6374
  template: template$y,
6686
6375
  styles: styles$x
6687
6376
  });
6688
6377
 
6689
6378
  definition$y.define(FluentDesignSystem.registry);
6690
6379
 
6380
+ const tagName$x = `${FluentDesignSystem.prefix}-counter-badge`;
6381
+
6691
6382
  var __defProp$C = Object.defineProperty;
6692
6383
  var __getOwnPropDesc$C = Object.getOwnPropertyDescriptor;
6693
6384
  var __decorateClass$C = (decorators, target, key, kind) => {
@@ -6767,7 +6458,7 @@ function composeTemplate(options = {}) {
6767
6458
  const template$x = composeTemplate();
6768
6459
 
6769
6460
  const definition$x = CounterBadge.compose({
6770
- name: `${FluentDesignSystem.prefix}-counter-badge`,
6461
+ name: tagName$x,
6771
6462
  template: template$x,
6772
6463
  styles: styles$w
6773
6464
  });
@@ -6779,12 +6470,13 @@ const DialogType = {
6779
6470
  nonModal: "non-modal",
6780
6471
  alert: "alert"
6781
6472
  };
6782
- function isDialog(element, tagName = "-dialog") {
6473
+ function isDialog(element, tagName2 = "-dialog") {
6783
6474
  if (element?.nodeType !== Node.ELEMENT_NODE) {
6784
6475
  return false;
6785
6476
  }
6786
- return element.tagName.toLowerCase().endsWith(tagName);
6477
+ return element.tagName.toLowerCase().endsWith(tagName2);
6787
6478
  }
6479
+ const tagName$w = `${FluentDesignSystem.prefix}-dialog`;
6788
6480
 
6789
6481
  var __defProp$B = Object.defineProperty;
6790
6482
  var __getOwnPropDesc$B = Object.getOwnPropertyDescriptor;
@@ -6904,17 +6596,18 @@ __decorateClass$B([attr], Dialog.prototype, "type", 2);
6904
6596
  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>`;
6905
6597
 
6906
6598
  const styles$v = css`
6907
- @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`
6908
- @layer base{dialog{border:${strokeWidthThin} solid ${colorTransparentStroke}}}`));
6599
+ @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)}}}@media (forced-colors:active){@layer base{dialog{border:${strokeWidthThin} solid ${colorTransparentStroke}}}}`;
6909
6600
 
6910
6601
  const definition$w = Dialog.compose({
6911
- name: `${FluentDesignSystem.prefix}-dialog`,
6602
+ name: tagName$w,
6912
6603
  template: template$w,
6913
6604
  styles: styles$v
6914
6605
  });
6915
6606
 
6916
6607
  definition$w.define(FluentDesignSystem.registry);
6917
6608
 
6609
+ const tagName$v = `${FluentDesignSystem.prefix}-dialog-body`;
6610
+
6918
6611
  class DialogBody extends FASTElement {
6919
6612
  /**
6920
6613
  * Handles click event for the close slot
@@ -6941,7 +6634,7 @@ const styles$u = css`
6941
6634
  :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}`;
6942
6635
 
6943
6636
  const definition$v = DialogBody.compose({
6944
- name: `${FluentDesignSystem.prefix}-dialog-body`,
6637
+ name: tagName$v,
6945
6638
  template: template$v,
6946
6639
  styles: styles$u
6947
6640
  });
@@ -6959,6 +6652,7 @@ const DividerRole = {
6959
6652
  presentation: "presentation"
6960
6653
  };
6961
6654
  const DividerOrientation = Orientation;
6655
+ const tagName$u = `${FluentDesignSystem.prefix}-divider`;
6962
6656
 
6963
6657
  var __defProp$A = Object.defineProperty;
6964
6658
  var __getOwnPropDesc$A = Object.getOwnPropertyDescriptor;
@@ -7040,11 +6734,10 @@ const template$u = dividerTemplate();
7040
6734
  const styles$t = css`
7041
6735
  ${display("flex")}
7042
6736
 
7043
- :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`
7044
- :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}`));
6737
+ :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}}@media (forced-colors:active){: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}}`;
7045
6738
 
7046
6739
  const definition$u = Divider.compose({
7047
- name: `${FluentDesignSystem.prefix}-divider`,
6740
+ name: tagName$u,
7048
6741
  template: template$u,
7049
6742
  styles: styles$t
7050
6743
  });
@@ -7066,6 +6759,7 @@ const DrawerType = {
7066
6759
  modal: "modal",
7067
6760
  inline: "inline"
7068
6761
  };
6762
+ const tagName$t = `${FluentDesignSystem.prefix}-drawer`;
7069
6763
 
7070
6764
  var __defProp$y = Object.defineProperty;
7071
6765
  var __getOwnPropDesc$y = Object.getOwnPropertyDescriptor;
@@ -7217,13 +6911,15 @@ function drawerTemplate() {
7217
6911
  const template$t = drawerTemplate();
7218
6912
 
7219
6913
  const definition$t = Drawer.compose({
7220
- name: `${FluentDesignSystem.prefix}-drawer`,
6914
+ name: tagName$t,
7221
6915
  template: template$t,
7222
6916
  styles: styles$s
7223
6917
  });
7224
6918
 
7225
6919
  definition$t.define(FluentDesignSystem.registry);
7226
6920
 
6921
+ const tagName$s = `${FluentDesignSystem.prefix}-drawer-body`;
6922
+
7227
6923
  class DrawerBody extends FASTElement {
7228
6924
  /**
7229
6925
  * Handles click event for the close slot
@@ -7242,6 +6938,109 @@ class DrawerBody extends FASTElement {
7242
6938
  }
7243
6939
  }
7244
6940
 
6941
+ const typographyBody1Styles = css.partial`
6942
+ font-family: ${fontFamilyBase};
6943
+ font-size: ${fontSizeBase300};
6944
+ line-height: ${lineHeightBase300};
6945
+ font-weight: ${fontWeightRegular};
6946
+ `;
6947
+ css.partial`
6948
+ font-family: ${fontFamilyBase};
6949
+ font-size: ${fontSizeBase300};
6950
+ line-height: ${lineHeightBase300};
6951
+ font-weight: ${fontWeightSemibold};
6952
+ `;
6953
+ css.partial`
6954
+ font-family: ${fontFamilyBase};
6955
+ font-size: ${fontSizeBase300};
6956
+ line-height: ${lineHeightBase300};
6957
+ font-weight: ${fontWeightBold};
6958
+ `;
6959
+ const typographyBody2Styles = css.partial`
6960
+ font-family: ${fontFamilyBase};
6961
+ font-size: ${fontSizeBase400};
6962
+ line-height: ${lineHeightBase400};
6963
+ font-weight: ${fontWeightRegular};
6964
+ `;
6965
+ const typographyCaption1Styles = css.partial`
6966
+ font-family: ${fontFamilyBase};
6967
+ font-size: ${fontSizeBase200};
6968
+ line-height: ${lineHeightBase200};
6969
+ font-weight: ${fontWeightRegular};
6970
+ `;
6971
+ css.partial`
6972
+ font-family: ${fontFamilyBase};
6973
+ font-size: ${fontSizeBase200};
6974
+ line-height: ${lineHeightBase200};
6975
+ font-weight: ${fontWeightSemibold};
6976
+ `;
6977
+ css.partial`
6978
+ font-family: ${fontFamilyBase};
6979
+ font-size: ${fontSizeBase200};
6980
+ line-height: ${lineHeightBase200};
6981
+ font-weight: ${fontWeightBold};
6982
+ `;
6983
+ css.partial`
6984
+ font-family: ${fontFamilyBase};
6985
+ font-size: ${fontSizeBase100};
6986
+ line-height: ${lineHeightBase100};
6987
+ font-weight: ${fontWeightRegular};
6988
+ `;
6989
+ css.partial`
6990
+ font-family: ${fontFamilyBase};
6991
+ font-size: ${fontSizeBase100};
6992
+ line-height: ${lineHeightBase100};
6993
+ font-weight: ${fontWeightSemibold};
6994
+ `;
6995
+ const typographySubtitle1Styles = css.partial`
6996
+ font-family: ${fontFamilyBase};
6997
+ font-size: ${fontSizeBase500};
6998
+ line-height: ${lineHeightBase500};
6999
+ font-weight: ${fontWeightSemibold};
7000
+ `;
7001
+ css.partial`
7002
+ font-family: ${fontFamilyBase};
7003
+ font-size: ${fontSizeBase400};
7004
+ line-height: ${lineHeightBase400};
7005
+ font-weight: ${fontWeightSemibold};
7006
+ `;
7007
+ css.partial`
7008
+ font-family: ${fontFamilyBase};
7009
+ font-size: ${fontSizeBase400};
7010
+ line-height: ${lineHeightBase400};
7011
+ font-weight: ${fontWeightBold};
7012
+ `;
7013
+ css.partial`
7014
+ font-family: ${fontFamilyBase};
7015
+ font-size: ${fontSizeHero800};
7016
+ line-height: ${lineHeightHero800};
7017
+ font-weight: ${fontWeightSemibold};
7018
+ `;
7019
+ css.partial`
7020
+ font-family: ${fontFamilyBase};
7021
+ font-size: ${fontSizeHero700};
7022
+ line-height: ${lineHeightHero700};
7023
+ font-weight: ${fontWeightSemibold};
7024
+ `;
7025
+ css.partial`
7026
+ font-family: ${fontFamilyBase};
7027
+ font-size: ${fontSizeBase600};
7028
+ line-height: ${lineHeightBase600};
7029
+ font-weight: ${fontWeightSemibold};
7030
+ `;
7031
+ css.partial`
7032
+ font-family: ${fontFamilyBase};
7033
+ font-size: ${fontSizeHero900};
7034
+ line-height: ${lineHeightHero900};
7035
+ font-weight: ${fontWeightSemibold};
7036
+ `;
7037
+ css.partial`
7038
+ font-family: ${fontFamilyBase};
7039
+ font-size: ${fontSizeHero1000};
7040
+ line-height: ${lineHeightHero1000};
7041
+ font-weight: ${fontWeightSemibold};
7042
+ `;
7043
+
7245
7044
  const styles$r = css`
7246
7045
  ${display("grid")}
7247
7046
  :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}`;
@@ -7252,26 +7051,45 @@ function drawerBodyTemplate() {
7252
7051
  const template$s = drawerBodyTemplate();
7253
7052
 
7254
7053
  const definition$s = DrawerBody.compose({
7255
- name: `${FluentDesignSystem.prefix}-drawer-body`,
7054
+ name: tagName$s,
7256
7055
  template: template$s,
7257
7056
  styles: styles$r
7258
7057
  });
7259
7058
 
7260
7059
  definition$s.define(FluentDesignSystem.registry);
7261
7060
 
7262
- function isListbox(element, tagName = "-listbox") {
7061
+ const DropdownAppearance = {
7062
+ filledDarker: "filled-darker",
7063
+ filledLighter: "filled-lighter",
7064
+ outline: "outline",
7065
+ transparent: "transparent"
7066
+ };
7067
+ const DropdownType = {
7068
+ combobox: "combobox",
7069
+ dropdown: "dropdown",
7070
+ select: "select"
7071
+ };
7072
+ const tagName$r = `${FluentDesignSystem.prefix}-dropdown`;
7073
+
7074
+ function isListbox(element, tagName2 = "-listbox") {
7263
7075
  if (element?.nodeType !== Node.ELEMENT_NODE) {
7264
7076
  return false;
7265
7077
  }
7266
- return element.tagName.toLowerCase().endsWith(tagName);
7078
+ return element.tagName.toLowerCase().endsWith(tagName2);
7267
7079
  }
7080
+ const tagName$q = `${FluentDesignSystem.prefix}-listbox`;
7268
7081
 
7269
- function isDropdownOption(value, tagName = "-option") {
7082
+ function isDropdownOption(value, tagName2 = "-option") {
7270
7083
  if (value?.nodeType !== Node.ELEMENT_NODE) {
7271
7084
  return false;
7272
7085
  }
7273
- return value.tagName.toLowerCase().endsWith(tagName);
7086
+ return value.tagName.toLowerCase().endsWith(tagName2);
7274
7087
  }
7088
+ const tagName$p = `${FluentDesignSystem.prefix}-option`;
7089
+
7090
+ const getDirection = rootNode => {
7091
+ return rootNode.closest("[dir]")?.dir === "rtl" ? Direction.rtl : Direction.ltr;
7092
+ };
7275
7093
 
7276
7094
  function getLanguage(rootNode) {
7277
7095
  return rootNode.closest("[lang]")?.lang ?? "en";
@@ -7283,18 +7101,6 @@ function uniqueId(prefix = "id-") {
7283
7101
  return document.getElementById(str) ? uniqueId(prefix) : str;
7284
7102
  }
7285
7103
 
7286
- const DropdownAppearance = {
7287
- filledDarker: "filled-darker",
7288
- filledLighter: "filled-lighter",
7289
- outline: "outline",
7290
- transparent: "transparent"
7291
- };
7292
- const DropdownType = {
7293
- combobox: "combobox",
7294
- dropdown: "dropdown",
7295
- select: "select"
7296
- };
7297
-
7298
7104
  const dropdownIndicatorTemplate = html`<svg class="chevron-down-20-regular" aria-hidden="true" slot="indicator" viewBox="0 0 20 20" ${ref("indicator")}><path d="M15.85 7.65a.5.5 0 0 1 0 .7l-5.46 5.49a.55.55 0 0 1-.78 0L4.15 8.35a.5.5 0 1 1 .7-.7L10 12.8l5.15-5.16a.5.5 0 0 1 .7 0" fill="currentColor" /></svg>`;
7299
7105
  const dropdownInputTemplate = html`<input @input="${(x, c) => x.inputHandler(c.event)}" @change="${(x, c) => x.changeHandler(c.event)}" aria-activedescendant="${x => x.activeDescendant}" aria-controls="${x => x.listbox?.id ?? null}" aria-labelledby="${x => x.ariaLabelledBy}" aria-expanded="${x => x.open}" aria-haspopup="listbox" placeholder="${x => x.placeholder}" role="combobox" ?disabled="${x => x.disabled}" type="${x => x.type}" value="${x => x.valueAttribute}" slot="control" ${ref("control")} />`;
7300
7106
  const dropdownButtonTemplate = html`<button aria-activedescendant="${x => x.activeDescendant}" aria-controls="${x => x.listbox?.id ?? null}" aria-expanded="${x => x.open}" aria-haspopup="listbox" role="combobox" ?disabled="${x => x.disabled}" type="button" slot="control" ${ref("control")}>${x => x.displayValue}</button>`;
@@ -8109,7 +7915,7 @@ const styles$q = css`
8109
7915
  :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(:not([slot]):not([popover])),::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}`;
8110
7916
 
8111
7917
  const definition$r = Dropdown.compose({
8112
- name: `${FluentDesignSystem.prefix}-dropdown`,
7918
+ name: tagName$r,
8113
7919
  template: template$r,
8114
7920
  styles: styles$q
8115
7921
  });
@@ -8134,6 +7940,7 @@ const ValidationFlags = {
8134
7940
  valueMissing: "value-missing",
8135
7941
  valid: "valid"
8136
7942
  };
7943
+ const tagName$o = `${FluentDesignSystem.prefix}-field`;
8137
7944
 
8138
7945
  var __defProp$v = Object.defineProperty;
8139
7946
  var __getOwnPropDesc$v = Object.getOwnPropertyDescriptor;
@@ -8353,7 +8160,7 @@ const template$q = html`<template @click="${(x, c) => x.clickHandler(c.event)}"
8353
8160
  })}></slot></template>`;
8354
8161
 
8355
8162
  const definition$q = Field.compose({
8356
- name: `${FluentDesignSystem.prefix}-field`,
8163
+ name: tagName$o,
8357
8164
  template: template$q,
8358
8165
  styles: styles$p,
8359
8166
  shadowOptions: {
@@ -8363,6 +8170,8 @@ const definition$q = Field.compose({
8363
8170
 
8364
8171
  definition$q.define(FluentDesignSystem.registry);
8365
8172
 
8173
+ const tagName$n = `${FluentDesignSystem.prefix}-image`;
8174
+
8366
8175
  var __defProp$t = Object.defineProperty;
8367
8176
  var __getOwnPropDesc$t = Object.getOwnPropertyDescriptor;
8368
8177
  var __decorateClass$t = (decorators, target, key, kind) => {
@@ -8390,13 +8199,15 @@ const styles$o = css`
8390
8199
  :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}}`;
8391
8200
 
8392
8201
  const definition$p = Image.compose({
8393
- name: `${FluentDesignSystem.prefix}-image`,
8202
+ name: tagName$n,
8394
8203
  template: template$p,
8395
8204
  styles: styles$o
8396
8205
  });
8397
8206
 
8398
8207
  definition$p.define(FluentDesignSystem.registry);
8399
8208
 
8209
+ const tagName$m = `${FluentDesignSystem.prefix}-label`;
8210
+
8400
8211
  var __defProp$s = Object.defineProperty;
8401
8212
  var __getOwnPropDesc$s = Object.getOwnPropertyDescriptor;
8402
8213
  var __decorateClass$s = (decorators, target, key, kind) => {
@@ -8432,13 +8243,15 @@ function labelTemplate() {
8432
8243
  const template$o = labelTemplate();
8433
8244
 
8434
8245
  const definition$o = Label.compose({
8435
- name: `${FluentDesignSystem.prefix}-label`,
8246
+ name: tagName$m,
8436
8247
  template: template$o,
8437
8248
  styles: styles$n
8438
8249
  });
8439
8250
 
8440
8251
  definition$o.define(FluentDesignSystem.registry);
8441
8252
 
8253
+ const tagName$l = `${FluentDesignSystem.prefix}-link`;
8254
+
8442
8255
  var __defProp$r = Object.defineProperty;
8443
8256
  var __getOwnPropDesc$r = Object.getOwnPropertyDescriptor;
8444
8257
  var __decorateClass$r = (decorators, target, key, kind) => {
@@ -8461,8 +8274,7 @@ __decorateClass$r([attr({
8461
8274
  const styles$m = css`
8462
8275
  ${display("inline")}
8463
8276
 
8464
- :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`
8465
- :host{color:LinkText}`));
8277
+ :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}@media (forced-colors:active){:host{color:LinkText}}`;
8466
8278
 
8467
8279
  function anchorTemplate() {
8468
8280
  return html`<template tabindex="0" @click="${(x, c) => x.clickHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}"><slot></slot></template>`;
@@ -8470,7 +8282,7 @@ function anchorTemplate() {
8470
8282
  const template$n = anchorTemplate();
8471
8283
 
8472
8284
  const definition$n = Link.compose({
8473
- name: `${FluentDesignSystem.prefix}-link`,
8285
+ name: tagName$l,
8474
8286
  template: template$n,
8475
8287
  styles: styles$m
8476
8288
  });
@@ -8664,13 +8476,15 @@ function listboxTemplate() {
8664
8476
  const template$m = listboxTemplate();
8665
8477
 
8666
8478
  const definition$m = Listbox.compose({
8667
- name: `${FluentDesignSystem.prefix}-listbox`,
8479
+ name: tagName$q,
8668
8480
  template: template$m,
8669
8481
  styles: styles$l
8670
8482
  });
8671
8483
 
8672
8484
  definition$m.define(FluentDesignSystem.registry);
8673
8485
 
8486
+ const tagName$k = `${FluentDesignSystem.prefix}-menu-button`;
8487
+
8674
8488
  class MenuButton extends Button {}
8675
8489
 
8676
8490
  const template$l = buttonTemplate$1({
@@ -8683,7 +8497,7 @@ const template$l = buttonTemplate$1({
8683
8497
  });
8684
8498
 
8685
8499
  const definition$l = MenuButton.compose({
8686
- name: `${FluentDesignSystem.prefix}-menu-button`,
8500
+ name: tagName$k,
8687
8501
  template: template$l,
8688
8502
  styles: styles$C
8689
8503
  });
@@ -8709,12 +8523,13 @@ const MenuItemRole = {
8709
8523
  [MenuItemRole.menuitemcheckbox]: "menuitemcheckbox",
8710
8524
  [MenuItemRole.menuitemradio]: "menuitemradio"
8711
8525
  });
8712
- function isMenuItem(element, tagName = "-menu-item") {
8526
+ function isMenuItem(element, tagName2 = "-menu-item") {
8713
8527
  if (element?.nodeType !== Node.ELEMENT_NODE) {
8714
8528
  return false;
8715
8529
  }
8716
- return element.tagName.toLowerCase().endsWith(tagName);
8530
+ return element.tagName.toLowerCase().endsWith(tagName2);
8717
8531
  }
8532
+ const tagName$j = `${FluentDesignSystem.prefix}-menu-item`;
8718
8533
 
8719
8534
  var __defProp$p = Object.defineProperty;
8720
8535
  var __getOwnPropDesc$p = Object.getOwnPropertyDescriptor;
@@ -8796,16 +8611,25 @@ class MenuItem extends FASTElement {
8796
8611
  * Setup required ARIA on open/close
8797
8612
  * @internal
8798
8613
  */
8799
- this.toggleHandler = e => {
8800
- if (e instanceof ToggleEvent && e.newState === "open") {
8801
- this.setAttribute("tabindex", "-1");
8614
+ this.handleToggle = e => {
8615
+ if (!(e instanceof ToggleEvent)) {
8616
+ return;
8617
+ }
8618
+ if (e.newState === "open") {
8802
8619
  this.elementInternals.ariaExpanded = "true";
8803
8620
  this.setSubmenuPosition();
8804
8621
  }
8805
- if (e instanceof ToggleEvent && e.newState === "closed") {
8622
+ if (e.newState === "closed") {
8806
8623
  this.elementInternals.ariaExpanded = "false";
8807
- this.setAttribute("tabindex", "0");
8808
8624
  }
8625
+ this.submenu?.setAttribute("focusgroup", e.newState === "open" ? "menu" : "none");
8626
+ };
8627
+ /** @internal */
8628
+ this.handleSubmenuFocusOut = e => {
8629
+ if (e.relatedTarget && this.submenu?.contains(e.relatedTarget)) {
8630
+ return;
8631
+ }
8632
+ this.submenu?.togglePopover(false);
8809
8633
  };
8810
8634
  /**
8811
8635
  * @internal
@@ -8892,11 +8716,14 @@ class MenuItem extends FASTElement {
8892
8716
  * @internal
8893
8717
  */
8894
8718
  slottedSubmenuChanged(prev, next) {
8895
- this.submenu?.removeEventListener("toggle", this.toggleHandler);
8719
+ this.submenu?.removeEventListener("toggle", this.handleToggle);
8720
+ this.submenu?.removeEventListener("focusout", this.handleSubmenuFocusOut);
8896
8721
  if (next.length) {
8897
8722
  this.submenu = next[0];
8898
8723
  this.submenu.toggleAttribute("popover", true);
8899
- this.submenu.addEventListener("toggle", this.toggleHandler);
8724
+ this.submenu.setAttribute("focusgroup", "none");
8725
+ this.submenu.addEventListener("toggle", this.handleToggle);
8726
+ this.submenu.addEventListener("focusout", this.handleSubmenuFocusOut);
8900
8727
  this.elementInternals.ariaHasPopup = "menu";
8901
8728
  toggleState(this.elementInternals, "submenu", true);
8902
8729
  } else {
@@ -8927,28 +8754,512 @@ applyMixins(MenuItem, StartEnd);
8927
8754
  const styles$k = css`
8928
8755
  ${display("grid")}
8929
8756
 
8930
- :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`
8931
- :host(${disabledState}),:host(${disabledState}) ::slotted([slot='start']),:host(${disabledState}) ::slotted([slot='end']){color:GrayText}`));
8757
+ :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}}}@media (forced-colors:active){:host(${disabledState}),:host(${disabledState}) ::slotted([slot='start']),:host(${disabledState}) ::slotted([slot='end']){color:GrayText}}`;
8758
+
8759
+ const Checkmark16Filled = html.partial(`<svg class="indicator" fill="currentColor" aria-hidden="true" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.05 3.49c.28.3.27.77-.04 1.06l-7.93 7.47A.85.85 0 014.9 12L2.22 9.28a.75.75 0 111.06-1.06l2.24 2.27 7.47-7.04a.75.75 0 011.06.04z" fill="currentColor"></path></svg>`);
8760
+ const chevronRight16Filled = html.partial(`<svg class="submenu-glyph" fill="currentColor" aria-hidden="true" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M5.74 3.2a.75.75 0 00-.04 1.06L9.23 8 5.7 11.74a.75.75 0 101.1 1.02l4-4.25a.75.75 0 000-1.02l-4-4.25a.75.75 0 00-1.06-.04z" fill="currentColor"></path></svg>`);
8761
+ function menuItemTemplate(options = {}) {
8762
+ return html`<template tabindex="0" @keydown="${(x, c) => x.handleMenuItemKeyDown(c.event)}" @click="${(x, c) => x.handleMenuItemClick(c.event)}" @mouseover="${(x, c) => x.handleMouseOver(c.event)}" @mouseout="${(x, c) => x.handleMouseOut(c.event)}" @toggle="${(x, c) => x.handleToggle(c.event)}"><slot name="indicator">${staticallyCompose(options.indicator)}</slot>${startSlotTemplate(options)}<div part="content" class="content"><slot></slot></div>${endSlotTemplate(options)}<slot name="submenu-glyph">${staticallyCompose(options.submenuGlyph)}</slot><slot name="submenu" ${slotted({
8763
+ property: "slottedSubmenu"
8764
+ })}></slot></template>`;
8765
+ }
8766
+ const template$k = menuItemTemplate({
8767
+ indicator: Checkmark16Filled,
8768
+ submenuGlyph: chevronRight16Filled
8769
+ });
8770
+
8771
+ const definition$k = MenuItem.compose({
8772
+ name: tagName$j,
8773
+ template: template$k,
8774
+ styles: styles$k
8775
+ });
8776
+
8777
+ definition$k.define(FluentDesignSystem.registry);
8778
+
8779
+ const tagName$i = `${FluentDesignSystem.prefix}-menu-list`;
8780
+
8781
+ //#region src/constants.js
8782
+ /** @enum {string} */
8783
+ var DatasetName = {
8784
+ INFERRED_ROLE: "data-fg-ir",
8785
+ ITEM: "data-fg-item",
8786
+ AUTHOR_TABINDEX: "data-fg-ati",
8787
+ SEGMENT: "data-fg-seg",
8788
+ SEGMENT_START: "data-fg-segs"
8789
+ };
8790
+ /** @enum {string} */
8791
+ var BehaviorToken = {
8792
+ TOOLBAR: "toolbar",
8793
+ TABLIST: "tablist",
8794
+ RADIOGROUP: "radiogroup",
8795
+ LISTBOX: "listbox",
8796
+ MENU: "menu",
8797
+ MENUBAR: "menubar",
8798
+ NONE: "none"
8799
+ };
8800
+
8801
+ //#region src/shadow-utils/index-shadowless.js
8802
+ function nodeContains(node, otherNode) {
8803
+ return node.contains(otherNode);
8804
+ }
8805
+
8806
+ /**
8807
+ * Whether the current user agent supports focusgroup.
8808
+ *
8809
+ * @returns {boolean}
8810
+ */
8811
+ function supportsFocusGroup() {
8812
+ return "focusgroup" in (globalThis?.HTMLElement?.prototype ?? {});
8813
+ }
8814
+ /**
8815
+ * Gets the navigation direction (“forward” or “backward”) based on:
8816
+ *
8817
+ * - The key that the user just pressed
8818
+ * - The owner element’s writing mode and direction
8819
+ * - The current focus group’s directional limit (“inline”, “block”, none)
8820
+ *
8821
+ * @param {KeyboardEvent} event - The keyboard event object.
8822
+ * @param {HTMLElement} owner - The owner element.
8823
+ * @param {("inline" | "block" | undefined)} axis - The directional limitation.
8824
+ * @returns {("forward" | "backward" | "start" | "end" | null)} Returns `null`
8825
+ * if there shouldn’t be navigation, e.g. when directional limit applies.
8826
+ */
8827
+ function getNavigationDirection(event, owner, axis) {
8828
+ const FORWARD = "forward";
8829
+ const BACKWARD = "backward";
8830
+ const BLOCK = "block";
8831
+ const INLINE = "inline";
8832
+ if (isKeyConflictElement(event.composedPath()[0])) return event.key === "Tab" ? event.shiftKey ? BACKWARD : FORWARD : null;
8833
+ if (event.shiftKey || event.ctrlKey || event.metaKey) return null;
8834
+ const {
8835
+ writingMode,
8836
+ direction
8837
+ } = window.getComputedStyle(owner);
8838
+ const isVertical = !writingMode.startsWith("horizontal-");
8839
+ const isRtl = direction === "rtl";
8840
+ const horizontal = isVertical ? BLOCK : INLINE;
8841
+ const vertical = isVertical ? INLINE : BLOCK;
8842
+ const isHorizontalReversed = isVertical ? writingMode.endsWith("-rl") !== isRtl : isRtl;
8843
+ const isVerticalReversed = isVertical && isRtl;
8844
+ const action = {
8845
+ ArrowUp: {
8846
+ axis: vertical,
8847
+ dir: isVerticalReversed ? FORWARD : BACKWARD
8848
+ },
8849
+ ArrowDown: {
8850
+ axis: vertical,
8851
+ dir: isVerticalReversed ? BACKWARD : FORWARD
8852
+ },
8853
+ ArrowLeft: {
8854
+ axis: horizontal,
8855
+ dir: isHorizontalReversed ? FORWARD : BACKWARD
8856
+ },
8857
+ ArrowRight: {
8858
+ axis: horizontal,
8859
+ dir: isHorizontalReversed ? BACKWARD : FORWARD
8860
+ },
8861
+ Home: {
8862
+ dir: "start"
8863
+ },
8864
+ End: {
8865
+ dir: "end"
8866
+ }
8867
+ }[event.key];
8868
+ if (!action || axis && action.axis && action.axis !== axis) return null;
8869
+ return action.dir;
8870
+ }
8871
+ /**
8872
+ * Whether a given element has keyboard conflicts with navigation keys, in which
8873
+ * case they should be considered as segmentors.
8874
+ *
8875
+ * @param {HTMLElement} element
8876
+ * @returns {boolean}
8877
+ */
8878
+ function isKeyConflictElement(el) {
8879
+ return el?.nodeType === Node.ELEMENT_NODE && (["INPUT", "TEXTAREA", "SELECT"].includes(el.nodeName) && !["checkbox", "radio"].includes(el.getAttribute("type")) || el.isContentEditable || ["AUDIO", "VIDEO"].includes(el.nodeName) && el.hasAttribute("controls") || ["IFRAME", "OBJECT"].includes(el.nodeName));
8880
+ }
8881
+
8882
+ //#region src/global-state.js
8883
+ /**
8884
+ * @type {{ o: Set<MutationObserver>, m?: Map<HTMLElement, *>, g?: MutationObserver, b: boolean }}
8885
+ * @global
8886
+ */
8887
+ globalThis.__FOCUSGROUP_POLYFILL__ ??= {
8888
+ o: /* @__PURE__ */new Set(),
8889
+ b: false
8890
+ };
8891
+ var state = globalThis.__FOCUSGROUP_POLYFILL__;
8892
+
8893
+ //#region src/observer-registry.js
8894
+ /** @type {Set<MutationObserver>} */
8895
+ var observers = state.o;
8896
+ /**
8897
+ * Flushes all globally registered focusgroup MutationObservers by calling
8898
+ * `takeRecords()` on each, discarding any pending mutation records that were
8899
+ * caused by polyfill-managed attribute writes. This prevents infinite
8900
+ * cross-group loops between nested focusgroups whose subtrees overlap.
8901
+ */
8902
+ function flushAllObservers() {
8903
+ for (const observer of observers) observer.takeRecords();
8904
+ }
8905
+
8906
+ //#region src/focusgroup.js
8907
+ /**
8908
+ * @import {
8909
+ * FocusGroupItemCollection,
8910
+ * FocusGroupOptions,
8911
+ * FocusGroupUpdateInfo,
8912
+ * } from "./focusgroup-items.js"
8913
+ * @import {FocusGroupDefinition} from "./utils.js"
8914
+ */
8915
+ var FocusGroup = class {
8916
+ /**
8917
+ * The focus group owner element.
8918
+ * @type {HTMLElement!}
8919
+ */
8920
+ #owner;
8921
+ /**
8922
+ * The items collection — exposes the focus group's items and answers
8923
+ * queries about them. Reconciliation is triggered externally via
8924
+ * `FocusGroup#update()`.
8925
+ * @type {FocusGroupItemCollection}
8926
+ */
8927
+ #items;
8928
+ /**
8929
+ * The focus group behavior.
8930
+ * @type {BehaviorToken!}
8931
+ */
8932
+ #behavior = BehaviorToken.NONE;
8933
+ /**
8934
+ * The focus group navigation axis limitation.
8935
+ * @type {("inline" | "block" | undefined)}
8936
+ */
8937
+ #axis = void 0;
8938
+ /**
8939
+ * Whether the focus group wraps. Defaults to `false`.
8940
+ * @type {boolean}
8941
+ */
8942
+ #wrap = false;
8943
+ /**
8944
+ * Whether the focus group remembers the previously focused element.
8945
+ * Defaults to `true`.
8946
+ * @type {boolean}
8947
+ */
8948
+ #memory = true;
8949
+ /**
8950
+ * The focus group start element (initial tab stop after decoration).
8951
+ * @type {HTMLElement}
8952
+ */
8953
+ #start;
8954
+ /**
8955
+ * The current item — the most recently focused item within the group.
8956
+ * Serves as the keyboard-navigation cursor while focus is inside, and (in
8957
+ * memory mode) as the tab stop to restore on re-entry. Updated by
8958
+ * `#handleFocusin`, plus directly by `#handleKeydown` for shadow-internal
8959
+ * navigation (where focus events don't cross the shadow boundary).
8960
+ * Cleared in nomemory mode on focusout and when validation fails after
8961
+ * re-decoration.
8962
+ * @type {HTMLElement|null}
8963
+ */
8964
+ #current = null;
8965
+ /**
8966
+ * Whether the owner currently has `tabindex=0` set as a Tab-entry proxy so
8967
+ * sequential focus navigation can reach a tab stop inside a shadow root.
8968
+ * @type {boolean}
8969
+ */
8970
+ #ownerIsProxy = false;
8971
+ /**
8972
+ * The owner's original `tabindex` attribute value (or `null` if it had no
8973
+ * `tabindex`), saved before the polyfill sets `tabindex=0` for proxy duty.
8974
+ * @type {string|null}
8975
+ */
8976
+ #ownerTabindexBeforeProxy = null;
8977
+ /**
8978
+ * The abort controller for when `disconnect()` is called.
8979
+ * @type {AbortController}
8980
+ */
8981
+ #abort = new AbortController();
8982
+ /**
8983
+ * Optional owner-decoration hook injected via `options.decorateOwner`.
8984
+ * Called with `(owner, behavior)` on decoration and `(owner, null)` on
8985
+ * undecoration. When absent, no owner decoration happens.
8986
+ * @type {((element: HTMLElement, behavior: BehaviorToken|null) => void) | undefined}
8987
+ */
8988
+ #decorateOwner;
8989
+ /**
8990
+ * Optional item-decoration hook injected via `options.decorateItem`.
8991
+ * Called with `(item, behavior)` on decoration and `(item, null)` on
8992
+ * undecoration. When absent, no item decoration happens.
8993
+ * @type {((element: HTMLElement, behavior: BehaviorToken|null) => void) | undefined}
8994
+ */
8995
+ #decorateItem;
8996
+ /**
8997
+ * @param {HTMLElement!} owner - The focus group owner element.
8998
+ * @param {FocusGroupItemCollection} items - The items collection providing
8999
+ * item discovery and queries.
9000
+ * @param {FocusGroupOptions} [options]
9001
+ */
9002
+ constructor(owner, items, options = {}) {
9003
+ if (supportsFocusGroup() || !owner) return;
9004
+ this.#owner = owner;
9005
+ this.#items = items;
9006
+ this.#decorateOwner = options.decorateOwner;
9007
+ this.#decorateItem = options.decorateItem;
9008
+ this.#updateDefinition(options.definition);
9009
+ this.#decorateOwner?.(this.#owner, this.#behavior);
9010
+ this.#decorateItems();
9011
+ const opts = {
9012
+ signal: this.#abort.signal
9013
+ };
9014
+ this.#owner.addEventListener("keydown", this.#handleKeydown.bind(this), opts);
9015
+ this.#owner.addEventListener("focusin", this.#handleFocusin.bind(this), opts);
9016
+ this.#owner.addEventListener("focusout", this.#handleFocusout.bind(this), opts);
9017
+ }
9018
+ /**
9019
+ * Tears down the focus group: disables the owner proxy, removes all event
9020
+ * listeners (via the abort signal), then disconnects the items collection
9021
+ * if it supports it.
9022
+ *
9023
+ * Ordering matters: owner-proxy teardown can trigger `flushAllObservers()`,
9024
+ * which expects the items' observer to still be in the global registry.
9025
+ * The items' own `disconnect()` is therefore called last.
9026
+ *
9027
+ * NOTE: This method does not undecorate the elements. Call it only after
9028
+ * the focusgroup owner has been removed from the DOM.
9029
+ */
9030
+ disconnect() {
9031
+ this.#disableFocusabilityProxy();
9032
+ this.#abort.abort();
9033
+ this.#items?.disconnect?.();
9034
+ this.#owner = null;
9035
+ }
9036
+ /**
9037
+ * Reconciles decoration state in response to relevant changes. Call this
9038
+ * whenever the focus group should refresh — e.g. items were added or
9039
+ * removed, the owner's `focusgroup` attribute changed, or an author set
9040
+ * `tabindex` on a decorated item.
9041
+ *
9042
+ * The polyfill's default `TreeWalkerItemCollection` calls this from a
9043
+ * `MutationObserver`. App-supplied collections (or app code that knows
9044
+ * when its model changed) can call it directly.
9045
+ *
9046
+ * @param {FocusGroupUpdateInfo} [info]
9047
+ */
9048
+ update(info = {}) {
9049
+ if (!this.#owner) return;
9050
+ if (info.definition !== void 0) {
9051
+ this.#updateDefinition(info.definition);
9052
+ this.#decorateOwner?.(this.#owner, this.#behavior);
9053
+ }
9054
+ if (info.authorTabindexChanges) for (const el of info.authorTabindexChanges) el.setAttribute(DatasetName.AUTHOR_TABINDEX, el.getAttribute("tabindex") ?? "none");
9055
+ this.#undecorateItems();
9056
+ this.#decorateItems();
9057
+ }
9058
+ /** @param {FocusGroupDefinition} [def] */
9059
+ #updateDefinition(def) {
9060
+ this.#behavior = def?.behavior ?? BehaviorToken.NONE;
9061
+ this.#wrap = def?.wrap ?? false;
9062
+ this.#axis = def?.axis;
9063
+ this.#memory = def?.memory ?? true;
9064
+ if (!this.#memory) this.#current = null;
9065
+ }
9066
+ #decorateItems() {
9067
+ if (this.#behavior === BehaviorToken.NONE) {
9068
+ this.#undecorateItems();
9069
+ return;
9070
+ }
9071
+ this.#items.decorate?.();
9072
+ for (const {
9073
+ element,
9074
+ segmentBoundary
9075
+ } of this.#items.items()) {
9076
+ this.#decorateItem?.(element, this.#behavior);
9077
+ element.setAttribute(DatasetName.AUTHOR_TABINDEX, element.getAttribute("tabindex") ?? "none");
9078
+ element.tabIndex = segmentBoundary ? 0 : -1;
9079
+ }
9080
+ if (!this.#current?.isConnected || !(this.#items.isItem?.(this.#current) ?? this.#items.contains(this.#current))) this.#current = null;
9081
+ const startItem = this.#current ?? this.#items.start ?? this.#items.first?.() ?? null;
9082
+ if (startItem) {
9083
+ startItem.tabIndex = 0;
9084
+ this.#start = startItem;
9085
+ this.#disableFocusabilityProxy();
9086
+ this.#enableFocusabilityProxy(startItem);
9087
+ }
9088
+ this.#items.flush?.();
9089
+ }
9090
+ #undecorateItems() {
9091
+ this.#disableFocusabilityProxy();
9092
+ let undecorated = false;
9093
+ for (const {
9094
+ element
9095
+ } of this.#items.items()) {
9096
+ undecorated = true;
9097
+ this.#decorateItem?.(element, null);
9098
+ const authorTabIndex = element.getAttribute(DatasetName.AUTHOR_TABINDEX);
9099
+ if (authorTabIndex) {
9100
+ if (authorTabIndex === "none") element.removeAttribute("tabindex");else element.setAttribute("tabindex", authorTabIndex);
9101
+ element.removeAttribute(DatasetName.AUTHOR_TABINDEX);
9102
+ }
9103
+ }
9104
+ this.#items.undecorate?.();
9105
+ if (undecorated) this.#items.flush?.();
9106
+ }
9107
+ /** @param {KeyboardEvent} evt */
9108
+ #handleKeydown(evt) {
9109
+ const current = evt.composedPath()[0];
9110
+ if (evt.defaultPrevented || current === this.#owner) return;
9111
+ if (!this.#items.contains(current)) return;
9112
+ evt.stopPropagation();
9113
+ let target;
9114
+ switch (getNavigationDirection(evt, current, this.#axis)) {
9115
+ case "start":
9116
+ target = this.#items.first();
9117
+ break;
9118
+ case "end":
9119
+ target = this.#items.last();
9120
+ break;
9121
+ case "forward":
9122
+ target = this.#items.next(current);
9123
+ if (!target && this.#wrap) target = this.#items.first();
9124
+ break;
9125
+ case "backward":
9126
+ target = this.#items.previous(current);
9127
+ if (!target && this.#wrap) target = this.#items.last();
9128
+ break;
9129
+ }
9130
+ if (target && target !== current) {
9131
+ this.#advanceFocus(current, target, true);
9132
+ this.#current = target;
9133
+ evt.preventDefault();
9134
+ }
9135
+ }
9136
+ /** @param {FocusEvent} evt */
9137
+ #handleFocusin(evt) {
9138
+ const target = evt.composedPath()[0];
9139
+ if (target === this.#owner && this.#ownerIsProxy && (!evt.relatedTarget || !nodeContains(this.#owner, evt.relatedTarget))) {
9140
+ const tabStop = this.#current || this.#start;
9141
+ this.#disableFocusabilityProxy();
9142
+ if (tabStop) tabStop.focus();
9143
+ evt.stopPropagation();
9144
+ return;
9145
+ }
9146
+ if (!this.#items.contains(target)) return;
9147
+ if (this.#ownerIsProxy) this.#disableFocusabilityProxy();
9148
+ const prev = this.#current;
9149
+ this.#current = target;
9150
+ if (prev === target) return;
9151
+ if (target.tabIndex < 0) {
9152
+ const transferFrom = prev ?? this.#start;
9153
+ if (transferFrom) this.#advanceFocus(transferFrom, target);
9154
+ }
9155
+ }
9156
+ /** @param {FocusEvent} evt */
9157
+ #handleFocusout(evt) {
9158
+ if (!evt.relatedTarget || !nodeContains(this.#owner, evt.relatedTarget)) {
9159
+ const tabStop = this.#memory ? this.#current || this.#start : this.#start;
9160
+ if (tabStop) this.#enableFocusabilityProxy(tabStop);
9161
+ }
9162
+ if (evt.relatedTarget && this.#owner.contains(evt.relatedTarget) || this.#memory || !this.#start) return;
9163
+ if (!this.#memory && this.#start) {
9164
+ const prev = this.#current;
9165
+ this.#current = null;
9166
+ const nextStart = this.#items.start ?? this.#items.first?.() ?? null;
9167
+ if (prev !== this.#start || nextStart !== this.#start) {
9168
+ for (const {
9169
+ element,
9170
+ segmentBoundary
9171
+ } of this.#items.items()) element.tabIndex = segmentBoundary ? 0 : -1;
9172
+ if (nextStart) {
9173
+ nextStart.tabIndex = 0;
9174
+ this.#start = nextStart;
9175
+ }
9176
+ this.#items.flush?.();
9177
+ }
9178
+ }
9179
+ const tabStop = this.#memory ? this.#current || this.#start : this.#start;
9180
+ if (tabStop) this.#enableFocusabilityProxy(tabStop);
9181
+ }
9182
+ /**
9183
+ * If the tab stop is inside a shadow DOM, sets `tabindex=0` on the
9184
+ * focusgroup owner so the browser's Tab navigation can land on it, at
9185
+ * which point `#handleFocusin` will redirect focus to the real tab stop.
9186
+ * @param {HTMLElement} tabStop - The actual focusable tab stop element.
9187
+ */
9188
+ #enableFocusabilityProxy(tabStop) {
9189
+ const rootNode = (tabStop.assignedSlot ?? tabStop).getRootNode();
9190
+ const hasFocusableHost = rootNode instanceof ShadowRoot && rootNode.host.hasAttribute(DatasetName.AUTHOR_TABINDEX);
9191
+ if (this.#ownerIsProxy || !hasFocusableHost) return;
9192
+ this.#ownerTabindexBeforeProxy = this.#owner.getAttribute("tabindex");
9193
+ this.#owner.tabIndex = 0;
9194
+ this.#ownerIsProxy = true;
9195
+ flushAllObservers();
9196
+ }
9197
+ /** Undoes `#enableFocusabilityProxy`. */
9198
+ #disableFocusabilityProxy() {
9199
+ if (!this.#ownerIsProxy) return;
9200
+ if (this.#ownerTabindexBeforeProxy !== null) this.#owner.setAttribute("tabindex", this.#ownerTabindexBeforeProxy);else this.#owner.removeAttribute("tabindex");
9201
+ this.#ownerIsProxy = false;
9202
+ this.#ownerTabindexBeforeProxy = null;
9203
+ this.#items.flush?.();
9204
+ flushAllObservers();
9205
+ }
9206
+ /**
9207
+ * Advances the focusgroup's active tab stop from one item to another. Sets
9208
+ * the target's `tabindex` to `0` and optionally calls `focus()` on it. The
9209
+ * previous item's `tabindex` is set to `-1` unless it belongs to a different
9210
+ * segment (in which case it remains `0` as a segment tab stop). Also disables
9211
+ * the owner proxy.
9212
+ *
9213
+ * @param {HTMLElement} prev - The currently focused item.
9214
+ * @param {HTMLElement} next - The item to receive focus.
9215
+ * @param {boolean} [shouldCallFocus=false] - Whether to programmatically
9216
+ * call `focus()` on the target element.
9217
+ */
9218
+ #advanceFocus(prev, next, shouldCallFocus = false) {
9219
+ next.tabIndex = 0;
9220
+ if (shouldCallFocus) next.focus();
9221
+ prev.tabIndex = this.#items.sameSegment?.(prev, next) ?? true ? -1 : 0;
9222
+ this.#disableFocusabilityProxy();
9223
+ flushAllObservers();
9224
+ }
9225
+ };
8932
9226
 
8933
- const Checkmark16Filled = html.partial(`<svg class="indicator" fill="currentColor" aria-hidden="true" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.05 3.49c.28.3.27.77-.04 1.06l-7.93 7.47A.85.85 0 014.9 12L2.22 9.28a.75.75 0 111.06-1.06l2.24 2.27 7.47-7.04a.75.75 0 011.06.04z" fill="currentColor"></path></svg>`);
8934
- const chevronRight16Filled = html.partial(`<svg class="submenu-glyph" fill="currentColor" aria-hidden="true" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M5.74 3.2a.75.75 0 00-.04 1.06L9.23 8 5.7 11.74a.75.75 0 101.1 1.02l4-4.25a.75.75 0 000-1.02l-4-4.25a.75.75 0 00-1.06-.04z" fill="currentColor"></path></svg>`);
8935
- function menuItemTemplate(options = {}) {
8936
- return html`<template @keydown="${(x, c) => x.handleMenuItemKeyDown(c.event)}" @click="${(x, c) => x.handleMenuItemClick(c.event)}" @mouseover="${(x, c) => x.handleMouseOver(c.event)}" @mouseout="${(x, c) => x.handleMouseOut(c.event)}" @toggle="${(x, c) => x.toggleHandler(c.event)}"><slot name="indicator">${staticallyCompose(options.indicator)}</slot>${startSlotTemplate(options)}<div part="content" class="content"><slot></slot></div>${endSlotTemplate(options)}<slot name="submenu-glyph">${staticallyCompose(options.submenuGlyph)}</slot><slot name="submenu" ${slotted({
8937
- property: "slottedSubmenu"
8938
- })}></slot></template>`;
9227
+ class ArrayItemCollection {
9228
+ constructor(getItems, getStart) {
9229
+ this.getItems = getItems;
9230
+ this.getStart = getStart;
9231
+ }
9232
+ get start() {
9233
+ return this.getStart?.() ?? null;
9234
+ }
9235
+ first() {
9236
+ return this.getItems()[0] ?? null;
9237
+ }
9238
+ last() {
9239
+ const items = this.getItems();
9240
+ return items[items.length - 1] ?? null;
9241
+ }
9242
+ next(current) {
9243
+ const items = this.getItems();
9244
+ const i = items.indexOf(current);
9245
+ return i === -1 ? null : items[i + 1] ?? null;
9246
+ }
9247
+ previous(current) {
9248
+ const items = this.getItems();
9249
+ const i = items.indexOf(current);
9250
+ return i <= 0 ? null : items[i - 1] ?? null;
9251
+ }
9252
+ *items() {
9253
+ for (const element of this.getItems()) {
9254
+ yield {
9255
+ element
9256
+ };
9257
+ }
9258
+ }
9259
+ contains(element) {
9260
+ return this.getItems().includes(element);
9261
+ }
8939
9262
  }
8940
- const template$k = menuItemTemplate({
8941
- indicator: Checkmark16Filled,
8942
- submenuGlyph: chevronRight16Filled
8943
- });
8944
-
8945
- const definition$k = MenuItem.compose({
8946
- name: `${FluentDesignSystem.prefix}-menu-item`,
8947
- template: template$k,
8948
- styles: styles$k
8949
- });
8950
-
8951
- definition$k.define(FluentDesignSystem.registry);
8952
9263
 
8953
9264
  var __defProp$o = Object.defineProperty;
8954
9265
  var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor;
@@ -8967,52 +9278,27 @@ const _BaseMenuList = class _BaseMenuList extends FASTElement {
8967
9278
  * @internal
8968
9279
  */
8969
9280
  this.elementInternals = this.attachInternals();
8970
- /**
8971
- * The index of the focusable element in the items array
8972
- * defaults to -1
8973
- */
8974
- this.focusIndex = -1;
8975
9281
  /**
8976
9282
  * @internal
8977
9283
  */
8978
9284
  this.isNestedMenu = () => {
8979
9285
  return this.parentElement !== null && isHTMLElement(this.parentElement) && this.parentElement.getAttribute("role") === "menuitem";
8980
9286
  };
8981
- /**
8982
- * if focus is moving out of the menu, reset to a stable initial state
8983
- * @internal
8984
- */
8985
- this.handleFocusOut = e => {
8986
- if (!this.contains(e.relatedTarget) && this.menuItems !== void 0) {
8987
- const focusIndex = this.menuItems.findIndex(this.isFocusableElement);
8988
- this.menuItems[this.focusIndex].setAttribute("tabindex", "-1");
8989
- this.menuItems[focusIndex].setAttribute("tabindex", "0");
8990
- this.focusIndex = focusIndex;
8991
- }
8992
- };
8993
- this.handleItemFocus = e => {
8994
- const targetItem = e.target;
8995
- if (this.menuItems !== void 0 && targetItem !== this.menuItems[this.focusIndex]) {
8996
- this.menuItems[this.focusIndex].setAttribute("tabindex", "-1");
8997
- this.focusIndex = this.menuItems.indexOf(targetItem);
8998
- targetItem.setAttribute("tabindex", "0");
8999
- }
9000
- };
9001
9287
  /**
9002
9288
  * Handle change from child MenuItem element and set radio group behavior
9003
9289
  */
9004
9290
  this.changedMenuItemHandler = e => {
9005
- if (this.menuItems === void 0) {
9291
+ if (this.menuChildren === void 0) {
9006
9292
  return;
9007
9293
  }
9008
9294
  const changedMenuItem = e.target;
9009
- const changeItemIndex = this.menuItems.indexOf(changedMenuItem);
9295
+ const changeItemIndex = this.menuChildren.indexOf(changedMenuItem);
9010
9296
  if (changeItemIndex === -1) {
9011
9297
  return;
9012
9298
  }
9013
9299
  if (changedMenuItem.role === "menuitemradio" && changedMenuItem.checked === true) {
9014
9300
  for (let i = changeItemIndex - 1; i >= 0; --i) {
9015
- const item = this.menuItems[i];
9301
+ const item = this.menuChildren[i];
9016
9302
  const role = item.role;
9017
9303
  if (role === MenuItemRole.menuitemradio) {
9018
9304
  item.checked = false;
@@ -9021,9 +9307,9 @@ const _BaseMenuList = class _BaseMenuList extends FASTElement {
9021
9307
  break;
9022
9308
  }
9023
9309
  }
9024
- const maxIndex = this.menuItems.length - 1;
9310
+ const maxIndex = this.menuChildren.length - 1;
9025
9311
  for (let i = changeItemIndex + 1; i <= maxIndex; ++i) {
9026
- const item = this.menuItems[i];
9312
+ const item = this.menuChildren[i];
9027
9313
  const role = item.role;
9028
9314
  if (role === MenuItemRole.menuitemradio) {
9029
9315
  item.checked = false;
@@ -9034,22 +9320,10 @@ const _BaseMenuList = class _BaseMenuList extends FASTElement {
9034
9320
  }
9035
9321
  }
9036
9322
  };
9037
- /**
9038
- * check if the item is a menu item
9039
- */
9040
- this.isMenuItemElement = el => {
9041
- return isMenuItem(el) || isHTMLElement(el) && !!el.role && el.role in _BaseMenuList.focusableElementRoles;
9042
- };
9043
- /**
9044
- * check if the item is focusable
9045
- */
9046
- this.isFocusableElement = el => {
9047
- return this.isMenuItemElement(el);
9048
- };
9049
9323
  this.elementInternals.role = "menu";
9050
9324
  }
9051
9325
  itemsChanged(oldValue, newValue) {
9052
- if (this.$fastController.isConnected && this.menuItems !== void 0) {
9326
+ if (this.$fastController.isConnected && this.menuChildren !== void 0) {
9053
9327
  this.setItems();
9054
9328
  }
9055
9329
  }
@@ -9068,8 +9342,7 @@ const _BaseMenuList = class _BaseMenuList extends FASTElement {
9068
9342
  */
9069
9343
  disconnectedCallback() {
9070
9344
  super.disconnectedCallback();
9071
- this.removeItemListeners();
9072
- this.menuItems = void 0;
9345
+ this.menuChildren = void 0;
9073
9346
  this.removeEventListener("change", this.changedMenuItemHandler);
9074
9347
  }
9075
9348
  /**
@@ -9078,37 +9351,7 @@ const _BaseMenuList = class _BaseMenuList extends FASTElement {
9078
9351
  * @public
9079
9352
  */
9080
9353
  focus() {
9081
- this.setFocus(0, 1);
9082
- }
9083
- /**
9084
- * @internal
9085
- */
9086
- handleMenuKeyDown(e) {
9087
- if (e.defaultPrevented || this.menuItems === void 0) {
9088
- return;
9089
- }
9090
- switch (e.key) {
9091
- case keyArrowDown:
9092
- this.setFocus(this.focusIndex + 1, 1);
9093
- return;
9094
- case keyArrowUp:
9095
- this.setFocus(this.focusIndex - 1, -1);
9096
- return;
9097
- case keyEnd:
9098
- this.setFocus(this.menuItems.length - 1, -1);
9099
- return;
9100
- case keyHome:
9101
- this.setFocus(0, 1);
9102
- return;
9103
- default:
9104
- return true;
9105
- }
9106
- }
9107
- removeItemListeners(items = this.items) {
9108
- items.forEach(item => {
9109
- item.removeEventListener("focus", this.handleItemFocus);
9110
- Observable.getNotifier(item).unsubscribe(this, "hidden");
9111
- });
9354
+ this.menuItems?.find(item => !item.disabled)?.focus();
9112
9355
  }
9113
9356
  static elementIndent(el) {
9114
9357
  const role = el.role;
@@ -9120,24 +9363,13 @@ const _BaseMenuList = class _BaseMenuList extends FASTElement {
9120
9363
  }
9121
9364
  setItems() {
9122
9365
  const children = Array.from(this.children);
9123
- this.removeItemListeners(children);
9124
- children.forEach(child => Observable.getNotifier(child).subscribe(this, "hidden"));
9125
- const newItems = children.filter(child => !child.hasAttribute("hidden"));
9126
- this.menuItems = newItems;
9127
- const menuItems = this.menuItems.filter(this.isMenuItemElement);
9128
- if (menuItems.length) {
9129
- this.focusIndex = 0;
9130
- }
9131
- menuItems.forEach((item, index) => {
9132
- item.setAttribute("tabindex", index === 0 ? "0" : "-1");
9133
- item.addEventListener("focus", this.handleItemFocus);
9134
- });
9135
- const filteredMenuListItems = this.menuItems?.filter(this.isMenuItemElement);
9136
- const indent = filteredMenuListItems?.reduce((accum, current) => {
9366
+ this.menuChildren = children.filter(child => !child.hasAttribute("hidden"));
9367
+ this.menuItems = this.menuChildren?.filter(this.isMenuItemElement);
9368
+ const indent = this.menuItems?.reduce((accum, current) => {
9137
9369
  const elementValue = _BaseMenuList.elementIndent(current);
9138
9370
  return Math.max(accum, elementValue);
9139
9371
  }, 0);
9140
- filteredMenuListItems?.forEach(item => {
9372
+ this.menuItems?.forEach(item => {
9141
9373
  item.dataset.indent = `${indent}`;
9142
9374
  });
9143
9375
  }
@@ -9149,30 +9381,38 @@ const _BaseMenuList = class _BaseMenuList extends FASTElement {
9149
9381
  this.setItems();
9150
9382
  }
9151
9383
  }
9152
- setFocus(focusIndex, adjustment) {
9153
- if (this.menuItems === void 0) {
9154
- return;
9155
- }
9156
- while (focusIndex >= 0 && focusIndex < this.menuItems.length) {
9157
- const child = this.menuItems[focusIndex];
9158
- if (this.isFocusableElement(child)) {
9159
- if (this.focusIndex > -1 && this.menuItems.length >= this.focusIndex - 1) {
9160
- this.menuItems[this.focusIndex].setAttribute("tabindex", "-1");
9161
- }
9162
- this.focusIndex = focusIndex;
9163
- child.setAttribute("tabindex", "0");
9164
- child.focus();
9165
- break;
9166
- }
9167
- focusIndex += adjustment;
9168
- }
9384
+ /**
9385
+ * check if the item is a menu item
9386
+ */
9387
+ isMenuItemElement(el) {
9388
+ return isMenuItem(el) || isHTMLElement(el) && !!el.role && el.role in _BaseMenuList.focusableElementRoles;
9169
9389
  }
9170
9390
  };
9171
9391
  _BaseMenuList.focusableElementRoles = MenuItemRole;
9172
9392
  __decorateClass$o([observable], _BaseMenuList.prototype, "items", 2);
9173
9393
  let BaseMenuList = _BaseMenuList;
9174
9394
 
9175
- class MenuList extends BaseMenuList {}
9395
+ class MenuList extends BaseMenuList {
9396
+ disconnectedCallback() {
9397
+ this.fg?.disconnect();
9398
+ super.disconnectedCallback();
9399
+ }
9400
+ setItems() {
9401
+ super.setItems();
9402
+ this.fgItems ?? (this.fgItems = new ArrayItemCollection(() => this.menuItems?.filter(i => !i.hidden) ?? []));
9403
+ if (!this.fg) {
9404
+ this.fg = new FocusGroup(this, this.fgItems, {
9405
+ definition: {
9406
+ behavior: "menu",
9407
+ axis: "block",
9408
+ wrap: true
9409
+ }
9410
+ });
9411
+ } else {
9412
+ this.fg.update();
9413
+ }
9414
+ }
9415
+ }
9176
9416
 
9177
9417
  const styles$j = css`
9178
9418
  ${display("flex")}
@@ -9180,18 +9420,20 @@ const styles$j = css`
9180
9420
  :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}`;
9181
9421
 
9182
9422
  function menuTemplate$1() {
9183
- 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>`;
9423
+ return html`<template focusgroup="menu" slot="${x => x.slot ? x.slot : x.isNestedMenu() ? "submenu" : void 0}"><slot ${slotted("items")}></slot></template>`;
9184
9424
  }
9185
9425
  const template$j = menuTemplate$1();
9186
9426
 
9187
9427
  const definition$j = MenuList.compose({
9188
- name: `${FluentDesignSystem.prefix}-menu-list`,
9428
+ name: tagName$i,
9189
9429
  template: template$j,
9190
9430
  styles: styles$j
9191
9431
  });
9192
9432
 
9193
9433
  definition$j.define(FluentDesignSystem.registry);
9194
9434
 
9435
+ const tagName$h = `${FluentDesignSystem.prefix}-menu`;
9436
+
9195
9437
  var __defProp$n = Object.defineProperty;
9196
9438
  var __getOwnPropDesc$n = Object.getOwnPropertyDescriptor;
9197
9439
  var __decorateClass$n = (decorators, target, key, kind) => {
@@ -9249,9 +9491,10 @@ class Menu extends FASTElement {
9249
9491
  */
9250
9492
  this.toggleHandler = e => {
9251
9493
  if (e.type === "toggle" && e.newState) {
9252
- const newState = e.newState === "open";
9253
- this._trigger?.setAttribute("aria-expanded", `${newState}`);
9254
- this._open = newState;
9494
+ const open = e.newState === "open";
9495
+ this._trigger?.setAttribute("aria-expanded", `${open}`);
9496
+ this._menuList?.setAttribute("focusgroup", open ? "menu" : "none");
9497
+ this._open = open;
9255
9498
  if (this._open) {
9256
9499
  this.focusMenuList();
9257
9500
  }
@@ -9547,13 +9790,15 @@ function menuTemplate() {
9547
9790
  const template$i = menuTemplate();
9548
9791
 
9549
9792
  const definition$i = Menu.compose({
9550
- name: `${FluentDesignSystem.prefix}-menu`,
9793
+ name: tagName$h,
9551
9794
  template: template$i,
9552
9795
  styles: styles$i
9553
9796
  });
9554
9797
 
9555
9798
  definition$i.define(FluentDesignSystem.registry);
9556
9799
 
9800
+ const tagName$g = `${FluentDesignSystem.prefix}-message-bar`;
9801
+
9557
9802
  var __defProp$m = Object.defineProperty;
9558
9803
  var __getOwnPropDesc$m = Object.getOwnPropertyDescriptor;
9559
9804
  var __decorateClass$m = (decorators, target, key, kind) => {
@@ -9596,7 +9841,7 @@ function messageBarTemplate() {
9596
9841
  const template$h = messageBarTemplate();
9597
9842
 
9598
9843
  const definition$h = MessageBar.compose({
9599
- name: `${FluentDesignSystem.prefix}-message-bar`,
9844
+ name: tagName$g,
9600
9845
  template: template$h,
9601
9846
  styles: styles$h,
9602
9847
  shadowOptions: {
@@ -9889,7 +10134,7 @@ const template$g = dropdownOptionTemplate({
9889
10134
  });
9890
10135
 
9891
10136
  const definition$g = DropdownOption.compose({
9892
- name: `${FluentDesignSystem.prefix}-option`,
10137
+ name: tagName$p,
9893
10138
  template: template$g,
9894
10139
  styles: styles$g
9895
10140
  });
@@ -9901,6 +10146,7 @@ const ProgressBarValidationState = {
9901
10146
  warning: "warning",
9902
10147
  error: "error"
9903
10148
  };
10149
+ const tagName$f = `${FluentDesignSystem.prefix}-progress-bar`;
9904
10150
 
9905
10151
  var __defProp$k = Object.defineProperty;
9906
10152
  var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor;
@@ -10029,8 +10275,7 @@ const styles$f = css`
10029
10275
 
10030
10276
  :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(
10031
10277
  to right,${colorNeutralBackground6} 0%,${colorTransparentBackground} 50%,${colorNeutralBackground6} 100%
10032
- );animation-name:indeterminate;animation-duration:3s;animation-timing-function:linear;animation-iteration-count:infinite}:host([validation-state='error']) .indicator{background-color:${colorPaletteRedBackground3}}:host([validation-state='warning']) .indicator{background-color:${colorPaletteDarkOrangeBackground3}}:host([validation-state='success']) .indicator{background-color:${colorPaletteGreenBackground3}}@layer animations{@media (prefers-reduced-motion:no-preference){:host([value]){transition:none}:host(:not([value])) .indicator{animation-duration:0.01ms;animation-iteration-count:1}}}@keyframes indeterminate{0%{inset-inline-start:-33%}100%{inset-inline-start:100%}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
10033
- :host{background-color:CanvasText}.indicator,:host(:is([validation-state='success'],[validation-state='warning'],[validation-state='error'])) .indicator{background-color:Highlight}`));
10278
+ );animation-name:indeterminate;animation-duration:3s;animation-timing-function:linear;animation-iteration-count:infinite}:host([validation-state='error']) .indicator{background-color:${colorPaletteRedBackground3}}:host([validation-state='warning']) .indicator{background-color:${colorPaletteDarkOrangeBackground3}}:host([validation-state='success']) .indicator{background-color:${colorPaletteGreenBackground3}}@layer animations{@media (prefers-reduced-motion:no-preference){:host([value]){transition:none}:host(:not([value])) .indicator{animation-duration:0.01ms;animation-iteration-count:1}}}@keyframes indeterminate{0%{inset-inline-start:-33%}100%{inset-inline-start:100%}}@media (forced-colors:active){:host{background-color:CanvasText}.indicator,:host(:is([validation-state='success'],[validation-state='warning'],[validation-state='error'])) .indicator{background-color:Highlight}}`;
10034
10279
 
10035
10280
  function progressTemplate() {
10036
10281
  return html`<div class="indicator" part="indicator" ${ref("indicator")}></div>`;
@@ -10038,26 +10283,20 @@ function progressTemplate() {
10038
10283
  const template$f = progressTemplate();
10039
10284
 
10040
10285
  const definition$f = ProgressBar.compose({
10041
- name: `${FluentDesignSystem.prefix}-progress-bar`,
10286
+ name: tagName$f,
10042
10287
  template: template$f,
10043
10288
  styles: styles$f
10044
10289
  });
10045
10290
 
10046
10291
  definition$f.define(FluentDesignSystem.registry);
10047
10292
 
10048
- function isRadio(element, tagName = "-radio") {
10049
- return isCustomElement(tagName)(element);
10050
- }
10293
+ const RadioGroupOrientation = Orientation;
10294
+ const tagName$e = `${FluentDesignSystem.prefix}-radio-group`;
10051
10295
 
10052
- function getRootActiveElement(element) {
10053
- const rootNode = element.getRootNode();
10054
- if (rootNode instanceof ShadowRoot) {
10055
- return rootNode.activeElement;
10056
- }
10057
- return document.activeElement;
10296
+ function isRadio(element, tagName2 = "-radio") {
10297
+ return isCustomElement(tagName2)(element);
10058
10298
  }
10059
-
10060
- const RadioGroupOrientation = Orientation;
10299
+ const tagName$d = `${FluentDesignSystem.prefix}-radio`;
10061
10300
 
10062
10301
  var __defProp$i = Object.defineProperty;
10063
10302
  var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor;
@@ -10070,6 +10309,7 @@ var __decorateClass$i = (decorators, target, key, kind) => {
10070
10309
  class BaseRadioGroup extends FASTElement {
10071
10310
  constructor() {
10072
10311
  super();
10312
+ this.isNavigating = false;
10073
10313
  /**
10074
10314
  * Indicates that the value has been changed by the user.
10075
10315
  */
@@ -10109,7 +10349,6 @@ class BaseRadioGroup extends FASTElement {
10109
10349
  this.radios?.forEach(radio => {
10110
10350
  radio.disabled = !!radio.disabledAttribute || !!this.disabled;
10111
10351
  });
10112
- this.restrictFocus();
10113
10352
  }
10114
10353
  }
10115
10354
  /**
@@ -10168,18 +10407,13 @@ class BaseRadioGroup extends FASTElement {
10168
10407
  }
10169
10408
  radio.name = this.name ?? radio.name;
10170
10409
  radio.disabled = !!this.disabled || !!radio.disabledAttribute;
10410
+ radio.toggleAttribute("focusgroupstart", radio.checked && !radio.disabled);
10171
10411
  });
10172
10412
  if (!this.dirtyState && this.initialValue) {
10173
10413
  this.value = this.initialValue;
10174
10414
  }
10175
10415
  if (!this.value ||
10176
10416
  // This logic covers the case when the RadioGroup doesn't have a `value`
10177
- // attribute, but does have a checked child Radio. Without this condition,
10178
- // the checked Radio's value will be assigned to `this.value`, and
10179
- // `checkedIndex` will be the checked Radio's index, but `this.checkedIndex`
10180
- // will remain `undefined`, which would cause the RadioGroup to add
10181
- // `tabindex=-1` to the checked Radio, and effectively makes the whole
10182
- // RadioGroup unfocusable.
10183
10417
  this.value && typeof this.checkedIndex !== "number" && checkedIndex >= 0) {
10184
10418
  this.checkedIndex = checkedIndex;
10185
10419
  }
@@ -10187,9 +10421,6 @@ class BaseRadioGroup extends FASTElement {
10187
10421
  if (radioIds) {
10188
10422
  this.setAttribute("aria-owns", radioIds);
10189
10423
  }
10190
- Updates.enqueue(() => {
10191
- this.restrictFocus();
10192
- });
10193
10424
  }
10194
10425
  /**
10195
10426
  *
@@ -10339,6 +10570,12 @@ class BaseRadioGroup extends FASTElement {
10339
10570
  focus() {
10340
10571
  this.enabledRadios[Math.max(0, this.checkedIndex)]?.focus();
10341
10572
  }
10573
+ formResetCallback() {
10574
+ this.dirtyState = false;
10575
+ this.checkedIndex = -1;
10576
+ this.setFormValue(this.value);
10577
+ this.setValidity();
10578
+ }
10342
10579
  /**
10343
10580
  * Enables tabbing through the radio group when the group receives focus.
10344
10581
  *
@@ -10346,37 +10583,20 @@ class BaseRadioGroup extends FASTElement {
10346
10583
  * @internal
10347
10584
  */
10348
10585
  focusinHandler(e) {
10349
- if (!this.disabled) {
10350
- this.enabledRadios.forEach(radio => {
10351
- radio.tabIndex = 0;
10586
+ if (!this.disabled && (this.isNavigating || this.value)) {
10587
+ this.radios?.forEach(radio => {
10588
+ if (radio.disabled && radio.checked) {
10589
+ radio.checked = false;
10590
+ }
10352
10591
  });
10592
+ const index = this.enabledRadios.indexOf(e.target);
10593
+ if (index > -1) {
10594
+ this.checkRadio(index, true);
10595
+ }
10596
+ this.isNavigating = false;
10353
10597
  }
10354
10598
  return true;
10355
10599
  }
10356
- /**
10357
- * Sets the tabindex of the radios based on the checked state when the radio group loses focus.
10358
- *
10359
- * @param e - the focusout event
10360
- * @internal
10361
- */
10362
- focusoutHandler(e) {
10363
- if (this.radios?.includes(e.relatedTarget) && this.radios?.some(x => x.checked)) {
10364
- this.restrictFocus();
10365
- }
10366
- return true;
10367
- }
10368
- formResetCallback() {
10369
- this.dirtyState = false;
10370
- this.checkedIndex = -1;
10371
- this.setFormValue(this.value);
10372
- this.setValidity();
10373
- }
10374
- getEnabledIndexInBounds(index, upperBound = this.enabledRadios.length) {
10375
- if (upperBound === 0) {
10376
- return -1;
10377
- }
10378
- return (index + upperBound) % upperBound;
10379
- }
10380
10600
  /**
10381
10601
  * Handles keydown events for the radio group.
10382
10602
  *
@@ -10384,47 +10604,20 @@ class BaseRadioGroup extends FASTElement {
10384
10604
  * @internal
10385
10605
  */
10386
10606
  keydownHandler(e) {
10387
- const isRtl = getDirection(this) === "rtl";
10388
- const checkedIndex = this.enabledRadios.findIndex(x => x === getRootActiveElement(this)) ?? this.checkedIndex;
10389
- let increment = 0;
10390
10607
  switch (e.key) {
10391
- case "ArrowLeft":
10392
- {
10393
- increment = isRtl ? 1 : -1;
10394
- break;
10395
- }
10396
- case "ArrowUp":
10397
- {
10398
- increment = -1;
10399
- break;
10400
- }
10401
- case "ArrowRight":
10402
- {
10403
- increment = isRtl ? -1 : 1;
10404
- break;
10405
- }
10406
- case "ArrowDown":
10407
- {
10408
- increment = 1;
10409
- break;
10410
- }
10411
- case "Tab":
10412
- {
10413
- this.restrictFocus();
10414
- break;
10415
- }
10416
- case " ":
10417
- {
10418
- this.checkRadio();
10419
- break;
10420
- }
10421
- }
10422
- if (!increment) {
10423
- return true;
10608
+ case keyArrowUp:
10609
+ case keyArrowDown:
10610
+ case keyArrowLeft:
10611
+ case keyArrowRight:
10612
+ case keyHome:
10613
+ case keyEnd:
10614
+ this.isNavigating = true;
10615
+ break;
10616
+ case keySpace:
10617
+ this.checkRadio();
10618
+ break;
10424
10619
  }
10425
- const nextIndex = checkedIndex + increment;
10426
- this.checkRadio(this.getEnabledIndexInBounds(nextIndex), true);
10427
- this.enabledRadios[this.checkedIndex]?.focus();
10620
+ return true;
10428
10621
  }
10429
10622
  /**
10430
10623
  *
@@ -10445,22 +10638,6 @@ class BaseRadioGroup extends FASTElement {
10445
10638
  reportValidity() {
10446
10639
  return this.elementInternals.reportValidity();
10447
10640
  }
10448
- /**
10449
- * Resets the `tabIndex` for all child radios when the radio group loses focus.
10450
- *
10451
- * @internal
10452
- */
10453
- restrictFocus() {
10454
- let activeIndex = Math.max(this.checkedIndex, 0);
10455
- const focusedRadioIndex = this.enabledRadios.indexOf(getRootActiveElement(this));
10456
- if (focusedRadioIndex !== -1) {
10457
- activeIndex = focusedRadioIndex;
10458
- }
10459
- activeIndex = this.getEnabledIndexInBounds(activeIndex);
10460
- this.enabledRadios.forEach((item, index) => {
10461
- item.tabIndex = index === activeIndex ? 0 : -1;
10462
- });
10463
- }
10464
10641
  /**
10465
10642
  * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/setFormValue | `ElementInternals.setFormValue()`} method.
10466
10643
  *
@@ -10541,7 +10718,27 @@ __decorateClass$i([attr({
10541
10718
  })], BaseRadioGroup.prototype, "required", 2);
10542
10719
  __decorateClass$i([observable], BaseRadioGroup.prototype, "slottedRadios", 2);
10543
10720
 
10544
- class RadioGroup extends BaseRadioGroup {}
10721
+ class RadioGroup extends BaseRadioGroup {
10722
+ disconnectedCallback() {
10723
+ this.fg?.disconnect();
10724
+ super.disconnectedCallback();
10725
+ }
10726
+ radiosChanged(prev, next) {
10727
+ super.radiosChanged(prev, next);
10728
+ this.fgItems ?? (this.fgItems = new ArrayItemCollection(() => this.enabledRadios?.filter(r => !r.hidden) ?? [], () => this.enabledRadios?.find(r => r.checked) ?? null));
10729
+ if (!this.fg) {
10730
+ this.fg = new FocusGroup(this, this.fgItems, {
10731
+ definition: {
10732
+ behavior: "radiogroup",
10733
+ axis: void 0,
10734
+ wrap: true
10735
+ }
10736
+ });
10737
+ } else {
10738
+ this.fg.update();
10739
+ }
10740
+ }
10741
+ }
10545
10742
 
10546
10743
  const styles$e = css`
10547
10744
  ${display("flex")}
@@ -10549,12 +10746,12 @@ const styles$e = css`
10549
10746
  :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}}`;
10550
10747
 
10551
10748
  function radioGroupTemplate() {
10552
- 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>`;
10749
+ return html`<template focusgroup="radiogroup wrap" @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)}" @keydown="${(x, c) => x.keydownHandler(c.event)}"><slot ${slotted("slottedRadios")}></slot></template>`;
10553
10750
  }
10554
10751
  const template$e = radioGroupTemplate();
10555
10752
 
10556
10753
  const definition$e = RadioGroup.compose({
10557
- name: `${FluentDesignSystem.prefix}-radio-group`,
10754
+ name: tagName$e,
10558
10755
  template: template$e,
10559
10756
  styles: styles$e
10560
10757
  });
@@ -10586,7 +10783,7 @@ class Radio extends BaseCheckbox {
10586
10783
  * @internal
10587
10784
  * @override
10588
10785
  * @remarks
10589
- * To make a group of radio controls required, see {@link RadioGroup.required}.
10786
+ * To make a group of radio controls required, see `RadioGroup.required`.
10590
10787
  */
10591
10788
  requiredChanged() {
10592
10789
  return;
@@ -10630,8 +10827,7 @@ class Radio extends BaseCheckbox {
10630
10827
  const styles$d = css`
10631
10828
  ${display("inline-flex")}
10632
10829
 
10633
- :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`
10634
- :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}`));
10830
+ :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}}@media (forced-colors:active){: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}}`;
10635
10831
 
10636
10832
  const checkedIndicator = html.partial(/* html */
10637
10833
  `
@@ -10645,13 +10841,15 @@ const template$d = radioTemplate({
10645
10841
  });
10646
10842
 
10647
10843
  const definition$d = Radio.compose({
10648
- name: `${FluentDesignSystem.prefix}-radio`,
10844
+ name: tagName$d,
10649
10845
  template: template$d,
10650
10846
  styles: styles$d
10651
10847
  });
10652
10848
 
10653
10849
  definition$d.define(FluentDesignSystem.registry);
10654
10850
 
10851
+ const tagName$c = `${FluentDesignSystem.prefix}-rating-display`;
10852
+
10655
10853
  var __defProp$h = Object.defineProperty;
10656
10854
  var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
10657
10855
  var __decorateClass$h = (decorators, target, key, kind) => {
@@ -10811,17 +11009,33 @@ const styles$c = css`
10811
11009
  var(--_mask-inline-size) * var(--_value) - var(--_icon-gradient-stop-visual-adjustment)
10812
11010
  );background-image:linear-gradient(
10813
11011
  var(--_icon-gradient-degree),var(--_icon-color-value) var(--_icon-gradient-stop),var(--_icon-color-empty) calc(var(--_icon-gradient-stop) + 0.5px)
10814
- );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`
10815
- .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)}`));
11012
+ );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}}@media (forced-colors:active){.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)}}`;
10816
11013
 
10817
11014
  const definition$c = RatingDisplay.compose({
10818
- name: `${FluentDesignSystem.prefix}-rating-display`,
11015
+ name: tagName$c,
10819
11016
  template: template$c,
10820
11017
  styles: styles$c
10821
11018
  });
10822
11019
 
10823
11020
  definition$c.define(FluentDesignSystem.registry);
10824
11021
 
11022
+ const SliderOrientation = Orientation;
11023
+ const SliderMode = {
11024
+ singleValue: "single-value"
11025
+ };
11026
+ const tagName$b = `${FluentDesignSystem.prefix}-slider`;
11027
+
11028
+ const numberLikeStringConverter = {
11029
+ fromView(value) {
11030
+ const valueAsNumber = parseFloat(value);
11031
+ return Number.isNaN(valueAsNumber) ? "" : valueAsNumber.toString();
11032
+ },
11033
+ toView(value) {
11034
+ const valueAsNumber = parseFloat(value);
11035
+ return Number.isNaN(valueAsNumber) ? void 0 : valueAsNumber.toString();
11036
+ }
11037
+ };
11038
+
10825
11039
  function convertPixelToPercent(pixelPos, minPosition, maxPosition, direction) {
10826
11040
  let pct = limit(0, 1, (pixelPos - minPosition) / (maxPosition - minPosition));
10827
11041
  if (direction === Direction.rtl) {
@@ -10830,11 +11044,6 @@ function convertPixelToPercent(pixelPos, minPosition, maxPosition, direction) {
10830
11044
  return pct;
10831
11045
  }
10832
11046
 
10833
- const SliderOrientation = Orientation;
10834
- const SliderMode = {
10835
- singleValue: "single-value"
10836
- };
10837
-
10838
11047
  var __defProp$f = Object.defineProperty;
10839
11048
  var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
10840
11049
  var __decorateClass$f = (decorators, target, key, kind) => {
@@ -11412,8 +11621,7 @@ const styles$b = css`
11412
11621
  var(--slider-direction),var(--rail-color) 0%,var(--rail-color) 50%,var(--track-color) 50.1%,var(--track-color) 100%
11413
11622
  );border-radius:var(--border-radius);content:'';grid-row:1 / -1;grid-column:1 / -1}.track{position:relative;background-color:var(--track-color);grid-row:2 / 2;grid-column:2 / 2;forced-color-adjust:none;overflow:hidden}:host([orientation='vertical'])::after,:host([orientation='vertical']) .track{height:100%;width:var(--track-size)}.track::before{content:'';position:absolute;height:100%;border-radius:inherit;inset-inline-start:0;width:var(--slider-progress)}:host(:dir(rtl)) .track::before{width:calc(100% - var(--slider-progress))}:host([orientation='vertical']) .track::before{width:100%;bottom:0;height:var(--slider-progress)}:host([step]) .track::after{content:'';position:absolute;border-radius:inherit;inset:var(--step-marker-inset);background-image:repeating-linear-gradient(
11414
11623
  var(--slider-direction),#0000 0%,#0000 calc(var(--step-rate) - 1px),${colorNeutralBackground1} calc(var(--step-rate) - 1px),${colorNeutralBackground1} var(--step-rate)
11415
- )}.thumb-container{position:absolute;grid-row:2 / 2;grid-column:2 / 2;transform:translateX(-50%);left:var(--slider-thumb)}:host([orientation='vertical']) .thumb-container{transform:translateY(50%);left:unset;bottom:var(--slider-thumb)}:host(:not(:active)) :is(.thumb-container,.track::before){transition:all 0.2s ease}.thumb{width:var(--thumb-size);height:var(--thumb-size);border-radius:${borderRadiusCircular};box-shadow:0 0 0 calc(var(--thumb-size) * 0.2) ${colorNeutralBackground1} inset;border:calc(var(--thumb-size) * 0.05) solid ${colorNeutralStroke1};box-sizing:border-box}.thumb,.track::before{background-color:var(--rail-color)}`.withBehaviors(forcedColorsStylesheetBehavior(css`
11416
- .track:hover,.track:active,.track{background:WindowText}.thumb:hover,.thumb:active,.thumb{background:ButtonText}:host(:hover) .track::before,:host(:active) .track::before,.track::before{background:Highlight}`));
11624
+ )}.thumb-container{position:absolute;grid-row:2 / 2;grid-column:2 / 2;transform:translateX(-50%);left:var(--slider-thumb)}:host([orientation='vertical']) .thumb-container{transform:translateY(50%);left:unset;bottom:var(--slider-thumb)}:host(:not(:active)) :is(.thumb-container,.track::before){transition:all 0.2s ease}.thumb{width:var(--thumb-size);height:var(--thumb-size);border-radius:${borderRadiusCircular};box-shadow:0 0 0 calc(var(--thumb-size) * 0.2) ${colorNeutralBackground1} inset;border:calc(var(--thumb-size) * 0.05) solid ${colorNeutralStroke1};box-sizing:border-box}.thumb,.track::before{background-color:var(--rail-color)}@media (forced-colors:active){.track:hover,.track:active,.track{background:WindowText}.thumb:hover,.thumb:active,.thumb{background:ButtonText}:host(:hover) .track::before,:host(:active) .track::before,.track::before{background:Highlight}}`;
11417
11625
 
11418
11626
  function sliderTemplate(options = {}) {
11419
11627
  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>`;
@@ -11423,13 +11631,15 @@ const template$b = sliderTemplate({
11423
11631
  });
11424
11632
 
11425
11633
  const definition$b = Slider.compose({
11426
- name: `${FluentDesignSystem.prefix}-slider`,
11634
+ name: tagName$b,
11427
11635
  template: template$b,
11428
11636
  styles: styles$b
11429
11637
  });
11430
11638
 
11431
11639
  definition$b.define(FluentDesignSystem.registry);
11432
11640
 
11641
+ const tagName$a = `${FluentDesignSystem.prefix}-spinner`;
11642
+
11433
11643
  class BaseSpinner extends FASTElement {
11434
11644
  constructor() {
11435
11645
  super();
@@ -11458,19 +11668,20 @@ __decorateClass$e([attr], Spinner.prototype, "appearance", 2);
11458
11668
  const styles$a = css`
11459
11669
  ${display("inline-flex")}
11460
11670
 
11461
- :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`
11462
- .background{display:none}.indicator{border-color:Canvas;border-block-start-color:Highlight;border-right-color:Highlight}`));
11671
+ :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)}}@media (forced-colors:active){.background{display:none}.indicator{border-color:Canvas;border-block-start-color:Highlight;border-right-color:Highlight}}`;
11463
11672
 
11464
11673
  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>`;
11465
11674
 
11466
11675
  const definition$a = Spinner.compose({
11467
- name: `${FluentDesignSystem.prefix}-spinner`,
11676
+ name: tagName$a,
11468
11677
  template: template$a,
11469
11678
  styles: styles$a
11470
11679
  });
11471
11680
 
11472
11681
  definition$a.define(FluentDesignSystem.registry);
11473
11682
 
11683
+ const tagName$9 = `${FluentDesignSystem.prefix}-switch`;
11684
+
11474
11685
  class Switch extends BaseCheckbox {
11475
11686
  constructor() {
11476
11687
  super();
@@ -11488,17 +11699,24 @@ const template$9 = switchTemplate({
11488
11699
  const styles$9 = css`
11489
11700
  ${display("inline-flex")}
11490
11701
 
11491
- :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`
11492
- :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}`));
11702
+ :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}}@media (forced-colors:active){: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}}`;
11493
11703
 
11494
11704
  const definition$9 = Switch.compose({
11495
- name: `${FluentDesignSystem.prefix}-switch`,
11705
+ name: tagName$9,
11496
11706
  template: template$9,
11497
11707
  styles: styles$9
11498
11708
  });
11499
11709
 
11500
11710
  definition$9.define(FluentDesignSystem.registry);
11501
11711
 
11712
+ function isTab(element, tagName2 = "-tab") {
11713
+ if (element?.nodeType !== Node.ELEMENT_NODE) {
11714
+ return false;
11715
+ }
11716
+ return element.tagName.toLowerCase().endsWith(tagName2);
11717
+ }
11718
+ const tagName$8 = `${FluentDesignSystem.prefix}-tab`;
11719
+
11502
11720
  var __defProp$d = Object.defineProperty;
11503
11721
  var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
11504
11722
  var __decorateClass$d = (decorators, target, key, kind) => {
@@ -11518,12 +11736,13 @@ class Tab extends FASTElement {
11518
11736
  this.elementInternals = this.attachInternals();
11519
11737
  this.elementInternals.role = "tab";
11520
11738
  }
11739
+ disabledChanged(prev, next) {
11740
+ this.setDisabledSideEffect(next);
11741
+ }
11521
11742
  connectedCallback() {
11522
11743
  super.connectedCallback();
11523
11744
  this.slot || (this.slot = "tab");
11524
- if (this.disabled) {
11525
- this.setAttribute("aria-disabled", "true");
11526
- }
11745
+ this.setDisabledSideEffect(this.disabled);
11527
11746
  if (this.styles) {
11528
11747
  this.$fastController.removeStyles(this.styles);
11529
11748
  }
@@ -11531,6 +11750,14 @@ class Tab extends FASTElement {
11531
11750
  :host{--textContent:'${this.textContent}'}`;
11532
11751
  this.$fastController.addStyles(this.styles);
11533
11752
  }
11753
+ setDisabledSideEffect(disabled) {
11754
+ if (disabled) {
11755
+ this.setAttribute("aria-disabled", "true");
11756
+ } else {
11757
+ this.removeAttribute("aria-disabled");
11758
+ }
11759
+ this.tabIndex = disabled && this.getAttribute("aria-selected") !== "true" ? -1 : 0;
11760
+ }
11534
11761
  }
11535
11762
  __decorateClass$d([attr({
11536
11763
  mode: "boolean"
@@ -11538,46 +11765,29 @@ __decorateClass$d([attr({
11538
11765
  applyMixins(Tab, StartEnd);
11539
11766
 
11540
11767
  function tabTemplate(options = {}) {
11541
- return html`<template slot="tab" role="tab" aria-disabled="${x => x.disabled}">${startSlotTemplate(options)}<span class="tab-content"><slot></slot></span>${endSlotTemplate(options)}</template>`;
11768
+ return html`<template slot="tab" role="tab">${startSlotTemplate(options)}<span class="tab-content"><slot></slot></span>${endSlotTemplate(options)}</template>`;
11542
11769
  }
11543
11770
  const template$8 = tabTemplate({});
11544
11771
 
11545
11772
  const styles$8 = css`
11546
11773
  ${display("inline-flex")}
11547
11774
 
11548
- :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`
11549
- :host([aria-selected='true'])::after{background-color:Highlight}`));
11775
+ :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}@supports (anchor-name:--a) and (text-size-adjust:auto){:host([aria-selected='true'])::after{background-color:transparent}:host([aria-selected='true']:hover)::after{background-color:${colorNeutralStroke1Hover}}}: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};pointer-events:none}: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}@media (forced-colors:active){:host([aria-selected='true'])::after{background-color:Highlight}}`;
11550
11776
 
11551
11777
  const definition$8 = Tab.compose({
11552
- name: `${FluentDesignSystem.prefix}-tab`,
11778
+ name: tagName$8,
11553
11779
  template: template$8,
11554
11780
  styles: styles$8
11555
11781
  });
11556
11782
 
11557
11783
  definition$8.define(FluentDesignSystem.registry);
11558
11784
 
11559
- function isTab(element, tagName = "-tab") {
11560
- if (element?.nodeType !== Node.ELEMENT_NODE) {
11561
- return false;
11562
- }
11563
- return element.tagName.toLowerCase().endsWith(tagName);
11564
- }
11565
-
11566
- const isARIADisabledElement = el => {
11567
- return el.getAttribute("aria-disabled") === "true" || el.elementInternals?.ariaDisabled === "true";
11568
- };
11569
- const isHiddenElement = el => {
11570
- return el.hasAttribute("hidden");
11571
- };
11572
- const isFocusableElement = el => {
11573
- return !isARIADisabledElement(el) && !isHiddenElement(el);
11574
- };
11575
-
11576
11785
  const TablistAppearance = {
11577
11786
  subtle: "subtle",
11578
11787
  transparent: "transparent"
11579
11788
  };
11580
11789
  const TablistOrientation = Orientation;
11790
+ const tagName$7 = `${FluentDesignSystem.prefix}-tablist`;
11581
11791
 
11582
11792
  var __defProp$c = Object.defineProperty;
11583
11793
  var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
@@ -11598,84 +11808,23 @@ class BaseTablist extends FASTElement {
11598
11808
  this.elementInternals = this.attachInternals();
11599
11809
  this.disabled = false;
11600
11810
  this.orientation = TablistOrientation.horizontal;
11601
- this.prevActiveTabIndex = 0;
11602
- this.activeTabIndex = 0;
11811
+ this.tabs = [];
11603
11812
  this.tabPanelMap = /* @__PURE__ */new WeakMap();
11604
- this.change = () => {
11605
- this.$emit("change", this.activetab);
11606
- };
11607
- this.handleTabClick = event => {
11608
- const selectedTab = event.currentTarget;
11609
- if (selectedTab.disabled || this.disabled) {
11610
- return;
11611
- }
11612
- if (selectedTab.nodeType === Node.ELEMENT_NODE && isFocusableElement(selectedTab)) {
11613
- this.prevActiveTabIndex = this.activeTabIndex;
11614
- this.activeTabIndex = this.tabs.indexOf(selectedTab);
11615
- this.setComponent();
11616
- }
11617
- };
11618
- this.handleTabKeyDown = event => {
11619
- if (this.disabled) {
11620
- return;
11621
- }
11622
- const dir = getDirection(this);
11623
- switch (event.key) {
11624
- case keyArrowLeft:
11625
- if (!this.isHorizontal()) {
11626
- return;
11627
- }
11628
- event.preventDefault();
11629
- this.adjust(dir === "ltr" ? -1 : 1);
11630
- break;
11631
- case keyArrowRight:
11632
- if (!this.isHorizontal()) {
11633
- return;
11634
- }
11635
- event.preventDefault();
11636
- this.adjust(dir === "ltr" ? 1 : -1);
11637
- break;
11638
- case keyArrowUp:
11639
- if (this.isHorizontal()) {
11640
- return;
11641
- }
11642
- event.preventDefault();
11643
- this.adjust(-1);
11644
- break;
11645
- case keyArrowDown:
11646
- if (this.isHorizontal()) {
11647
- return;
11648
- }
11649
- event.preventDefault();
11650
- this.adjust(1);
11651
- break;
11652
- case keyHome:
11653
- event.preventDefault();
11654
- this.adjust(-this.activeTabIndex);
11655
- break;
11656
- case keyEnd:
11657
- event.preventDefault();
11658
- this.adjust(this.tabs.filter(t => isFocusableElement(t)).length - this.activeTabIndex - 1);
11659
- break;
11660
- }
11813
+ this.change = () => {
11814
+ this.$emit("change", this.activetab);
11661
11815
  };
11662
11816
  this.elementInternals.role = "tablist";
11663
11817
  this.elementInternals.ariaOrientation = this.orientation ?? TablistOrientation.horizontal;
11664
11818
  }
11665
- /**
11666
- * Handles disabled changes
11667
- * @param prev - previous value
11668
- * @param next - next value
11669
- *
11670
- * @internal
11671
- */
11819
+ /** @internal */
11672
11820
  disabledChanged(prev, next) {
11673
- toggleState(this.elementInternals, "disabled", next);
11674
- this.setTabs();
11821
+ if (this.elementInternals) {
11822
+ toggleState(this.elementInternals, "disabled", next);
11823
+ }
11824
+ this.setTabs({
11825
+ forceDisabled: true
11826
+ });
11675
11827
  }
11676
- /**
11677
- * @internal
11678
- */
11679
11828
  orientationChanged(prev, next) {
11680
11829
  if (this.elementInternals) {
11681
11830
  this.elementInternals.ariaOrientation = next ?? TablistOrientation.horizontal;
@@ -11683,54 +11832,56 @@ class BaseTablist extends FASTElement {
11683
11832
  }
11684
11833
  this.setTabs();
11685
11834
  }
11686
- /**
11687
- * @internal
11688
- */
11835
+ /** @internal */
11689
11836
  activeidChanged(oldValue, newValue) {
11690
11837
  if (this.tabs?.length > 0) {
11691
- this.prevActiveTabIndex = this.tabs.findIndex(item => item.id === oldValue);
11692
- this.setTabs();
11693
- if (oldValue) {
11694
- const prevActiveTab = this.tabs[this.prevActiveTabIndex];
11695
- const prevActivePanel = this.tabPanelMap.get(prevActiveTab);
11696
- if (prevActivePanel) {
11697
- prevActivePanel.hidden = true;
11698
- }
11699
- }
11700
- if (newValue && this.activetab) {
11701
- const activePanel = this.tabPanelMap.get(this.activetab);
11702
- if (activePanel) {
11703
- activePanel.hidden = false;
11704
- }
11705
- }
11706
- if (oldValue !== newValue) {
11707
- this.change();
11708
- }
11838
+ this.changeTab(oldValue, newValue);
11709
11839
  }
11710
11840
  }
11711
- /**
11712
- * Updates the tabs property when content in the tabs slot changes.
11713
- * @internal
11714
- */
11841
+ /** @internal */
11715
11842
  slottedTabsChanged(prev, next) {
11716
11843
  this.tabs = next?.filter(tab => isTab(tab)) ?? [];
11717
11844
  }
11718
- /**
11719
- * @internal
11720
- */
11845
+ /** @internal */
11721
11846
  tabsChanged(prev, next) {
11722
- if (prev?.length) {
11723
- prev.forEach(tab => {
11724
- tab.removeEventListener("click", this.handleTabClick);
11725
- tab.removeEventListener("keydown", this.handleTabKeyDown);
11847
+ if (this.tabs?.length > 0) {
11848
+ this.setTabs({
11849
+ connectToPanel: true
11726
11850
  });
11727
11851
  }
11728
- if (this.tabs.length > 0) {
11729
- this.tabIds = this.getTabIds();
11730
- this.setTabs();
11731
- for (const tab of this.tabs) {
11852
+ }
11853
+ /**
11854
+ * Function that is invoked whenever the selected tab or the tab collection changes.
11855
+ */
11856
+ setTabs({
11857
+ connectToPanel = false,
11858
+ forceDisabled = false
11859
+ } = {}) {
11860
+ if (!this.tabs) {
11861
+ return;
11862
+ }
11863
+ const hasStartSlot = this.tabs.some(tab => !!tab.querySelector("[slot='start']"));
11864
+ const rootNode = this.getRootNode();
11865
+ let firstEnabledTabId = "";
11866
+ for (const tab of this.tabs) {
11867
+ if (tab.slot !== "tab") {
11868
+ continue;
11869
+ }
11870
+ tab.id || (tab.id = uniqueId$1("tab-"));
11871
+ if (forceDisabled) {
11872
+ tab.disabled = this.disabled;
11873
+ } else {
11874
+ tab.disabled = tab.disabled || this.disabled;
11875
+ }
11876
+ if (!firstEnabledTabId && !tab.disabled) {
11877
+ firstEnabledTabId = tab.id;
11878
+ }
11879
+ const isSelected = this.activeid === tab.id;
11880
+ tab.toggleAttribute("focusgroupstart", isSelected);
11881
+ tab.setAttribute("aria-selected", isSelected.toString());
11882
+ tab.toggleAttribute("data-hasIndent", hasStartSlot && this.orientation === TablistOrientation.vertical);
11883
+ if (connectToPanel) {
11732
11884
  const ariaControls = tab.getAttribute("aria-controls") ?? "";
11733
- const rootNode = this.getRootNode();
11734
11885
  const panel = rootNode.getElementById(ariaControls);
11735
11886
  if (ariaControls && panel) {
11736
11887
  panel.role ?? (panel.role = "tabpanel");
@@ -11739,84 +11890,43 @@ class BaseTablist extends FASTElement {
11739
11890
  }
11740
11891
  }
11741
11892
  }
11893
+ if (!this.disabled) {
11894
+ if (this.activeid) {
11895
+ this.changeTab(void 0, this.activeid);
11896
+ } else if (firstEnabledTabId) {
11897
+ this.activeid = firstEnabledTabId;
11898
+ }
11899
+ }
11742
11900
  }
11743
- getActiveIndex() {
11744
- const id = this.activeid;
11745
- if (id !== void 0) {
11746
- return this.tabIds.indexOf(this.activeid) === -1 ? 0 : this.tabIds.indexOf(this.activeid);
11747
- } else {
11748
- return 0;
11901
+ /** @internal */
11902
+ handleFocusIn(event) {
11903
+ const target = event.target;
11904
+ if (!isTab(target) || target.disabled) {
11905
+ return;
11749
11906
  }
11907
+ this.activeid = target.id;
11750
11908
  }
11751
- /**
11752
- * Function that is invoked whenever the selected tab or the tab collection changes.
11753
- *
11754
- * @public
11755
- */
11756
- setTabs() {
11757
- this.activeTabIndex = this.getActiveIndex();
11758
- const hasStartSlot = this.tabs?.some(tab => !!tab.querySelector("[slot='start']"));
11759
- this.tabs?.forEach((tab, index) => {
11760
- if (tab.slot === "tab") {
11761
- const isActiveTab = this.activeTabIndex === index && isFocusableElement(tab);
11762
- const tabId = this.tabIds[index];
11763
- if (!tab.disabled) {
11764
- this.disabled ? tab.setAttribute("aria-disabled", "true") : tab.removeAttribute("aria-disabled");
11765
- }
11766
- tab.setAttribute("id", tabId);
11767
- tab.setAttribute("aria-selected", isActiveTab ? "true" : "false");
11768
- tab.addEventListener("click", this.handleTabClick);
11769
- tab.addEventListener("keydown", this.handleTabKeyDown);
11770
- tab.setAttribute("tabindex", isActiveTab && !this.disabled ? "0" : "-1");
11771
- if (isActiveTab) {
11772
- this.activetab = tab;
11773
- this.activeid = tabId;
11774
- }
11775
- if (hasStartSlot && this.orientation === TablistOrientation.vertical) {
11776
- tab.setAttribute("data-hasIndent", "");
11777
- }
11909
+ changeTab(oldId, newId) {
11910
+ const rootNode = this.getRootNode();
11911
+ const prevTab = oldId ? rootNode.getElementById(oldId) : null;
11912
+ const nextTab = rootNode.getElementById(newId);
11913
+ if (!isTab(nextTab) || !this.contains(nextTab)) {
11914
+ return;
11915
+ }
11916
+ if (prevTab) {
11917
+ prevTab.setAttribute("aria-selected", "false");
11918
+ const prevPanel = this.tabPanelMap.get(prevTab);
11919
+ if (prevPanel) {
11920
+ prevPanel.hidden = true;
11778
11921
  }
11779
- });
11780
- }
11781
- getTabIds() {
11782
- return this.tabs?.map(tab => {
11783
- return tab.getAttribute("id") ?? `tab-${uniqueId$1()}`;
11784
- }) ?? [];
11785
- }
11786
- setComponent() {
11787
- if (this.activeTabIndex !== this.prevActiveTabIndex) {
11788
- this.activeid = this.tabIds[this.activeTabIndex];
11789
- this.focusTab();
11790
11922
  }
11791
- }
11792
- isHorizontal() {
11793
- return this.orientation === TablistOrientation.horizontal;
11794
- }
11795
- /**
11796
- * The adjust method for FASTTabs
11797
- * @public
11798
- * @remarks
11799
- * This method allows the active index to be adjusted by numerical increments
11800
- */
11801
- adjust(adjustment) {
11802
- const focusableTabs = this.tabs.filter(t => isFocusableElement(t));
11803
- const currentActiveTabIndex = focusableTabs.indexOf(this.activetab);
11804
- const nextTabIndex = wrapInBounds(0, focusableTabs.length - 1, currentActiveTabIndex + adjustment);
11805
- const nextIndex = this.tabs.indexOf(focusableTabs[nextTabIndex]);
11806
- if (nextIndex > -1) {
11807
- this.activateTabByIndex(this.tabs, nextIndex);
11808
- }
11809
- }
11810
- activateTabByIndex(group, index) {
11811
- const tab = group[index];
11812
- this.activetab = tab;
11813
- this.prevActiveTabIndex = this.activeTabIndex;
11814
- this.activeTabIndex = index;
11815
- tab.focus();
11816
- this.setComponent();
11817
- }
11818
- focusTab() {
11819
- this.tabs[this.activeTabIndex].focus();
11923
+ nextTab.setAttribute("aria-selected", "true");
11924
+ const nextPanel = this.tabPanelMap.get(nextTab);
11925
+ if (nextPanel) {
11926
+ nextPanel.hidden = false;
11927
+ }
11928
+ this.activetab = nextTab;
11929
+ this.change();
11820
11930
  }
11821
11931
  /**
11822
11932
  * @internal
@@ -11824,7 +11934,6 @@ class BaseTablist extends FASTElement {
11824
11934
  connectedCallback() {
11825
11935
  super.connectedCallback();
11826
11936
  waitForConnectedDescendants(this, () => {
11827
- this.tabIds = this.getTabIds();
11828
11937
  this.setTabs();
11829
11938
  }, {
11830
11939
  shallow: true
@@ -11850,154 +11959,41 @@ var __decorateClass$b = (decorators, target, key, kind) => {
11850
11959
  class Tablist extends BaseTablist {
11851
11960
  constructor() {
11852
11961
  super(...arguments);
11853
- /**
11854
- * activeTabData
11855
- * The positional coordinates and size dimensions of the active tab. Used for calculating the offset and scale of the tab active indicator.
11856
- */
11857
- this.activeTabData = {
11858
- x: 0,
11859
- y: 0,
11860
- height: 0,
11861
- width: 0
11862
- };
11863
- /**
11864
- * previousActiveTabData
11865
- * The positional coordinates and size dimensions of the active tab. Used for calculating the offset and scale of the tab active indicator.
11866
- */
11867
- this.previousActiveTabData = {
11868
- x: 0,
11869
- y: 0,
11870
- height: 0,
11871
- width: 0
11872
- };
11873
- /**
11874
- * activeTabOffset
11875
- * Used to position the active indicator for animations of the active indicator on active tab changes.
11876
- */
11877
- this.activeTabOffset = 0;
11878
- /**
11879
- * activeTabScale
11880
- * Used to scale the tab active indicator up or down as animations of the active indicator occur.
11881
- */
11882
- this.activeTabScale = 1;
11883
11962
  this.appearance = TablistAppearance.transparent;
11884
11963
  }
11885
- /**
11886
- * calculateAnimationProperties
11887
- *
11888
- * Recalculates the active tab offset and scale.
11889
- * These values will be applied to css variables that control the tab active indicator position animations
11890
- */
11891
- calculateAnimationProperties(tab) {
11892
- this.activeTabOffset = this.getTabPosition(tab);
11893
- this.activeTabScale = this.getTabScale(tab);
11894
- }
11895
- /**
11896
- * getSelectedTabPosition - gets the x or y coordinates of the tab
11897
- */
11898
- getTabPosition(tab) {
11899
- if (this.orientation === TablistOrientation.horizontal) {
11900
- return this.previousActiveTabData.x - (tab.getBoundingClientRect().x - this.getBoundingClientRect().x);
11901
- } else return this.previousActiveTabData.y - (tab.getBoundingClientRect().y - this.getBoundingClientRect().y);
11902
- }
11903
- /**
11904
- * getSelectedTabScale - gets the scale of the tab
11905
- */
11906
- getTabScale(tab) {
11907
- if (this.orientation === TablistOrientation.horizontal) {
11908
- return this.previousActiveTabData.width / tab.getBoundingClientRect().width;
11909
- } else return this.previousActiveTabData.height / tab.getBoundingClientRect().height;
11910
- }
11911
- /**
11912
- * Calculates and applies updated values to CSS variables.
11913
- *
11914
- * @param tab - the tab element to apply the updated values to
11915
- * @internal
11916
- */
11917
- applyUpdatedCSSValues(tab) {
11918
- this.calculateAnimationProperties(tab);
11919
- this.setAnimationVars();
11920
- }
11921
- /**
11922
- * Runs through all the operations required for setting the tab active indicator to its starting location, ending
11923
- * location, and applying the animated css class to the tab.
11924
- *
11925
- * @param tab - the tab element to apply the updated values to
11926
- * @internal
11927
- */
11928
- animationLoop(tab) {
11929
- tab.setAttribute("data-animate", "false");
11930
- this.applyUpdatedCSSValues(tab);
11931
- this.previousActiveTabData = this.activeTabData;
11932
- this.applyUpdatedCSSValues(tab);
11933
- tab.setAttribute("data-animate", "true");
11934
- }
11935
- /**
11936
- * Sets the data from the active tab onto the class. used for making all the animation calculations for the active
11937
- * tab indicator.
11938
- *
11939
- * @internal
11940
- */
11941
- setTabData() {
11942
- if (this.tabs && this.tabs.length > 0) {
11943
- const tabs = this.tabs;
11944
- const activeTab = this.activetab || tabs[0];
11945
- const activeRect = activeTab?.getBoundingClientRect();
11946
- const parentRect = this.getBoundingClientRect();
11947
- this.activeTabData = {
11948
- x: activeRect.x - parentRect.x,
11949
- y: activeRect.y - parentRect.y,
11950
- height: activeRect.height,
11951
- width: activeRect.width
11952
- };
11953
- if (this.previousActiveTabData?.x !== this.activeTabData?.x && this.previousActiveTabData?.y !== this.activeTabData?.y) {
11954
- this.previousActiveTabData = this.activeTabData;
11955
- }
11956
- }
11957
- }
11958
- /**
11959
- * Sets the css variables for the active tab indicator.
11960
- * @internal
11961
- */
11962
- setAnimationVars() {
11963
- this.style.setProperty("--tabIndicatorOffset", `${this.activeTabOffset}px`);
11964
- this.style.setProperty("--tabIndicatorScale", `${this.activeTabScale}`);
11965
- }
11966
- /**
11967
- * Initiates the active tab indicator animation loop when activeid changes.
11968
- * @param oldValue - the previous tabId
11969
- * @param newValue - the new tabId
11970
- */
11971
- activeidChanged(oldValue, newValue) {
11972
- super.activeidChanged(oldValue, newValue);
11973
- this.setTabData();
11974
- if (this.activetab) {
11975
- this.animationLoop(this.activetab);
11976
- }
11964
+ disconnectedCallback() {
11965
+ this.fg?.disconnect();
11966
+ super.disconnectedCallback();
11977
11967
  }
11978
- /**
11979
- * Initiates the active tab indicator animation loop when tabs change.
11980
- */
11981
11968
  tabsChanged(prev, next) {
11982
11969
  super.tabsChanged(prev, next);
11983
- this.setTabData();
11984
- if (this.activetab) {
11985
- this.animationLoop(this.activetab);
11970
+ this.fgItems ?? (this.fgItems = new ArrayItemCollection(() => this.tabs?.filter(t => (t.getAttribute("aria-selected") === "true" || !t.disabled) && !t.hidden) ?? [], () => this.activetab ?? null));
11971
+ if (!this.fg) {
11972
+ this.fg = new FocusGroup(this, this.fgItems, {
11973
+ definition: {
11974
+ behavior: "tablist",
11975
+ axis: void 0,
11976
+ memory: false,
11977
+ wrap: true
11978
+ }
11979
+ });
11980
+ } else {
11981
+ this.fg.update();
11986
11982
  }
11987
11983
  }
11988
11984
  }
11989
11985
  __decorateClass$b([attr], Tablist.prototype, "appearance", 2);
11990
11986
  __decorateClass$b([attr], Tablist.prototype, "size", 2);
11991
11987
 
11992
- const template$7 = html`<template role="tablist"><slot name="tab" ${slotted("slottedTabs")}></slot></template>`;
11988
+ const template$7 = html`<template role="tablist" focusgroup="tablist inline block" @focusin="${(x, c) => x.handleFocusIn(c.event)}"><slot name="tab" ${slotted("slottedTabs")}></slot></template>`;
11993
11989
 
11994
11990
  const styles$7 = css`
11995
11991
  ${display("flex")}
11996
11992
 
11997
- :host{--tabPaddingInline:inherit;--tabPaddingBlock:inherit;--tabIndicatorInsetInline:0;--tabIndicatorInsetBlock:0;box-sizing:border-box;color:${colorNeutralForeground2};flex-direction:row}:host([orientation='vertical']){flex-direction:column}:host([orientation='vertical']) ::slotted([role='tab']){justify-content:flex-start}:host ::slotted([slot='tab'][data-animate='true'])::after{transition-property:transform;transition-duration:${durationSlow};transition-timing-function:${curveDecelerateMax}}:host ::slotted([slot='tab'])::after{height:${strokeWidthThicker};margin-block-start:auto;transform-origin:left;transform:translateX(var(--tabIndicatorOffset)) scaleX(var(--tabIndicatorScale))}:host([orientation='vertical']) ::slotted([slot='tab'])::after{width:${strokeWidthThicker};height:unset;margin-block-start:unset;transform-origin:top;transform:translateY(var(--tabIndicatorOffset)) scaleY(var(--tabIndicatorScale))}:host ::slotted([slot='tab'])::before{height:${strokeWidthThicker};border-radius:${borderRadiusCircular};content:'';inset-inline:var(--tabIndicatorInsetInline);inset-block:var(--tabIndicatorInsetBlock);position:absolute;margin-top:auto}:host ::slotted([slot='tab'])::before{inset-inline:var(--tabIndicatorInsetInline);inset-block:var(--tabIndicatorInsetBlock)}:host ::slotted([slot='tab'][aria-selected='true'])::before{background-color:${colorNeutralForegroundDisabled}}:host ::slotted([slot='tab'][aria-selected='false']:hover)::after{height:${strokeWidthThicker};margin-block-start:auto;transform-origin:left}:host([orientation='vertical']) ::slotted([slot='tab'])::before,:host([orientation='vertical']) ::slotted([slot='tab'][aria-selected='false']:hover)::after{height:unset;width:${strokeWidthThicker};margin-inline-end:auto;transform-origin:top}:host(:where([size='small'],[size='large'])) ::slotted([slot='tab']){padding-inline:var(--tabPaddingInline);padding-block:var(--tabPaddingBlock)}:host([size='small']) ::slotted([slot='tab']){--tabPaddingBlock:${spacingVerticalSNudge};--tabPaddingInline:${spacingHorizontalSNudge};font-size:${fontSizeBase300};line-height:${lineHeightBase300}}:host([size='large']) ::slotted([slot='tab']){--tabPaddingBlock:${spacingVerticalL};--tabPaddingInline:${spacingHorizontalMNudge};font-size:${fontSizeBase400};line-height:${lineHeightBase400}}:host ::slotted([slot='tab'])::after,:host ::slotted([slot='tab'])::before,:host ::slotted([slot='tab']:hover)::after{inset-inline:var(--tabIndicatorInsetInline)}:host ::slotted([slot='tab']){--tabIndicatorInsetInline:${spacingHorizontalMNudge}}:host([size='small']) ::slotted([slot='tab']){--tabIndicatorInsetInline:${spacingHorizontalSNudge}}:host([size='large']) ::slotted([slot='tab']){--tabIndicatorInsetInline:${spacingHorizontalMNudge}}:host([orientation='vertical']) ::slotted([slot='tab']){padding-block:var(--tabPaddingBlock)}:host([orientation='vertical']) ::slotted([slot='tab']){--tabPaddingBlock:${spacingVerticalS}}:host([orientation='vertical'][size='small']) ::slotted([slot='tab']){--tabPaddingBlock:${spacingVerticalXXS}}:host([orientation='vertical'][size='large']) ::slotted([slot='tab']){--tabPaddingBlock:${spacingVerticalS}}:host([orientation='vertical']) ::slotted([slot='tab'])::after,:host([orientation='vertical']) ::slotted([slot='tab'])::before,:host([orientation='vertical']) ::slotted([slot='tab']:hover)::after{inset-inline:0;inset-block:var(--tabIndicatorInsetBlock)}:host([orientation='vertical']){--tabIndicatorInsetBlock:${spacingVerticalS}}:host([orientation='vertical'][size='small']){--tabIndicatorInsetBlock:${spacingVerticalSNudge}}:host([orientation='vertical'][size='large']){--tabIndicatorInsetBlock:${spacingVerticalMNudge}}:host([disabled]){cursor:not-allowed;color:${colorNeutralForegroundDisabled}}:host([disabled]) ::slotted([slot='tab']){pointer-events:none;cursor:not-allowed;color:${colorNeutralForegroundDisabled}}:host([disabled]) ::slotted([slot='tab']:after){background-color:${colorNeutralForegroundDisabled}}:host([disabled]) ::slotted([slot='tab'][aria-selected='true'])::after{background-color:${colorNeutralForegroundDisabled}}:host([disabled]) ::slotted([slot='tab']:hover):before{content:unset}:host([appearance='subtle']) ::slotted([slot='tab']:hover){background-color:${colorSubtleBackgroundHover};color:${colorNeutralForeground1Hover};fill:${colorCompoundBrandForeground1Hover}}:host([appearance='subtle']) ::slotted([slot='tab']:active){background-color:${colorSubtleBackgroundPressed};fill:${colorSubtleBackgroundPressed};color:${colorNeutralForeground1}}`;
11993
+ :host{--tabPaddingInline:${spacingHorizontalMNudge};--tabPaddingBlock:${spacingHorizontalM};--tabIndicatorInsetInline:var(--tabPaddingInline);--tabIndicatorInsetBlock:0;box-sizing:border-box;color:${colorNeutralForeground2};flex-direction:row;position:relative}:host([size='small']){--tabPaddingBlock:${spacingVerticalSNudge};--tabPaddingInline:${spacingHorizontalSNudge}}:host([size='large']){--tabPaddingBlock:${spacingVerticalL};--tabPaddingInline:${spacingHorizontalMNudge}}:host([orientation='vertical']){--tabPaddingBlock:${spacingVerticalS};--tabIndicatorInsetBlock:${spacingVerticalS};flex-direction:column}:host([orientation='vertical'][size='small']){--tabPaddingBlock:${spacingVerticalXXS};--tabIndicatorInsetBlock:${spacingVerticalSNudge}}:host([orientation='vertical'][size='large']){--tabPaddingBlock:${spacingVerticalS};--tabIndicatorInsetBlock:${spacingVerticalMNudge}}::slotted([slot='tab']){padding-inline:var(--tabPaddingInline);padding-block:var(--tabPaddingBlock)}:host([orientation='vertical']) ::slotted([role='tab']){justify-content:flex-start}:host ::slotted([slot='tab'])::after{height:${strokeWidthThicker};margin-block-start:auto}:host([orientation='vertical']) ::slotted([slot='tab'])::after{width:${strokeWidthThicker};height:unset;margin-block-start:unset}:host ::slotted([slot='tab'])::before{height:${strokeWidthThicker};border-radius:${borderRadiusCircular};content:'';inset-inline:var(--tabIndicatorInsetInline);inset-block:var(--tabIndicatorInsetBlock);position:absolute;margin-top:auto}:host ::slotted([slot='tab'])::before{inset-inline:var(--tabIndicatorInsetInline);inset-block:var(--tabIndicatorInsetBlock)}:host ::slotted([slot='tab'][aria-selected='true'])::before{background-color:${colorNeutralForegroundDisabled}}:host ::slotted([slot='tab'][aria-selected='false']:hover)::after{height:${strokeWidthThicker};margin-block-start:auto;transform-origin:left}:host([orientation='vertical']) ::slotted([slot='tab'])::before,:host([orientation='vertical']) ::slotted([slot='tab'][aria-selected='false']:hover)::after{height:unset;width:${strokeWidthThicker};margin-inline-end:auto;transform-origin:top}:host([size='small']) ::slotted([slot='tab']){font-size:${fontSizeBase300};line-height:${lineHeightBase300}}:host([size='large']) ::slotted([slot='tab']){font-size:${fontSizeBase400};line-height:${lineHeightBase400}}:host ::slotted([slot='tab'])::after,:host ::slotted([slot='tab'])::before,:host ::slotted([slot='tab']:hover)::after{inset-inline:var(--tabIndicatorInsetInline)}:host([orientation='vertical']) ::slotted([slot='tab'])::after,:host([orientation='vertical']) ::slotted([slot='tab'])::before,:host([orientation='vertical']) ::slotted([slot='tab']:hover)::after{inset-inline:0;inset-block:var(--tabIndicatorInsetBlock)}:host([disabled]){cursor:not-allowed;color:${colorNeutralForegroundDisabled}}:host([disabled]) ::slotted([slot='tab']){pointer-events:none;cursor:not-allowed;color:${colorNeutralForegroundDisabled}}:host([disabled]) ::slotted([slot='tab']:after){background-color:${colorNeutralForegroundDisabled}}:host([disabled]) ::slotted([slot='tab'][aria-selected='true'])::after{background-color:${colorNeutralForegroundDisabled}}:host([disabled]) ::slotted([slot='tab']:hover):before{content:unset}:host([appearance='subtle']) ::slotted([slot='tab']:hover){background-color:${colorSubtleBackgroundHover};color:${colorNeutralForeground1Hover};fill:${colorCompoundBrandForeground1Hover}}:host([appearance='subtle']) ::slotted([slot='tab']:active){background-color:${colorSubtleBackgroundPressed};fill:${colorSubtleBackgroundPressed};color:${colorNeutralForeground1}}@supports (anchor-name:--a) and (text-size-adjust:auto){::slotted([slot='tab'][aria-selected='true']){anchor-name:--tab}:host::after{background-color:${colorCompoundBrandStroke};content:'';inline-size:100%;inset:auto auto anchor(end) anchor(center);position:absolute;position-anchor:--tab;transform:translateX(-50%);transition-property:inset-inline,width;transition-duration:${durationSlow};transition-timing-function:${curveDecelerateMax};z-index:3;border-radius:${borderRadiusCircular};width:calc(anchor-size() - var(--tabIndicatorInsetInline) * 2);height:${strokeWidthThicker}}:host([orientation='vertical'])::after{inset:anchor(center) anchor(end) auto 0;transform:translateY(-50%);transition-property:inset-block,height;width:${strokeWidthThicker};height:calc(anchor-size() - var(--tabIndicatorInsetBlock) * 2)}:host(:dir(rtl)[orientation='vertical'])::after{inset:anchor(center) anchor(start) auto 0}:host([disabled])::after{background-color:${colorNeutralForegroundDisabled}}}`;
11998
11994
 
11999
11995
  const definition$7 = Tablist.compose({
12000
- name: `${FluentDesignSystem.prefix}-tablist`,
11996
+ name: tagName$7,
12001
11997
  template: template$7,
12002
11998
  styles: styles$7
12003
11999
  });
@@ -12015,6 +12011,9 @@ const TextAreaResize = {
12015
12011
  horizontal: "horizontal",
12016
12012
  vertical: "vertical"
12017
12013
  };
12014
+ const tagName$6 = `${FluentDesignSystem.prefix}-textarea`;
12015
+
12016
+ const whitespaceFilter = value => value.nodeType !== Node.TEXT_NODE || !!value.nodeValue?.trim().length;
12018
12017
 
12019
12018
  var __defProp$a = Object.defineProperty;
12020
12019
  var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
@@ -12505,8 +12504,7 @@ __decorateClass$9([attr], TextArea.prototype, "size", 2);
12505
12504
  const styles$6 = css`
12506
12505
  ${display("inline-block")}
12507
12506
 
12508
- :host{--font-size:${fontSizeBase300};--line-height:${lineHeightBase300};--padding-inline:${spacingHorizontalMNudge};--padding-block:${spacingVerticalSNudge};--min-block-size:52px;--block-size:var(--min-block-size);--inline-size:18rem;--border-width:${strokeWidthThin};--control-padding-inline:${spacingHorizontalXXS};--color:${colorNeutralForeground1};--background-color:${colorNeutralBackground1};--border-color:${colorNeutralStroke1};--border-block-end-color:${colorNeutralStrokeAccessible};--placeholder-color:${colorNeutralForeground4};--focus-indicator-color:${colorCompoundBrandStroke};--box-shadow:none;--contain-size:size;--resize:none;color:var(--color);font-family:${fontFamilyBase};font-size:var(--font-size);font-weight:${fontWeightRegular};line-height:var(--line-height);position:relative}:host(:hover){--border-color:${colorNeutralStroke1Hover};--border-block-end-color:${colorNeutralStrokeAccessibleHover}}:host(:active){--border-color:${colorNeutralStroke1Pressed};--border-block-end-color:${colorNeutralStrokeAccessiblePressed}}:host(:focus-within){outline:none}:host([block]:not([hidden])){display:block}:host([size='small']){--font-size:${fontSizeBase200};--line-height:${lineHeightBase200};--min-block-size:40px;--padding-block:${spacingVerticalXS};--padding-inline:${spacingHorizontalSNudge};--control-padding-inline:${spacingHorizontalXXS}}:host([size='large']){--font-size:${fontSizeBase400};--line-height:${lineHeightBase400};--min-block-size:64px;--padding-block:${spacingVerticalS};--padding-inline:${spacingHorizontalM};--control-padding-inline:${spacingHorizontalSNudge}}:host([resize='both']:not(:disabled)){--resize:both}:host([resize='horizontal']:not(:disabled)){--resize:horizontal}:host([resize='vertical']:not(:disabled)){--resize:vertical}:host([auto-resize]){--block-size:auto;--contain-size:inline-size}:host([appearance='filled-darker']){--background-color:${colorNeutralBackground3};--border-color:var(--background-color);--border-block-end-color:var(--border-color)}:host([appearance='filled-lighter']){--border-color:var(--background-color);--border-block-end-color:var(--border-color)}:host([appearance='filled-darker'][display-shadow]),:host([appearance='filled-lighter'][display-shadow]){--box-shadow:${shadow2}}:host(${userInvalidState}){--border-color:${colorPaletteRedBorder2};--border-block-end-color:${colorPaletteRedBorder2}}:host(:disabled){--color:${colorNeutralForegroundDisabled};--background-color:${colorTransparentBackground};--border-color:${colorNeutralStrokeDisabled};--border-block-end-color:var(--border-color);--box-shadow:none;--placeholder-color:${colorNeutralForegroundDisabled};cursor:no-drop;user-select:none}.root{background-color:var(--background-color);border:var(--border-width) solid var(--border-color);border-block-end-color:var(--border-block-end-color);border-radius:${borderRadiusMedium};box-sizing:border-box;box-shadow:var(--box-shadow);contain:paint layout style var(--contain-size);display:grid;grid-template:1fr / 1fr;inline-size:var(--inline-size);min-block-size:var(--min-block-size);block-size:var(--block-size);overflow:hidden;padding:var(--padding-block) var(--padding-inline);position:relative;resize:var(--resize)}:host([block]) .root{inline-size:auto}.root::after{border-bottom:2px solid var(--focus-indicator-color);border-radius:0 0 ${borderRadiusMedium} ${borderRadiusMedium};box-sizing:border-box;clip-path:inset(calc(100% - 2px) 1px 0px);content:'';height:max(2px,${borderRadiusMedium});inset:auto -1px 0;position:absolute;transform:scaleX(0);transition-delay:${curveAccelerateMid};transition-duration:${durationUltraFast};transition-property:transform}:host(:focus-within) .root::after{transform:scaleX(1);transition-property:transform;transition-duration:${durationNormal};transition-delay:${curveDecelerateMid}}:host([readonly]) .root::after,:host(:disabled) .root::after{content:none}label{color:var(--color);display:flex;inline-size:fit-content;padding-block-end:${spacingVerticalXS};padding-inline-end:${spacingHorizontalXS}}:host(:empty) label,label[hidden]{display:none}.auto-sizer,.control{box-sizing:border-box;font:inherit;grid-column:1 / -1;grid-row:1 / -1;letter-space:inherit;padding:0 var(--control-padding-inline)}.auto-sizer{display:none;padding-block-end:2px;pointer-events:none;visibility:hidden;white-space:pre-wrap}:host([auto-resize]) .auto-sizer{display:block}.control{appearance:none;background-color:transparent;border:0;color:inherit;field-sizing:content;max-block-size:100%;outline:0;resize:none;text-align:inherit}.control:disabled{cursor:inherit}.control::placeholder{color:var(--placeholder-color)}::selection{color:${colorNeutralForegroundInverted};background-color:${colorNeutralBackgroundInverted}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
12509
- :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}`));
12507
+ :host{--font-size:${fontSizeBase300};--line-height:${lineHeightBase300};--padding-inline:${spacingHorizontalMNudge};--padding-block:${spacingVerticalSNudge};--min-block-size:52px;--block-size:var(--min-block-size);--inline-size:18rem;--border-width:${strokeWidthThin};--control-padding-inline:${spacingHorizontalXXS};--color:${colorNeutralForeground1};--background-color:${colorNeutralBackground1};--border-color:${colorNeutralStroke1};--border-block-end-color:${colorNeutralStrokeAccessible};--placeholder-color:${colorNeutralForeground4};--focus-indicator-color:${colorCompoundBrandStroke};--box-shadow:none;--contain-size:size;--resize:none;color:var(--color);font-family:${fontFamilyBase};font-size:var(--font-size);font-weight:${fontWeightRegular};line-height:var(--line-height);position:relative}:host(:hover){--border-color:${colorNeutralStroke1Hover};--border-block-end-color:${colorNeutralStrokeAccessibleHover}}:host(:active){--border-color:${colorNeutralStroke1Pressed};--border-block-end-color:${colorNeutralStrokeAccessiblePressed}}:host(:focus-within){outline:none}:host([block]:not([hidden])){display:block}:host([size='small']){--font-size:${fontSizeBase200};--line-height:${lineHeightBase200};--min-block-size:40px;--padding-block:${spacingVerticalXS};--padding-inline:${spacingHorizontalSNudge};--control-padding-inline:${spacingHorizontalXXS}}:host([size='large']){--font-size:${fontSizeBase400};--line-height:${lineHeightBase400};--min-block-size:64px;--padding-block:${spacingVerticalS};--padding-inline:${spacingHorizontalM};--control-padding-inline:${spacingHorizontalSNudge}}:host([resize='both']:not(:disabled)){--resize:both}:host([resize='horizontal']:not(:disabled)){--resize:horizontal}:host([resize='vertical']:not(:disabled)){--resize:vertical}:host([auto-resize]){--block-size:auto;--contain-size:inline-size}:host([appearance='filled-darker']){--background-color:${colorNeutralBackground3};--border-color:var(--background-color);--border-block-end-color:var(--border-color)}:host([appearance='filled-lighter']){--border-color:var(--background-color);--border-block-end-color:var(--border-color)}:host([appearance='filled-darker'][display-shadow]),:host([appearance='filled-lighter'][display-shadow]){--box-shadow:${shadow2}}:host(${userInvalidState}){--border-color:${colorPaletteRedBorder2};--border-block-end-color:${colorPaletteRedBorder2}}:host(:disabled){--color:${colorNeutralForegroundDisabled};--background-color:${colorTransparentBackground};--border-color:${colorNeutralStrokeDisabled};--border-block-end-color:var(--border-color);--box-shadow:none;--placeholder-color:${colorNeutralForegroundDisabled};cursor:no-drop;user-select:none}.root{background-color:var(--background-color);border:var(--border-width) solid var(--border-color);border-block-end-color:var(--border-block-end-color);border-radius:${borderRadiusMedium};box-sizing:border-box;box-shadow:var(--box-shadow);contain:paint layout style var(--contain-size);display:grid;grid-template:1fr / 1fr;inline-size:var(--inline-size);min-block-size:var(--min-block-size);block-size:var(--block-size);overflow:hidden;padding:var(--padding-block) var(--padding-inline);position:relative;resize:var(--resize)}:host([block]) .root{inline-size:auto}.root::after{border-bottom:2px solid var(--focus-indicator-color);border-radius:0 0 ${borderRadiusMedium} ${borderRadiusMedium};box-sizing:border-box;clip-path:inset(calc(100% - 2px) 1px 0px);content:'';height:max(2px,${borderRadiusMedium});inset:auto -1px 0;position:absolute;transform:scaleX(0);transition-delay:${curveAccelerateMid};transition-duration:${durationUltraFast};transition-property:transform}:host(:focus-within) .root::after{transform:scaleX(1);transition-property:transform;transition-duration:${durationNormal};transition-delay:${curveDecelerateMid}}:host([readonly]) .root::after,:host(:disabled) .root::after{content:none}label{color:var(--color);display:flex;inline-size:fit-content;padding-block-end:${spacingVerticalXS};padding-inline-end:${spacingHorizontalXS}}:host(:empty) label,label[hidden]{display:none}.auto-sizer,.control{box-sizing:border-box;font:inherit;grid-column:1 / -1;grid-row:1 / -1;letter-space:inherit;padding:0 var(--control-padding-inline)}.auto-sizer{display:none;padding-block-end:2px;pointer-events:none;visibility:hidden;white-space:pre-wrap}:host([auto-resize]) .auto-sizer{display:block}.control{appearance:none;background-color:transparent;border:0;color:inherit;field-sizing:content;max-block-size:100%;outline:0;resize:none;text-align:inherit}.control:disabled{cursor:inherit}.control::placeholder{color:var(--placeholder-color)}::selection{color:${colorNeutralForegroundInverted};background-color:${colorNeutralBackgroundInverted}}@media (forced-colors:active){: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}}`;
12510
12508
 
12511
12509
  function textAreaTemplate() {
12512
12510
  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>`;
@@ -12514,7 +12512,7 @@ function textAreaTemplate() {
12514
12512
  const template$6 = textAreaTemplate();
12515
12513
 
12516
12514
  const definition$6 = TextArea.compose({
12517
- name: `${FluentDesignSystem.prefix}-textarea`,
12515
+ name: tagName$6,
12518
12516
  template: template$6,
12519
12517
  styles: styles$6,
12520
12518
  shadowOptions: {
@@ -12532,6 +12530,7 @@ const TextInputType = {
12532
12530
  url: "url"
12533
12531
  };
12534
12532
  const ImplicitSubmissionBlockingTypes = ["date", "datetime-local", "email", "month", "number", "password", "search", "tel", "text", "time", "url", "week"];
12533
+ const tagName$5 = `${FluentDesignSystem.prefix}-text-input`;
12535
12534
 
12536
12535
  var __defProp$8 = Object.defineProperty;
12537
12536
  var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
@@ -12955,7 +12954,7 @@ function textInputTemplate(options = {}) {
12955
12954
  const template$5 = textInputTemplate();
12956
12955
 
12957
12956
  const definition$5 = TextInput.compose({
12958
- name: `${FluentDesignSystem.prefix}-text-input`,
12957
+ name: tagName$5,
12959
12958
  template: template$5,
12960
12959
  styles: styles$5,
12961
12960
  shadowOptions: {
@@ -12965,6 +12964,8 @@ const definition$5 = TextInput.compose({
12965
12964
 
12966
12965
  definition$5.define(FluentDesignSystem.registry);
12967
12966
 
12967
+ const tagName$4 = `${FluentDesignSystem.prefix}-text`;
12968
+
12968
12969
  var __defProp$6 = Object.defineProperty;
12969
12970
  var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
12970
12971
  var __decorateClass$6 = (decorators, target, key, kind) => {
@@ -13021,13 +13022,15 @@ const styles$4 = css`
13021
13022
  const template$4 = html`<slot></slot>`;
13022
13023
 
13023
13024
  const definition$4 = Text.compose({
13024
- name: `${FluentDesignSystem.prefix}-text`,
13025
+ name: tagName$4,
13025
13026
  template: template$4,
13026
13027
  styles: styles$4
13027
13028
  });
13028
13029
 
13029
13030
  definition$4.define(FluentDesignSystem.registry);
13030
13031
 
13032
+ const tagName$3 = `${FluentDesignSystem.prefix}-toggle-button`;
13033
+
13031
13034
  var __defProp$5 = Object.defineProperty;
13032
13035
  var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
13033
13036
  var __decorateClass$5 = (decorators, target, key, kind) => {
@@ -13090,21 +13093,36 @@ __decorateClass$5([attr({
13090
13093
  const styles$3 = css`
13091
13094
  ${styles$C}
13092
13095
 
13093
- :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`
13094
- :host(${pressedState}),:host(
13096
+ :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}}@media (forced-colors:active){:host(${pressedState}),:host(
13095
13097
  ${pressedState}:is([appearance='primary'],[appearance='subtle'],[appearance='outline'],[appearance='transparent'])
13096
- ){background:SelectedItem;color:SelectedItemText}`));
13098
+ ){background:SelectedItem;color:SelectedItemText}}`;
13097
13099
 
13098
13100
  const template$3 = buttonTemplate$1();
13099
13101
 
13100
13102
  const definition$3 = ToggleButton.compose({
13101
- name: `${FluentDesignSystem.prefix}-toggle-button`,
13103
+ name: tagName$3,
13102
13104
  template: template$3,
13103
13105
  styles: styles$3
13104
13106
  });
13105
13107
 
13106
13108
  definition$3.define(FluentDesignSystem.registry);
13107
13109
 
13110
+ const TooltipPositioningOption = {
13111
+ "above-start": "block-start span-inline-end",
13112
+ above: "block-start",
13113
+ "above-end": "block-start span-inline-start",
13114
+ "below-start": "block-end span-inline-end",
13115
+ below: "block-end",
13116
+ "below-end": "block-end span-inline-start",
13117
+ "before-top": "inline-start span-block-end",
13118
+ before: "inline-start",
13119
+ "before-bottom": "inline-start span-block-start",
13120
+ "after-top": "inline-end span-block-end",
13121
+ after: "inline-end",
13122
+ "after-bottom": "inline-end span-block-start"
13123
+ };
13124
+ const tagName$2 = `${FluentDesignSystem.prefix}-tooltip`;
13125
+
13108
13126
  var __defProp$4 = Object.defineProperty;
13109
13127
  var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
13110
13128
  var __decorateClass$4 = (decorators, target, key, kind) => {
@@ -13198,7 +13216,7 @@ class Tooltip extends FASTElement {
13198
13216
  }
13199
13217
  /**
13200
13218
  * Shows the tooltip
13201
- * @param delay Number of milliseconds to delay showing the tooltip
13219
+ * @param delay - Number of milliseconds to delay showing the tooltip
13202
13220
  * @internal
13203
13221
  */
13204
13222
  showTooltip(delay = this.defaultDelay) {
@@ -13209,7 +13227,7 @@ class Tooltip extends FASTElement {
13209
13227
  }
13210
13228
  /**
13211
13229
  * Hide the tooltip
13212
- * @param delay Number of milliseconds to delay hiding the tooltip
13230
+ * @param delay - Number of milliseconds to delay hiding the tooltip
13213
13231
  * @internal
13214
13232
  */
13215
13233
  hideTooltip(delay = this.defaultDelay) {
@@ -13283,21 +13301,6 @@ __decorateClass$4([attr({
13283
13301
  __decorateClass$4([attr], Tooltip.prototype, "positioning", 2);
13284
13302
  __decorateClass$4([attr], Tooltip.prototype, "anchor", 2);
13285
13303
 
13286
- const TooltipPositioningOption = {
13287
- "above-start": "block-start span-inline-end",
13288
- above: "block-start",
13289
- "above-end": "block-start span-inline-start",
13290
- "below-start": "block-end span-inline-end",
13291
- below: "block-end",
13292
- "below-end": "block-end span-inline-start",
13293
- "before-top": "inline-start span-block-end",
13294
- before: "inline-start",
13295
- "before-bottom": "inline-start span-block-start",
13296
- "after-top": "inline-end span-block-end",
13297
- after: "inline-end",
13298
- "after-bottom": "inline-end span-block-start"
13299
- };
13300
-
13301
13304
  const styles$2 = css`
13302
13305
  ${display("inline-flex")}
13303
13306
 
@@ -13306,13 +13309,15 @@ const styles$2 = css`
13306
13309
  const template$2 = html`<template popover aria-hidden="true"><slot></slot></template>`;
13307
13310
 
13308
13311
  const definition$2 = Tooltip.compose({
13309
- name: `${FluentDesignSystem.prefix}-tooltip`,
13312
+ name: tagName$2,
13310
13313
  template: template$2,
13311
13314
  styles: styles$2
13312
13315
  });
13313
13316
 
13314
13317
  definition$2.define(FluentDesignSystem.registry);
13315
13318
 
13319
+ const tagName$1 = `${FluentDesignSystem.prefix}-tree`;
13320
+
13316
13321
  const TreeItemAppearance = {
13317
13322
  subtle: "subtle",
13318
13323
  subtleAlpha: "subtle-alpha",
@@ -13322,12 +13327,13 @@ const TreeItemSize = {
13322
13327
  small: "small",
13323
13328
  medium: "medium"
13324
13329
  };
13325
- function isTreeItem(element, tagName = "-tree-item") {
13330
+ function isTreeItem(element, tagName2 = "-tree-item") {
13326
13331
  if (element?.nodeType !== Node.ELEMENT_NODE) {
13327
13332
  return false;
13328
13333
  }
13329
- return element.tagName.toLowerCase().endsWith(tagName);
13334
+ return element.tagName.toLowerCase().endsWith(tagName2);
13330
13335
  }
13336
+ const tagName = `${FluentDesignSystem.prefix}-tree-item`;
13331
13337
 
13332
13338
  var __defProp$3 = Object.defineProperty;
13333
13339
  var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
@@ -13341,12 +13347,6 @@ class BaseTree extends FASTElement {
13341
13347
  constructor() {
13342
13348
  super();
13343
13349
  this.currentSelected = null;
13344
- /**
13345
- * The tree item that is designated to be in the tab queue.
13346
- *
13347
- * @internal
13348
- */
13349
- this.currentFocused = null;
13350
13350
  /**
13351
13351
  * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
13352
13352
  *
@@ -13364,10 +13364,6 @@ class BaseTree extends FASTElement {
13364
13364
  defaultSlotChanged() {
13365
13365
  this.handleDefaultSlotChange();
13366
13366
  }
13367
- connectedCallback() {
13368
- super.connectedCallback();
13369
- this.tabIndex = Number(this.getAttribute("tabindex") ?? 0) < 0 ? -1 : 0;
13370
- }
13371
13367
  /** @internal */
13372
13368
  childTreeItemsChanged() {
13373
13369
  this.updateCurrentSelected();
@@ -13378,9 +13374,6 @@ class BaseTree extends FASTElement {
13378
13374
  updateCurrentSelected() {
13379
13375
  const selectedItem = this.querySelector(`[selected]`);
13380
13376
  this.currentSelected = selectedItem;
13381
- if (this.currentFocused === null || !this.contains(this.currentFocused)) {
13382
- this.currentFocused = this.getValidFocusableItem();
13383
- }
13384
13377
  }
13385
13378
  /**
13386
13379
  * KeyDown handler
@@ -13395,22 +13388,7 @@ class BaseTree extends FASTElement {
13395
13388
  if (!isTreeItem(item) || this.childTreeItems.length < 1) {
13396
13389
  return true;
13397
13390
  }
13398
- const elements = this.getVisibleNodes();
13399
13391
  switch (e.key) {
13400
- case keyHome:
13401
- {
13402
- if (elements.length) {
13403
- elements[0].focus();
13404
- }
13405
- return;
13406
- }
13407
- case keyEnd:
13408
- {
13409
- if (elements.length) {
13410
- elements[elements.length - 1].focus();
13411
- }
13412
- return;
13413
- }
13414
13392
  case keyArrowLeft:
13415
13393
  {
13416
13394
  if (item?.childTreeItems?.length && item.expanded) {
@@ -13425,22 +13403,10 @@ class BaseTree extends FASTElement {
13425
13403
  if (item?.childTreeItems?.length) {
13426
13404
  if (!item.expanded) {
13427
13405
  item.expanded = true;
13428
- } else {
13429
- this.focusNextNode(1, item);
13430
13406
  }
13431
13407
  }
13432
13408
  return;
13433
13409
  }
13434
- case keyArrowDown:
13435
- {
13436
- this.focusNextNode(1, item);
13437
- return;
13438
- }
13439
- case keyArrowUp:
13440
- {
13441
- this.focusNextNode(-1, item);
13442
- return;
13443
- }
13444
13410
  case keyEnter:
13445
13411
  {
13446
13412
  this.clickHandler(e);
@@ -13454,38 +13420,6 @@ class BaseTree extends FASTElement {
13454
13420
  }
13455
13421
  return true;
13456
13422
  }
13457
- /**
13458
- * Handle focus events
13459
- *
13460
- * @internal
13461
- */
13462
- focusHandler(e) {
13463
- if (this.childTreeItems.length < 1) {
13464
- return;
13465
- }
13466
- if (e.target === this) {
13467
- this.currentFocused = this.getValidFocusableItem();
13468
- if (this.currentFocused && this.currentFocused.tabIndex < 0) {
13469
- this.currentFocused.tabIndex = 0;
13470
- }
13471
- this.currentFocused?.focus();
13472
- return;
13473
- }
13474
- if (this.contains(e.target)) {
13475
- this.setAttribute("tabindex", "-1");
13476
- this.currentFocused = e.target;
13477
- }
13478
- }
13479
- /**
13480
- * Handle blur events
13481
- *
13482
- * @internal
13483
- */
13484
- blurHandler(e) {
13485
- if (e.target instanceof HTMLElement && (e.relatedTarget === null || !this.contains(e.relatedTarget))) {
13486
- this.setAttribute("tabindex", "0");
13487
- }
13488
- }
13489
13423
  /**
13490
13424
  * Handles click events bubbling up
13491
13425
  *
@@ -13525,40 +13459,28 @@ class BaseTree extends FASTElement {
13525
13459
  this.currentSelected = null;
13526
13460
  }
13527
13461
  }
13528
- /**
13529
- * checks if there are any nested tree items
13530
- */
13531
- getValidFocusableItem() {
13532
- const elements = this.getVisibleNodes();
13533
- let focusIndex = elements.findIndex(el => el.selected);
13534
- if (focusIndex === -1) {
13535
- focusIndex = elements.findIndex(el => isTreeItem(el));
13536
- }
13537
- if (focusIndex !== -1) {
13538
- return elements[focusIndex];
13539
- }
13540
- return null;
13541
- }
13542
- getVisibleNodes() {
13543
- return Array.from(this.querySelectorAll("*")).filter(node => isTreeItem(node) && node.offsetParent !== null);
13544
- }
13545
- /**
13546
- * Move focus to a tree item based on its offset from the provided item
13547
- */
13548
- focusNextNode(delta, item) {
13549
- const visibleNodes = this.getVisibleNodes();
13550
- if (!visibleNodes.length) {
13551
- return;
13552
- }
13553
- const focusItem = visibleNodes[visibleNodes.indexOf(item) + delta];
13554
- if (isHTMLElement(focusItem)) {
13555
- focusItem.focus();
13556
- }
13557
- }
13558
13462
  /** @internal */
13559
13463
  handleDefaultSlotChange() {
13560
13464
  this.childTreeItems = this.defaultSlot.assignedElements().filter(el => isTreeItem(el));
13561
13465
  }
13466
+ /**
13467
+ * All descendant tree items in DOM order, recursively flattened from
13468
+ * `childTreeItems`.
13469
+ */
13470
+ get descendantTreeItems() {
13471
+ const result = [];
13472
+ const visit = items => {
13473
+ if (!items) {
13474
+ return;
13475
+ }
13476
+ for (const item of items) {
13477
+ result.push(item);
13478
+ visit(item.childTreeItems);
13479
+ }
13480
+ };
13481
+ visit(this.childTreeItems);
13482
+ return result;
13483
+ }
13562
13484
  }
13563
13485
  __decorateClass$3([observable], BaseTree.prototype, "currentSelected", 2);
13564
13486
  __decorateClass$3([observable], BaseTree.prototype, "defaultSlot", 2);
@@ -13591,6 +13513,22 @@ class Tree extends BaseTree {
13591
13513
  childTreeItemsChanged() {
13592
13514
  super.childTreeItemsChanged();
13593
13515
  this.updateSizeAndAppearance();
13516
+ this.fgItems ?? (this.fgItems = new ArrayItemCollection(() => this.descendantTreeItems.filter(i => !i.isHidden), () => this.currentSelected ?? null));
13517
+ if (!this.fg) {
13518
+ this.fg = new FocusGroup(this, this.fgItems, {
13519
+ definition: {
13520
+ behavior: "menu",
13521
+ axis: "block",
13522
+ memory: false
13523
+ }
13524
+ });
13525
+ } else {
13526
+ this.fg.update();
13527
+ }
13528
+ }
13529
+ disconnectedCallback() {
13530
+ this.fg?.disconnect();
13531
+ super.disconnectedCallback();
13594
13532
  }
13595
13533
  /**
13596
13534
  * 1. Update the child items' size based on the tree's size
@@ -13605,6 +13543,10 @@ class Tree extends BaseTree {
13605
13543
  item.appearance = this.appearance;
13606
13544
  });
13607
13545
  }
13546
+ /** @internal */
13547
+ itemToggleHandler() {
13548
+ this.fg?.update();
13549
+ }
13608
13550
  }
13609
13551
  __decorateClass$2([attr], Tree.prototype, "size", 2);
13610
13552
  __decorateClass$2([attr], Tree.prototype, "appearance", 2);
@@ -13614,10 +13556,10 @@ const styles$1 = css`
13614
13556
 
13615
13557
  :host{outline:none}`;
13616
13558
 
13617
- const template$1 = html`<template tabindex="0" @click="${(x, c) => x.clickHandler(c.event)}" @focusin="${(x, c) => x.focusHandler(c.event)}" @focusout="${(x, c) => x.blurHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}" @change="${(x, c) => x.changeHandler(c.event)}"><slot ${ref("defaultSlot")} @slotchange="${x => x.handleDefaultSlotChange()}"></slot></template>`;
13559
+ const template$1 = html`<template focusgroup="menu nowrap nomemory" @click="${(x, c) => x.clickHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}" @change="${(x, c) => x.changeHandler(c.event)}" @toggle="${(x, c) => x.itemToggleHandler()}"><slot ${ref("defaultSlot")} @slotchange="${x => x.handleDefaultSlotChange()}"></slot></template>`;
13618
13560
 
13619
13561
  const definition$1 = Tree.compose({
13620
- name: `${FluentDesignSystem.prefix}-tree`,
13562
+ name: tagName$1,
13621
13563
  template: template$1,
13622
13564
  styles: styles$1
13623
13565
  });
@@ -13670,6 +13612,20 @@ class BaseTreeItem extends FASTElement {
13670
13612
  toggleState(this.elementInternals, "expanded", next);
13671
13613
  if (this.childTreeItems && this.childTreeItems.length > 0) {
13672
13614
  this.elementInternals.ariaExpanded = next ? "true" : "false";
13615
+ requestAnimationFrame(() => {
13616
+ const walker = document.createTreeWalker(this, NodeFilter.SHOW_ELEMENT, node => isTreeItem(node) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP);
13617
+ while (walker.nextNode()) {
13618
+ const item = walker.currentNode;
13619
+ if (next) {
13620
+ item.removeAttribute("focusgroup");
13621
+ } else {
13622
+ if (item.selected) {
13623
+ item.selected = false;
13624
+ }
13625
+ item.setAttribute("focusgroup", "none");
13626
+ }
13627
+ }
13628
+ });
13673
13629
  }
13674
13630
  }
13675
13631
  /**
@@ -13680,7 +13636,6 @@ class BaseTreeItem extends FASTElement {
13680
13636
  * @internal
13681
13637
  */
13682
13638
  selectedChanged(prev, next) {
13683
- this.updateTabindexBySelected();
13684
13639
  this.$emit("change");
13685
13640
  toggleState(this.elementInternals, "selected", next);
13686
13641
  this.elementInternals.ariaSelected = next ? "true" : "false";
@@ -13702,12 +13657,6 @@ class BaseTreeItem extends FASTElement {
13702
13657
  this.empty = this.childTreeItems?.length === 0;
13703
13658
  this.updateChildTreeItems();
13704
13659
  }
13705
- connectedCallback() {
13706
- super.connectedCallback();
13707
- Updates.enqueue(() => {
13708
- this.updateTabindexBySelected();
13709
- });
13710
- }
13711
13660
  /**
13712
13661
  * Updates the childrens indent
13713
13662
  *
@@ -13742,14 +13691,25 @@ class BaseTreeItem extends FASTElement {
13742
13691
  }
13743
13692
  }
13744
13693
  /**
13745
- * Whether the tree is nested
13694
+ * Whether the tree item is nested
13746
13695
  * @internal
13747
13696
  */
13748
13697
  get isNestedItem() {
13749
13698
  return isTreeItem(this.parentElement);
13750
13699
  }
13751
- updateTabindexBySelected() {
13752
- this.tabIndex = this.selected ? 0 : -1;
13700
+ /**
13701
+ * Whether the tree item is nested in a collapsed tree item.
13702
+ * @internal
13703
+ */
13704
+ get isHidden() {
13705
+ let parent = this.parentElement;
13706
+ while (isTreeItem(parent)) {
13707
+ if (!parent.expanded) {
13708
+ return true;
13709
+ }
13710
+ parent = parent.parentElement;
13711
+ }
13712
+ return false;
13753
13713
  }
13754
13714
  /** @internal */
13755
13715
  handleItemSlotChange() {
@@ -13835,10 +13795,10 @@ const styles = css`
13835
13795
  ${colorStrokeFocus2} inset}.positioning-region{display:flex;align-items:center;justify-content:space-between;cursor:pointer;height:${spacingVerticalXXXL};padding-inline-start:calc(var(--indent) * ${spacingHorizontalXXL});padding-inline-end:${spacingVerticalS};border-radius:${borderRadiusMedium};background-color:${colorSubtleBackground};color:${colorNeutralForeground2};gap:${spacingHorizontalXS}}@media (prefers-contrast:more){:host(:focus-visible) .positioning-region{outline:1px solid ${colorStrokeFocus2}}}.content{display:flex;align-items:center;gap:${spacingHorizontalXS}}.chevron{display:flex;align-items:center;flex-shrink:0;justify-content:center;width:${spacingHorizontalXXL};height:${spacingVerticalXXL};transition:transform ${durationFaster} ${curveEasyEaseMax};transform:rotate(0deg)}.chevron:dir(rtl){transform:rotate(180deg)}.chevron svg{inline-size:12px;block-size:12px}.aside{display:flex;align-items:center}.positioning-region:hover{background-color:${colorSubtleBackgroundHover};color:${colorNeutralForeground2Hover}}.positioning-region:active{background-color:${colorSubtleBackgroundPressed};color:${colorNeutralForeground2Pressed}}::slotted([slot='start']),::slotted([slot='end']),::slotted(:not([slot])){display:flex;align-items:center;min-width:0}::slotted([slot='start']){flex-shrink:0}::slotted(:not([slot])){padding-inline:${spacingHorizontalXXS}}.items{display:none}:host([expanded]) .items{display:block}:host([empty]) .chevron,:host([empty]) .items{visibility:hidden}:host([selected]) .positioning-region{background-color:${colorSubtleBackgroundSelected};color:${colorNeutralForeground2Selected}}:host([selected]) .content,:host([selected]) .chevron{color:${colorNeutralForeground3Selected}}:host([size='small']) .positioning-region{height:${spacingVerticalXXL};padding-inline-start:calc(var(--indent) * ${spacingHorizontalM})}:host([appearance='subtle-alpha']) .positioning-region:hover{background-color:${colorSubtleBackgroundLightAlphaHover}}:host([appearance='subtle-alpha']) .positioning-region:active{background-color:${colorSubtleBackgroundLightAlphaPressed}}:host([appearance='subtle-alpha'][selected]) .positioning-region{background-color:${colorSubtleBackgroundLightAlphaSelected};color:${colorNeutralForeground2Selected}}:host([appearance='transparent']) .positioning-region{background-color:${colorTransparentBackground}}:host([appearance='transparent']) .positioning-region:hover{background-color:${colorTransparentBackgroundHover}}:host([appearance='transparent']) .positioning-region:active{background-color:${colorTransparentBackgroundPressed}}:host([appearance='transparent'][selected]) .positioning-region{background-color:${colorTransparentBackgroundSelected};color:${colorNeutralForeground2Selected}}:host([expanded]) .chevron{transform:rotate(90deg)}`;
13836
13796
 
13837
13797
  const chevronIcon = html`<svg viewBox="0 0 12 12" fill="currentColor"><path d="M4.65 2.15a.5.5 0 000 .7L7.79 6 4.65 9.15a.5.5 0 10.7.7l3.5-3.5a.5.5 0 000-.7l-3.5-3.5a.5.5 0 00-.7 0z"></path></svg>`;
13838
- const template = html`<template slot="${x => x.isNestedItem ? "item" : void 0}"><div class="positioning-region" part="positioning-region"><div class="content" part="content"><span class="chevron" part="chevron" aria-hidden="true"><slot name="chevron">${chevronIcon}</slot></span><slot name="start"></slot><slot></slot><slot name="end"></slot></div><div class="aside" part="aside"><slot name="aside"></slot></div></div><div role="group" class="items" part="items"><slot name="item" ${ref("itemSlot")} @slotchange="${x => x.handleItemSlotChange()}"></slot></div></template>`;
13798
+ const template = html`<template slot="${x => x.isNestedItem ? "item" : void 0}" tabindex="0" ?focusgroupstart="${x => x.selected}"><div class="positioning-region" part="positioning-region"><div class="content" part="content"><span class="chevron" part="chevron" aria-hidden="true"><slot name="chevron">${chevronIcon}</slot></span><slot name="start"></slot><slot></slot><slot name="end"></slot></div><div class="aside" part="aside"><slot name="aside"></slot></div></div><div role="group" class="items" part="items"><slot name="item" ${ref("itemSlot")} @slotchange="${x => x.handleItemSlotChange()}"></slot></div></template>`;
13839
13799
 
13840
13800
  const definition = TreeItem.compose({
13841
- name: `${FluentDesignSystem.prefix}-tree-item`,
13801
+ name: tagName,
13842
13802
  template: template,
13843
13803
  styles: styles
13844
13804
  });