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

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 (547) hide show
  1. package/CHANGELOG.md +26 -2
  2. package/custom-elements.json +10660 -11092
  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 +8 -9
  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.base.js +1 -2
  75. package/dist/esm/button/button.base.js.map +1 -1
  76. package/dist/esm/button/button.d.ts +1 -1
  77. package/dist/esm/button/button.definition.js +2 -2
  78. package/dist/esm/button/button.definition.js.map +1 -1
  79. package/dist/esm/button/button.js +1 -1
  80. package/dist/esm/button/button.js.map +1 -1
  81. package/dist/esm/button/button.options.d.ts +8 -2
  82. package/dist/esm/button/button.options.js +7 -0
  83. package/dist/esm/button/button.options.js.map +1 -1
  84. package/dist/esm/button/button.styles.js +5 -3
  85. package/dist/esm/button/button.styles.js.map +1 -1
  86. package/dist/esm/button/button.template.js +1 -1
  87. package/dist/esm/button/button.template.js.map +1 -1
  88. package/dist/esm/button/index.d.ts +1 -0
  89. package/dist/esm/button/index.js +1 -0
  90. package/dist/esm/button/index.js.map +1 -1
  91. package/dist/esm/checkbox/checkbox.definition.js +2 -2
  92. package/dist/esm/checkbox/checkbox.definition.js.map +1 -1
  93. package/dist/esm/checkbox/checkbox.options.d.ts +6 -0
  94. package/dist/esm/checkbox/checkbox.options.js +7 -0
  95. package/dist/esm/checkbox/checkbox.options.js.map +1 -1
  96. package/dist/esm/checkbox/checkbox.styles.js +4 -3
  97. package/dist/esm/checkbox/checkbox.styles.js.map +1 -1
  98. package/dist/esm/checkbox/index.d.ts +1 -0
  99. package/dist/esm/checkbox/index.js +1 -0
  100. package/dist/esm/checkbox/index.js.map +1 -1
  101. package/dist/esm/compound-button/compound-button.definition.js +2 -2
  102. package/dist/esm/compound-button/compound-button.definition.js.map +1 -1
  103. package/dist/esm/compound-button/compound-button.options.d.ts +7 -1
  104. package/dist/esm/compound-button/compound-button.options.js +7 -0
  105. package/dist/esm/compound-button/compound-button.options.js.map +1 -1
  106. package/dist/esm/compound-button/compound-button.styles.js +4 -3
  107. package/dist/esm/compound-button/compound-button.styles.js.map +1 -1
  108. package/dist/esm/compound-button/compound-button.template.js +1 -1
  109. package/dist/esm/compound-button/compound-button.template.js.map +1 -1
  110. package/dist/esm/compound-button/index.d.ts +1 -0
  111. package/dist/esm/compound-button/index.js +1 -0
  112. package/dist/esm/compound-button/index.js.map +1 -1
  113. package/dist/esm/counter-badge/counter-badge.d.ts +1 -1
  114. package/dist/esm/counter-badge/counter-badge.definition.js +2 -2
  115. package/dist/esm/counter-badge/counter-badge.definition.js.map +1 -1
  116. package/dist/esm/counter-badge/counter-badge.js +1 -1
  117. package/dist/esm/counter-badge/counter-badge.js.map +1 -1
  118. package/dist/esm/counter-badge/counter-badge.options.d.ts +7 -1
  119. package/dist/esm/counter-badge/counter-badge.options.js +7 -0
  120. package/dist/esm/counter-badge/counter-badge.options.js.map +1 -1
  121. package/dist/esm/counter-badge/counter-badge.styles.js +1 -1
  122. package/dist/esm/counter-badge/counter-badge.styles.js.map +1 -1
  123. package/dist/esm/counter-badge/index.d.ts +1 -0
  124. package/dist/esm/counter-badge/index.js +1 -0
  125. package/dist/esm/counter-badge/index.js.map +1 -1
  126. package/dist/esm/dialog/dialog.definition.js +2 -2
  127. package/dist/esm/dialog/dialog.definition.js.map +1 -1
  128. package/dist/esm/dialog/dialog.options.d.ts +7 -1
  129. package/dist/esm/dialog/dialog.options.js +7 -0
  130. package/dist/esm/dialog/dialog.options.js.map +1 -1
  131. package/dist/esm/dialog/dialog.styles.js +4 -3
  132. package/dist/esm/dialog/dialog.styles.js.map +1 -1
  133. package/dist/esm/dialog/index.d.ts +1 -0
  134. package/dist/esm/dialog/index.js +1 -0
  135. package/dist/esm/dialog/index.js.map +1 -1
  136. package/dist/esm/dialog-body/dialog-body.definition.js +2 -2
  137. package/dist/esm/dialog-body/dialog-body.definition.js.map +1 -1
  138. package/dist/esm/dialog-body/dialog-body.options.d.ts +6 -0
  139. package/dist/esm/dialog-body/dialog-body.options.js +8 -0
  140. package/dist/esm/dialog-body/dialog-body.options.js.map +1 -0
  141. package/dist/esm/dialog-body/dialog-body.styles.js +1 -1
  142. package/dist/esm/dialog-body/dialog-body.styles.js.map +1 -1
  143. package/dist/esm/dialog-body/index.d.ts +1 -0
  144. package/dist/esm/dialog-body/index.js +1 -0
  145. package/dist/esm/dialog-body/index.js.map +1 -1
  146. package/dist/esm/divider/divider.definition.js +2 -2
  147. package/dist/esm/divider/divider.definition.js.map +1 -1
  148. package/dist/esm/divider/divider.options.d.ts +7 -1
  149. package/dist/esm/divider/divider.options.js +8 -1
  150. package/dist/esm/divider/divider.options.js.map +1 -1
  151. package/dist/esm/divider/divider.styles.js +5 -3
  152. package/dist/esm/divider/divider.styles.js.map +1 -1
  153. package/dist/esm/divider/index.d.ts +1 -0
  154. package/dist/esm/divider/index.js +1 -0
  155. package/dist/esm/divider/index.js.map +1 -1
  156. package/dist/esm/drawer/drawer.d.ts +8 -7
  157. package/dist/esm/drawer/drawer.definition.js +2 -2
  158. package/dist/esm/drawer/drawer.definition.js.map +1 -1
  159. package/dist/esm/drawer/drawer.js +8 -7
  160. package/dist/esm/drawer/drawer.js.map +1 -1
  161. package/dist/esm/drawer/drawer.options.d.ts +7 -1
  162. package/dist/esm/drawer/drawer.options.js +7 -0
  163. package/dist/esm/drawer/drawer.options.js.map +1 -1
  164. package/dist/esm/drawer/drawer.styles.js +1 -1
  165. package/dist/esm/drawer/drawer.styles.js.map +1 -1
  166. package/dist/esm/drawer/index.d.ts +1 -0
  167. package/dist/esm/drawer/index.js +1 -0
  168. package/dist/esm/drawer/index.js.map +1 -1
  169. package/dist/esm/drawer-body/drawer-body.definition.js +2 -2
  170. package/dist/esm/drawer-body/drawer-body.definition.js.map +1 -1
  171. package/dist/esm/drawer-body/drawer-body.options.d.ts +6 -0
  172. package/dist/esm/drawer-body/drawer-body.options.js +8 -0
  173. package/dist/esm/drawer-body/drawer-body.options.js.map +1 -0
  174. package/dist/esm/drawer-body/drawer-body.styles.js +1 -1
  175. package/dist/esm/drawer-body/drawer-body.styles.js.map +1 -1
  176. package/dist/esm/drawer-body/index.d.ts +1 -0
  177. package/dist/esm/drawer-body/index.js +1 -0
  178. package/dist/esm/drawer-body/index.js.map +1 -1
  179. package/dist/esm/dropdown/dropdown.definition.js +2 -2
  180. package/dist/esm/dropdown/dropdown.definition.js.map +1 -1
  181. package/dist/esm/dropdown/dropdown.options.d.ts +6 -0
  182. package/dist/esm/dropdown/dropdown.options.js +7 -0
  183. package/dist/esm/dropdown/dropdown.options.js.map +1 -1
  184. package/dist/esm/dropdown/index.d.ts +1 -0
  185. package/dist/esm/dropdown/index.js +1 -0
  186. package/dist/esm/dropdown/index.js.map +1 -1
  187. package/dist/esm/field/field.base.js +1 -1
  188. package/dist/esm/field/field.base.js.map +1 -1
  189. package/dist/esm/field/field.definition.js +2 -2
  190. package/dist/esm/field/field.definition.js.map +1 -1
  191. package/dist/esm/field/field.options.d.ts +6 -0
  192. package/dist/esm/field/field.options.js +7 -0
  193. package/dist/esm/field/field.options.js.map +1 -1
  194. package/dist/esm/field/index.d.ts +1 -0
  195. package/dist/esm/field/index.js +1 -0
  196. package/dist/esm/field/index.js.map +1 -1
  197. package/dist/esm/fluent-design-system.js +1 -1
  198. package/dist/esm/fluent-design-system.js.map +1 -1
  199. package/dist/esm/image/image.definition.js +2 -2
  200. package/dist/esm/image/image.definition.js.map +1 -1
  201. package/dist/esm/image/image.options.d.ts +7 -1
  202. package/dist/esm/image/image.options.js +7 -0
  203. package/dist/esm/image/image.options.js.map +1 -1
  204. package/dist/esm/image/index.d.ts +1 -0
  205. package/dist/esm/image/index.js +1 -0
  206. package/dist/esm/image/index.js.map +1 -1
  207. package/dist/esm/index.d.ts +2 -3
  208. package/dist/esm/index.js +2 -2
  209. package/dist/esm/index.js.map +1 -1
  210. package/dist/esm/label/index.d.ts +1 -0
  211. package/dist/esm/label/index.js +1 -0
  212. package/dist/esm/label/index.js.map +1 -1
  213. package/dist/esm/label/label.definition.js +2 -2
  214. package/dist/esm/label/label.definition.js.map +1 -1
  215. package/dist/esm/label/label.options.d.ts +7 -1
  216. package/dist/esm/label/label.options.js +7 -0
  217. package/dist/esm/label/label.options.js.map +1 -1
  218. package/dist/esm/label/label.styles.js +1 -1
  219. package/dist/esm/label/label.styles.js.map +1 -1
  220. package/dist/esm/link/index.d.ts +1 -0
  221. package/dist/esm/link/index.js +1 -0
  222. package/dist/esm/link/index.js.map +1 -1
  223. package/dist/esm/link/link.definition.js +2 -2
  224. package/dist/esm/link/link.definition.js.map +1 -1
  225. package/dist/esm/link/link.options.d.ts +7 -1
  226. package/dist/esm/link/link.options.js +7 -0
  227. package/dist/esm/link/link.options.js.map +1 -1
  228. package/dist/esm/link/link.styles.js +5 -3
  229. package/dist/esm/link/link.styles.js.map +1 -1
  230. package/dist/esm/listbox/index.d.ts +1 -0
  231. package/dist/esm/listbox/index.js +1 -0
  232. package/dist/esm/listbox/index.js.map +1 -1
  233. package/dist/esm/listbox/listbox.definition.js +2 -2
  234. package/dist/esm/listbox/listbox.definition.js.map +1 -1
  235. package/dist/esm/listbox/listbox.options.d.ts +6 -0
  236. package/dist/esm/listbox/listbox.options.js +7 -0
  237. package/dist/esm/listbox/listbox.options.js.map +1 -1
  238. package/dist/esm/menu/index.d.ts +1 -0
  239. package/dist/esm/menu/index.js +1 -0
  240. package/dist/esm/menu/index.js.map +1 -1
  241. package/dist/esm/menu/menu.definition.js +2 -2
  242. package/dist/esm/menu/menu.definition.js.map +1 -1
  243. package/dist/esm/menu/menu.js +8 -8
  244. package/dist/esm/menu/menu.js.map +1 -1
  245. package/dist/esm/menu/menu.options.d.ts +6 -0
  246. package/dist/esm/menu/menu.options.js +8 -0
  247. package/dist/esm/menu/menu.options.js.map +1 -0
  248. package/dist/esm/menu/menu.styles.js +1 -1
  249. package/dist/esm/menu/menu.styles.js.map +1 -1
  250. package/dist/esm/menu-button/index.d.ts +1 -0
  251. package/dist/esm/menu-button/index.js +1 -0
  252. package/dist/esm/menu-button/index.js.map +1 -1
  253. package/dist/esm/menu-button/menu-button.definition.js +2 -2
  254. package/dist/esm/menu-button/menu-button.definition.js.map +1 -1
  255. package/dist/esm/menu-button/menu-button.options.d.ts +7 -1
  256. package/dist/esm/menu-button/menu-button.options.js +7 -0
  257. package/dist/esm/menu-button/menu-button.options.js.map +1 -1
  258. package/dist/esm/menu-item/index.d.ts +1 -0
  259. package/dist/esm/menu-item/index.js +1 -0
  260. package/dist/esm/menu-item/index.js.map +1 -1
  261. package/dist/esm/menu-item/menu-item.d.ts +3 -1
  262. package/dist/esm/menu-item/menu-item.definition.js +2 -2
  263. package/dist/esm/menu-item/menu-item.definition.js.map +1 -1
  264. package/dist/esm/menu-item/menu-item.js +23 -12
  265. package/dist/esm/menu-item/menu-item.js.map +1 -1
  266. package/dist/esm/menu-item/menu-item.options.d.ts +7 -1
  267. package/dist/esm/menu-item/menu-item.options.js +7 -0
  268. package/dist/esm/menu-item/menu-item.options.js.map +1 -1
  269. package/dist/esm/menu-item/menu-item.styles.js +5 -3
  270. package/dist/esm/menu-item/menu-item.styles.js.map +1 -1
  271. package/dist/esm/menu-item/menu-item.template.js +3 -2
  272. package/dist/esm/menu-item/menu-item.template.js.map +1 -1
  273. package/dist/esm/menu-list/index.d.ts +1 -0
  274. package/dist/esm/menu-list/index.js +1 -0
  275. package/dist/esm/menu-list/index.js.map +1 -1
  276. package/dist/esm/menu-list/menu-list.base.d.ts +5 -24
  277. package/dist/esm/menu-list/menu-list.base.js +20 -125
  278. package/dist/esm/menu-list/menu-list.base.js.map +1 -1
  279. package/dist/esm/menu-list/menu-list.d.ts +5 -1
  280. package/dist/esm/menu-list/menu-list.definition.js +2 -2
  281. package/dist/esm/menu-list/menu-list.definition.js.map +1 -1
  282. package/dist/esm/menu-list/menu-list.js +23 -1
  283. package/dist/esm/menu-list/menu-list.js.map +1 -1
  284. package/dist/esm/menu-list/menu-list.options.d.ts +6 -0
  285. package/dist/esm/menu-list/menu-list.options.js +8 -0
  286. package/dist/esm/menu-list/menu-list.options.js.map +1 -0
  287. package/dist/esm/menu-list/menu-list.styles.js +1 -1
  288. package/dist/esm/menu-list/menu-list.styles.js.map +1 -1
  289. package/dist/esm/menu-list/menu-list.template.js +1 -5
  290. package/dist/esm/menu-list/menu-list.template.js.map +1 -1
  291. package/dist/esm/message-bar/index.d.ts +1 -0
  292. package/dist/esm/message-bar/index.js +1 -0
  293. package/dist/esm/message-bar/index.js.map +1 -1
  294. package/dist/esm/message-bar/message-bar.definition.js +2 -1
  295. package/dist/esm/message-bar/message-bar.definition.js.map +1 -1
  296. package/dist/esm/message-bar/message-bar.options.d.ts +6 -0
  297. package/dist/esm/message-bar/message-bar.options.js +7 -0
  298. package/dist/esm/message-bar/message-bar.options.js.map +1 -1
  299. package/dist/esm/message-bar/message-bar.template.d.ts +3 -3
  300. package/dist/esm/message-bar/message-bar.template.js +3 -3
  301. package/dist/esm/option/index.d.ts +1 -0
  302. package/dist/esm/option/index.js +1 -0
  303. package/dist/esm/option/index.js.map +1 -1
  304. package/dist/esm/option/option.definition.js +2 -2
  305. package/dist/esm/option/option.definition.js.map +1 -1
  306. package/dist/esm/option/option.options.d.ts +6 -0
  307. package/dist/esm/option/option.options.js +7 -0
  308. package/dist/esm/option/option.options.js.map +1 -1
  309. package/dist/esm/patterns/start-end.d.ts +1 -1
  310. package/dist/esm/patterns/start-end.js +1 -1
  311. package/dist/esm/patterns/start-end.js.map +1 -1
  312. package/dist/esm/progress-bar/index.d.ts +1 -0
  313. package/dist/esm/progress-bar/index.js +1 -0
  314. package/dist/esm/progress-bar/index.js.map +1 -1
  315. package/dist/esm/progress-bar/progress-bar.definition.js +2 -2
  316. package/dist/esm/progress-bar/progress-bar.definition.js.map +1 -1
  317. package/dist/esm/progress-bar/progress-bar.options.d.ts +7 -1
  318. package/dist/esm/progress-bar/progress-bar.options.js +7 -0
  319. package/dist/esm/progress-bar/progress-bar.options.js.map +1 -1
  320. package/dist/esm/progress-bar/progress-bar.styles.js +5 -3
  321. package/dist/esm/progress-bar/progress-bar.styles.js.map +1 -1
  322. package/dist/esm/radio/index.d.ts +1 -0
  323. package/dist/esm/radio/index.js +1 -0
  324. package/dist/esm/radio/index.js.map +1 -1
  325. package/dist/esm/radio/radio.d.ts +1 -1
  326. package/dist/esm/radio/radio.definition.js +2 -2
  327. package/dist/esm/radio/radio.definition.js.map +1 -1
  328. package/dist/esm/radio/radio.js +1 -1
  329. package/dist/esm/radio/radio.options.d.ts +6 -0
  330. package/dist/esm/radio/radio.options.js +7 -0
  331. package/dist/esm/radio/radio.options.js.map +1 -1
  332. package/dist/esm/radio/radio.styles.js +4 -3
  333. package/dist/esm/radio/radio.styles.js.map +1 -1
  334. package/dist/esm/radio/radio.template.js +1 -1
  335. package/dist/esm/radio/radio.template.js.map +1 -1
  336. package/dist/esm/radio-group/index.d.ts +1 -0
  337. package/dist/esm/radio-group/index.js +1 -0
  338. package/dist/esm/radio-group/index.js.map +1 -1
  339. package/dist/esm/radio-group/radio-group.base.d.ts +3 -16
  340. package/dist/esm/radio-group/radio-group.base.js +30 -89
  341. package/dist/esm/radio-group/radio-group.base.js.map +1 -1
  342. package/dist/esm/radio-group/radio-group.d.ts +5 -0
  343. package/dist/esm/radio-group/radio-group.definition.js +2 -2
  344. package/dist/esm/radio-group/radio-group.definition.js.map +1 -1
  345. package/dist/esm/radio-group/radio-group.js +22 -0
  346. package/dist/esm/radio-group/radio-group.js.map +1 -1
  347. package/dist/esm/radio-group/radio-group.options.d.ts +7 -1
  348. package/dist/esm/radio-group/radio-group.options.js +8 -1
  349. package/dist/esm/radio-group/radio-group.options.js.map +1 -1
  350. package/dist/esm/radio-group/radio-group.styles.js +1 -1
  351. package/dist/esm/radio-group/radio-group.styles.js.map +1 -1
  352. package/dist/esm/radio-group/radio-group.template.js +1 -1
  353. package/dist/esm/radio-group/radio-group.template.js.map +1 -1
  354. package/dist/esm/rating-display/index.d.ts +1 -0
  355. package/dist/esm/rating-display/index.js +1 -0
  356. package/dist/esm/rating-display/index.js.map +1 -1
  357. package/dist/esm/rating-display/rating-display.definition.js +2 -2
  358. package/dist/esm/rating-display/rating-display.definition.js.map +1 -1
  359. package/dist/esm/rating-display/rating-display.options.d.ts +7 -1
  360. package/dist/esm/rating-display/rating-display.options.js +7 -0
  361. package/dist/esm/rating-display/rating-display.options.js.map +1 -1
  362. package/dist/esm/rating-display/rating-display.styles.js +5 -3
  363. package/dist/esm/rating-display/rating-display.styles.js.map +1 -1
  364. package/dist/esm/slider/index.d.ts +1 -0
  365. package/dist/esm/slider/index.js +1 -0
  366. package/dist/esm/slider/index.js.map +1 -1
  367. package/dist/esm/slider/slider-utilities.d.ts +1 -1
  368. package/dist/esm/slider/slider-utilities.js +2 -1
  369. package/dist/esm/slider/slider-utilities.js.map +1 -1
  370. package/dist/esm/slider/slider.d.ts +2 -1
  371. package/dist/esm/slider/slider.definition.js +2 -2
  372. package/dist/esm/slider/slider.definition.js.map +1 -1
  373. package/dist/esm/slider/slider.js +9 -7
  374. package/dist/esm/slider/slider.js.map +1 -1
  375. package/dist/esm/slider/slider.options.d.ts +9 -2
  376. package/dist/esm/slider/slider.options.js +8 -1
  377. package/dist/esm/slider/slider.options.js.map +1 -1
  378. package/dist/esm/slider/slider.styles.js +5 -3
  379. package/dist/esm/slider/slider.styles.js.map +1 -1
  380. package/dist/esm/spinner/index.d.ts +1 -0
  381. package/dist/esm/spinner/index.js +1 -0
  382. package/dist/esm/spinner/index.js.map +1 -1
  383. package/dist/esm/spinner/spinner.definition.js +2 -2
  384. package/dist/esm/spinner/spinner.definition.js.map +1 -1
  385. package/dist/esm/spinner/spinner.options.d.ts +7 -1
  386. package/dist/esm/spinner/spinner.options.js +7 -0
  387. package/dist/esm/spinner/spinner.options.js.map +1 -1
  388. package/dist/esm/spinner/spinner.styles.js +5 -3
  389. package/dist/esm/spinner/spinner.styles.js.map +1 -1
  390. package/dist/esm/styles/index.d.ts +2 -1
  391. package/dist/esm/styles/index.js +2 -1
  392. package/dist/esm/styles/index.js.map +1 -1
  393. package/dist/esm/styles/partials/badge.partials.js +1 -1
  394. package/dist/esm/styles/partials/badge.partials.js.map +1 -1
  395. package/dist/esm/switch/index.d.ts +1 -0
  396. package/dist/esm/switch/index.js +1 -0
  397. package/dist/esm/switch/index.js.map +1 -1
  398. package/dist/esm/switch/switch.d.ts +1 -1
  399. package/dist/esm/switch/switch.definition.js +2 -2
  400. package/dist/esm/switch/switch.definition.js.map +1 -1
  401. package/dist/esm/switch/switch.options.d.ts +7 -1
  402. package/dist/esm/switch/switch.options.js +7 -0
  403. package/dist/esm/switch/switch.options.js.map +1 -1
  404. package/dist/esm/switch/switch.styles.js +4 -3
  405. package/dist/esm/switch/switch.styles.js.map +1 -1
  406. package/dist/esm/switch/switch.template.js +1 -1
  407. package/dist/esm/switch/switch.template.js.map +1 -1
  408. package/dist/esm/tab/index.d.ts +1 -0
  409. package/dist/esm/tab/index.js +1 -0
  410. package/dist/esm/tab/index.js.map +1 -1
  411. package/dist/esm/tab/tab.d.ts +2 -0
  412. package/dist/esm/tab/tab.definition.js +2 -2
  413. package/dist/esm/tab/tab.definition.js.map +1 -1
  414. package/dist/esm/tab/tab.js +13 -3
  415. package/dist/esm/tab/tab.js.map +1 -1
  416. package/dist/esm/tab/tab.options.d.ts +6 -0
  417. package/dist/esm/tab/tab.options.js +7 -0
  418. package/dist/esm/tab/tab.options.js.map +1 -1
  419. package/dist/esm/tab/tab.styles.js +23 -3
  420. package/dist/esm/tab/tab.styles.js.map +1 -1
  421. package/dist/esm/tab/tab.template.js +2 -2
  422. package/dist/esm/tab/tab.template.js.map +1 -1
  423. package/dist/esm/tablist/index.d.ts +1 -0
  424. package/dist/esm/tablist/index.js +1 -0
  425. package/dist/esm/tablist/index.js.map +1 -1
  426. package/dist/esm/tablist/tablist.base.d.ts +13 -45
  427. package/dist/esm/tablist/tablist.base.js +76 -185
  428. package/dist/esm/tablist/tablist.base.js.map +1 -1
  429. package/dist/esm/tablist/tablist.d.ts +5 -73
  430. package/dist/esm/tablist/tablist.definition.js +2 -2
  431. package/dist/esm/tablist/tablist.definition.js.map +1 -1
  432. package/dist/esm/tablist/tablist.js +20 -130
  433. package/dist/esm/tablist/tablist.js.map +1 -1
  434. package/dist/esm/tablist/tablist.options.d.ts +7 -1
  435. package/dist/esm/tablist/tablist.options.js +8 -1
  436. package/dist/esm/tablist/tablist.options.js.map +1 -1
  437. package/dist/esm/tablist/tablist.styles.js +83 -65
  438. package/dist/esm/tablist/tablist.styles.js.map +1 -1
  439. package/dist/esm/tablist/tablist.template.js +5 -1
  440. package/dist/esm/tablist/tablist.template.js.map +1 -1
  441. package/dist/esm/text/index.d.ts +1 -0
  442. package/dist/esm/text/index.js +1 -0
  443. package/dist/esm/text/index.js.map +1 -1
  444. package/dist/esm/text/text.definition.js +2 -2
  445. package/dist/esm/text/text.definition.js.map +1 -1
  446. package/dist/esm/text/text.options.d.ts +7 -1
  447. package/dist/esm/text/text.options.js +7 -0
  448. package/dist/esm/text/text.options.js.map +1 -1
  449. package/dist/esm/text/text.styles.js +1 -1
  450. package/dist/esm/text/text.styles.js.map +1 -1
  451. package/dist/esm/text-input/index.d.ts +1 -0
  452. package/dist/esm/text-input/index.js +1 -0
  453. package/dist/esm/text-input/index.js.map +1 -1
  454. package/dist/esm/text-input/text-input.definition.js +2 -2
  455. package/dist/esm/text-input/text-input.definition.js.map +1 -1
  456. package/dist/esm/text-input/text-input.options.d.ts +6 -0
  457. package/dist/esm/text-input/text-input.options.js +7 -0
  458. package/dist/esm/text-input/text-input.options.js.map +1 -1
  459. package/dist/esm/textarea/index.d.ts +1 -0
  460. package/dist/esm/textarea/index.js +1 -0
  461. package/dist/esm/textarea/index.js.map +1 -1
  462. package/dist/esm/textarea/textarea.base.js +1 -1
  463. package/dist/esm/textarea/textarea.base.js.map +1 -1
  464. package/dist/esm/textarea/textarea.definition.js +2 -2
  465. package/dist/esm/textarea/textarea.definition.js.map +1 -1
  466. package/dist/esm/textarea/textarea.options.d.ts +6 -0
  467. package/dist/esm/textarea/textarea.options.js +7 -0
  468. package/dist/esm/textarea/textarea.options.js.map +1 -1
  469. package/dist/esm/textarea/textarea.styles.js +4 -3
  470. package/dist/esm/textarea/textarea.styles.js.map +1 -1
  471. package/dist/esm/theme/set-theme.js +1 -1
  472. package/dist/esm/theme/set-theme.js.map +1 -1
  473. package/dist/esm/toggle-button/index.d.ts +1 -0
  474. package/dist/esm/toggle-button/index.js +1 -0
  475. package/dist/esm/toggle-button/index.js.map +1 -1
  476. package/dist/esm/toggle-button/toggle-button.definition.js +2 -2
  477. package/dist/esm/toggle-button/toggle-button.definition.js.map +1 -1
  478. package/dist/esm/toggle-button/toggle-button.options.d.ts +8 -2
  479. package/dist/esm/toggle-button/toggle-button.options.js +7 -0
  480. package/dist/esm/toggle-button/toggle-button.options.js.map +1 -1
  481. package/dist/esm/toggle-button/toggle-button.styles.js +4 -3
  482. package/dist/esm/toggle-button/toggle-button.styles.js.map +1 -1
  483. package/dist/esm/tooltip/index.d.ts +1 -0
  484. package/dist/esm/tooltip/index.js +1 -0
  485. package/dist/esm/tooltip/index.js.map +1 -1
  486. package/dist/esm/tooltip/tooltip.d.ts +2 -2
  487. package/dist/esm/tooltip/tooltip.definition.js +2 -2
  488. package/dist/esm/tooltip/tooltip.definition.js.map +1 -1
  489. package/dist/esm/tooltip/tooltip.js +3 -3
  490. package/dist/esm/tooltip/tooltip.js.map +1 -1
  491. package/dist/esm/tooltip/tooltip.options.d.ts +6 -0
  492. package/dist/esm/tooltip/tooltip.options.js +7 -0
  493. package/dist/esm/tooltip/tooltip.options.js.map +1 -1
  494. package/dist/esm/tree/index.d.ts +1 -0
  495. package/dist/esm/tree/index.js +1 -0
  496. package/dist/esm/tree/index.js.map +1 -1
  497. package/dist/esm/tree/tree.base.d.ts +5 -28
  498. package/dist/esm/tree/tree.base.js +23 -109
  499. package/dist/esm/tree/tree.base.js.map +1 -1
  500. package/dist/esm/tree/tree.d.ts +5 -0
  501. package/dist/esm/tree/tree.definition.js +2 -2
  502. package/dist/esm/tree/tree.definition.js.map +1 -1
  503. package/dist/esm/tree/tree.js +23 -0
  504. package/dist/esm/tree/tree.js.map +1 -1
  505. package/dist/esm/tree/tree.options.d.ts +6 -0
  506. package/dist/esm/tree/tree.options.js +8 -0
  507. package/dist/esm/tree/tree.options.js.map +1 -0
  508. package/dist/esm/tree/tree.template.js +2 -3
  509. package/dist/esm/tree/tree.template.js.map +1 -1
  510. package/dist/esm/tree-item/index.d.ts +1 -0
  511. package/dist/esm/tree-item/index.js +1 -0
  512. package/dist/esm/tree-item/index.js.map +1 -1
  513. package/dist/esm/tree-item/tree-item.base.d.ts +6 -3
  514. package/dist/esm/tree-item/tree-item.base.js +31 -11
  515. package/dist/esm/tree-item/tree-item.base.js.map +1 -1
  516. package/dist/esm/tree-item/tree-item.definition.js +2 -2
  517. package/dist/esm/tree-item/tree-item.definition.js.map +1 -1
  518. package/dist/esm/tree-item/tree-item.options.d.ts +6 -0
  519. package/dist/esm/tree-item/tree-item.options.js +7 -0
  520. package/dist/esm/tree-item/tree-item.options.js.map +1 -1
  521. package/dist/esm/tree-item/tree-item.template.js +1 -1
  522. package/dist/esm/tree-item/tree-item.template.js.map +1 -1
  523. package/dist/esm/utils/direction.d.ts +13 -1
  524. package/dist/esm/utils/direction.js +8 -1
  525. package/dist/esm/utils/direction.js.map +1 -1
  526. package/dist/esm/utils/focusgroup.d.ts +22 -0
  527. package/dist/esm/utils/focusgroup.js +42 -0
  528. package/dist/esm/utils/focusgroup.js.map +1 -0
  529. package/dist/esm/utils/index.d.ts +2 -1
  530. package/dist/esm/utils/index.js +2 -1
  531. package/dist/esm/utils/index.js.map +1 -1
  532. package/dist/esm/utils/numbers.d.ts +5 -0
  533. package/dist/esm/utils/numbers.js +9 -0
  534. package/dist/esm/utils/numbers.js.map +1 -0
  535. package/dist/esm/utils/orientation.d.ts +13 -0
  536. package/dist/esm/utils/orientation.js +10 -0
  537. package/dist/esm/utils/orientation.js.map +1 -0
  538. package/dist/esm/utils/typings.d.ts +4 -0
  539. package/dist/esm/utils/typings.js +6 -0
  540. package/dist/esm/utils/typings.js.map +1 -1
  541. package/dist/web-components.d.ts +100 -341
  542. package/dist/web-components.js +1271 -1375
  543. package/dist/web-components.min.js +244 -261
  544. package/package.json +4 -4
  545. package/dist/esm/utils/behaviors/match-media-stylesheet-behavior.d.ts +0 -124
  546. package/dist/esm/utils/behaviors/match-media-stylesheet-behavior.js +0 -142
  547. package/dist/esm/utils/behaviors/match-media-stylesheet-behavior.js.map +0 -1
