@fluentui/web-components 3.0.0-rc.25 → 3.0.0-rc.27

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 (207) hide show
  1. package/CHANGELOG.md +21 -2
  2. package/README.md +26 -0
  3. package/custom-elements.json +723 -356
  4. package/dist/esm/accordion/accordion.d.ts +1 -1
  5. package/dist/esm/accordion/accordion.js +1 -1
  6. package/dist/esm/accordion/accordion.styles.css +11 -7
  7. package/dist/esm/accordion/accordion.template.html +4 -3
  8. package/dist/esm/accordion-item/accordion-item.d.ts +2 -2
  9. package/dist/esm/accordion-item/accordion-item.js +2 -0
  10. package/dist/esm/accordion-item/accordion-item.js.map +1 -1
  11. package/dist/esm/accordion-item/accordion-item.styles.css +174 -170
  12. package/dist/esm/accordion-item/accordion-item.template.html +38 -31
  13. package/dist/esm/anchor-button/anchor-button.d.ts +2 -2
  14. package/dist/esm/anchor-button/anchor-button.js +2 -0
  15. package/dist/esm/anchor-button/anchor-button.js.map +1 -1
  16. package/dist/esm/anchor-button/anchor-button.styles.css +224 -223
  17. package/dist/esm/anchor-button/anchor-button.template.html +8 -11
  18. package/dist/esm/avatar/avatar.d.ts +2 -0
  19. package/dist/esm/avatar/avatar.js +3 -1
  20. package/dist/esm/avatar/avatar.js.map +1 -1
  21. package/dist/esm/avatar/avatar.styles.css +475 -470
  22. package/dist/esm/avatar/avatar.template.html +10 -14
  23. package/dist/esm/badge/badge.d.ts +6 -1
  24. package/dist/esm/badge/badge.js +6 -1
  25. package/dist/esm/badge/badge.js.map +1 -1
  26. package/dist/esm/badge/badge.styles.css +264 -266
  27. package/dist/esm/badge/badge.template.html +5 -2
  28. package/dist/esm/button/button.base.d.ts +0 -9
  29. package/dist/esm/button/button.base.js +2 -3
  30. package/dist/esm/button/button.base.js.map +1 -1
  31. package/dist/esm/button/button.styles.css +260 -259
  32. package/dist/esm/button/button.template.html +8 -10
  33. package/dist/esm/checkbox/checkbox.base.d.ts +3 -9
  34. package/dist/esm/checkbox/checkbox.base.js +5 -3
  35. package/dist/esm/checkbox/checkbox.base.js.map +1 -1
  36. package/dist/esm/checkbox/checkbox.d.ts +2 -2
  37. package/dist/esm/checkbox/checkbox.js +2 -2
  38. package/dist/esm/checkbox/checkbox.styles.css +146 -142
  39. package/dist/esm/checkbox/checkbox.template.html +21 -16
  40. package/dist/esm/compound-button/compound-button.d.ts +3 -0
  41. package/dist/esm/compound-button/compound-button.js +3 -0
  42. package/dist/esm/compound-button/compound-button.js.map +1 -1
  43. package/dist/esm/compound-button/compound-button.styles.css +363 -365
  44. package/dist/esm/compound-button/compound-button.template.html +9 -11
  45. package/dist/esm/counter-badge/counter-badge.d.ts +3 -0
  46. package/dist/esm/counter-badge/counter-badge.js +3 -0
  47. package/dist/esm/counter-badge/counter-badge.js.map +1 -1
  48. package/dist/esm/counter-badge/counter-badge.styles.css +177 -177
  49. package/dist/esm/counter-badge/counter-badge.template.html +5 -2
  50. package/dist/esm/dialog/dialog.d.ts +4 -0
  51. package/dist/esm/dialog/dialog.js +4 -0
  52. package/dist/esm/dialog/dialog.js.map +1 -1
  53. package/dist/esm/dialog/dialog.styles.css +65 -66
  54. package/dist/esm/dialog/dialog.template.html +18 -15
  55. package/dist/esm/dialog-body/dialog-body.d.ts +9 -0
  56. package/dist/esm/dialog-body/dialog-body.js +9 -0
  57. package/dist/esm/dialog-body/dialog-body.js.map +1 -1
  58. package/dist/esm/dialog-body/dialog-body.styles.css +81 -76
  59. package/dist/esm/dialog-body/dialog-body.styles.js +1 -0
  60. package/dist/esm/dialog-body/dialog-body.styles.js.map +1 -1
  61. package/dist/esm/dialog-body/dialog-body.template.html +2 -1
  62. package/dist/esm/divider/divider.styles.css +105 -101
  63. package/dist/esm/divider/divider.template.html +6 -1
  64. package/dist/esm/drawer/drawer.d.ts +3 -4
  65. package/dist/esm/drawer/drawer.js +3 -4
  66. package/dist/esm/drawer/drawer.js.map +1 -1
  67. package/dist/esm/drawer/drawer.styles.css +124 -120
  68. package/dist/esm/drawer/drawer.styles.js +16 -17
  69. package/dist/esm/drawer/drawer.styles.js.map +1 -1
  70. package/dist/esm/drawer/drawer.template.html +5 -2
  71. package/dist/esm/drawer-body/drawer-body.styles.css +29 -26
  72. package/dist/esm/drawer-body/drawer-body.template.html +5 -2
  73. package/dist/esm/dropdown/dropdown.base.d.ts +3 -1
  74. package/dist/esm/dropdown/dropdown.base.js +5 -1
  75. package/dist/esm/dropdown/dropdown.base.js.map +1 -1
  76. package/dist/esm/dropdown/dropdown.styles.css +192 -190
  77. package/dist/esm/dropdown/dropdown.styles.js +1 -0
  78. package/dist/esm/dropdown/dropdown.styles.js.map +1 -1
  79. package/dist/esm/dropdown/dropdown.template.html +26 -19
  80. package/dist/esm/field/field.d.ts +7 -0
  81. package/dist/esm/field/field.js +7 -0
  82. package/dist/esm/field/field.js.map +1 -1
  83. package/dist/esm/field/field.styles.css +125 -121
  84. package/dist/esm/field/field.template.html +3 -2
  85. package/dist/esm/image/image.d.ts +2 -0
  86. package/dist/esm/image/image.js +2 -0
  87. package/dist/esm/image/image.js.map +1 -1
  88. package/dist/esm/image/image.styles.css +49 -50
  89. package/dist/esm/image/image.template.html +6 -1
  90. package/dist/esm/label/label.d.ts +3 -0
  91. package/dist/esm/label/label.js +3 -0
  92. package/dist/esm/label/label.js.map +1 -1
  93. package/dist/esm/label/label.styles.css +34 -30
  94. package/dist/esm/label/label.template.html +5 -2
  95. package/dist/esm/link/link.styles.css +58 -54
  96. package/dist/esm/link/link.template.html +4 -7
  97. package/dist/esm/listbox/listbox.styles.css +40 -36
  98. package/dist/esm/listbox/listbox.template.html +4 -6
  99. package/dist/esm/menu/menu.styles.css +56 -52
  100. package/dist/esm/menu/menu.template.html +6 -5
  101. package/dist/esm/menu-button/menu-button.styles.css +260 -259
  102. package/dist/esm/menu-button/menu-button.template.html +23 -14
  103. package/dist/esm/menu-item/menu-item.d.ts +1 -1
  104. package/dist/esm/menu-item/menu-item.js +3 -1
  105. package/dist/esm/menu-item/menu-item.js.map +1 -1
  106. package/dist/esm/menu-item/menu-item.styles.css +141 -137
  107. package/dist/esm/menu-item/menu-item.template.html +48 -17
  108. package/dist/esm/menu-list/menu-list.styles.css +19 -15
  109. package/dist/esm/menu-list/menu-list.template.html +4 -3
  110. package/dist/esm/message-bar/message-bar.d.ts +2 -0
  111. package/dist/esm/message-bar/message-bar.js +2 -0
  112. package/dist/esm/message-bar/message-bar.js.map +1 -1
  113. package/dist/esm/message-bar/message-bar.styles.css +83 -84
  114. package/dist/esm/message-bar/message-bar.template.html +7 -2
  115. package/dist/esm/option/option.d.ts +3 -0
  116. package/dist/esm/option/option.js +3 -0
  117. package/dist/esm/option/option.js.map +1 -1
  118. package/dist/esm/option/option.styles.css +117 -114
  119. package/dist/esm/option/option.template.html +17 -14
  120. package/dist/esm/progress-bar/progress-bar.base.d.ts +3 -3
  121. package/dist/esm/progress-bar/progress-bar.d.ts +1 -0
  122. package/dist/esm/progress-bar/progress-bar.js +1 -0
  123. package/dist/esm/progress-bar/progress-bar.js.map +1 -1
  124. package/dist/esm/progress-bar/progress-bar.styles.css +83 -79
  125. package/dist/esm/progress-bar/progress-bar.template.html +4 -1
  126. package/dist/esm/radio/radio.d.ts +3 -2
  127. package/dist/esm/radio/radio.js +3 -2
  128. package/dist/esm/radio/radio.js.map +1 -1
  129. package/dist/esm/radio/radio.styles.css +100 -96
  130. package/dist/esm/radio/radio.template.html +6 -9
  131. package/dist/esm/radio-group/radio-group.base.d.ts +2 -0
  132. package/dist/esm/radio-group/radio-group.base.js +2 -0
  133. package/dist/esm/radio-group/radio-group.base.js.map +1 -1
  134. package/dist/esm/radio-group/radio-group.d.ts +1 -0
  135. package/dist/esm/radio-group/radio-group.js +1 -0
  136. package/dist/esm/radio-group/radio-group.js.map +1 -1
  137. package/dist/esm/radio-group/radio-group.styles.css +45 -41
  138. package/dist/esm/radio-group/radio-group.template.html +11 -10
  139. package/dist/esm/rating-display/rating-display.styles.css +136 -134
  140. package/dist/esm/rating-display/rating-display.template.html +5 -2
  141. package/dist/esm/slider/slider.d.ts +1 -1
  142. package/dist/esm/slider/slider.js +3 -1
  143. package/dist/esm/slider/slider.js.map +1 -1
  144. package/dist/esm/slider/slider.styles.css +186 -182
  145. package/dist/esm/slider/slider.template.html +13 -15
  146. package/dist/esm/spinner/spinner.styles.css +155 -151
  147. package/dist/esm/spinner/spinner.template.html +16 -11
  148. package/dist/esm/switch/switch.d.ts +1 -0
  149. package/dist/esm/switch/switch.js +1 -0
  150. package/dist/esm/switch/switch.js.map +1 -1
  151. package/dist/esm/switch/switch.styles.css +112 -108
  152. package/dist/esm/switch/switch.template.html +9 -8
  153. package/dist/esm/tab/tab.js +2 -0
  154. package/dist/esm/tab/tab.js.map +1 -1
  155. package/dist/esm/tab/tab.styles.css +112 -108
  156. package/dist/esm/tab/tab.template.html +6 -5
  157. package/dist/esm/tablist/tablist.d.ts +1 -0
  158. package/dist/esm/tablist/tablist.js +1 -0
  159. package/dist/esm/tablist/tablist.js.map +1 -1
  160. package/dist/esm/tablist/tablist.styles.css +194 -190
  161. package/dist/esm/tablist/tablist.template.html +2 -5
  162. package/dist/esm/text/text.d.ts +2 -0
  163. package/dist/esm/text/text.js +2 -0
  164. package/dist/esm/text/text.js.map +1 -1
  165. package/dist/esm/text/text.styles.css +105 -101
  166. package/dist/esm/text/text.template.html +6 -1
  167. package/dist/esm/text-input/text-input.base.d.ts +4 -16
  168. package/dist/esm/text-input/text-input.base.js +7 -17
  169. package/dist/esm/text-input/text-input.base.js.map +1 -1
  170. package/dist/esm/text-input/text-input.d.ts +2 -0
  171. package/dist/esm/text-input/text-input.js +2 -0
  172. package/dist/esm/text-input/text-input.js.map +1 -1
  173. package/dist/esm/text-input/text-input.styles.css +199 -195
  174. package/dist/esm/text-input/text-input.template.html +34 -36
  175. package/dist/esm/text-input/text-input.template.js +1 -5
  176. package/dist/esm/text-input/text-input.template.js.map +1 -1
  177. package/dist/esm/textarea/textarea.base.d.ts +2 -2
  178. package/dist/esm/textarea/textarea.base.js +4 -2
  179. package/dist/esm/textarea/textarea.base.js.map +1 -1
  180. package/dist/esm/textarea/textarea.styles.css +254 -250
  181. package/dist/esm/textarea/textarea.template.html +28 -27
  182. package/dist/esm/toggle-button/toggle-button.styles.css +360 -357
  183. package/dist/esm/toggle-button/toggle-button.template.html +8 -10
  184. package/dist/esm/tooltip/tooltip.d.ts +2 -0
  185. package/dist/esm/tooltip/tooltip.js +2 -0
  186. package/dist/esm/tooltip/tooltip.js.map +1 -1
  187. package/dist/esm/tooltip/tooltip.styles.css +81 -77
  188. package/dist/esm/tooltip/tooltip.template.html +6 -1
  189. package/dist/esm/tree/tree.styles.css +9 -5
  190. package/dist/esm/tree/tree.template.html +3 -2
  191. package/dist/esm/tree-item/tree-item.base.d.ts +9 -0
  192. package/dist/esm/tree-item/tree-item.base.js +11 -0
  193. package/dist/esm/tree-item/tree-item.base.js.map +1 -1
  194. package/dist/esm/tree-item/tree-item.d.ts +15 -0
  195. package/dist/esm/tree-item/tree-item.js +15 -0
  196. package/dist/esm/tree-item/tree-item.js.map +1 -1
  197. package/dist/esm/tree-item/tree-item.styles.css +157 -153
  198. package/dist/esm/tree-item/tree-item.template.html +8 -7
  199. package/dist/esm/utils/autofocus.d.ts +12 -0
  200. package/dist/esm/utils/autofocus.js +25 -0
  201. package/dist/esm/utils/autofocus.js.map +1 -0
  202. package/dist/web-components-all.js +24 -27
  203. package/dist/web-components-all.min.js +15 -15
  204. package/dist/web-components.d.ts +110 -54
  205. package/dist/web-components.js +24 -27
  206. package/dist/web-components.min.js +15 -15
  207. package/package.json +6 -6
