@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
@@ -0,0 +1,31 @@
1
+ import { __decorate } from "tslib";
2
+ import { attr, booleanConverter } from '@microsoft/fast-element';
3
+ import { CalendarTitleTemplate, Calendar as FoundationCalendar, calendarTemplate as template, } from '@microsoft/fast-foundation';
4
+ import { calendarStyles as styles } from './calendar.styles';
5
+ /**
6
+ * Updated Calendar class that is readonly by default
7
+ */
8
+ export class Calendar extends FoundationCalendar {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.readonly = true;
12
+ }
13
+ }
14
+ __decorate([
15
+ attr({ converter: booleanConverter })
16
+ ], Calendar.prototype, "readonly", void 0);
17
+ /**
18
+ * The Fluent Calendar Element. Implements {@link @microsoft/fast-foundation#Calendar},
19
+ * {@link @microsoft/fast-foundation#calendarTemplate}
20
+ *
21
+ * @public
22
+ * @remarks
23
+ * HTML Element \<fluent-calendar\>
24
+ */
25
+ export const fluentCalendar = Calendar.compose({
26
+ baseName: 'calendar',
27
+ template,
28
+ styles,
29
+ title: CalendarTitleTemplate,
30
+ });
31
+ export { styles as calendarStyles };
@@ -22,8 +22,7 @@ export const cardStyles = (context, definition) => css `
22
22
  }
23
23
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
24
24
  :host {
25
- forced-color-adjust: none;
26
25
  background: ${SystemColors.Canvas};
27
- box-shadow: 0 0 0 1px ${SystemColors.CanvasText};
26
+ color: ${SystemColors.CanvasText};
28
27
  }
29
28
  `));
@@ -7,7 +7,6 @@ export const checkboxStyles = (context, definition) => css `
7
7
  ${display('inline-flex')} :host {
8
8
  align-items: center;
9
9
  outline: none;
10
- margin: calc(${designUnit} * 1px) 0;
11
10
  ${
12
11
  /*
13
12
  * Chromium likes to select label text or the default slot when
@@ -113,64 +112,55 @@ export const checkboxStyles = (context, definition) => css `
113
112
  }
114
113
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
115
114
  .control {
116
- forced-color-adjust: none;
117
115
  border-color: ${SystemColors.FieldText};
118
116
  background: ${SystemColors.Field};
119
117
  }
