@fluentui/web-components 1.6.3 → 2.1.0

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 (170) 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/color/palette.d.ts +43 -1
  7. package/dist/dts/color/recipes/contrast-and-delta-swatch-set.d.ts +11 -0
  8. package/dist/dts/color/recipes/contrast-swatch.d.ts +12 -0
  9. package/dist/dts/color/recipes/delta-swatch-set.d.ts +36 -0
  10. package/dist/dts/color/recipes/{neutral-divider.d.ts → delta-swatch.d.ts} +3 -2
  11. package/dist/dts/color/recipes/focus-stroke.d.ts +2 -2
  12. package/dist/dts/color/recipes/foreground-on-accent.d.ts +6 -0
  13. package/dist/dts/color/recipes/gradient-shadow-stroke.d.ts +7 -0
  14. package/dist/dts/color/recipes/gradient-swatch.d.ts +36 -0
  15. package/dist/dts/color/recipes/neutral-layer-1.d.ts +4 -0
  16. package/dist/dts/color/recipes/neutral-layer-2.d.ts +1 -5
  17. package/dist/dts/color/recipes/neutral-layer-3.d.ts +1 -1
  18. package/dist/dts/color/recipes/neutral-layer-4.d.ts +1 -1
  19. package/dist/dts/color/recipes/neutral-layer-floating.d.ts +1 -1
  20. package/dist/dts/color/recipes/underline-stroke.d.ts +7 -0
  21. package/dist/dts/color/swatch.d.ts +7 -0
  22. package/dist/dts/color/utilities/base-layer-luminance.d.ts +2 -2
  23. package/dist/dts/combobox/index.d.ts +1 -2
  24. package/dist/dts/custom-elements.d.ts +4 -2
  25. package/dist/dts/data-grid/data-grid-row.styles.d.ts +1 -1
  26. package/dist/dts/data-grid/index.d.ts +1 -1
  27. package/dist/dts/design-system-provider/index.d.ts +14 -29
  28. package/dist/dts/design-tokens.d.ts +198 -82
  29. package/dist/dts/menu/index.d.ts +11 -6
  30. package/dist/dts/menu/menu.stories.d.ts +1 -1
  31. package/dist/dts/select/index.d.ts +1 -1
  32. package/dist/dts/select/select.stories.d.ts +8 -0
  33. package/dist/dts/select/select.styles.d.ts +1 -0
  34. package/dist/dts/skeleton/skeleton.stories.d.ts +1 -0
  35. package/dist/dts/styles/elevation.d.ts +44 -5
  36. package/dist/dts/styles/patterns/button.styles.d.ts +7 -6
  37. package/dist/dts/styles/patterns/index.d.ts +1 -1
  38. package/dist/dts/styles/patterns/input.styles.d.ts +22 -0
  39. package/dist/dts/text-area/text-area.stories.d.ts +1 -1
  40. package/dist/dts/tree-view/tree-view.stories.d.ts +0 -5
  41. package/dist/esm/accordion/accordion-item/accordion-item.styles.js +54 -17
  42. package/dist/esm/accordion/accordion-item/index.js +4 -22
  43. package/dist/esm/accordion/accordion.styles.js +4 -4
  44. package/dist/esm/anchor/anchor.stories.js +2 -2
  45. package/dist/esm/anchor/anchor.styles.js +8 -2
  46. package/dist/esm/badge/badge.styles.js +10 -2
  47. package/dist/esm/breadcrumb-item/breadcrumb-item.styles.js +44 -53
  48. package/dist/esm/breadcrumb-item/index.js +2 -4
  49. package/dist/esm/button/button.stories.js +1 -1
  50. package/dist/esm/button/button.styles.js +21 -71
  51. package/dist/esm/calendar/calendar.stories.js +115 -0
  52. package/dist/esm/calendar/calendar.styles.js +133 -0
  53. package/dist/esm/calendar/index.js +31 -0
  54. package/dist/esm/card/card.stories.js +14 -0
  55. package/dist/esm/card/card.styles.js +23 -32
  56. package/dist/esm/card/index.js +1 -1
  57. package/dist/esm/checkbox/checkbox.styles.js +58 -51
  58. package/dist/esm/checkbox/index.js +5 -13
  59. package/dist/esm/color/palette.js +174 -12
  60. package/dist/esm/color/recipes/contrast-and-delta-swatch-set.js +28 -0
  61. package/dist/esm/color/recipes/contrast-swatch.js +12 -0
  62. package/dist/esm/color/recipes/delta-swatch-set.js +53 -0
  63. package/dist/esm/color/recipes/{neutral-divider.js → delta-swatch.js} +3 -2
  64. package/dist/esm/color/recipes/focus-stroke.js +4 -3
  65. package/dist/esm/color/recipes/foreground-on-accent.js +14 -0
  66. package/dist/esm/color/recipes/gradient-shadow-stroke.js +54 -0
  67. package/dist/esm/color/recipes/gradient-swatch.js +36 -0
  68. package/dist/esm/color/recipes/neutral-layer-1.js +7 -1
  69. package/dist/esm/color/recipes/neutral-layer-2.js +3 -9
  70. package/dist/esm/color/recipes/neutral-layer-3.js +3 -3
  71. package/dist/esm/color/recipes/neutral-layer-4.js +3 -3
  72. package/dist/esm/color/recipes/neutral-layer-floating.js +3 -4
  73. package/dist/esm/color/recipes/underline-stroke.js +31 -0
  74. package/dist/esm/color/swatch.js +22 -2
  75. package/dist/esm/color/utilities/base-layer-luminance.js +2 -2
  76. package/dist/esm/combobox/combobox.stories.js +1 -0
  77. package/dist/esm/combobox/index.js +6 -9
  78. package/dist/esm/custom-elements.js +3 -1
  79. package/dist/esm/data-grid/data-grid-cell.styles.js +4 -4
  80. package/dist/esm/data-grid/data-grid-row.styles.js +3 -3
  81. package/dist/esm/design-system-provider/design-system-provider.vscode.definition.json +17 -9
  82. package/dist/esm/design-system-provider/index.js +24 -39
  83. package/dist/esm/design-tokens.js +303 -217
  84. package/dist/esm/dialog/dialog.styles.js +2 -3
  85. package/dist/esm/divider/divider.styles.js +1 -2
  86. package/dist/esm/flipper/flipper.styles.js +28 -65
  87. package/dist/esm/flipper/index.js +4 -8
  88. package/dist/esm/listbox/listbox.styles.js +8 -29
  89. package/dist/esm/listbox-option/listbox-option.styles.js +52 -35
  90. package/dist/esm/menu/index.js +16 -6
  91. package/dist/esm/menu/menu.stories.js +16 -2
  92. package/dist/esm/menu/menu.styles.js +38 -27
  93. package/dist/esm/menu-item/index.js +6 -33
  94. package/dist/esm/menu-item/menu-item.stories.js +1 -1
  95. package/dist/esm/menu-item/menu-item.styles.js +58 -84
  96. package/dist/esm/number-field/index.js +7 -3
  97. package/dist/esm/number-field/number-field.styles.js +30 -175
  98. package/dist/esm/progress/progress/index.js +1 -1
  99. package/dist/esm/progress/progress/progress.styles.js +13 -18
  100. package/dist/esm/progress/progress-ring/progress-ring.styles.js +65 -69
  101. package/dist/esm/radio/index.js +3 -1
  102. package/dist/esm/radio/radio.stories.js +3 -2
  103. package/dist/esm/radio/radio.styles.js +52 -42
  104. package/dist/esm/radio-group/radio-group.styles.js +0 -2
  105. package/dist/esm/select/index.js +6 -9
  106. package/dist/esm/select/select.stories.js +10 -2
  107. package/dist/esm/select/select.styles.js +100 -124
  108. package/dist/esm/select/select.vscode.definition.json +3 -0
  109. package/dist/esm/skeleton/skeleton.stories.js +3 -2
  110. package/dist/esm/skeleton/skeleton.styles.js +11 -6
  111. package/dist/esm/slider/slider.styles.js +54 -14
  112. package/dist/esm/slider-label/slider-label.styles.js +5 -6
  113. package/dist/esm/styles/direction.js +1 -1
  114. package/dist/esm/styles/elevation.js +54 -5
  115. package/dist/esm/styles/patterns/button.styles.js +274 -294
  116. package/dist/esm/styles/patterns/index.js +1 -1
  117. package/dist/esm/styles/patterns/input.styles.js +218 -0
  118. package/dist/esm/switch/index.js +3 -1
  119. package/dist/esm/switch/switch.stories.js +3 -3
  120. package/dist/esm/switch/switch.styles.js +79 -60
  121. package/dist/esm/tabs/tab/tab.styles.js +11 -14
  122. package/dist/esm/tabs/tabs.styles.js +9 -8
  123. package/dist/esm/text-area/text-area.stories.js +2 -2
  124. package/dist/esm/text-area/text-area.styles.js +16 -96
  125. package/dist/esm/text-field/text-field.stories.js +1 -1
  126. package/dist/esm/text-field/text-field.styles.js +16 -144
  127. package/dist/esm/toolbar/index.js +1 -0
  128. package/dist/esm/toolbar/toolbar.styles.js +56 -56
  129. package/dist/esm/tooltip/index.js +2 -4
  130. package/dist/esm/tooltip/tooltip.styles.js +14 -14
  131. package/dist/esm/tree-item/index.js +2 -8
  132. package/dist/esm/tree-item/tree-item.styles.js +45 -80
  133. package/dist/esm/tree-view/tree-view.stories.js +23 -11
  134. package/dist/fluent-web-components.api.json +4900 -2353
  135. package/dist/web-components.d.ts +397 -100
  136. package/dist/web-components.js +2240 -2175
  137. package/dist/web-components.min.js +158 -128
  138. package/docs/api-report.md +338 -80
  139. package/package.json +2 -5
  140. package/public/switches.ts +13 -14
  141. package/dist/dts/color/recipes/accent-fill.d.ts +0 -7
  142. package/dist/dts/color/recipes/accent-foreground.d.ts +0 -7
  143. package/dist/dts/color/recipes/neutral-fill-contrast.d.ts +0 -7
  144. package/dist/dts/color/recipes/neutral-fill-input.d.ts +0 -7
  145. package/dist/dts/color/recipes/neutral-fill-inverse.d.ts +0 -7
  146. package/dist/dts/color/recipes/neutral-fill-layer.d.ts +0 -6
  147. package/dist/dts/color/recipes/neutral-fill-stealth.d.ts +0 -7
  148. package/dist/dts/color/recipes/neutral-fill.d.ts +0 -14
  149. package/dist/dts/color/recipes/neutral-foreground-hint.d.ts +0 -10
  150. package/dist/dts/color/recipes/neutral-foreground.d.ts +0 -6
  151. package/dist/dts/color/recipes/neutral-layer-card-container.d.ts +0 -6
  152. package/dist/dts/color/recipes/neutral-stroke-strong.d.ts +0 -7
  153. package/dist/dts/color/recipes/neutral-stroke.d.ts +0 -7
  154. package/dist/dts/styles/patterns/input.d.ts +0 -4
  155. package/dist/dts/utilities/math.d.ts +0 -24
  156. package/dist/esm/color/recipes/accent-fill.js +0 -18
  157. package/dist/esm/color/recipes/accent-foreground.js +0 -31
  158. package/dist/esm/color/recipes/neutral-fill-contrast.js +0 -26
  159. package/dist/esm/color/recipes/neutral-fill-input.js +0 -14
  160. package/dist/esm/color/recipes/neutral-fill-inverse.js +0 -26
  161. package/dist/esm/color/recipes/neutral-fill-layer.js +0 -7
  162. package/dist/esm/color/recipes/neutral-fill-stealth.js +0 -14
  163. package/dist/esm/color/recipes/neutral-fill.js +0 -21
  164. package/dist/esm/color/recipes/neutral-foreground-hint.js +0 -10
  165. package/dist/esm/color/recipes/neutral-foreground.js +0 -6
  166. package/dist/esm/color/recipes/neutral-layer-card-container.js +0 -9
  167. package/dist/esm/color/recipes/neutral-stroke-strong.js +0 -15
  168. package/dist/esm/color/recipes/neutral-stroke.js +0 -18
  169. package/dist/esm/styles/patterns/input.js +0 -31
  170. package/dist/esm/utilities/math.js +0 -49
