@fluentui/web-components 3.0.0-beta.76 → 3.0.0-beta.78

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 (154) hide show
  1. package/CHANGELOG.md +22 -2
  2. package/dist/dts/dropdown/define.d.ts +1 -0
  3. package/dist/dts/dropdown/dropdown.d.ts +492 -0
  4. package/dist/dts/dropdown/dropdown.definition.d.ts +9 -0
  5. package/dist/dts/dropdown/dropdown.options.d.ts +53 -0
  6. package/dist/dts/dropdown/dropdown.styles.d.ts +6 -0
  7. package/dist/dts/dropdown/dropdown.template.d.ts +38 -0
  8. package/dist/dts/dropdown/index.d.ts +5 -0
  9. package/dist/dts/index-rollup.d.ts +3 -0
  10. package/dist/dts/index.d.ts +3 -0
  11. package/dist/dts/listbox/define.d.ts +1 -0
  12. package/dist/dts/listbox/index.d.ts +5 -0
  13. package/dist/dts/listbox/listbox.d.ts +116 -0
  14. package/dist/dts/listbox/listbox.definition.d.ts +9 -0
  15. package/dist/dts/listbox/listbox.options.d.ts +10 -0
  16. package/dist/dts/listbox/listbox.styles.d.ts +6 -0
  17. package/dist/dts/listbox/listbox.template.d.ts +17 -0
  18. package/dist/dts/option/define.d.ts +1 -0
  19. package/dist/dts/option/index.d.ts +5 -0
  20. package/dist/dts/option/option.d.ts +260 -0
  21. package/dist/dts/option/option.definition.d.ts +9 -0
  22. package/dist/dts/option/option.options.d.ts +20 -0
  23. package/dist/dts/option/option.styles.d.ts +6 -0
  24. package/dist/dts/option/option.template.d.ts +16 -0
  25. package/dist/dts/patterns/start-end.d.ts +16 -2
  26. package/dist/dts/styles/states/index.d.ts +34 -0
  27. package/dist/dts/utils/element-internals.d.ts +3 -6
  28. package/dist/dts/utils/index.d.ts +1 -0
  29. package/dist/dts/utils/language.d.ts +9 -0
  30. package/dist/dts/utils/support.d.ts +15 -0
  31. package/dist/dts/utils/unique-id.d.ts +9 -0
  32. package/dist/esm/accordion/accordion.js +2 -3
  33. package/dist/esm/accordion/accordion.js.map +1 -1
  34. package/dist/esm/anchor-button/anchor-button.js +2 -4
  35. package/dist/esm/anchor-button/anchor-button.js.map +1 -1
  36. package/dist/esm/avatar/avatar.js +11 -12
  37. package/dist/esm/avatar/avatar.js.map +1 -1
  38. package/dist/esm/button/button.js +19 -23
  39. package/dist/esm/button/button.js.map +1 -1
  40. package/dist/esm/button/button.template.js +1 -1
  41. package/dist/esm/button/button.template.js.map +1 -1
  42. package/dist/esm/checkbox/checkbox.js +10 -11
  43. package/dist/esm/checkbox/checkbox.js.map +1 -1
  44. package/dist/esm/compound-button/compound-button.template.js +1 -1
  45. package/dist/esm/compound-button/compound-button.template.js.map +1 -1
  46. package/dist/esm/counter-badge/counter-badge.js +1 -2
  47. package/dist/esm/counter-badge/counter-badge.js.map +1 -1
  48. package/dist/esm/dialog-body/dialog-body.template.js +2 -2
  49. package/dist/esm/dialog-body/dialog-body.template.js.map +1 -1
  50. package/dist/esm/divider/divider.js +4 -5
  51. package/dist/esm/divider/divider.js.map +1 -1
  52. package/dist/esm/dropdown/define.js +4 -0
  53. package/dist/esm/dropdown/define.js.map +1 -0
  54. package/dist/esm/dropdown/dropdown.definition.js +20 -0
  55. package/dist/esm/dropdown/dropdown.definition.js.map +1 -0
  56. package/dist/esm/dropdown/dropdown.js +779 -0
  57. package/dist/esm/dropdown/dropdown.js.map +1 -0
  58. package/dist/esm/dropdown/dropdown.options.js +43 -0
  59. package/dist/esm/dropdown/dropdown.options.js.map +1 -0
  60. package/dist/esm/dropdown/dropdown.styles.js +213 -0
  61. package/dist/esm/dropdown/dropdown.styles.js.map +1 -0
  62. package/dist/esm/dropdown/dropdown.template.js +92 -0
  63. package/dist/esm/dropdown/dropdown.template.js.map +1 -0
  64. package/dist/esm/dropdown/index.js +6 -0
  65. package/dist/esm/dropdown/index.js.map +1 -0
  66. package/dist/esm/field/field.js +3 -4
  67. package/dist/esm/field/field.js.map +1 -1
  68. package/dist/esm/form-associated/form-associated.js +3 -5
  69. package/dist/esm/form-associated/form-associated.js.map +1 -1
  70. package/dist/esm/index-rollup.js +3 -0
  71. package/dist/esm/index-rollup.js.map +1 -1
  72. package/dist/esm/index.js +3 -0
  73. package/dist/esm/index.js.map +1 -1
  74. package/dist/esm/listbox/define.js +4 -0
  75. package/dist/esm/listbox/define.js.map +1 -0
  76. package/dist/esm/listbox/index.js +6 -0
  77. package/dist/esm/listbox/index.js.map +1 -0
  78. package/dist/esm/listbox/listbox.definition.js +17 -0
  79. package/dist/esm/listbox/listbox.definition.js.map +1 -0
  80. package/dist/esm/listbox/listbox.js +175 -0
  81. package/dist/esm/listbox/listbox.js.map +1 -0
  82. package/dist/esm/listbox/listbox.options.js +15 -0
  83. package/dist/esm/listbox/listbox.options.js.map +1 -0
  84. package/dist/esm/listbox/listbox.styles.js +26 -0
  85. package/dist/esm/listbox/listbox.styles.js.map +1 -0
  86. package/dist/esm/listbox/listbox.template.js +33 -0
  87. package/dist/esm/listbox/listbox.template.js.map +1 -0
  88. package/dist/esm/menu/menu.js +23 -32
  89. package/dist/esm/menu/menu.js.map +1 -1
  90. package/dist/esm/menu-item/menu-item.js +9 -14
  91. package/dist/esm/menu-item/menu-item.js.map +1 -1
  92. package/dist/esm/menu-list/menu-list.js +4 -5
  93. package/dist/esm/menu-list/menu-list.js.map +1 -1
  94. package/dist/esm/option/define.js +4 -0
  95. package/dist/esm/option/define.js.map +1 -0
  96. package/dist/esm/option/index.js +6 -0
  97. package/dist/esm/option/index.js.map +1 -0
  98. package/dist/esm/option/option.definition.js +17 -0
  99. package/dist/esm/option/option.definition.js.map +1 -0
  100. package/dist/esm/option/option.js +296 -0
  101. package/dist/esm/option/option.js.map +1 -0
  102. package/dist/esm/option/option.options.js +15 -0
  103. package/dist/esm/option/option.options.js.map +1 -0
  104. package/dist/esm/option/option.styles.js +127 -0
  105. package/dist/esm/option/option.styles.js.map +1 -0
  106. package/dist/esm/option/option.template.js +42 -0
  107. package/dist/esm/option/option.template.js.map +1 -0
  108. package/dist/esm/patterns/start-end.js +12 -0
  109. package/dist/esm/patterns/start-end.js.map +1 -1
  110. package/dist/esm/progress-bar/progress-bar.js +3 -4
  111. package/dist/esm/progress-bar/progress-bar.js.map +1 -1
  112. package/dist/esm/radio-group/radio-group.js +27 -38
  113. package/dist/esm/radio-group/radio-group.js.map +1 -1
  114. package/dist/esm/rating-display/rating-display.js +7 -13
  115. package/dist/esm/rating-display/rating-display.js.map +1 -1
  116. package/dist/esm/slider/slider.js +13 -16
  117. package/dist/esm/slider/slider.js.map +1 -1
  118. package/dist/esm/spinner/spinner.styles.js +4 -4
  119. package/dist/esm/styles/states/index.js +34 -0
  120. package/dist/esm/styles/states/index.js.map +1 -1
  121. package/dist/esm/switch/switch.styles.js +4 -0
  122. package/dist/esm/switch/switch.styles.js.map +1 -1
  123. package/dist/esm/tablist/tablist.js +5 -7
  124. package/dist/esm/tablist/tablist.js.map +1 -1
  125. package/dist/esm/tabs/tabs.js +5 -8
  126. package/dist/esm/tabs/tabs.js.map +1 -1
  127. package/dist/esm/text-input/text-input.js +13 -15
  128. package/dist/esm/text-input/text-input.js.map +1 -1
  129. package/dist/esm/textarea/textarea.js +20 -29
  130. package/dist/esm/textarea/textarea.js.map +1 -1
  131. package/dist/esm/theme/set-theme.js +1 -2
  132. package/dist/esm/theme/set-theme.js.map +1 -1
  133. package/dist/esm/tooltip/tooltip.js +13 -18
  134. package/dist/esm/tooltip/tooltip.js.map +1 -1
  135. package/dist/esm/utils/direction.js +1 -2
  136. package/dist/esm/utils/direction.js.map +1 -1
  137. package/dist/esm/utils/element-internals.js +8 -11
  138. package/dist/esm/utils/element-internals.js.map +1 -1
  139. package/dist/esm/utils/get-initials.js +2 -2
  140. package/dist/esm/utils/get-initials.js.map +1 -1
  141. package/dist/esm/utils/index.js +1 -0
  142. package/dist/esm/utils/index.js.map +1 -1
  143. package/dist/esm/utils/language.js +12 -0
  144. package/dist/esm/utils/language.js.map +1 -0
  145. package/dist/esm/utils/support.js +16 -0
  146. package/dist/esm/utils/support.js.map +1 -0
  147. package/dist/esm/utils/unique-id.js +14 -0
  148. package/dist/esm/utils/unique-id.js.map +1 -0
  149. package/dist/esm/utils/whitespace-filter.js +1 -1
  150. package/dist/esm/utils/whitespace-filter.js.map +1 -1
  151. package/dist/web-components.d.ts +1928 -862
  152. package/dist/web-components.js +1668 -448
  153. package/dist/web-components.min.js +344 -322
  154. package/package.json +1 -1
