@fluentui/web-components 3.0.0-beta.10 → 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 (109) hide show
  1. package/CHANGELOG.md +20 -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/index.d.ts +3 -0
  9. package/dist/dts/toggle-button/toggle-button.d.ts +29 -26
  10. package/dist/dts/toggle-button/toggle-button.styles.d.ts +7 -0
  11. package/dist/dts/utils/behaviors/match-media-stylesheet-behavior.d.ts +124 -0
  12. package/dist/dts/utils/display.d.ts +17 -0
  13. package/dist/dts/utils/index.d.ts +2 -0
  14. package/dist/esm/accordion/accordion.styles.js +1 -1
  15. package/dist/esm/accordion/accordion.styles.js.map +1 -1
  16. package/dist/esm/accordion-item/accordion-item.styles.js +1 -1
  17. package/dist/esm/accordion-item/accordion-item.styles.js.map +1 -1
  18. package/dist/esm/anchor-button/anchor-button.styles.js +254 -3
  19. package/dist/esm/anchor-button/anchor-button.styles.js.map +1 -1
  20. package/dist/esm/avatar/avatar.styles.js +1 -1
  21. package/dist/esm/avatar/avatar.styles.js.map +1 -1
  22. package/dist/esm/button/button.definition.js +3 -4
  23. package/dist/esm/button/button.definition.js.map +1 -1
  24. package/dist/esm/button/button.js +233 -126
  25. package/dist/esm/button/button.js.map +1 -1
  26. package/dist/esm/button/button.options.js +10 -0
  27. package/dist/esm/button/button.options.js.map +1 -1
  28. package/dist/esm/button/button.styles.js +52 -55
  29. package/dist/esm/button/button.styles.js.map +1 -1
  30. package/dist/esm/button/button.template.js +13 -39
  31. package/dist/esm/button/button.template.js.map +1 -1
  32. package/dist/esm/checkbox/checkbox.styles.js +1 -1
  33. package/dist/esm/checkbox/checkbox.styles.js.map +1 -1
  34. package/dist/esm/compound-button/compound-button.definition.js +0 -3
  35. package/dist/esm/compound-button/compound-button.definition.js.map +1 -1
  36. package/dist/esm/compound-button/compound-button.styles.js +7 -7
  37. package/dist/esm/compound-button/compound-button.template.js +3 -39
  38. package/dist/esm/compound-button/compound-button.template.js.map +1 -1
  39. package/dist/esm/dialog/dialog.styles.js +1 -1
  40. package/dist/esm/dialog/dialog.styles.js.map +1 -1
  41. package/dist/esm/divider/divider.styles.js +1 -1
  42. package/dist/esm/divider/divider.styles.js.map +1 -1
  43. package/dist/esm/form-associated/form-associated.js.map +1 -1
  44. package/dist/esm/index.js +3 -0
  45. package/dist/esm/index.js.map +1 -1
  46. package/dist/esm/label/label.styles.js +1 -1
  47. package/dist/esm/label/label.styles.js.map +1 -1
  48. package/dist/esm/menu-button/menu-button.definition.js +0 -3
  49. package/dist/esm/menu-button/menu-button.definition.js.map +1 -1
  50. package/dist/esm/menu-button/menu-button.template.js +5 -1
  51. package/dist/esm/menu-button/menu-button.template.js.map +1 -1
  52. package/dist/esm/menu-item/menu-item.styles.js +1 -1
  53. package/dist/esm/menu-item/menu-item.styles.js.map +1 -1
  54. package/dist/esm/menu-list/menu-list.styles.js +1 -1
  55. package/dist/esm/menu-list/menu-list.styles.js.map +1 -1
  56. package/dist/esm/progress-bar/progress-bar.styles.js +1 -1
  57. package/dist/esm/progress-bar/progress-bar.styles.js.map +1 -1
  58. package/dist/esm/radio/radio.styles.js +1 -1
  59. package/dist/esm/radio/radio.styles.js.map +1 -1
  60. package/dist/esm/radio-group/radio-group.styles.js +1 -1
  61. package/dist/esm/radio-group/radio-group.styles.js.map +1 -1
  62. package/dist/esm/slider/slider.styles.js +1 -1
  63. package/dist/esm/slider/slider.styles.js.map +1 -1
  64. package/dist/esm/spinner/spinner.styles.js +1 -1
  65. package/dist/esm/spinner/spinner.styles.js.map +1 -1
  66. package/dist/esm/styles/partials/badge.partials.js +1 -1
  67. package/dist/esm/styles/partials/badge.partials.js.map +1 -1
  68. package/dist/esm/switch/switch.styles.js +1 -1
  69. package/dist/esm/switch/switch.styles.js.map +1 -1
  70. package/dist/esm/tab/tab.styles.js +1 -1
  71. package/dist/esm/tab/tab.styles.js.map +1 -1
  72. package/dist/esm/tab-panel/tab-panel.styles.js +1 -1
  73. package/dist/esm/tab-panel/tab-panel.styles.js.map +1 -1
  74. package/dist/esm/tabs/tabs.styles.js +1 -1
  75. package/dist/esm/tabs/tabs.styles.js.map +1 -1
  76. package/dist/esm/text/text.styles.js +1 -1
  77. package/dist/esm/text/text.styles.js.map +1 -1
  78. package/dist/esm/text-input/text-input.styles.js +1 -1
  79. package/dist/esm/text-input/text-input.styles.js.map +1 -1
  80. package/dist/esm/toggle-button/toggle-button.definition.js +0 -3
  81. package/dist/esm/toggle-button/toggle-button.definition.js.map +1 -1
  82. package/dist/esm/toggle-button/toggle-button.js +42 -85
  83. package/dist/esm/toggle-button/toggle-button.js.map +1 -1
  84. package/dist/esm/toggle-button/toggle-button.styles.js +31 -26
  85. package/dist/esm/toggle-button/toggle-button.styles.js.map +1 -1
  86. package/dist/esm/utils/behaviors/match-media-stylesheet-behavior.js +142 -0
  87. package/dist/esm/utils/behaviors/match-media-stylesheet-behavior.js.map +1 -0
  88. package/dist/esm/utils/display.js +15 -0
  89. package/dist/esm/utils/display.js.map +1 -0
  90. package/dist/esm/utils/index.js +2 -0
  91. package/dist/esm/utils/index.js.map +1 -1
  92. package/dist/fluent-web-components.api.json +1213 -771
  93. package/dist/storybook/{284.0946b1fb.iframe.bundle.js → 289.703b1698.iframe.bundle.js} +2 -2
  94. package/dist/storybook/{284.0946b1fb.iframe.bundle.js.LICENSE.txt → 289.703b1698.iframe.bundle.js.LICENSE.txt} +1 -1
  95. package/dist/storybook/iframe.html +1 -1
  96. package/dist/storybook/main.d55b693e.iframe.bundle.js +2 -0
  97. package/dist/storybook/project.json +1 -1
  98. package/dist/web-components.d.ts +407 -219
  99. package/dist/web-components.js +807 -671
  100. package/dist/web-components.min.js +140 -139
  101. package/docs/api-report.md +107 -77
  102. package/package.json +4 -3
  103. package/playwright.config.ts +2 -3
  104. package/tensile.config.js +0 -2
  105. package/dist/dts/button/button.form-associated.d.ts +0 -14
  106. package/dist/esm/button/button.form-associated.js +0 -14
  107. package/dist/esm/button/button.form-associated.js.map +0 -1
  108. package/dist/storybook/main.b9de79ac.iframe.bundle.js +0 -2
  109. /package/dist/storybook/{main.b9de79ac.iframe.bundle.js.LICENSE.txt → main.d55b693e.iframe.bundle.js.LICENSE.txt} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,12 +1,30 @@
