@fluentui/web-components 2.5.5 → 2.5.7

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 (59) hide show
  1. package/CHANGELOG.json +46 -1
  2. package/CHANGELOG.md +20 -2
  3. package/dist/dts/combobox/combobox.stories.d.ts +5 -0
  4. package/dist/dts/custom-elements.d.ts +3 -35
  5. package/dist/dts/number-field/index.d.ts +1 -1
  6. package/dist/dts/number-field/number-field.styles.d.ts +1 -2
  7. package/dist/dts/search/index.d.ts +1 -1
  8. package/dist/dts/search/search.styles.d.ts +2 -3
  9. package/dist/dts/select/index.d.ts +1 -1
  10. package/dist/dts/select/select.styles.d.ts +11 -3
  11. package/dist/dts/styles/focus.d.ts +13 -0
  12. package/dist/dts/styles/index.d.ts +1 -0
  13. package/dist/dts/styles/patterns/button.styles.d.ts +12 -6
  14. package/dist/dts/styles/patterns/input.styles.d.ts +13 -5
  15. package/dist/dts/text-area/index.d.ts +2 -18
  16. package/dist/dts/text-area/text-area.stories.d.ts +1 -17
  17. package/dist/dts/text-area/text-area.styles.d.ts +1 -2
  18. package/dist/dts/text-field/index.d.ts +2 -18
  19. package/dist/dts/text-field/text-field.stories.d.ts +1 -17
  20. package/dist/dts/text-field/text-field.styles.d.ts +1 -2
  21. package/dist/esm/accordion/accordion-item/accordion-item.styles.js +8 -10
  22. package/dist/esm/anchor/anchor.styles.js +3 -10
  23. package/dist/esm/breadcrumb-item/breadcrumb-item.styles.js +6 -10
  24. package/dist/esm/button/button.styles.js +14 -39
  25. package/dist/esm/checkbox/checkbox.styles.js +4 -8
  26. package/dist/esm/combobox/combobox.stories.js +7 -2
  27. package/dist/esm/combobox/combobox.styles.js +22 -23
  28. package/dist/esm/data-grid/data-grid-cell.styles.js +6 -9
  29. package/dist/esm/flipper/flipper.styles.js +5 -6
  30. package/dist/esm/listbox/listbox.styles.js +3 -4
  31. package/dist/esm/listbox-option/listbox-option.styles.js +9 -6
  32. package/dist/esm/menu/menu.styles.js +1 -1
  33. package/dist/esm/menu-item/menu-item.styles.js +5 -9
  34. package/dist/esm/number-field/number-field.styles.js +5 -16
  35. package/dist/esm/progress/progress/progress.styles.js +0 -1
  36. package/dist/esm/progress/progress-ring/progress-ring.styles.js +0 -1
  37. package/dist/esm/radio/radio.styles.js +4 -9
  38. package/dist/esm/search/search.styles.js +8 -11
  39. package/dist/esm/select/select.stories.js +2 -2
  40. package/dist/esm/select/select.styles.js +37 -110
  41. package/dist/esm/styles/focus.js +21 -0
  42. package/dist/esm/styles/index.js +1 -0
  43. package/dist/esm/styles/patterns/button.styles.js +194 -161
  44. package/dist/esm/styles/patterns/input.styles.js +113 -102
  45. package/dist/esm/switch/switch.styles.js +5 -17
  46. package/dist/esm/tabs/tab/tab.styles.js +4 -6
  47. package/dist/esm/text-area/text-area.stories.js +2 -2
  48. package/dist/esm/text-area/text-area.styles.js +5 -11
  49. package/dist/esm/text-field/text-field.styles.js +5 -11
  50. package/dist/esm/toolbar/toolbar.styles.js +4 -3
  51. package/dist/esm/tree-item/tree-item.styles.js +4 -14
  52. package/dist/esm/tree-view/tree-view.styles.js +0 -4
  53. package/dist/fluent-web-components.api.json +179 -397
  54. package/dist/web-components.d.ts +54 -90
  55. package/dist/web-components.js +158 -132
  56. package/dist/web-components.min.js +137 -156
  57. package/docs/api-report.md +44 -99
  58. package/karma.conf.js +3 -8
  59. package/package.json +27 -40
