@fluentui/web-components 3.0.0-beta.11 → 3.0.0-beta.12

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 (52) hide show
  1. package/CHANGELOG.md +11 -2
  2. package/dist/dts/button/button.d.ts +173 -90
  3. package/dist/dts/button/button.definition.d.ts +3 -1
  4. package/dist/dts/button/button.options.d.ts +16 -1
  5. package/dist/dts/button/button.styles.d.ts +5 -0
  6. package/dist/dts/button/button.template.d.ts +7 -1
  7. package/dist/dts/form-associated/form-associated.d.ts +0 -74
  8. package/dist/dts/toggle-button/toggle-button.d.ts +29 -26
  9. package/dist/dts/toggle-button/toggle-button.styles.d.ts +7 -0
  10. package/dist/esm/anchor-button/anchor-button.styles.js +254 -3
  11. package/dist/esm/anchor-button/anchor-button.styles.js.map +1 -1
  12. package/dist/esm/button/button.definition.js +3 -4
  13. package/dist/esm/button/button.definition.js.map +1 -1
  14. package/dist/esm/button/button.js +233 -126
  15. package/dist/esm/button/button.js.map +1 -1
  16. package/dist/esm/button/button.options.js +10 -0
  17. package/dist/esm/button/button.options.js.map +1 -1
  18. package/dist/esm/button/button.styles.js +51 -54
  19. package/dist/esm/button/button.styles.js.map +1 -1
  20. package/dist/esm/button/button.template.js +13 -39
  21. package/dist/esm/button/button.template.js.map +1 -1
  22. package/dist/esm/compound-button/compound-button.definition.js +0 -3
  23. package/dist/esm/compound-button/compound-button.definition.js.map +1 -1
  24. package/dist/esm/compound-button/compound-button.styles.js +7 -7
  25. package/dist/esm/compound-button/compound-button.template.js +3 -39
  26. package/dist/esm/compound-button/compound-button.template.js.map +1 -1
  27. package/dist/esm/form-associated/form-associated.js.map +1 -1
  28. package/dist/esm/menu-button/menu-button.definition.js +0 -3
  29. package/dist/esm/menu-button/menu-button.definition.js.map +1 -1
  30. package/dist/esm/menu-button/menu-button.template.js +5 -1
  31. package/dist/esm/menu-button/menu-button.template.js.map +1 -1
  32. package/dist/esm/toggle-button/toggle-button.definition.js +0 -3
  33. package/dist/esm/toggle-button/toggle-button.definition.js.map +1 -1
  34. package/dist/esm/toggle-button/toggle-button.js +42 -85
  35. package/dist/esm/toggle-button/toggle-button.js.map +1 -1
  36. package/dist/esm/toggle-button/toggle-button.styles.js +31 -26
  37. package/dist/esm/toggle-button/toggle-button.styles.js.map +1 -1
  38. package/dist/fluent-web-components.api.json +342 -673
  39. package/dist/storybook/iframe.html +1 -1
  40. package/dist/storybook/main.d55b693e.iframe.bundle.js +2 -0
  41. package/dist/storybook/project.json +1 -1
  42. package/dist/web-components.d.ts +250 -223
  43. package/dist/web-components.js +236 -229
  44. package/dist/web-components.min.js +51 -50
  45. package/docs/api-report.md +63 -79
  46. package/package.json +3 -2
  47. package/playwright.config.ts +2 -3
  48. package/dist/dts/button/button.form-associated.d.ts +0 -14
  49. package/dist/esm/button/button.form-associated.js +0 -14
  50. package/dist/esm/button/button.form-associated.js.map +0 -1
  51. package/dist/storybook/main.81e47c59.iframe.bundle.js +0 -2
  52. /package/dist/storybook/{main.81e47c59.iframe.bundle.js.LICENSE.txt → main.d55b693e.iframe.bundle.js.LICENSE.txt} +0 -0
@@ -1,11 +1,262 @@
1
1
  import { css } from '@microsoft/fast-element';