@@ -1,157 +1,161 @@
1
-
2
- :host([hidden]){display:none}:host{display:block}
3
-
4
- :host {
5
- outline: none;
6
- font-size: var(--fontSizeBase300);
7
- line-height: var(--lineHeightBase300);
8
- }
9
-
10
- :host(:focus-visible) .positioning-region {
11
- box-shadow: var(--spacingVerticalNone) var(--spacingVerticalNone) var(--spacingVerticalNone) var(--spacingVerticalXXS)
12
- var(--colorStrokeFocus2) inset;
13
- }
14
-
15
- /**
1
+ :host([hidden]) {
2
+ display: none;
3
+ }
4
+ :host {
5
+ display: block;
6
+ }
7
+
8
+ :host {
9
+ outline: none;
10
+ font-size: var(--fontSizeBase300);
11
+ line-height: var(--lineHeightBase300);
12
+ }
13
+
14
+ :host(:focus-visible) .positioning-region {
15
+ box-shadow: var(--spacingVerticalNone) var(--spacingVerticalNone) var(--spacingVerticalNone) var(--spacingVerticalXXS)
16
+ var(--colorStrokeFocus2) inset;
17
+ }
18
+
19
+ /**
16
20
  * Default variants:
17
21
  * Size - medium
18
22
  * Appearance - subtle
19
23
  */