120
- :host(:not(.disabled)) .control:hover,
121
- .control:active {
118
+ :host(:not(.disabled):hover) .control,
119
+ :host(:not(.disabled):active) .control {
122
120
  border-color: ${SystemColors.Highlight};
123
121
  background: ${SystemColors.Field};
124
122
  }
125
- slot[name='checked-indicator'] {
126
- fill: ${SystemColors.FieldText};
127
- }
123
+ slot[name='checked-indicator'],
128
124
  slot[name='indeterminate-indicator'] {
129
125
  fill: ${SystemColors.FieldText};
130
126
  }
131
127
  :host(:${focusVisible}) .control {
128
+ forced-color-adjust: none;
129
+ box-shadow: 0 0 0 1px ${SystemColors.Field}, 0 0 0 3px ${SystemColors.FieldText};
130
+ background: ${SystemColors.Field};
132
131
  border-color: ${SystemColors.Highlight};
133
- box-shadow: 0 0 0 2px ${SystemColors.Field}, 0 0 0 4px ${SystemColors.FieldText};
134
- }
135
- :host(.checked:${focusVisible}:not(.disabled)) .control {
136
- box-shadow: 0 0 0 2px ${SystemColors.Field}, 0 0 0 4px ${SystemColors.FieldText};
137
132
  }
138
133
  :host(.checked) .control {
139
134
  background: ${SystemColors.Highlight};
140
135
  border-color: ${SystemColors.Highlight};
141
136
  }
142
- :host(.checked) .control:hover,
143
- .control:active {
137
+ :host(.checked:not(.disabled):hover) .control,
138
+ :host(.checked:not(.disabled):active) .control {
144
139
  background: ${SystemColors.HighlightText};
140
+ border-color: ${SystemColors.Highlight};
145
141
  }
146
- :host(.checked) slot[name='checked-indicator'] {
147
- fill: ${SystemColors.HighlightText};
148
- }
149
- :host(.checked) .control:hover slot[name='checked-indicator'] {
150
- fill: ${SystemColors.Highlight};
142
+ :host(.checked:${focusVisible}) .control {
143
+ box-shadow: 0 0 0 1px ${SystemColors.Field}, 0 0 0 3px ${SystemColors.FieldText};
151
144
  }
145
+ :host(.checked) slot[name='checked-indicator'],
152
146
  :host(.checked) slot[name='indeterminate-indicator'] {
153
147
  fill: ${SystemColors.HighlightText};
154
148
  }
155
- :host(.checked) .control:hover slot[name='indeterminate-indicator'] {
149
+ :host(.checked:hover ) .control slot[name='checked-indicator'],
150
+ :host(.checked:hover ) .control slot[name='indeterminate-indicator'] {
156
151
  fill: ${SystemColors.Highlight};
157
152
  }
158
153
  :host(.disabled) {
159
154
  opacity: 1;
160
155
  }
161
156
  :host(.disabled) .control {
162
- forced-color-adjust: none;
163
157
  border-color: ${SystemColors.GrayText};
164
158
  background: ${SystemColors.Field};
165
159
  }
166
- :host(.disabled) slot[name='indeterminate-indicator'],
167
- :host(.checked.disabled) .control:hover slot[name='indeterminate-indicator'] {
168
- forced-color-adjust: none;
169
- fill: ${SystemColors.GrayText};
170
- }
171
160
  :host(.disabled) slot[name='checked-indicator'],
172
- :host(.checked.disabled) .control:hover slot[name='checked-indicator'] {
173
- forced-color-adjust: none;
161
+ :host(.checked.disabled:hover) .control slot[name='checked-indicator'],
162
+ :host(.disabled) slot[name='indeterminate-indicator'],
163
+ :host(.checked.disabled:hover) .control slot[name='indeterminate-indicator'] {
174
164
  fill: ${SystemColors.GrayText};
175
165
  }
176
166
  `));
@@ -5,6 +5,7 @@ import { fluentBadge } from './badge/index';
5
5
  import { fluentBreadcrumb } from './breadcrumb/index';
6
6
  import { fluentBreadcrumbItem } from './breadcrumb-item/index';
7
7
  import { fluentButton } from './button/index';
8
+ import { fluentCalendar } from './calendar/index';
8
9
  import { fluentCard } from './card/index';
9
10
  import { fluentCheckbox } from './checkbox/index';
10
11
  import { fluentCombobox } from './combobox/index';
@@ -34,7 +35,7 @@ import { fluentToolbar } from './toolbar/index';
34
35
  import { fluentTooltip } from './tooltip/index';
35
36
  import { fluentTreeView } from './tree-view/index';
36
37
  import { fluentTreeItem } from './tree-item/index';
37
- export { fluentAccordion, fluentAccordionItem, fluentAnchor, fluentAnchoredRegion, fluentBadge, fluentBreadcrumb, fluentBreadcrumbItem, fluentButton, fluentCard, fluentCheckbox, fluentCombobox, fluentDataGrid, fluentDataGridCell, fluentDataGridRow, fluentDesignSystemProvider, fluentDialog, fluentDivider, fluentFlipper, fluentHorizontalScroll, fluentListbox, fluentOption, fluentMenu, fluentMenuItem, fluentNumberField, fluentProgress, fluentProgressRing, fluentRadio, fluentRadioGroup, fluentSelect, fluentSkeleton, fluentSlider, fluentSliderLabel, fluentSwitch, fluentTabs, fluentTab, fluentTabPanel, fluentTextArea, fluentTextField, fluentToolbar, fluentTooltip, fluentTreeView, fluentTreeItem, };
38
+ export { fluentAccordion, fluentAccordionItem, fluentAnchor, fluentAnchoredRegion, fluentBadge, fluentBreadcrumb, fluentBreadcrumbItem, fluentButton, fluentCard, fluentCalendar, fluentCheckbox, fluentCombobox, fluentDataGrid, fluentDataGridCell, fluentDataGridRow, fluentDesignSystemProvider, fluentDialog, fluentDivider, fluentFlipper, fluentHorizontalScroll, fluentListbox, fluentOption, fluentMenu, fluentMenuItem, fluentNumberField, fluentProgress, fluentProgressRing, fluentRadio, fluentRadioGroup, fluentSelect, fluentSkeleton, fluentSlider, fluentSliderLabel, fluentSwitch, fluentTabs, fluentTab, fluentTabPanel, fluentTextArea, fluentTextField, fluentToolbar, fluentTooltip, fluentTreeView, fluentTreeItem, };
38
39
  /**
39
40
  * All Fluent UI Web Components
40
41
  * @public
@@ -48,6 +49,7 @@ export const allComponents = {
48
49
  fluentBreadcrumb,
49
50
  fluentBreadcrumbItem,
50
51
  fluentButton,
52
+ fluentCalendar,
51
53
  fluentCard,
52
54
  fluentCheckbox,
53
55
  fluentCombobox,
@@ -1,11 +1,10 @@
1
1
  import { css } from '@microsoft/fast-element';
2
2
  import { display } from '@microsoft/fast-foundation';
3
- import { designUnit, neutralStrokeDividerRest, strokeWidth } from '../design-tokens';
3
+ import { neutralStrokeDividerRest, strokeWidth } from '../design-tokens';
4
4
  export const dividerStyles = (context, definition) => css `
5
5
  ${display('block')} :host {
6
6
  box-sizing: content-box;
7
7
  height: 0;
8
- margin: calc(${designUnit} * 1px) 0;
9
8
  border: none;
10
9
  border-top: calc(${strokeWidth} * 1px) solid ${neutralStrokeDividerRest};
11
10
  }
@@ -8,7 +8,6 @@ export const flipperStyles = (context, definition) => css `
8
8
  height: calc((${heightNumber} + ${designUnit}) * 1px);
9
9
  justify-content: center;
10
10
  align-items: center;
11
- margin: 0;
12
11
  fill: currentcolor;
13
12
  color: ${neutralFillStrongRest};
14
13
  background: padding-box linear-gradient(${neutralFillRest}, ${neutralFillRest}),
@@ -51,26 +50,19 @@ export const flipperStyles = (context, definition) => css `
51
50
  }
52
51
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
53
52
  :host {
54
- background: ${SystemColors.Canvas};
53
+ background: ${SystemColors.ButtonFace};
54
+ border-color: ${SystemColors.ButtonText};
55
55
  }
56
56
  :host .next,
57
57
  :host .previous {
58
58
  color: ${SystemColors.ButtonText};
59
59
  fill: currentcolor;
60
60
  }
61
- :host {
62
- background: ${SystemColors.Canvas};
63
- border-color: ${SystemColors.ButtonText};
64
- }
65
61
  :host(:not(.disabled):hover) {
66
- forced-color-adjust: none;
67
62
  background: ${SystemColors.Highlight};
68
- border-color: ${SystemColors.ButtonText};
69
- opacity: 1;
70
63
  }
71
64
  :host(:not(.disabled):hover) .next,
72
65
  :host(:not(.disabled):hover) .previous {
73
- forced-color-adjust: none;
74
66
  color: ${SystemColors.HighlightText};
75
67
  fill: currentcolor;
76
68
  }
@@ -78,20 +70,15 @@ export const flipperStyles = (context, definition) => css `
78
70
  opacity: 1;
79
71
  }
80
72
  :host(.disabled),
81
- :host(.disabled:hover),
82
73
  :host(.disabled) .next,
83
- :host(.disabled) .previous,
84
- :host(.disabled:hover) .next,
85
- :host(.disabled:hover) .previous {
86
- forced-color-adjust: none;
87
- background: ${SystemColors.Canvas};
74
+ :host(.disabled) .previous {
88
75
  border-color: ${SystemColors.GrayText};
89
76
  color: ${SystemColors.GrayText};
90
- fill: ${SystemColors.GrayText};
77
+ fill: currentcolor;
91
78
  }
92
79
  :host(:${focusVisible}) {
93
80
  forced-color-adjust: none;
94
81
  border-color: ${SystemColors.Highlight};
95
- box-shadow: 0 0 0 2px ${SystemColors.Field}, 0 0 0 4px ${SystemColors.FieldText};
82
+ box-shadow: 0 0 0 2px ${SystemColors.ButtonFace}, 0 0 0 4px ${SystemColors.ButtonText};
96
83
  }
97
84
  `));
@@ -1,7 +1,6 @@
1
1
  import { css } from '@microsoft/fast-element';
2
- import { display, focusVisible, forcedColorsStylesheetBehavior, } from '@microsoft/fast-foundation';
3
- import { SystemColors } from '@microsoft/fast-web-utilities';
4
- import { controlCornerRadius, designUnit, focusStrokeOuter, focusStrokeWidth, neutralStrokeRest, strokeWidth, } from '../design-tokens';
2
+ import { display, ListboxOption } from '@microsoft/fast-foundation';
3
+ import { controlCornerRadius, designUnit, focusStrokeOuter, neutralStrokeRest, strokeWidth, } from '../design-tokens';
5
4
  export const listboxStyles = (context, definition) => css `
6
5
  ${display('inline-flex')} :host {
7
6
  border: calc(${strokeWidth} * 1px) solid ${neutralStrokeRest};
@@ -12,32 +11,12 @@ export const listboxStyles = (context, definition) => css `
12
11
  outline: none;
13
12
  }
14
13
 
14
+ ::slotted(${context.tagFor(ListboxOption)}) {
15
+ margin: 0 calc(${designUnit} * 1px);
16
+ }
17
+
15
18
  :host(:focus-within:not([disabled])) {
16
19
  border-color: ${focusStrokeOuter};
17
20
  box-shadow: 0 0 0 1px ${focusStrokeOuter} inset;
18
21
  }
19
- `.withBehaviors(forcedColorsStylesheetBehavior(css `
20
- :host(:${focusVisible}) ::slotted([aria-selected="true"][role="option"]) {
21
- background: ${SystemColors.Highlight};
22
- border-color: ${SystemColors.ButtonText};
23
- box-shadow: 0 0 0 calc(${focusStrokeWidth} * 1px) inset ${SystemColors.HighlightText};
24
- color: ${SystemColors.HighlightText};
25
- fill: currentcolor;
26
- }
27
-
28
- :host(:${focusVisible}) ::slotted([aria-selected="true"][role="option"]) {
29
- background: ${SystemColors.Highlight};
30
- border-color: ${SystemColors.ButtonText};
31
- box-shadow: 0 0 0 calc(${focusStrokeWidth} * 1px) inset ${SystemColors.HighlightText};
32
- color: ${SystemColors.HighlightText};
33
- fill: currentcolor;
34
- }
35
-
36
- ::slotted([role='option']:not([aria-selected='true']):not([disabled]):hover) {
37
- forced-color-adjust: none;
38
- color: ${SystemColors.ButtonText};
39
- background: ${SystemColors.ButtonFace};
40
- border-color: ${SystemColors.Highlight};
41
- box-shadow: none;
42
- }
43
- `));
22
+ `;
@@ -17,7 +17,6 @@ export const optionStyles = (context, definition) => css `
17
17
  font-size: ${typeRampBaseFontSize};
18
18
  height: calc(${heightNumber} * 1px);
19
19
  line-height: ${typeRampBaseLineHeight};
20
- margin: 0 calc(${designUnit} * 1px);
21
20
  outline: none;
22
21
  overflow: hidden;
23
22
  align-items: center;
@@ -107,17 +106,21 @@ export const optionStyles = (context, definition) => css `
107
106
  }
