@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,77 +1,32 @@
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';
2
+ import { display, forcedColorsStylesheetBehavior, } from '@microsoft/fast-foundation';
3
+ import { heightNumber, inputFilledForcedColorStyles, inputFilledStyles, inputForcedColorStyles, inputStateStyles, inputStyles, } from '../styles';
5
4
  import { appearanceBehavior } from '../utilities/behaviors';
6
- import { bodyFont, controlCornerRadius, designUnit, disabledOpacity, focusStrokeOuter, neutralFillHover, neutralFillInputHover, neutralFillInputRest, neutralFillRest, neutralForegroundRest, neutralStrokeHover, neutralStrokeRest, strokeWidth, typeRampBaseFontSize, typeRampBaseLineHeight, } from '../design-tokens';
5
+ import { designUnit } from '../design-tokens';
7
6
  export const textAreaFilledStyles = (context, definition) => css `
8
- :host([appearance='filled']) .control {
9
- background: ${neutralFillRest};
10
- border-color: transparent;
11
- }
12
-
13
- :host([appearance='filled']:hover:not([disabled])) .control {
14
- background: ${neutralFillHover};
15
- border-color: transparent;
16
- }
17
-
18
- :host([appearance='filled']:focus-within:not([disabled])) .control {
19
- border-color: transparent;
20
- box-shadow: none;
21
- }
22
- ${fillStateStyles(context, definition)}
7
+ ${inputFilledStyles(context, definition, '.control')}
23
8
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
24
- :host([appearance='filled']:hover:not([disabled])) .control,
25
- :host([appearance='filled']:focus-within:not([disabled])) .control {
26
- background: ${SystemColors.Field};
27
- border-color: ${SystemColors.FieldText};
28
- }
29
- :host([appearance='filled']:not([disabled]):active)::after,
30
- :host([appearance='filled']:not([disabled]):focus-within:not(:active))::after {
31
- border-bottom-color: ${SystemColors.Highlight};
32
- }
9
+ ${inputFilledForcedColorStyles(context, definition, '.control')}
33
10
  `));
34
11
  export const textAreaStyles = (context, definition) => css `
35
- ${display('inline-flex')} :host {
36
- font-family: ${bodyFont};
37
- outline: none;
38
- user-select: none;
39
- position: relative;
12
+ ${display('inline-flex')}
13
+
14
+ ${inputStyles(context, definition, '.control')}
15
+
16
+ ${inputStateStyles(context, definition, '.control')}
17
+
18
+ :host {
40
19
  flex-direction: column;
41
20
  vertical-align: bottom;
42
21
  }
43
22
 
44
23
  .control {
45
- box-sizing: border-box;
46
- position: relative;
47
- color: ${neutralForegroundRest};
48
- background: ${neutralFillInputRest};
49
- border-radius: calc(${controlCornerRadius} * 1px);
50
- border: calc(${strokeWidth} * 1px) solid ${neutralStrokeRest};
51
- height: calc(${heightNumber} * 2px);
52
- font: inherit;
53
- font-size: ${typeRampBaseFontSize};
54
- line-height: ${typeRampBaseLineHeight};
24
+ height: calc((${heightNumber} * 2) * 1px);
55
25
  padding: calc(${designUnit} * 1.5px) calc(${designUnit} * 2px + 1px);
56
- width: 100%;
57
- resize: none;
58
- }
59
-
60
- .control:hover:enabled {
61
- background: ${neutralFillInputHover};
62
- border-color: ${neutralStrokeHover};
63
26
  }
64
27
 
65
- .control:hover,
66
- .control:${focusVisible},
67
- .control:disabled,
68
- .control:active {
69
- outline: none;
70
- }
71
-
72
- :host(:focus-within) .control {
73
- border-color: ${focusStrokeOuter};
74
- box-shadow: 0 0 0 1px ${focusStrokeOuter} inset;
28
+ :host .control {
29
+ resize: none;
75
30
  }
76
31
 
77
32
  :host(.resize-both) .control {
@@ -85,41 +40,6 @@ export const textAreaStyles = (context, definition) => css `
85
40
  :host(.resize-vertical) .control {
86
41
  resize: vertical;
87
42
  }