@@ -0,0 +1,116 @@
1
+ import { FASTElement } from '@microsoft/fast-element';
2
+ import type { BaseDropdown } from '../dropdown/dropdown.js';
3
+ import type { DropdownOption } from '../option/option.js';
4
+ /**
5
+ * A Listbox Custom HTML Element.
6
+ * Implements the {@link https://w3c.github.io/aria/#listbox | ARIA listbox } role.
7
+ *
8
+ * @slot - The default slot for the options.
9
+ * @emits connected - Dispatched when the element is connected to the DOM.
10
+ *
11
+ * @remarks
12
+ * The listbox component represents a list of options that can be selected.
13
+ * It is intended to be used in conjunction with the {@link BaseDropdown | Dropdown} component.
14
+ *
15
+ * @public
16
+ */
17
+ export declare class Listbox extends FASTElement {
18
+ /**
19
+ * Sets the listbox ID to a unique value if one is not provided.
20
+ *
21
+ * @override
22
+ * @public
23
+ * @remarks
24
+ * HTML Attribute: `id`
25
+ */
26
+ id: string;
27
+ /**
28
+ * Indicates whether the listbox allows multiple selection.
29
+ *
30
+ * @public
31
+ */
32
+ multiple?: boolean;
33
+ /**
34
+ * Updates the multiple selection state of the listbox and its options.
35
+ *
36
+ * @param prev - the previous multiple value
37
+ * @param next - the current multiple value
38
+ */
39
+ multipleChanged(prev: boolean | undefined, next: boolean | undefined): void;
40
+ /**
41
+ * The collection of all child options.
42
+ *
43
+ * @public
44
+ */
45
+ options: DropdownOption[];
46
+ /**
47
+ * Updates the enabled options collection when properties on the child options change.
48
+ *
49
+ * @param prev - the previous options
50
+ * @param next - the current options
51
+ *
52
+ * @internal
53
+ */
54
+ optionsChanged(prev: DropdownOption[] | undefined, next: DropdownOption[] | undefined): void;
55
+ /**
56
+ * The index of the first selected and enabled option.
57
+ * @internal
58
+ */
59
+ selectedIndex: number;
60
+ /**
61
+ * Reference to the parent dropdown element.
62
+ * @internal
63
+ */
64
+ dropdown?: BaseDropdown;
65
+ /**
66
+ * Handles the `beforetoggle` event on the listbox.
67
+ *
68
+ * @param e - the toggle event
69
+ * @returns true to allow the default popover behavior, undefined to prevent it
70
+ * @internal
71
+ */
72
+ beforetoggleHandler(e: ToggleEvent): boolean | undefined;
73
+ /**
74
+ * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
75
+ *
76
+ * @internal
77
+ */
78
+ elementInternals: ElementInternals;
79
+ /**
80
+ * The collection of child options that are not disabled.
81
+ *
82
+ * @internal
83
+ */
84
+ get enabledOptions(): DropdownOption[];
85
+ /**
86
+ * The collection of child options that are selected.
87
+ *
88
+ * @public
89
+ */
90
+ get selectedOptions(): DropdownOption[];
91
+ /**
92
+ * Sets the `selected` state on a target option when clicked.
93
+ *
94
+ * @param e - The pointer event
95
+ * @public
96
+ */
97
+ clickHandler(e: PointerEvent): boolean | void;
98
+ constructor();
99
+ connectedCallback(): void;
100
+ /**
101
+ * Handles observable subscriptions for the listbox.
102
+ *
103
+ * @param source - The source of the observed change
104
+ * @param propertyName - The name of the property that changed
105
+ *
106
+ * @internal
107
+ */
108
+ handleChange(source: any, propertyName?: string): void;
109
+ /**
110
+ * Selects an option by index.
111
+ *
112
+ * @param index - The index of the option to select.
113
+ * @public
114
+ */
115
+ selectOption(index?: number): void;
116
+ }
@@ -0,0 +1,9 @@
1
+ import { Listbox } from './listbox.js';
2
+ /**
3
+ * The Fluent Listbox Element
4
+ *
5
+ * @public
6
+ * @remarks
7
+ * HTML Element: `<fluent-listbox>`
8
+ */
9
+ export declare const definition: import("@microsoft/fast-element").FASTElementDefinition<typeof Listbox>;
@@ -0,0 +1,10 @@
1
+ import type { Listbox } from './listbox.js';
2
+ /**
3
+ * Predicate function that determines if the element should be considered a listbox.
4
+ *
5
+ * @param element - The element to check.
6
+ * @param tagName - The tag name to check.
7
+ * @returns true if the element is a listbox.
8
+ * @public
9
+ */
10
+ export declare function isListbox(element?: Node | null, tagName?: string): element is Listbox;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Styles for the {@link (Listbox:class)} component.
3
+ *
4
+ * @public
5
+ */
6
+ export declare const styles: import("@microsoft/fast-element").ElementStyles;
@@ -0,0 +1,17 @@
1
+ import { ElementViewTemplate } from '@microsoft/fast-element';
2
+ import type { Listbox } from './listbox.js';
3
+ /**
4
+ * Generates a template for the {@link (Dropdown:class)} component.
5
+ *
6
+ * @param options - The {@link (DropdownOptions:interface)} to use for generating the template.
7
+ * @returns The template object.
8
+ *
9
+ * @public
10
+ */
11
+ export declare function listboxTemplate<T extends Listbox>(): ElementViewTemplate<T>;
12
+ /**
13
+ * Template for the Listbox component.
14
+ *
15
+ * @public
16
+ */
17
+ export declare const template: ElementViewTemplate<Listbox>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ export { definition as DropdownOptionDefinition } from './option.definition.js';
2
+ export { DropdownOption } from './option.js';
3
+ export { isDropdownOption, type DropdownOptionOptions } from './option.options.js';
4
+ export { styles as DropdownOptionStyles } from './option.styles.js';
5
+ export { template as DropdownOptionTemplate } from './option.template.js';
@@ -0,0 +1,260 @@
1
+ import { FASTElement } from '@microsoft/fast-element';
2
+ import type { Start } from '../patterns/start-end.js';
3
+ /**
4
+ * A DropdownOption Custom HTML Element.
5
+ * Implements the {@link https://w3c.github.io/aria/#option | ARIA option } role.
6
+ *
7
+ * @slot - The default slot for the option's content.
8
+ * @slot checked-indicator - The checked indicator.
9
+ * @slot description - Optional description content.
10
+ *
11
+ * @remarks
12
+ * To support single and multiple selection modes with the {@link (BaseDropdown:class)} element, the Option element
13
+ * itself handles form association and value submission, rather than its parent Dropdown element. In this way, the
14
+ * Option element is a variation of the Checkbox element that is specifically designed for use in the Dropdown element.
15
+ *
16
+ * This class is named `DropdownOption` to avoid conflicts with the native `Option` global. Related constructs are also
17
+ * titled with `DropdownOption` to maintain consistency.
18
+ *
19
+ * @public
20
+ */
21
+ export declare class DropdownOption extends FASTElement implements Start {
22
+ /**
23
+ * Indicates that the option is active.
24
+ *
25
+ * @public
26
+ */
27
+ active: boolean;
28
+ /**
29
+ * Changes the active state of the option when the active property changes.
30
+ *
31
+ * @param prev - the previous active state
32
+ * @param next - the current active state
33
+ * @internal
34
+ */
35
+ protected activeChanged(prev: boolean, next: boolean): void;
36
+ /**
37
+ * The current selected state of the option.
38
+ *
39
+ * @internal
40
+ */
41
+ currentSelected?: boolean;
42
+ /**
43
+ * Sets the selected property to match the currentSelected state.
44
+ *
45
+ * @param prev - the previous selected state
46
+ * @param next - the current selected state
47
+ * @internal
48
+ */
49
+ currentSelectedChanged(prev: boolean | undefined, next: boolean | undefined): void;
50
+ /**
51
+ * The initial selected state of the option.
52
+ *
53
+ * @public
54
+ * @remarks
55
+ * HTML Attribute: `checked`
56
+ */
57
+ defaultSelected?: boolean;
58
+ /**
59
+ * Updates the selected state when the `selected` attribute is changed, unless the selected state has been changed by the user.
60
+ *
61
+ * @param prev - The previous initial selected state
62
+ * @param next - The current initial selected state
63
+ * @internal
64
+ */
65
+ protected defaultSelectedChanged(prev: boolean | undefined, next: boolean | undefined): void;
66
+ /**
67
+ * The collection of slotted description elements.
68
+ *
69
+ * @internal
70
+ */
71
+ descriptionSlot: Node[];
72
+ /**
73
+ * Changes the description state of the option when the description slot changes.
74
+ *
75
+ * @param prev - the previous collection of description elements
76
+ * @param next - the current collection of description elements
77
+ * @internal
78
+ */
79
+ descriptionSlotChanged(prev: Node[] | undefined, next: Node[] | undefined): void;
80
+ /**
81
+ * The current disabled state of the option.
82
+ *
83
+ * @public
84
+ */
85
+ disabled?: boolean;
86
+ /**
87
+ * Toggles the disabled state when the user changes the `disabled` property.
88
+ *
89
+ * @internal
90
+ */
91
+ protected disabledChanged(prev: boolean | undefined, next: boolean | undefined): void;
92
+ /**
93
+ * The initial disabled state of the option.
94
+ *
95
+ * @public
96
+ * @remarks
97
+ * HTML Attribute: `disabled`
98
+ */
99
+ disabledAttribute?: boolean;
100
+ /**
101
+ * Sets the disabled state when the `disabled` attribute changes.
102
+ *
103
+ * @param prev - the previous value
104
+ * @param next - the current value
105
+ * @internal
106
+ */
107
+ protected disabledAttributeChanged(prev: boolean | undefined, next: boolean | undefined): void;
108
+ /**
109
+ * The id of a form to associate the element to.
110
+ * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Element/input#form | `form`} attribute
111
+ *
112
+ * @public
113
+ * @remarks
114
+ * HTML Attribute: `form`
115
+ */
116
+ formAttribute?: string;
117
+ /**
118
+ * Indicates that the option value should sync with the value of the dropdown's control.
119
+ *
120
+ * @public
121
+ * @remarks
122
+ * HTML Attribute: `freeform`
123
+ */
124
+ freeform?: boolean;
125
+ /**
126
+ * The id of the option. If not provided, a unique id will be assigned.
127
+ *
128
+ * @override
129
+ * @public
130
+ * @remarks
131
+ * HTML Attribute: `id`
132
+ */
133
+ id: string;
134
+ /**
135
+ * The initial value of the option.
136
+ *
137
+ * @public
138
+ * @remarks
139
+ * HTML Attribute: `value`
140
+ */
141
+ initialValue: string;
142
+ /**
143
+ * Sets the value of the option when the `value` attribute changes.
144
+ *
145
+ * @param prev - The previous initial value
146
+ * @param next - The current initial value
147
+ * @internal
148
+ */
149
+ protected initialValueChanged(prev: string, next: string): void;
150
+ /**
151
+ * Indicates that the option is in a multiple selection mode context.
152
+ * @public
153
+ */
154
+ multiple: boolean;
155
+ /**
156
+ * Updates the multiple state of the option when the multiple property changes.
157
+ *
158
+ * @param prev - the previous multiple state
159
+ * @param next - the current multiple state
160
+ */
161
+ multipleChanged(prev: boolean, next: boolean): void;
162
+ /**
163
+ * The name of the option. This option's value will be surfaced during form submission under the provided name.
164
+ *
165
+ * @public
166
+ * @remarks
167
+ * HTML Attribute: `name`
168
+ */
169
+ name: string;
170
+ /**
171
+ * Reference to the start slot element.
172
+ *
173
+ * @internal
174
+ */
175
+ start: HTMLSlotElement;
176
+ /**
177
+ * The text to display in the dropdown control when the option is selected.
178
+ *
179
+ * @public
180
+ * @remarks
181
+ * HTML Attribute: `text`
182
+ */
183
+ textAttribute?: string;
184
+ /**
185
+ * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
186
+ *
187
+ * @internal
188
+ */
189
+ elementInternals: ElementInternals;
190
+ /**
191
+ * The associated `<form>` element.
192
+ *
193
+ * @public
194
+ * @remarks
195
+ * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/form | `ElementInternals.form`} property.
196
+ */
197
+ get form(): HTMLFormElement | null;
198
+ /**
199
+ * The collection of slotted `output` elements, used to display the value when the option is freeform.
200
+ *
201
+ * @internal
202
+ */
203
+ freeformOutputs?: HTMLOutputElement[];
204
+ /**
205
+ * The form-associated flag.
206
+ * @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-face-example | Form-associated custom elements}
207
+ *
208
+ * @public
209
+ */
210
+ static formAssociated: boolean;
211
+ /**
212
+ * A reference to all associated `<label>` elements.
213
+ *
214
+ * @public
215
+ */
216
+ get labels(): ReadonlyArray<HTMLLabelElement>;
217
+ /**
218
+ * The option's current selected state.
219
+ *
220
+ * @public
221
+ */
222
+ get selected(): boolean;
223
+ set selected(next: boolean);
224
+ /**
225
+ * The display text of the option.
226
+ *
227
+ * @public
228
+ * @remarks
229
+ * When the option is freeform, the text is the value of the option.
230
+ */
231
+ get text(): string;
232
+ /**
233
+ * The internal value of the option.
234
+ *
235
+ * @internal
236
+ */
237
+ private _value;
238
+ /**
239
+ * The current value of the option.
240
+ *
241
+ * @public
242
+ */
243
+ get value(): string;
244
+ set value(value: string);
245
+ connectedCallback(): void;
246
+ constructor();
247
+ /**
248
+ * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/setFormValue | `ElementInternals.setFormValue()`} method.
249
+ *
250
+ * @internal
251
+ */
252
+ setFormValue(value: File | string | FormData | null, state?: File | string | FormData | null): void;
253
+ /**
254
+ * Toggles the selected state of the control.
255
+ *
256
+ * @param force - Forces the element to be checked or unchecked
257
+ * @public
258
+ */
259
+ toggleSelected(force?: boolean): void;
260
+ }
@@ -0,0 +1,9 @@
1
+ import { DropdownOption } from './option.js';
2
+ /**
3
+ * The Fluent Option Element.
4
+ *
5
+ * @public
6
+ * @remarks
7
+ * HTML Element: `<fluent-option>`
8
+ */
9
+ export declare const definition: import("@microsoft/fast-element").FASTElementDefinition<typeof DropdownOption>;
@@ -0,0 +1,20 @@
1
+ import type { StartOptions } from '../patterns/start-end.js';
2
+ import type { StaticallyComposableHTML } from '../utils/template-helpers.js';
3
+ import type { DropdownOption } from './option.js';
4
+ /**
5
+ * Predicate function that determines if the element should be considered an option.
6
+ *
7
+ * @param element - The element to check.
8
+ * @param tagName - The tag name to check.
9
+ * @returns true if the element is an option.
10
+ * @public
11
+ */
12
+ export declare function isDropdownOption(value: Node | null, tagName?: string): value is DropdownOption;
13
+ /**
14
+ * The options for the {@link DropdownOption} component.
15
+ *
16
+ * @public
17
+ */
18
+ export type DropdownOptionOptions = StartOptions<DropdownOption> & {
19
+ checkedIndicator?: StaticallyComposableHTML<DropdownOption>;
20
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Styles for the {@link (DropdownOption:class)} component.
3
+ *
4
+ * @public
5
+ */
6
+ export declare const styles: import("@microsoft/fast-element").ElementStyles;
@@ -0,0 +1,16 @@
1
+ import type { ElementViewTemplate } from '@microsoft/fast-element';
2
+ import type { DropdownOption } from './option.js';
3
+ import type { DropdownOptionOptions } from './option.options.js';
4
+ /**
5
+ * Generates a template for the {@link (Option:class)} component.
6
+ *
7
+ * @param options - The {@link (OptionOptions:interface)} to use for generating the template.
8
+ * @returns The template object.
9
+ * @public
10
+ */
11
+ export declare function dropdownOptionTemplate<T extends DropdownOption>(options?: DropdownOptionOptions): ElementViewTemplate<T>;
12
+ /**
13
+ * Template for the Option component.
14
+ * @public
15
+ */
16
+ export declare const template: ElementViewTemplate<DropdownOption>;
@@ -19,12 +19,26 @@ export type EndOptions<TSource = any, TParent = any> = {
19
19
  * @public
20
20
  */
21
21
  export type StartEndOptions<TSource = any, TParent = any> = StartOptions<TSource, TParent> & EndOptions<TSource, TParent>;
22
+ /**
23
+ * A mixin class implementing start slots.
24
+ * @public
25
+ */
26
+ export declare class Start {
27
+ start: HTMLSlotElement;
28
+ }
29
+ /**
30
+ * A mixin class implementing end slots.
31
+ * @public
32
+ */
33
+ export declare class End {
34
+ end: HTMLSlotElement;
35
+ }
22
36
  /**
23
37
  * A mixin class implementing start and end slots.
24
38
  * These are generally used to decorate text elements with icons or other visual indicators.
25
39
  * @public
26
40
  */
27
- export declare class StartEnd {
41
+ export declare class StartEnd implements Start, End {
28
42
  start: HTMLSlotElement;
29
43
  end: HTMLSlotElement;
30
44
  }
@@ -41,4 +55,4 @@ export declare function endSlotTemplate<TSource extends StartEnd = StartEnd, TPa
41
55
  *
42
56
  * @public
43
57
  */
44
- export declare function startSlotTemplate<TSource extends StartEnd = StartEnd, TParent = any>(options: StartOptions<TSource, TParent>): CaptureType<TSource, TParent>;
58
+ export declare function startSlotTemplate<TSource extends Pick<StartEnd, 'start'> = StartEnd, TParent = any>(options: StartOptions<TSource, TParent>): CaptureType<TSource, TParent>;
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Selector for the `active` state.
3
+ * @public
4
+ */
5
+ export declare const activeState: ":state(active)" | "[state--active]";
1
6
  /**
2
7
  * Selector for the `align-end` state.
3
8
  * @public
@@ -108,6 +113,10 @@ export declare const darkGreenState: ":state(dark-green)" | "[state--dark-green]
108
113
  * @public
109
114
  */
110
115
  export declare const darkRedState: ":state(dark-red)" | "[state--dark-red]";
116
+ /**
117
+ * Selector for the `description` state.
118
+ */
119
+ export declare const descriptionState: ":state(description)" | "[state--description]";
111
120
  /**
112
121
  * Selector for the `disabled` state.
113
122
  * @public
@@ -178,6 +187,11 @@ export declare const fitCoverState: ":state(fit-cover)" | "[state--fit-cover]";
178
187
  * @public
179
188
  */
180
189
  export declare const fitNoneState: ":state(fit-none)" | "[state--fit-none]";
190
+ /**
191
+ * Selector for the `flip-block` state.
192
+ * @public
193
+ */
194
+ export declare const flipBlockState: ":state(flip-block)" | "[state--flip-block]";
181
195
  /**
182
196
  * Selector for the `focus-visible` state.
183
197
  * @public
@@ -308,6 +322,11 @@ export declare const monospaceState: ":state(monospace)" | "[state--monospace]";
308
322
  * @public
309
323
  */
310
324
  export declare const multiLineState: ":state(multiline)" | "[state--multiline]";
325
+ /**
326
+ * Selector for the `multiselect` state.
327
+ * @public
328
+ */
329
+ export declare const multipleState: ":state(multiple)" | "[state--multiple]";
311
330
  /**
312
331
  * Selector for the `navy` state.
313
332
  * @public
@@ -328,6 +347,11 @@ export declare const nowrapState: ":state(nowrap)" | "[state--nowrap]";
328
347
  * @public
329
348
  */
330
349
  export declare const numericState: ":state(numeric)" | "[state--numeric]";
350
+ /**
351
+ * Selector for the `open` state.
352
+ * @public
353
+ */
354
+ export declare const openState: ":state(open)" | "[state--open]";
331
355
  /**
332
356
  * Selector for the `outline` state.
333
357
  * @public
@@ -348,6 +372,11 @@ export declare const peachState: ":state(peach)" | "[state--peach]";
348
372
  * @public
349
373
  */
350
374
  export declare const pinkState: ":state(pink)" | "[state--pink]";
375
+ /**
376
+ * Selector for the `placeholder-shown` state.
377
+ * @public
378
+ */
379
+ export declare const placeholderShownState: ":state(placeholder-shown)" | "[state--placeholder-shown]";
351
380
  /**
352
381
  * Selector for the `platinum` state.
353
382
  * @public
@@ -423,6 +452,11 @@ export declare const royalBlueState: ":state(royal-blue)" | "[state--royal-blue]
423
452
  * @public
424
453
  */
425
454
  export declare const seafoamState: ":state(seafoam)" | "[state--seafoam]";
455
+ /**
456
+ * Selector for the `selected` state.
457
+ * @public
458
+ */
459
+ export declare const selectedState: ":state(selected)" | "[state--selected]";
426
460
  /**
427
461
  * Selector for the `semibold` state.
428
462
  * @public
@@ -1,13 +1,10 @@
1
+ import { CustomStatesSetSupported } from './support.js';
1
2
  /**
2
3
  * Inference type for a CSS custom state selector.
3
4
  * @public
4
5
  */
5
6
  export type StateSelector<S> = S extends string ? `:state(${S})` | `[state--${S}]` : never;
6
- /**
7
- * Check if the browser supports Custom States.
8
- * @public
9
- */
10
- export declare const CustomStatesSetSupported: boolean;
7
+ export { CustomStatesSetSupported };
11
8
  /**
12
9
  * Returns a string that represents a CSS custom state selector.
13
10
  *
@@ -32,7 +29,7 @@ export declare function stateSelector<S extends string>(state: S): StateSelector
32
29
  * @param force - force the state to be toggled on or off
33
30
  * @internal
34
31
  */
35
- export declare function toggleState(elementInternals: ElementInternals, state: string | undefined, force?: boolean): void;
32
+ export declare function toggleState(elementInternals: ElementInternals | undefined, state: string | undefined, force?: boolean): void;
36
33
  /**
37
34
  * Check if a given attribute value is a valid state. Attribute values are often kebab-cased, so this function converts
38
35
  * the kebab-cased `state` to camelCase and checks if it exists in as a key in the `States` object.
@@ -5,3 +5,4 @@ export * from './template-helpers.js';
5
5
  export * from './whitespace-filter.js';
6
6
  export * from './display.js';
7
7
  export * from './behaviors/match-media-stylesheet-behavior.js';
8
+ export * from './support.js';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Determines the current language code of an element.
3
+ *
4
+ * @param rootNode - the HTMLElement to begin the query from, usually "this" when used in a component controller
5
+ * @returns the language code of the element
6
+ *
7
+ * @public
8
+ */
9
+ export declare function getLanguage(rootNode: HTMLElement): Intl.BCP47LanguageTag;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Check if the browser supports CSS Anchor Positioning.
3
+ * @public
4
+ */
5
+ export declare const AnchorPositioningCSSSupported: boolean;
6
+ /**
7
+ * Check if the browser supports HTML Anchor Positioning.
8
+ * @public
9
+ */
10
+ export declare const AnchorPositioningHTMLSupported: boolean;
11
+ /**
12
+ * Check if the browser supports Custom States.
13
+ * @public
14
+ */
15
+ export declare const CustomStatesSetSupported: boolean;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generates a unique element id.
3
+ *
4
+ * @param prefix - The prefix to use for the unique id.
5
+ * @returns A unique id.
6
+ *
7
+ * @public
8
+ */
9
+ export declare function uniqueId(prefix?: string): string;