108
107
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
109
108
  :host {
110
- border-color: transparent;
109
+ background: ${SystemColors.ButtonFace};
110
+ border-color: ${SystemColors.ButtonFace};
111
111
  color: ${SystemColors.ButtonText};
112
- forced-color-adjust: none;
113
112
  }
114
-
115
- :host(:not([aria-selected='true']):hover),
116
- :host([aria-selected='true']) {
113
+ :host(:not([disabled]):not([aria-selected="true"]):hover),
114
+ :host(:not([disabled])[aria-selected="true"]:hover),
115
+ :host([aria-selected="true"]) {
116
+ forced-color-adjust: none;
117
117
  background: ${SystemColors.Highlight};
118
118
  color: ${SystemColors.HighlightText};
119
119
  }
120
-
120
+ :host(:not([disabled]):active)::before,
121
+ :host([aria-selected='true'])::before {
122
+ background: ${SystemColors.HighlightText};
123
+ }
121
124
  :host([disabled]),
122
125
  :host([disabled]:not([aria-selected='true']):hover) {
123
126
  background: ${SystemColors.Canvas};
@@ -1,5 +1,6 @@
1
1
  import { css } from '@microsoft/fast-element';
2
- import { display } from '@microsoft/fast-foundation';
2
+ import { display, Divider, forcedColorsStylesheetBehavior, MenuItem } from '@microsoft/fast-foundation';
3
+ import { SystemColors } from "@microsoft/fast-web-utilities";
3
4
  import { elevationShadowFlyout } from '../styles/index';
4
5
  import { designUnit, layerCornerRadius, neutralLayerFloating, neutralStrokeDividerRest, strokeWidth, } from '../design-tokens';
5
6
  export const menuStyles = (context, definition) => css `
@@ -8,7 +9,6 @@ export const menuStyles = (context, definition) => css `
8
9
  border: calc(${strokeWidth} * 1px) solid transparent;
9
10
  border-radius: calc(${layerCornerRadius} * 1px);
10
11
  box-shadow: ${elevationShadowFlyout};
11
- margin: 0;
12
12
  padding: calc(${designUnit} * 1px) 0;
13
13
  max-width: 368px;
14
14
  min-width: 64px;
@@ -19,6 +19,14 @@ export const menuStyles = (context, definition) => css `
19
19
  margin: 0 calc(${designUnit} * 2px);
20
20
  }
21
21
 
22
+ ::slotted(${context.tagFor(MenuItem)}) {
23
+ margin: 0 calc(${designUnit} * 1px);
24
+ }
25
+
26
+ ::slotted(${context.tagFor(Divider)}) {
27
+ margin: calc(${designUnit} * 1px) 0;
28
+ }
29
+
22
30
  ::slotted(hr) {
23
31
  box-sizing: content-box;
24
32
  height: 0;
@@ -26,4 +34,9 @@ export const menuStyles = (context, definition) => css `
26
34
  border: none;
27
35
  border-top: calc(${strokeWidth} * 1px) solid ${neutralStrokeDividerRest};
28
36
  }
29
- `;
37
+ `.withBehaviors(forcedColorsStylesheetBehavior(css `
38
+ :host([slot='submenu']) {
39
+ background: ${SystemColors.Canvas};
40
+ border-color: ${SystemColors.CanvasText};
41
+ }
42
+ `));
@@ -2,7 +2,7 @@ import { css } from '@microsoft/fast-element';
2
2
  import { disabledCursor, display, focusVisible, forcedColorsStylesheetBehavior, } from '@microsoft/fast-foundation';
3
3
  import { SystemColors } from '@microsoft/fast-web-utilities';
4
4
  import { DirectionalStyleSheetBehavior, heightNumber } from '../styles/index';
5
- import { bodyFont, controlCornerRadius, designUnit, disabledOpacity, focusStrokeOuter, focusStrokeWidth, neutralFillStealthActive, neutralFillStealthHover, neutralForegroundHint, neutralForegroundRest, strokeWidth, typeRampBaseFontSize, typeRampBaseLineHeight, } from '../design-tokens';
5
+ import { bodyFont, controlCornerRadius, disabledOpacity, focusStrokeOuter, focusStrokeWidth, neutralFillStealthActive, neutralFillStealthHover, neutralForegroundHint, neutralForegroundRest, strokeWidth, typeRampBaseFontSize, typeRampBaseLineHeight, } from '../design-tokens';
6
6
  export const menuItemStyles = (context, definition) => css `
7
7
  ${display('grid')} :host {
8
8
  contain: layout;
@@ -16,7 +16,6 @@ export const menuItemStyles = (context, definition) => css `
16
16
  justify-items: center;
17
17
  align-items: center;
18
18
  padding: 0;
19
- margin: 0 calc(${designUnit} * 1px);
20
19
  white-space: nowrap;
21
20
  color: ${neutralForegroundRest};
22
21
  fill: currentcolor;
@@ -175,31 +174,33 @@ export const menuItemStyles = (context, definition) => css `
175
174
  display: flex;
176
175
  }
177
176
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
178
- :host {
177
+ :host,
178
+ ::slotted([slot='end']:not(svg)) {
179
179
  forced-color-adjust: none;
180
- border-color: transparent;
181
180
  color: ${SystemColors.ButtonText};
182
- fill: ${SystemColors.ButtonText};
181
+ fill: currentcolor;
183
182
  }
184
- :host(:hover) {
183
+ :host(:not([disabled]):hover) {
185
184
  background: ${SystemColors.Highlight};
186
185
  color: ${SystemColors.HighlightText};
186
+ fill: currentcolor;
187
187
  }
188
188
  :host(:hover) .start,
189
189
  :host(:hover) .end,
190
190
  :host(:hover)::slotted(svg),
191
191
  :host(:active) .start,
192
192
  :host(:active) .end,
193
- :host(:active)::slotted(svg) {
194
- fill: ${SystemColors.HighlightText};
193
+ :host(:active)::slotted(svg),
194
+ :host(:hover) ::slotted([slot='end']:not(svg)),
195
+ :host(:${focusVisible}) ::slotted([slot='end']:not(svg)) {
196
+ color: ${SystemColors.HighlightText};
197
+ fill: currentcolor;
195
198
  }
196
-
197
199
  :host(.expanded) {
198
200
  background: ${SystemColors.Highlight};
199
201
  border-color: ${SystemColors.Highlight};
200
202
  color: ${SystemColors.HighlightText};
201
203
  }
202
-
203
204
  :host(:${focusVisible}) {
204
205
  background: ${SystemColors.Highlight};
205
206
  border-color: ${SystemColors.ButtonText};
@@ -207,31 +208,31 @@ export const menuItemStyles = (context, definition) => css `
207
208
  color: ${SystemColors.HighlightText};
208
209
  fill: currentcolor;
209
210
  }