2
- import { styles as ButtonStyles } from '../button/button.styles.js';
2
+ import { borderRadiusCircular, borderRadiusLarge, borderRadiusMedium, borderRadiusNone, borderRadiusSmall, colorBrandBackground, colorBrandBackgroundHover, colorBrandBackgroundPressed, colorNeutralBackground1, colorNeutralBackground1Hover, colorNeutralBackground1Pressed, colorNeutralBackgroundDisabled, colorNeutralForeground1, colorNeutralForeground1Hover, colorNeutralForeground1Pressed, colorNeutralForeground2, colorNeutralForeground2BrandHover, colorNeutralForeground2BrandPressed, colorNeutralForeground2Hover, colorNeutralForeground2Pressed, colorNeutralForegroundDisabled, colorNeutralForegroundOnBrand, colorNeutralStroke1, colorNeutralStroke1Hover, colorNeutralStroke1Pressed, colorNeutralStrokeDisabled, colorStrokeFocus2, colorSubtleBackground, colorSubtleBackgroundHover, colorSubtleBackgroundPressed, colorTransparentBackground, colorTransparentBackgroundHover, colorTransparentBackgroundPressed, colorTransparentStroke, curveEasyEase, durationFaster, fontFamilyBase, fontSizeBase200, fontSizeBase300, fontSizeBase400, fontWeightRegular, fontWeightSemibold, lineHeightBase200, lineHeightBase300, lineHeightBase400, shadow2, shadow4, spacingHorizontalL, spacingHorizontalM, spacingHorizontalS, spacingHorizontalSNudge, spacingHorizontalXS, strokeWidthThick, strokeWidthThin, } from '../theme/design-tokens.js';
3
+ import { forcedColorsStylesheetBehavior } from '../utils/behaviors/match-media-stylesheet-behavior.js';
4
+ import { display } from '../utils/display.js';
3
5
  // Need to support icon hover styles