@@ -1,9 +1,26 @@
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
+ function isHTMLElement(...args) {
16
+ return args.every(arg => arg instanceof HTMLElement);
17
+ }
18
+
19
+ function isAccordionItem(element, tagName2 = "-accordion-item") {
20
+ return isCustomElement(tagName2)(element);
21
+ }
22
+ const tagName$F = `${FluentDesignSystem.prefix}-accordion-item`;
23
+
7
24
  let kernelMode;
8
25
  const kernelAttr = "fast-kernel";
9
26
  try {
@@ -3943,180 +3960,6 @@ const FASTElement = Object.assign(createFASTElement(HTMLElement), {
3943
3960
  compose
3944
3961
  });
3945
3962
 
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
3963
  function staticallyCompose(item) {
4121
3964
  if (!item) {
4122
3965
  return InlineTemplateDirective.empty;
@@ -4130,136 +3973,6 @@ function staticallyCompose(item) {
4130
3973
  return item;
4131
3974
  }
4132
3975
 
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
3976
  class StartEnd {}
4264
3977
  function endSlotTemplate(options) {
4265
3978
  return html`<slot name="end" ${ref("end")}>${staticallyCompose(options.end)}</slot>`.inline();
@@ -4340,6 +4053,11 @@ __decorateClass$N([attr({
4340
4053
  })], AccordionItem.prototype, "block", 2);
4341
4054
  applyMixins(AccordionItem, StartEnd);
4342
4055
 
4056
+ const hidden = `:host([hidden]){display:none}`;
4057
+ function display(displayValue) {
4058
+ return `${hidden}:host{display:${displayValue}}`;
4059
+ }
4060
+
4343
4061
  const colorNeutralForeground1 = "var(--colorNeutralForeground1)";
4344
4062
  const colorNeutralForeground1Hover = "var(--colorNeutralForeground1Hover)";
4345
4063
  const colorNeutralForeground1Pressed = "var(--colorNeutralForeground1Pressed)";
@@ -4628,13 +4346,19 @@ const template$F = accordionItemTemplate({
4628
4346
  });
4629
4347
 
4630
4348
  const definition$F = AccordionItem.compose({
4631
- name: `${FluentDesignSystem.prefix}-accordion-item`,
4349
+ name: tagName$F,
4632
4350
  template: template$F,
4633
4351
  styles: styles$E
4634
4352
  });
4635
4353
 
4636
4354
  definition$F.define(FluentDesignSystem.registry);
4637
4355
 
4356
+ const AccordionExpandMode = {
4357
+ single: "single",
4358
+ multi: "multi"
4359
+ };
4360
+ const tagName$E = `${FluentDesignSystem.prefix}-accordion`;
4361
+
4638
4362
  function requestIdleCallback(callback, options) {
4639
4363
  if ("requestIdleCallback" in globalThis) {
4640
4364
  return globalThis.requestIdleCallback(callback, options);
@@ -4670,15 +4394,6 @@ function waitForConnectedDescendants(target, callback, options) {
4670
4394
  scheduleCheck();
4671
4395
  }
4672
4396
 
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
4397
  var __defProp$M = Object.defineProperty;
4683
4398
  var __getOwnPropDesc$M = Object.getOwnPropertyDescriptor;
4684
4399
  var __decorateClass$M = (decorators, target, key, kind) => {
@@ -4699,7 +4414,6 @@ class Accordion extends FASTElement {
4699
4414
  /**
4700
4415
  * Resets event listeners and sets the `accordionItems` property
4701
4416
  * then rebinds event listeners to each non-disabled item
4702
- * @returns {void}
4703
4417
  */
4704
4418
  this.setItems = () => {
4705
4419
  waitForConnectedDescendants(this, () => {
@@ -4722,7 +4436,7 @@ class Accordion extends FASTElement {
4722
4436
  };
4723
4437
  /**
4724
4438
  * Removes event listeners from the previous accordion items
4725
- * @param oldValue An array of the previous accordion items
4439
+ * @param oldValue - An array of the previous accordion items
4726
4440
  */
4727
4441
  this.removeItemListeners = oldValue => {
4728
4442
  oldValue.forEach((item, index) => {
@@ -4733,7 +4447,7 @@ class Accordion extends FASTElement {
4733
4447
  };
4734
4448
  /**
4735
4449
  * Changes the expanded state of the accordion item
4736
- * @param evt Click event
4450
+ * @param evt - Click event
4737
4451
  * @returns
4738
4452
  */
4739
4453
  this.expandedChangedHandler = evt => {
@@ -4786,7 +4500,6 @@ class Accordion extends FASTElement {
4786
4500
  }
4787
4501
  /**
4788
4502
  * Find the first expanded item in the accordion
4789
- * @returns {void}
4790
4503
  */
4791
4504
  findExpandedItem() {
4792
4505
  if (!this.accordionItems || this.accordionItems?.length === 0) {
@@ -4796,15 +4509,14 @@ class Accordion extends FASTElement {
4796
4509
  }
4797
4510
  /**
4798
4511
  * Checks if the accordion is in single expand mode
4799
- * @returns {boolean}
4512
+ * @returns true if the accordion is in single expand mode.
4800
4513
  */
4801
4514
  isSingleExpandMode() {
4802
4515
  return this.expandmode === AccordionExpandMode.single;
4803
4516
  }
4804
4517
  /**
4805
4518
  * Controls the behavior of the accordion in single expand mode
4806
- * @param expandedItem The item to expand in single expand mode
4807
- * @returns {void}
4519
+ * @param expandedItem - The item to expand in single expand mode
4808
4520
  */
4809
4521
  setSingleExpandMode(expandedItem) {
4810
4522
  if (this.accordionItems.length === 0) {
@@ -4851,13 +4563,55 @@ function accordionTemplate() {
4851
4563
  const template$E = accordionTemplate();
4852
4564
 
4853
4565
  const definition$E = Accordion.compose({
4854
- name: `${FluentDesignSystem.prefix}-accordion`,
4566
+ name: tagName$E,
4855
4567
  template: template$E,
4856
4568
  styles: styles$D
4857
4569
  });
4858
4570
 
4859
4571
  definition$E.define(FluentDesignSystem.registry);
4860
4572
 
4573
+ const ButtonAppearance = {
4574
+ primary: "primary",
4575
+ outline: "outline",
4576
+ subtle: "subtle",
4577
+ transparent: "transparent"
4578
+ };
4579
+ const ButtonShape = {
4580
+ circular: "circular",
4581
+ rounded: "rounded",
4582
+ square: "square"
4583
+ };
4584
+ const ButtonSize = {
4585
+ small: "small",
4586
+ medium: "medium",
4587
+ large: "large"
4588
+ };
4589
+ const ButtonType = {
4590
+ submit: "submit",
4591
+ reset: "reset",
4592
+ button: "button"
4593
+ };
4594
+ const tagName$D = `${FluentDesignSystem.prefix}-button`;
4595
+
4596
+ const AnchorButtonAppearance = ButtonAppearance;
4597
+ const AnchorButtonShape = ButtonShape;
4598
+ const AnchorButtonSize = ButtonSize;
4599
+ const AnchorAttributes = {
4600
+ download: "download",
4601
+ href: "href",
4602
+ hreflang: "hreflang",
4603
+ ping: "ping",
4604
+ referrerpolicy: "referrerpolicy",
4605
+ rel: "rel",
4606
+ target: "target",
4607
+ type: "type"
4608
+ };
4609
+ const tagName$C = `${FluentDesignSystem.prefix}-anchor-button`;
4610
+
4611
+ const AnchorPositioningCSSSupported = CSS.supports("anchor-name: --a");
4612
+ const AnchorPositioningHTMLSupported = "anchor" in HTMLElement.prototype;
4613
+ const CustomStatesSetSupported = CSS.supports("selector(:state(g))");
4614
+
4861
4615
  const statesMap = /* @__PURE__ */new Map();
4862
4616
  function stateSelector(state) {
4863
4617
  return statesMap.get(state) ?? statesMap.set(state, CustomStatesSetSupported ? `:state(${state})` : `[state--${state}]`).get(state);
@@ -4895,42 +4649,6 @@ function swapStates(elementInternals, prev = "", next = "", States, prefix = "")
4895
4649
  }
4896
4650
  }
4897
4651
 
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"
4918
- };
4919
-
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
- };
4933
-
4934
4652
  var __defProp$L = Object.defineProperty;
4935
4653
  var __getOwnPropDesc$L = Object.getOwnPropertyDescriptor;
4936
4654
  var __decorateClass$L = (decorators, target, key, kind) => {
@@ -4994,11 +4712,12 @@ class BaseAnchor extends FASTElement {
4994
4712
  * @internal
4995
4713
  */
4996
4714
  clickHandler(e) {
4715
+ if (e.composedPath()[0] === this.internalProxyAnchor) {
4716
+ e.stopImmediatePropagation();
4717
+ return true;
4718
+ }
4997
4719
  if (this.href) {
4998
- const newTab = !this.isMac ? e.ctrlKey : e.metaKey;
4999
- if (newTab) {
5000
- e.preventDefault();
5001
- }
4720
+ const newTab = e.ctrlKey || e.metaKey;
5002
4721
  this.handleNavigation(newTab);
5003
4722
  }
5004
4723
  return true;
@@ -5012,7 +4731,7 @@ class BaseAnchor extends FASTElement {
5012
4731
  */
5013
4732
  keydownHandler(e) {
5014
4733
  if (this.href) {
5015
- if (e.key === keyEnter) {
4734
+ if (e.key === "Enter") {
5016
4735
  const newTab = !this.isMac ? e.ctrlKey : e.metaKey || e.ctrlKey;
5017
4736
  this.handleNavigation(newTab);
5018
4737
  return;
@@ -5022,7 +4741,7 @@ class BaseAnchor extends FASTElement {
5022
4741
  }
5023
4742
  /**
5024
4743
  * 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
4744
+ * If a modified activation requests a new tab, opens the href in a new window.
5026
4745
  * @internal
5027
4746
  */
5028
4747
  handleNavigation(newTab) {
@@ -5043,8 +4762,7 @@ class BaseAnchor extends FASTElement {
5043
4762
  }
5044
4763
  createProxyElement() {
5045
4764
  const proxy = this.internalProxyAnchor ?? document.createElement("a");
5046
- proxy.ariaHidden = "true";
5047
- proxy.tabIndex = -1;
4765
+ proxy.inert = true;
5048
4766
  return proxy;
5049
4767
  }
5050
4768
  }
@@ -5119,14 +4837,12 @@ const baseButtonStyles = css`
5119
4837
  const styles$C = css`
5120
4838
  ${baseButtonStyles}
5121
4839
 
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}`));
4840
+ :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
4841
 
5125
4842
  const styles$B = css`
5126
4843
  ${baseButtonStyles}
5127
4844
 
5128
- ::slotted(a){position:absolute;inset:0}`.withBehaviors(forcedColorsStylesheetBehavior(css`
5129
- :host{border-color:LinkText;color:LinkText}`));
4845
+ ::slotted(a){position:absolute;inset:0}@media (forced-colors:active){:host{border-color:LinkText;color:LinkText}}`;
5130
4846
 
5131
4847
  function anchorTemplate$1(options = {}) {
5132
4848
  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,35 +4850,75 @@ function anchorTemplate$1(options = {}) {
5134
4850
  const template$D = anchorTemplate$1();
5135
4851
 
5136
4852
  const definition$D = AnchorButton.compose({
5137
- name: `${FluentDesignSystem.prefix}-anchor-button`,
4853
+ name: tagName$C,
5138
4854
  template: template$D,
5139
4855
  styles: styles$B
5140
4856
  });
5141
4857
 
5142
4858
  definition$D.define(FluentDesignSystem.registry);
5143
4859
 
5144
- const UNWANTED_ENCLOSURES_REGEX = /[\(\[\{][^\)\]\}]*[\)\]\}]/g;
5145
- const UNWANTED_CHARS_REGEX = /[\0-\u001F\!-/:-@\[-`\{-\u00BF\u0250-\u036F\uD800-\uFFFF]/g;
5146
- const PHONENUMBER_REGEX = /^\d+[\d\s]*(:?ext|x|)\s*\d+$/i;
5147
- const MULTIPLE_WHITESPACES_REGEX = /\s+/g;
5148
- const UNSUPPORTED_TEXT_REGEX = /[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\u1100-\u11FF\u3130-\u318F\uA960-\uA97F\uAC00-\uD7AF\uD7B0-\uD7FF\u3040-\u309F\u30A0-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF]|[\uD840-\uD869][\uDC00-\uDED6]/;
5149
- function getInitialsLatin(displayName, isRtl, firstInitialOnly) {
5150
- let initials = "";
5151
- const splits = displayName.split(" ");
5152
- if (splits.length !== 0) {
5153
- initials += splits[0].charAt(0).toUpperCase();
5154
- }
5155
- if (!firstInitialOnly) {
5156
- if (splits.length === 2) {
5157
- initials += splits[1].charAt(0).toUpperCase();
5158
- } else if (splits.length === 3) {
5159
- initials += splits[2].charAt(0).toUpperCase();
5160
- }
5161
- }
5162
- if (isRtl && initials.length > 1) {
5163
- return initials.charAt(1) + initials.charAt(0);
5164
- }
5165
- return initials;
4860
+ const AvatarNamedColor = {
4861
+ darkRed: "dark-red",
4862
+ cranberry: "cranberry",
4863
+ red: "red",
4864
+ pumpkin: "pumpkin",
4865
+ peach: "peach",
4866
+ marigold: "marigold",
4867
+ gold: "gold",
4868
+ brass: "brass",
4869
+ brown: "brown",
4870
+ forest: "forest",
4871
+ seafoam: "seafoam",
4872
+ darkGreen: "dark-green",
4873
+ lightTeal: "light-teal",
4874
+ teal: "teal",
4875
+ steel: "steel",
4876
+ blue: "blue",
4877
+ royalBlue: "royal-blue",
4878
+ cornflower: "cornflower",
4879
+ navy: "navy",
4880
+ lavender: "lavender",
4881
+ purple: "purple",
4882
+ grape: "grape",
4883
+ lilac: "lilac",
4884
+ pink: "pink",
4885
+ magenta: "magenta",
4886
+ plum: "plum",
4887
+ beige: "beige",
4888
+ mink: "mink",
4889
+ platinum: "platinum",
4890
+ anchor: "anchor"
4891
+ };
4892
+ const AvatarColor = {
4893
+ neutral: "neutral",
4894
+ brand: "brand",
4895
+ colorful: "colorful",
4896
+ ...AvatarNamedColor
4897
+ };
4898
+ const tagName$B = `${FluentDesignSystem.prefix}-avatar`;
4899
+
4900
+ const UNWANTED_ENCLOSURES_REGEX = /[\(\[\{][^\)\]\}]*[\)\]\}]/g;
4901
+ const UNWANTED_CHARS_REGEX = /[\0-\u001F\!-/:-@\[-`\{-\u00BF\u0250-\u036F\uD800-\uFFFF]/g;
4902
+ const PHONENUMBER_REGEX = /^\d+[\d\s]*(:?ext|x|)\s*\d+$/i;
4903
+ const MULTIPLE_WHITESPACES_REGEX = /\s+/g;
4904
+ const UNSUPPORTED_TEXT_REGEX = /[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\u1100-\u11FF\u3130-\u318F\uA960-\uA97F\uAC00-\uD7AF\uD7B0-\uD7FF\u3040-\u309F\u30A0-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF]|[\uD840-\uD869][\uDC00-\uDED6]/;
4905
+ function getInitialsLatin(displayName, isRtl, firstInitialOnly) {
4906
+ let initials = "";
4907
+ const splits = displayName.split(" ");
4908
+ if (splits.length !== 0) {
4909
+ initials += splits[0].charAt(0).toUpperCase();
4910
+ }
4911
+ if (!firstInitialOnly) {
4912
+ if (splits.length === 2) {
4913
+ initials += splits[1].charAt(0).toUpperCase();
4914
+ } else if (splits.length === 3) {
4915
+ initials += splits[2].charAt(0).toUpperCase();
4916
+ }
4917
+ }
4918
+ if (isRtl && initials.length > 1) {
4919
+ return initials.charAt(1) + initials.charAt(0);
4920
+ }
4921
+ return initials;
5166
4922
  }
5167
4923
  function cleanupDisplayName(displayName) {
5168
4924
  displayName = displayName.replace(UNWANTED_ENCLOSURES_REGEX, "");
@@ -5302,45 +5058,6 @@ __decorateClass$J([observable], BaseAvatar.prototype, "slottedDefaults", 2);
5302
5058
  __decorateClass$J([attr], BaseAvatar.prototype, "name", 2);
5303
5059
  __decorateClass$J([attr], BaseAvatar.prototype, "initials", 2);
5304
5060
 
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
5061
  var __defProp$I = Object.defineProperty;
5345
5062
  var __getOwnPropDesc$I = Object.getOwnPropertyDescriptor;
5346
5063
  var __decorateClass$I = (decorators, target, key, kind) => {
@@ -5443,7 +5160,7 @@ function avatarTemplate() {
5443
5160
  const template$C = avatarTemplate();
5444
5161
 
5445
5162
  const definition$C = Avatar.compose({
5446
- name: `${FluentDesignSystem.prefix}-avatar`,
5163
+ name: tagName$B,
5447
5164
  template: template$C,
5448
5165
  styles: styles$A
5449
5166
  });
@@ -5466,6 +5183,7 @@ const BadgeColor = {
5466
5183
  success: "success",
5467
5184
  warning: "warning"
5468
5185
  };
5186
+ const tagName$A = `${FluentDesignSystem.prefix}-badge`;
5469
5187
 
5470
5188
  var __defProp$H = Object.defineProperty;
5471
5189
  var __getOwnPropDesc$H = Object.getOwnPropertyDescriptor;
@@ -5736,109 +5454,6 @@ const badgeTintStyles = css.partial`
5736
5454
  }
5737
5455
  `;
5738
5456
 
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
5457
  const styles$z = css`
5843
5458
  :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
5459
  ${badgeOutlineStyles}
@@ -5846,8 +5461,8 @@ const styles$z = css`
5846
5461
  ${badgeFilledStyles}
5847
5462
  ${badgeSizeStyles}
5848
5463
  ${badgeBaseStyles}
5849
- `.withBehaviors(forcedColorsStylesheetBehavior(css`
5850
- :host,:host([appearance='outline']),:host([appearance='tint']){border-color:CanvasText}`));
5464
+
5465
+ @media (forced-colors:active){:host,:host([appearance='outline']),:host([appearance='tint']){border-color:CanvasText}}`;
5851
5466
 
5852
5467
  function badgeTemplate(options = {}) {
5853
5468
  return html` ${startSlotTemplate(options)}<slot>${staticallyCompose(options.defaultContent)}</slot>${endSlotTemplate(options)} `;
@@ -5855,7 +5470,7 @@ function badgeTemplate(options = {}) {
5855
5470
  const template$B = badgeTemplate();
5856
5471
 
5857
5472
  const definition$B = Badge.compose({
5858
- name: `${FluentDesignSystem.prefix}-badge`,
5473
+ name: tagName$A,
5859
5474
  template: template$B,
5860
5475
  styles: styles$z
5861
5476
  });
@@ -6019,7 +5634,7 @@ class BaseButton extends FASTElement {
6019
5634
  e.stopImmediatePropagation();
6020
5635
  return;
6021
5636
  }
6022
- if (e.key === keyEnter || e.key === keySpace) {
5637
+ if (e.key === "Enter" || e.key === " ") {
6023
5638
  this.click();
6024
5639
  return;
6025
5640
  }
@@ -6157,13 +5772,15 @@ function buttonTemplate$1(options = {}) {
6157
5772
  const template$A = buttonTemplate$1();
6158
5773
 
6159
5774
  const definition$A = Button.compose({
6160
- name: `${FluentDesignSystem.prefix}-button`,
5775
+ name: tagName$D,
6161
5776
  template: template$A,
6162
5777
  styles: styles$C
6163
5778
  });
6164
5779
 
6165
5780
  definition$A.define(FluentDesignSystem.registry);
6166
5781
 
5782
+ const tagName$z = `${FluentDesignSystem.prefix}-checkbox`;
5783
+
6167
5784
  var __defProp$E = Object.defineProperty;
6168
5785
  var __getOwnPropDesc$E = Object.getOwnPropertyDescriptor;
6169
5786
  var __decorateClass$E = (decorators, target, key, kind) => {
@@ -6628,8 +6245,7 @@ const valueMissingState = stateSelector("value-missing");
6628
6245
  const styles$y = css`
6629
6246
  ${display("inline-flex")}
6630
6247
 
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}`));
6248
+ :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
6249
 
6634
6250
  const checkedIndicator$2 = html.partial(/* html */
6635
6251
  `
@@ -6657,13 +6273,15 @@ const template$z = checkboxTemplate({
6657
6273
  });
6658
6274
 
6659
6275
  const definition$z = Checkbox.compose({
6660
- name: `${FluentDesignSystem.prefix}-checkbox`,
6276
+ name: tagName$z,
6661
6277
  template: template$z,
6662
6278
  styles: styles$y
6663
6279
  });
6664
6280
 
6665
6281
  definition$z.define(FluentDesignSystem.registry);
6666
6282
 
6283
+ const tagName$y = `${FluentDesignSystem.prefix}-compound-button`;
6284
+
6667
6285
  class CompoundButton extends Button {}
6668
6286
 
6669
6287
  const styles$x = css`
@@ -6671,9 +6289,8 @@ const styles$x = css`
6671
6289
 
6672
6290
  :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
6291
  ::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}`));
6292
+ ::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]))
6293
+ ::slotted([slot='description']){color:HighlightText}}`;
6677
6294
 
6678
6295
  function buttonTemplate(options = {}) {
6679
6296
  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 +6298,15 @@ function buttonTemplate(options = {}) {
6681
6298
  const template$y = buttonTemplate();
6682
6299
 
6683
6300
  const definition$y = CompoundButton.compose({
6684
- name: `${FluentDesignSystem.prefix}-compound-button`,
6301
+ name: tagName$y,
6685
6302
  template: template$y,
6686
6303
  styles: styles$x
6687
6304
  });
6688
6305
 
6689
6306
  definition$y.define(FluentDesignSystem.registry);
6690
6307
 
6308
+ const tagName$x = `${FluentDesignSystem.prefix}-counter-badge`;
6309
+
6691
6310
  var __defProp$C = Object.defineProperty;
6692
6311
  var __getOwnPropDesc$C = Object.getOwnPropertyDescriptor;
6693
6312
  var __decorateClass$C = (decorators, target, key, kind) => {
@@ -6767,7 +6386,7 @@ function composeTemplate(options = {}) {
6767
6386
  const template$x = composeTemplate();
6768
6387
 
6769
6388
  const definition$x = CounterBadge.compose({
6770
- name: `${FluentDesignSystem.prefix}-counter-badge`,
6389
+ name: tagName$x,
6771
6390
  template: template$x,
6772
6391
  styles: styles$w
6773
6392
  });
@@ -6779,12 +6398,13 @@ const DialogType = {
6779
6398
  nonModal: "non-modal",
6780
6399
  alert: "alert"
6781
6400
  };
6782
- function isDialog(element, tagName = "-dialog") {
6401
+ function isDialog(element, tagName2 = "-dialog") {
6783
6402
  if (element?.nodeType !== Node.ELEMENT_NODE) {
6784
6403
  return false;
6785
6404
  }
6786
- return element.tagName.toLowerCase().endsWith(tagName);
6405
+ return element.tagName.toLowerCase().endsWith(tagName2);
6787
6406
  }
6407
+ const tagName$w = `${FluentDesignSystem.prefix}-dialog`;
6788
6408
 
6789
6409
  var __defProp$B = Object.defineProperty;
6790
6410
  var __getOwnPropDesc$B = Object.getOwnPropertyDescriptor;
@@ -6904,17 +6524,18 @@ __decorateClass$B([attr], Dialog.prototype, "type", 2);
6904
6524
  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
6525
 
6906
6526
  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}}}`));
6527
+ @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
6528
 
6910
6529
  const definition$w = Dialog.compose({
6911
- name: `${FluentDesignSystem.prefix}-dialog`,
6530
+ name: tagName$w,
6912
6531
  template: template$w,
6913
6532
  styles: styles$v
6914
6533
  });
6915
6534
 
6916
6535
  definition$w.define(FluentDesignSystem.registry);
6917
6536
 
6537
+ const tagName$v = `${FluentDesignSystem.prefix}-dialog-body`;
6538
+
6918
6539
  class DialogBody extends FASTElement {
6919
6540
  /**
6920
6541
  * Handles click event for the close slot
@@ -6941,13 +6562,18 @@ const styles$u = css`
6941
6562
  :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
6563
 
6943
6564
  const definition$v = DialogBody.compose({
6944
- name: `${FluentDesignSystem.prefix}-dialog-body`,
6565
+ name: tagName$v,
6945
6566
  template: template$v,
6946
6567
  styles: styles$u
6947
6568
  });
6948
6569
 
6949
6570
  definition$v.define(FluentDesignSystem.registry);
6950
6571
 
6572
+ const Orientation = {
6573
+ horizontal: "horizontal",
6574
+ vertical: "vertical"
6575
+ };
6576
+
6951
6577
  const DividerRole = {
6952
6578
  /**
6953
6579
  * The divider semantically separates content
@@ -6959,6 +6585,7 @@ const DividerRole = {
6959
6585
  presentation: "presentation"
6960
6586
  };
6961
6587
  const DividerOrientation = Orientation;
6588
+ const tagName$u = `${FluentDesignSystem.prefix}-divider`;
6962
6589
 
6963
6590
  var __defProp$A = Object.defineProperty;
6964
6591
  var __getOwnPropDesc$A = Object.getOwnPropertyDescriptor;
@@ -7040,11 +6667,10 @@ const template$u = dividerTemplate();
7040
6667
  const styles$t = css`
7041
6668
  ${display("flex")}
7042
6669
 
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}`));
6670
+ :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
6671
 
7046
6672
  const definition$u = Divider.compose({
7047
- name: `${FluentDesignSystem.prefix}-divider`,
6673
+ name: tagName$u,
7048
6674
  template: template$u,
7049
6675
  styles: styles$t
7050
6676
  });
@@ -7066,6 +6692,7 @@ const DrawerType = {
7066
6692
  modal: "modal",
7067
6693
  inline: "inline"
7068
6694
  };
6695
+ const tagName$t = `${FluentDesignSystem.prefix}-drawer`;
7069
6696
 
7070
6697
  var __defProp$y = Object.defineProperty;
7071
6698
  var __getOwnPropDesc$y = Object.getOwnPropertyDescriptor;
@@ -7217,13 +6844,15 @@ function drawerTemplate() {
7217
6844
  const template$t = drawerTemplate();
7218
6845
 
7219
6846
  const definition$t = Drawer.compose({
7220
- name: `${FluentDesignSystem.prefix}-drawer`,
6847
+ name: tagName$t,
7221
6848
  template: template$t,
7222
6849
  styles: styles$s
7223
6850
  });
7224
6851
 
7225
6852
  definition$t.define(FluentDesignSystem.registry);
7226
6853
 
6854
+ const tagName$s = `${FluentDesignSystem.prefix}-drawer-body`;
6855
+
7227
6856
  class DrawerBody extends FASTElement {
7228
6857
  /**
7229
6858
  * Handles click event for the close slot
@@ -7242,58 +6871,172 @@ class DrawerBody extends FASTElement {
7242
6871
  }
7243
6872
  }
7244
6873
 
7245
- const styles$r = css`
7246
- ${display("grid")}
7247
- :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}`;
7248
-
7249
- function drawerBodyTemplate() {
7250
- return html`<div class="header" part="header"><slot name="title"></slot><slot name="close" @click="${(x, c) => x.clickHandler(c.event)}"></slot></div><div class="content" part="content"><slot></slot></div><div class="footer" part="footer"><slot name="footer"></slot></div>`;
7251
- }
7252
- const template$s = drawerBodyTemplate();
7253
-
7254
- const definition$s = DrawerBody.compose({
7255
- name: `${FluentDesignSystem.prefix}-drawer-body`,
7256
- template: template$s,
7257
- styles: styles$r
7258
- });
7259
-
7260
- definition$s.define(FluentDesignSystem.registry);
7261
-
7262
- function isListbox(element, tagName = "-listbox") {
7263
- if (element?.nodeType !== Node.ELEMENT_NODE) {
7264
- return false;
7265
- }
7266
- return element.tagName.toLowerCase().endsWith(tagName);
7267
- }
7268
-
7269
- function isDropdownOption(value, tagName = "-option") {
7270
- if (value?.nodeType !== Node.ELEMENT_NODE) {
7271
- return false;
7272
- }
7273
- return value.tagName.toLowerCase().endsWith(tagName);
7274
- }
7275
-
7276
- function getLanguage(rootNode) {
7277
- return rootNode.closest("[lang]")?.lang ?? "en";
7278
- }
7279
-
7280
- let uniqueIdCounter = 0;
7281
- function uniqueId(prefix = "id-") {
7282
- const str = `${prefix}${uniqueIdCounter++}`;
7283
- return document.getElementById(str) ? uniqueId(prefix) : str;
7284
- }
7285
-
7286
- const DropdownAppearance = {
7287
- filledDarker: "filled-darker",
7288
- filledLighter: "filled-lighter",
7289
- outline: "outline",
7290
- transparent: "transparent"
7291
- };
6874
+ const typographyBody1Styles = css.partial`
6875
+ font-family: ${fontFamilyBase};
6876
+ font-size: ${fontSizeBase300};
6877
+ line-height: ${lineHeightBase300};
6878
+ font-weight: ${fontWeightRegular};
6879
+ `;
6880
+ css.partial`
6881
+ font-family: ${fontFamilyBase};
6882
+ font-size: ${fontSizeBase300};
6883
+ line-height: ${lineHeightBase300};
6884
+ font-weight: ${fontWeightSemibold};
6885
+ `;
6886
+ css.partial`
6887
+ font-family: ${fontFamilyBase};
6888
+ font-size: ${fontSizeBase300};
6889
+ line-height: ${lineHeightBase300};
6890
+ font-weight: ${fontWeightBold};
6891
+ `;
6892
+ const typographyBody2Styles = css.partial`
6893
+ font-family: ${fontFamilyBase};
6894
+ font-size: ${fontSizeBase400};
6895
+ line-height: ${lineHeightBase400};
6896
+ font-weight: ${fontWeightRegular};
6897
+ `;
6898
+ const typographyCaption1Styles = css.partial`
6899
+ font-family: ${fontFamilyBase};
6900
+ font-size: ${fontSizeBase200};
6901
+ line-height: ${lineHeightBase200};
6902
+ font-weight: ${fontWeightRegular};
6903
+ `;
6904
+ css.partial`
6905
+ font-family: ${fontFamilyBase};
6906
+ font-size: ${fontSizeBase200};
6907
+ line-height: ${lineHeightBase200};
6908
+ font-weight: ${fontWeightSemibold};
6909
+ `;
6910
+ css.partial`
6911
+ font-family: ${fontFamilyBase};
6912
+ font-size: ${fontSizeBase200};
6913
+ line-height: ${lineHeightBase200};
6914
+ font-weight: ${fontWeightBold};
6915
+ `;
6916
+ css.partial`
6917
+ font-family: ${fontFamilyBase};
6918
+ font-size: ${fontSizeBase100};
6919
+ line-height: ${lineHeightBase100};
6920
+ font-weight: ${fontWeightRegular};
6921
+ `;
6922
+ css.partial`
6923
+ font-family: ${fontFamilyBase};
6924
+ font-size: ${fontSizeBase100};
6925
+ line-height: ${lineHeightBase100};
6926
+ font-weight: ${fontWeightSemibold};
6927
+ `;
6928
+ const typographySubtitle1Styles = css.partial`
6929
+ font-family: ${fontFamilyBase};
6930
+ font-size: ${fontSizeBase500};
6931
+ line-height: ${lineHeightBase500};
6932
+ font-weight: ${fontWeightSemibold};
6933
+ `;
6934
+ css.partial`
6935
+ font-family: ${fontFamilyBase};
6936
+ font-size: ${fontSizeBase400};
6937
+ line-height: ${lineHeightBase400};
6938
+ font-weight: ${fontWeightSemibold};
6939
+ `;
6940
+ css.partial`
6941
+ font-family: ${fontFamilyBase};
6942
+ font-size: ${fontSizeBase400};
6943
+ line-height: ${lineHeightBase400};
6944
+ font-weight: ${fontWeightBold};
6945
+ `;
6946
+ css.partial`
6947
+ font-family: ${fontFamilyBase};
6948
+ font-size: ${fontSizeHero800};
6949
+ line-height: ${lineHeightHero800};
6950
+ font-weight: ${fontWeightSemibold};
6951
+ `;
6952
+ css.partial`
6953
+ font-family: ${fontFamilyBase};
6954
+ font-size: ${fontSizeHero700};
6955
+ line-height: ${lineHeightHero700};
6956
+ font-weight: ${fontWeightSemibold};
6957
+ `;
6958
+ css.partial`
6959
+ font-family: ${fontFamilyBase};
6960
+ font-size: ${fontSizeBase600};
6961
+ line-height: ${lineHeightBase600};
6962
+ font-weight: ${fontWeightSemibold};
6963
+ `;
6964
+ css.partial`
6965
+ font-family: ${fontFamilyBase};
6966
+ font-size: ${fontSizeHero900};
6967
+ line-height: ${lineHeightHero900};
6968
+ font-weight: ${fontWeightSemibold};
6969
+ `;
6970
+ css.partial`
6971
+ font-family: ${fontFamilyBase};
6972
+ font-size: ${fontSizeHero1000};
6973
+ line-height: ${lineHeightHero1000};
6974
+ font-weight: ${fontWeightSemibold};
6975
+ `;
6976
+
6977
+ const styles$r = css`
6978
+ ${display("grid")}
6979
+ :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}`;
6980
+
6981
+ function drawerBodyTemplate() {
6982
+ return html`<div class="header" part="header"><slot name="title"></slot><slot name="close" @click="${(x, c) => x.clickHandler(c.event)}"></slot></div><div class="content" part="content"><slot></slot></div><div class="footer" part="footer"><slot name="footer"></slot></div>`;
6983
+ }
6984
+ const template$s = drawerBodyTemplate();
6985
+
6986
+ const definition$s = DrawerBody.compose({
6987
+ name: tagName$s,
6988
+ template: template$s,
6989
+ styles: styles$r
6990
+ });
6991
+
6992
+ definition$s.define(FluentDesignSystem.registry);
6993
+
6994
+ const DropdownAppearance = {
6995
+ filledDarker: "filled-darker",
6996
+ filledLighter: "filled-lighter",
6997
+ outline: "outline",
6998
+ transparent: "transparent"
6999
+ };
7292
7000
  const DropdownType = {
7293
7001
  combobox: "combobox",
7294
7002
  dropdown: "dropdown",
7295
7003
  select: "select"
7296
7004
  };
7005
+ const tagName$r = `${FluentDesignSystem.prefix}-dropdown`;
7006
+
7007
+ function isListbox(element, tagName2 = "-listbox") {
7008
+ if (element?.nodeType !== Node.ELEMENT_NODE) {
7009
+ return false;
7010
+ }
7011
+ return element.tagName.toLowerCase().endsWith(tagName2);
7012
+ }
7013
+ const tagName$q = `${FluentDesignSystem.prefix}-listbox`;
7014
+
7015
+ function isDropdownOption(value, tagName2 = "-option") {
7016
+ if (value?.nodeType !== Node.ELEMENT_NODE) {
7017
+ return false;
7018
+ }
7019
+ return value.tagName.toLowerCase().endsWith(tagName2);
7020
+ }
7021
+ const tagName$p = `${FluentDesignSystem.prefix}-option`;
7022
+
7023
+ const Direction = {
7024
+ ltr: "ltr",
7025
+ rtl: "rtl"
7026
+ };
7027
+ const getDirection = rootNode => {
7028
+ return rootNode.closest("[dir]")?.dir === "rtl" ? Direction.rtl : Direction.ltr;
7029
+ };
7030
+
7031
+ function getLanguage(rootNode) {
7032
+ return rootNode.closest("[lang]")?.lang ?? "en";
7033
+ }
7034
+
7035
+ let uniqueIdCounter = 0;
7036
+ function uniqueId(prefix = "id-") {
7037
+ const str = `${prefix}${uniqueIdCounter++}`;
7038
+ return document.getElementById(str) ? uniqueId(prefix) : str;
7039
+ }
7297
7040
 
7298
7041
  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
7042
  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")} />`;
@@ -8109,7 +7852,7 @@ const styles$q = css`
8109
7852
  :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
7853
 
8111
7854
  const definition$r = Dropdown.compose({
8112
- name: `${FluentDesignSystem.prefix}-dropdown`,
7855
+ name: tagName$r,
8113
7856
  template: template$r,
8114
7857
  styles: styles$q
8115
7858
  });
@@ -8134,6 +7877,7 @@ const ValidationFlags = {
8134
7877
  valueMissing: "value-missing",
8135
7878
  valid: "valid"
8136
7879
  };
7880
+ const tagName$o = `${FluentDesignSystem.prefix}-field`;
8137
7881
 
8138
7882
  var __defProp$v = Object.defineProperty;
8139
7883
  var __getOwnPropDesc$v = Object.getOwnPropertyDescriptor;
@@ -8287,7 +8031,7 @@ class BaseField extends FASTElement {
8287
8031
  */
8288
8032
  setLabelProperties() {
8289
8033
  if (this.$fastController.isConnected) {
8290
- this.input.id = this.input.id || uniqueId$1("input");
8034
+ this.input.id = this.input.id || uniqueId("input");
8291
8035
  this.labelSlot?.forEach(label => {
8292
8036
  if (label instanceof HTMLLabelElement) {
8293
8037
  label.htmlFor = label.htmlFor || this.input.id;
@@ -8353,7 +8097,7 @@ const template$q = html`<template @click="${(x, c) => x.clickHandler(c.event)}"
8353
8097
  })}></slot></template>`;
8354
8098
 
8355
8099
  const definition$q = Field.compose({
8356
- name: `${FluentDesignSystem.prefix}-field`,
8100
+ name: tagName$o,
8357
8101
  template: template$q,
8358
8102
  styles: styles$p,
8359
8103
  shadowOptions: {
@@ -8363,6 +8107,8 @@ const definition$q = Field.compose({
8363
8107
 
8364
8108
  definition$q.define(FluentDesignSystem.registry);
8365
8109
 
8110
+ const tagName$n = `${FluentDesignSystem.prefix}-image`;
8111
+
8366
8112
  var __defProp$t = Object.defineProperty;
8367
8113
  var __getOwnPropDesc$t = Object.getOwnPropertyDescriptor;
8368
8114
  var __decorateClass$t = (decorators, target, key, kind) => {
@@ -8390,13 +8136,15 @@ const styles$o = css`
8390
8136
  :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
8137
 
8392
8138
  const definition$p = Image.compose({
8393
- name: `${FluentDesignSystem.prefix}-image`,
8139
+ name: tagName$n,
8394
8140
  template: template$p,
8395
8141
  styles: styles$o
8396
8142
  });
8397
8143
 
8398
8144
  definition$p.define(FluentDesignSystem.registry);
8399
8145
 
8146
+ const tagName$m = `${FluentDesignSystem.prefix}-label`;
8147
+
8400
8148
  var __defProp$s = Object.defineProperty;
8401
8149
  var __getOwnPropDesc$s = Object.getOwnPropertyDescriptor;
8402
8150
  var __decorateClass$s = (decorators, target, key, kind) => {
@@ -8432,13 +8180,15 @@ function labelTemplate() {
8432
8180
  const template$o = labelTemplate();
8433
8181
 
8434
8182
  const definition$o = Label.compose({
8435
- name: `${FluentDesignSystem.prefix}-label`,
8183
+ name: tagName$m,
8436
8184
  template: template$o,
8437
8185
  styles: styles$n
8438
8186
  });
8439
8187
 
8440
8188
  definition$o.define(FluentDesignSystem.registry);
8441
8189
 
8190
+ const tagName$l = `${FluentDesignSystem.prefix}-link`;
8191
+
8442
8192
  var __defProp$r = Object.defineProperty;
8443
8193
  var __getOwnPropDesc$r = Object.getOwnPropertyDescriptor;
8444
8194
  var __decorateClass$r = (decorators, target, key, kind) => {
@@ -8461,8 +8211,7 @@ __decorateClass$r([attr({
8461
8211
  const styles$m = css`
8462
8212
  ${display("inline")}
8463
8213
 
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}`));
8214
+ :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
8215
 
8467
8216
  function anchorTemplate() {
8468
8217
  return html`<template tabindex="0" @click="${(x, c) => x.clickHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}"><slot></slot></template>`;
@@ -8470,7 +8219,7 @@ function anchorTemplate() {
8470
8219
  const template$n = anchorTemplate();
8471
8220
 
8472
8221
  const definition$n = Link.compose({
8473
- name: `${FluentDesignSystem.prefix}-link`,
8222
+ name: tagName$l,
8474
8223
  template: template$n,
8475
8224
  styles: styles$m
8476
8225
  });
@@ -8664,13 +8413,15 @@ function listboxTemplate() {
8664
8413
  const template$m = listboxTemplate();
8665
8414
 
8666
8415
  const definition$m = Listbox.compose({
8667
- name: `${FluentDesignSystem.prefix}-listbox`,
8416
+ name: tagName$q,
8668
8417
  template: template$m,
8669
8418
  styles: styles$l
8670
8419
  });
8671
8420
 
8672
8421
  definition$m.define(FluentDesignSystem.registry);
8673
8422
 
8423
+ const tagName$k = `${FluentDesignSystem.prefix}-menu-button`;
8424
+
8674
8425
  class MenuButton extends Button {}
8675
8426
 
8676
8427
  const template$l = buttonTemplate$1({
@@ -8683,7 +8434,7 @@ const template$l = buttonTemplate$1({
8683
8434
  });
8684
8435
 
8685
8436
  const definition$l = MenuButton.compose({
8686
- name: `${FluentDesignSystem.prefix}-menu-button`,
8437
+ name: tagName$k,
8687
8438
  template: template$l,
8688
8439
  styles: styles$C
8689
8440
  });
@@ -8709,12 +8460,13 @@ const MenuItemRole = {
8709
8460
  [MenuItemRole.menuitemcheckbox]: "menuitemcheckbox",
8710
8461
  [MenuItemRole.menuitemradio]: "menuitemradio"
8711
8462
  });
8712
- function isMenuItem(element, tagName = "-menu-item") {
8463
+ function isMenuItem(element, tagName2 = "-menu-item") {
8713
8464
  if (element?.nodeType !== Node.ELEMENT_NODE) {
8714
8465
  return false;
8715
8466
  }
8716
- return element.tagName.toLowerCase().endsWith(tagName);
8467
+ return element.tagName.toLowerCase().endsWith(tagName2);
8717
8468
  }
8469
+ const tagName$j = `${FluentDesignSystem.prefix}-menu-item`;
8718
8470
 
8719
8471
  var __defProp$p = Object.defineProperty;
8720
8472
  var __getOwnPropDesc$p = Object.getOwnPropertyDescriptor;
@@ -8743,17 +8495,17 @@ class MenuItem extends FASTElement {
8743
8495
  return false;
8744
8496
  }
8745
8497
  switch (e.key) {
8746
- case keyEnter:
8747
- case keySpace:
8498
+ case "Enter":
8499
+ case " ":
8748
8500
  this.invoke();
8749
8501
  return false;
8750
- case keyArrowRight:
8502
+ case "ArrowRight":
8751
8503
  if (!this.disabled) {
8752
8504
  this.submenu?.togglePopover(true);
8753
8505
  this.submenu?.focus();
8754
8506
  }
8755
8507
  return false;
8756
- case keyArrowLeft:
8508
+ case "ArrowLeft":
8757
8509
  if (this.parentElement?.hasAttribute("popover")) {
8758
8510
  this.parentElement.togglePopover(false);
8759
8511
  this.parentElement.parentElement?.focus();
@@ -8796,16 +8548,25 @@ class MenuItem extends FASTElement {
8796
8548
  * Setup required ARIA on open/close
8797
8549
  * @internal
8798
8550
  */
8799
- this.toggleHandler = e => {
8800
- if (e instanceof ToggleEvent && e.newState === "open") {
8801
- this.setAttribute("tabindex", "-1");
8551
+ this.handleToggle = e => {
8552
+ if (!(e instanceof ToggleEvent)) {
8553
+ return;
8554
+ }
8555
+ if (e.newState === "open") {
8802
8556
  this.elementInternals.ariaExpanded = "true";
8803
8557
  this.setSubmenuPosition();
8804
8558
  }
8805
- if (e instanceof ToggleEvent && e.newState === "closed") {
8559
+ if (e.newState === "closed") {
8806
8560
  this.elementInternals.ariaExpanded = "false";
8807
- this.setAttribute("tabindex", "0");
8808
8561
  }
8562
+ this.submenu?.setAttribute("focusgroup", e.newState === "open" ? "menu" : "none");
8563
+ };
8564
+ /** @internal */
8565
+ this.handleSubmenuFocusOut = e => {
8566
+ if (e.relatedTarget && this.submenu?.contains(e.relatedTarget)) {
8567
+ return;
8568
+ }
8569
+ this.submenu?.togglePopover(false);
8809
8570
  };
8810
8571
  /**
8811
8572
  * @internal
@@ -8892,11 +8653,14 @@ class MenuItem extends FASTElement {
8892
8653
  * @internal
8893
8654
  */
8894
8655
  slottedSubmenuChanged(prev, next) {
8895
- this.submenu?.removeEventListener("toggle", this.toggleHandler);
8656
+ this.submenu?.removeEventListener("toggle", this.handleToggle);
8657
+ this.submenu?.removeEventListener("focusout", this.handleSubmenuFocusOut);
8896
8658
  if (next.length) {
8897
8659
  this.submenu = next[0];
8898
8660
  this.submenu.toggleAttribute("popover", true);
8899
- this.submenu.addEventListener("toggle", this.toggleHandler);
8661
+ this.submenu.setAttribute("focusgroup", "none");
8662
+ this.submenu.addEventListener("toggle", this.handleToggle);
8663
+ this.submenu.addEventListener("focusout", this.handleSubmenuFocusOut);
8900
8664
  this.elementInternals.ariaHasPopup = "menu";
8901
8665
  toggleState(this.elementInternals, "submenu", true);
8902
8666
  } else {
@@ -8927,13 +8691,12 @@ applyMixins(MenuItem, StartEnd);
8927
8691
  const styles$k = css`
8928
8692
  ${display("grid")}
8929
8693
 
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}`));
8694
+ :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}}`;
8932
8695
 
8933
8696
  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
8697
  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
8698
  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({
8699
+ 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({
8937
8700
  property: "slottedSubmenu"
8938
8701
  })}></slot></template>`;
8939
8702
  }
@@ -8943,13 +8706,493 @@ const template$k = menuItemTemplate({
8943
8706
  });
8944
8707
 
8945
8708
  const definition$k = MenuItem.compose({
8946
- name: `${FluentDesignSystem.prefix}-menu-item`,
8709
+ name: tagName$j,
8947
8710
  template: template$k,
8948
8711
  styles: styles$k
8949
8712
  });
8950
8713
 
8951
8714
  definition$k.define(FluentDesignSystem.registry);
8952
8715
 
8716
+ const tagName$i = `${FluentDesignSystem.prefix}-menu-list`;
8717
+
8718
+ //#region src/constants.js
8719
+ /** @enum {string} */
8720
+ var DatasetName = {
8721
+ INFERRED_ROLE: "data-fg-ir",
8722
+ ITEM: "data-fg-item",
8723
+ AUTHOR_TABINDEX: "data-fg-ati",
8724
+ SEGMENT: "data-fg-seg",
8725
+ SEGMENT_START: "data-fg-segs"
8726
+ };
8727
+ /** @enum {string} */
8728
+ var BehaviorToken = {
8729
+ TOOLBAR: "toolbar",
8730
+ TABLIST: "tablist",
8731
+ RADIOGROUP: "radiogroup",
8732
+ LISTBOX: "listbox",
8733
+ MENU: "menu",
8734
+ MENUBAR: "menubar",
8735
+ NONE: "none"
8736
+ };
8737
+
8738
+ //#region src/shadow-utils/index-shadowless.js
8739
+ function nodeContains(node, otherNode) {
8740
+ return node.contains(otherNode);
8741
+ }
8742
+
8743
+ /**
8744
+ * Whether the current user agent supports focusgroup.
8745
+ *
8746
+ * @returns {boolean}
8747
+ */
8748
+ function supportsFocusGroup() {
8749
+ return "focusgroup" in (globalThis?.HTMLElement?.prototype ?? {});
8750
+ }
8751
+ /**
8752
+ * Gets the navigation direction (“forward” or “backward”) based on:
8753
+ *
8754
+ * - The key that the user just pressed
8755
+ * - The owner element’s writing mode and direction
8756
+ * - The current focus group’s directional limit (“inline”, “block”, none)
8757
+ *
8758
+ * @param {KeyboardEvent} event - The keyboard event object.
8759
+ * @param {HTMLElement} owner - The owner element.
8760
+ * @param {("inline" | "block" | undefined)} axis - The directional limitation.
8761
+ * @returns {("forward" | "backward" | "start" | "end" | null)} Returns `null`
8762
+ * if there shouldn’t be navigation, e.g. when directional limit applies.
8763
+ */
8764
+ function getNavigationDirection(event, owner, axis) {
8765
+ const FORWARD = "forward";
8766
+ const BACKWARD = "backward";
8767
+ const BLOCK = "block";
8768
+ const INLINE = "inline";
8769
+ if (isKeyConflictElement(event.composedPath()[0])) return event.key === "Tab" ? event.shiftKey ? BACKWARD : FORWARD : null;
8770
+ if (event.shiftKey || event.ctrlKey || event.metaKey) return null;
8771
+ const {
8772
+ writingMode,
8773
+ direction
8774
+ } = window.getComputedStyle(owner);
8775
+ const isVertical = !writingMode.startsWith("horizontal-");
8776
+ const isRtl = direction === "rtl";
8777
+ const horizontal = isVertical ? BLOCK : INLINE;
8778
+ const vertical = isVertical ? INLINE : BLOCK;
8779
+ const isHorizontalReversed = isVertical ? writingMode.endsWith("-rl") !== isRtl : isRtl;
8780
+ const isVerticalReversed = isVertical && isRtl;
8781
+ const action = {
8782
+ ArrowUp: {
8783
+ axis: vertical,
8784
+ dir: isVerticalReversed ? FORWARD : BACKWARD
8785
+ },
8786
+ ArrowDown: {
8787
+ axis: vertical,
8788
+ dir: isVerticalReversed ? BACKWARD : FORWARD
8789
+ },
8790
+ ArrowLeft: {
8791
+ axis: horizontal,
8792
+ dir: isHorizontalReversed ? FORWARD : BACKWARD
8793
+ },
8794
+ ArrowRight: {
8795
+ axis: horizontal,
8796
+ dir: isHorizontalReversed ? BACKWARD : FORWARD
8797
+ },
8798
+ Home: {
8799
+ dir: "start"
8800
+ },
8801
+ End: {
8802
+ dir: "end"
8803
+ }
8804
+ }[event.key];
8805
+ if (!action || axis && action.axis && action.axis !== axis) return null;
8806
+ return action.dir;
8807
+ }
8808
+ /**
8809
+ * Whether a given element has keyboard conflicts with navigation keys, in which
8810
+ * case they should be considered as segmentors.
8811
+ *
8812
+ * @param {HTMLElement} element
8813
+ * @returns {boolean}
8814
+ */
8815
+ function isKeyConflictElement(el) {
8816
+ 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));
8817
+ }
8818
+
8819
+ //#region src/global-state.js
8820
+ /**
8821
+ * @type {{ o: Set<MutationObserver>, m?: Map<HTMLElement, *>, g?: MutationObserver, b: boolean }}
8822
+ * @global
8823
+ */
8824
+ globalThis.__FOCUSGROUP_POLYFILL__ ??= {
8825
+ o: /* @__PURE__ */new Set(),
8826
+ b: false
8827
+ };
8828
+ var state = globalThis.__FOCUSGROUP_POLYFILL__;
8829
+
8830
+ //#region src/observer-registry.js
8831
+ /** @type {Set<MutationObserver>} */
8832
+ var observers = state.o;
8833
+ /**
8834
+ * Flushes all globally registered focusgroup MutationObservers by calling
8835
+ * `takeRecords()` on each, discarding any pending mutation records that were
8836
+ * caused by polyfill-managed attribute writes. This prevents infinite
8837
+ * cross-group loops between nested focusgroups whose subtrees overlap.
8838
+ */
8839
+ function flushAllObservers() {
8840
+ for (const observer of observers) observer.takeRecords();
8841
+ }
8842
+
8843
+ //#region src/focusgroup.js
8844
+ /**
8845
+ * @import {
8846
+ * FocusGroupItemCollection,
8847
+ * FocusGroupOptions,
8848
+ * FocusGroupUpdateInfo,
8849
+ * } from "./focusgroup-items.js"
8850
+ * @import {FocusGroupDefinition} from "./utils.js"
8851
+ */
8852
+ var FocusGroup = class {
8853
+ /**
8854
+ * The focus group owner element.
8855
+ * @type {HTMLElement!}
8856
+ */
8857
+ #owner;
8858
+ /**
8859
+ * The items collection — exposes the focus group's items and answers
8860
+ * queries about them. Reconciliation is triggered externally via
8861
+ * `FocusGroup#update()`.
8862
+ * @type {FocusGroupItemCollection}
8863
+ */
8864
+ #items;
8865
+ /**
8866
+ * The focus group behavior.
8867
+ * @type {BehaviorToken!}
8868
+ */
8869
+ #behavior = BehaviorToken.NONE;
8870
+ /**
8871
+ * The focus group navigation axis limitation.
8872
+ * @type {("inline" | "block" | undefined)}
8873
+ */
8874
+ #axis = void 0;
8875
+ /**
8876
+ * Whether the focus group wraps. Defaults to `false`.
8877
+ * @type {boolean}
8878
+ */
8879
+ #wrap = false;
8880
+ /**
8881
+ * Whether the focus group remembers the previously focused element.
8882
+ * Defaults to `true`.
8883
+ * @type {boolean}
8884
+ */
8885
+ #memory = true;
8886
+ /**
8887
+ * The focus group start element (initial tab stop after decoration).
8888
+ * @type {HTMLElement}
8889
+ */
8890
+ #start;
8891
+ /**
8892
+ * The current item — the most recently focused item within the group.
8893
+ * Serves as the keyboard-navigation cursor while focus is inside, and (in
8894
+ * memory mode) as the tab stop to restore on re-entry. Updated by
8895
+ * `#handleFocusin`, plus directly by `#handleKeydown` for shadow-internal
8896
+ * navigation (where focus events don't cross the shadow boundary).
8897
+ * Cleared in nomemory mode on focusout and when validation fails after
8898
+ * re-decoration.
8899
+ * @type {HTMLElement|null}
8900
+ */
8901
+ #current = null;
8902
+ /**
8903
+ * Whether the owner currently has `tabindex=0` set as a Tab-entry proxy so
8904
+ * sequential focus navigation can reach a tab stop inside a shadow root.
8905
+ * @type {boolean}
8906
+ */
8907
+ #ownerIsProxy = false;
8908
+ /**
8909
+ * The owner's original `tabindex` attribute value (or `null` if it had no
8910
+ * `tabindex`), saved before the polyfill sets `tabindex=0` for proxy duty.
8911
+ * @type {string|null}
8912
+ */
8913
+ #ownerTabindexBeforeProxy = null;
8914
+ /**
8915
+ * The abort controller for when `disconnect()` is called.
8916
+ * @type {AbortController}
8917
+ */
8918
+ #abort = new AbortController();
8919
+ /**
8920
+ * Optional owner-decoration hook injected via `options.decorateOwner`.
8921
+ * Called with `(owner, behavior)` on decoration and `(owner, null)` on
8922
+ * undecoration. When absent, no owner decoration happens.
8923
+ * @type {((element: HTMLElement, behavior: BehaviorToken|null) => void) | undefined}
8924
+ */
8925
+ #decorateOwner;
8926
+ /**
8927
+ * Optional item-decoration hook injected via `options.decorateItem`.
8928
+ * Called with `(item, behavior)` on decoration and `(item, null)` on
8929
+ * undecoration. When absent, no item decoration happens.
8930
+ * @type {((element: HTMLElement, behavior: BehaviorToken|null) => void) | undefined}
8931
+ */
8932
+ #decorateItem;
8933
+ /**
8934
+ * @param {HTMLElement!} owner - The focus group owner element.
8935
+ * @param {FocusGroupItemCollection} items - The items collection providing
8936
+ * item discovery and queries.
8937
+ * @param {FocusGroupOptions} [options]
8938
+ */
8939
+ constructor(owner, items, options = {}) {
8940
+ if (supportsFocusGroup() || !owner) return;
8941
+ this.#owner = owner;
8942
+ this.#items = items;
8943
+ this.#decorateOwner = options.decorateOwner;
8944
+ this.#decorateItem = options.decorateItem;
8945
+ this.#updateDefinition(options.definition);
8946
+ this.#decorateOwner?.(this.#owner, this.#behavior);
8947
+ this.#decorateItems();
8948
+ const opts = {
8949
+ signal: this.#abort.signal
8950
+ };
8951
+ this.#owner.addEventListener("keydown", this.#handleKeydown.bind(this), opts);
8952
+ this.#owner.addEventListener("focusin", this.#handleFocusin.bind(this), opts);
8953
+ this.#owner.addEventListener("focusout", this.#handleFocusout.bind(this), opts);
8954
+ }
8955
+ /**
8956
+ * Tears down the focus group: disables the owner proxy, removes all event
8957
+ * listeners (via the abort signal), then disconnects the items collection
8958
+ * if it supports it.
8959
+ *
8960
+ * Ordering matters: owner-proxy teardown can trigger `flushAllObservers()`,
8961
+ * which expects the items' observer to still be in the global registry.
8962
+ * The items' own `disconnect()` is therefore called last.
8963
+ *
8964
+ * NOTE: This method does not undecorate the elements. Call it only after
8965
+ * the focusgroup owner has been removed from the DOM.
8966
+ */
8967
+ disconnect() {
8968
+ this.#disableFocusabilityProxy();
8969
+ this.#abort.abort();
8970
+ this.#items?.disconnect?.();
8971
+ this.#owner = null;
8972
+ }
8973
+ /**
8974
+ * Reconciles decoration state in response to relevant changes. Call this
8975
+ * whenever the focus group should refresh — e.g. items were added or
8976
+ * removed, the owner's `focusgroup` attribute changed, or an author set
8977
+ * `tabindex` on a decorated item.
8978
+ *
8979
+ * The polyfill's default `TreeWalkerItemCollection` calls this from a
8980
+ * `MutationObserver`. App-supplied collections (or app code that knows
8981
+ * when its model changed) can call it directly.
8982
+ *
8983
+ * @param {FocusGroupUpdateInfo} [info]
8984
+ */
8985
+ update(info = {}) {
8986
+ if (!this.#owner) return;
8987
+ if (info.definition !== void 0) {
8988
+ this.#updateDefinition(info.definition);
8989
+ this.#decorateOwner?.(this.#owner, this.#behavior);
8990
+ }
8991
+ if (info.authorTabindexChanges) for (const el of info.authorTabindexChanges) el.setAttribute(DatasetName.AUTHOR_TABINDEX, el.getAttribute("tabindex") ?? "none");
8992
+ this.#undecorateItems();
8993
+ this.#decorateItems();
8994
+ }
8995
+ /** @param {FocusGroupDefinition} [def] */
8996
+ #updateDefinition(def) {
8997
+ this.#behavior = def?.behavior ?? BehaviorToken.NONE;
8998
+ this.#wrap = def?.wrap ?? false;
8999
+ this.#axis = def?.axis;
9000
+ this.#memory = def?.memory ?? true;
9001
+ if (!this.#memory) this.#current = null;
9002
+ }
9003
+ #decorateItems() {
9004
+ if (this.#behavior === BehaviorToken.NONE) {
9005
+ this.#undecorateItems();
9006
+ return;
9007
+ }
9008
+ this.#items.decorate?.();
9009
+ for (const {
9010
+ element,
9011
+ segmentBoundary
9012
+ } of this.#items.items()) {
9013
+ this.#decorateItem?.(element, this.#behavior);
9014
+ element.setAttribute(DatasetName.AUTHOR_TABINDEX, element.getAttribute("tabindex") ?? "none");
9015
+ element.tabIndex = segmentBoundary ? 0 : -1;
9016
+ }
9017
+ if (!this.#current?.isConnected || !(this.#items.isItem?.(this.#current) ?? this.#items.contains(this.#current))) this.#current = null;
9018
+ const startItem = this.#current ?? this.#items.start ?? this.#items.first?.() ?? null;
9019
+ if (startItem) {
9020
+ startItem.tabIndex = 0;
9021
+ this.#start = startItem;
9022
+ this.#disableFocusabilityProxy();
9023
+ this.#enableFocusabilityProxy(startItem);
9024
+ }
9025
+ this.#items.flush?.();
9026
+ }
9027
+ #undecorateItems() {
9028
+ this.#disableFocusabilityProxy();
9029
+ let undecorated = false;
9030
+ for (const {
9031
+ element
9032
+ } of this.#items.items()) {
9033
+ undecorated = true;
9034
+ this.#decorateItem?.(element, null);
9035
+ const authorTabIndex = element.getAttribute(DatasetName.AUTHOR_TABINDEX);
9036
+ if (authorTabIndex) {
9037
+ if (authorTabIndex === "none") element.removeAttribute("tabindex");else element.setAttribute("tabindex", authorTabIndex);
9038
+ element.removeAttribute(DatasetName.AUTHOR_TABINDEX);
9039
+ }
9040
+ }
9041
+ this.#items.undecorate?.();
9042
+ if (undecorated) this.#items.flush?.();
9043
+ }
9044
+ /** @param {KeyboardEvent} evt */
9045
+ #handleKeydown(evt) {
9046
+ const current = evt.composedPath()[0];
9047
+ if (evt.defaultPrevented || current === this.#owner) return;
9048
+ if (!this.#items.contains(current)) return;
9049
+ let target;
9050
+ switch (getNavigationDirection(evt, current, this.#axis)) {
9051
+ case "start":
9052
+ target = this.#items.first();
9053
+ break;
9054
+ case "end":
9055
+ target = this.#items.last();
9056
+ break;
9057
+ case "forward":
9058
+ target = this.#items.next(current);
9059
+ if (!target && this.#wrap) target = this.#items.first();
9060
+ break;
9061
+ case "backward":
9062
+ target = this.#items.previous(current);
9063
+ if (!target && this.#wrap) target = this.#items.last();
9064
+ break;
9065
+ }
9066
+ if (target && target !== current) {
9067
+ this.#advanceFocus(current, target, true);
9068
+ this.#current = target;
9069
+ evt.preventDefault();
9070
+ }
9071
+ }
9072
+ /** @param {FocusEvent} evt */
9073
+ #handleFocusin(evt) {
9074
+ const target = evt.composedPath()[0];
9075
+ if (target === this.#owner && this.#ownerIsProxy && (!evt.relatedTarget || !nodeContains(this.#owner, evt.relatedTarget))) {
9076
+ const tabStop = this.#current || this.#start;
9077
+ this.#disableFocusabilityProxy();
9078
+ if (tabStop) tabStop.focus();
9079
+ evt.stopPropagation();
9080
+ return;
9081
+ }
9082
+ if (!this.#items.contains(target)) return;
9083
+ if (this.#ownerIsProxy) this.#disableFocusabilityProxy();
9084
+ const prev = this.#current;
9085
+ this.#current = target;
9086
+ if (prev === target) return;
9087
+ if (target.tabIndex < 0) {
9088
+ const transferFrom = prev ?? this.#start;
9089
+ if (transferFrom) this.#advanceFocus(transferFrom, target);
9090
+ }
9091
+ }
9092
+ /** @param {FocusEvent} evt */
9093
+ #handleFocusout(evt) {
9094
+ if (!evt.relatedTarget || !nodeContains(this.#owner, evt.relatedTarget)) {
9095
+ const tabStop = this.#memory ? this.#current || this.#start : this.#start;
9096
+ if (tabStop) this.#enableFocusabilityProxy(tabStop);
9097
+ }
9098
+ if (evt.relatedTarget && nodeContains(this.#owner, evt.relatedTarget) || this.#memory || !this.#start) return;
9099
+ const prev = this.#current;
9100
+ this.#current = null;
9101
+ const nextStart = this.#items.start ?? this.#items.first?.() ?? null;
9102
+ if (prev !== this.#start || nextStart !== this.#start) {
9103
+ for (const {
9104
+ element,
9105
+ segmentBoundary
9106
+ } of this.#items.items()) element.tabIndex = segmentBoundary ? 0 : -1;
9107
+ if (nextStart) {
9108
+ nextStart.tabIndex = 0;
9109
+ this.#start = nextStart;
9110
+ }
9111
+ this.#items.flush?.();
9112
+ }
9113
+ }
9114
+ /**
9115
+ * If the tab stop is inside a shadow DOM, sets `tabindex=0` on the
9116
+ * focusgroup owner so the browser's Tab navigation can land on it, at
9117
+ * which point `#handleFocusin` will redirect focus to the real tab stop.
9118
+ * @param {HTMLElement} tabStop - The actual focusable tab stop element.
9119
+ */
9120
+ #enableFocusabilityProxy(tabStop) {
9121
+ const rootNode = (tabStop.assignedSlot ?? tabStop).getRootNode();
9122
+ const hasFocusableHost = rootNode instanceof ShadowRoot && rootNode.host.hasAttribute(DatasetName.AUTHOR_TABINDEX);
9123
+ if (this.#ownerIsProxy || !hasFocusableHost) return;
9124
+ this.#ownerTabindexBeforeProxy = this.#owner.getAttribute("tabindex");
9125
+ this.#owner.tabIndex = 0;
9126
+ this.#ownerIsProxy = true;
9127
+ flushAllObservers();
9128
+ }
9129
+ /** Undoes `#enableFocusabilityProxy`. */
9130
+ #disableFocusabilityProxy() {
9131
+ if (!this.#ownerIsProxy) return;
9132
+ if (this.#ownerTabindexBeforeProxy !== null) this.#owner.setAttribute("tabindex", this.#ownerTabindexBeforeProxy);else this.#owner.removeAttribute("tabindex");
9133
+ this.#ownerIsProxy = false;
9134
+ this.#ownerTabindexBeforeProxy = null;
9135
+ this.#items.flush?.();
9136
+ flushAllObservers();
9137
+ }
9138
+ /**
9139
+ * Advances the focusgroup's active tab stop from one item to another. Sets
9140
+ * the target's `tabindex` to `0` and optionally calls `focus()` on it. The
9141
+ * previous item's `tabindex` is set to `-1` unless it belongs to a different
9142
+ * segment (in which case it remains `0` as a segment tab stop). Also disables
9143
+ * the owner proxy.
9144
+ *
9145
+ * @param {HTMLElement} prev - The currently focused item.
9146
+ * @param {HTMLElement} next - The item to receive focus.
9147
+ * @param {boolean} [shouldCallFocus=false] - Whether to programmatically
9148
+ * call `focus()` on the target element.
9149
+ */
9150
+ #advanceFocus(prev, next, shouldCallFocus = false) {
9151
+ next.tabIndex = 0;
9152
+ if (shouldCallFocus) next.focus();
9153
+ prev.tabIndex = this.#items.sameSegment?.(prev, next) ?? true ? -1 : 0;
9154
+ this.#disableFocusabilityProxy();
9155
+ flushAllObservers();
9156
+ }
9157
+ };
9158
+
9159
+ class ArrayItemCollection {
9160
+ constructor(getItems, getStart) {
9161
+ this.getItems = getItems;
9162
+ this.getStart = getStart;
9163
+ }
9164
+ get start() {
9165
+ return this.getStart?.() ?? null;
9166
+ }
9167
+ first() {
9168
+ return this.getItems()[0] ?? null;
9169
+ }
9170
+ last() {
9171
+ const items = this.getItems();
9172
+ return items[items.length - 1] ?? null;
9173
+ }
9174
+ next(current) {
9175
+ const items = this.getItems();
9176
+ const i = items.indexOf(current);
9177
+ return i === -1 ? null : items[i + 1] ?? null;
9178
+ }
9179
+ previous(current) {
9180
+ const items = this.getItems();
9181
+ const i = items.indexOf(current);
9182
+ return i <= 0 ? null : items[i - 1] ?? null;
9183
+ }
9184
+ *items() {
9185
+ for (const element of this.getItems()) {
9186
+ yield {
9187
+ element
9188
+ };
9189
+ }
9190
+ }
9191
+ contains(element) {
9192
+ return this.getItems().includes(element);
9193
+ }
9194
+ }
9195
+
8953
9196
  var __defProp$o = Object.defineProperty;
8954
9197
  var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor;
8955
9198
  var __decorateClass$o = (decorators, target, key, kind) => {
@@ -8967,52 +9210,27 @@ const _BaseMenuList = class _BaseMenuList extends FASTElement {
8967
9210
  * @internal
8968
9211
  */
8969
9212
  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
9213
  /**
8976
9214
  * @internal
8977
9215
  */
8978
9216
  this.isNestedMenu = () => {
8979
9217
  return this.parentElement !== null && isHTMLElement(this.parentElement) && this.parentElement.getAttribute("role") === "menuitem";
8980
9218
  };
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
9219
  /**
9002
9220
  * Handle change from child MenuItem element and set radio group behavior
9003
9221
  */
9004
9222
  this.changedMenuItemHandler = e => {
9005
- if (this.menuItems === void 0) {
9223
+ if (this.menuChildren === void 0) {
9006
9224
  return;
9007
9225
  }
9008
9226
  const changedMenuItem = e.target;
9009
- const changeItemIndex = this.menuItems.indexOf(changedMenuItem);
9227
+ const changeItemIndex = this.menuChildren.indexOf(changedMenuItem);
9010
9228
  if (changeItemIndex === -1) {
9011
9229
  return;
9012
9230
  }
9013
9231
  if (changedMenuItem.role === "menuitemradio" && changedMenuItem.checked === true) {
9014
9232
  for (let i = changeItemIndex - 1; i >= 0; --i) {
9015
- const item = this.menuItems[i];
9233
+ const item = this.menuChildren[i];
9016
9234
  const role = item.role;
9017
9235
  if (role === MenuItemRole.menuitemradio) {
9018
9236
  item.checked = false;
@@ -9021,9 +9239,9 @@ const _BaseMenuList = class _BaseMenuList extends FASTElement {
9021
9239
  break;
9022
9240
  }
9023
9241
  }
9024
- const maxIndex = this.menuItems.length - 1;
9242
+ const maxIndex = this.menuChildren.length - 1;
9025
9243
  for (let i = changeItemIndex + 1; i <= maxIndex; ++i) {
9026
- const item = this.menuItems[i];
9244
+ const item = this.menuChildren[i];
9027
9245
  const role = item.role;
9028
9246
  if (role === MenuItemRole.menuitemradio) {
9029
9247
  item.checked = false;
@@ -9034,22 +9252,10 @@ const _BaseMenuList = class _BaseMenuList extends FASTElement {
9034
9252
  }
9035
9253
  }
9036
9254
  };
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
9255
  this.elementInternals.role = "menu";
9050
9256
  }
9051
9257
  itemsChanged(oldValue, newValue) {
9052
- if (this.$fastController.isConnected && this.menuItems !== void 0) {
9258
+ if (this.$fastController.isConnected && this.menuChildren !== void 0) {
9053
9259
  this.setItems();
9054
9260
  }
9055
9261
  }
@@ -9068,8 +9274,7 @@ const _BaseMenuList = class _BaseMenuList extends FASTElement {
9068
9274
  */
9069
9275
  disconnectedCallback() {
9070
9276
  super.disconnectedCallback();
9071
- this.removeItemListeners();
9072
- this.menuItems = void 0;
9277
+ this.menuChildren = void 0;
9073
9278
  this.removeEventListener("change", this.changedMenuItemHandler);
9074
9279
  }
9075
9280
  /**
@@ -9078,37 +9283,7 @@ const _BaseMenuList = class _BaseMenuList extends FASTElement {
9078
9283
  * @public
9079
9284
  */
9080
9285
  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
- });
9286
+ this.menuItems?.find(item => !item.disabled)?.focus();
9112
9287
  }
9113
9288
  static elementIndent(el) {
9114
9289
  const role = el.role;
@@ -9120,24 +9295,13 @@ const _BaseMenuList = class _BaseMenuList extends FASTElement {
9120
9295
  }
9121
9296
  setItems() {
9122
9297
  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) => {
9298
+ this.menuChildren = children.filter(child => !child.hasAttribute("hidden"));
9299
+ this.menuItems = this.menuChildren?.filter(this.isMenuItemElement);
9300
+ const indent = this.menuItems?.reduce((accum, current) => {
9137
9301
  const elementValue = _BaseMenuList.elementIndent(current);
9138
9302
  return Math.max(accum, elementValue);
9139
9303
  }, 0);
9140
- filteredMenuListItems?.forEach(item => {
9304
+ this.menuItems?.forEach(item => {
9141
9305
  item.dataset.indent = `${indent}`;
9142
9306
  });
9143
9307
  }
@@ -9149,30 +9313,38 @@ const _BaseMenuList = class _BaseMenuList extends FASTElement {
9149
9313
  this.setItems();
9150
9314
  }
9151
9315
  }
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
- }
9316
+ /**
9317
+ * check if the item is a menu item
9318
+ */
9319
+ isMenuItemElement(el) {
9320
+ return isMenuItem(el) || isHTMLElement(el) && !!el.role && el.role in _BaseMenuList.focusableElementRoles;
9169
9321
  }
9170
9322
  };
9171
9323
  _BaseMenuList.focusableElementRoles = MenuItemRole;
9172
9324
  __decorateClass$o([observable], _BaseMenuList.prototype, "items", 2);
9173
9325
  let BaseMenuList = _BaseMenuList;
9174
9326
 
9175
- class MenuList extends BaseMenuList {}
9327
+ class MenuList extends BaseMenuList {
9328
+ disconnectedCallback() {
9329
+ this.fg?.disconnect();
9330
+ super.disconnectedCallback();
9331
+ }
9332
+ setItems() {
9333
+ super.setItems();
9334
+ this.fgItems ?? (this.fgItems = new ArrayItemCollection(() => this.menuItems?.filter(i => !i.hidden) ?? []));
9335
+ if (!this.fg) {
9336
+ this.fg = new FocusGroup(this, this.fgItems, {
9337
+ definition: {
9338
+ behavior: "menu",
9339
+ axis: "block",
9340
+ wrap: true
9341
+ }
9342
+ });
9343
+ } else {
9344
+ this.fg.update();
9345
+ }
9346
+ }
9347
+ }
9176
9348
 
9177
9349
  const styles$j = css`
9178
9350
  ${display("flex")}
@@ -9180,18 +9352,20 @@ const styles$j = css`
9180
9352
  :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
9353
 
9182
9354
  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>`;
9355
+ return html`<template focusgroup="menu" slot="${x => x.slot ? x.slot : x.isNestedMenu() ? "submenu" : void 0}"><slot ${slotted("items")}></slot></template>`;
9184
9356
  }
9185
9357
  const template$j = menuTemplate$1();
9186
9358
 
9187
9359
  const definition$j = MenuList.compose({
9188
- name: `${FluentDesignSystem.prefix}-menu-list`,
9360
+ name: tagName$i,
9189
9361
  template: template$j,
9190
9362
  styles: styles$j
9191
9363
  });
9192
9364
 
9193
9365
  definition$j.define(FluentDesignSystem.registry);
9194
9366
 
9367
+ const tagName$h = `${FluentDesignSystem.prefix}-menu`;
9368
+
9195
9369
  var __defProp$n = Object.defineProperty;
9196
9370
  var __getOwnPropDesc$n = Object.getOwnPropertyDescriptor;
9197
9371
  var __decorateClass$n = (decorators, target, key, kind) => {
@@ -9249,9 +9423,10 @@ class Menu extends FASTElement {
9249
9423
  */
9250
9424
  this.toggleHandler = e => {
9251
9425
  if (e.type === "toggle" && e.newState) {
9252
- const newState = e.newState === "open";
9253
- this._trigger?.setAttribute("aria-expanded", `${newState}`);
9254
- this._open = newState;
9426
+ const open = e.newState === "open";
9427
+ this._trigger?.setAttribute("aria-expanded", `${open}`);
9428
+ this._menuList?.setAttribute("focusgroup", open ? "menu" : "none");
9429
+ this._open = open;
9255
9430
  if (this._open) {
9256
9431
  this.focusMenuList();
9257
9432
  }
@@ -9270,8 +9445,8 @@ class Menu extends FASTElement {
9270
9445
  }
9271
9446
  const key = e.key;
9272
9447
  switch (key) {
9273
- case keySpace:
9274
- case keyEnter:
9448
+ case " ":
9449
+ case "Enter":
9275
9450
  e.preventDefault();
9276
9451
  this.toggleMenu();
9277
9452
  break;
@@ -9488,14 +9663,14 @@ class Menu extends FASTElement {
9488
9663
  }
9489
9664
  const key = e.key;
9490
9665
  switch (key) {
9491
- case keyEscape:
9666
+ case "Escape":
9492
9667
  e.preventDefault();
9493
9668
  if (this._open) {
9494
9669
  this.closeMenu();
9495
9670
  this.focusTrigger();
9496
9671
  }
9497
9672
  break;
9498
- case keyTab:
9673
+ case "Tab":
9499
9674
  if (this._open) this.closeMenu();
9500
9675
  if (e.shiftKey && e.composedPath()[0] !== this._trigger && e.composedPath()[0].assignedSlot !== this.primaryAction) {
9501
9676
  this.focusTrigger();
@@ -9547,13 +9722,15 @@ function menuTemplate() {
9547
9722
  const template$i = menuTemplate();
9548
9723
 
9549
9724
  const definition$i = Menu.compose({
9550
- name: `${FluentDesignSystem.prefix}-menu`,
9725
+ name: tagName$h,
9551
9726
  template: template$i,
9552
9727
  styles: styles$i
9553
9728
  });
9554
9729
 
9555
9730
  definition$i.define(FluentDesignSystem.registry);
9556
9731
 
9732
+ const tagName$g = `${FluentDesignSystem.prefix}-message-bar`;
9733
+
9557
9734
  var __defProp$m = Object.defineProperty;
9558
9735
  var __getOwnPropDesc$m = Object.getOwnPropertyDescriptor;
9559
9736
  var __decorateClass$m = (decorators, target, key, kind) => {
@@ -9596,7 +9773,7 @@ function messageBarTemplate() {
9596
9773
  const template$h = messageBarTemplate();
9597
9774
 
9598
9775
  const definition$h = MessageBar.compose({
9599
- name: `${FluentDesignSystem.prefix}-message-bar`,
9776
+ name: tagName$g,
9600
9777
  template: template$h,
9601
9778
  styles: styles$h,
9602
9779
  shadowOptions: {
@@ -9889,7 +10066,7 @@ const template$g = dropdownOptionTemplate({
9889
10066
  });
9890
10067
 
9891
10068
  const definition$g = DropdownOption.compose({
9892
- name: `${FluentDesignSystem.prefix}-option`,
10069
+ name: tagName$p,
9893
10070
  template: template$g,
9894
10071
  styles: styles$g
9895
10072
  });
@@ -9901,6 +10078,7 @@ const ProgressBarValidationState = {
9901
10078
  warning: "warning",
9902
10079
  error: "error"
9903
10080
  };
10081
+ const tagName$f = `${FluentDesignSystem.prefix}-progress-bar`;
9904
10082
 
9905
10083
  var __defProp$k = Object.defineProperty;
9906
10084
  var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor;
@@ -10029,8 +10207,7 @@ const styles$f = css`
10029
10207
 
10030
10208
  :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
10209
  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}`));
10210
+ );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
10211
 
10035
10212
  function progressTemplate() {
10036
10213
  return html`<div class="indicator" part="indicator" ${ref("indicator")}></div>`;
@@ -10038,26 +10215,20 @@ function progressTemplate() {
10038
10215
  const template$f = progressTemplate();
10039
10216
 
10040
10217
  const definition$f = ProgressBar.compose({
10041
- name: `${FluentDesignSystem.prefix}-progress-bar`,
10218
+ name: tagName$f,
10042
10219
  template: template$f,
10043
10220
  styles: styles$f
10044
10221
  });
10045
10222
 
10046
10223
  definition$f.define(FluentDesignSystem.registry);
10047
10224
 
10048
- function isRadio(element, tagName = "-radio") {
10049
- return isCustomElement(tagName)(element);
10050
- }
10225
+ const RadioGroupOrientation = Orientation;
10226
+ const tagName$e = `${FluentDesignSystem.prefix}-radio-group`;
10051
10227
 
10052
- function getRootActiveElement(element) {
10053
- const rootNode = element.getRootNode();
10054
- if (rootNode instanceof ShadowRoot) {
10055
- return rootNode.activeElement;
10056
- }
10057
- return document.activeElement;
10228
+ function isRadio(element, tagName2 = "-radio") {
10229
+ return isCustomElement(tagName2)(element);
10058
10230
  }
10059
-
10060
- const RadioGroupOrientation = Orientation;
10231
+ const tagName$d = `${FluentDesignSystem.prefix}-radio`;
10061
10232
 
10062
10233
  var __defProp$i = Object.defineProperty;
10063
10234
  var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor;
@@ -10070,6 +10241,7 @@ var __decorateClass$i = (decorators, target, key, kind) => {
10070
10241
  class BaseRadioGroup extends FASTElement {
10071
10242
  constructor() {
10072
10243
  super();
10244
+ this.isNavigating = false;
10073
10245
  /**
10074
10246
  * Indicates that the value has been changed by the user.
10075
10247
  */
@@ -10109,7 +10281,6 @@ class BaseRadioGroup extends FASTElement {
10109
10281
  this.radios?.forEach(radio => {
10110
10282
  radio.disabled = !!radio.disabledAttribute || !!this.disabled;
10111
10283
  });
10112
- this.restrictFocus();
10113
10284
  }
10114
10285
  }
10115
10286
  /**
@@ -10157,7 +10328,7 @@ class BaseRadioGroup extends FASTElement {
10157
10328
  if (!this.name && next.every(x => x.name === next[0].name)) {
10158
10329
  this.name = next[0].name;
10159
10330
  }
10160
- const checkedIndex = findLastIndex(this.enabledRadios, x => x.initialChecked);
10331
+ const checkedIndex = this.enabledRadios.findLastIndex(x => x.initialChecked);
10161
10332
  next.forEach((radio, index) => {
10162
10333
  radio.ariaPosInSet = `${index + 1}`;
10163
10334
  radio.ariaSetSize = `${setSize}`;
@@ -10168,18 +10339,13 @@ class BaseRadioGroup extends FASTElement {
10168
10339
  }
10169
10340
  radio.name = this.name ?? radio.name;
10170
10341
  radio.disabled = !!this.disabled || !!radio.disabledAttribute;
10342
+ radio.toggleAttribute("focusgroupstart", radio.checked && !radio.disabled);
10171
10343
  });
10172
10344
  if (!this.dirtyState && this.initialValue) {
10173
10345
  this.value = this.initialValue;
10174
10346
  }
10175
10347
  if (!this.value ||
10176
10348
  // 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
10349
  this.value && typeof this.checkedIndex !== "number" && checkedIndex >= 0) {
10184
10350
  this.checkedIndex = checkedIndex;
10185
10351
  }
@@ -10187,9 +10353,6 @@ class BaseRadioGroup extends FASTElement {
10187
10353
  if (radioIds) {
10188
10354
  this.setAttribute("aria-owns", radioIds);
10189
10355
  }
10190
- Updates.enqueue(() => {
10191
- this.restrictFocus();
10192
- });
10193
10356
  }
10194
10357
  /**
10195
10358
  *
@@ -10339,6 +10502,12 @@ class BaseRadioGroup extends FASTElement {
10339
10502
  focus() {
10340
10503
  this.enabledRadios[Math.max(0, this.checkedIndex)]?.focus();
10341
10504
  }
10505
+ formResetCallback() {
10506
+ this.dirtyState = false;
10507
+ this.checkedIndex = -1;
10508
+ this.setFormValue(this.value);
10509
+ this.setValidity();
10510
+ }
10342
10511
  /**
10343
10512
  * Enables tabbing through the radio group when the group receives focus.
10344
10513
  *
@@ -10346,37 +10515,20 @@ class BaseRadioGroup extends FASTElement {
10346
10515
  * @internal
10347
10516
  */
10348
10517
  focusinHandler(e) {
10349
- if (!this.disabled) {
10350
- this.enabledRadios.forEach(radio => {
10351
- radio.tabIndex = 0;
10518
+ if (!this.disabled && (this.isNavigating || this.value)) {
10519
+ this.radios?.forEach(radio => {
10520
+ if (radio.disabled && radio.checked) {
10521
+ radio.checked = false;
10522
+ }
10352
10523
  });
10524
+ const index = this.enabledRadios.indexOf(e.target);
10525
+ if (index > -1) {
10526
+ this.checkRadio(index, true);
10527
+ }
10528
+ this.isNavigating = false;
10353
10529
  }
10354
10530
  return true;
10355
10531
  }
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
10532
  /**
10381
10533
  * Handles keydown events for the radio group.
10382
10534
  *
@@ -10384,47 +10536,20 @@ class BaseRadioGroup extends FASTElement {
10384
10536
  * @internal
10385
10537
  */
10386
10538
  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
10539
  switch (e.key) {
10391
- case "ArrowLeft":
10392
- {
10393
- increment = isRtl ? 1 : -1;
10394
- break;
10395
- }
10396
10540
  case "ArrowUp":
10397
- {
10398
- increment = -1;
10399
- break;
10400
- }
10401
- case "ArrowRight":
10402
- {
10403
- increment = isRtl ? -1 : 1;
10404
- break;
10405
- }
10406
10541
  case "ArrowDown":
10407
- {
10408
- increment = 1;
10409
- break;
10410
- }
10411
- case "Tab":
10412
- {
10413
- this.restrictFocus();
10414
- break;
10415
- }
10542
+ case "ArrowLeft":
10543
+ case "ArrowRight":
10544
+ case "Home":
10545
+ case "End":
10546
+ this.isNavigating = true;
10547
+ break;
10416
10548
  case " ":
10417
- {
10418
- this.checkRadio();
10419
- break;
10420
- }
10421
- }
10422
- if (!increment) {
10423
- return true;
10549
+ this.checkRadio();
10550
+ break;
10424
10551
  }
10425
- const nextIndex = checkedIndex + increment;
10426
- this.checkRadio(this.getEnabledIndexInBounds(nextIndex), true);
10427
- this.enabledRadios[this.checkedIndex]?.focus();
10552
+ return true;
10428
10553
  }
10429
10554
  /**
10430
10555
  *
@@ -10445,22 +10570,6 @@ class BaseRadioGroup extends FASTElement {
10445
10570
  reportValidity() {
10446
10571
  return this.elementInternals.reportValidity();
10447
10572
  }
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
10573
  /**
10465
10574
  * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/setFormValue | `ElementInternals.setFormValue()`} method.
10466
10575
  *
@@ -10541,7 +10650,27 @@ __decorateClass$i([attr({
10541
10650
  })], BaseRadioGroup.prototype, "required", 2);
10542
10651
  __decorateClass$i([observable], BaseRadioGroup.prototype, "slottedRadios", 2);
10543
10652
 
10544
- class RadioGroup extends BaseRadioGroup {}
10653
+ class RadioGroup extends BaseRadioGroup {
10654
+ disconnectedCallback() {
10655
+ this.fg?.disconnect();
10656
+ super.disconnectedCallback();
10657
+ }
10658
+ radiosChanged(prev, next) {
10659
+ super.radiosChanged(prev, next);
10660
+ this.fgItems ?? (this.fgItems = new ArrayItemCollection(() => this.enabledRadios?.filter(r => !r.hidden) ?? [], () => this.enabledRadios?.find(r => r.checked) ?? null));
10661
+ if (!this.fg) {
10662
+ this.fg = new FocusGroup(this, this.fgItems, {
10663
+ definition: {
10664
+ behavior: "radiogroup",
10665
+ axis: void 0,
10666
+ wrap: true
10667
+ }
10668
+ });
10669
+ } else {
10670
+ this.fg.update();
10671
+ }
10672
+ }
10673
+ }
10545
10674
 
10546
10675
  const styles$e = css`
10547
10676
  ${display("flex")}
@@ -10549,12 +10678,12 @@ const styles$e = css`
10549
10678
  :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
10679
 
10551
10680
  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>`;
10681
+ 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
10682
  }
10554
10683
  const template$e = radioGroupTemplate();
10555
10684
 
10556
10685
  const definition$e = RadioGroup.compose({
10557
- name: `${FluentDesignSystem.prefix}-radio-group`,
10686
+ name: tagName$e,
10558
10687
  template: template$e,
10559
10688
  styles: styles$e
10560
10689
  });
@@ -10586,7 +10715,7 @@ class Radio extends BaseCheckbox {
10586
10715
  * @internal
10587
10716
  * @override
10588
10717
  * @remarks
10589
- * To make a group of radio controls required, see {@link RadioGroup.required}.
10718
+ * To make a group of radio controls required, see `RadioGroup.required`.
10590
10719
  */
10591
10720
  requiredChanged() {
10592
10721
  return;
@@ -10630,8 +10759,7 @@ class Radio extends BaseCheckbox {
10630
10759
  const styles$d = css`
10631
10760
  ${display("inline-flex")}
10632
10761
 
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}`));
10762
+ :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
10763
 
10636
10764
  const checkedIndicator = html.partial(/* html */
10637
10765
  `
@@ -10645,13 +10773,15 @@ const template$d = radioTemplate({
10645
10773
  });
10646
10774
 
10647
10775
  const definition$d = Radio.compose({
10648
- name: `${FluentDesignSystem.prefix}-radio`,
10776
+ name: tagName$d,
10649
10777
  template: template$d,
10650
10778
  styles: styles$d
10651
10779
  });
10652
10780
 
10653
10781
  definition$d.define(FluentDesignSystem.registry);
10654
10782
 
10783
+ const tagName$c = `${FluentDesignSystem.prefix}-rating-display`;
10784
+
10655
10785
  var __defProp$h = Object.defineProperty;
10656
10786
  var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
10657
10787
  var __decorateClass$h = (decorators, target, key, kind) => {
@@ -10811,17 +10941,37 @@ const styles$c = css`
10811
10941
  var(--_mask-inline-size) * var(--_value) - var(--_icon-gradient-stop-visual-adjustment)
10812
10942
  );background-image:linear-gradient(
10813
10943
  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)}`));
10944
+ );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
10945
 
10817
10946
  const definition$c = RatingDisplay.compose({
10818
- name: `${FluentDesignSystem.prefix}-rating-display`,
10947
+ name: tagName$c,
10819
10948
  template: template$c,
10820
10949
  styles: styles$c
10821
10950
  });
10822
10951
 
10823
10952
  definition$c.define(FluentDesignSystem.registry);
10824
10953
 
10954
+ const SliderOrientation = Orientation;
10955
+ const SliderMode = {
10956
+ singleValue: "single-value"
10957
+ };
10958
+ const tagName$b = `${FluentDesignSystem.prefix}-slider`;
10959
+
10960
+ function limit(min, max, value) {
10961
+ return Math.min(Math.max(value, min), max);
10962
+ }
10963
+
10964
+ const numberLikeStringConverter = {
10965
+ fromView(value) {
10966
+ const valueAsNumber = parseFloat(value);
10967
+ return Number.isNaN(valueAsNumber) ? "" : valueAsNumber.toString();
10968
+ },
10969
+ toView(value) {
10970
+ const valueAsNumber = parseFloat(value);
10971
+ return Number.isNaN(valueAsNumber) ? void 0 : valueAsNumber.toString();
10972
+ }
10973
+ };
10974
+
10825
10975
  function convertPixelToPercent(pixelPos, minPosition, maxPosition, direction) {
10826
10976
  let pct = limit(0, 1, (pixelPos - minPosition) / (maxPosition - minPosition));
10827
10977
  if (direction === Direction.rtl) {
@@ -10830,11 +10980,6 @@ function convertPixelToPercent(pixelPos, minPosition, maxPosition, direction) {
10830
10980
  return pct;
10831
10981
  }
10832
10982
 
10833
- const SliderOrientation = Orientation;
10834
- const SliderMode = {
10835
- singleValue: "single-value"
10836
- };
10837
-
10838
10983
  var __defProp$f = Object.defineProperty;
10839
10984
  var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
10840
10985
  var __decorateClass$f = (decorators, target, key, kind) => {
@@ -11281,23 +11426,23 @@ class Slider extends FASTElement {
11281
11426
  return true;
11282
11427
  }
11283
11428
  switch (event.key) {
11284
- case keyHome:
11429
+ case "Home":
11285
11430
  event.preventDefault();
11286
11431
  this.value = this.direction !== Direction.rtl && this.orientation !== Orientation.vertical ? `${this.minAsNumber}` : `${this.maxAsNumber}`;
11287
11432
  break;
11288
- case keyEnd:
11433
+ case "End":
11289
11434
  event.preventDefault();
11290
11435
  this.value = this.direction !== Direction.rtl && this.orientation !== Orientation.vertical ? `${this.maxAsNumber}` : `${this.minAsNumber}`;
11291
11436
  break;
11292
- case keyArrowRight:
11293
- case keyArrowUp:
11437
+ case "ArrowRight":
11438
+ case "ArrowUp":
11294
11439
  if (!event.shiftKey) {
11295
11440
  event.preventDefault();
11296
11441
  this.increment();
11297
11442
  }
11298
11443
  break;
11299
- case keyArrowLeft:
11300
- case keyArrowDown:
11444
+ case "ArrowLeft":
11445
+ case "ArrowDown":
11301
11446
  if (!event.shiftKey) {
11302
11447
  event.preventDefault();
11303
11448
  this.decrement();
@@ -11412,8 +11557,7 @@ const styles$b = css`
11412
11557
  var(--slider-direction),var(--rail-color) 0%,var(--rail-color) 50%,var(--track-color) 50.1%,var(--track-color) 100%
11413
11558
  );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
11559
  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}`));
11560
+ )}.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
11561
 
11418
11562
  function sliderTemplate(options = {}) {
11419
11563
  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 +11567,15 @@ const template$b = sliderTemplate({
11423
11567
  });
11424
11568
 
11425
11569
  const definition$b = Slider.compose({
11426
- name: `${FluentDesignSystem.prefix}-slider`,
11570
+ name: tagName$b,
11427
11571
  template: template$b,
11428
11572
  styles: styles$b
11429
11573
  });
11430
11574
 
11431
11575
  definition$b.define(FluentDesignSystem.registry);
11432
11576
 
11577
+ const tagName$a = `${FluentDesignSystem.prefix}-spinner`;
11578
+
11433
11579
  class BaseSpinner extends FASTElement {
11434
11580
  constructor() {
11435
11581
  super();
@@ -11458,19 +11604,20 @@ __decorateClass$e([attr], Spinner.prototype, "appearance", 2);
11458
11604
  const styles$a = css`
11459
11605
  ${display("inline-flex")}
11460
11606
 
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}`));
11607
+ :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
11608
 
11464
11609
  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
11610
 
11466
11611
  const definition$a = Spinner.compose({
11467
- name: `${FluentDesignSystem.prefix}-spinner`,
11612
+ name: tagName$a,
11468
11613
  template: template$a,
11469
11614
  styles: styles$a
11470
11615
  });
11471
11616
 
11472
11617
  definition$a.define(FluentDesignSystem.registry);
11473
11618
 
11619
+ const tagName$9 = `${FluentDesignSystem.prefix}-switch`;
11620
+
11474
11621
  class Switch extends BaseCheckbox {
11475
11622
  constructor() {
11476
11623
  super();
@@ -11488,17 +11635,24 @@ const template$9 = switchTemplate({
11488
11635
  const styles$9 = css`
11489
11636
  ${display("inline-flex")}
11490
11637
 
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}`));
11638
+ :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
11639
 
11494
11640
  const definition$9 = Switch.compose({
11495
- name: `${FluentDesignSystem.prefix}-switch`,
11641
+ name: tagName$9,
11496
11642
  template: template$9,
11497
11643
  styles: styles$9
11498
11644
  });
11499
11645
 
11500
11646
  definition$9.define(FluentDesignSystem.registry);
11501
11647
 
11648
+ function isTab(element, tagName2 = "-tab") {
11649
+ if (element?.nodeType !== Node.ELEMENT_NODE) {
11650
+ return false;
11651
+ }
11652
+ return element.tagName.toLowerCase().endsWith(tagName2);
11653
+ }
11654
+ const tagName$8 = `${FluentDesignSystem.prefix}-tab`;
11655
+
11502
11656
  var __defProp$d = Object.defineProperty;
11503
11657
  var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
11504
11658
  var __decorateClass$d = (decorators, target, key, kind) => {
@@ -11518,12 +11672,13 @@ class Tab extends FASTElement {
11518
11672
  this.elementInternals = this.attachInternals();
11519
11673
  this.elementInternals.role = "tab";
11520
11674
  }
11675
+ disabledChanged(prev, next) {
11676
+ this.setDisabledSideEffect(next);
11677
+ }
11521
11678
  connectedCallback() {
11522
11679
  super.connectedCallback();
11523
11680
  this.slot || (this.slot = "tab");
11524
- if (this.disabled) {
11525
- this.setAttribute("aria-disabled", "true");
11526
- }
11681
+ this.setDisabledSideEffect(this.disabled);
11527
11682
  if (this.styles) {
11528
11683
  this.$fastController.removeStyles(this.styles);
11529
11684
  }
@@ -11531,6 +11686,14 @@ class Tab extends FASTElement {
11531
11686
  :host{--textContent:'${this.textContent}'}`;
11532
11687
  this.$fastController.addStyles(this.styles);
11533
11688
  }
11689
+ setDisabledSideEffect(disabled) {
11690
+ if (disabled) {
11691
+ this.setAttribute("aria-disabled", "true");
11692
+ } else {
11693
+ this.removeAttribute("aria-disabled");
11694
+ }
11695
+ this.tabIndex = disabled && this.getAttribute("aria-selected") !== "true" ? -1 : 0;
11696
+ }
11534
11697
  }
11535
11698
  __decorateClass$d([attr({
11536
11699
  mode: "boolean"
@@ -11538,46 +11701,29 @@ __decorateClass$d([attr({
11538
11701
  applyMixins(Tab, StartEnd);
11539
11702
 
11540
11703
  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>`;
11704
+ return html`<template slot="tab" role="tab">${startSlotTemplate(options)}<span class="tab-content"><slot></slot></span>${endSlotTemplate(options)}</template>`;
11542
11705
  }
11543
11706
  const template$8 = tabTemplate({});
11544
11707
 
11545
11708
  const styles$8 = css`
11546
11709
  ${display("inline-flex")}
11547
11710
 
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}`));
11711
+ :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
11712
 
11551
11713
  const definition$8 = Tab.compose({
11552
- name: `${FluentDesignSystem.prefix}-tab`,
11714
+ name: tagName$8,
11553
11715
  template: template$8,
11554
11716
  styles: styles$8
11555
11717
  });
11556
11718
 
11557
11719
  definition$8.define(FluentDesignSystem.registry);
11558
11720
 
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
11721
  const TablistAppearance = {
11577
11722
  subtle: "subtle",
11578
11723
  transparent: "transparent"
11579
11724
  };
11580
11725
  const TablistOrientation = Orientation;
11726
+ const tagName$7 = `${FluentDesignSystem.prefix}-tablist`;
11581
11727
 
11582
11728
  var __defProp$c = Object.defineProperty;
11583
11729
  var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
@@ -11598,84 +11744,23 @@ class BaseTablist extends FASTElement {
11598
11744
  this.elementInternals = this.attachInternals();
11599
11745
  this.disabled = false;
11600
11746
  this.orientation = TablistOrientation.horizontal;
11601
- this.prevActiveTabIndex = 0;
11602
- this.activeTabIndex = 0;
11747
+ this.tabs = [];
11603
11748
  this.tabPanelMap = /* @__PURE__ */new WeakMap();
11604
11749
  this.change = () => {
11605
11750
  this.$emit("change", this.activetab);
11606
11751
  };
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
- }
11661
- };
11662
11752
  this.elementInternals.role = "tablist";
11663
11753
  this.elementInternals.ariaOrientation = this.orientation ?? TablistOrientation.horizontal;
11664
11754
  }
11665
- /**
11666
- * Handles disabled changes
11667
- * @param prev - previous value
11668
- * @param next - next value
11669
- *
11670
- * @internal
11671
- */
11755
+ /** @internal */
11672
11756
  disabledChanged(prev, next) {
11673
- toggleState(this.elementInternals, "disabled", next);
11674
- this.setTabs();
11757
+ if (this.elementInternals) {
11758
+ toggleState(this.elementInternals, "disabled", next);
11759
+ }
11760
+ this.setTabs({
11761
+ forceDisabled: true
11762
+ });
11675
11763
  }
11676
- /**
11677
- * @internal
11678
- */
11679
11764
  orientationChanged(prev, next) {
11680
11765
  if (this.elementInternals) {
11681
11766
  this.elementInternals.ariaOrientation = next ?? TablistOrientation.horizontal;
@@ -11683,54 +11768,56 @@ class BaseTablist extends FASTElement {
11683
11768
  }
11684
11769
  this.setTabs();
11685
11770
  }
11686
- /**
11687
- * @internal
11688
- */
11771
+ /** @internal */
11689
11772
  activeidChanged(oldValue, newValue) {
11690
11773
  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
- }
11774
+ this.changeTab(oldValue, newValue);
11709
11775
  }
11710
11776
  }
11711
- /**
11712
- * Updates the tabs property when content in the tabs slot changes.
11713
- * @internal
11714
- */
11777
+ /** @internal */
11715
11778
  slottedTabsChanged(prev, next) {
11716
11779
  this.tabs = next?.filter(tab => isTab(tab)) ?? [];
11717
11780
  }
11718
- /**
11719
- * @internal
11720
- */
11781
+ /** @internal */
11721
11782
  tabsChanged(prev, next) {
11722
- if (prev?.length) {
11723
- prev.forEach(tab => {
11724
- tab.removeEventListener("click", this.handleTabClick);
11725
- tab.removeEventListener("keydown", this.handleTabKeyDown);
11783
+ if (this.tabs?.length > 0) {
11784
+ this.setTabs({
11785
+ connectToPanel: true
11726
11786
  });
11727
11787
  }
11728
- if (this.tabs.length > 0) {
11729
- this.tabIds = this.getTabIds();
11730
- this.setTabs();
11731
- for (const tab of this.tabs) {
11788
+ }
11789
+ /**
11790
+ * Function that is invoked whenever the selected tab or the tab collection changes.
11791
+ */
11792
+ setTabs({
11793
+ connectToPanel = false,
11794
+ forceDisabled = false
11795
+ } = {}) {
11796
+ if (!this.tabs) {
11797
+ return;
11798
+ }
11799
+ const hasStartSlot = this.tabs.some(tab => !!tab.querySelector("[slot='start']"));
11800
+ const rootNode = this.getRootNode();
11801
+ let firstEnabledTabId = "";
11802
+ for (const tab of this.tabs) {
11803
+ if (tab.slot !== "tab") {
11804
+ continue;
11805
+ }
11806
+ tab.id || (tab.id = uniqueId("tab-"));
11807
+ if (forceDisabled) {
11808
+ tab.disabled = this.disabled;
11809
+ } else {
11810
+ tab.disabled = tab.disabled || this.disabled;
11811
+ }
11812
+ if (!firstEnabledTabId && !tab.disabled) {
11813
+ firstEnabledTabId = tab.id;
11814
+ }
11815
+ const isSelected = this.activeid === tab.id;
11816
+ tab.toggleAttribute("focusgroupstart", isSelected);
11817
+ tab.setAttribute("aria-selected", isSelected.toString());
11818
+ tab.toggleAttribute("data-hasIndent", hasStartSlot && this.orientation === TablistOrientation.vertical);
11819
+ if (connectToPanel) {
11732
11820
  const ariaControls = tab.getAttribute("aria-controls") ?? "";
11733
- const rootNode = this.getRootNode();
11734
11821
  const panel = rootNode.getElementById(ariaControls);
11735
11822
  if (ariaControls && panel) {
11736
11823
  panel.role ?? (panel.role = "tabpanel");
@@ -11739,84 +11826,43 @@ class BaseTablist extends FASTElement {
11739
11826
  }
11740
11827
  }
11741
11828
  }
11829
+ if (!this.disabled) {
11830
+ if (this.activeid) {
11831
+ this.changeTab(void 0, this.activeid);
11832
+ } else if (firstEnabledTabId) {
11833
+ this.activeid = firstEnabledTabId;
11834
+ }
11835
+ }
11742
11836
  }
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;
11837
+ /** @internal */
11838
+ handleFocusIn(event) {
11839
+ const target = event.target;
11840
+ if (!isTab(target) || target.disabled) {
11841
+ return;
11749
11842
  }
11843
+ this.activeid = target.id;
11750
11844
  }
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
- }
11845
+ changeTab(oldId, newId) {
11846
+ const rootNode = this.getRootNode();
11847
+ const prevTab = oldId ? rootNode.getElementById(oldId) : null;
11848
+ const nextTab = rootNode.getElementById(newId);
11849
+ if (!isTab(nextTab) || !this.contains(nextTab)) {
11850
+ return;
11851
+ }
11852
+ if (prevTab) {
11853
+ prevTab.setAttribute("aria-selected", "false");
11854
+ const prevPanel = this.tabPanelMap.get(prevTab);
11855
+ if (prevPanel) {
11856
+ prevPanel.hidden = true;
11778
11857
  }
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
11858
  }
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();
11859
+ nextTab.setAttribute("aria-selected", "true");
11860
+ const nextPanel = this.tabPanelMap.get(nextTab);
11861
+ if (nextPanel) {
11862
+ nextPanel.hidden = false;
11863
+ }
11864
+ this.activetab = nextTab;
11865
+ this.change();
11820
11866
  }
11821
11867
  /**
11822
11868
  * @internal
@@ -11824,7 +11870,6 @@ class BaseTablist extends FASTElement {
11824
11870
  connectedCallback() {
11825
11871
  super.connectedCallback();
11826
11872
  waitForConnectedDescendants(this, () => {
11827
- this.tabIds = this.getTabIds();
11828
11873
  this.setTabs();
11829
11874
  }, {
11830
11875
  shallow: true
@@ -11850,154 +11895,41 @@ var __decorateClass$b = (decorators, target, key, kind) => {
11850
11895
  class Tablist extends BaseTablist {
11851
11896
  constructor() {
11852
11897
  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
11898
  this.appearance = TablistAppearance.transparent;
11884
11899
  }
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
- }
11900
+ disconnectedCallback() {
11901
+ this.fg?.disconnect();
11902
+ super.disconnectedCallback();
11977
11903
  }
11978
- /**
11979
- * Initiates the active tab indicator animation loop when tabs change.
11980
- */
11981
11904
  tabsChanged(prev, next) {
11982
11905
  super.tabsChanged(prev, next);
11983
- this.setTabData();
11984
- if (this.activetab) {
11985
- this.animationLoop(this.activetab);
11906
+ this.fgItems ?? (this.fgItems = new ArrayItemCollection(() => this.tabs?.filter(t => (t.getAttribute("aria-selected") === "true" || !t.disabled) && !t.hidden) ?? [], () => this.activetab ?? null));
11907
+ if (!this.fg) {
11908
+ this.fg = new FocusGroup(this, this.fgItems, {
11909
+ definition: {
11910
+ behavior: "tablist",
11911
+ axis: void 0,
11912
+ memory: false,
11913
+ wrap: true
11914
+ }
11915
+ });
11916
+ } else {
11917
+ this.fg.update();
11986
11918
  }
11987
11919
  }
11988
11920
  }
11989
11921
  __decorateClass$b([attr], Tablist.prototype, "appearance", 2);
11990
11922
  __decorateClass$b([attr], Tablist.prototype, "size", 2);
11991
11923
 
11992
- const template$7 = html`<template role="tablist"><slot name="tab" ${slotted("slottedTabs")}></slot></template>`;
11924
+ 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
11925
 
11994
11926
  const styles$7 = css`
11995
11927
  ${display("flex")}
11996
11928
 
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}}`;
11929
+ :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
11930
 
11999
11931
  const definition$7 = Tablist.compose({
12000
- name: `${FluentDesignSystem.prefix}-tablist`,
11932
+ name: tagName$7,
12001
11933
  template: template$7,
12002
11934
  styles: styles$7
12003
11935
  });
@@ -12015,6 +11947,9 @@ const TextAreaResize = {
12015
11947
  horizontal: "horizontal",
12016
11948
  vertical: "vertical"
12017
11949
  };
11950
+ const tagName$6 = `${FluentDesignSystem.prefix}-textarea`;
11951
+
11952
+ const whitespaceFilter = value => value.nodeType !== Node.TEXT_NODE || !!value.nodeValue?.trim().length;
12018
11953
 
12019
11954
  var __defProp$a = Object.defineProperty;
12020
11955
  var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
@@ -12505,8 +12440,7 @@ __decorateClass$9([attr], TextArea.prototype, "size", 2);
12505
12440
  const styles$6 = css`
12506
12441
  ${display("inline-block")}
12507
12442
 
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}`));
12443
+ :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
12444
 
12511
12445
  function textAreaTemplate() {
12512
12446
  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 +12448,7 @@ function textAreaTemplate() {
12514
12448
  const template$6 = textAreaTemplate();
12515
12449
 
12516
12450
  const definition$6 = TextArea.compose({
12517
- name: `${FluentDesignSystem.prefix}-textarea`,
12451
+ name: tagName$6,
12518
12452
  template: template$6,
12519
12453
  styles: styles$6,
12520
12454
  shadowOptions: {
@@ -12532,6 +12466,7 @@ const TextInputType = {
12532
12466
  url: "url"
12533
12467
  };
12534
12468
  const ImplicitSubmissionBlockingTypes = ["date", "datetime-local", "email", "month", "number", "password", "search", "tel", "text", "time", "url", "week"];
12469
+ const tagName$5 = `${FluentDesignSystem.prefix}-text-input`;
12535
12470
 
12536
12471
  var __defProp$8 = Object.defineProperty;
12537
12472
  var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
@@ -12955,7 +12890,7 @@ function textInputTemplate(options = {}) {
12955
12890
  const template$5 = textInputTemplate();
12956
12891
 
12957
12892
  const definition$5 = TextInput.compose({
12958
- name: `${FluentDesignSystem.prefix}-text-input`,
12893
+ name: tagName$5,
12959
12894
  template: template$5,
12960
12895
  styles: styles$5,
12961
12896
  shadowOptions: {
@@ -12965,6 +12900,8 @@ const definition$5 = TextInput.compose({
12965
12900
 
12966
12901
  definition$5.define(FluentDesignSystem.registry);
12967
12902
 
12903
+ const tagName$4 = `${FluentDesignSystem.prefix}-text`;
12904
+
12968
12905
  var __defProp$6 = Object.defineProperty;
12969
12906
  var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
12970
12907
  var __decorateClass$6 = (decorators, target, key, kind) => {
@@ -13021,13 +12958,15 @@ const styles$4 = css`
13021
12958
  const template$4 = html`<slot></slot>`;
13022
12959
 
13023
12960
  const definition$4 = Text.compose({
13024
- name: `${FluentDesignSystem.prefix}-text`,
12961
+ name: tagName$4,
13025
12962
  template: template$4,
13026
12963
  styles: styles$4
13027
12964
  });
13028
12965
 
13029
12966
  definition$4.define(FluentDesignSystem.registry);
13030
12967
 
12968
+ const tagName$3 = `${FluentDesignSystem.prefix}-toggle-button`;
12969
+
13031
12970
  var __defProp$5 = Object.defineProperty;
13032
12971
  var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
13033
12972
  var __decorateClass$5 = (decorators, target, key, kind) => {
@@ -13090,21 +13029,36 @@ __decorateClass$5([attr({
13090
13029
  const styles$3 = css`
13091
13030
  ${styles$C}
13092
13031
 
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(
13032
+ :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
13033
  ${pressedState}:is([appearance='primary'],[appearance='subtle'],[appearance='outline'],[appearance='transparent'])
13096
- ){background:SelectedItem;color:SelectedItemText}`));
13034
+ ){background:SelectedItem;color:SelectedItemText}}`;
13097
13035
 
13098
13036
  const template$3 = buttonTemplate$1();
13099
13037
 
13100
13038
  const definition$3 = ToggleButton.compose({
13101
- name: `${FluentDesignSystem.prefix}-toggle-button`,
13039
+ name: tagName$3,
13102
13040
  template: template$3,
13103
13041
  styles: styles$3
13104
13042
  });
13105
13043
 
13106
13044
  definition$3.define(FluentDesignSystem.registry);
13107
13045
 
13046
+ const TooltipPositioningOption = {
13047
+ "above-start": "block-start span-inline-end",
13048
+ above: "block-start",
13049
+ "above-end": "block-start span-inline-start",
13050
+ "below-start": "block-end span-inline-end",
13051
+ below: "block-end",
13052
+ "below-end": "block-end span-inline-start",
13053
+ "before-top": "inline-start span-block-end",
13054
+ before: "inline-start",
13055
+ "before-bottom": "inline-start span-block-start",
13056
+ "after-top": "inline-end span-block-end",
13057
+ after: "inline-end",
13058
+ "after-bottom": "inline-end span-block-start"
13059
+ };
13060
+ const tagName$2 = `${FluentDesignSystem.prefix}-tooltip`;
13061
+
13108
13062
  var __defProp$4 = Object.defineProperty;
13109
13063
  var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
13110
13064
  var __decorateClass$4 = (decorators, target, key, kind) => {
@@ -13120,7 +13074,7 @@ class Tooltip extends FASTElement {
13120
13074
  * The attached element internals
13121
13075
  */
13122
13076
  this.elementInternals = this.attachInternals();
13123
- this.id = uniqueId$1("tooltip-");
13077
+ this.id = uniqueId("tooltip-");
13124
13078
  /**
13125
13079
  * The default delay for the tooltip
13126
13080
  * @internal
@@ -13198,7 +13152,7 @@ class Tooltip extends FASTElement {
13198
13152
  }
13199
13153
  /**
13200
13154
  * Shows the tooltip
13201
- * @param delay Number of milliseconds to delay showing the tooltip
13155
+ * @param delay - Number of milliseconds to delay showing the tooltip
13202
13156
  * @internal
13203
13157
  */
13204
13158
  showTooltip(delay = this.defaultDelay) {
@@ -13209,7 +13163,7 @@ class Tooltip extends FASTElement {
13209
13163
  }
13210
13164
  /**
13211
13165
  * Hide the tooltip
13212
- * @param delay Number of milliseconds to delay hiding the tooltip
13166
+ * @param delay - Number of milliseconds to delay hiding the tooltip
13213
13167
  * @internal
13214
13168
  */
13215
13169
  hideTooltip(delay = this.defaultDelay) {
@@ -13283,21 +13237,6 @@ __decorateClass$4([attr({
13283
13237
  __decorateClass$4([attr], Tooltip.prototype, "positioning", 2);
13284
13238
  __decorateClass$4([attr], Tooltip.prototype, "anchor", 2);
13285
13239
 
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
13240
  const styles$2 = css`
13302
13241
  ${display("inline-flex")}
13303
13242
 
@@ -13306,13 +13245,15 @@ const styles$2 = css`
13306
13245
  const template$2 = html`<template popover aria-hidden="true"><slot></slot></template>`;
13307
13246
 
13308
13247
  const definition$2 = Tooltip.compose({
13309
- name: `${FluentDesignSystem.prefix}-tooltip`,
13248
+ name: tagName$2,
13310
13249
  template: template$2,
13311
13250
  styles: styles$2
13312
13251
  });
13313
13252
 
13314
13253
  definition$2.define(FluentDesignSystem.registry);
13315
13254
 
13255
+ const tagName$1 = `${FluentDesignSystem.prefix}-tree`;
13256
+
13316
13257
  const TreeItemAppearance = {
13317
13258
  subtle: "subtle",
13318
13259
  subtleAlpha: "subtle-alpha",
@@ -13322,12 +13263,13 @@ const TreeItemSize = {
13322
13263
  small: "small",
13323
13264
  medium: "medium"
13324
13265
  };
13325
- function isTreeItem(element, tagName = "-tree-item") {
13266
+ function isTreeItem(element, tagName2 = "-tree-item") {
13326
13267
  if (element?.nodeType !== Node.ELEMENT_NODE) {
13327
13268
  return false;
13328
13269
  }
13329
- return element.tagName.toLowerCase().endsWith(tagName);
13270
+ return element.tagName.toLowerCase().endsWith(tagName2);
13330
13271
  }
13272
+ const tagName = `${FluentDesignSystem.prefix}-tree-item`;
13331
13273
 
13332
13274
  var __defProp$3 = Object.defineProperty;
13333
13275
  var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
@@ -13341,12 +13283,6 @@ class BaseTree extends FASTElement {
13341
13283
  constructor() {
13342
13284
  super();
13343
13285
  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
13286
  /**
13351
13287
  * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
13352
13288
  *
@@ -13364,10 +13300,6 @@ class BaseTree extends FASTElement {
13364
13300
  defaultSlotChanged() {
13365
13301
  this.handleDefaultSlotChange();
13366
13302
  }
13367
- connectedCallback() {
13368
- super.connectedCallback();
13369
- this.tabIndex = Number(this.getAttribute("tabindex") ?? 0) < 0 ? -1 : 0;
13370
- }
13371
13303
  /** @internal */
13372
13304
  childTreeItemsChanged() {
13373
13305
  this.updateCurrentSelected();
@@ -13378,9 +13310,6 @@ class BaseTree extends FASTElement {
13378
13310
  updateCurrentSelected() {
13379
13311
  const selectedItem = this.querySelector(`[selected]`);
13380
13312
  this.currentSelected = selectedItem;
13381
- if (this.currentFocused === null || !this.contains(this.currentFocused)) {
13382
- this.currentFocused = this.getValidFocusableItem();
13383
- }
13384
13313
  }
13385
13314
  /**
13386
13315
  * KeyDown handler
@@ -13395,23 +13324,8 @@ class BaseTree extends FASTElement {
13395
13324
  if (!isTreeItem(item) || this.childTreeItems.length < 1) {
13396
13325
  return true;
13397
13326
  }
13398
- const elements = this.getVisibleNodes();
13399
13327
  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
- case keyArrowLeft:
13328
+ case "ArrowLeft":
13415
13329
  {
13416
13330
  if (item?.childTreeItems?.length && item.expanded) {
13417
13331
  item.expanded = false;
@@ -13420,33 +13334,21 @@ class BaseTree extends FASTElement {
13420
13334
  }
13421
13335
  return;
13422
13336
  }
13423
- case keyArrowRight:
13337
+ case "ArrowRight":
13424
13338
  {
13425
13339
  if (item?.childTreeItems?.length) {
13426
13340
  if (!item.expanded) {
13427
13341
  item.expanded = true;
13428
- } else {
13429
- this.focusNextNode(1, item);
13430
13342
  }
13431
13343
  }
13432
13344
  return;
13433
13345
  }
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
- case keyEnter:
13346
+ case "Enter":
13445
13347
  {
13446
13348
  this.clickHandler(e);
13447
13349
  return;
13448
13350
  }
13449
- case keySpace:
13351
+ case " ":
13450
13352
  {
13451
13353
  item.selected = true;
13452
13354
  return;
@@ -13454,38 +13356,6 @@ class BaseTree extends FASTElement {
13454
13356
  }
13455
13357
  return true;
13456
13358
  }
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
13359
  /**
13490
13360
  * Handles click events bubbling up
13491
13361
  *
@@ -13525,40 +13395,28 @@ class BaseTree extends FASTElement {
13525
13395
  this.currentSelected = null;
13526
13396
  }
13527
13397
  }
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
13398
  /** @internal */
13559
13399
  handleDefaultSlotChange() {
13560
13400
  this.childTreeItems = this.defaultSlot.assignedElements().filter(el => isTreeItem(el));
13561
13401
  }
13402
+ /**
13403
+ * All descendant tree items in DOM order, recursively flattened from
13404
+ * `childTreeItems`.
13405
+ */
13406
+ get descendantTreeItems() {
13407
+ const result = [];
13408
+ const visit = items => {
13409
+ if (!items) {
13410
+ return;
13411
+ }
13412
+ for (const item of items) {
13413
+ result.push(item);
13414
+ visit(item.childTreeItems);
13415
+ }
13416
+ };
13417
+ visit(this.childTreeItems);
13418
+ return result;
13419
+ }
13562
13420
  }
13563
13421
  __decorateClass$3([observable], BaseTree.prototype, "currentSelected", 2);
13564
13422
  __decorateClass$3([observable], BaseTree.prototype, "defaultSlot", 2);
@@ -13591,6 +13449,22 @@ class Tree extends BaseTree {
13591
13449
  childTreeItemsChanged() {
13592
13450
  super.childTreeItemsChanged();
13593
13451
  this.updateSizeAndAppearance();
13452
+ this.fgItems ?? (this.fgItems = new ArrayItemCollection(() => this.descendantTreeItems.filter(i => !i.isHidden), () => this.currentSelected ?? null));
13453
+ if (!this.fg) {
13454
+ this.fg = new FocusGroup(this, this.fgItems, {
13455
+ definition: {
13456
+ behavior: "menu",
13457
+ axis: "block",
13458
+ memory: false
13459
+ }
13460
+ });
13461
+ } else {
13462
+ this.fg.update();
13463
+ }
13464
+ }
13465
+ disconnectedCallback() {
13466
+ this.fg?.disconnect();
13467
+ super.disconnectedCallback();
13594
13468
  }
13595
13469
  /**
13596
13470
  * 1. Update the child items' size based on the tree's size
@@ -13605,6 +13479,10 @@ class Tree extends BaseTree {
13605
13479
  item.appearance = this.appearance;
13606
13480
  });
13607
13481
  }
13482
+ /** @internal */
13483
+ itemToggleHandler() {
13484
+ this.fg?.update();
13485
+ }
13608
13486
  }
13609
13487
  __decorateClass$2([attr], Tree.prototype, "size", 2);
13610
13488
  __decorateClass$2([attr], Tree.prototype, "appearance", 2);
@@ -13614,10 +13492,10 @@ const styles$1 = css`
13614
13492
 
13615
13493
  :host{outline:none}`;
13616
13494
 
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>`;
13495
+ 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
13496
 
13619
13497
  const definition$1 = Tree.compose({
13620
- name: `${FluentDesignSystem.prefix}-tree`,
13498
+ name: tagName$1,
13621
13499
  template: template$1,
13622
13500
  styles: styles$1
13623
13501
  });
@@ -13670,6 +13548,20 @@ class BaseTreeItem extends FASTElement {
13670
13548
  toggleState(this.elementInternals, "expanded", next);
13671
13549
  if (this.childTreeItems && this.childTreeItems.length > 0) {
13672
13550
  this.elementInternals.ariaExpanded = next ? "true" : "false";
13551
+ requestAnimationFrame(() => {
13552
+ const walker = document.createTreeWalker(this, NodeFilter.SHOW_ELEMENT, node => isTreeItem(node) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP);
13553
+ while (walker.nextNode()) {
13554
+ const item = walker.currentNode;
13555
+ if (next) {
13556
+ item.removeAttribute("focusgroup");
13557
+ } else {
13558
+ if (item.selected) {
13559
+ item.selected = false;
13560
+ }
13561
+ item.setAttribute("focusgroup", "none");
13562
+ }
13563
+ }
13564
+ });
13673
13565
  }
13674
13566
  }
13675
13567
  /**
@@ -13680,7 +13572,6 @@ class BaseTreeItem extends FASTElement {
13680
13572
  * @internal
13681
13573
  */
13682
13574
  selectedChanged(prev, next) {
13683
- this.updateTabindexBySelected();
13684
13575
  this.$emit("change");
13685
13576
  toggleState(this.elementInternals, "selected", next);
13686
13577
  this.elementInternals.ariaSelected = next ? "true" : "false";
@@ -13702,12 +13593,6 @@ class BaseTreeItem extends FASTElement {
13702
13593
  this.empty = this.childTreeItems?.length === 0;
13703
13594
  this.updateChildTreeItems();
13704
13595
  }
13705
- connectedCallback() {
13706
- super.connectedCallback();
13707
- Updates.enqueue(() => {
13708
- this.updateTabindexBySelected();
13709
- });
13710
- }
13711
13596
  /**
13712
13597
  * Updates the childrens indent
13713
13598
  *
@@ -13742,14 +13627,25 @@ class BaseTreeItem extends FASTElement {
13742
13627
  }
13743
13628
  }
13744
13629
  /**
13745
- * Whether the tree is nested
13630
+ * Whether the tree item is nested
13746
13631
  * @internal
13747
13632
  */
13748
13633
  get isNestedItem() {
13749
13634
  return isTreeItem(this.parentElement);
13750
13635
  }
13751
- updateTabindexBySelected() {
13752
- this.tabIndex = this.selected ? 0 : -1;
13636
+ /**
13637
+ * Whether the tree item is nested in a collapsed tree item.
13638
+ * @internal
13639
+ */
13640
+ get isHidden() {
13641
+ let parent = this.parentElement;
13642
+ while (isTreeItem(parent)) {
13643
+ if (!parent.expanded) {
13644
+ return true;
13645
+ }
13646
+ parent = parent.parentElement;
13647
+ }
13648
+ return false;
13753
13649
  }
13754
13650
  /** @internal */
13755
13651
  handleItemSlotChange() {
@@ -13835,10 +13731,10 @@ const styles = css`
13835
13731
  ${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
13732
 
13837
13733
  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>`;
13734
+ 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
13735
 
13840
13736
  const definition = TreeItem.compose({
13841
- name: `${FluentDesignSystem.prefix}-tree-item`,
13737
+ name: tagName,
13842
13738
  template: template,
13843
13739
  styles: styles
13844
13740
  });
@@ -13927,7 +13823,7 @@ function getShadowAdoptedStyleSheet(element) {
13927
13823
  }
13928
13824
  function getScopedThemeKey(theme) {
13929
13825
  if (!scopedThemeKeyMap.has(theme)) {
13930
- const themeKey = uniqueId$1("fluent-theme-");
13826
+ const themeKey = uniqueId("fluent-theme-");
13931
13827
  const scopedThemeStyleSheet = new CSSStyleSheet();
13932
13828
  scopedThemeKeyMap.set(theme, themeKey);
13933
13829
  scopedThemeStyleSheet.replaceSync(`