210
-
211
211
  :host([disabled]),
212
212
  :host([disabled]:hover),
213
213
  :host([disabled]:hover) .start,
214
214
  :host([disabled]:hover) .end,
215
- :host([disabled]:hover)::slotted(svg) {
216
- background: ${SystemColors.Canvas};
215
+ :host([disabled]:hover)::slotted(svg),
216
+ :host([disabled]:${focusVisible}) {
217
+ background: ${SystemColors.ButtonFace};
217
218
  color: ${SystemColors.GrayText};
218
219
  fill: currentcolor;
219
220
  opacity: 1;
220
221
  }
221
-
222
+ :host([disabled]:${focusVisible}) {
223
+ border-color: ${SystemColors.GrayText};
224
+ }
222
225
  :host .expanded-toggle,
223
226
  :host .checkbox,
224
227
  :host .radio {
225
228
  border-color: ${SystemColors.ButtonText};
226
229
  background: ${SystemColors.HighlightText};
227
230
  }
228
-
229
231
  :host([checked]) .checkbox,
230
232
  :host([checked]) .radio {
231
233
  background: ${SystemColors.HighlightText};
232
234
  border-color: ${SystemColors.HighlightText};
233
235
  }
234
-
235
236
  :host(:hover) .expanded-toggle,
236
237
  :host(:hover) .checkbox,
237
238
  :host(:hover) .radio,
@@ -244,18 +245,15 @@ export const menuItemStyles = (context, definition) => css `
244
245
  :host([checked]:${focusVisible}) .radio {
245
246
  border-color: ${SystemColors.HighlightText};
246
247
  }
247
-
248
248
  :host([aria-checked='true']) {
249
249
  background: ${SystemColors.Highlight};
250
250
  color: ${SystemColors.HighlightText};
251
251
  }
252
-
253
252
  :host([aria-checked='true']) .checkbox-indicator,
254
253
  :host([aria-checked='true']) ::slotted([slot='checkbox-indicator']),
255
254
  :host([aria-checked='true']) ::slotted([slot='radio-indicator']) {
256
255
  fill: ${SystemColors.Highlight};
257
256
  }
258
-
259
257
  :host([aria-checked='true']) .radio-indicator {
260
258
  background: ${SystemColors.Highlight};
261
259
  }
@@ -1,5 +1,6 @@
1
1
  import { css } from '@microsoft/fast-element';
2
2
  import { display, forcedColorsStylesheetBehavior, } from '@microsoft/fast-foundation';
3
+ import { SystemColors } from "@microsoft/fast-web-utilities";
3
4
  import { inputFilledForcedColorStyles, inputFilledStyles, inputForcedColorStyles, inputStateStyles, inputStyles, } from '../styles/index';
4
5
  import { appearanceBehavior } from '../utilities/behaviors';
5
6
  import { designUnit } from '../design-tokens';
@@ -74,4 +75,8 @@ export const numberFieldStyles = (context, definition) => css `
74
75
  }
