@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,29 +1,31 @@
1
1
  import { css } from '@microsoft/fast-element';
2
2
  import { SystemColors } from '@microsoft/fast-web-utilities';
3
- import { display, focusVisible, forcedColorsStylesheetBehavior } from '@microsoft/fast-foundation';
3
+ import { display, focusVisible, forcedColorsStylesheetBehavior, } from '@microsoft/fast-foundation';
4
4
  import { heightNumber } from '../size';
5
- import { accentFillActive, accentFillHover, accentFillRest, accentForegroundActive, accentForegroundHover, accentForegroundRest, bodyFont, controlCornerRadius, density, designUnit, focusStrokeInner, focusStrokeOuter, focusStrokeWidth, foregroundOnAccentActive, foregroundOnAccentHover, foregroundOnAccentRest, neutralFillActive, neutralFillHover, neutralFillRest, neutralFillStealthActive, neutralFillStealthHover, neutralFillStealthRest, neutralForegroundRest, neutralStrokeActive, neutralStrokeHover, neutralStrokeRest, strokeWidth, typeRampBaseFontSize, typeRampBaseLineHeight, } from '../../design-tokens';
5
+ import { accentFillActive, accentFillHover, accentFillRest, accentForegroundActive, accentForegroundHover, accentForegroundRest, accentStrokeControlActive, accentStrokeControlHover, accentStrokeControlRest, bodyFont, controlCornerRadius, density, designUnit, focusStrokeInner, focusStrokeOuter, focusStrokeWidth, foregroundOnAccentActive, foregroundOnAccentHover, foregroundOnAccentRest, neutralFillActive, neutralFillHover, neutralFillRest, neutralFillStealthActive, neutralFillStealthHover, neutralFillStealthRest, neutralForegroundRest, neutralStrokeActive, neutralStrokeControlActive, neutralStrokeControlHover, neutralStrokeControlRest, neutralStrokeHover, neutralStrokeRest, strokeWidth, typeRampBaseFontSize, typeRampBaseLineHeight, } from '../../design-tokens';
6
6
  /**
7
7
  * @internal
8
8
  */
9
- export const baseButtonStyles = (context, definition) => css `
9
+ export const baseButtonStyles = (context, definition, interactivitySelector = '', nonInteractivitySelector = '') => css `
10
10
  ${display('inline-flex')} :host {
11
+ position: relative;
12
+ box-sizing: border-box;
11
13
  font-family: ${bodyFont};
12
14
  outline: none;
13
15
  font-size: ${typeRampBaseFontSize};
14
16
  line-height: ${typeRampBaseLineHeight};
15
17
  height: calc(${heightNumber} * 1px);
16
18
  min-width: calc(${heightNumber} * 1px);
17
- background-color: ${neutralFillRest};
18
19
  color: ${neutralForegroundRest};
19
20
  border-radius: calc(${controlCornerRadius} * 1px);
20
21
  fill: currentcolor;
21
22
  cursor: pointer;
22
23
  }
23
24
 
