@fluentui/web-components 2.0.0 → 2.1.1

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 (47) hide show
  1. package/CHANGELOG.json +103 -1
  2. package/CHANGELOG.md +40 -2
  3. package/dist/dts/calendar/calendar.stories.d.ts +86 -0
  4. package/dist/dts/calendar/calendar.styles.d.ts +7 -0
  5. package/dist/dts/calendar/index.d.ts +18 -0
  6. package/dist/dts/custom-elements.d.ts +3 -1
  7. package/dist/dts/text-area/text-area.stories.d.ts +1 -1
  8. package/dist/esm/anchor/anchor.stories.js +2 -2
  9. package/dist/esm/breadcrumb-item/breadcrumb-item.styles.js +14 -0
  10. package/dist/esm/button/button.styles.js +31 -1
  11. package/dist/esm/calendar/calendar.stories.js +115 -0
  12. package/dist/esm/calendar/calendar.styles.js +133 -0
  13. package/dist/esm/calendar/index.js +31 -0
  14. package/dist/esm/card/card.styles.js +1 -2
  15. package/dist/esm/checkbox/checkbox.styles.js +17 -27
  16. package/dist/esm/custom-elements.js +3 -1
  17. package/dist/esm/divider/divider.styles.js +1 -2
  18. package/dist/esm/flipper/flipper.styles.js +5 -18
  19. package/dist/esm/listbox/listbox.styles.js +7 -28
  20. package/dist/esm/listbox-option/listbox-option.styles.js +10 -7
  21. package/dist/esm/menu/menu.styles.js +16 -3
  22. package/dist/esm/menu-item/menu-item.styles.js +17 -19
  23. package/dist/esm/number-field/number-field.styles.js +5 -0
  24. package/dist/esm/progress/progress/progress.styles.js +3 -10
  25. package/dist/esm/progress/progress-ring/progress-ring.styles.js +5 -8
  26. package/dist/esm/radio/radio.styles.js +14 -18
  27. package/dist/esm/radio-group/radio-group.styles.js +0 -2
  28. package/dist/esm/select/select.styles.js +52 -55
  29. package/dist/esm/skeleton/skeleton.styles.js +7 -2
  30. package/dist/esm/slider/slider.styles.js +6 -2
  31. package/dist/esm/styles/patterns/button.styles.js +61 -63
  32. package/dist/esm/styles/patterns/input.styles.js +13 -25
  33. package/dist/esm/switch/switch.stories.js +1 -2
  34. package/dist/esm/switch/switch.styles.js +21 -20
  35. package/dist/esm/tabs/tab/tab.styles.js +4 -3
  36. package/dist/esm/tabs/tabs.stories.js +56 -2
  37. package/dist/esm/tabs/tabs.styles.js +1 -1
  38. package/dist/esm/text-area/text-area.stories.js +2 -2
  39. package/dist/esm/tree-item/tree-item.styles.js +20 -11
  40. package/dist/esm/tree-view/tree-view.stories.js +39 -22
  41. package/dist/fluent-web-components.api.json +131 -2
  42. package/dist/web-components.d.ts +12 -0
  43. package/dist/web-components.js +973 -352
  44. package/dist/web-components.min.js +147 -135
  45. package/docs/api-report.md +12 -7
  46. package/package.json +2 -5
  47. package/public/switches.ts +14 -14
@@ -4,7 +4,7 @@ import { SystemColors } from '@microsoft/fast-web-utilities';
4
4
  import { elevationShadowFlyout } from '../styles/elevation';
5
5
  import { heightNumber } from '../styles/size';
6
6
  import { appearanceBehavior } from '../utilities/behaviors';