75
76
  `.withBehaviors(appearanceBehavior('filled', numberFieldFilledStyles(context, definition)), forcedColorsStylesheetBehavior(css `
76
77
  ${inputForcedColorStyles(context, definition, '.root')}
78
+ .step-up,
79
+ .step-down {
80
+ fill: ${SystemColors.FieldText};
81
+ }
77
82
  `));
@@ -7,7 +7,6 @@ export const progressStyles = (context, definition) => css `
7
7
  align-items: center;
8
8
  outline: none;
9
9
  height: calc((${strokeWidth} * 3) * 1px);
10
- margin: calc(${designUnit} * 1px) 0;
11
10
  }
12
11
 
13
12
  .progress {
@@ -109,18 +108,12 @@ export const progressStyles = (context, definition) => css `
109
108
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
110
109
  .indeterminate-indicator-1,
111
110
  .indeterminate-indicator-2,
112
- .determinate {
113
- forced-color-adjust: none;
114
- background-color: ${SystemColors.FieldText};
115
- }
111
+ .determinate,
116
112
  .progress {
117
- background-color: ${SystemColors.Field};
118
- border: calc(${strokeWidth} * 1px) solid ${SystemColors.FieldText};
113
+ background-color: ${SystemColors.ButtonText};
119
114
  }
120
115
  :host(.paused) .indeterminate-indicator-1,
121
- .indeterminate-indicator-2 {
122
- background-color: ${SystemColors.Field};
123
- }
116
+ :host(.paused) .indeterminate-indicator-2,
124
117
  :host(.paused) .determinate {
125
118
  background-color: ${SystemColors.GrayText};
126
119
  }
@@ -9,7 +9,6 @@ export const progressRingStyles = (context, definition) => css `
9
9
  outline: none;
10
10
  height: calc(${heightNumber} * 1px);
11
11
  width: calc(${heightNumber} * 1px);
12
- margin: calc(${heightNumber} * 1px) 0;
13
12
  }