4
6
  export const styles = css `
5
- ${ButtonStyles}
7
+ ${display('inline-flex')}
8
+
9
+ :host {
10
+ --icon-spacing: ${spacingHorizontalSNudge};
11
+ contain: layout style;
12
+ vertical-align: middle;
13
+ }
14
+
15
+ :host .control {
16
+ display: inline-flex;
17
+ align-items: center;
18
+ box-sizing: border-box;
19
+ justify-content: center;
20
+ text-decoration-line: none;
21
+ margin: 0;
22
+ min-height: 32px;
23
+ outline-style: none;
24
+ background-color: ${colorNeutralBackground1};
25
+ color: ${colorNeutralForeground1};
26
+ border: ${strokeWidthThin} solid ${colorNeutralStroke1};
27
+ padding: 0 ${spacingHorizontalM};
28
+ min-width: 96px;
29
+ border-radius: ${borderRadiusMedium};
30
+ font-size: ${fontSizeBase300};
31
+ font-family: ${fontFamilyBase};
32
+ font-weight: ${fontWeightSemibold};
33
+ line-height: ${lineHeightBase300};
34
+ transition-duration: ${durationFaster};
35
+ transition-property: background, border, color;
36
+ transition-timing-function: ${curveEasyEase};
37
+ cursor: pointer;
38
+ }
6
39
 
7
40
  .content {
41
+ display: inherit;
8
42
  text-align: center;
9
43
  }
10
- `;
44
+
45
+ :host(:hover) .control {
46
+ background-color: ${colorNeutralBackground1Hover};
47
+ color: ${colorNeutralForeground1Hover};
48
+ border-color: ${colorNeutralStroke1Hover};
49
+ }
50
+
51
+ :host(:hover:active) .control {
52
+ background-color: ${colorNeutralBackground1Pressed};
53
+ border-color: ${colorNeutralStroke1Pressed};
54
+ color: ${colorNeutralForeground1Pressed};
55
+ outline-style: none;
56
+ }
57
+
58
+ :host .control:focus-visible {
59
+ border-color: ${colorTransparentStroke};
60
+ outline: ${strokeWidthThick}) solid ${colorTransparentStroke};
61
+ box-shadow: ${shadow4}, 0 0 0 2px ${colorStrokeFocus2};
62
+ }
63
+
64
+ @media screen and (prefers-reduced-motion: reduce) {
65
+ transition-duration: 0.01ms;
66
+ }
67
+
68
+ ::slotted(svg) {
69
+ font-size: 20px;
70
+ height: 20px;
71
+ width: 20px;
72
+ fill: currentColor;
73
+ }
74
+
75
+ [slot='start'],
76
+ ::slotted([slot='start']) {
77
+ margin-inline-end: var(--icon-spacing);
78
+ }
79
+
80
+ [slot='end'],
81
+ ::slotted([slot='end']) {
82
+ margin-inline-start: var(--icon-spacing);
83
+ }
84
+
85
+ :host([icon-only]) .control {
86
+ min-width: 32px;
87
+ max-width: 32px;
88
+ }
89
+
90
+ :host([size='small']) {
91
+ --icon-spacing: ${spacingHorizontalXS};
92
+ }
93
+
94
+ :host([size='small']) .control {
95
+ min-height: 24px;
96
+ min-width: 64px;
97
+ padding: 0 ${spacingHorizontalS};
98
+ border-radius: ${borderRadiusSmall};
99
+ font-size: ${fontSizeBase200};
100
+ line-height: ${lineHeightBase200};
101
+ font-weight: ${fontWeightRegular};
102
+ }
103
+
104
+ :host([size='small'][icon-only]) .control {
105
+ min-width: 24px;
106
+ max-width: 24px;
107
+ }
108
+
109
+ :host([size='large']) .control {
110
+ min-height: 40px;
111
+ border-radius: ${borderRadiusLarge};
112
+ padding: 0 ${spacingHorizontalL};
113
+ font-size: ${fontSizeBase400};
114
+ line-height: ${lineHeightBase400};
115
+ }
116
+
117
+ :host([size='large'][icon-only]) .control {
118
+ min-width: 40px;
119
+ max-width: 40px;
120
+ }
121
+
122
+ :host([size='large']) ::slotted(svg) {
123
+ font-size: 24px;
124
+ height: 24px;
125
+ width: 24px;
126
+ }
127
+
128
+ :host([shape='circular']) .control,
129
+ :host([shape='circular']) .control:focus-visible {
130
+ border-radius: ${borderRadiusCircular};
131
+ }
132
+
133
+ :host([shape='square']) .control,
134
+ :host([shape='square']) .control:focus-visible {
135
+ border-radius: ${borderRadiusNone};
136
+ }
137
+
138
+ :host([appearance='primary']) .control {
139
+ background-color: ${colorBrandBackground};
140
+ color: ${colorNeutralForegroundOnBrand};
141
+ border-color: transparent;
142
+ }
143
+
144
+ :host([appearance='primary']:hover) .control {
145
+ background-color: ${colorBrandBackgroundHover};
146
+ }
147
+
148
+ :host([appearance='primary']:hover) .control,
149
+ :host([appearance='primary']:hover:active) .control {
150
+ border-color: transparent;
151
+ color: ${colorNeutralForegroundOnBrand};
152
+ }
153
+
154
+ :host([appearance='primary']:hover:active) .control {
155
+ background-color: ${colorBrandBackgroundPressed};
156
+ }
157
+
158
+ :host([appearance='primary']) .control:focus-visible {
159
+ border-color: ${colorNeutralForegroundOnBrand};
160
+ box-shadow: ${shadow2}, 0 0 0 2px ${colorStrokeFocus2};
161
+ }
162
+
163
+ :host(is:([disabled][appearance='primary'], [disabled-focusabale][appearance="primary"])) .control,
164
+ :host(is:([disabled][appearance='primary'], [disabled-focusabale][appearance="primary"]):hover) .control,
165
+ :host(is:([disabled][appearance='primary'], [disabled-focusabale][appearance="primary"]):hover:active) .control {
166
+ border-color: transparent;
167
+ }
168
+
169
+ :host([appearance='outline']) .control {
170
+ background-color: ${colorTransparentBackground};
171
+ }
172
+
173
+ :host([appearance='outline']:hover) .control {
174
+ background-color: ${colorTransparentBackgroundHover};
175
+ }
176
+
177
+ :host([appearance='outline']:hover:active) .control {
178
+ background-color: ${colorTransparentBackgroundPressed};
179
+ }
180
+
181
+ :host(is:([disabled][appearance='outline'], [disabled-focusabale][appearance="outline"])) .control,
182
+ :host(is:([disabled][appearance='outline'], [disabled-focusabale][appearance="outline"]):hover) .control,
183
+ :host(is:([disabled][appearance='outline'], [disabled-focusabale][appearance="outline"]):hover:active) .control {
184
+ background-color: ${colorTransparentBackground};
185
+ }
186
+
187
+ :host([appearance='subtle']) .control {
188
+ background-color: ${colorSubtleBackground};
189
+ color: ${colorNeutralForeground2};
190
+ border-color: transparent;
191
+ }
192
+
193
+ :host([appearance='subtle']:hover) .control {
194
+ background-color: ${colorSubtleBackgroundHover};
195
+ color: ${colorNeutralForeground2Hover};
196
+ border-color: transparent;
197
+ }
198
+
199
+ :host([appearance='subtle']:hover:active) .control {
200
+ background-color: ${colorSubtleBackgroundPressed};
201
+ color: ${colorNeutralForeground2Pressed};
202
+ border-color: transparent;
203
+ }
204
+
205
+ :host(is:([disabled][appearance='subtle'], [disabled-focusabale][appearance="subtle"])) .control,
206
+ :host(is:([disabled][appearance='subtle'], [disabled-focusabale][appearance="subtle"]):hover) .control,
207
+ :host(is:([disabled][appearance='subtle'], [disabled-focusabale][appearance="subtle"]):hover:active) .control {
208
+ background-color: ${colorTransparentBackground};
209
+ border-color: transparent;
210
+ }
211
+
212
+ :host([appearance='subtle']:hover) ::slotted(svg) {
213
+ fill: ${colorNeutralForeground2BrandHover};
214
+ }
215
+
216
+ :host([appearance='subtle']:hover:active) ::slotted(svg) {
217
+ fill: ${colorNeutralForeground2BrandPressed};
218
+ }
219
+
220
+ :host([appearance='transparent']) .control {
221
+ background-color: ${colorTransparentBackground};
222
+ color: ${colorNeutralForeground2};
223
+ }
224
+
225
+ :host([appearance='transparent']:hover) .control {
226
+ background-color: ${colorTransparentBackgroundHover};
227
+ color: ${colorNeutralForeground2BrandHover};
228
+ }
229
+
230
+ :host([appearance='transparent']:hover:active) .control {
231
+ background-color: ${colorTransparentBackgroundPressed};
232
+ color: ${colorNeutralForeground2BrandPressed};
233
+ }
234
+
235
+ :host([appearance='transparent']) .control,
236
+ :host([appearance='transparent']:hover) .control,
237
+ :host([appearance='transparent']:hover:active) .control {
238
+ border-color: transparent;
239
+ }
240
+
241
+ :host(is:([disabled][appearance='transparent'], [disabled-focusabale][appearance="transparent"])) .control,
242
+ :host(is:([disabled][appearance='transparent'], [disabled-focusabale][appearance="transparent"]):hover) .control,
243
+ :host(is:([disabled][appearance='transparent'], [disabled-focusabale][appearance="transparent"]):hover:active) .control {
244
+ border-color: transparent;
245
+ background-color: ${colorTransparentBackground};
246
+ }
247
+
248
+ :host(:is([disabled], [disabled-focusable], [appearance][disabled], [appearance][disabled-focusable])) .control,
249
+ :host(:is([disabled], [disabled-focusable], [appearance][disabled], [appearance][disabled-focusable]):hover) .control,
250
+ :host(:is([disabled], [disabled-focusable], [appearance][disabled], [appearance][disabled-focusable]):hover:active)
251
+ .control {
252
+ background-color: ${colorNeutralBackgroundDisabled};
253
+ border-color: ${colorNeutralStrokeDisabled};
254
+ color: ${colorNeutralForegroundDisabled};
255
+ cursor: not-allowed;
256
+ }
257
+ `.withBehaviors(forcedColorsStylesheetBehavior(css `
258
+ :host([appearance='transparent']:hover) .control {
259
+ border-color: Highlight;
260
+ }
261
+ `));
11
262
  //# sourceMappingURL=anchor-button.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"anchor-button.styles.js","sourceRoot":"","sources":["../../../src/anchor-button/anchor-button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAEpE,oCAAoC;AACpC,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;IACrB,YAAY;;;;;CAKf,CAAC"}
1
+ {"version":3,"file":"anchor-button.styles.js","sourceRoot":"","sources":["../../../src/anchor-button/anchor-button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,2BAA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WAAW,sBAAsB;kBAC9C,OAAO,eAAe,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBA8BnC,mBAAmB;;;;;;iBAMxB,kBAAkB;qBACd,iBAAiB;iBACrB,eAAe;mBACb,iBAAiB;mBACjB,iBAAiB;;;;;;;;;;qBAUf,iBAAiB;iBACrB,kBAAkB;iBAClB,eAAe;mBACb,iBAAiB;;;;;;;;;;;;;;;;qBAgBf,oBAAoB;;;;;qBAKpB,gBAAgB;;;;wBAIb,oBAAoB;aAC/B,6BAA6B;;;;;wBAKlB,yBAAyB;;;;;;aAMpC,6BAA6B;;;;wBAIlB,2BAA2B;;;;oBAI/B,6BAA6B;kBAC/B,OAAO,eAAe,iBAAiB;;;;;;;;;;wBAUjC,0BAA0B;;;;wBAI1B,+BAA+B;;;;wBAI/B,iCAAiC;;;;;;wBAMjC,0BAA0B;;;;wBAI1B,qBAAqB;aAChC,uBAAuB;;;;;wBAKZ,0BAA0B;aACrC,4BAA4B;;;;;wBAKjB,4BAA4B;aACvC,8BAA8B;;;;;;;wBAOnB,0BAA0B;;;;;YAKtC,iCAAiC;;;;YAIjC,mCAAmC;;;;wBAIvB,0BAA0B;aACrC,uBAAuB;;;;wBAIZ,+BAA+B;aAC1C,iCAAiC;;;;wBAItB,iCAAiC;aAC5C,mCAAmC;;;;;;;;;;;;;wBAaxB,0BAA0B;;;;;;;wBAO1B,8BAA8B;oBAClC,0BAA0B;aACjC,8BAA8B;;;CAG1C,CAAC,aAAa,CACb,8BAA8B,CAAC,GAAG,CAAA;;;;GAIjC,CAAC,CACH,CAAC"}
@@ -3,16 +3,15 @@ import { Button } from './button.js';
3
3
  import { styles } from './button.styles.js';
4
4
  import { template } from './button.template.js';
5
5
  /**
6
+ * The definition for the Fluent Button component.
7
+ *
6
8
  * @public
7
9
  * @remarks
8
- * HTML Element: \<fluent-button\>
10
+ * HTML Element: `<fluent-button>`
9
11
  */
10
12
  export const definition = Button.compose({
11
13
  name: `${FluentDesignSystem.prefix}-button`,
12
14
  template,
13
15
  styles,
14
- shadowOptions: {
15
- delegatesFocus: true,
16
- },
17
16
  });
18
17
  //# sourceMappingURL=button.definition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.definition.js","sourceRoot":"","sources":["../../../src/button/button.definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC;IACvC,IAAI,EAAE,GAAG,kBAAkB,CAAC,MAAM,SAAS;IAC3C,QAAQ;IACR,MAAM;IACN,aAAa,EAAE;QACb,cAAc,EAAE,IAAI;KACrB;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"button.definition.js","sourceRoot":"","sources":["../../../src/button/button.definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC;IACvC,IAAI,EAAE,GAAG,kBAAkB,CAAC,MAAM,SAAS;IAC3C,QAAQ;IACR,MAAM;CACP,CAAC,CAAC"}