@@ -2,28 +2,29 @@ import { css } from '@microsoft/fast-element';
2
2
  import { SystemColors } from '@microsoft/fast-web-utilities';
3
3
  import { display, focusVisible, forcedColorsStylesheetBehavior, } from '@microsoft/fast-foundation';
4
4
  import { heightNumber } from '../size';
5
- import { accentFillActive, accentFillHover, accentFillRest, accentForegroundActive, accentForegroundHover, accentForegroundRest, accentStrokeControlActive, accentStrokeControlHover, accentStrokeControlRest, controlCornerRadius, density, designUnit, focusStrokeInner, focusStrokeOuter, focusStrokeWidth, foregroundOnAccentActive, foregroundOnAccentHover, foregroundOnAccentRest, neutralFillActive, neutralFillHover, neutralFillRest, neutralFillStealthActive, neutralFillStealthHover, neutralFillStealthRest, neutralForegroundRest, neutralStrokeActive, neutralStrokeControlActive, neutralStrokeControlHover, neutralStrokeControlRest, neutralStrokeHover, neutralStrokeRest, strokeWidth, } from '../../design-tokens';
5
+ import { accentFillActive, accentFillHover, accentFillRest, accentForegroundActive, accentForegroundHover, accentForegroundRest, accentStrokeControlActive, accentStrokeControlHover, accentStrokeControlRest, controlCornerRadius, density, designUnit, focusStrokeInner, focusStrokeWidth, foregroundOnAccentActive, foregroundOnAccentHover, foregroundOnAccentRest, neutralFillActive, neutralFillHover, neutralFillRest, neutralFillStealthActive, neutralFillStealthHover, neutralFillStealthRest, neutralForegroundRest, neutralStrokeActive, neutralStrokeControlActive, neutralStrokeControlHover, neutralStrokeControlRest, neutralStrokeHover, neutralStrokeRest, strokeWidth, } from '../../design-tokens';
6
6
  import { typeRampBase } from '../../styles/patterns/type-ramp';
7
+ import { focusTreatmentBase, focusTreatmentTight } from '../focus';
7
8
  /**
9
+ * The base styles for button controls, without `appearance` visual differences.
10
+ *
8
11
  * @internal
9
12
  */
10
- export const baseButtonStyles = (context, definition, interactivitySelector = '', nonInteractivitySelector = '') => css `
11
- ${display('inline-flex')} :host {
13
+ export const baseButtonStyles = (context, definition, interactivitySelector, nonInteractivitySelector = '[disabled]') => css `
14
+ ${display('inline-flex')}
15
+
16
+ :host {
12
17
  position: relative;
13
18
  box-sizing: border-box;
14
- outline: none;
15
19
  ${typeRampBase}
16
20
  height: calc(${heightNumber} * 1px);
17
21
  min-width: calc(${heightNumber} * 1px);
18
22
  color: ${neutralForegroundRest};
19
23
  border-radius: calc(${controlCornerRadius} * 1px);
20
24
  fill: currentcolor;
21
- cursor: pointer;
22
25
  }
23
26
 