7
- import { bodyFont, controlCornerRadius, designUnit, disabledOpacity, fillColor, focusStrokeOuter, focusStrokeWidth, layerCornerRadius, neutralFillActive, neutralFillHover, neutralFillRest, neutralFillSecondaryActive, neutralFillSecondaryHover, neutralFillSecondaryRest, neutralFillStealthActive, neutralFillStealthHover, neutralFillStealthRest, neutralForegroundRest, neutralStrokeControlActive, neutralStrokeControlHover, neutralStrokeControlRest, strokeWidth, typeRampBaseFontSize, typeRampBaseLineHeight, } from '../design-tokens';
7
+ import { bodyFont, controlCornerRadius, designUnit, disabledOpacity, fillColor, focusStrokeOuter, layerCornerRadius, neutralFillActive, neutralFillHover, neutralFillRest, neutralFillSecondaryActive, neutralFillSecondaryHover, neutralFillSecondaryRest, neutralFillStealthActive, neutralFillStealthHover, neutralFillStealthRest, neutralForegroundRest, neutralStrokeControlActive, neutralStrokeControlHover, neutralStrokeControlRest, strokeWidth, typeRampBaseFontSize, typeRampBaseLineHeight, } from '../design-tokens';
8
8
  export const selectFilledStyles = (context, definition) => css `
9
9
  :host {
10
10
  background: ${neutralFillSecondaryRest};
@@ -20,7 +20,21 @@ export const selectFilledStyles = (context, definition) => css `
20
20
  background: ${neutralFillSecondaryActive};
21
21
  border-color: transparent;
22
22
  }
23
- `;
23
+ `.withBehaviors(forcedColorsStylesheetBehavior(css `
24
+ :host(:not([disabled]):not([open]):hover) {
25
+ background: transparent;
26
+ }
27
+ :host(:not([disabled]):not([open]):hover),
28
+ :host(:not([disabled]):not([open]):active) {
29
+ border-color: ${SystemColors.Highlight};
30
+ }
31
+ :host(:${focusVisible}) {
32
+ forced-color-adjust: none;
33
+ background: transparent;
34
+ border-color: ${SystemColors.Highlight};
35
+ box-shadow: 0 0 0 1px inset ${SystemColors.Highlight};
36
+ }
37
+ `));
24
38
  export const selectStealthStyles = (context, definition) => css `
25
39
  :host {
26
40
  background: ${neutralFillStealthRest};
@@ -63,12 +77,13 @@ export const selectStyles = (context, definition) => css `
63
77
  flex-direction: column;
64
78
  left: 0;
65
79
  max-height: calc(var(--max-height) - (${heightNumber} * 1px));
66
- padding: calc(${designUnit} * 1px) 0;
80
+ padding: calc((${designUnit} - ${strokeWidth} ) * 1px) 0;
67
81
  overflow-y: auto;
68
82
  position: absolute;
69
83
  width: 100%;
70
84
  z-index: 1;
71
85
  margin: 1px 0;
86
+ border: calc(${strokeWidth} * 1px) solid transparent;
72
87
  }
73
88
 