88
-
89
- .label__hidden {
90
- display: none;
91
- visibility: hidden;
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
- :host([disabled]) .label,
104
- :host([readonly]) .label,
105
- :host([readonly]) .control,
106
- :host([disabled]) .control {
107
- cursor: ${disabledCursor};
108
- }
109
- :host([disabled]) {
110
- opacity: ${disabledOpacity};
111
- }
112
43
  `.withBehaviors(appearanceBehavior('filled', textAreaFilledStyles(context, definition)), forcedColorsStylesheetBehavior(css `
113
- :host([disabled]) {
114
- opacity: 1;
115
- }
116
- ::placeholder,
117
- ::-webkit-input-placeholder {
118
- color: ${SystemColors.FieldText};
119
- }
120
- :host([disabled]) ::placeholder,
121
- :host([disabled]) ::-webkit-input-placeholder,
122
- :host([disabled]) .label {
123
- color: ${SystemColors.GrayText};
124
- }
44
+ ${inputForcedColorStyles(context, definition, '.control')}
125
45
  `));
@@ -70,7 +70,7 @@ const TextFieldTemplate = ({ appearance, autoFocus, disabled, list, maxlength, n
70
70
  ></fluent-text-field>`;
71
71
  export const TextField = TextFieldTemplate.bind({});
72
72
  TextField.args = {
73
- placeholder: '',
73
+ placeholder: 'placeholder',
74
74
  autoFocus: false,
75
75
  disabled: false,
76
76
  readonly: false,
@@ -1,182 +1,54 @@
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';
2
+ import { display, forcedColorsStylesheetBehavior, } from '@microsoft/fast-foundation';
3
+ import { inputFilledForcedColorStyles, inputFilledStyles, inputForcedColorStyles, inputStateStyles, inputStyles, } from '../styles';
5
4
  import { appearanceBehavior } from '../utilities/behaviors';
6
- import { bodyFont, controlCornerRadius, designUnit, disabledOpacity, focusStrokeOuter, neutralFillHover, neutralFillInputHover, neutralFillInputRest, neutralFillRest, neutralForegroundRest, neutralStrokeHover, neutralStrokeRest, strokeWidth, typeRampBaseFontSize, typeRampBaseLineHeight, } from '../design-tokens';
5
+ import { designUnit } from '../design-tokens';
7
6
  export const textFieldFilledStyles = (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)}
7
+ ${inputFilledStyles(context, definition, '.root')}
23
8
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
24
- :host([appearance='filled']) .root {
25
- background: ${SystemColors.Field};
26
- border-color: ${SystemColors.FieldText};
27
- }
28
- :host([appearance='filled']:hover:not([disabled])) .root,
29
- :host([appearance='filled']:focus-within:not([disabled])) .root {
30
- background: ${SystemColors.Field};
31
- border-color: ${SystemColors.FieldText};
32
- }
33
- :host([appearance='filled']:active:not([disabled])) .root {
34
- background: ${SystemColors.Field};
35
- border-color: ${SystemColors.FieldText};
36
- }
37
- :host([appearance='filled']:not([disabled]):active)::after,
38
- :host([appearance='filled']:not([disabled]):focus-within:not(:active))::after {
39
- border-bottom-color: ${SystemColors.Highlight};
40
- }
41
- :host([appearance='filled'][disabled]) .root {
42
- border-color: ${SystemColors.GrayText};
43
- background: ${SystemColors.Field};
44
- }
9
+ ${inputFilledForcedColorStyles(context, definition, '.root')}
45
10
  `));
46
11
  export const textFieldStyles = (context, definition) => css `
47
- ${display('inline-block')} :host {
48
- font-family: ${bodyFont};
49
- outline: none;
50
- user-select: none;
51
- position: relative;
52
- }
12
+ ${display('inline-block')}
13
+
14
+ ${inputStyles(context, definition, '.root')}
15
+
16
+ ${inputStateStyles(context, definition, '.root')}
53
17
 
54
18
  .root {
55
- box-sizing: border-box;
56
- position: relative;
57
19
  display: flex;
58
20
  flex-direction: row;
59
- color: ${neutralForegroundRest};
60
- background: ${neutralFillInputRest};
61
- border-radius: calc(${controlCornerRadius} * 1px);
62
- border: calc(${strokeWidth} * 1px) solid ${neutralStrokeRest};
63
- height: calc(${heightNumber} * 1px);
64
21
  }
65
22
 
66
23
  .control {
67
24
  -webkit-appearance: none;
25
+ color: inherit;
68
26
  background: transparent;
69
27
  border: 0;
70
28
  height: calc(100% - 4px);
71
- width: 100%;
72
29
  margin-top: auto;
73
30
  margin-bottom: auto;
74
- border: none;
75
31
  padding: 0 calc(${designUnit} * 2px + 1px);
76
- color: ${neutralForegroundRest};
77
32
  font-family: inherit;
78
- font-size: ${typeRampBaseFontSize};
79
- line-height: ${typeRampBaseLineHeight};
80
- }
81
-
82
- .control:hover,
83
- .control:${focusVisible},
84
- .control:disabled,
85
- .control:active {
86
- outline: none;
87
- }
88
-
89
- .label {
90
- display: block;
91
- color: ${neutralForegroundRest};
92
- cursor: pointer;
93
- font-size: ${typeRampBaseFontSize};
94
- line-height: ${typeRampBaseLineHeight};
95
- margin-bottom: 4px;
96
- }
97
-
98
- .label__hidden {
99
- display: none;
100
- visibility: hidden;
33
+ font-size: inherit;
34
+ line-height: inherit;
101
35
  }
102
36
 
103
37
  .start,
104
38
  .end {
105
39
  display: flex;
106
40
  margin: auto;
107
- fill: currentcolor;
108
- }
109
-
110
- ::slotted(svg) {
111
- ${
112
- /* Glyph size and margin-left is temporary -
113
- replace when adaptive typography is figured out */ ''} width: 16px;
114
- height: 16px;
115
41
  }
116
42
 
117
43
  .start {
44
+ display: flex;
118
45
  margin-inline-start: 11px;
119
46
  }
120
47
 
121
48
  .end {
49
+ display: flex;
122
50
  margin-inline-end: 11px;
123
51
  }
124
-
125
- :host(:hover:not(.disabled)) .root {
126
- background: ${neutralFillInputHover};
127
- border-color: ${neutralStrokeHover};
128
- }
129
-
130
- :host(:focus-within:not(.disabled)) .root {
131
- border-color: ${focusStrokeOuter};
132
- box-shadow: 0 0 0 1px ${focusStrokeOuter} inset;
133
- }
134
-
135
- :host(.disabled) .label,
136
- :host(.readonly) .label,
137
- :host(.readonly) .control,
138
- :host(.disabled) .control {
139
- cursor: ${disabledCursor};
140
- }
141
-
142
- :host(.disabled) {
143
- opacity: ${disabledOpacity};
144
- }
145
52
  `.withBehaviors(appearanceBehavior('filled', textFieldFilledStyles(context, definition)), forcedColorsStylesheetBehavior(css `
146
- .root {
147
- forced-color-adjust: none;
148
- background: ${SystemColors.Field};
149
- border-color: ${SystemColors.FieldText};
150
- }
151
- :host(:hover:not(.disabled)) .root {
152
- background: ${SystemColors.Field};
153
- border-color: ${SystemColors.Highlight};
154
- }
155
- .start,
156
- .end {
157
- fill: ${SystemColors.ButtonText};
158
- }
159
- :host(.disabled) {
160
- opacity: 1;
161
- }
162
- :host(.disabled) .root {
163
- border-color: ${SystemColors.GrayText};
164
- background: ${SystemColors.Field};
165
- }
166
- :host(:focus-within:enabled) .root {
167
- border-color: ${SystemColors.Highlight};
168
- box-shadow: 0 0 0 1px ${SystemColors.Highlight} inset;
169
- }
170
- .control {
171
- color: ${SystemColors.ButtonText};
172
- }
173
- ::placeholder,
174
- ::-webkit-input-placeholder {
175
- color: ${SystemColors.FieldText};
176
- }
177
- :host(.disabled) ::placeholder,
178
- :host(.disabled) ::-webkit-input-placeholder,
179
- :host([disabled]) .label {
180
- color: ${SystemColors.GrayText};
181
- }
53
+ ${inputForcedColorStyles(context, definition, '.root')}
182
54
  `));
@@ -17,6 +17,7 @@ export class Toolbar extends FoundationToolbar {
17
17
  */
18
18
  export const fluentToolbar = Toolbar.compose({
19
19
  baseName: 'toolbar',
20
+ baseClass: FoundationToolbar,
20
21
  template,
21
22
  styles,
22
23
  });
@@ -1,72 +1,72 @@
1
1
  import { css } from '@microsoft/fast-element';
2
2
  import { display, focusVisible, forcedColorsStylesheetBehavior, } from '@microsoft/fast-foundation';
3
- import { SystemColors } from "@microsoft/fast-web-utilities";
4
- import { designUnit, fillColor, focusStrokeWidth, neutralStrokeFocus, strokeWidth, } from '../design-tokens';
3
+ import { SystemColors } from '@microsoft/fast-web-utilities';
4
+ import { designUnit, fillColor, focusStrokeWidth, neutralStrokeFocus, strokeWidth } from '../design-tokens';
5
5
  export const toolbarStyles = (context, definition) => css `
6
- ${display("inline-flex")} :host {
7
- --toolbar-item-gap: calc(${designUnit} * 1px);
8
- background: ${fillColor};
9
- fill: currentcolor;
10
- padding: var(--toolbar-item-gap);
11
- box-sizing: border-box;
12
- align-items: center;
13
- }
6
+ ${display('inline-flex')} :host {
7
+ --toolbar-item-gap: calc(${designUnit} * 1px);
8
+ background: ${fillColor};
9
+ fill: currentcolor;
10
+ padding: var(--toolbar-item-gap);
11
+ box-sizing: border-box;
12
+ align-items: center;
13
+ }
14
14
 
15
- :host(${focusVisible}) {
16
- outline: calc(${strokeWidth} * 1px) solid ${neutralStrokeFocus};
17
- }
15
+ :host(${focusVisible}) {
16
+ outline: calc(${strokeWidth} * 1px) solid ${neutralStrokeFocus};
17
+ }
18
18
 
19
- .positioning-region {
20
- align-items: center;
21
- display: inline-flex;
22
- flex-flow: row wrap;
23
- justify-content: flex-start;
24
- flex-grow: 1;
25
- }
19
+ .positioning-region {
20
+ align-items: center;
21
+ display: inline-flex;
22
+ flex-flow: row wrap;
23
+ justify-content: flex-start;
24
+ flex-grow: 1;
25
+ }
26
26
 
27
- :host([orientation="vertical"]) .positioning-region {
28
- flex-direction: column;
29
- align-items: start;
30
- }
27
+ :host([orientation='vertical']) .positioning-region {
28
+ flex-direction: column;
29
+ align-items: start;
30
+ }
31
31
 
32
- ::slotted(:not([slot])) {
33
- flex: 0 0 auto;
34
- margin: 0 var(--toolbar-item-gap);
35
- }
32
+ ::slotted(:not([slot])) {
33
+ flex: 0 0 auto;
34
+ margin: 0 var(--toolbar-item-gap);
35
+ }
36
36
 
37
- :host([orientation="vertical"]) ::slotted(:not([slot])) {
38
- margin: var(--toolbar-item-gap) 0;
39
- }
37
+ :host([orientation='vertical']) ::slotted(:not([slot])) {
38
+ margin: var(--toolbar-item-gap) 0;
39
+ }
40
40
 
41
- :host([orientation="vertical"]) {
42
- display: inline-flex;
43
- flex-direction: column;
41
+ :host([orientation='vertical']) {
42
+ display: inline-flex;
43
+ flex-direction: column;
44
44
  }
45
45
 
46
- .start,
47
- .end {
48
- display: flex;
49
- align-items: center;
50
- }
46
+ .start,
47
+ .end {
48
+ display: flex;
49
+ align-items: center;
50
+ }
51
51
 
52
- .end {
53
- margin-inline-start: auto;
54
- }
52
+ .end {
53
+ margin-inline-start: auto;
54
+ }
55
55
 
56
- .start__hidden,
57
- .end__hidden {
58
- display: none;
59
- }
56
+ .start__hidden,
57
+ .end__hidden {
58
+ display: none;
59
+ }
60
60
 
61
- ::slotted(svg) {
62
- ${ /* Glyph size is temporary - replace when adaptive typography is figured out */""}
63
- width: 16px;
64
- height: 16px;
65
- }
61
+ ::slotted(svg) {
62
+ ${ /* Glyph size is temporary - replace when adaptive typography is figured out */''}
63
+ width: 16px;
64
+ height: 16px;
65
+ }
66
66
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
67
- :host(:${focusVisible}) {
68
- box-shadow: 0 0 0 calc(${focusStrokeWidth} * 1px) ${SystemColors.Highlight};
69
- color: ${SystemColors.ButtonText};
70
- forced-color-adjust: none;
71
- }
67
+ :host(:${focusVisible}) {
68
+ box-shadow: 0 0 0 calc(${focusStrokeWidth} * 1px) ${SystemColors.Highlight};
69
+ color: ${SystemColors.ButtonText};
70
+ forced-color-adjust: none;
71
+ }
72
72
  `));
@@ -1,5 +1,5 @@
1
1
  import { Tooltip as FoundationTooltip, tooltipTemplate as template } from '@microsoft/fast-foundation';
2
- import { fillColor, neutralFillInverseRecipe } from '../design-tokens';
2
+ import { fillColor, neutralLayerFloating } from '../design-tokens';
3
3
  import { tooltipStyles as styles } from './tooltip.styles';
4
4
  /**
5
5
  * The Fluent tooltip class
@@ -11,9 +11,7 @@ export class Tooltip extends FoundationTooltip {
11
11
  */
12
12
  connectedCallback() {
13
13
  super.connectedCallback();
14
- const recipe = neutralFillInverseRecipe.getValueFor(this);
15
- const parentFill = fillColor.getValueFor(this.parentElement);
16
- fillColor.setValueFor(this, (target) => recipe.evaluate(target, parentFill).rest);
14
+ fillColor.setValueFor(this, neutralLayerFloating);
17
15
  }
18
16
  }
19
17
  /**
@@ -1,10 +1,9 @@
1
1
  import { css } from '@microsoft/fast-element';
2
2
  import { forcedColorsStylesheetBehavior, } from '@microsoft/fast-foundation';
3
- import { elevation } from '../styles/index';
4
- import { bodyFont, controlCornerRadius, fillColor, neutralForegroundRest, strokeWidth, typeRampBaseFontSize, typeRampBaseLineHeight, } from '../design-tokens';
3
+ import { elevationShadowTooltip } from '../styles/index';
4
+ import { bodyFont, controlCornerRadius, fillColor, neutralForegroundRest, neutralStrokeLayerRest, strokeWidth, typeRampBaseFontSize, typeRampBaseLineHeight, } from '../design-tokens';
5
5
  export const tooltipStyles = (context, definition) => css `
6
6
  :host {
7
- --elevation: 11;
8
7
  position: relative;
9
8
  contain: layout;
10
9
  overflow: visible;
@@ -16,7 +15,7 @@ export const tooltipStyles = (context, definition) => css `
16
15
  .tooltip {
17
16
  box-sizing: border-box;
18
17
  border-radius: calc(${controlCornerRadius} * 1px);
19
- border: calc(${strokeWidth} * 1px) solid transparent;
18
+ border: calc(${strokeWidth} * 1px) solid ${neutralStrokeLayerRest};
20
19
  background: ${fillColor};
21
20
  color: ${neutralForegroundRest};
22
21
  padding: 4px 12px;
@@ -26,7 +25,7 @@ export const tooltipStyles = (context, definition) => css `
26
25
  font-size: ${typeRampBaseFontSize};
27
26
  line-height: ${typeRampBaseLineHeight};
28
27
  white-space: nowrap;
29
- ${elevation}
28
+ box-shadow: ${elevationShadowTooltip};
30
29
  }
31
30
 
32
31
  fluent-anchored-region {
@@ -50,13 +49,14 @@ export const tooltipStyles = (context, definition) => css `
50
49
  width: 12px;
51
50
  height: 12px;
52
51
  background: ${fillColor};
53
- border-radius: calc(${controlCornerRadius} * 1px);
52
+ border-top: calc(${strokeWidth} * 1px) solid ${neutralStrokeLayerRest};
53
+ border-left: calc(${strokeWidth} * 1px) solid ${neutralStrokeLayerRest};
54
54
  position: absolute;
55
55
  }
56
56
 
57
57
  fluent-anchored-region.top .tooltip::after {
58
- transform: rotate(45deg) translateX(-50%);
59
- bottom: 4px;
58
+ transform: translateX(-50%) rotate(225deg);
59
+ bottom: 5px;
60
60
  left: 50%;
61
61
  }
62
62
 
@@ -65,8 +65,8 @@ export const tooltipStyles = (context, definition) => css `
65
65
  }
66
66
 
67
67
  fluent-anchored-region.bottom .tooltip::after {
68
- transform: rotate(45deg) translateX(-50%);
69
- top: 12px;
68
+ transform: translateX(-50%) rotate(45deg);
69
+ top: 5px;
70
70
  left: 50%;
71
71
  }
72
72
 
@@ -75,9 +75,9 @@ export const tooltipStyles = (context, definition) => css `
75
75
  }
76
76
 
77
77
  fluent-anchored-region.left .tooltip::after {
78
- transform: rotate(45deg) translateY(-50%);
78
+ transform: translateY(-50%) rotate(135deg);
79
79
  top: 50%;
80
- right: 12px;
80
+ right: 5px;
81
81
  }
82
82
 
83
83
  fluent-anchored-region.left .tooltip {
@@ -85,9 +85,9 @@ export const tooltipStyles = (context, definition) => css `
85
85
  }
86
86
 
87
87
  fluent-anchored-region.right .tooltip::after {
88
- transform: rotate(45deg) translateY(-50%);
88
+ transform: translateY(-50%) rotate(-45deg);
89
89
  top: 50%;
90
- left: 4px;
90
+ left: 5px;
91
91
  }
92
92
 
93
93
  fluent-anchored-region.right .tooltip {
@@ -15,14 +15,8 @@ export const fluentTreeItem = TreeItem.compose({
15
15
  template,
16
16
  styles,
17
17
  expandCollapseGlyph: `
18
- <svg
19
- viewBox="0 0 16 16"
20
- xmlns="http://www.w3.org/2000/svg"
21
- class="expand-collapse-glyph"
22
- >
23
- <path
24
- d="M5.00001 12.3263C5.00124 12.5147 5.05566 12.699 5.15699 12.8578C5.25831 13.0167 5.40243 13.1437 5.57273 13.2242C5.74304 13.3047 5.9326 13.3354 6.11959 13.3128C6.30659 13.2902 6.4834 13.2152 6.62967 13.0965L10.8988 8.83532C11.0739 8.69473 11.2153 8.51658 11.3124 8.31402C11.4096 8.11146 11.46 7.88966 11.46 7.66499C11.46 7.44033 11.4096 7.21853 11.3124 7.01597C11.2153 6.81341 11.0739 6.63526 10.8988 6.49467L6.62967 2.22347C6.48274 2.10422 6.30501 2.02912 6.11712 2.00691C5.92923 1.9847 5.73889 2.01628 5.56823 2.09799C5.39757 2.17969 5.25358 2.30817 5.153 2.46849C5.05241 2.62882 4.99936 2.8144 5.00001 3.00369V12.3263Z"
25
- />
18
+ <svg width="12" height="12" xmlns="http://www.w3.org/2000/svg">
19
+ <path d="M4.65 2.15a.5.5 0 000 .7L7.79 6 4.65 9.15a.5.5 0 10.7.7l3.5-3.5a.5.5 0 000-.7l-3.5-3.5a.5.5 0 00-.7 0z"/>
26
20
  </svg>
27
21
  `,
28
22
  });