@@ -1,8 +1,8 @@
1
1
  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
- import { heightNumber } from '../styles/index';
5
- import { bodyFont, controlCornerRadius, designUnit, disabledOpacity, focusStrokeOuter, focusStrokeWidth, neutralFillStealthActive, neutralFillStealthHover, neutralForegroundHint, neutralForegroundRest, strokeWidth, typeRampBaseFontSize, typeRampBaseLineHeight, } from '../design-tokens';
4
+ import { DirectionalStyleSheetBehavior, heightNumber } from '../styles/index';
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;
@@ -11,12 +11,11 @@ export const menuItemStyles = (context, definition) => css `
11
11
  outline: none;
12
12
  box-sizing: border-box;
13
13
  height: calc(${heightNumber} * 1px);
14
- grid-template-columns: minmax(42px, auto) 1fr minmax(42px, auto);
14
+ grid-template-columns: minmax(32px, auto) 1fr minmax(32px, auto);
15
15
  grid-template-rows: auto;
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;
@@ -28,7 +27,7 @@ export const menuItemStyles = (context, definition) => css `
28
27
  }
29
28
 
30
29
  :host(.indent-0) {
31
- grid-template-columns: auto 1fr minmax(42px, auto);
30
+ grid-template-columns: auto 1fr minmax(32px, auto);
32
31
  }
