@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,83 +2,79 @@ 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
4
  import { heightNumber } from '../../styles';
5
- import { accentFillRest, neutralFillRest, neutralForegroundHint } from '../../design-tokens';
5
+ import { accentFillRest, neutralForegroundHint } from '../../design-tokens';
6
6
  export const progressRingStyles = (context, definition) => css `
7
- ${display('flex')} :host {
8
- align-items: center;
9
- outline: none;
10
- height: calc(${heightNumber} * 1px);
11
- width: calc(${heightNumber} * 1px);
12
- margin: calc(${heightNumber} * 1px) 0;
13
- }
7
+ ${display('flex')} :host {
8
+ align-items: center;
9
+ outline: none;
10
+ height: calc(${heightNumber} * 1px);
11
+ width: calc(${heightNumber} * 1px);
12
+ }
14
13
 
15
- .progress {
16
- height: 100%;
17
- width: 100%;
18
- }
14
+ .progress {
15
+ height: 100%;
16
+ width: 100%;
17
+ }
19
18
 
20
- .background {
21
- stroke: ${neutralFillRest};
22
- fill: none;
23
- stroke-width: 2px;
24
- }
19
+ .background {
20
+ fill: none;
21
+ stroke-width: 2px;
22
+ }
25
23
 
26
- .determinate {
27
- stroke: ${accentFillRest};
28
- fill: none;
29
- stroke-width: 2px;
30
- stroke-linecap: round;
31
- transform-origin: 50% 50%;
32
- transform: rotate(-90deg);
33
- transition: all 0.2s ease-in-out;
34
- }
24
+ .determinate {
25
+ stroke: ${accentFillRest};
26
+ fill: none;
27
+ stroke-width: 2px;
28
+ stroke-linecap: round;
29
+ transform-origin: 50% 50%;
30
+ transform: rotate(-90deg);
31
+ transition: all 0.2s ease-in-out;
32
+ }
35
33
 
36
- .indeterminate-indicator-1 {
37
- stroke: ${accentFillRest};
38
- fill: none;
39
- stroke-width: 2px;
40
- stroke-linecap: round;
41
- transform-origin: 50% 50%;
42
- transform: rotate(-90deg);
43
- transition: all 0.2s ease-in-out;
44
- animation: spin-infinite 2s linear infinite;
45
- }
34
+ .indeterminate-indicator-1 {
35
+ stroke: ${accentFillRest};
36
+ fill: none;
37
+ stroke-width: 2px;
38
+ stroke-linecap: round;
39
+ transform-origin: 50% 50%;
40
+ transform: rotate(-90deg);
41
+ transition: all 0.2s ease-in-out;
42
+ animation: spin-infinite 2s linear infinite;
43
+ }
46
44
 
47
- :host(.paused) .indeterminate-indicator-1 {
48
- animation-play-state: paused;
49
- stroke: ${neutralFillRest};
50
- }
45
+ :host(.paused) .indeterminate-indicator-1 {
46
+ animation: none;
47
+ stroke: ${neutralForegroundHint};
48
+ }
51
49
 
52
- :host(.paused) .determinate {
53
- stroke: ${neutralForegroundHint};
54
- }
50
+ :host(.paused) .determinate {
51
+ stroke: ${neutralForegroundHint};
52
+ }
55
53
 
56
- @keyframes spin-infinite {
57
- 0% {
58
- stroke-dasharray: 0.01px 43.97px;
59
- transform: rotate(0deg);
54
+ @keyframes spin-infinite {
55
+ 0% {
56
+ stroke-dasharray: 0.01px 43.97px;
57
+ transform: rotate(0deg);
58
+ }
59
+ 50% {
60
+ stroke-dasharray: 21.99px 21.99px;
61
+ transform: rotate(450deg);
62
+ }
63
+ 100% {
64
+ stroke-dasharray: 0.01px 43.97px;
65
+ transform: rotate(1080deg);
66
+ }
67
+ }
68
+ `.withBehaviors(forcedColorsStylesheetBehavior(css `
69
+ .background {
70
+ stroke: ${SystemColors.Field};
60
71
  }
61
- 50% {
62
- stroke-dasharray: 21.99px 21.99px;
63
- transform: rotate(450deg);
72
+ .determinate,
73
+ .indeterminate-indicator-1 {
74
+ stroke: ${SystemColors.ButtonText};
64
75
  }
65
- 100% {
66
- stroke-dasharray: 0.01px 43.97px;
67
- transform: rotate(1080deg);
76
+ :host(.paused) .determinate,
77
+ :host(.paused) .indeterminate-indicator-1 {
78
+ stroke: ${SystemColors.GrayText};
68
79
  }
69
- }
70
- `.withBehaviors(forcedColorsStylesheetBehavior(css `
71
- .indeterminate-indicator-1,
72
- .determinate {
73
- stroke: ${SystemColors.FieldText};
74
- }
75
- .background {
76
- stroke: ${SystemColors.Field};
77
- }
78
- :host(.paused) .indeterminate-indicator-1 {
79
- stroke: ${SystemColors.Field};
80
- }
81
- :host(.paused) .determinate {
82
- stroke: ${SystemColors.GrayText};
83
- }
84
- `));
80
+ `));
@@ -14,7 +14,9 @@ export const fluentRadio = Radio.compose({
14
14
  template,
15
15
  styles,
16
16
  checkedIndicator: `
17
- <div part="checked-indicator" class="checked-indicator"></div>
17
+ <svg width="16" height="16" xmlns="http://www.w3.org/2000/svg">
18
+ <circle cx="8" cy="8" r="4"/>
19
+ </svg>
18
20
  `,
19
21
  });
20
22
  /**
@@ -15,15 +15,16 @@ export default {
15
15
  },
16
16
  },
17
17
  };
18
- const RadioTemplate = ({ checked, disabled, required }) => `
18
+ const RadioTemplate = ({ checked, disabled, required, label }) => `
19
19
  <fluent-radio
20
20
  ${checked ? 'checked' : ''}
21
21
  ${disabled ? 'disabled' : ''}
22
22
  ${required ? 'required' : ''}
23
- ></fluent-radio>
23
+ >${label}</fluent-radio>
24
24
  `;
25
25
  export const Radio = RadioTemplate.bind({});
26
26
  Radio.args = {
27
+ label: 'Label',
27
28
  checked: false,
28
29
  disabled: false,
29
30
  required: false,
@@ -2,13 +2,12 @@ import { css } from '@microsoft/fast-element';
2
2
  import { SystemColors } from '@microsoft/fast-web-utilities';
3
3
  import { disabledCursor, display, focusVisible, forcedColorsStylesheetBehavior, } from '@microsoft/fast-foundation';
4
4
  import { heightNumber } from '../styles';
5
- import { bodyFont, designUnit, disabledOpacity, fillColor, focusStrokeOuter, neutralFillInputActive, neutralFillInputHover, neutralFillInputRest, neutralForegroundRest, neutralStrokeStrongActive, neutralStrokeStrongHover, neutralStrokeStrongRest, strokeWidth, typeRampBaseFontSize, typeRampBaseLineHeight, } from '../design-tokens';
5
+ import { accentFillActive, accentFillHover, accentFillRest, bodyFont, designUnit, disabledOpacity, fillColor, focusStrokeOuter, foregroundOnAccentRest, neutralFillInputAltActive, neutralFillInputAltFocus, neutralFillInputAltHover, neutralFillInputAltRest, neutralForegroundRest, neutralStrokeStrongActive, neutralStrokeStrongHover, neutralStrokeStrongRest, strokeWidth, typeRampBaseFontSize, typeRampBaseLineHeight, } from '../design-tokens';
6
6
  export const radioStyles = (context, definition) => css `
7
7
  ${display('inline-flex')} :host {
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
@@ -26,7 +25,7 @@ export const radioStyles = (context, definition) => css `
26
25
  box-sizing: border-box;
27
26
  border-radius: 50%;
28
27
  border: calc(${strokeWidth} * 1px) solid ${neutralStrokeStrongRest};
29
- background: ${neutralFillInputRest};
28
+ background: ${neutralFillInputAltRest};
30
29
  outline: none;
31
30
  cursor: pointer;
32
31
  }
@@ -48,39 +47,56 @@ export const radioStyles = (context, definition) => css `
48
47
  }
49
48
 
50
49
  .control,
51
- .checked-indicator {
50
+ slot[name='checked-indicator'] {
52
51
  flex-shrink: 0;
53
52
  }
54
53
 
55
- .checked-indicator {
56
- position: absolute;
57
- top: 5px;
58
- left: 5px;
59
- right: 5px;
60
- bottom: 5px;
61
- border-radius: 50%;
62
- display: inline-block;
63
- background: ${neutralForegroundRest};
64
- fill: ${neutralForegroundRest};
54
+ slot[name='checked-indicator'] {
55
+ display: flex;
56
+ align-items: center;
57
+ justify-content: center;
58
+ width: 100%;
59
+ height: 100%;
60
+ fill: ${foregroundOnAccentRest};
65
61
  opacity: 0;
66
62
  pointer-events: none;
67
63
  }
68
64
 
69
- :host(:enabled) .control:hover {
70
- background: ${neutralFillInputHover};
65
+ :host(:not(.disabled):hover) .control {
66
+ background: ${neutralFillInputAltHover};
71
67
  border-color: ${neutralStrokeStrongHover};
72
68
  }
73
69
 
74
- :host(:enabled) .control:active {
75
- background: ${neutralFillInputActive};
70
+ :host(:not(.disabled):active) .control {
71
+ background: ${neutralFillInputAltActive};
76
72
  border-color: ${neutralStrokeStrongActive};
77
73
  }
78
74
 
75
+ :host(:not(.disabled):active) slot[name='checked-indicator'] {
76
+ opacity: 1;
77
+ }
78
+
79
79
  :host(:${focusVisible}) .control {
80
- box-shadow: 0 0 0 2px ${fillColor}, 0 0 0 4px ${focusStrokeOuter};
80
+ box-shadow: 0 0 0 1px ${fillColor}, 0 0 0 3px ${focusStrokeOuter};
81
+ background: ${neutralFillInputAltFocus};
81
82
  border-color: ${focusStrokeOuter};
82
83
  }
83
84
 
85
+ :host(.checked) .control {
86
+ background: ${accentFillRest};
87
+ border-color: transparent;
88
+ }
89
+
90
+ :host(.checked:not(.disabled):hover) .control {
91
+ background: ${accentFillHover};
92
+ border-color: transparent;
93
+ }
94
+
95
+ :host(.checked:not(.disabled):active) .control {
96
+ background: ${accentFillActive};
97
+ border-color: transparent;
98
+ }
99
+
84
100
  :host(.disabled) .label,
85
101
  :host(.readonly) .label,
86
102
  :host(.readonly) .control,
@@ -88,7 +104,7 @@ export const radioStyles = (context, definition) => css `
88
104
  cursor: ${disabledCursor};
89
105
  }
90
106
 
91
- :host(.checked) .checked-indicator {
107
+ :host(.checked) slot[name='checked-indicator'] {
92
108
  opacity: 1;
93
109
  }
94
110
 
@@ -97,52 +113,46 @@ export const radioStyles = (context, definition) => css `
97
113
  }
98
114
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
99
115
  .control {
100
- forced-color-adjust: none;
101
- border-color: ${SystemColors.FieldText};
102
116
  background: ${SystemColors.Field};
117
+ border-color: ${SystemColors.FieldText};
103
118
  }
104
- :host(:enabled) .control:hover,
105
- .control:active {
119
+ :host(:not(.disabled):hover) .control,
120
+ :host(:not(.disabled):active) .control {
106
121
  border-color: ${SystemColors.Highlight};
107
- background: ${SystemColors.Field};
108
122
  }
109
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};
110
127
  border-color: ${SystemColors.Highlight};
111
- box-shadow: 0 0 0 2px ${SystemColors.Field}, 0 0 0 4px ${SystemColors.FieldText};
112
- }
113
- :host(.checked:${focusVisible}:enabled) .control {
114
- border-color: ${SystemColors.Highlight};
115
- box-shadow: 0 0 0 2px ${SystemColors.Field}, 0 0 0 4px ${SystemColors.FieldText};
116
128
  }
117
- :host(.checked:enabled) .control:hover,
118
- .control:active {
129
+ :host(.checked:not(.disabled):hover) .control,
130
+ :host(.checked:not(.disabled):active) .control {
119
131
  border-color: ${SystemColors.Highlight};
120
132
  background: ${SystemColors.Highlight};
121
133
  }
122
- :host(.checked) .checked-indicator {
123
- background: ${SystemColors.Highlight};
134
+ :host(.checked:${focusVisible}) .control {
135
+ box-shadow: 0 0 0 1px ${SystemColors.Field}, 0 0 0 3px ${SystemColors.FieldText};
136
+ }
137
+ :host(.checked) slot[name='checked-indicator'] {
124
138
  fill: ${SystemColors.Highlight};
125
139
  }
126
- :host(.checked) .control:hover .checked-indicator {
127
- background: ${SystemColors.HighlightText};
140
+ :host(.checked:hover) .control slot[name='checked-indicator'] {
128
141
  fill: ${SystemColors.HighlightText};
129
142
  }
130
143
  :host(.disabled) {
131
- forced-color-adjust: none;
132
144
  opacity: 1;
133
145
  }
134
146
  :host(.disabled) .label {
135
147
  color: ${SystemColors.GrayText};
136
148
  }
137
149
  :host(.disabled) .control,
138
- :host(.checked.disabled) .control:hover,
139
- .control:active {
150
+ :host(.checked.disabled) .control {
140
151
  background: ${SystemColors.Field};
141
152
  border-color: ${SystemColors.GrayText};
142
153
  }
143
- :host(.disabled) .checked-indicator,
144
- :host(.checked.disabled) .control:hover .checked-indicator {
154
+ :host(.disabled) slot[name='checked-indicator'],
155
+ :host(.checked.disabled) slot[name='checked-indicator'] {
145
156
  fill: ${SystemColors.GrayText};
146
- background: ${SystemColors.GrayText};
147
157
  }
148
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
 
@@ -1,6 +1,7 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { attr } from '@microsoft/fast-element';
3
3
  import { Select as FoundationSelect, selectTemplate as template } from '@microsoft/fast-foundation';
4
+ import { fillColor, neutralLayerFloating } from '../design-tokens';
4
5
  import { selectStyles as styles } from './select.styles';
5
6
  /**
6
7
  * The Fluent select class
@@ -24,6 +25,9 @@ export class Select extends FoundationSelect {
24
25
  if (!this.appearance) {
25
26
  this.appearance = 'outline';
26
27
  }
28
+ if (this.listbox) {
29
+ fillColor.setValueFor(this.listbox, neutralLayerFloating);
30
+ }
27
31
  }
28
32
  }
29
33
  __decorate([
@@ -45,15 +49,8 @@ export const fluentSelect = Select.compose({
45
49
  template,
46
50
  styles,
47
51
  indicator: `
48
- <svg
49
- class="select-indicator"
50
- part="select-indicator"
51
- viewBox="0 0 12 7"
52
- xmlns="http://www.w3.org/2000/svg"
53
- >
54
- <path
55
- d="M11.85.65c.2.2.2.5 0 .7L6.4 6.84a.55.55 0 01-.78 0L.14 1.35a.5.5 0 11.71-.7L6 5.8 11.15.65c.2-.2.5-.2.7 0z"
56
- />
52
+ <svg width="12" height="12" xmlns="http://www.w3.org/2000/svg">
53
+ <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"/>
57
54
  </svg>
58
55
  `,
59
56
  });
@@ -4,19 +4,27 @@ export default {
4
4
  title: 'Components/Select',
5
5
  component: fluentSelect,
6
6
  argTypes: {
7
+ appearance: {
8
+ options: ['filled', 'outlined', 'stealth'],
9
+ control: { type: 'radio' },
10
+ defaultValue: 'outlined',
11
+ },
7
12
  disabled: {
8
13
  control: { type: 'boolean' },
9
14
  },
10
15
  position: {
11
16
  options: ['above', 'below'],
12
17
  control: { type: 'radio' },
18
+ defaultValue: 'below',
13
19
  },
14
20
  },
15
21
  };
16
- const SelectTemplate = ({ disabled, position }) => `
17
- <fluent-select
22
+ const SelectTemplate = ({ appearance, disabled, position }) => `
23
+ <fluent-select
24
+ ${appearance ? `appearance="${appearance}"` : ''}
18
25
  ${disabled ? 'disabled' : ''}
19
26
  ${position ? `position="${position}"` : ''}
27
+ style="margin-bottom: 200px;"
20
28
  >
21
29
  <fluent-option>Option One</fluent-option>
22
30
  <fluent-option>Option Two</fluent-option>