74
89
  :host .listbox[hidden] {
@@ -162,55 +177,37 @@ export const selectStyles = (context, definition) => css `
162
177
  flex: 0 0 auto;
163
178
  }
164
179
  `.withBehaviors(appearanceBehavior('filled', selectFilledStyles(context, definition)), appearanceBehavior('stealth', selectStealthStyles(context, definition)), forcedColorsStylesheetBehavior(css `
165
- :host([disabled]) {
166
- border-color: ${SystemColors.GrayText};
167
- background-color: ${SystemColors.ButtonFace};
168
- color: ${SystemColors.GrayText};
169
- opacity: 1;
170
- forced-color-adjust: none;
171
- }
172
-
173
- :host([disabled]:hover) {
174
- background: ${SystemColors.ButtonFace};
175
- }
176
-
177
- :host([disabled]) .control {
178
- color: ${SystemColors.GrayText};
179
- border-color: ${SystemColors.GrayText};
180
- }
181
-
182
- :host(:not([disabled]):hover) {
183
- background: ${SystemColors.ButtonFace};
184
- border-color: ${SystemColors.Highlight};
185
- }
186
-
187
- :host(:${focusVisible}) {
188
- forced-color-adjust: none;
189
- background: ${SystemColors.ButtonFace};
190
- border-color: ${SystemColors.Highlight};
191
- box-shadow: 0 0 0 1px inset ${SystemColors.Highlight};
192
- color: ${SystemColors.ButtonText};
193
- fill: currentcolor;
194
- }
195
-
196
- :host([open]) .listbox {
197
- background: ${SystemColors.ButtonFace};
198
- border: 1px solid ${SystemColors.ButtonText};
199
- }
200
-
201
- :host(:${focusVisible}) ::slotted([aria-selected="true"][role="option"]:not([disabled])) {
202
- background: ${SystemColors.Highlight};
203
- border-color: ${SystemColors.ButtonText};
204
- box-shadow: 0 0 0 calc(${focusStrokeWidth} * 1px) inset ${SystemColors.HighlightText};
205
- color: ${SystemColors.HighlightText};
206
- fill: currentcolor;
207
- }
208
-
209
- ::slotted([role='option']:not([aria-selected='true']):not([disabled]):hover) {
210
- forced-color-adjust: none;
211
- color: ${SystemColors.ButtonText};
212
- background: ${SystemColors.ButtonFace};
213
- border-color: ${SystemColors.Highlight};
214
- box-shadow: none;
215
- }
216
- `));
180
+ :host {
181
+ background: ${SystemColors.ButtonFace};
182
+ color: ${SystemColors.ButtonText};
183
+ }
184
+ :host(:not([disabled]):not([open]):hover) {
185
+ background: transparent;
186
+ }
187
+ :host(:not([disabled]):hover) {
188
+ border-color: ${SystemColors.Highlight};
189
+ }
190
+ :host(:${focusVisible}) {
191
+ forced-color-adjust: none;
192
+ border-color: ${SystemColors.Highlight};
193
+ box-shadow: 0 0 0 1px inset ${SystemColors.Highlight};
194
+ }
195
+ :host([open]) .listbox {
196
+ background: ${SystemColors.ButtonFace};
197
+ border-color: ${SystemColors.CanvasText};
198
+ }
199
+ .start, .end, .indicator, ::slotted(svg) {
200
+ fill: ${SystemColors.FieldText};
201
+ }
202
+ :host([disabled]) {
203
+ border-color: ${SystemColors.GrayText};
204
+ color: ${SystemColors.GrayText};
205
+ opacity: 1;
206
+ }
207
+ :host([disabled]) .start,
208
+ :host([disabled]) .end,
209
+ :host([disabled]) .indicator,
210
+ :host([disabled]) ::slotted(svg) {
211
+ fill: ${SystemColors.GrayText};
212
+ }
213
+ `));
@@ -1,5 +1,6 @@
1
1
  import { css } from '@microsoft/fast-element';
2
- import { display } from '@microsoft/fast-foundation';
2
+ import { display, forcedColorsStylesheetBehavior } from '@microsoft/fast-foundation';
3
+ import { SystemColors } from "@microsoft/fast-web-utilities";
3
4
  import { controlCornerRadius, neutralFillSecondaryHover, neutralFillSecondaryRest } from '../design-tokens';
4
5
  export const skeletonStyles = (context, definition) => css `
5
6
  ${display('block')} :host {
@@ -69,4 +70,8 @@ export const skeletonStyles = (context, definition) => css `
69
70
  transform: translateX(100%);
70
71
  }
71
72
  }
72
- `;
73
+ `.withBehaviors(forcedColorsStylesheetBehavior(css `
74
+ :host{
75
+ background-color: ${SystemColors.CanvasText};
76
+ }
77
+ `));
@@ -11,7 +11,6 @@ export const sliderStyles = (context, definition) => css `
11
11
  --track-width: ${designUnit};
12
12
  align-items: center;
13
13
  width: 100%;
14
- margin: calc(${designUnit} * 1px) 0;
15
14
  user-select: none;
16
15
  box-sizing: border-box;
17
16
  border-radius: calc(${controlCornerRadius} * 1px);
@@ -142,10 +141,15 @@ export const sliderStyles = (context, definition) => css `
142
141
  forced-color-adjust: none;
143
142
  background: ${SystemColors.FieldText};
144
143
  }
144
+ .thumb-cursor::after,
145
+ :host(:not(.disabled)) .thumb-cursor:hover::after,
146
+ :host(:not(.disabled)) .thumb-cursor:active::after {
147
+ background: ${SystemColors.Field};
148
+ }
145
149
  :host(:${focusVisible}) .thumb-cursor {
146
150
  background: ${SystemColors.Highlight};
147
151
  border-color: ${SystemColors.Highlight};
148
- box-shadow: 0 0 0 2px ${SystemColors.Field}, 0 0 0 4px ${SystemColors.FieldText};
152
+ box-shadow: 0 0 0 1px ${SystemColors.Field}, 0 0 0 3px ${SystemColors.FieldText};
149
153
  }
150
154
  :host(.disabled) {
151
155
  opacity: 1;
@@ -94,50 +94,44 @@ export const baseButtonStyles = (context, definition, interactivitySelector = ''
94
94
  margin-inline-start: 11px;
95
95
  }
96
96
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
97
- :host,
98
97
  :host .control {
99
- background-color: ${SystemColors.ButtonFace};
98
+ background: ${SystemColors.ButtonFace};
100
99
  border-color: ${SystemColors.ButtonText};
101
100
  color: ${SystemColors.ButtonText};
102
101
  fill: currentcolor;
103
102
  }
104
-
105
- :host .control${interactivitySelector}:hover {
103
+ :host(:not([disabled])) .control:hover,
104
+ :host .control${interactivitySelector}:hover,
105
+ .control${interactivitySelector}:hover {
106
106
  forced-color-adjust: none;
107
- background-color: ${SystemColors.Highlight};
107
+ background: ${SystemColors.Highlight};
108
108
  color: ${SystemColors.HighlightText};
109
109
  }
110
-
111
110
  .control:${focusVisible},
112
111
  :host .control:${focusVisible},
113
112
  :host(:${focusVisible}) .control {
114
113
  forced-color-adjust: none;
115
- background-color: ${SystemColors.Highlight};
116
- border-color: ${SystemColors.ButtonText};
117
- box-shadow: 0 0 0 calc((${focusStrokeWidth} - ${strokeWidth}) * 1px) ${SystemColors.ButtonText};
118
- color: ${SystemColors.HighlightText};
119
- }
120
-
121
- .control${interactivitySelector}:hover,
122
- :host .control:hover {
123
- border-color: ${SystemColors.ButtonText};
114
+ background: ${SystemColors.ButtonFace};
115
+ border-color: ${SystemColors.Highlight} !important;
116
+ box-shadow: 0 0 0 calc((${focusStrokeWidth} - ${strokeWidth}) * 1px) ${SystemColors.Highlight} !important;
124
117
  }
125
-
126
118
  :host([href]) .control {
119
+ background: ${SystemColors.ButtonFace};
127
120
  border-color: ${SystemColors.LinkText};
128
121
  color: ${SystemColors.LinkText};
122
+ fill: currentcolor;
129
123
  }
130
-
131
124
  :host([href]) .control:hover,
132
- :host(.neutral[href]) .control:hover,
133
- :host(.outline[href]) .control:hover,
125
+ :host(.neutral[href]) .control:hover {
126
+ background: ${SystemColors.LinkText};
127
+ border-color: ${SystemColors.LinkText} !important;
128
+ color: ${SystemColors.HighlightText};
129
+ fill: currentcolor;
130
+ }
134
131
  :host([href]) .control:${focusVisible}{
135
132
  forced-color-adjust: none;
136
- background: ${SystemColors.ButtonFace};
137
- border-color: ${SystemColors.LinkText};
138
- box-shadow: 0 0 0 1px ${SystemColors.LinkText} inset;
139
- color: ${SystemColors.LinkText};
140
- fill: currentcolor;
133
+ border-color: ${SystemColors.LinkText} !important;
134
+ box-shadow: 0 0 0 calc((${focusStrokeWidth} - ${strokeWidth}) * 1px) ${SystemColors.LinkText} !important;
141
135
  }
142
136
  `));