33
32
 
34
33
  :host(.indent-0) .content {
@@ -37,8 +36,13 @@ export const menuItemStyles = (context, definition) => css `
37
36
  margin-inline-start: 10px;
38
37
  }
39
38
 
39
+ :host(.indent-0) .expand-collapse-glyph-container {
40
+ grid-column: 5;
41
+ grid-row: 1;
42
+ }
43
+
40
44
  :host(.indent-2) {
41
- grid-template-columns: minmax(42px, auto) minmax(42px, auto) 1fr minmax(42px, auto) minmax(42px, auto);
45
+ grid-template-columns: minmax(32px, auto) minmax(32px, auto) 1fr minmax(32px, auto) minmax(32px, auto);
42
46
  }
43
47
 
44
48
  :host(.indent-2) .content {
@@ -65,12 +69,11 @@ export const menuItemStyles = (context, definition) => css `
65
69
  box-shadow: 0 0 0 calc((${focusStrokeWidth} - ${strokeWidth}) * 1px) ${focusStrokeOuter};
66
70
  }
67
71
 
68
- :host(:hover) {
72
+ :host(:not([disabled]):hover) {
69
73
  background: ${neutralFillStealthHover};
70
74
  }
71
75
 
72
- :host([aria-checked='true']),
73
- :host(:active),
76
+ :host(:not([disabled]):active),
74
77
  :host(.expanded) {
75
78
  background: ${neutralFillStealthActive};
76
79
  color: ${neutralForegroundRest};
@@ -81,12 +84,6 @@ export const menuItemStyles = (context, definition) => css `
81
84
  opacity: ${disabledOpacity};
82
85
  }
83
86
 
84
- :host([disabled]:hover) .start,
85
- :host([disabled]:hover) .end,
86
- :host([disabled]:hover)::slotted(svg) {
87
- fill: currentcolor;
88
- }
89
-
90
87
  .content {
91
88
  grid-column-start: 2;
92
89
  justify-self: start;
@@ -100,28 +97,18 @@ export const menuItemStyles = (context, definition) => css `
100
97
  justify-content: center;
101
98
  }
102
99
 
103
- ::slotted(svg) {
104
- ${
105
- /* Glyph size and margin-left is temporary -
106
- replace when adaptive typography is figured out */ ''} width: 16px;
107
- height: 16px;
108
- display: flex;
109
- }
110
-
111
- :host(:hover) .start,
112
- :host(:hover) .end,
113
- :host(:hover)::slotted(svg),
114
- :host(:active) .start,
115
- :host(:active) .end,
116
- :host(:active)::slotted(svg) {
117
- fill: ${neutralForegroundRest};
100
+ :host(.indent-0[aria-haspopup='menu']) {
101
+ display: grid;
102
+ grid-template-columns: minmax(32px, auto) auto 1fr minmax(32px, auto) minmax(32px, auto);
103
+ align-items: center;
104
+ min-height: 32px;
118
105
  }
119
106
 
120
107
  :host(.indent-1[aria-haspopup='menu']),
121
108
  :host(.indent-1[role='menuitemcheckbox']),
122
109
  :host(.indent-1[role='menuitemradio']) {
123
110
  display: grid;
124
- grid-template-columns: minmax(42px, auto) auto 1fr minmax(42px, auto) minmax(42px, auto);
111
+ grid-template-columns: minmax(32px, auto) auto 1fr minmax(32px, auto) minmax(32px, auto);
125
112
  align-items: center;
126
113
  min-height: 32px;
127
114
  }
@@ -139,7 +126,6 @@ export const menuItemStyles = (context, definition) => css `
139
126
  :host([role='menuitemcheckbox']) .input-container,
140
127
  :host([role='menuitemradio']) .input-container {
141
128
  display: grid;
142
- margin-inline-end: 10px;
143
129
  }
144
130
 
145
131
  :host([aria-haspopup='menu']) .content,
@@ -148,6 +134,10 @@ export const menuItemStyles = (context, definition) => css `
148
134
  grid-column-start: 3;
149
135
  }
150
136
 
137
+ :host([aria-haspopup='menu'].indent-0) .content {
138
+ grid-column-start: 1;
139
+ }
140
+
151
141
  :host([aria-haspopup='menu']) .end,
152
142
  :host([role='menuitemcheckbox']) .end,
153
143
  :host([role='menuitemradio']) .end {
@@ -161,25 +151,14 @@ export const menuItemStyles = (context, definition) => css `
161
151
  align-items: center;
162
152
  justify-content: center;
163
153
  position: relative;
164
- width: 20px;
165
- height: 20px;
166
154
  box-sizing: border-box;
167
155
  outline: none;
168
- margin-inline-start: 10px;
169
- }
170
-
171
- :host .checkbox {
172
- border-radius: calc(${controlCornerRadius} * 1px);
173
- }
174
-
175
- :host .radio {
176
- border-radius: 999px;
177
156
  }
178
157
 
179
158
  :host .checkbox-indicator,
180
159
  :host .radio-indicator,
181
- ::slotted([slot='checkbox-indicator']),
182
- ::slotted([slot='radio-indicator']) {
160
+ slot[name='checkbox-indicator'],
161
+ slot[name='radio-indicator'] {
183
162
  display: none;
184
163
  }
185
164
 
@@ -189,49 +168,39 @@ export const menuItemStyles = (context, definition) => css `
189
168
  }
190
169
 
191
170
  :host([aria-checked='true']) .checkbox-indicator,
192
- :host([aria-checked='true']) ::slotted([slot='checkbox-indicator']) {
193
- width: 100%;
194
- height: 100%;
195
- display: block;
196
- fill: ${neutralForegroundRest};
197
- pointer-events: none;
198
- }
199
-
200
- :host([aria-checked='true']) .radio-indicator {
201
- display: block;
202
- pointer-events: none;
203
- }
204
-
205
- :host([aria-checked='true']) ::slotted([slot='radio-indicator']) {
206
- display: block;
207
- pointer-events: none;
171
+ :host([aria-checked='true']) slot[name='checkbox-indicator'],
172
+ :host([aria-checked='true']) .radio-indicator,
173
+ :host([aria-checked='true']) slot[name='radio-indicator'] {
174
+ display: flex;
208
175
  }
209
176
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
210
- :host {
177
+ :host,
178
+ ::slotted([slot='end']:not(svg)) {
211
179
  forced-color-adjust: none;
212
- border-color: transparent;
213
180
  color: ${SystemColors.ButtonText};
214
- fill: ${SystemColors.ButtonText};
181
+ fill: currentcolor;
215
182
  }
216
- :host(:hover) {
183
+ :host(:not([disabled]):hover) {
217
184
  background: ${SystemColors.Highlight};
218
185
  color: ${SystemColors.HighlightText};
186
+ fill: currentcolor;
219
187
  }
220
188
  :host(:hover) .start,
221
189
  :host(:hover) .end,
222
190
  :host(:hover)::slotted(svg),
223
191
  :host(:active) .start,
224
192
  :host(:active) .end,
225
- :host(:active)::slotted(svg) {
226
- 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;
227
198
  }
228
-
229
199
  :host(.expanded) {
230
200
  background: ${SystemColors.Highlight};
231
201
  border-color: ${SystemColors.Highlight};
232
202
  color: ${SystemColors.HighlightText};
233
203
  }
234
-
235
204
  :host(:${focusVisible}) {
236
205
  background: ${SystemColors.Highlight};
237
206
  border-color: ${SystemColors.ButtonText};
@@ -239,56 +208,61 @@ export const menuItemStyles = (context, definition) => css `
239
208
  color: ${SystemColors.HighlightText};
240
209
  fill: currentcolor;
241
210
  }
242
-
243
211
  :host([disabled]),
244
212
  :host([disabled]:hover),
245
213
  :host([disabled]:hover) .start,
246
214
  :host([disabled]:hover) .end,
247
- :host([disabled]:hover)::slotted(svg) {
248
- background: ${SystemColors.Canvas};
215
+ :host([disabled]:hover)::slotted(svg),
216
+ :host([disabled]:${focusVisible}) {
217
+ background: ${SystemColors.ButtonFace};
249
218
  color: ${SystemColors.GrayText};
250
219
  fill: currentcolor;
251
220
  opacity: 1;
252
221
  }
253
-
222
+ :host([disabled]:${focusVisible}) {
223
+ border-color: ${SystemColors.GrayText};
224
+ }
254
225
  :host .expanded-toggle,
255
226
  :host .checkbox,
256
227
  :host .radio {
257
228
  border-color: ${SystemColors.ButtonText};
258
229
  background: ${SystemColors.HighlightText};
259
230
  }
260
-
261
- :host([checked='true']) .checkbox,
262
- :host([checked='true']) .radio {
231
+ :host([checked]) .checkbox,
232
+ :host([checked]) .radio {
263
233
  background: ${SystemColors.HighlightText};
264
234
  border-color: ${SystemColors.HighlightText};
265
235
  }
266
-
267
236
  :host(:hover) .expanded-toggle,
268
237
  :host(:hover) .checkbox,
269
238
  :host(:hover) .radio,
270
239
  :host(:${focusVisible}) .expanded-toggle,
271
240
  :host(:${focusVisible}) .checkbox,
272
241
  :host(:${focusVisible}) .radio,
273
- :host([checked="true"]:hover) .checkbox,
274
- :host([checked="true"]:hover) .radio,
275
- :host([checked="true"]:${focusVisible}) .checkbox,
276
- :host([checked="true"]:${focusVisible}) .radio {
242
+ :host([checked]:hover) .checkbox,
243
+ :host([checked]:hover) .radio,
244
+ :host([checked]:${focusVisible}) .checkbox,
245
+ :host([checked]:${focusVisible}) .radio {
277
246
  border-color: ${SystemColors.HighlightText};
278
247
  }
279
-
280
248
  :host([aria-checked='true']) {
281
249
  background: ${SystemColors.Highlight};
282
250
  color: ${SystemColors.HighlightText};
283
251
  }
284
-
285
252
  :host([aria-checked='true']) .checkbox-indicator,
286
253
  :host([aria-checked='true']) ::slotted([slot='checkbox-indicator']),
287
254
  :host([aria-checked='true']) ::slotted([slot='radio-indicator']) {
288
255
  fill: ${SystemColors.Highlight};
289
256
  }
290
-
291
257
  :host([aria-checked='true']) .radio-indicator {
292
258
  background: ${SystemColors.Highlight};
293
259
  }
260
+ `), new DirectionalStyleSheetBehavior(css `
261
+ .expand-collapse-glyph-container {
262
+ transform: rotate(0deg);
263
+ }
264
+ `, css `
265
+ .expand-collapse-glyph-container {
266
+ transform: rotate(180deg);
267
+ }
294
268
  `));
@@ -45,9 +45,13 @@ export const fluentNumberField = NumberField.compose({
45
45
  delegatesFocus: true,
46
46
  },
47
47
  stepDownGlyph: `
48
- <span class="step-down-glyph" part="step-down-glyph"></span>
48
+ <svg width="12" height="12" xmlns="http://www.w3.org/2000/svg">
49
+ <path d="M2.15 4.65c.2-.2.5-.2.7 0L6 7.79l3.15-3.14a.5.5 0 11.7.7l-3.5 3.5a.5.5 0 01-.7 0l-3.5-3.5a.5.5 0 010-.7z"/>
50
+ </svg>
49
51
  `,
50
52
  stepUpGlyph: `
51
- <span class="step-up-glyph" part="step-up-glyph"></span>
52
- `,
53
+ <svg width="12" height="12" xmlns="http://www.w3.org/2000/svg">
54
+ <path d="M2.15 7.35c.2.2.5.2.7 0L6 4.21l3.15 3.14a.5.5 0 10.7-.7l-3.5-3.5a.5.5 0 00-.7 0l-3.5 3.5a.5.5 0 000 .7z"/>
55
+ </svg>
56
+ `,
53
57
  });
@@ -1,108 +1,38 @@
1
1
  import { css } from '@microsoft/fast-element';
2
- import { disabledCursor, display, focusVisible, forcedColorsStylesheetBehavior, } from '@microsoft/fast-foundation';
3
- import { SystemColors } from '@microsoft/fast-web-utilities';
4
- import { fillStateStyles, heightNumber } from '../styles/index';
2
+ import { display, forcedColorsStylesheetBehavior, } from '@microsoft/fast-foundation';
3
+ import { SystemColors } from "@microsoft/fast-web-utilities";
4
+ import { inputFilledForcedColorStyles, inputFilledStyles, inputForcedColorStyles, inputStateStyles, inputStyles, } from '../styles/index';
5
5
  import { appearanceBehavior } from '../utilities/behaviors';
6
- import { bodyFont, controlCornerRadius, designUnit, disabledOpacity, focusStrokeOuter, neutralFillHover, neutralFillInputActive, neutralFillInputHover, neutralFillInputRest, neutralFillRest, neutralForegroundRest, neutralStrokeActive, neutralStrokeHover, neutralStrokeRest, strokeWidth, typeRampBaseFontSize, typeRampBaseLineHeight, } from '../design-tokens';
6
+ import { designUnit } from '../design-tokens';
7
7
  export const numberFieldFilledStyles = (context, definition) => css `
8
- :host([appearance='filled']) .root {
9
- background: ${neutralFillRest};
10
- border-color: transparent;
11
- }
12
-
13
- :host([appearance='filled']:hover:not([disabled])) .root {
14
- background: ${neutralFillHover};
15
- border-color: transparent;
16
- }
17
-
18
- :host([appearance='filled']:focus-within:not([disabled])) .root {
19
- border-color: transparent;
20
- box-shadow: none;
21
- }
22
- ${fillStateStyles(context, definition)}
8
+ ${inputFilledStyles(context, definition, '.root')}
23
9
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
24
- :host([appearance='filled']) .root,
25
- :host([appearance='filled']:hover:not([disabled])) .root {
26
- background: ${SystemColors.Field};
27
- border-color: ${SystemColors.FieldText};
28
- }
29
- :host([appearance='filled']:active:not([disabled])) .root,
30
- :host([appearance='filled']:focus-within:not([disabled])) .root {
31
- background: ${SystemColors.Field};
32
- border-color: ${SystemColors.FieldText};
33
- }
34
- :host([appearance='filled']:not([disabled]):active)::after,
35
- :host([appearance='filled']:not([disabled]):focus-within:not(:active))::after {
36
- border-bottom-color: ${SystemColors.Highlight};
37
- }
38
- :host([appearance='filled'][disabled]) .root {
39
- border-color: ${SystemColors.GrayText};
40
- background: ${SystemColors.Field};
41
- }
42
- :host([appearance='filled'][disabled]) .root {
43
- border-color: ${SystemColors.GrayText};
44
- background: ${SystemColors.Field};
45
- }
10
+ ${inputFilledForcedColorStyles(context, definition, '.root')}
46
11
  `));
47
12
  export const numberFieldStyles = (context, definition) => css `
48
- ${display('inline-block')} :host {
49
- font-family: ${bodyFont};
50
- outline: none;
51
- user-select: none;
52
- position: relative;
53
- }
13
+ ${display('inline-block')}
14
+
15
+ ${inputStyles(context, definition, '.root')}
16
+
17
+ ${inputStateStyles(context, definition, '.root')}
54
18
 
55
19
  .root {
56
- box-sizing: border-box;
57
- position: relative;
58
20
  display: flex;
59
21
  flex-direction: row;
60
- color: ${neutralForegroundRest};
61
- background: ${neutralFillInputRest};
62
- border-radius: calc(${controlCornerRadius} * 1px);
63
- border: calc(${strokeWidth} * 1px) solid ${neutralStrokeRest};
64
- height: calc(${heightNumber} * 1px);
65
22
  }
66
23
 
67
24
  .control {
68
25
  -webkit-appearance: none;
69
- font: inherit;
26
+ color: inherit;
70
27
  background: transparent;
71
28
  border: 0;
72
- color: inherit;
73
29
  height: calc(100% - 4px);
74
- width: 100%;
75
30
  margin-top: auto;
76
31
  margin-bottom: auto;
77
- border: none;
78
32
  padding: 0 calc(${designUnit} * 2px + 1px);
79
- font-size: ${typeRampBaseFontSize};
80
- line-height: ${typeRampBaseLineHeight};
81
- }
82
-
83
- .control:hover,
84
- .control:${focusVisible},
85
- .control:disabled,
86
- .control:active {
87
- outline: none;
88
- }
89
-
90
- .controls {
91
- opacity: 0;
92
- }
93
-
94
- .label {
95
- display: block;
96
- color: ${neutralForegroundRest};
97
- cursor: pointer;
98
- font-size: ${typeRampBaseFontSize};
99
- line-height: ${typeRampBaseLineHeight};
100
- margin-bottom: 4px;
101
- }
102
-
103
- .label__hidden {
104
- display: none;
105
- visibility: hidden;
33
+ font-family: inherit;
34
+ font-size: inherit;
35
+ line-height: inherit;
106
36
  }
107
37
 
108
38
  .start,
@@ -111,34 +41,6 @@ export const numberFieldStyles = (context, definition) => css `
111
41
  fill: currentcolor;
112
42
  }
113
43
 
114
- .step-up,
115
- .step-down {
116
- padding: 2px 10px;
117
- cursor: pointer;
118
- }
119
-
120
- .step-up:before,
121
- .step-down:before {
122
- content: '';
123
- display: block;
124
- border: solid transparent 6px;
125
- }
126
-
127
- .step-up:before {
128
- border-bottom-color: ${neutralForegroundRest};
129
- }
130
-
131
- .step-down:before {
132
- border-top-color: ${neutralForegroundRest};
133
- }
134
-
135
- ::slotted(svg) {
136
- ${
137
- /* Glyph size and margin-left is temporary -
138
- replace when adaptive typography is figured out */ ''} width: 16px;
139
- height: 16px;
140
- }
141
-
142
44
  .start {
143
45
  display: flex;
144
46
  margin-inline-start: 11px;
@@ -149,19 +51,11 @@ export const numberFieldStyles = (context, definition) => css `
149
51
  margin-inline-end: 11px;
150
52
  }
151
53
 
152
- :host(:hover:not([disabled])) .root {
153
- background: ${neutralFillInputHover};
154
- border-color: ${neutralStrokeHover};
155
- }
156
-
157
- :host(:active:not([disabled])) .root {
158
- background: ${neutralFillInputActive};
159
- border-color: ${neutralStrokeActive};
160
- }
161
-
162
- :host(:focus-within:not([disabled])) .root {
163
- border-color: ${focusStrokeOuter};
164
- box-shadow: 0 0 0 1px ${focusStrokeOuter} inset;
54
+ .controls {
55
+ opacity: 0;
56
+ position: relative;
57
+ top: -1px;
58
+ z-index: 3;
165
59
  }
166
60
 
167
61
  :host(:hover:not([disabled])) .controls,
@@ -169,59 +63,20 @@ export const numberFieldStyles = (context, definition) => css `
169
63
  opacity: 1;
170
64
  }
171
65
 
172
- :host([disabled]) .label,
173
- :host([readonly]) .label,
174
- :host([readonly]) .control,
175
- :host([disabled]) .control {
176
- cursor: ${disabledCursor};
177
- }
178
-
179
- :host([disabled]) {
180
- opacity: ${disabledOpacity};
66
+ .step-up,
67
+ .step-down {
68
+ display: flex;
69
+ padding: 0 8px;
70
+ cursor: pointer;
181
71
  }
182
72
 
183
- :host([disabled]) .control {
184
- border-color: ${neutralStrokeRest};
73
+ .step-up {
74
+ padding-top: 3px;
185
75
  }
186
76
  `.withBehaviors(appearanceBehavior('filled', numberFieldFilledStyles(context, definition)), forcedColorsStylesheetBehavior(css `
187
- .root {
188
- forced-color-adjust: none;
189
- background: ${SystemColors.Field};
190
- border-color: ${SystemColors.FieldText};
191
- }
192
- :host(:hover:not([disabled])) .root {
193
- background: ${SystemColors.Field};
194
- border-color: ${SystemColors.Highlight};
195
- }
196
- :host(:focus-within:enabled) .root {
197
- border-color: ${SystemColors.Highlight};
198
- box-shadow: 0 0 0 1px ${SystemColors.Highlight} inset;
199
- }
200
- .control,
201
- ::placeholder,
202
- ::-webkit-input-placeholder {
203
- color: ${SystemColors.FieldText};
204
- }
205
- .step-up:before {
206
- border-bottom-color: ${SystemColors.FieldText};
207
- }
208
- .step-down:before {
209
- border-top-color: ${SystemColors.FieldText};
210
- }
211
- .start,
212
- .end {
77
+ ${inputForcedColorStyles(context, definition, '.root')}
78
+ .step-up,
79
+ .step-down {
213
80
  fill: ${SystemColors.FieldText};
214
81
  }
215
- :host([disabled]) {
216
- opacity: 1;
217
- }
218
- :host([disabled]) .root {
219
- border-color: ${SystemColors.GrayText};
220
- background: ${SystemColors.Field};
221
- }
222
- :host([disabled]) ::placeholder,
223
- :host([disabled]) ::-webkit-input-placeholder,
224
- :host([disabled]) .label {
225
- color: ${SystemColors.GrayText};
226
- }
227
82
  `));
@@ -23,7 +23,7 @@ export const fluentProgress = Progress.compose({
23
23
  <span class="indeterminate-indicator-1" part="indeterminate-indicator-1"></span>
24
24
  `,
25
25
  indeterminateIndicator2: `
26
- <span class="indeterminate-indicator-1" part="indeterminate-indicator-1"></span>
26
+ <span class="indeterminate-indicator-2" part="indeterminate-indicator-2"></span>
27
27
  `,
28
28
  });
29
29
  /**
@@ -1,20 +1,19 @@
1
1
  import { css } from '@microsoft/fast-element';
2
2
  import { SystemColors } from '@microsoft/fast-web-utilities';
3
3
  import { display, forcedColorsStylesheetBehavior, } from '@microsoft/fast-foundation';
4
- import { accentFillRest, designUnit, neutralFillRest, neutralForegroundHint, strokeWidth, } from '../../design-tokens';
4
+ import { accentFillRest, designUnit, neutralForegroundHint, neutralStrokeStrongRest, strokeWidth, } from '../../design-tokens';
5
5
  export const progressStyles = (context, definition) => css `
6
6
  ${display('flex')} :host {
7
7
  align-items: center;
8
8
  outline: none;
9
- height: calc(${designUnit} * 1px);
10
- margin: calc(${designUnit} * 1px) 0;
9
+ height: calc((${strokeWidth} * 3) * 1px);
11
10
  }
12
11
 
13
12
  .progress {
14
- background-color: ${neutralFillRest};
13
+ background-color: ${neutralStrokeStrongRest};
15
14
  border-radius: calc(${designUnit} * 1px);
16
15
  width: 100%;
17
- height: 100%;
16
+ height: calc(${strokeWidth} * 1px);
18
17
  display: flex;
19
18
  align-items: center;
20
19
  position: relative;
@@ -23,13 +22,13 @@ export const progressStyles = (context, definition) => css `
23
22
  .determinate {
24
23
  background-color: ${accentFillRest};
25
24
  border-radius: calc(${designUnit} * 1px);
26
- height: 100%;
25
+ height: calc((${strokeWidth} * 3) * 1px);
27
26
  transition: all 0.2s ease-in-out;
28
27
  display: flex;
29
28
  }
30
29
 
31
30
  .indeterminate {
32
- height: 100%;
31
+ height: calc((${strokeWidth} * 3) * 1px);
33
32
  border-radius: calc(${designUnit} * 1px);
34
33
  display: flex;
35
34
  width: 100%;
@@ -61,8 +60,10 @@ export const progressStyles = (context, definition) => css `
61
60
 
62
61
  :host(.paused) .indeterminate-indicator-1,
63
62
  :host(.paused) .indeterminate-indicator-2 {
64
- animation-play-state: paused;
65
- background-color: ${neutralFillRest};
63
+ animation: none;
64
+ background-color: ${neutralForegroundHint};
65
+ width: 100%;
66
+ opacity: 1;
66
67
  }
67
68
 
68
69
  :host(.paused) .determinate {
@@ -107,18 +108,12 @@ export const progressStyles = (context, definition) => css `
107
108
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
108
109
  .indeterminate-indicator-1,
109
110
  .indeterminate-indicator-2,
110
- .determinate {
111
- forced-color-adjust: none;
112
- background-color: ${SystemColors.FieldText};
113
- }
111
+ .determinate,
114
112
  .progress {
115
- background-color: ${SystemColors.Field};
116
- border: calc(${strokeWidth} * 1px) solid ${SystemColors.FieldText};
113
+ background-color: ${SystemColors.ButtonText};
117
114
  }
118
115
  :host(.paused) .indeterminate-indicator-1,
119
- .indeterminate-indicator-2 {
120
- background-color: ${SystemColors.Field};
121
- }
116
+ :host(.paused) .indeterminate-indicator-2,
122
117
  :host(.paused) .determinate {
123
118
  background-color: ${SystemColors.GrayText};
124
119
  }