1
1
  # Change Log - @fluentui/web-components
2
2
 
3
- This log was last generated on Tue, 09 Apr 2024 04:07:57 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 23 Apr 2024 04:08:58 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [3.0.0-beta.12](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v3.0.0-beta.12)
8
+
9
+ Tue, 23 Apr 2024 04:08:58 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v3.0.0-beta.11..@fluentui/web-components_v3.0.0-beta.12)
11
+
12
+ ### Changes
13
+
14
+ - Use ElementInternals for Button components ([PR #30999](https://github.com/microsoft/fluentui/pull/30999) by 863023+radium-v@users.noreply.github.com)
15
+
16
+ ## [3.0.0-beta.11](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v3.0.0-beta.11)
17
+
18
+ Mon, 15 Apr 2024 04:09:34 GMT
19
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v3.0.0-beta.10..@fluentui/web-components_v3.0.0-beta.11)
20
+
21
+ ### Changes
22
+
23
+ - fix(web-components): remove final dependencies on fast-foundation ([PR #31009](https://github.com/microsoft/fluentui/pull/31009) by =)
24
+
7
25
  ## [3.0.0-beta.10](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v3.0.0-beta.10)
8
26
 
9
- Tue, 09 Apr 2024 04:07:57 GMT
27
+ Tue, 09 Apr 2024 04:08:05 GMT
10
28
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v3.0.0-beta.9..@fluentui/web-components_v3.0.0-beta.10)
11
29
 
12
30
  ### Changes
@@ -1,193 +1,276 @@
1
- import { ARIAGlobalStatesAndProperties, StartEnd } from '../patterns/index.js';
2
- import { FormAssociatedButton } from './button.form-associated.js';
3
- import { ButtonAppearance, ButtonShape, ButtonSize, ButtonType } from './button.options.js';
1
+ import { FASTElement } from '@microsoft/fast-element';
2
+ import { StartEnd } from '../patterns/index.js';
3
+ import type { ButtonAppearance, ButtonFormTarget, ButtonShape, ButtonSize } from './button.options.js';
4
+ import { ButtonType } from './button.options.js';
4
5
  /**
5
6
  * A Button Custom HTML Element.
6
- * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button | <button> element }.
7
+ * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button | `<button>`} element.
7
8
  *
8
9
  * @slot start - Content which can be provided before the button content
9
10
  * @slot end - Content which can be provided after the button content
10
11
  * @slot - The default slot for button content
11
- * @csspart control - The button element
12
- * @csspart content - The element wrapping button content
12
+ * @csspart content - The button content container
13
13
  *
14
14
  * @public
15
15
  */
16
- export declare class Button extends FormAssociatedButton {
16
+ export declare class Button extends FASTElement {
17
17
  /**
18
- * Determines if the element should receive document focus on page load.
18
+ * Indicates the styled appearance of the button.
19
19
  *
20
20
  * @public
21
21
  * @remarks
22
- * HTML Attribute: autofocus
22
+ * HTML Attribute: `appearance`
23
+ */
24
+ appearance?: ButtonAppearance;
25
+ /**
26
+ * Indicates the button should be focused when the page is loaded.
27
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#autofocus | `autofocus`} attribute
28
+ *
29
+ * @public
30
+ * @remarks
31
+ * HTML Attribute: `autofocus`
23
32
  */
24
33
  autofocus: boolean;
25
34
  /**
26
- * The id of a form to associate the element to.
35
+ * Default slotted content.
36
+ *
37
+ * @public
38
+ */
39
+ defaultSlottedContent: HTMLElement[];
40
+ /**
41
+ * Sets the element's disabled state.
42
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#disabled | `disabled`} attribute
27
43
  *
28
44
  * @public
29
45
  * @remarks
30
- * HTML Attribute: form
46
+ * HTML Attribute: `disabled`
31
47
  */
32
- formId: string;
48
+ disabled?: boolean;
33
49
  /**
34
- * See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button | <button> element} for more details.
50
+ * Indicates that the button is focusable while disabled.
35
51
  *
36
52
  * @public
37
53
  * @remarks
38
- * HTML Attribute: formaction
54
+ * HTML Attribute: `disabled-focusable`
55
+ */
56
+ disabledFocusable: boolean;
57
+ /**
58
+ * Sets the element's internal disabled state when the element is focusable while disabled.
59
+ *
60
+ * @param previous - the previous disabledFocusable value
61
+ * @param next - the current disabledFocusable value
62
+ * @internal
63
+ */
64
+ disabledFocusableChanged(previous: boolean, next: boolean): void;
65
+ /**
66
+ * The internal {@link https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
67
+ *
68
+ * @internal
69
+ */
70
+ protected elementInternals: ElementInternals;
71
+ /**
72
+ * The associated form element.
73
+ *
74
+ * @public
39
75
  */
40
- formaction: string;
41
- protected formactionChanged(): void;
76
+ get form(): HTMLFormElement | null;
42
77
  /**
43
- * See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button | <button> element} for more details.
78
+ * The URL that processes the form submission.
79
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#formaction | `formaction`} attribute
44
80
  *
45
81
  * @public
46
82
  * @remarks
47
- * HTML Attribute: formenctype
83
+ * HTML Attribute: `formaction`
48
84
  */
49
- formenctype: string;
50
- protected formenctypeChanged(): void;
85
+ formAction?: string;
51
86
  /**
52
- * See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button | <button> element} for more details.
87
+ * The form-associated flag.
88
+ * @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-face-example | Form-associated custom elements}
89
+ *
90
+ * @public
91
+ */
92
+ static readonly formAssociated = true;
93
+ /**
94
+ * The id of a form to associate the element to.
95
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#form | `form`} attribute
53
96
  *
54
97
  * @public
55
98
  * @remarks
56
- * HTML Attribute: formmethod
99
+ * HTML Attribute: `form`
57
100
  */
58
- formmethod: string;
59
- protected formmethodChanged(): void;
101
+ formAttribute?: string;
60
102
  /**
61
- * See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button | <button> element} for more details.
103
+ * The encoding type for the form submission.
104
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#formenctype | `formenctype`} attribute
62
105
  *
63
106
  * @public
64
107
  * @remarks
65
- * HTML Attribute: formnovalidate
108
+ * HTML Attribute: `formenctype`
66
109
  */
67
- formnovalidate: boolean;
68
- protected formnovalidateChanged(): void;
110
+ formEnctype?: string;
69
111
  /**
70
- * See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button | <button> element} for more details.
112
+ * The HTTP method that the browser uses to submit the form.
113
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#formmethod | `formmethod`} attribute
71
114
  *
72
115
  * @public
73
116
  * @remarks
74
- * HTML Attribute: formtarget
117
+ * HTML Attribute: `formmethod`
75
118
  */
76
- formtarget: '_self' | '_blank' | '_parent' | '_top';
77
- protected formtargetChanged(): void;
119
+ formMethod?: string;
78
120
  /**
79
- * The button type.
121
+ * Indicates that the form will not be validated when submitted.
122
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#formnovalidate | `formnovalidate`} attribute
80
123
  *
81
124
  * @public
82
125
  * @remarks
83
- * HTML Attribute: type
126
+ * HTML Attribute: `formnovalidate`
84
127
  */
85
- type: ButtonType;
86
- protected typeChanged(previous: ButtonType | undefined, next: ButtonType): void;
128
+ formNoValidate?: boolean;
129
+ /**
130
+ * The internal form submission fallback control.
131
+ *
132
+ * @internal
133
+ */
134
+ private formSubmissionFallbackControl?;
135
+ /**
136
+ * The internal slot for the form submission fallback control.
137
+ *
138
+ * @internal
139
+ */
140
+ private formSubmissionFallbackControlSlot?;
141
+ /**
142
+ * The target frame or window to open the form submission in.
143
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#formtarget | `formtarget`} attribute
144
+ *
145
+ * @public
146
+ * @remarks
147
+ * HTML Attribute: `formtarget`
148
+ */
149
+ formTarget?: ButtonFormTarget;
87
150
  /**
88
- * The appearance the button should have.
151
+ * Indicates that the button should only display as an icon with no text content.
89
152
  *
90
153
  * @public
91
154
  * @remarks
92
- * HTML Attribute: appearance
155
+ * HTML Attribute: `icon-only`
156
+ */
157
+ iconOnly: boolean;
158
+ /**
159
+ * A reference to all associated label elements.
160
+ *
161
+ * @public
93
162
  */
94
- appearance?: ButtonAppearance | undefined;
163
+ get labels(): ReadonlyArray<Node>;
95
164
  /**
96
- * The shape the button should have.
165
+ * The name of the element. This element's value will be surfaced during form submission under the provided name.
166
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#name | `name`} attribute
97
167
  *
98
168
  * @public
99
169
  * @remarks
100
- * HTML Attribute: shape
170
+ * HTML Attribute: `name`
101
171
  */
102
- shape?: ButtonShape | undefined;
172
+ name?: string;
103
173
  /**
104
- * The size the button should have.
174
+ * The shape of the button.
105
175
  *
106
176
  * @public
107
177
  * @remarks
108
- * HTML Attribute: size
178
+ * HTML Attribute: `shape`
109
179
  */
110
- size?: ButtonSize;
180
+ shape?: ButtonShape;
111
181
  /**
112
- * The button has an icon only, no text content
182
+ * The size of the button.
113
183
  *
114
184
  * @public
115
185
  * @remarks
116
- * HTML Attribute: icon-only
186
+ * HTML Attribute: `size`
117
187
  */
118
- iconOnly: boolean;
188
+ size?: ButtonSize;
119
189
  /**
120
- * The button is disabled but focusable
190
+ * The button type.
191
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#type | `type`} attribute
121
192
  *
122
193
  * @public
123
194
  * @remarks
124
- * HTML Attribute: disabled-focusable
195
+ * HTML Attribute: `type`
125
196
  */
126
- disabledFocusable?: boolean;
127
- protected disabledFocusableChanged(prev: boolean, next: boolean): void;
197
+ type: ButtonType;
128
198
  /**
129
- * Prevents disabledFocusable click events
199
+ * Removes the form submission fallback control when the type changes.
200
+ *
201
+ * @param previous - the previous type value
202
+ * @param next - the new type value
203
+ * @internal
130
204
  */
131
- private handleDisabledFocusableClick;
205
+ typeChanged(previous: ButtonType, next: ButtonType): void;
132
206
  /**
207
+ * The value attribute.
133
208
  *
134
- * Default slotted content
209
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#value | `value`} attribute
135
210
  *
136
211
  * @public
137
212
  * @remarks
213
+ * HTML Attribute: `value`
138
214
  */
139
- defaultSlottedContent: HTMLElement[];
140
- /** {@inheritDoc (FormAssociated:interface).validate} */
141
- validate(): void;
215
+ value?: string;
142
216
  /**
217
+ * Handles the button click event.
218
+ *
219
+ * @param e - The event object
143
220
  * @internal
144
221
  */
222
+ clickHandler(e: Event): boolean | void;
145
223
  connectedCallback(): void;
146
- disconnectedCallback(): void;
224
+ constructor();
147
225
  /**
148
- * Submits the parent form
226
+ * This fallback creates a new slot, then creates a submit button to mirror the custom element's
227
+ * properties. The submit button is then appended to the slot and the form is submitted.
228
+ *
229
+ * @internal
230
+ * @privateRemarks
231
+ * This is a workaround until {@link https://github.com/WICG/webcomponents/issues/814 | WICG/webcomponents/issues/814} is resolved.
149
232
  */
150
- private handleSubmission;
233
+ private createAndInsertFormSubmissionFallbackControl;
151
234
  /**
152
- * Resets the parent form
235
+ * Invoked when a connected component's form or fieldset has its disabled state changed.
236
+ *
237
+ * @param disabled - the disabled value of the form / fieldset
238
+ *
239
+ * @internal
153
240
  */
154
- private handleFormReset;
155
- control: HTMLButtonElement;
156
- }
157
- /**
158
- * Includes ARIA states and properties relating to the ARIA button role
159
- *
160
- * @public
161
- */
162
- export declare class DelegatesARIAButton {
241
+ formDisabledCallback(disabled: boolean): void;
163
242
  /**
164
- * See {@link https://www.w3.org/WAI/PF/aria/roles#button} for more information
243
+ * Handles keypress events for the button.
244
+ *
245
+ * @param e - the keyboard event
246
+ * @returns - the return value of the click handler
165
247
  * @public
166
- * @remarks
167
- * HTML Attribute: aria-expanded
168
248
  */
169
- ariaExpanded: 'true' | 'false' | string | null;
249
+ keypressHandler(e: KeyboardEvent): boolean | void;
170
250
  /**
171
- * See {@link https://www.w3.org/WAI/PF/aria/roles#button} for more information
251
+ * Presses the button.
252
+ *
172
253
  * @public
173
- * @remarks
174
- * HTML Attribute: aria-pressed
175
254
  */
176
- ariaPressed: 'true' | 'false' | 'mixed' | string | null;
255
+ protected press(): void;
256
+ /**
257
+ * Resets the associated form.
258
+ *
259
+ * @public
260
+ */
261
+ resetForm(): void;
262
+ /**
263
+ * Submits the associated form.
264
+ *
265
+ * @internal
266
+ */
267
+ private submitForm;
177
268
  }
178
269
  /**
179
- * Mark internal because exporting class and interface of the same name
180
- * confuses API documenter.
181
- * TODO: https://github.com/microsoft/fast/issues/3317
182
270
  * @internal
183
- */
184
- export interface DelegatesARIAButton extends ARIAGlobalStatesAndProperties {
185
- }
186
- /**
187
- * Mark internal because exporting class and interface of the same name
188
- * confuses API documenter.
271
+ * @privateRemarks
272
+ * Mark internal because exporting class and interface of the same name confuses API documenter.
189
273
  * TODO: https://github.com/microsoft/fast/issues/3317
190
- * @internal
191
274
  */
192
- export interface Button extends StartEnd, DelegatesARIAButton {
275
+ export interface Button extends StartEnd {
193
276
  }
@@ -1,7 +1,9 @@
1
1
  import { Button } from './button.js';
2
2
  /**
3
+ * The definition for the Fluent Button component.
4
+ *
3
5
  * @public
4
6
  * @remarks
5
- * HTML Element: \<fluent-button\>
7
+ * HTML Element: `<fluent-button>`
6
8
  */
7
9
  export declare const definition: import("@microsoft/fast-element").FASTElementDefinition<typeof Button>;
@@ -62,7 +62,22 @@ export declare const ButtonType: {
62
62
  */
63
63
  export declare type ButtonType = ValuesOf<typeof ButtonType>;
64
64
  /**
65
- * Button configuration options
65
+ * Button configuration options.
66
66
  * @public
67
67
  */
68
68
  export declare type ButtonOptions = StartEndOptions<Button>;
69
+ /**
70
+ * Button `formtarget` attribute values.
71
+ * @public
72
+ */
73
+ export declare const ButtonFormTarget: {
74
+ readonly blank: "_blank";
75
+ readonly self: "_self";
76
+ readonly parent: "_parent";
77
+ readonly top: "_top";
78
+ };
79
+ /**
80
+ * Types for the `formtarget` attribute values.
81
+ * @public
82
+ */
83
+ export declare type ButtonFormTarget = ValuesOf<typeof ButtonFormTarget>;
@@ -1 +1,6 @@
1
+ /**
2
+ * The styles for the Button component.
3
+ *
4
+ * @public
5
+ */
1
6
  export declare const styles: import("@microsoft/fast-element").ElementStyles;
@@ -2,8 +2,14 @@ import { ElementViewTemplate } from '@microsoft/fast-element';
2
2
  import type { Button } from './button.js';
3
3
  import { ButtonOptions } from './button.options.js';
4
4
  /**
5
- * The template for the Button component.
5
+ * Generates a template for the Button component.
6
+ *
6
7
  * @public
7
8
  */
8
9
  export declare function buttonTemplate<T extends Button>(options?: ButtonOptions): ElementViewTemplate<T>;
10
+ /**
11
+ * The template for the Button component.
12
+ *
13
+ * @public
14
+ */
9
15
  export declare const template: ElementViewTemplate<Button>;
@@ -1,77 +1,4 @@
1
1
  import type { Constructable, FASTElement } from '@microsoft/fast-element';
2
- /**
3
- * This file enables typing support for ElementInternals APIs.
4
- * It is largely taken from https://github.com/microsoft/TSJS-lib-generator/pull/818/files.
5
- *
6
- * When TypeScript adds support for these APIs we can delete this file.
7
- */
8
- interface ValidityStateFlags {
9
- badInput?: boolean;
10
- customError?: boolean;
11
- patternMismatch?: boolean;
12
- rangeOverflow?: boolean;
13
- rangeUnderflow?: boolean;
14
- stepMismatch?: boolean;
15
- tooLong?: boolean;
16
- tooShort?: boolean;
17
- typeMismatch?: boolean;
18
- valueMissing?: boolean;
19
- }
20
- /**
21
- * Source:
22
- * https://html.spec.whatwg.org/multipage/custom-elements.html#elementinternals
23
- */
24
- interface ElementInternals {
25
- /**
26
- * Returns the form owner of internals target element.
27
- */
28
- readonly form: HTMLFormElement | null;
29
- /**
30
- * Returns a NodeList of all the label elements that internals target element is associated with.
31
- */
32
- readonly labels: NodeList;
33
- /**
34
- * Returns the error message that would be shown to the user if internals target element was to be checked for validity.
35
- */
36
- readonly validationMessage: string;
37
- /**
38
- * Returns the ValidityState object for internals target element.
39
- */
40
- readonly validity: ValidityState;
41
- /**
42
- * Returns true if internals target element will be validated when the form is submitted; false otherwise.
43
- */
44
- readonly willValidate: boolean;
45
- /**
46
- * Returns true if internals target element has no validity problems; false otherwise. Fires an invalid event at the element in the latter case.
47
- */
48
- checkValidity(): boolean;
49
- /**
50
- * Returns true if internals target element has no validity problems; otherwise,
51
- * returns false, fires an invalid event at the element, and (if the event isn't canceled) reports the problem to the user.
52
- */
53
- reportValidity(): boolean;
54
- /**
55
- * Sets both the state and submission value of internals target element to value.
56
- *
57
- * While "null" isn't enumerated as a argument type (here)[https://html.spec.whatwg.org/multipage/custom-elements.html#the-elementinternals-interface],
58
- * In practice it appears to remove the value from the form data on submission. Adding it as a valid type here
59
- * becuase that capability is required for checkbox and radio types
60
- */
61
- setFormValue(value: File | string | FormData | null, state?: File | string | FormData | null): void;
62
- /**
63
- * Marks internals target element as suffering from the constraints indicated by the flags argument,
64
- * and sets the element's validation message to message.
65
- * If anchor is specified, the user agent might use
66
- * it to indicate problems with the constraints of internals target
67
- * element when the form owner is validated interactively or reportValidity() is called.
68
- */
69
- setValidity(flags: ValidityStateFlags, message?: string, anchor?: HTMLElement): void;
70
- }
71
- declare let ElementInternals: {
72
- prototype: ElementInternals;
73
- new (): ElementInternals;
74
- };
75
2
  /**
76
3
  * @alpha
77
4
  */
@@ -175,4 +102,3 @@ export declare function FormAssociated<T extends ConstructableFormAssociated>(Ba
175
102
  * @beta
176
103
  */
177
104
  export declare function CheckableFormAssociated<T extends ConstructableFormAssociated>(BaseCtor: T): T;
178
- export {};
@@ -29,3 +29,6 @@ export * from './text-input/index.js';
29
29
  export * from './toggle-button/index.js';
30
30
  export * from './fluent-design-system.js';
31
31
  export * from './theme/index.js';
32
+ export * from './utils/direction.js';
33
+ export * from './utils/display.js';
34
+ export * from './utils/behaviors/match-media-stylesheet-behavior.js';
@@ -1,48 +1,51 @@
1
1
  import { Button } from '../button/button.js';
2
2
  /**
3
- * The base class used for constructing a fluent-toggle-button custom element
3
+ * The base class used for constructing a `<fluent-toggle-button>` custom element.
4
+ *
4
5
  * @public
5
6
  */
6
7
  export declare class ToggleButton extends Button {
7
8
  /**
8
- * Tracks whether the "checked" property has been changed.
9
- * This is necessary to provide consistent behavior with
10
- * normal input checkboxes
9
+ * Indicates the pressed state of the control.
10
+ *
11
+ * @public
12
+ * @remarks
13
+ * HTML Attribute: `pressed`
11
14
  */
12
- protected dirtyChecked: boolean;
15
+ pressed: boolean;
13
16
  /**
14
- * Provides the default checkedness of the input element
15
- * Passed down to proxy
17
+ * Updates the pressed state when the `pressed` property changes.
18
+ *
19
+ * @internal
20
+ */
21
+ protected pressedChanged(): void;
22
+ /**
23
+ * Indicates the mixed state of the control. This property takes precedence over `pressed`.
16
24
  *
17
25
  * @public
18
26
  * @remarks
19
- * HTML Attribute: checked
27
+ * HTML Attribute: `mixed`
20
28
  */
21
- checkedAttribute: boolean;
22
- protected checkedAttributeChanged(): void;
23
- defaultChecked: boolean;
24
- protected defaultCheckedChanged(): void;
29
+ mixed?: boolean;
25
30
  /**
26
- * The checked state of the control.
31
+ * Updates the pressed state when the `mixed` property changes.
27
32
  *
28
- * @public
33
+ * @param previous - the previous mixed state
34
+ * @param next - the current mixed state
35
+ * @internal
29
36
  */
30
- checked: boolean;
31
- protected checkedChanged(prev: boolean | undefined, next: boolean): void;
37
+ protected mixedChanged(): void;
32
38
  /**
33
- * The current checkedness of the element. This property serves as a mechanism
34
- * to set the `checked` property through both property assignment and the
35
- * .setAttribute() method. This is useful for setting the field's checkedness
36
- * in UI libraries that bind data through the .setAttribute() API
37
- * and don't support IDL attribute binding.
39
+ * Toggles the pressed state of the button.
40
+ *
41
+ * @override
38
42
  */
39
- currentChecked: boolean;
40
- currentCheckedChanged(prev: boolean | undefined, next: boolean): void;
41
- constructor();
43
+ protected press(): void;
42
44
  connectedCallback(): void;
43
- disconnectedCallback(): void;
44
45
  /**
46
+ * Sets the `aria-pressed` attribute based on the `pressed` and `mixed` properties.
47
+ *
45
48
  * @internal
46
49
  */
47
- protected handleToggleButtonClick: (e: MouseEvent) => void;
50
+ private setPressedState;
48
51
  }
@@ -1 +1,8 @@
1
+ /**
2
+ * The styles for the ToggleButton component.
3
+ *
4
+ * @public
5
+ * @privateRemarks
6
+ * TODO: Need to support icon hover styles
7
+ */
1
8
  export declare const styles: import("@microsoft/fast-element").ElementStyles;