20
- .positioning-region {
21
- display: flex;
22
- align-items: center;
23
- justify-content: space-between;
24
- cursor: pointer;
25
- height: var(--spacingVerticalXXXL);
26
- padding-inline-start: calc(var(--indent) * var(--spacingHorizontalXXL));
27
- padding-inline-end: var(--spacingVerticalS);
28
- border-radius: var(--borderRadiusMedium);
29
- background-color: var(--colorSubtleBackground);
30
- color: var(--colorNeutralForeground2);
31
- gap: var(--spacingHorizontalXS);
32
- }
33
-
34
- @media (prefers-contrast: more) {
35
- :host(:focus-visible) .positioning-region {
36
- outline: 1px solid var(--colorStrokeFocus2);
37
- }
38
- }
39
-
40
- .content {
41
- display: flex;
42
- align-items: center;
43
- gap: var(--spacingHorizontalXS);
44
- }
45
-
46
- .chevron {
47
- display: flex;
48
- align-items: center;
49
- flex-shrink: 0;
50
- justify-content: center;
51
- width: var(--spacingHorizontalXXL);
52
- height: var(--spacingVerticalXXL);
53
- transition: transform var(--durationFaster) var(--curveEasyEaseMax);
54
- transform: rotate(0deg);
55
- }
56
-
57
- .chevron:dir(rtl) {
58
- transform: rotate(180deg);
59
- }
60
-
61
- .chevron svg {
62
- inline-size: 12px;
63
- block-size: 12px;
64
- }
65
-
66
- .aside {
67
- display: flex;
68
- align-items: center;
69
- }
70
-
71
- .positioning-region:hover {
72
- background-color: var(--colorSubtleBackgroundHover);
73
- color: var(--colorNeutralForeground2Hover);
74
- }
75
-
76
- .positioning-region:active {
77
- background-color: var(--colorSubtleBackgroundPressed);
78
- color: var(--colorNeutralForeground2Pressed);
79
- }
80
-
81
- ::slotted([slot='start']),
82
- ::slotted([slot='end']),
83
- ::slotted(:not([slot])) {
84
- display: flex;
85
- align-items: center;
86
- min-width: 0;
87
- }
88
-
89
- ::slotted([slot='start']) {
90
- flex-shrink: 0;
91
- }
92
-
93
- ::slotted(:not([slot])) {
94
- padding-inline: var(--spacingHorizontalXXS);
95
- }
96
-
97
- .items {
98
- display: none;
99
- }
100
-
101
- :host([expanded]) .items {
102
- display: block;
103
- }
104
-
105
- :host([empty]) .chevron,
106
- :host([empty]) .items {
107
- visibility: hidden;
108
- }
109
-
110
- :host([selected]) .positioning-region {
111
- background-color: var(--colorSubtleBackgroundSelected);
112
- color: var(--colorNeutralForeground2Selected);
113
- }
114
-
115
- :host([selected]) .content,
116
- :host([selected]) .chevron {
117
- color: var(--colorNeutralForeground3Selected);
118
- }
119
-
120
- :host([size='small']) .positioning-region {
121
- height: var(--spacingVerticalXXL);
122
- padding-inline-start: calc(var(--indent) * var(--spacingHorizontalM));
123
- }
124
-
125
- :host([appearance='subtle-alpha']) .positioning-region:hover {
126
- background-color: var(--colorSubtleBackgroundLightAlphaHover);
127
- }
128
-
129
- :host([appearance='subtle-alpha']) .positioning-region:active {
130
- background-color: var(--colorSubtleBackgroundLightAlphaPressed);
131
- }
132
-
133
- :host([appearance='subtle-alpha'][selected]) .positioning-region {
134
- background-color: var(--colorSubtleBackgroundLightAlphaSelected);
135
- color: var(--colorNeutralForeground2Selected);
136
- }
137
-
138
- :host([appearance='transparent']) .positioning-region {
139
- background-color: var(--colorTransparentBackground);
140
- }
141
-
142
- :host([appearance='transparent']) .positioning-region:hover {
143
- background-color: var(--colorTransparentBackgroundHover);
144
- }
145
-
146
- :host([appearance='transparent']) .positioning-region:active {
147
- background-color: var(--colorTransparentBackgroundPressed);
148
- }
149
-
150
- :host([appearance='transparent'][selected]) .positioning-region {
151
- background-color: var(--colorTransparentBackgroundSelected);
152
- color: var(--colorNeutralForeground2Selected);
153
- }
154
-
155
- :host([expanded]) .chevron {
156
- transform: rotate(90deg);
157
- }
24
+ .positioning-region {
25
+ display: flex;
26
+ align-items: center;
27
+ justify-content: space-between;
28
+ cursor: pointer;
29
+ height: var(--spacingVerticalXXXL);
30
+ padding-inline-start: calc(var(--indent) * var(--spacingHorizontalXXL));
31
+ padding-inline-end: var(--spacingVerticalS);
32
+ border-radius: var(--borderRadiusMedium);
33
+ background-color: var(--colorSubtleBackground);
34
+ color: var(--colorNeutralForeground2);
35
+ gap: var(--spacingHorizontalXS);
36
+ }
37
+
38
+ @media (prefers-contrast: more) {
39
+ :host(:focus-visible) .positioning-region {
40
+ outline: 1px solid var(--colorStrokeFocus2);
41
+ }
42
+ }
43
+
44
+ .content {
45
+ display: flex;
46
+ align-items: center;
47
+ gap: var(--spacingHorizontalXS);
48
+ }
49
+
50
+ .chevron {
51
+ display: flex;
52
+ align-items: center;
53
+ flex-shrink: 0;
54
+ justify-content: center;
55
+ width: var(--spacingHorizontalXXL);
56
+ height: var(--spacingVerticalXXL);
57
+ transition: transform var(--durationFaster) var(--curveEasyEaseMax);
58
+ transform: rotate(0deg);
59
+ }
60
+
61
+ .chevron:dir(rtl) {
62
+ transform: rotate(180deg);
63
+ }
64
+
65
+ .chevron svg {
66
+ inline-size: 12px;
67
+ block-size: 12px;
68
+ }
69
+
70
+ .aside {
71
+ display: flex;
72
+ align-items: center;
73
+ }
74
+
75
+ .positioning-region:hover {
76
+ background-color: var(--colorSubtleBackgroundHover);
77
+ color: var(--colorNeutralForeground2Hover);
78
+ }
79
+
80
+ .positioning-region:active {
81
+ background-color: var(--colorSubtleBackgroundPressed);
82
+ color: var(--colorNeutralForeground2Pressed);
83
+ }
84
+
85
+ ::slotted([slot='start']),
86
+ ::slotted([slot='end']),
87
+ ::slotted(:not([slot])) {
88
+ display: flex;
89
+ align-items: center;
90
+ min-width: 0;
91
+ }
92
+
93
+ ::slotted([slot='start']) {
94
+ flex-shrink: 0;
95
+ }
96
+
97
+ ::slotted(:not([slot])) {
98
+ padding-inline: var(--spacingHorizontalXXS);
99
+ }
100
+
101
+ .items {
102
+ display: none;
103
+ }
104
+
105
+ :host([expanded]) .items {
106
+ display: block;
107
+ }
108
+
109
+ :host([empty]) .chevron,
110
+ :host([empty]) .items {
111
+ visibility: hidden;
112
+ }
113
+
114
+ :host([selected]) .positioning-region {
115
+ background-color: var(--colorSubtleBackgroundSelected);
116
+ color: var(--colorNeutralForeground2Selected);
117
+ }
118
+
119
+ :host([selected]) .content,
120
+ :host([selected]) .chevron {
121
+ color: var(--colorNeutralForeground3Selected);
122
+ }
123
+
124
+ :host([size='small']) .positioning-region {
125
+ height: var(--spacingVerticalXXL);
126
+ padding-inline-start: calc(var(--indent) * var(--spacingHorizontalM));
127
+ }
128
+
129
+ :host([appearance='subtle-alpha']) .positioning-region:hover {
130
+ background-color: var(--colorSubtleBackgroundLightAlphaHover);
131
+ }
132
+
133
+ :host([appearance='subtle-alpha']) .positioning-region:active {
134
+ background-color: var(--colorSubtleBackgroundLightAlphaPressed);
135
+ }
136
+
137
+ :host([appearance='subtle-alpha'][selected]) .positioning-region {
138
+ background-color: var(--colorSubtleBackgroundLightAlphaSelected);
139
+ color: var(--colorNeutralForeground2Selected);
140
+ }
141
+
142
+ :host([appearance='transparent']) .positioning-region {
143
+ background-color: var(--colorTransparentBackground);
144
+ }
145
+
146
+ :host([appearance='transparent']) .positioning-region:hover {
147
+ background-color: var(--colorTransparentBackgroundHover);
148
+ }
149
+
150
+ :host([appearance='transparent']) .positioning-region:active {
151
+ background-color: var(--colorTransparentBackgroundPressed);
152
+ }
153
+
154
+ :host([appearance='transparent'][selected]) .positioning-region {
155
+ background-color: var(--colorTransparentBackgroundSelected);
156
+ color: var(--colorNeutralForeground2Selected);
157
+ }
158
+
159
+ :host([expanded]) .chevron {
160
+ transform: rotate(90deg);
161
+ }
@@ -1,15 +1,16 @@
1
1
  <f-template name="fluent-tree-item" shadowrootmode="open">