143
137
  /**
@@ -176,24 +170,21 @@ export const AccentButtonStyles = (context, definition, interactivitySelector =
176
170
  background: ${SystemColors.Highlight};
177
171
  color: ${SystemColors.HighlightText};
178
172
  }
179
-
180
173
  :host .control${interactivitySelector}:hover,
181
174
  :host .control${interactivitySelector}:active {
182
175
  background: ${SystemColors.HighlightText};
183
176
  border-color: ${SystemColors.Highlight};
184
177
  color: ${SystemColors.Highlight};
185
178
  }
186
-
187
179
  :host .control:${focusVisible} {
188
- border-color: ${SystemColors.ButtonText};
189
- box-shadow: 0 0 0 2px ${SystemColors.HighlightText} inset;
180
+ background: ${SystemColors.Highlight};
181
+ box-shadow: 0 0 0 calc((${focusStrokeWidth} - ${strokeWidth}) * 1px) ${SystemColors.Highlight} inset,
182
+ 0 0 0 calc(((${focusStrokeWidth} + ${strokeWidth}) - ${strokeWidth}) * 1px) ${SystemColors.HighlightText} inset !important;
190
183
  }
191
-
192
184
  :host([href]) .control {
193
185
  background: ${SystemColors.LinkText};
194
186
  color: ${SystemColors.HighlightText};
195
187
  }
196
-
197
188
  :host([href]) .control:hover {
198
189
  background: ${SystemColors.ButtonFace};
199
190
  border-color: ${SystemColors.LinkText};
@@ -201,10 +192,12 @@ export const AccentButtonStyles = (context, definition, interactivitySelector =
201
192
  color: ${SystemColors.LinkText};
202
193
  fill: currentcolor;
203
194
  }
204
-
205
195
  :host([href]) .control:${focusVisible} {
206
- border-color: ${SystemColors.LinkText};
207
- box-shadow: 0 0 0 2px ${SystemColors.HighlightText} inset;
196
+ background: ${SystemColors.LinkText};
197
+ box-shadow: 0 0 0 calc((${focusStrokeWidth} - ${strokeWidth}) * 1px) ${SystemColors.LinkText} inset,
198
+ 0 0 0 calc(((${focusStrokeWidth} + ${strokeWidth}) - ${strokeWidth}) * 1px) ${SystemColors.HighlightText} inset !important;
199
+ color: ${SystemColors.HighlightText};
200
+ fill: currentcolor;
208
201
  }
209
202
  `));
210
203
  /**
@@ -230,7 +223,7 @@ export const HypertextStyles = (context, definition, interactivitySelector = '',
230
223
  }
231
224
 
232
225
  :host .control:not([href]) {
233
- background-color: transparent;
226
+ background: transparent;
234
227
  }
235
228
 
236
229
  :host .control${interactivitySelector} {
@@ -258,9 +251,13 @@ export const HypertextStyles = (context, definition, interactivitySelector = '',
258
251
  background: transparent;
259
252
  }
260
253
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
261
- :host .control:${focusVisible} {
262
- color: ${SystemColors.LinkText};
263
- }
254
+ :host .control${interactivitySelector}:hover {
255
+ color: ${SystemColors.Highlight};
256
+ fill: currentcolor;
257
+ }
258
+ :host .control:${focusVisible} {
259
+ color: ${SystemColors.LinkText};
260
+ }
264
261
  `));
265
262
  /**
266
263
  * @internal
@@ -288,17 +285,22 @@ export const LightweightButtonStyles = (context, definition, interactivitySelect
288
285
  background: ${neutralFillStealthRest};
289
286
  }
290
287
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
291
- :host {
288
+ :host .control {
289
+ border-color: ${SystemColors.ButtonFace};
292
290
  color: ${SystemColors.ButtonText};
293
291
  }
294
292
  :host .control${interactivitySelector}:hover,
295
293
  :host .control${interactivitySelector}:active,
296
294
  :host .control:${focusVisible} {
297
- forced-color-adjust: none;
298
- background: ${SystemColors.ButtonFace};
299
- color: ${SystemColors.Highlight};
295
+ border-color: ${SystemColors.Highlight};
296
+ background: ${SystemColors.Highlight};
297
+ box-shadow: none;
298
+ color: ${SystemColors.HighlightText};
299
+ }
300
+ :host([href]) .control {
301
+ border-color: ${SystemColors.ButtonFace};
302
+ color: ${SystemColors.LinkText};
300
303
  }
301
-
302
304
  :host([href]) .control:hover,
303
305
  :host([href]) .control:${focusVisible} {
304
306
  background: ${SystemColors.ButtonFace};
@@ -328,12 +330,20 @@ export const OutlineButtonStyles = (context, definition, interactivitySelector =
328
330
  border-color: ${neutralStrokeRest};
329
331
  }
330
332
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
331
- :host {
333
+ :host .control${nonInteractivitySelector} {
332
334
  border-color: ${SystemColors.ButtonText};
333
335
  }
336
+ :host .control${interactivitySelector}:hover {
337
+ border-color: ${SystemColors.Highlight};
338
+ color: ${SystemColors.ButtonText};
339
+ }
334
340
  :host([href]) {
335
341
  border-color: ${SystemColors.LinkText};
336
342
  }
343
+ :host([href]) .control:hover {
344
+ box-shadow: 0 0 0 calc((${focusStrokeWidth} - ${strokeWidth}) * 1px) ${SystemColors.LinkText};
345
+ color: ${SystemColors.LinkText};
346
+ }
337
347
  `));
338
348
  /**
339
349
  * @internal
@@ -355,43 +365,31 @@ export const StealthButtonStyles = (context, definition, interactivitySelector =
355
365
  background: ${neutralFillStealthRest};
356
366
  }
357
367
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
358
- :host,
359
368
  :host .control {
360
- forced-color-adjust: none;
361
369
  background: ${SystemColors.ButtonFace};
362
- border-color: transparent;
370
+ border-color: ${SystemColors.ButtonFace};
363
371
  color: ${SystemColors.ButtonText};
364
372
  fill: currentcolor;
365
373
  }
366
-
367
374
  :host .control${interactivitySelector}:hover,
368
- :host .control${interactivitySelector}:active {
369
- background: ${SystemColors.Highlight};
370
- border-color: ${SystemColors.Highlight};
371
- color: ${SystemColors.HighlightText};
372
- fill: currentcolor;
373
- }
374
-
375
+ :host .control${interactivitySelector}:active,
375
376
  :host .control:${focusVisible} {
376
377
  background: ${SystemColors.Highlight};
377
- box-shadow: 0 0 0 1px ${SystemColors.Highlight};
378
+ border-color: ${SystemColors.Highlight};
379
+ box-shadow: none !important;
378
380
  color: ${SystemColors.HighlightText};
379
381
  fill: currentcolor;
380
382
  }
381
-
382
383
  :host([href]) .control {
384
+ border-color: ${SystemColors.ButtonFace};
383
385
  color: ${SystemColors.LinkText};
384
386
  }
385
-
386
- :host(:hover[href]) .control,
387
- :host(:${focusVisible}[href]) .control {
387
+ :host([href]) .control:hover,
388
+ :host([href]) .control:${focusVisible} {
388
389
  background: ${SystemColors.LinkText};
389
390
  border-color: ${SystemColors.LinkText};
391
+ box-shadow: none !important;
390
392
  color: ${SystemColors.HighlightText};
391
393
  fill: currentcolor;
392
394
  }
393
-
394
- :host(:${focusVisible}[href]) .control {
395
- box-shadow: 0 0 0 1px ${SystemColors.LinkText};
396
- }
397
395
  `));
@@ -133,7 +133,7 @@ export const inputStateStyles = (context, definition, rootSelector) => css `
133
133
  :host(:not([disabled]):focus-within:not(:active))::after {
134
134
  content: '';
135
135
  position: absolute;
136
- height: 100%;
136
+ height: calc(${focusStrokeWidth} * 1px);
137
137
  bottom: 0;
138
138
  border-bottom: calc(${focusStrokeWidth} * 1px) solid ${accentFillRest};
139
139
  border-bottom-left-radius: calc(${controlCornerRadius} * 1px);
@@ -173,49 +173,38 @@ export const inputFilledStyles = (context, definition, rootSelector) => css `
173
173
  * @internal
174
174
  */