24
- :host .control {
25
- background: padding-box linear-gradient(${neutralFillRest}, ${neutralFillRest}),
26
- border-box ${neutralStrokeControlRest};
27
+ .control {
27
28
  border: calc(${strokeWidth} * 1px) solid transparent;
28
29
  flex-grow: 1;
29
30
  box-sizing: border-box;
@@ -37,7 +38,6 @@ export const baseButtonStyles = (context, definition, interactivitySelector = ''
37
38
  color: inherit;
38
39
  border-radius: inherit;
39
40
  fill: inherit;
40
- cursor: inherit;
41
41
  font-family: inherit;
42
42
  }
43
43
 
@@ -52,23 +52,8 @@ export const baseButtonStyles = (context, definition, interactivitySelector = ''
52
52
  line-height: 0;
53
53
  }
54
54
 
55
- :host .control${interactivitySelector}:hover {
56
- background: padding-box linear-gradient(${neutralFillHover}, ${neutralFillHover}),
57
- border-box ${neutralStrokeControlHover};
58
- }
59
-
60
- :host .control${interactivitySelector}:active {
61
- background: padding-box linear-gradient(${neutralFillActive}, ${neutralFillActive}),
62
- border-box ${neutralStrokeControlActive};
63
- }
64
-
65
- :host .control:${focusVisible} {
66
- border-color: ${focusStrokeOuter} !important;
67
- box-shadow: 0 0 0 calc((${focusStrokeWidth} - ${strokeWidth}) * 1px) ${focusStrokeOuter} inset !important;
68
- }
69
-
70
- :host .control${nonInteractivitySelector} {
71
- background: padding-box linear-gradient(${neutralFillRest}, ${neutralFillRest}), border-box ${neutralStrokeRest};
55
+ .control:${focusVisible} {
56
+ ${focusTreatmentBase}
72
57
  }
73
58
 
74
59
  .control::-moz-focus-inner {
@@ -92,117 +77,138 @@ export const baseButtonStyles = (context, definition, interactivitySelector = ''
92
77
  .end {
93
78
  margin-inline-start: 11px;
94
79
  }
80
+ `;
81
+ /**
82
+ * @internal
83
+ */
84
+ export const NeutralButtonStyles = (context, definition, interactivitySelector, nonInteractivitySelector = '[disabled]') => css `
85
+ .control {
86
+ background: padding-box linear-gradient(${neutralFillRest}, ${neutralFillRest}),
87
+ border-box ${neutralStrokeControlRest};
88
+ }
89
+
90
+ :host(${interactivitySelector}:hover) .control {
91
+ background: padding-box linear-gradient(${neutralFillHover}, ${neutralFillHover}),
92
+ border-box ${neutralStrokeControlHover};
93
+ }
94
+
95
+ :host(${interactivitySelector}:active) .control {
96
+ background: padding-box linear-gradient(${neutralFillActive}, ${neutralFillActive}),
97
+ border-box ${neutralStrokeControlActive};
98
+ }
99
+
100
+ :host(${nonInteractivitySelector}) .control {
101
+ background: padding-box linear-gradient(${neutralFillRest}, ${neutralFillRest}),
102
+ border-box ${neutralStrokeRest};
103
+ }
95
104
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
96
- :host .control {
105
+ .control {
97
106
  background: ${SystemColors.ButtonFace};
98
107
  border-color: ${SystemColors.ButtonText};
99
108
  color: ${SystemColors.ButtonText};
100
- fill: currentcolor;
101
109
  }
102
- :host(:not([disabled])) .control:hover,
103
- :host .control${interactivitySelector}:hover,
104
- .control${interactivitySelector}:hover {
110
+
111
+ :host(${interactivitySelector}:hover) .control,
112
+ :host(${interactivitySelector}:active) .control {
105
113
  forced-color-adjust: none;
106
- background: ${SystemColors.Highlight};
107
- color: ${SystemColors.HighlightText};
114
+ background: ${SystemColors.HighlightText};
115
+ border-color: ${SystemColors.Highlight};
116
+ color: ${SystemColors.Highlight};
108
117
  }
109
- .control:${focusVisible},
110
- :host .control:${focusVisible},
111
- :host(:${focusVisible}) .control {
112
- forced-color-adjust: none;
113
- background: ${SystemColors.ButtonFace};
114
- border-color: ${SystemColors.Highlight} !important;
115
- box-shadow: 0 0 0 calc((${focusStrokeWidth} - ${strokeWidth}) * 1px) ${SystemColors.Highlight} !important;
118
+
119
+ :host(${nonInteractivitySelector}) .control {
120
+ background: transparent;
121
+ border-color: ${SystemColors.GrayText};
122
+ color: ${SystemColors.GrayText};
123
+ }
124
+
125
+ .control:${focusVisible} {
126
+ outline-color: ${SystemColors.CanvasText};
116
127
  }
128
+
117
129
  :host([href]) .control {
118
- background: ${SystemColors.ButtonFace};
130
+ background: transparent;
119
131
  border-color: ${SystemColors.LinkText};
120
132
  color: ${SystemColors.LinkText};
121
- fill: currentcolor;
122
- }
123
- :host([href]) .control:hover,
124
- :host(.neutral[href]) .control:hover {
125
- background: ${SystemColors.LinkText};
126
- border-color: ${SystemColors.LinkText} !important;
127
- color: ${SystemColors.HighlightText};
128
- fill: currentcolor;
129
133
  }
130
- :host([href]) .control:${focusVisible}{
131
- forced-color-adjust: none;
132
- border-color: ${SystemColors.LinkText} !important;
133
- box-shadow: 0 0 0 calc((${focusStrokeWidth} - ${strokeWidth}) * 1px) ${SystemColors.LinkText} !important;
134
+
135
+ :host([href]:hover) .control,
136
+ :host([href]:active) .control {
137
+ background: transparent;
138
+ border-color: ${SystemColors.CanvasText};
139
+ color: ${SystemColors.CanvasText};
134
140
  }
135
141
  `));
136
142
  /**
137
143
  * @internal
138
144
  */
139
- export const AccentButtonStyles = (context, definition, interactivitySelector = '', nonInteractivitySelector = '') => css `
140
- :host .control {
145
+ export const AccentButtonStyles = (context, definition, interactivitySelector, nonInteractivitySelector = '[disabled]') => css `
146
+ .control {
141
147
  background: padding-box linear-gradient(${accentFillRest}, ${accentFillRest}),
142
148
  border-box ${accentStrokeControlRest};
143
149
  color: ${foregroundOnAccentRest};
144
150
  }
145
151
 
146
- :host .control${interactivitySelector}:hover {
152
+ :host(${interactivitySelector}:hover) .control {
147
153
  background: padding-box linear-gradient(${accentFillHover}, ${accentFillHover}),
148
154
  border-box ${accentStrokeControlHover};
149
155
  color: ${foregroundOnAccentHover};
150
156
  }
151
157
 
152
- :host .control${interactivitySelector}:active {
158
+ :host(${interactivitySelector}:active) .control {
153
159
  background: padding-box linear-gradient(${accentFillActive}, ${accentFillActive}),
154
160
  border-box ${accentStrokeControlActive};
155
161
  color: ${foregroundOnAccentActive};
156
162
  }
157
163
 
158
- :host .control:${focusVisible} {
159
- box-shadow: 0 0 0 calc((${focusStrokeWidth} - ${strokeWidth}) * 1px) ${focusStrokeOuter} inset,
160
- 0 0 0 calc(((${focusStrokeWidth} + ${strokeWidth}) - ${strokeWidth}) * 1px) ${focusStrokeInner} inset !important;
164
+ :host(${nonInteractivitySelector}) .control {
165
+ background: ${accentFillRest};
161
166
  }
162
167
 
163
- :host .control${nonInteractivitySelector} {
164
- background: ${accentFillRest};
168
+ .control:${focusVisible} {
169
+ box-shadow: 0 0 0 calc(${focusStrokeWidth} * 1px) ${focusStrokeInner} inset !important;
165
170
  }
166
171
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
167
- :host .control {
172
+ .control {
168
173
  forced-color-adjust: none;
169
174
  background: ${SystemColors.Highlight};
170
175
  color: ${SystemColors.HighlightText};
171
176
  }
172
- :host .control${interactivitySelector}:hover,
173
- :host .control${interactivitySelector}:active {
177
+
178
+ :host(${interactivitySelector}:hover) .control,
179
+ :host(${interactivitySelector}:active) .control {
174
180
  background: ${SystemColors.HighlightText};
175
181
  border-color: ${SystemColors.Highlight};
176
182
  color: ${SystemColors.Highlight};
177
183
  }
178
- :host .control:${focusVisible} {
179
- background: ${SystemColors.Highlight};
180
- box-shadow: 0 0 0 calc((${focusStrokeWidth} - ${strokeWidth}) * 1px) ${SystemColors.Highlight} inset,
181
- 0 0 0 calc(((${focusStrokeWidth} + ${strokeWidth}) - ${strokeWidth}) * 1px) ${SystemColors.HighlightText} inset !important;
184
+
185
+ :host(${nonInteractivitySelector}) .control {
186
+ background: transparent;
187
+ border-color: ${SystemColors.GrayText};
188
+ color: ${SystemColors.GrayText};
189
+ }
190
+
191
+ .control:${focusVisible} {
192
+ outline-color: ${SystemColors.CanvasText};
193
+ box-shadow: 0 0 0 calc(${focusStrokeWidth} * 1px) ${SystemColors.HighlightText} inset !important;
182
194
  }
195
+
183
196
  :host([href]) .control {
184
197
  background: ${SystemColors.LinkText};
185
198
  color: ${SystemColors.HighlightText};
186
199
  }
187
- :host([href]) .control:hover {
200
+
201
+ :host([href]:hover) .control,
202
+ :host([href]:active) .control {
188
203
  background: ${SystemColors.ButtonFace};
189
204
  border-color: ${SystemColors.LinkText};
190
- box-shadow: none;
191
205
  color: ${SystemColors.LinkText};
192
- fill: currentcolor;
193
- }
194
- :host([href]) .control:${focusVisible} {
195
- background: ${SystemColors.LinkText};
196
- box-shadow: 0 0 0 calc((${focusStrokeWidth} - ${strokeWidth}) * 1px) ${SystemColors.LinkText} inset,
197
- 0 0 0 calc(((${focusStrokeWidth} + ${strokeWidth}) - ${strokeWidth}) * 1px) ${SystemColors.HighlightText} inset !important;
198
- color: ${SystemColors.HighlightText};
199
- fill: currentcolor;
200
206
  }
201
207
  `));
202
208
  /**
203
209
  * @internal
204
210
  */
205
- export const HypertextStyles = (context, definition, interactivitySelector = '', nonInteractivitySelector = '') => css `
211
+ export const HypertextStyles = (context, definition, interactivitySelector, nonInteractivitySelector = '[disabled]') => css `
206
212
  :host {
207
213
  height: auto;
208
214
  font-family: inherit;
@@ -211,184 +217,211 @@ export const HypertextStyles = (context, definition, interactivitySelector = '',
211
217
  min-width: 0;
212
218
  }
213
219
 
214
- :host .control {
220
+ .control {
215
221
  display: inline;
216
222
  padding: 0;
217
- background: transparent;
218
223
  border: none;
219
224
  box-shadow: none;
220
225
  line-height: 1;
221
- text-decoration: underline 1px;
222
- }
223
-
224
- :host .control:not([href]) {
225
- background: transparent;
226
226
  }
227
227
 
228
- :host .control${interactivitySelector} {
229
- background: transparent;
228
+ :host(${interactivitySelector}) .control {
230
229
  color: ${accentForegroundRest};
230
+ text-decoration: underline 1px;
231
231
  }
232
232
 
233
- :host .control${interactivitySelector}:hover {
234
- background: transparent;
233
+ :host(${interactivitySelector}:hover) .control {
235
234
  color: ${accentForegroundHover};
236
235
  text-decoration: none;
237
236
  }
238
237
 
239
- :host .control${interactivitySelector}:active {
240
- background: transparent;
238
+ :host(${interactivitySelector}:active) .control {
241
239
  color: ${accentForegroundActive};
242
240
  text-decoration: none;
243
241
  }
244
242
 
245
- :host .control:${focusVisible} {
246
- box-shadow: 0 0 0 calc(${focusStrokeWidth} * 1px) ${focusStrokeOuter} !important;
247
- }
248
-
249
- :host .control${nonInteractivitySelector} {
250
- background: transparent;
243
+ .control:${focusVisible} {
244
+ ${focusTreatmentTight}
251
245
  }
252
246
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
253
- :host .control${interactivitySelector}:hover {
254
- color: ${SystemColors.Highlight};
255
- fill: currentcolor;
256
- }
257
- :host .control:${focusVisible} {
258
- color: ${SystemColors.LinkText};
259
- }
247
+ :host(${interactivitySelector}) .control {
248
+ color: ${SystemColors.LinkText};
249
+ }
250
+
251
+ :host(${interactivitySelector}:hover) .control,
252
+ :host(${interactivitySelector}:active) .control {
253
+ color: ${SystemColors.CanvasText};
254
+ }
255
+
256
+ .control:${focusVisible} {
257
+ outline-color: ${SystemColors.CanvasText};
258
+ }
260
259
  `));
261
260
  /**
262
261
  * @internal
263
262
  */
264
- export const LightweightButtonStyles = (context, definition, interactivitySelector = '', nonInteractivitySelector = '') => css `
263
+ export const LightweightButtonStyles = (context, definition, interactivitySelector, nonInteractivitySelector = '[disabled]') => css `
265
264
  :host {
266
265
  color: ${accentForegroundRest};
267
266
  }
268
267
 
269
- :host .control {
268
+ .control {
270
269
  background: ${neutralFillStealthRest};
271
270
  }
272
271
 
273
- :host .control${interactivitySelector}:hover {
272
+ :host(${interactivitySelector}:hover) .control {
274
273
  background: ${neutralFillStealthHover};
275
274
  color: ${accentForegroundHover};
276
275
  }
277
276
 
278
- :host .control${interactivitySelector}:active {
277
+ :host(${interactivitySelector}:active) .control {
279
278
  background: ${neutralFillStealthActive};
280
279
  color: ${accentForegroundActive};
281
280
  }
282
281
 
283
- :host .control${nonInteractivitySelector} {
282
+ :host(${nonInteractivitySelector}) .control {
284
283
  background: ${neutralFillStealthRest};
285
284
  }
286
285
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
287
- :host .control {
288
- border-color: ${SystemColors.ButtonFace};
286
+ :host {
289
287
  color: ${SystemColors.ButtonText};
290
288
  }
291
- :host .control${interactivitySelector}:hover,
292
- :host .control${interactivitySelector}:active,
293
- :host .control:${focusVisible} {
294
- border-color: ${SystemColors.Highlight};
295
- background: ${SystemColors.Highlight};
296
- box-shadow: none;
297
- color: ${SystemColors.HighlightText};
289
+
290
+ .control {
291
+ forced-color-adjust: none;
292
+ background: transparent;
293
+ }
294
+
295
+ :host(${interactivitySelector}:hover) .control,
296
+ :host(${interactivitySelector}:active) .control {
297
+ background: transparent;
298
+ border-color: ${SystemColors.ButtonText};
299
+ color: ${SystemColors.ButtonText};
298
300
  }
301
+
302
+ :host(${nonInteractivitySelector}) .control {
303
+ background: transparent;
304
+ color: ${SystemColors.GrayText};
305
+ }
306
+
307
+ .control:${focusVisible} {
308
+ outline-color: ${SystemColors.CanvasText};
309
+ }
310
+
299
311
  :host([href]) .control {
300
- border-color: ${SystemColors.ButtonFace};
301
312
  color: ${SystemColors.LinkText};
302
313
  }
303
- :host([href]) .control:hover,
304
- :host([href]) .control:${focusVisible} {
305
- background: ${SystemColors.ButtonFace};
306
- box-shadow: none;
314
+
315
+ :host([href]:hover) .control,
316
+ :host([href]:active) .control {
317
+ border-color: ${SystemColors.LinkText};
307
318
  color: ${SystemColors.LinkText};
308
319
  }
309
320
  `));
310
321
  /**
311
322
  * @internal
312
323
  */
313
- export const OutlineButtonStyles = (context, definition, interactivitySelector = '', nonInteractivitySelector = '') => css `
314
- :host .control {
324
+ export const OutlineButtonStyles = (context, definition, interactivitySelector, nonInteractivitySelector = '[disabled]') => css `
325
+ .control {
315
326
  background: transparent !important;
316
327
  border-color: ${neutralStrokeRest};
317
328
  }
318
329
 
319
- :host .control${interactivitySelector}:hover {
330
+ :host(${interactivitySelector}:hover) .control {
320
331
  border-color: ${neutralStrokeHover};
321
332
  }
322
333
 
323
- :host .control${interactivitySelector}:active {
334
+ :host(${interactivitySelector}:active) .control {
324
335
  border-color: ${neutralStrokeActive};
325
336
  }
326
337
 
327
- :host .control${nonInteractivitySelector} {
338
+ :host(${nonInteractivitySelector}) .control {
328
339
  background: transparent !important;
329
340
  border-color: ${neutralStrokeRest};
330
341
  }
331
342
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
332
- :host .control${nonInteractivitySelector} {
343
+ .control {
333
344
  border-color: ${SystemColors.ButtonText};
345
+ color: ${SystemColors.ButtonText};
334
346
  }
335
- :host .control${interactivitySelector}:hover {
347
+
348
+ :host(${interactivitySelector}:hover) .control,
349
+ :host(${interactivitySelector}:active) .control {
350
+ background: ${SystemColors.HighlightText};
336
351
  border-color: ${SystemColors.Highlight};
337
- color: ${SystemColors.ButtonText};
352
+ color: ${SystemColors.Highlight};
338
353
  }
339
- :host([href]) {
340
- border-color: ${SystemColors.LinkText};
354
+
355
+ :host(${nonInteractivitySelector}) .control {
356
+ border-color: ${SystemColors.GrayText};
357
+ color: ${SystemColors.GrayText};
341
358
  }
342
- :host([href]) .control:hover {
343
- box-shadow: 0 0 0 calc((${focusStrokeWidth} - ${strokeWidth}) * 1px) ${SystemColors.LinkText};
359
+
360
+ .control:${focusVisible} {
361
+ outline-color: ${SystemColors.CanvasText};
362
+ }
363
+
364
+ :host([href]) .control {
365
+ border-color: ${SystemColors.LinkText};
344
366
  color: ${SystemColors.LinkText};
345
367
  }
368
+
369
+ :host([href]:hover) .control,
370
+ :host([href]:active) .control {
371
+ border-color: ${SystemColors.CanvasText};
372
+ color: ${SystemColors.CanvasText};
373
+ }
346
374
  `));
347
375
  /**
348
376
  * @internal
349
377
  */
350
- export const StealthButtonStyles = (context, definition, interactivitySelector = '', nonInteractivitySelector = '') => css `
351
- :host .control {
378
+ export const StealthButtonStyles = (context, definition, interactivitySelector, nonInteractivitySelector = '[disabled]') => css `
379
+ .control {
352
380
  background: ${neutralFillStealthRest};
353
381
  }
354
382
 
355
- :host .control${interactivitySelector}:hover {
383
+ :host(${interactivitySelector}:hover) .control {
356
384
  background: ${neutralFillStealthHover};
357
385
  }
358
386
 
359
- :host .control${interactivitySelector}:active {
387
+ :host(${interactivitySelector}:active) .control {
360
388
  background: ${neutralFillStealthActive};
361
389
  }
362
390
 
363
- :host .control${nonInteractivitySelector} {
391
+ :host(${nonInteractivitySelector}) .control {
364
392
  background: ${neutralFillStealthRest};
365
393
  }
366
394
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
367
- :host .control {
368
- background: ${SystemColors.ButtonFace};
369
- border-color: ${SystemColors.ButtonFace};
395
+ .control {
396
+ forced-color-adjust: none;
397
+ background: transparent;
370
398
  color: ${SystemColors.ButtonText};
371
- fill: currentcolor;
372
399
  }
373
- :host .control${interactivitySelector}:hover,
374
- :host .control${interactivitySelector}:active,
375
- :host .control:${focusVisible} {
376
- background: ${SystemColors.Highlight};
377
- border-color: ${SystemColors.Highlight};
378
- box-shadow: none !important;
379
- color: ${SystemColors.HighlightText};
380
- fill: currentcolor;
400
+
401
+ :host(${interactivitySelector}:hover) .control,
402
+ :host(${interactivitySelector}:active) .control {
403
+ background: transparent;
404
+ border-color: ${SystemColors.ButtonText};
405
+ color: ${SystemColors.ButtonText};
381
406
  }
407
+
408
+ :host(${nonInteractivitySelector}) .control {
409
+ background: transparent;
410
+ color: ${SystemColors.GrayText};
411
+ }
412
+
413
+ .control:${focusVisible} {
414
+ outline-color: ${SystemColors.CanvasText};
415
+ }
416
+
382
417
  :host([href]) .control {
383
- border-color: ${SystemColors.ButtonFace};
384
418
  color: ${SystemColors.LinkText};
385
419
  }
386
- :host([href]) .control:hover,
387
- :host([href]) .control:${focusVisible} {
388
- background: ${SystemColors.LinkText};
420
+
421
+ :host([href]:hover) .control,
422
+ :host([href]:active) .control {
423
+ background: transparent;
389
424
  border-color: ${SystemColors.LinkText};
390
- box-shadow: none !important;
391
- color: ${SystemColors.HighlightText};
392
- fill: currentcolor;
425
+ color: ${SystemColors.LinkText};
393
426
  }
394
427
  `));