24
- .control {
25
- background: transparent;
26
- height: inherit;
25
+ :host .control {
26
+ background: padding-box linear-gradient(${neutralFillRest}, ${neutralFillRest}),
27
+ border-box ${neutralStrokeControlRest};
28
+ border: calc(${strokeWidth} * 1px) solid transparent;
27
29
  flex-grow: 1;
28
30
  box-sizing: border-box;
29
31
  display: inline-flex;
@@ -33,7 +35,6 @@ export const baseButtonStyles = (context, definition) => css `
33
35
  white-space: nowrap;
34
36
  outline: none;
35
37
  text-decoration: none;
36
- border: calc(${strokeWidth} * 1px) solid transparent;
37
38
  color: inherit;
38
39
  border-radius: inherit;
39
40
  fill: inherit;
@@ -52,17 +53,23 @@ export const baseButtonStyles = (context, definition) => css `
52
53
  line-height: 0;
53
54
  }
54
55
 
55
- :host(:hover) {
56
- background-color: ${neutralFillHover};
56
+ :host .control${interactivitySelector}:hover {
57
+ background: padding-box linear-gradient(${neutralFillHover}, ${neutralFillHover}),
58
+ border-box ${neutralStrokeControlHover};
59
+ }
60
+
61
+ :host .control${interactivitySelector}:active {
62
+ background: padding-box linear-gradient(${neutralFillActive}, ${neutralFillActive}),
63
+ border-box ${neutralStrokeControlActive};
57
64
  }
58
65
 
59
- :host(:active) {
60
- background-color: ${neutralFillActive};
66
+ :host .control:${focusVisible} {
67
+ border-color: ${focusStrokeOuter} !important;
68
+ box-shadow: 0 0 0 calc((${focusStrokeWidth} - ${strokeWidth}) * 1px) ${focusStrokeOuter} inset !important;
61
69
  }
62
70
 
63
- .control:${focusVisible} {
64
- border: calc(${strokeWidth} * 1px) solid ${focusStrokeOuter};
65
- box-shadow: 0 0 0 calc((${focusStrokeWidth} - ${strokeWidth}) * 1px) ${focusStrokeOuter};
71
+ :host .control${nonInteractivitySelector} {
72
+ background: padding-box linear-gradient(${neutralFillRest}, ${neutralFillRest}), border-box ${neutralStrokeRest};
66
73
  }
67
74
 
68
75
  .control::-moz-focus-inner {
@@ -79,14 +86,6 @@ export const baseButtonStyles = (context, definition) => css `
79
86
  pointer-events: none;
80
87
  }
81
88
 
82
- ::slotted(svg) {
83
- ${
84
- /* Glyph size and margin-left is temporary -
85
- replace when adaptive typography is figured out */ ''} width: 16px;
86
- height: 16px;
87
- pointer-events: none;
88
- }
89
-
90
89
  .start {
91
90
  margin-inline-end: 11px;
92
91
  }
@@ -95,321 +94,302 @@ export const baseButtonStyles = (context, definition) => css `
95
94
  margin-inline-start: 11px;
96
95
  }
97
96
  `.withBehaviors(forcedColorsStylesheetBehavior(css `
98
- :host,
99
- :host([appearance="neutral"]) .control {
100
- background-color: ${SystemColors.ButtonFace};
97
+ :host .control {
98
+ background: ${SystemColors.ButtonFace};
101
99
  border-color: ${SystemColors.ButtonText};
102
100
  color: ${SystemColors.ButtonText};
103
101
  fill: currentcolor;
104
102
  }
105
-
106
- :host(:not([disabled][href]):hover),
107
- :host([appearance="neutral"]:not([disabled]):hover) .control {
103
+ :host(:not([disabled])) .control:hover,
104
+ :host .control${interactivitySelector}:hover,
105
+ .control${interactivitySelector}:hover {
108
106
  forced-color-adjust: none;
109
- background-color: ${SystemColors.Highlight};
107
+ background: ${SystemColors.Highlight};
110
108
  color: ${SystemColors.HighlightText};
111
109
  }
112
-
113
110
  .control:${focusVisible},
114
- :host([appearance="outline"]) .control:${focusVisible},
115
- :host([appearance="neutral"]:${focusVisible}) .control {
111
+ :host .control:${focusVisible},
112
+ :host(:${focusVisible}) .control {
116
113
  forced-color-adjust: none;
117
- background-color: ${SystemColors.Highlight};
118
- border-color: ${SystemColors.ButtonText};
119
- box-shadow: 0 0 0 calc((${focusStrokeWidth} - ${strokeWidth}) * 1px) ${SystemColors.ButtonText};
120
- color: ${SystemColors.HighlightText};
121
- }
122
-
123
- .control:not([disabled]):hover,
124
- :host([appearance="outline"]) .control:hover {
125
- border-color: ${SystemColors.ButtonText};
114
+ background: ${SystemColors.ButtonFace};
115
+ border-color: ${SystemColors.Highlight} !important;
116
+ box-shadow: 0 0 0 calc((${focusStrokeWidth} - ${strokeWidth}) * 1px) ${SystemColors.Highlight} !important;
126
117
  }
127
-
128
118
  :host([href]) .control {
119
+ background: ${SystemColors.ButtonFace};
129
120
  border-color: ${SystemColors.LinkText};
130
121
  color: ${SystemColors.LinkText};
122
+ fill: currentcolor;
131
123
  }
132
-
133
124
  :host([href]) .control:hover,
134
- :host(.neutral[href]) .control:hover,
135
- :host(.outline[href]) .control:hover,
125
+ :host(.neutral[href]) .control:hover {
126
+ background: ${SystemColors.LinkText};
127
+ border-color: ${SystemColors.LinkText} !important;
128
+ color: ${SystemColors.HighlightText};
129
+ fill: currentcolor;
130
+ }
136
131
  :host([href]) .control:${focusVisible}{
137
132
  forced-color-adjust: none;
133
+ border-color: ${SystemColors.LinkText} !important;
134
+ box-shadow: 0 0 0 calc((${focusStrokeWidth} - ${strokeWidth}) * 1px) ${SystemColors.LinkText} !important;
135
+ }
136
+ `));
137
+ /**
138
+ * @internal
139
+ */
140
+ export const AccentButtonStyles = (context, definition, interactivitySelector = '', nonInteractivitySelector = '') => css `
141
+ :host .control {
142
+ background: padding-box linear-gradient(${accentFillRest}, ${accentFillRest}),
143
+ border-box ${accentStrokeControlRest};
144
+ color: ${foregroundOnAccentRest};
145
+ }
146
+
147
+ :host .control${interactivitySelector}:hover {
148
+ background: padding-box linear-gradient(${accentFillHover}, ${accentFillHover}),
149
+ border-box ${accentStrokeControlHover};
150
+ color: ${foregroundOnAccentHover};
151
+ }
152
+
153
+ :host .control${interactivitySelector}:active {
154
+ background: padding-box linear-gradient(${accentFillActive}, ${accentFillActive}),
155
+ border-box ${accentStrokeControlActive};
156
+ color: ${foregroundOnAccentActive};
157
+ }
158
+
159
+ :host .control:${focusVisible} {
160
+ box-shadow: 0 0 0 calc((${focusStrokeWidth} - ${strokeWidth}) * 1px) ${focusStrokeOuter} inset,
161
+ 0 0 0 calc(((${focusStrokeWidth} + ${strokeWidth}) - ${strokeWidth}) * 1px) ${focusStrokeInner} inset !important;
162
+ }
163
+
164
+ :host .control${nonInteractivitySelector} {
165
+ background: ${accentFillRest};
166
+ }
167
+ `.withBehaviors(forcedColorsStylesheetBehavior(css `
168
+ :host .control {
169
+ forced-color-adjust: none;
170
+ background: ${SystemColors.Highlight};
171
+ color: ${SystemColors.HighlightText};
172
+ }
173
+ :host .control${interactivitySelector}:hover,
174
+ :host .control${interactivitySelector}:active {
175
+ background: ${SystemColors.HighlightText};
176
+ border-color: ${SystemColors.Highlight};
177
+ color: ${SystemColors.Highlight};
178
+ }
179
+ :host .control:${focusVisible} {
180
+ background: ${SystemColors.Highlight};
181
+ box-shadow: 0 0 0 calc((${focusStrokeWidth} - ${strokeWidth}) * 1px) ${SystemColors.Highlight} inset,
182
+ 0 0 0 calc(((${focusStrokeWidth} + ${strokeWidth}) - ${strokeWidth}) * 1px) ${SystemColors.HighlightText} inset !important;
183
+ }
184
+ :host([href]) .control {
185
+ background: ${SystemColors.LinkText};
186
+ color: ${SystemColors.HighlightText};
187
+ }
188
+ :host([href]) .control:hover {
138
189
  background: ${SystemColors.ButtonFace};
139
190
  border-color: ${SystemColors.LinkText};
140
- box-shadow: 0 0 0 1px ${SystemColors.LinkText} inset;
191
+ box-shadow: none;
141
192
  color: ${SystemColors.LinkText};
142
193
  fill: currentcolor;
143
194
  }
144
- `));
195
+ :host([href]) .control:${focusVisible} {
196
+ background: ${SystemColors.LinkText};
197
+ box-shadow: 0 0 0 calc((${focusStrokeWidth} - ${strokeWidth}) * 1px) ${SystemColors.LinkText} inset,
198
+ 0 0 0 calc(((${focusStrokeWidth} + ${strokeWidth}) - ${strokeWidth}) * 1px) ${SystemColors.HighlightText} inset !important;
199
+ color: ${SystemColors.HighlightText};
200
+ fill: currentcolor;
201
+ }
202
+ `));
145
203
  /**
146
204
  * @internal
147
205
  */
148
- export const AccentButtonStyles = css `
149
- :host([appearance='accent']) {
150
- background: ${accentFillRest};
151
- color: ${foregroundOnAccentRest};
152
- }
153
-
154
- :host([appearance='accent']:hover) {
155
- background: ${accentFillHover};
156
- color: ${foregroundOnAccentHover};
157
- }
158
-
159
- :host([appearance='accent']:active) .control:active {
160
- background: ${accentFillActive};
161
- color: ${foregroundOnAccentActive};
162
- }
163
-
164
- :host([appearance="accent"]) .control:${focusVisible} {
165
- box-shadow: 0 0 0 calc(${focusStrokeWidth} * 1px) inset ${focusStrokeInner},
166
- 0 0 0 calc((${focusStrokeWidth} - ${strokeWidth}) * 1px) ${focusStrokeOuter};
167
- }
168
- `.withBehaviors(forcedColorsStylesheetBehavior(css `
169
- :host([appearance='accent']) .control {
170
- forced-color-adjust: none;
171
- background: ${SystemColors.Highlight};
172
- color: ${SystemColors.HighlightText};
173
- }
206
+ export const HypertextStyles = (context, definition, interactivitySelector = '', nonInteractivitySelector = '') => css `
207
+ :host {
208
+ height: auto;
209
+ font-family: inherit;
210
+ font-size: inherit;
211
+ line-height: inherit;
212
+ min-width: 0;
213
+ }
174
214
 
175
- :host([appearance='accent']) .control:hover,
176
- :host([appearance='accent']:active) .control:active {
177
- background: ${SystemColors.HighlightText};
178
- border-color: ${SystemColors.Highlight};
179
- color: ${SystemColors.Highlight};
180
- }
215
+ :host .control {
216
+ display: inline;
217
+ padding: 0;
218
+ background: transparent;
219
+ border: none;
220
+ box-shadow: none;
221
+ line-height: 1;
222
+ text-decoration: underline 1px;
223
+ }
181
224
 
182
- :host([appearance="accent"]) .control:${focusVisible} {
183
- border-color: ${SystemColors.ButtonText};
184
- box-shadow: 0 0 0 2px ${SystemColors.HighlightText} inset;
185
- }
225
+ :host .control:not([href]) {
226
+ background: transparent;
227
+ }
186
228
 
187
- :host([appearance='accent'][href]) .control {
188
- background: ${SystemColors.LinkText};
189
- color: ${SystemColors.HighlightText};
190
- }
229
+ :host .control${interactivitySelector} {
230
+ background: transparent;
231
+ color: ${accentForegroundRest};
232
+ }
191
233
 
192
- :host([appearance='accent'][href]) .control:hover {
193
- background: ${SystemColors.ButtonFace};
194
- border-color: ${SystemColors.LinkText};
195
- box-shadow: none;
196
- color: ${SystemColors.LinkText};
197
- fill: currentcolor;
198
- }
234
+ :host .control${interactivitySelector}:hover {
235
+ background: transparent;
236
+ color: ${accentForegroundHover};
237
+ text-decoration: none;
238
+ }
199
239
 
200
- :host([appearance="accent"][href]) .control:${focusVisible} {
201
- border-color: ${SystemColors.LinkText};
202
- box-shadow: 0 0 0 2px ${SystemColors.HighlightText} inset;
240
+ :host .control${interactivitySelector}:active {
241
+ background: transparent;
242
+ color: ${accentForegroundActive};
243
+ text-decoration: none;
244
+ }
245
+
246
+ :host .control:${focusVisible} {
247
+ box-shadow: 0 0 0 calc(${focusStrokeWidth} * 1px) ${focusStrokeOuter} !important;
248
+ }
249
+
250
+ :host .control${nonInteractivitySelector} {
251
+ background: transparent;
252
+ }
253
+ `.withBehaviors(forcedColorsStylesheetBehavior(css `
254
+ :host .control${interactivitySelector}:hover {
255
+ color: ${SystemColors.Highlight};
256
+ fill: currentcolor;
203
257
  }
204
- `));
205
- /**
206
- * @internal
207
- */
208
- export const HypertextStyles = css `
209
- :host([appearance='hypertext']) {
210
- height: auto;
211
- font-size: inherit;
212
- line-height: inherit;
213
- background: transparent;
214
- min-width: 0;
215
- }
216
-
217
- :host([appearance='hypertext']) .control {
218
- display: inline;
219
- padding: 0;
220
- border: none;
221
- box-shadow: none;
222
- border-radius: 0;
223
- line-height: 1;
224
- }
225
- :host a.control:not(:link) {
226
- background-color: transparent;
227
- cursor: default;
228
- }
229
- :host([appearance='hypertext']) .control:link,
230
- :host([appearance='hypertext']) .control:visited {
231
- background: transparent;
232
- color: ${accentForegroundRest};
233
- border-bottom: calc(${strokeWidth} * 1px) solid ${accentForegroundRest};
234
- }
235
- :host([appearance='hypertext']) .control:hover {
236
- border-bottom-color: ${accentForegroundHover};
237
- }
238
- :host([appearance='hypertext']) .control:active {
239
- border-bottom-color: ${accentForegroundActive};
240
- }
241
- :host([appearance="hypertext"]) .control:${focusVisible} {
242
- border-bottom: calc(${focusStrokeWidth} * 1px) solid ${focusStrokeOuter};
243
- margin-bottom: calc(calc(${strokeWidth} - ${focusStrokeWidth}) * 1px);
244
- }
245
- `.withBehaviors(forcedColorsStylesheetBehavior(css `
246
- :host([appearance="hypertext"]) .control:${focusVisible} {
258
+ :host .control:${focusVisible} {
247
259
  color: ${SystemColors.LinkText};
248
- border-bottom-color: ${SystemColors.LinkText};
249
260
  }
250
- `));
261
+ `));
251
262
  /**
252
263
  * @internal
253
264
  */
254
- export const LightweightButtonStyles = css `
255
- :host([appearance='lightweight']) {
256
- background: transparent;
257
- color: ${accentForegroundRest};
258
- }
259
-
260
- :host([appearance='lightweight']) .control {
261
- padding: 0;
262
- height: initial;
263
- border: none;
264
- box-shadow: none;
265
- border-radius: 0;
266
- }
267
-
268
- :host([appearance='lightweight']:hover) {
269
- color: ${accentForegroundHover};
270
- }
271
-
272
- :host([appearance='lightweight']:active) {
273
- color: ${accentForegroundActive};
274
- }
275
-
276
- :host([appearance='lightweight']) .content {
277
- position: relative;
278
- }
279
-
280
- :host([appearance='lightweight']) .content::before {
281
- content: '';
282
- display: block;
283
- height: calc(${strokeWidth} * 1px);
284
- position: absolute;
285
- top: calc(1em + 3px);
286
- width: 100%;
287
- }
288
-
289
- :host([appearance='lightweight']:hover) .content::before {
290
- background: ${accentForegroundHover};
291
- }
292
-
293
- :host([appearance='lightweight']:active) .content::before {
294
- background: ${accentForegroundActive};
295
- }
296
-
297
- :host([appearance="lightweight"]) .control:${focusVisible} .content::before {
298
- background: ${neutralForegroundRest};
299
- height: calc(${focusStrokeWidth} * 1px);
300
- }
301
- `.withBehaviors(forcedColorsStylesheetBehavior(css `
302
- :host([appearance='lightweight']) {
303
- color: ${SystemColors.ButtonText};
304
- }
305
- :host([appearance="lightweight"]) .control:hover,
306
- :host([appearance="lightweight"]) .control:${focusVisible} {
307
- forced-color-adjust: none;
308
- background: ${SystemColors.ButtonFace};
309
- color: ${SystemColors.Highlight};
310
- }
311
- :host([appearance="lightweight"]) .control:hover .content::before,
312
- :host([appearance="lightweight"]) .control:${focusVisible} .content::before {
313
- background: ${SystemColors.Highlight};
314
- }
265
+ export const LightweightButtonStyles = (context, definition, interactivitySelector = '', nonInteractivitySelector = '') => css `
266
+ :host {
267
+ color: ${accentForegroundRest};
268
+ }
315
269
 
316
- :host([appearance="lightweight"][href]) .control:hover,
317
- :host([appearance="lightweight"][href]) .control:${focusVisible} {
318
- background: ${SystemColors.ButtonFace};
319
- box-shadow: none;
320
- color: ${SystemColors.LinkText};
321
- }
270
+ :host .control {
271
+ background: ${neutralFillStealthRest};
272
+ }
322
273
 
323
- :host([appearance="lightweight"][href]) .control:hover .content::before,
324
- :host([appearance="lightweight"][href]) .control:${focusVisible} .content::before {
325
- background: ${SystemColors.LinkText};
326
- }
327
- `));
274
+ :host .control${interactivitySelector}:hover {
275
+ background: ${neutralFillStealthHover};
276
+ color: ${accentForegroundHover};
277
+ }
278
+
279
+ :host .control${interactivitySelector}:active {
280
+ background: ${neutralFillStealthActive};
281
+ color: ${accentForegroundActive};
282
+ }
283
+
284
+ :host .control${nonInteractivitySelector} {
285
+ background: ${neutralFillStealthRest};
286
+ }
287
+ `.withBehaviors(forcedColorsStylesheetBehavior(css `
288
+ :host .control {
289
+ border-color: ${SystemColors.ButtonFace};
290
+ color: ${SystemColors.ButtonText};
291
+ }
292
+ :host .control${interactivitySelector}:hover,
293
+ :host .control${interactivitySelector}:active,
294
+ :host .control:${focusVisible} {
295
+ border-color: ${SystemColors.Highlight};
296
+ background: ${SystemColors.Highlight};
297
+ box-shadow: none;
298
+ color: ${SystemColors.HighlightText};
299
+ }
300
+ :host([href]) .control {
301
+ border-color: ${SystemColors.ButtonFace};
302
+ color: ${SystemColors.LinkText};
303
+ }
304
+ :host([href]) .control:hover,
305
+ :host([href]) .control:${focusVisible} {
306
+ background: ${SystemColors.ButtonFace};
307
+ box-shadow: none;
308
+ color: ${SystemColors.LinkText};
309
+ }
310
+ `));
328
311
  /**
329
312
  * @internal
330
313
  */
331
- export const OutlineButtonStyles = css `
332
- :host([appearance='outline']) {
333
- background: transparent;
334
- border-color: ${neutralStrokeRest};
335
- }
336
-
337
- :host([appearance='outline']:hover) {
338
- border-color: ${neutralStrokeHover};
339
- }
340
-
341
- :host([appearance='outline']:active) {
342
- border-color: ${neutralStrokeActive};
343
- }
344
-
345
- :host([appearance='outline']) .control {
346
- border-color: inherit;
347
- }
348
-
349
- :host([appearance="outline"]) .control:${focusVisible} {
350
- box-shadow: 0 0 0 calc((${focusStrokeWidth} - ${strokeWidth}) * 1px) ${focusStrokeOuter};
351
- border-color: ${focusStrokeOuter};
352
- }
353
- `.withBehaviors(forcedColorsStylesheetBehavior(css `
354
- :host([appearance='outline']) {
355
- border-color: ${SystemColors.ButtonText};
356
- }
357
- :host([appearance='outline'][href]) {
358
- border-color: ${SystemColors.LinkText};
359
- }
360
- `));
314
+ export const OutlineButtonStyles = (context, definition, interactivitySelector = '', nonInteractivitySelector = '') => css `
315
+ :host .control {
316
+ background: transparent !important;
317
+ border-color: ${neutralStrokeRest};
318
+ }
319
+
320
+ :host .control${interactivitySelector}:hover {
321
+ border-color: ${neutralStrokeHover};
322
+ }
323
+
324
+ :host .control${interactivitySelector}:active {
325
+ border-color: ${neutralStrokeActive};
326
+ }
327
+
328
+ :host .control${nonInteractivitySelector} {
329
+ background: transparent !important;
330
+ border-color: ${neutralStrokeRest};
331
+ }
332
+ `.withBehaviors(forcedColorsStylesheetBehavior(css `
333
+ :host .control${nonInteractivitySelector} {
334
+ border-color: ${SystemColors.ButtonText};
335
+ }
336
+ :host .control${interactivitySelector}:hover {
337
+ border-color: ${SystemColors.Highlight};
338
+ color: ${SystemColors.ButtonText};
339
+ }
340
+ :host([href]) {
341
+ border-color: ${SystemColors.LinkText};
342
+ }
343
+ :host([href]) .control:hover {
344
+ box-shadow: 0 0 0 calc((${focusStrokeWidth} - ${strokeWidth}) * 1px) ${SystemColors.LinkText};
345
+ color: ${SystemColors.LinkText};
346
+ }
347
+ `));
361
348
  /**
362
349
  * @internal
363
350
  */
364
- export const StealthButtonStyles = css `
365
- :host([appearance='stealth']) {
366
- background: ${neutralFillStealthRest};
367
- }
368
-
369
- :host([appearance='stealth']:hover) {
370
- background: ${neutralFillStealthHover};
371
- }
372
-
373
- :host([appearance='stealth']:active) {
374
- background: ${neutralFillStealthActive};
375
- }
376
- `.withBehaviors(forcedColorsStylesheetBehavior(css `
377
- :host([appearance='stealth']),
378
- :host([appearance='stealth']) .control {
379
- forced-color-adjust: none;
380
- background: ${SystemColors.ButtonFace};
381
- border-color: transparent;
382
- color: ${SystemColors.ButtonText};
383
- fill: currentcolor;
384
- }
385
-
386
- :host([appearance='stealth']:hover) .control {
387
- background: ${SystemColors.Highlight};
388
- border-color: ${SystemColors.Highlight};
389
- color: ${SystemColors.HighlightText};
390
- fill: currentcolor;
391
- }
392
-
393
- :host([appearance="stealth"]:${focusVisible}) .control {
394
- background: ${SystemColors.Highlight};
395
- box-shadow: 0 0 0 1px ${SystemColors.Highlight};
396
- color: ${SystemColors.HighlightText};
397
- fill: currentcolor;
398
- }
351
+ export const StealthButtonStyles = (context, definition, interactivitySelector = '', nonInteractivitySelector = '') => css `
352
+ :host .control {
353
+ background: ${neutralFillStealthRest};
354
+ }
399
355
 
400
- :host([appearance='stealth'][href]) .control {
401
- color: ${SystemColors.LinkText};
402
- }
356
+ :host .control${interactivitySelector}:hover {
357
+ background: ${neutralFillStealthHover};
358
+ }
403
359
 
404
- :host([appearance="stealth"]:hover[href]) .control,
405
- :host([appearance="stealth"]:${focusVisible}[href]) .control {
406
- background: ${SystemColors.LinkText};
407
- border-color: ${SystemColors.LinkText};
408
- color: ${SystemColors.HighlightText};
409
- fill: currentcolor;
410
- }
360
+ :host .control${interactivitySelector}:active {
361
+ background: ${neutralFillStealthActive};
362
+ }
411
363
 
412
- :host([appearance="stealth"]:${focusVisible}[href]) .control {
413
- box-shadow: 0 0 0 1px ${SystemColors.LinkText};
414
- }
415
- `));
364
+ :host .control${nonInteractivitySelector} {
365
+ background: ${neutralFillStealthRest};
366
+ }
367
+ `.withBehaviors(forcedColorsStylesheetBehavior(css `
368
+ :host .control {
369
+ background: ${SystemColors.ButtonFace};
370
+ border-color: ${SystemColors.ButtonFace};
371
+ color: ${SystemColors.ButtonText};
372
+ fill: currentcolor;
373
+ }
374
+ :host .control${interactivitySelector}:hover,
375
+ :host .control${interactivitySelector}:active,
376
+ :host .control:${focusVisible} {
377
+ background: ${SystemColors.Highlight};
378
+ border-color: ${SystemColors.Highlight};
379
+ box-shadow: none !important;
380
+ color: ${SystemColors.HighlightText};
381
+ fill: currentcolor;
382
+ }
383
+ :host([href]) .control {
384
+ border-color: ${SystemColors.ButtonFace};
385
+ color: ${SystemColors.LinkText};
386
+ }
387
+ :host([href]) .control:hover,
388
+ :host([href]) .control:${focusVisible} {
389
+ background: ${SystemColors.LinkText};
390
+ border-color: ${SystemColors.LinkText};
391
+ box-shadow: none !important;
392
+ color: ${SystemColors.HighlightText};
393
+ fill: currentcolor;
394
+ }
395
+ `));
@@ -1,2 +1,2 @@
1
1
  export * from './button.styles';
2
- export * from './input';
2
+ export * from './input.styles';