175
175
  export const inputForcedColorStyles = (context, definition, rootSelector) => css `
176
- ${rootSelector} {
177
- forced-color-adjust: none;
178
- background: ${SystemColors.ButtonFace};
179
- border-color: ${SystemColors.ButtonText};
180
- }
181
- :host(:hover:not([disabled])) ${rootSelector} {
182
- background: ${SystemColors.ButtonFace};
183
- border-color: ${SystemColors.Highlight};
176
+ :host ${rootSelector} {
177
+ background: ${SystemColors.Field};
178
+ border-color: ${SystemColors.FieldText};
184
179
  }
185
- :host(:focus-within:not([disabled])) ${rootSelector} {
180
+ :host(:hover:not([disabled]):not(:focus-within)) ${rootSelector} {
186
181
  border-color: ${SystemColors.Highlight};
187
- box-shadow: 0 0 0 1px ${SystemColors.Highlight} inset;
188
182
  }
189
- .control,
190
- ::placeholder,
191
- ::-webkit-input-placeholder {
192
- color: ${SystemColors.FieldText};
183
+ :host(:not([disabled]):active)::after,
184
+ :host(:not([disabled]):focus-within:not(:active))::after {
185
+ border-bottom-color: ${SystemColors.Highlight};
193
186
  }
194
187
  :host([disabled]) {
195
188
  opacity: 1;
196
189
  }
197
190
  :host([disabled]) ${rootSelector} {
198
191
  border-color: ${SystemColors.GrayText};
199
- background: ${SystemColors.Field};
200
192
  }
201
193
  :host([disabled]) ::placeholder,
202
194
  :host([disabled]) ::-webkit-input-placeholder,
203
195
  :host([disabled]) .label {
204
196
  color: ${SystemColors.GrayText};
197
+ fill: currentcolor;
205
198
  }
206
199
  `;