14
13
 
15
14
  .progress {
@@ -67,17 +66,15 @@ export const progressRingStyles = (context, definition) => css `
67
66
  }
68
67
  }
69
68
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
70
- .indeterminate-indicator-1,
71
- .determinate {
72
- stroke: ${SystemColors.FieldText};
73
- }
74
69
  .background {
75
70
  stroke: ${SystemColors.Field};
76
71
  }
77
- :host(.paused) .indeterminate-indicator-1 {
78
- stroke: ${SystemColors.Field};
72
+ .determinate,
73
+ .indeterminate-indicator-1 {
74
+ stroke: ${SystemColors.ButtonText};
79
75
  }
80
- :host(.paused) .determinate {
76
+ :host(.paused) .determinate,
77
+ :host(.paused) .indeterminate-indicator-1 {
81
78
  stroke: ${SystemColors.GrayText};
82
79
  }
83
80
  `));
@@ -8,7 +8,6 @@ export const radioStyles = (context, definition) => css `
8
8
  --input-size: calc((${heightNumber} / 2) + ${designUnit});
9
9
  align-items: center;
10
10
  outline: none;
11
- margin: calc(${designUnit} * 1px) 0;
12
11
  ${
13
12
  /*
14
13
  * Chromium likes to select label text or the default slot when
@@ -114,49 +113,46 @@ export const radioStyles = (context, definition) => css `
114
113
  }