2
- <template tabindex="0" ?focusgroupstart="{{selected}}">{{styles}}
2
+ <template tabindex="0" ?focusgroupstart="{{selected}}">
3
+ {{styles}}
3
4
  <div class="positioning-region" part="positioning-region">
4
5
  <div class="content" part="content">
5
6
  <span class="chevron" part="chevron" aria-hidden="true">
6
7
  <slot name="chevron">
7
- <svg viewBox="0 0 12 12" fill="currentColor">
8
- <path
9
- 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"
10
- ></path>
11
- </svg>
12
- </slot>
8
+ <svg viewBox="0 0 12 12" fill="currentColor">
9
+ <path
10
+ 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"
11
+ ></path>
12
+ </svg>
13
+ </slot>
13
14
  </span>
14
15
  <slot name="start"></slot>
15
16
  <slot></slot>
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Artificial sets the focus to the given element, if no other element in the
3
+ * document is currently focused and the given element meets the following
4
+ * conditions:
5
+ *
6
+ * - is connected to DOM
7
+ * - has `autofocus` attribute
8
+ * - is visible
9
+ *
10
+ * For more details of this issue, see https://codepen.io/editor/marchbox/pen/019e9ab9-cd81-7c21-a3ae-1b7fe2d3458a
11
+ */
12
+ export declare function maybeSetAutoFocus(element: HTMLElement): void;
@@ -0,0 +1,25 @@
1
+ import { Updates } from '@microsoft/fast-element';
2
+ /**
3
+ * Artificial sets the focus to the given element, if no other element in the
4
+ * document is currently focused and the given element meets the following
5
+ * conditions:
6
+ *
7
+ * - is connected to DOM
8
+ * - has `autofocus` attribute
9
+ * - is visible
10
+ *
11
+ * For more details of this issue, see https://codepen.io/editor/marchbox/pen/019e9ab9-cd81-7c21-a3ae-1b7fe2d3458a
12
+ */
13
+ export function maybeSetAutoFocus(element) {
14
+ const doc = element.ownerDocument;
15
+ if (element?.isConnected &&
16
+ element?.hasAttribute('autofocus') &&
17
+ // Note: opacity=0 is considered visible based on the native `autofocus` implementation
18
+ element?.checkVisibility?.({ contentVisibilityAuto: true, visibilityProperty: true }) &&
19
+ [null, element, doc.body, doc.documentElement].includes(doc.activeElement)) {
20
+ Updates.enqueue(() => {
21
+ element.focus();
22
+ });
23
+ }
24
+ }
25
+ //# sourceMappingURL=autofocus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autofocus.js","sourceRoot":"","sources":["../../../src/utils/autofocus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAoB;IACpD,MAAM,GAAG,GAAG,OAAO,CAAC,aAAa,CAAC;IAClC,IACE,OAAO,EAAE,WAAW;QACpB,OAAO,EAAE,YAAY,CAAC,WAAW,CAAC;QAClC,uFAAuF;QACvF,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,qBAAqB,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC;QACrF,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,aAAmC,CAAC,EAChG,CAAC;QACD,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE;YACnB,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
@@ -6266,6 +6266,16 @@ const definition$B = Badge.compose({
6266
6266
 
6267
6267
  definition$B.define(FluentDesignSystem.registry);
6268
6268
 
6269
+ function maybeSetAutoFocus(element) {
6270
+ const doc = element.ownerDocument;
6271
+ if (element?.isConnected && element?.hasAttribute("autofocus") && // Note: opacity=0 is considered visible based on the native `autofocus` implementation
6272
+ element?.checkVisibility?.({ contentVisibilityAuto: true, visibilityProperty: true }) && [null, element, doc.body, doc.documentElement].includes(doc.activeElement)) {
6273
+ Updates.enqueue(() => {
6274
+ element.focus();
6275
+ });
6276
+ }
6277
+ }
6278
+
6269
6279
  var __defProp$H = Object.defineProperty;
6270
6280
  var __getOwnPropDesc$H = Object.getOwnPropertyDescriptor;
6271
6281
  var __decorateClass$H = (decorators, target, key, kind) => {
@@ -6358,6 +6368,7 @@ class BaseButton extends FASTElement {
6358
6368
  super.connectedCallback();
6359
6369
  this.elementInternals.ariaDisabled = `${!!this.disabledFocusable}`;
6360
6370
  this.setTabIndex();
6371
+ maybeSetAutoFocus(this);
6361
6372
  }
6362
6373
  /**
6363
6374
  * This fallback creates a new slot, then creates a submit button to mirror the custom element's
@@ -6498,9 +6509,6 @@ class BaseButton extends FASTElement {
6498
6509
  * @public
6499
6510
  */
6500
6511
  BaseButton.formAssociated = true;
6501
- __decorateClass$H([
6502
- attr({ mode: "boolean" })
6503
- ], BaseButton.prototype, "autofocus", 2);
6504
6512
  __decorateClass$H([
6505
6513
  observable
6506
6514
  ], BaseButton.prototype, "defaultSlottedContent", 2);
@@ -6824,6 +6832,7 @@ class BaseCheckbox extends FASTElement {
6824
6832
  this.disabled = !!this.disabledAttribute;
6825
6833
  this.setAriaChecked();
6826
6834
  this.setValidity();
6835
+ maybeSetAutoFocus(this);
6827
6836
  }
6828
6837
  /**
6829
6838
  * Updates the form value when a user changes the `checked` state.
@@ -6950,9 +6959,6 @@ class BaseCheckbox extends FASTElement {
6950
6959
  * @public
6951
6960
  */
6952
6961
  BaseCheckbox.formAssociated = true;
6953
- __decorateClass$F([
6954
- attr({ mode: "boolean" })
6955
- ], BaseCheckbox.prototype, "autofocus", 2);
6956
6962
  __decorateClass$F([
6957
6963
  observable
6958
6964
  ], BaseCheckbox.prototype, "disabled", 2);
@@ -7420,7 +7426,7 @@ class DialogBody extends FASTElement {
7420
7426
 
7421
7427
  const template$v = html`<template><div class=title part=title><slot name=title></slot><slot name=title-action></slot><slot name=close @click=${(x, c) => x.clickHandler(c.event)}></slot></div><div class=content part=content><slot></slot></div><div class=actions part=actions><slot name=action></slot></div></template>`;
7422
7428
 
7423
- const styles$v = css`${display("grid")} :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}`;
7429
+ const styles$v = css`${display("grid")} :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}}`;
7424
7430
 
7425
7431
  const definition$v = DialogBody.compose({
7426
7432
  name: tagName$v,
@@ -7729,7 +7735,7 @@ __decorateClass$y([
7729
7735
  volatile
7730
7736
  ], Drawer.prototype, "dialogRole", 1);
7731
7737
 
7732
- const styles$t = css`${display("block")} :host{--dialog-backdrop:${colorBackgroundOverlay}}:host([type='non-modal']) dialog[open]::backdrop{display:none}:host([type='non-modal']) dialog{position:fixed;top:0;bottom:0}:host([type='inline']){height:100%;width:fit-content}:host([type='inline']) dialog[open]{box-shadow:none;position:relative}:host([size='small']) dialog{width:320px;max-width:320px}:host([size='large']) dialog{width:940px;max-width:940px}:host([size='full']) dialog{width:100%;max-width:100%}:host([position='end']) dialog{margin-inline-start:auto;margin-inline-end:0}dialog{box-sizing:border-box;z-index:var(--drawer-elevation,1000);font-size:${fontSizeBase300};line-height:${lineHeightBase300};font-family:${fontFamilyBase};font-weight:${fontWeightRegular};color:${colorNeutralForeground1};max-width:var(--drawer-width,592px);max-height:100vh;height:100%;margin-inline-start:0;margin-inline-end:auto;border-inline-end-color:${colorTransparentStroke};border-inline-start-color:var(--drawer-separator,${colorTransparentStroke});outline:none;top:0;bottom:0;width:var(--drawer-width,592px);border-radius:0;padding:0;max-width:var(--drawer-width,592px);box-shadow:${shadow64};border:${strokeWidthThin} solid ${colorTransparentStroke};background:${colorNeutralBackground1}}dialog::backdrop{background:var(--dialog-backdrop)}@layer animations{@media (prefers-reduced-motion:no-preference){dialog{transition:display allow-discrete,opacity,overlay allow-discrete,transform;transition-duration:${durationGentle};transition-timing-function:${curveDecelerateMid}}:host dialog:not([open]){transform:translateX(-100%);transition-timing-function:${curveAccelerateMid}}:host([position='end']) dialog:not([open]){transform:translateX(100%);transition-timing-function:${curveAccelerateMid}}dialog[open]{transform:translateX(0)}dialog::backdrop{transition:display allow-discrete,opacity,overlay allow-discrete,scale;transition-duration:${durationGentle};transition-timing-function:${curveDecelerateMid};background:var(--dialog-backdrop,${colorBackgroundOverlay});opacity:0}dialog[open]::backdrop{opacity:1}dialog::backdrop{transition-timing-function:${curveLinear}}}@starting-style{dialog[open]{transform:translateX(-100%)}:host([position='end']) dialog[open]{transform:translateX(100%)}dialog[open]::backdrop{opacity:0}}}`;
7738
+ const styles$t = css`${display("block")} :host{--dialog-backdrop:${colorBackgroundOverlay}}:host([type='non-modal']) dialog[open]::backdrop{display:none}:host([type='non-modal']) dialog{position:fixed;top:0;bottom:0}:host([type='inline']){height:100%;width:fit-content}:host([type='inline']) dialog[open]{box-shadow:none;position:relative}:host([size='small']) dialog{width:320px;max-width:320px}:host([size='large']) dialog{width:940px;max-width:940px}:host([size='full']) dialog{width:100%;max-width:100%}:host([position='end']) dialog{margin-inline-start:auto;margin-inline-end:0}dialog{background:${colorNeutralBackground1};border-radius:0;border:${strokeWidthThin} solid ${colorTransparentStroke};border-inline-end-color:${colorTransparentStroke};border-inline-start-color:var(--drawer-separator,${colorTransparentStroke});box-shadow:${shadow64};box-sizing:border-box;color:${colorNeutralForeground1};font-family:${fontFamilyBase};font-size:${fontSizeBase300};font-weight:${fontWeightRegular};height:100%;line-height:${lineHeightBase300};margin-inline-end:auto;margin-inline-start:0;max-height:100vh;max-width:calc(100vw - ${spacingHorizontalXXL});outline:none;padding:0;bottom:0;top:0;width:var(--drawer-width,592px);z-index:var(--drawer-elevation,1000)}dialog::backdrop{background:var(--dialog-backdrop)}@layer animations{@media (prefers-reduced-motion:no-preference){dialog{transition:display allow-discrete,opacity,overlay allow-discrete,transform;transition-duration:${durationGentle};transition-timing-function:${curveDecelerateMid}}:host dialog:not([open]){transform:translateX(-100%);transition-timing-function:${curveAccelerateMid}}:host([position='end']) dialog:not([open]){transform:translateX(100%);transition-timing-function:${curveAccelerateMid}}dialog[open]{transform:translateX(0)}dialog::backdrop{transition:display allow-discrete,opacity,overlay allow-discrete,scale;transition-duration:${durationGentle};transition-timing-function:${curveDecelerateMid};background:var(--dialog-backdrop,${colorBackgroundOverlay});opacity:0}dialog[open]::backdrop{opacity:1}dialog::backdrop{transition-timing-function:${curveLinear}}}@starting-style{dialog[open]{transform:translateX(-100%)}:host([position='end']) dialog[open]{transform:translateX(100%)}dialog[open]::backdrop{opacity:0}}}`;
7733
7739
 
7734
7740
  function drawerTemplate() {
7735
7741
  return html`<dialog class=dialog part=dialog aria-describedby=${(x) => x.dialogDescribedby} aria-labelledby=${(x) => x.dialogLabelledby} aria-label=${(x) => x.dialogLabel} aria-modal=${(x) => x.dialogModal} role=${(x) => x.dialogRole} size=${(x) => x.size} position=${(x) => x.position} @click=${(x, c) => x.clickHandler(c.event)} @cancel=${(x) => x.cancelHandler()} ${ref("dialog")}><slot></slot></dialog>`;
@@ -8383,7 +8389,7 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
8383
8389
  this._insertingControl = false;
8384
8390
  }
8385
8391
  /**
8386
- * Handles printable character input by moving {@link activeIndex} to the next option whose label matches the
8392
+ * Handles printable character input by moving {@link Dropdown#activeIndex} to the next option whose label matches the
8387
8393
  * accumulated search string. When the string is a single character (or the same character repeated), matching
8388
8394
  * options are cycled through; otherwise the string is treated as a prefix match.
8389
8395
  *
@@ -8586,6 +8592,7 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
8586
8592
  Updates.enqueue(() => {
8587
8593
  this.insertControl();
8588
8594
  });
8595
+ maybeSetAutoFocus(this);
8589
8596
  }
8590
8597
  disconnectedCallback() {
8591
8598
  _BaseDropdown.AnchorPositionFallbackObserver?.disconnect();
@@ -8731,7 +8738,7 @@ __decorateClass$w([
8731
8738
  attr
8732
8739
  ], Dropdown.prototype, "size", 2);
8733
8740
 
8734
- const styles$r = css`${display("inline-flex")} :host{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};white-space:normal;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}`;
8741
+ const styles$r = css`${display("inline-flex")} :host{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};white-space:normal;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}}`;
8735
8742
 
8736
8743
  const definition$r = Dropdown.compose({
8737
8744
  name: tagName$r,
@@ -9605,6 +9612,7 @@ class MenuItem extends FASTElement {
9605
9612
  super.connectedCallback();
9606
9613
  this.elementInternals.role = this.role ?? MenuItemRole.menuitem;
9607
9614
  this.elementInternals.ariaChecked = this.role !== MenuItemRole.menuitem ? `${!!this.checked}` : null;
9615
+ maybeSetAutoFocus(this);
9608
9616
  }
9609
9617
  }
9610
9618
  __decorateClass$p([
@@ -12339,6 +12347,7 @@ class Slider extends FASTElement {
12339
12347
  notifier.subscribe(this, "min");
12340
12348
  notifier.subscribe(this, "step");
12341
12349
  });
12350
+ maybeSetAutoFocus(this);
12342
12351
  }
12343
12352
  /**
12344
12353
  * @internal
@@ -12682,6 +12691,7 @@ class Tab extends FASTElement {
12682
12691
  }
12683
12692
  this.styles = css`:host{--textContent:'${this.textContent}'}`;
12684
12693
  this.$fastController.addStyles(this.styles);
12694
+ maybeSetAutoFocus(this);
12685
12695
  }
12686
12696
  setDisabledSideEffect(disabled) {
12687
12697
  if (disabled) {
@@ -13183,6 +13193,7 @@ class BaseTextArea extends FASTElement {
13183
13193
  this.setValidity();
13184
13194
  this.preConnectControlEl = null;
13185
13195
  this.maybeCreateAutoSizerEl();
13196
+ maybeSetAutoFocus(this);
13186
13197
  });
13187
13198
  }
13188
13199
  /**
@@ -13727,21 +13738,9 @@ class BaseTextInput extends FASTElement {
13727
13738
  }
13728
13739
  connectedCallback() {
13729
13740
  super.connectedCallback();
13730
- this.tabIndex = Number(this.getAttribute("tabindex") ?? 0) < 0 ? -1 : 0;
13731
13741
  this.setFormValue(this.value);
13732
13742
  this.setValidity();
13733
- }
13734
- /**
13735
- * Focuses the inner control when the component is focused.
13736
- *
13737
- * @param e - the event object
13738
- * @public
13739
- */
13740
- focusinHandler(e) {
13741
- if (e.target === this) {
13742
- this.control?.focus();
13743
- }
13744
- return true;
13743
+ maybeSetAutoFocus(this);
13745
13744
  }
13746
13745
  /**
13747
13746
  * Resets the value to its initial value when the form is reset.
@@ -13875,9 +13874,6 @@ BaseTextInput.formAssociated = true;
13875
13874
  __decorateClass$8([
13876
13875
  attr
13877
13876
  ], BaseTextInput.prototype, "autocomplete", 2);
13878
- __decorateClass$8([
13879
- attr({ mode: "boolean" })
13880
- ], BaseTextInput.prototype, "autofocus", 2);
13881
13877
  __decorateClass$8([
13882
13878
  attr({ attribute: "current-value" })
13883
13879
  ], BaseTextInput.prototype, "currentValue", 2);
@@ -13967,7 +13963,7 @@ applyMixins(TextInput, StartEnd);
13967
13963
  const styles$5 = css`${display("block")} :host{font-family:${fontFamilyBase};font-size:${fontSizeBase300};font-weight:${fontWeightRegular};line-height:${lineHeightBase300};max-width:400px}.label{display:flex;color:${colorNeutralForeground1};padding-bottom:${spacingVerticalXS};flex-shrink:0;padding-inline-end:${spacingHorizontalXS}}.label[hidden],:host(:empty) .label{display:none}.root{align-items:center;background-color:${colorNeutralBackground1};border:${strokeWidthThin} solid ${colorNeutralStroke1};border-bottom-color:${colorNeutralStrokeAccessible};border-radius:${borderRadiusMedium};box-sizing:border-box;height:32px;display:inline-flex;flex-direction:row;gap:${spacingHorizontalXXS};padding:0 ${spacingHorizontalMNudge};position:relative;width:100%}:has(.control:user-invalid){border-color:${colorPaletteRedBorder2}}.root::after{box-sizing:border-box;content:'';position:absolute;left:-1px;bottom:0px;right:-1px;height:max(2px,${borderRadiusMedium});border-radius:0 0 ${borderRadiusMedium} ${borderRadiusMedium};border-bottom:2px solid ${colorCompoundBrandStroke};clip-path:inset(calc(100% - 2px) 1px 0px);transform:scaleX(0);transition-property:transform;transition-duration:${durationUltraFast};transition-delay:${curveAccelerateMid}}.control{width:100%;height:100%;box-sizing:border-box;color:${colorNeutralForeground1};border-radius:${borderRadiusMedium};background:${colorTransparentBackground};font-family:${fontFamilyBase};font-weight:${fontWeightRegular};font-size:${fontSizeBase300};border:none;vertical-align:center}.control:focus-visible{outline:0;border:0}.control::placeholder{color:${colorNeutralForeground4}}:host ::slotted([slot='start']),:host ::slotted([slot='end']){display:flex;align-items:center;justify-content:center;color:${colorNeutralForeground3};font-size:${fontSizeBase500}}:host ::slotted([slot='start']){padding-right:${spacingHorizontalXXS}}:host ::slotted([slot='end']){padding-left:${spacingHorizontalXXS};gap:${spacingHorizontalXS}}:host(:hover) .root{border-color:${colorNeutralStroke1Hover};border-bottom-color:${colorNeutralStrokeAccessibleHover}}:host(:active) .root{border-color:${colorNeutralStroke1Pressed}}:host(:focus-within) .root{outline:transparent solid 2px;border-bottom:0}:host(:focus-within) .root::after{transform:scaleX(1);transition-property:transform;transition-duration:${durationNormal};transition-delay:${curveDecelerateMid}}:host(:focus-within:active) .root:after{border-bottom-color:${colorCompoundBrandStrokePressed}}:host([appearance='outline']:focus-within) .root{border:${strokeWidthThin} solid ${colorNeutralStroke1}}:host(:focus-within) .control{color:${colorNeutralForeground1}}:host([disabled]) .root{background:${colorTransparentBackground};border:${strokeWidthThin} solid ${colorNeutralStrokeDisabled}}:host([disabled]) .control::placeholder,:host([disabled]) ::slotted([slot='start']),:host([disabled]) ::slotted([slot='end']){color:${colorNeutralForegroundDisabled}}::selection{color:${colorNeutralForegroundInverted};background-color:${colorNeutralBackgroundInverted}}:host([control-size='small']) .control{font-size:${fontSizeBase200};font-weight:${fontWeightRegular};line-height:${lineHeightBase200}}:host([control-size='small']) .root{height:24px;gap:${spacingHorizontalXXS};padding:0 ${spacingHorizontalSNudge}}:host([control-size='small']) ::slotted([slot='start']),:host([control-size='small']) ::slotted([slot='end']){font-size:${fontSizeBase400}}:host([control-size='large']) .control{font-size:${fontSizeBase400};font-weight:${fontWeightRegular};line-height:${lineHeightBase400}}:host([control-size='large']) .root{height:40px;gap:${spacingHorizontalS};padding:0 ${spacingHorizontalM}}:host([control-size='large']) ::slotted([slot='start']),:host([control-size='large']) ::slotted([slot='end']){font-size:${fontSizeBase600}}:host([appearance='underline']) .root{background:${colorTransparentBackground};border:0;border-radius:0;border-bottom:${strokeWidthThin} solid ${colorNeutralStrokeAccessible}}:host([appearance='underline']:hover) .root{border-bottom-color:${colorNeutralStrokeAccessibleHover}}:host([appearance='underline']:active) .root{border-bottom-color:${colorNeutralStrokeAccessiblePressed}}:host([appearance='underline']:focus-within) .root{border:0;border-bottom-color:${colorNeutralStrokeAccessiblePressed}}:host([appearance='underline'][disabled]) .root{border-bottom-color:${colorNeutralStrokeDisabled}}:host([appearance='filled-lighter']) .root,:host([appearance='filled-darker']) .root{border:${strokeWidthThin} solid ${colorTransparentStroke};box-shadow:${shadow2}}:host([appearance='filled-lighter']) .root{background:${colorNeutralBackground1}}:host([appearance='filled-darker']) .root{background:${colorNeutralBackground3}}:host([appearance='filled-lighter']:hover) .root,:host([appearance='filled-darker']:hover) .root{border-color:${colorTransparentStrokeInteractive}}:host([appearance='filled-lighter']:active) .root,:host([appearance='filled-darker']:active) .root{border-color:${colorTransparentStrokeInteractive};background:${colorNeutralBackground3}}`;
13968
13964
 
13969
13965
  function textInputTemplate(options = {}) {
13970
- return html`<template @focusin=${(x, c) => x.focusinHandler(c.event)} @keydown=${(x, c) => x.keydownHandler(c.event)}><label part=label for=control class=label ${ref("controlLabel")}><slot ${slotted("defaultSlottedNodes")}></slot></label><div class=root part=root>${startSlotTemplate(options)} <input class=control part=control id=control @change=${(x, c) => x.changeHandler(c.event)} @input=${(x, c) => x.inputHandler(c.event)} ?autofocus=${(x) => x.autofocus} autocomplete=${(x) => x.autocomplete} ?disabled=${(x) => x.disabled} list=${(x) => x.list} maxlength=${(x) => x.maxlength} minlength=${(x) => x.minlength} ?multiple=${(x) => x.multiple} name=${(x) => x.name} pattern=${(x) => x.pattern} placeholder=${(x) => x.placeholder} ?readonly=${(x) => x.readOnly} ?required=${(x) => x.required} size=${(x) => x.size} spellcheck=${(x) => x.spellcheck} type=${(x) => x.type} value=${(x) => x.value} ${ref("control")}> ${endSlotTemplate(options)}</div></template>`;
13966
+ return html`<template @keydown=${(x, c) => x.keydownHandler(c.event)}><label part=label for=control class=label ${ref("controlLabel")}><slot ${slotted("defaultSlottedNodes")}></slot></label><div class=root part=root>${startSlotTemplate(options)} <input class=control part=control id=control @change=${(x, c) => x.changeHandler(c.event)} @input=${(x, c) => x.inputHandler(c.event)} autocomplete=${(x) => x.autocomplete} ?disabled=${(x) => x.disabled} list=${(x) => x.list} maxlength=${(x) => x.maxlength} minlength=${(x) => x.minlength} ?multiple=${(x) => x.multiple} name=${(x) => x.name} pattern=${(x) => x.pattern} placeholder=${(x) => x.placeholder} ?readonly=${(x) => x.readOnly} ?required=${(x) => x.required} size=${(x) => x.size} spellcheck=${(x) => x.spellcheck} type=${(x) => x.type} value=${(x) => x.value} ${ref("control")}> ${endSlotTemplate(options)}</div></template>`;
13971
13967
  }
13972
13968
  const template$5 = textInputTemplate();
13973
13969
 
@@ -14701,6 +14697,7 @@ class BaseTreeItem extends FASTElement {
14701
14697
  if (isTreeItem(this.parentElement)) {
14702
14698
  this.slot || (this.slot = "item");
14703
14699
  }
14700
+ maybeSetAutoFocus(this);
14704
14701
  }
14705
14702
  /**
14706
14703
  * Handles changes to the expanded attribute