207
200
  /**
208
201
  * @internal
209
202
  */
210
203
  export const inputFilledForcedColorStyles = (context, definition, rootSelector) => css `
211
- :host
212
- ${rootSelector},
213
- :host(:hover:not([disabled]))
214
- ${rootSelector},
215
- :host(:active:not([disabled]))
216
- ${rootSelector},
217
- :host(:focus-within:not([disabled]))
218
- ${rootSelector} {
204
+ :host ${rootSelector},
205
+ :host(:hover:not([disabled])) ${rootSelector},
206
+ :host(:active:not([disabled])) ${rootSelector},
207
+ :host(:focus-within:not([disabled])) ${rootSelector} {
219
208
  background: ${SystemColors.Field};
220
209
  border-color: ${SystemColors.FieldText};
221
210
  }
@@ -225,6 +214,5 @@ export const inputFilledForcedColorStyles = (context, definition, rootSelector)
225
214
  }
226
215
  :host([disabled]) ${rootSelector} {
227
216
  border-color: ${SystemColors.GrayText};
228
- background: ${SystemColors.Field};
229
217
  }
230
218
  `;
@@ -15,10 +15,9 @@ const SwitchTemplate = ({ checked, disabled, label }) => `
15
15
  <fluent-switch
16
16
  ${checked ? 'checked' : ''}
17
17
  ${disabled ? 'disabled' : ''}
18
- >
18
+ >${label}
19
19
  <span slot="checked-message">On</span>
20
20
  <span slot="unchecked-message">Off</span>
21
- <label for="direction-switch">Captions:</label>
22
21
  </fluent-switch>
23
22
  `;