115
114
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
116
115
  .control {
117
- forced-color-adjust: none;
118
- border-color: ${SystemColors.FieldText};
119
116
  background: ${SystemColors.Field};
117
+ border-color: ${SystemColors.FieldText};
120
118
  }
121
- :host(:not(.disabled)) .control:hover,
122
- .control:active {
119
+ :host(:not(.disabled):hover) .control,
120
+ :host(:not(.disabled):active) .control {
123
121
  border-color: ${SystemColors.Highlight};
124
- background: ${SystemColors.Field};
125
122
  }
126
123
  :host(:${focusVisible}) .control {
124
+ forced-color-adjust: none;
125
+ box-shadow: 0 0 0 1px ${SystemColors.Field}, 0 0 0 3px ${SystemColors.FieldText};
126
+ background: ${SystemColors.Field};
127
127
  border-color: ${SystemColors.Highlight};
128
- box-shadow: 0 0 0 2px ${SystemColors.Field}, 0 0 0 4px ${SystemColors.FieldText};
129
- }
130
- :host(.checked:${focusVisible}:not(.disabled)) .control {
131
- border-color: ${SystemColors.Highlight};
132
- box-shadow: 0 0 0 2px ${SystemColors.Field}, 0 0 0 4px ${SystemColors.FieldText};
133
128
  }
134
- :host(.checked:not(.disabled)) .control:hover,
135
- .control:active {
129
+ :host(.checked:not(.disabled):hover) .control,
130
+ :host(.checked:not(.disabled):active) .control {
136
131
  border-color: ${SystemColors.Highlight};
137
132
  background: ${SystemColors.Highlight};
138
133
  }
134
+ :host(.checked:${focusVisible}) .control {
135
+ box-shadow: 0 0 0 1px ${SystemColors.Field}, 0 0 0 3px ${SystemColors.FieldText};
136
+ }
139
137
  :host(.checked) slot[name='checked-indicator'] {
140
138
  fill: ${SystemColors.Highlight};
141
139
  }
142
- :host(.checked) .control:hover slot[name='checked-indicator'] {
140
+ :host(.checked:hover) .control slot[name='checked-indicator'] {
143
141
  fill: ${SystemColors.HighlightText};
144
142
  }
145
143
  :host(.disabled) {
146
- forced-color-adjust: none;
147
144
  opacity: 1;
148
145
  }
149
146
  :host(.disabled) .label {
150
147
  color: ${SystemColors.GrayText};
151
148
  }
152
149
  :host(.disabled) .control,
153
- :host(.checked.disabled) .control:hover,
154
- .control:active {
150
+ :host(.checked.disabled) .control {
155
151
  background: ${SystemColors.Field};
156
152
  border-color: ${SystemColors.GrayText};
157
153
  }
158
154
  :host(.disabled) slot[name='checked-indicator'],
159
- :host(.checked.disabled) .control:hover slot[name='checked-indicator'] {
155
+ :host(.checked.disabled) slot[name='checked-indicator'] {
160
156
  fill: ${SystemColors.GrayText};
161
157
  }
162
158
  `));
@@ -1,10 +1,8 @@
1
1
  import { css } from '@microsoft/fast-element';
2
2
  import { display } from '@microsoft/fast-foundation';
3
- import { designUnit } from '../design-tokens';
4
3
  export const radioGroupStyles = (context, definition) => css `
5
4
  ${display('flex')} :host {
6
5
  align-items: flex-start;
7
- margin: calc(${designUnit} * 1px) 0;
8
6
  flex-direction: column;
9
7
  }
10
8