@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
@@ -2,9 +2,9 @@ import { css, cssPartial } from '@microsoft/fast-element';
2
2
  import { DesignToken, 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 { accentForegroundRest, baseHeightMultiplier, bodyFont, controlCornerRadius, density, designUnit, disabledOpacity, focusStrokeOuter, focusStrokeWidth, neutralFillRecipe, neutralFillRest, neutralFillStealthActive, neutralFillStealthHover, neutralFillStealthRecipe, neutralFillStealthRest, neutralForegroundRest, strokeWidth, typeRampBaseFontSize, typeRampBaseLineHeight, } from '../design-tokens';
5
+ import { accentFillRest, baseHeightMultiplier, bodyFont, controlCornerRadius, density, designUnit, disabledOpacity, focusStrokeOuter, focusStrokeWidth, neutralFillSecondaryRecipe, neutralFillSecondaryRest, neutralFillStealthActive, neutralFillStealthHover, neutralFillStealthRecipe, neutralFillStealthRest, neutralForegroundRest, strokeWidth, typeRampBaseFontSize, typeRampBaseLineHeight, } from '../design-tokens';
6
6
  const ltr = css `
7
- .expand-collapse-glyph {
7
+ .expand-collapse-button svg {
8
8
  transform: rotate(0deg);
9
9
  }
10
10
  :host(.nested) .expand-collapse-button {
@@ -13,12 +13,12 @@ const ltr = css `
13
13
  :host([selected])::after {
14
14
  left: calc(${focusStrokeWidth} * 1px);
15
15
  }
16
- :host([expanded]) > .positioning-region .expand-collapse-glyph {
17
- transform: rotate(45deg);
16
+ :host([expanded]) > .positioning-region .expand-collapse-button svg {
17
+ transform: rotate(90deg);
18
18
  }
19
19
  `;
20
20
  const rtl = css `
21
- .expand-collapse-glyph {
21
+ .expand-collapse-button svg {
22
22
  transform: rotate(180deg);
23
23
  }
24
24
  :host(.nested) .expand-collapse-button {
@@ -27,17 +27,17 @@ const rtl = css `
27
27
  :host([selected])::after {
28
28
  right: calc(${focusStrokeWidth} * 1px);
29
29
  }
30
- :host([expanded]) > .positioning-region .expand-collapse-glyph {
31
- transform: rotate(135deg);
30
+ :host([expanded]) > .positioning-region .expand-collapse-button svg {
31
+ transform: rotate(90deg);
32
32
  }
33
33
  `;
34
34
  export const expandCollapseButtonSize = cssPartial `((${baseHeightMultiplier} / 2) * ${designUnit}) + ((${designUnit} * ${density}) / 2)`;
35
- const expandCollapseHoverBehavior = DesignToken.create('tree-item-expand-collapse-hover').withDefault((target) => {
35
+ const expandCollapseHover = DesignToken.create('tree-item-expand-collapse-hover').withDefault((target) => {
36
36
  const recipe = neutralFillStealthRecipe.getValueFor(target);
37
37
  return recipe.evaluate(target, recipe.evaluate(target).hover).hover;
38
38
  });
39
- const selectedExpandCollapseHoverBehavior = DesignToken.create('tree-item-expand-collapse-selected-hover').withDefault((target) => {
40
- const baseRecipe = neutralFillRecipe.getValueFor(target);
39
+ const selectedExpandCollapseHover = DesignToken.create('tree-item-expand-collapse-selected-hover').withDefault((target) => {
40
+ const baseRecipe = neutralFillSecondaryRecipe.getValueFor(target);
41
41
  const buttonRecipe = neutralFillStealthRecipe.getValueFor(target);
42
42
  return buttonRecipe.evaluate(target, baseRecipe.evaluate(target).rest).hover;
43
43
  });
@@ -47,7 +47,7 @@ export const treeItemStyles = (context, definition) => css `
47
47
  position: relative;
48
48
  outline: none;
49
49
  color: ${neutralForegroundRest};
50
- background: ${neutralFillStealthRest};
50
+ fill: currentcolor;
51
51
  cursor: pointer;
52
52
  font-family: ${bodyFont};
53
53
  --expand-collapse-button-size: calc(${heightNumber} * 1px);
@@ -66,14 +66,15 @@ export const treeItemStyles = (context, definition) => css `
66
66
  display: flex;
67
67
  position: relative;
68
68
  box-sizing: border-box;
69
+ background: ${neutralFillStealthRest};
69
70
  border: calc(${strokeWidth} * 1px) solid transparent;
71
+ border-radius: calc(${controlCornerRadius} * 1px);
70
72
  height: calc((${heightNumber} + 1) * 1px);
71
73
  }
72
74
 
73
75
  :host(:${focusVisible}) .positioning-region {
74
- border: calc(${strokeWidth} * 1px) solid ${focusStrokeOuter};
75
- border-radius: calc(${controlCornerRadius} * 1px);
76
- color: ${neutralForegroundRest};
76
+ border-color: ${focusStrokeOuter};
77
+ box-shadow: 0 0 0 calc((${focusStrokeWidth} - ${strokeWidth}) * 1px) ${focusStrokeOuter} inset;
77
78
  }
78
79
 
79
80
  .positioning-region::before {
@@ -83,11 +84,11 @@ export const treeItemStyles = (context, definition) => css `
83
84
  flex-shrink: 0;
84
85
  }
85
86
 
86
- .positioning-region:hover {
87
+ :host(:not([disabled])) .positioning-region:hover {
87
88
  background: ${neutralFillStealthHover};
88
89
  }
89
90
 
90
- .positioning-region:active {
91
+ :host(:not([disabled])) .positioning-region:active {
91
92
  background: ${neutralFillStealthActive};
92
93
  }
93
94
 
@@ -113,6 +114,7 @@ export const treeItemStyles = (context, definition) => css `
113
114
  .expand-collapse-button {
114
115
  background: none;
115
116
  border: none;
117
+ border-radius: calc(${controlCornerRadius} * 1px);
116
118
  outline: none;
117
119
  ${
118
120
  /* Width and Height should be based off calc(glyph-size-number + (design-unit * 4) * 1px) -
@@ -126,25 +128,14 @@ export const treeItemStyles = (context, definition) => css `
126
128
  margin: 0 6px;
127
129
  }
128
130
 
129
- .expand-collapse-glyph {
130
- width: 16px;
131
- height: 16px;
131
+ .expand-collapse-button svg {
132
132
  transition: transform 0.1s linear;
133
133
  pointer-events: none;
134
- fill: ${neutralForegroundRest};
135
134
  }
136
135
 
137
136
  .start,
138
137
  .end {
139
138
  display: flex;
140
- fill: currentcolor;
141
- }
142
-
143
- ::slotted(svg) {
144
- ${
145
- /* Glyph size is temporary -
146
- replace when glyph-size var is added */ ''} width: 16px;
147
- height: 16px;
148
139
  }
149
140
 
150
141
  .start {
@@ -161,7 +152,7 @@ export const treeItemStyles = (context, definition) => css `
161
152
  display: block;
162
153
  }
163
154
 
164
- :host([disabled]) .content-region {
155
+ :host([disabled]) {
165
156
  opacity: ${disabledOpacity};
166
157
  cursor: ${disabledCursor};
167
158
  }
@@ -176,15 +167,15 @@ export const treeItemStyles = (context, definition) => css `
176
167
  }
177
168
 
178
169
  :host(.nested) .expand-collapse-button:hover {
179
- background: ${expandCollapseHoverBehavior};
170
+ background: ${expandCollapseHover};
180
171
  }
181
172
 
182
- :host([selected]) .positioning-region {
183
- background: ${neutralFillRest};
173
+ :host(:not([disabled])[selected]) .positioning-region {
174
+ background: ${neutralFillSecondaryRest};
184
175
  }
185
176
 
186
- :host([selected]) .expand-collapse-button:hover {
187
- background: ${selectedExpandCollapseHoverBehavior};
177
+ :host(:not([disabled])[selected]) .expand-collapse-button:hover {
178
+ background: ${selectedExpandCollapseHover};
188
179
  }
189
180
 
190
181
  :host([selected])::after {
@@ -196,7 +187,7 @@ export const treeItemStyles = (context, definition) => css `
196
187
  height: calc((${heightNumber} / 2) * 1px);
197
188
  ${
198
189
  /* The french fry background needs to be calculated based on the selected background state for this control.
199
- We currently have no way of chaning that, so setting to accent-foreground-rest for the time being */ ''} background: ${accentForegroundRest};
190
+ We currently have no way of changing that, so setting to accent-foreground-rest for the time being */ ''} background: ${accentFillRest};
200
191
  border-radius: calc(${controlCornerRadius} * 1px);
201
192
  }
202
193
 
@@ -206,68 +197,42 @@ export const treeItemStyles = (context, definition) => css `
206
197
  }
207
198
  `.withBehaviors(new DirectionalStyleSheetBehavior(ltr, rtl), forcedColorsStylesheetBehavior(css `
208
199
  :host {
209
- forced-color-adjust: none;
210
- border-color: transparent;
211
- background: ${SystemColors.Field};
212
- color: ${SystemColors.FieldText};
213
- }
214
- :host .content-region {
215
- color: ${SystemColors.FieldText};
200
+ color: ${SystemColors.ButtonText};
216
201
  }
217
- :host .content-region .expand-collapse-glyph,
218
- :host .content-region .start,
219
- :host .content-region .end {
220
- fill: ${SystemColors.FieldText};
202
+ .positioning-region {
203
+ border-color: ${SystemColors.ButtonFace};
204
+ background: ${SystemColors.ButtonFace};
221
205
  }
222
- :host .positioning-region:hover,
223
- :host([selected]) .positioning-region {
206
+ :host(:not([disabled])) .positioning-region:hover,
207
+ :host(:not([disabled])) .positioning-region:active,
208
+ :host(:not([disabled])[selected]) .positioning-region {
224
209
  background: ${SystemColors.Highlight};
225
210
  }
226
211
  :host .positioning-region:hover .content-region,
227
212
  :host([selected]) .positioning-region .content-region {
213
+ forced-color-adjust: none;
228
214
  color: ${SystemColors.HighlightText};
229
215
  }
230
- :host .positioning-region:hover .content-region .expand-collapse-glyph,
231
- :host .positioning-region:hover .content-region .start,
232
- :host .positioning-region:hover .content-region .end,
233
- :host([selected]) .content-region .expand-collapse-glyph,
234
- :host([selected]) .content-region .start,
235
- :host([selected]) .content-region .end {
236
- fill: ${SystemColors.HighlightText};
216
+ :host([disabled][selected]) .positioning-region .content-region {
217
+ color: ${SystemColors.GrayText};
237
218
  }
238
219
  :host([selected])::after {
239
- background: ${SystemColors.Field};
220
+ background: ${SystemColors.HighlightText};
240
221
  }
241
222
  :host(:${focusVisible}) .positioning-region {
242
- border-color: ${SystemColors.FieldText};
243
- box-shadow: 0 0 0 2px inset ${SystemColors.Field};
244
- color: ${SystemColors.FieldText};
223
+ forced-color-adjust: none;
224
+ border-color: ${SystemColors.ButtonText};
225
+ box-shadow: 0 0 0 2px inset ${SystemColors.ButtonFace};
245
226
  }
227
+ :host([disabled]),
246
228
  :host([disabled]) .content-region,
247
229
  :host([disabled]) .positioning-region:hover .content-region {
248
230
  opacity: 1;
249
231
  color: ${SystemColors.GrayText};
250
232
  }
251
- :host([disabled]) .content-region .expand-collapse-glyph,
252
- :host([disabled]) .content-region .start,
253
- :host([disabled]) .content-region .end,
254
- :host([disabled]) .positioning-region:hover .content-region .expand-collapse-glyph,
255
- :host([disabled]) .positioning-region:hover .content-region .start,
256
- :host([disabled]) .positioning-region:hover .content-region .end {
257
- fill: ${SystemColors.GrayText};
258
- }
259
- :host([disabled]) .positioning-region:hover {
260
- background: ${SystemColors.Field};
261
- }
262
- .expand-collapse-glyph,
263
- .start,
264
- .end {
265
- fill: ${SystemColors.FieldText};
266
- }
267
- :host(.nested) .expand-collapse-button:hover {
268
- background: ${SystemColors.Field};
269
- }
270
- :host(.nested) .expand-collapse-button:hover .expand-collapse-glyph {
271
- fill: ${SystemColors.FieldText};
233
+ :host(.nested) .expand-collapse-button:hover,
234
+ :host(:not([disabled])[selected]) .expand-collapse-button:hover {
235
+ background: ${SystemColors.ButtonFace};
236
+ fill: ${SystemColors.ButtonText};
272
237
  }
273
238
  `));
@@ -3,31 +3,44 @@ export default {
3
3
  title: 'Components/Tree View',
4
4
  component: fluentTreeView,
5
5
  argTypes: {
6
- disabled: {
7
- control: { type: 'boolean' },
8
- },
9
6
  renderCollapsedNodes: {
10
7
  control: { type: 'boolean' },
11
8
  },
12
9
  },
13
10
  };
14
- const TreeViewTemplate = ({ disabled, renderCollapsedNodes }) => `
11
+ const TreeViewTemplate = ({ renderCollapsedNodes }) => `
15
12
  <style>
16
13
  div.docs-story>div:first-child {
17
- height: 22em !important;
14
+ height: 26em !important;
18
15
  }
19
16
  </style>
20
17
  <fluent-tree-view
21
- ${disabled ? 'disabled' : ''}
22
18
  ${renderCollapsedNodes ? `render-collapsed-nodes="${renderCollapsedNodes}` : ''}
23
19
  ">
24
20
  <fluent-tree-item>
25
21
  Root item 1
26
22
  <fluent-tree-item>
27
- Flowers
28
- <fluent-tree-item disabled>Daisy</fluent-tree-item>
29
- <fluent-tree-item>Sunflower</fluent-tree-item>
30
- <fluent-tree-item>Rose</fluent-tree-item>
23
+ Root item 1
24
+ <fluent-tree-item>
25
+ Flowers
26
+ <fluent-tree-item disabled>Daisy</fluent-tree-item>
27
+ <fluent-tree-item>
28
+ Sunflower
29
+ <svg slot="start" width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
30
+ <path
31
+ d="M12 5.5a1 1 0 100 2 1 1 0 000-2zm-5 1a1 1 0 112 0 1 1 0 01-2 0zm3.5-4a.5.5 0 00-1 0V3h-3C5.67 3 5 3.67 5 4.5v4c0 .83.67 1.5 1.5 1.5h7c.83 0 1.5-.67 1.5-1.5v-4c0-.83-.67-1.5-1.5-1.5h-3v-.5zM6.5 4h7c.28 0 .5.22.5.5v4a.5.5 0 01-.5.5h-7a.5.5 0 01-.5-.5v-4c0-.28.22-.5.5-.5zm3.75 14c2.62-.04 4.2-.6 5.12-1.44A3.52 3.52 0 0016.5 14h.01v-.69c0-1-.81-1.8-1.8-1.8h-3.2v-.01H5.3c-.99 0-1.8.81-1.8 1.81v.7c.04.77.25 1.75 1.13 2.55.93.84 2.5 1.4 5.12 1.44h.5zm-4.94-5.5h9.38c.45 0 .81.37.81.81v.44c0 .69-.13 1.46-.8 2.07C14 16.45 12.66 17 10 17s-4.01-.55-4.7-1.18a2.63 2.63 0 01-.8-2.07v-.44c0-.44.36-.8.8-.8z"
32
+ />
33
+ </svg>
34
+ <svg slot="end" width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
35
+ <path
36
+ d="M12 5.5a1 1 0 100 2 1 1 0 000-2zm-5 1a1 1 0 112 0 1 1 0 01-2 0zm3.5-4a.5.5 0 00-1 0V3h-3C5.67 3 5 3.67 5 4.5v4c0 .83.67 1.5 1.5 1.5h7c.83 0 1.5-.67 1.5-1.5v-4c0-.83-.67-1.5-1.5-1.5h-3v-.5zM6.5 4h7c.28 0 .5.22.5.5v4a.5.5 0 01-.5.5h-7a.5.5 0 01-.5-.5v-4c0-.28.22-.5.5-.5zm3.75 14c2.62-.04 4.2-.6 5.12-1.44A3.52 3.52 0 0016.5 14h.01v-.69c0-1-.81-1.8-1.8-1.8h-3.2v-.01H5.3c-.99 0-1.8.81-1.8 1.81v.7c.04.77.25 1.75 1.13 2.55.93.84 2.5 1.4 5.12 1.44h.5zm-4.94-5.5h9.38c.45 0 .81.37.81.81v.44c0 .69-.13 1.46-.8 2.07C14 16.45 12.66 17 10 17s-4.01-.55-4.7-1.18a2.63 2.63 0 01-.8-2.07v-.44c0-.44.36-.8.8-.8z"
37
+ />
38
+ </svg>
39
+ </fluent-tree-item>
40
+ <fluent-tree-item>Rose</fluent-tree-item>
41
+ </fluent-tree-item>
42
+ <fluent-tree-item>Nested item 2</fluent-tree-item>
43
+ <fluent-tree-item>Nested item 3</fluent-tree-item>
31
44
  </fluent-tree-item>
32
45
  <fluent-tree-item>Nested item 2</fluent-tree-item>
33
46
  <fluent-tree-item>Nested item 3</fluent-tree-item>
@@ -48,7 +61,6 @@ div.docs-story>div:first-child {
48
61
  </fluent-tree-view>`;
49
62
  export const TreeView = TreeViewTemplate.bind({});
50
63
  TreeView.args = {
51
- disabled: false,
52
64
  renderCollapsedNodes: false,
53
65
  };
54
66
  const example = `