24
23
  export const Switch = SwitchTemplate.bind({});
@@ -12,7 +12,6 @@ export const switchStyles = (context, definition) => css `
12
12
  align-items: center;
13
13
  outline: none;
14
14
  font-family: ${bodyFont};
15
- margin: calc(${designUnit} * 1px) 0;
16
15
  ${
17
16
  /*
18
17
  * Chromium likes to select label text or the default slot when
@@ -104,8 +103,9 @@ export const switchStyles = (context, definition) => css `
104
103
  cursor: pointer;
105
104
  }
106
105
 
107
- .status-message {
108
- margin-inline-start: calc(${designUnit} * 2px + 2px);
106
+ ::slotted([slot="checked-message"]),
107
+ ::slotted([slot="unchecked-message"]) {
108
+ margin-inline-start: calc(${designUnit} * 2px + 2px);
109
109
  }
110
110
 
111
111
  :host(.checked) .switch {
@@ -172,47 +172,48 @@ export const switchStyles = (context, definition) => css `
172
172
  transform: translateX(100%);
173
173
  }
174
174
  `), forcedColorsStylesheetBehavior(css `
175
- slot[name='switch'],
176
- :host(:not(.disabled)) .switch:active slot[name='switch'] {
175
+ :host(:not(.disabled)) .switch slot[name='switch'] {
177
176
  forced-color-adjust: none;
178
- background: ${SystemColors.FieldText};
177
+ fill: ${SystemColors.FieldText};
179
178
  }
180
179
  .switch {
181
- forced-color-adjust: none;
182
180
  background: ${SystemColors.Field};
183
181
  border-color: ${SystemColors.FieldText};
184
182
  }
185
- :host(:not(.disabled)) .switch:hover {
186
- background: ${SystemColors.HighlightText};
187
- border-color: ${SystemColors.Highlight};
188
- }
189
183
  :host(.checked) .switch {
190
184
  background: ${SystemColors.Highlight};
191
185
  border-color: ${SystemColors.Highlight};
192
186
  }
193
- :host(.checked:not(.disabled)) .switch:hover,
194
- :host(:not(.disabled)) .switch:active {
187
+ :host(:not(.disabled):hover) .switch ,
188
+ :host(:not(.disabled):active) .switch,
189
+ :host(.checked:not(.disabled):hover) .switch {
195
190
  background: ${SystemColors.HighlightText};
196
191
  border-color: ${SystemColors.Highlight};
197
192
  }
198
- :host(.checked) slot[name='switch'] {
199
- background: ${SystemColors.HighlightText};
193
+ :host(.checked:not(.disabled)) .switch slot[name="switch"] {
194
+ fill: ${SystemColors.HighlightText};
200
195
  }
201
- :host(.checked:not(.disabled)) .switch:hover slot[name='switch'] {
202
- background: ${SystemColors.Highlight};
196
+ :host(.checked:not(.disabled):hover) .switch slot[name='switch'] {
197
+ fill: ${SystemColors.Highlight};
203
198
  }
204
199
  :host(:${focusVisible}) .switch {
200
+ forced-color-adjust: none;
201
+ background: ${SystemColors.Field};
205
202
  border-color: ${SystemColors.Highlight};
206
- box-shadow: 0 0 0 2px ${SystemColors.Field}, 0 0 0 4px ${SystemColors.FieldText};
203
+ box-shadow: 0 0 0 1px ${SystemColors.Highlight}, 0 0 0 3px ${SystemColors.FieldText};
207
204
  }
208
205
  :host(.checked:${focusVisible}:not(.disabled)) .switch {
209
- box-shadow: 0 0 0 2px ${SystemColors.Field}, 0 0 0 4px ${SystemColors.FieldText};
206
+ forced-color-adjust: none;
207
+ background: ${SystemColors.Highlight};
208
+ box-shadow: 0 0 0 1px ${SystemColors.Field}, 0 0 0 3px ${SystemColors.FieldText};
209
+ border-color: ${SystemColors.Field};
210
210
  }
211
211
  :host(.disabled) {
212
212
  opacity: 1;
213
213
  }
214
214
  :host(.disabled) slot[name='switch'] {
215
- background: ${SystemColors.GrayText};
215
+ forced-color-adjust: none;
216
+ fill: ${SystemColors.GrayText};
216
217
  }
217
218
  :host(.disabled) .switch {
218
219
  background: ${SystemColors.Field};
@@ -62,16 +62,17 @@ export const tabStyles = (context, definition) => css `
62
62
  :host(:hover),
63
63
  :host(.vertical:hover),
64
64
  :host([aria-selected='true']:hover) {
65
- background: ${SystemColors.Highlight};
66
- color: ${SystemColors.HighlightText};
65
+ background: transparent;
66
+ color: ${SystemColors.Highlight};
67
67
  fill: currentcolor;
68
68
  }
69
69
  :host([aria-selected='true']) {
70
- background: ${SystemColors.HighlightText};
70
+ background: transparent;
71
71
  color: ${SystemColors.Highlight};
72
72
  fill: currentcolor;
73
73
  }
74
74
  :host(:${focusVisible}) {
75
+ background: transparent;
75
76
  border-color: ${SystemColors.ButtonText};
76
77
  box-shadow: none;
77
78
  }