@fluentui/web-components 3.0.0-beta.7 → 3.0.0-beta.8

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 (283) hide show
  1. package/CHANGELOG.md +11 -2
  2. package/dist/dts/accordion/accordion.d.ts +47 -3
  3. package/dist/dts/accordion/accordion.definition.d.ts +0 -4
  4. package/dist/dts/accordion/accordion.options.d.ts +14 -0
  5. package/dist/dts/accordion/accordion.template.d.ts +4 -0
  6. package/dist/dts/accordion-item/accordion-item.d.ts +78 -3
  7. package/dist/dts/accordion-item/accordion-item.definition.d.ts +0 -3
  8. package/dist/dts/accordion-item/accordion-item.options.d.ts +1 -1
  9. package/dist/dts/accordion-item/accordion-item.template.d.ts +2 -1
  10. package/dist/dts/anchor-button/anchor-button.d.ts +116 -4
  11. package/dist/dts/anchor-button/anchor-button.definition.d.ts +0 -3
  12. package/dist/dts/anchor-button/anchor-button.options.d.ts +19 -2
  13. package/dist/dts/anchor-button/anchor-button.template.d.ts +7 -2
  14. package/dist/dts/avatar/avatar.options.d.ts +1 -1
  15. package/dist/dts/badge/badge.d.ts +1 -1
  16. package/dist/dts/badge/badge.definition.d.ts +0 -3
  17. package/dist/dts/badge/badge.options.d.ts +2 -2
  18. package/dist/dts/button/button.d.ts +142 -4
  19. package/dist/dts/button/button.definition.d.ts +0 -3
  20. package/dist/dts/button/button.form-associated.d.ts +14 -0
  21. package/dist/dts/button/button.options.d.ts +24 -3
  22. package/dist/dts/button/button.template.d.ts +2 -0
  23. package/dist/dts/checkbox/checkbox.d.ts +46 -3
  24. package/dist/dts/checkbox/checkbox.form-associated.d.ts +14 -0
  25. package/dist/dts/checkbox/checkbox.options.d.ts +1 -1
  26. package/dist/dts/checkbox/checkbox.template.d.ts +6 -1
  27. package/dist/dts/compound-button/compound-button.definition.d.ts +0 -3
  28. package/dist/dts/compound-button/compound-button.options.d.ts +6 -6
  29. package/dist/dts/counter-badge/counter-badge.d.ts +1 -1
  30. package/dist/dts/counter-badge/counter-badge.definition.d.ts +0 -4
  31. package/dist/dts/counter-badge/counter-badge.options.d.ts +1 -1
  32. package/dist/dts/dialog/dialog.options.d.ts +1 -1
  33. package/dist/dts/divider/divider.d.ts +20 -4
  34. package/dist/dts/divider/divider.options.d.ts +30 -6
  35. package/dist/dts/divider/divider.template.d.ts +1 -0
  36. package/dist/dts/form-associated/form-associated.d.ts +178 -0
  37. package/dist/dts/image/image.options.d.ts +1 -1
  38. package/dist/dts/label/label.options.d.ts +1 -1
  39. package/dist/dts/menu-button/menu-button.definition.d.ts +0 -3
  40. package/dist/dts/menu-button/menu-button.options.d.ts +2 -2
  41. package/dist/dts/menu-item/menu-item.d.ts +161 -4
  42. package/dist/dts/menu-item/menu-item.definition.d.ts +0 -4
  43. package/dist/dts/menu-item/menu-item.options.d.ts +30 -0
  44. package/dist/dts/menu-item/menu-item.template.d.ts +2 -1
  45. package/dist/dts/menu-list/menu-list.d.ts +71 -4
  46. package/dist/dts/menu-list/menu-list.definition.d.ts +0 -4
  47. package/dist/dts/menu-list/menu-list.template.d.ts +1 -0
  48. package/dist/dts/patterns/aria-globals.d.ts +189 -0
  49. package/dist/dts/patterns/index.d.ts +2 -0
  50. package/dist/dts/patterns/start-end.d.ts +44 -0
  51. package/dist/dts/progress-bar/base-progress.d.ts +41 -0
  52. package/dist/dts/progress-bar/progress-bar.d.ts +11 -4
  53. package/dist/dts/progress-bar/progress-bar.options.d.ts +10 -1
  54. package/dist/dts/progress-bar/progress-bar.template.d.ts +2 -0
  55. package/dist/dts/progress-ring/progress-ring.d.ts +15 -0
  56. package/dist/dts/progress-ring/progress-ring.options.d.ts +9 -0
  57. package/dist/dts/radio/radio.d.ts +54 -3
  58. package/dist/dts/radio/radio.form-associated.d.ts +14 -0
  59. package/dist/dts/radio/radio.template.d.ts +2 -1
  60. package/dist/dts/radio-group/index.d.ts +0 -1
  61. package/dist/dts/radio-group/radio-group.d.ts +91 -2
  62. package/dist/dts/radio-group/radio-group.options.d.ts +17 -0
  63. package/dist/dts/radio-group/radio-group.template.d.ts +1 -0
  64. package/dist/dts/slider/slider-utilities.d.ts +5 -0
  65. package/dist/dts/slider/slider.d.ts +195 -5
  66. package/dist/dts/slider/slider.form-associated.d.ts +14 -0
  67. package/dist/dts/slider/slider.options.d.ts +43 -2
  68. package/dist/dts/slider/slider.template.d.ts +4 -2
  69. package/dist/dts/spinner/spinner.d.ts +2 -2
  70. package/dist/dts/spinner/spinner.definition.d.ts +0 -4
  71. package/dist/dts/spinner/spinner.options.d.ts +1 -1
  72. package/dist/dts/spinner/spinner.template.d.ts +2 -0
  73. package/dist/dts/switch/switch.d.ts +34 -2
  74. package/dist/dts/switch/switch.form-associated.d.ts +14 -0
  75. package/dist/dts/switch/switch.options.d.ts +1 -1
  76. package/dist/dts/switch/switch.template.d.ts +2 -1
  77. package/dist/dts/tab/tab.d.ts +17 -2
  78. package/dist/dts/tab/tab.template.d.ts +3 -3
  79. package/dist/dts/tab-panel/tab-panel.d.ts +2 -2
  80. package/dist/dts/tab-panel/tab-panel.template.d.ts +4 -1
  81. package/dist/dts/tabs/tabs.d.ts +89 -4
  82. package/dist/dts/tabs/tabs.options.d.ts +21 -3
  83. package/dist/dts/tabs/tabs.template.d.ts +5 -1
  84. package/dist/dts/text/text.options.d.ts +1 -1
  85. package/dist/dts/text-input/index.d.ts +0 -1
  86. package/dist/dts/text-input/text-field.form-associated.d.ts +14 -0
  87. package/dist/dts/text-input/text-input.d.ts +134 -6
  88. package/dist/dts/text-input/text-input.options.d.ts +32 -1
  89. package/dist/dts/text-input/text-input.template.d.ts +2 -1
  90. package/dist/dts/toggle-button/toggle-button.definition.d.ts +0 -2
  91. package/dist/dts/toggle-button/toggle-button.options.d.ts +2 -2
  92. package/dist/dts/utils/direction.d.ts +10 -0
  93. package/dist/dts/utils/index.d.ts +4 -0
  94. package/dist/dts/utils/template-helpers.d.ts +16 -0
  95. package/dist/dts/utils/typings.d.ts +6 -0
  96. package/dist/dts/utils/whitespace-filter.d.ts +12 -0
  97. package/dist/esm/accordion/accordion.definition.js +0 -4
  98. package/dist/esm/accordion/accordion.definition.js.map +1 -1
  99. package/dist/esm/accordion/accordion.js +216 -3
  100. package/dist/esm/accordion/accordion.js.map +1 -1
  101. package/dist/esm/accordion/accordion.options.js +9 -0
  102. package/dist/esm/accordion/accordion.options.js.map +1 -0
  103. package/dist/esm/accordion/accordion.template.js +11 -1
  104. package/dist/esm/accordion/accordion.template.js.map +1 -1
  105. package/dist/esm/accordion-item/accordion-item.definition.js +0 -3
  106. package/dist/esm/accordion-item/accordion-item.definition.js.map +1 -1
  107. package/dist/esm/accordion-item/accordion-item.js +80 -4
  108. package/dist/esm/accordion-item/accordion-item.js.map +1 -1
  109. package/dist/esm/accordion-item/accordion-item.template.js +47 -2
  110. package/dist/esm/accordion-item/accordion-item.template.js.map +1 -1
  111. package/dist/esm/anchor-button/anchor-button.definition.js +0 -3
  112. package/dist/esm/anchor-button/anchor-button.definition.js.map +1 -1
  113. package/dist/esm/anchor-button/anchor-button.js +52 -4
  114. package/dist/esm/anchor-button/anchor-button.js.map +1 -1
  115. package/dist/esm/anchor-button/anchor-button.options.js +11 -0
  116. package/dist/esm/anchor-button/anchor-button.options.js.map +1 -1
  117. package/dist/esm/anchor-button/anchor-button.template.js +49 -1
  118. package/dist/esm/anchor-button/anchor-button.template.js.map +1 -1
  119. package/dist/esm/badge/badge.definition.js +0 -3
  120. package/dist/esm/badge/badge.definition.js.map +1 -1
  121. package/dist/esm/badge/badge.js +1 -1
  122. package/dist/esm/badge/badge.js.map +1 -1
  123. package/dist/esm/badge/badge.template.js +2 -2
  124. package/dist/esm/badge/badge.template.js.map +1 -1
  125. package/dist/esm/button/button.definition.js +0 -3
  126. package/dist/esm/button/button.definition.js.map +1 -1
  127. package/dist/esm/button/button.form-associated.js +14 -0
  128. package/dist/esm/button/button.form-associated.js.map +1 -0
  129. package/dist/esm/button/button.js +124 -4
  130. package/dist/esm/button/button.js.map +1 -1
  131. package/dist/esm/button/button.options.js +10 -0
  132. package/dist/esm/button/button.options.js.map +1 -1
  133. package/dist/esm/button/button.template.js +49 -1
  134. package/dist/esm/button/button.template.js.map +1 -1
  135. package/dist/esm/checkbox/checkbox.form-associated.js +14 -0
  136. package/dist/esm/checkbox/checkbox.form-associated.js.map +1 -0
  137. package/dist/esm/checkbox/checkbox.js +62 -4
  138. package/dist/esm/checkbox/checkbox.js.map +1 -1
  139. package/dist/esm/checkbox/checkbox.template.js +35 -7
  140. package/dist/esm/checkbox/checkbox.template.js.map +1 -1
  141. package/dist/esm/compound-button/compound-button.definition.js +0 -3
  142. package/dist/esm/compound-button/compound-button.definition.js.map +1 -1
  143. package/dist/esm/compound-button/compound-button.options.js.map +1 -1
  144. package/dist/esm/compound-button/compound-button.template.js +1 -1
  145. package/dist/esm/compound-button/compound-button.template.js.map +1 -1
  146. package/dist/esm/counter-badge/counter-badge.definition.js +0 -4
  147. package/dist/esm/counter-badge/counter-badge.definition.js.map +1 -1
  148. package/dist/esm/counter-badge/counter-badge.js +1 -1
  149. package/dist/esm/counter-badge/counter-badge.js.map +1 -1
  150. package/dist/esm/divider/divider.js +29 -4
  151. package/dist/esm/divider/divider.js.map +1 -1
  152. package/dist/esm/divider/divider.options.js +14 -5
  153. package/dist/esm/divider/divider.options.js.map +1 -1
  154. package/dist/esm/divider/divider.template.js +12 -1
  155. package/dist/esm/divider/divider.template.js.map +1 -1
  156. package/dist/esm/form-associated/form-associated.js +458 -0
  157. package/dist/esm/form-associated/form-associated.js.map +1 -0
  158. package/dist/esm/menu-button/menu-button.definition.js +0 -3
  159. package/dist/esm/menu-button/menu-button.definition.js.map +1 -1
  160. package/dist/esm/menu-button/menu-button.options.js.map +1 -1
  161. package/dist/esm/menu-button/menu-button.template.js +1 -1
  162. package/dist/esm/menu-button/menu-button.template.js.map +1 -1
  163. package/dist/esm/menu-item/menu-item.definition.js +0 -4
  164. package/dist/esm/menu-item/menu-item.definition.js.map +1 -1
  165. package/dist/esm/menu-item/menu-item.js +270 -4
  166. package/dist/esm/menu-item/menu-item.js.map +1 -1
  167. package/dist/esm/menu-item/menu-item.options.js +27 -0
  168. package/dist/esm/menu-item/menu-item.options.js.map +1 -0
  169. package/dist/esm/menu-item/menu-item.template.js +57 -2
  170. package/dist/esm/menu-item/menu-item.template.js.map +1 -1
  171. package/dist/esm/menu-list/menu-list.definition.js +0 -4
  172. package/dist/esm/menu-list/menu-list.definition.js.map +1 -1
  173. package/dist/esm/menu-list/menu-list.js +265 -10
  174. package/dist/esm/menu-list/menu-list.js.map +1 -1
  175. package/dist/esm/menu-list/menu-list.template.js +13 -1
  176. package/dist/esm/menu-list/menu-list.template.js.map +1 -1
  177. package/dist/esm/patterns/aria-globals.js +77 -0
  178. package/dist/esm/patterns/aria-globals.js.map +1 -0
  179. package/dist/esm/patterns/index.js +3 -0
  180. package/dist/esm/patterns/index.js.map +1 -0
  181. package/dist/esm/patterns/start-end.js +29 -0
  182. package/dist/esm/patterns/start-end.js.map +1 -0
  183. package/dist/esm/progress-bar/base-progress.js +61 -0
  184. package/dist/esm/progress-bar/base-progress.js.map +1 -0
  185. package/dist/esm/progress-bar/progress-bar.js +10 -3
  186. package/dist/esm/progress-bar/progress-bar.js.map +1 -1
  187. package/dist/esm/progress-bar/progress-bar.options.js.map +1 -1
  188. package/dist/esm/progress-bar/progress-bar.template.js +25 -1
  189. package/dist/esm/progress-bar/progress-bar.template.js.map +1 -1
  190. package/dist/esm/progress-ring/progress-ring.js +16 -0
  191. package/dist/esm/progress-ring/progress-ring.js.map +1 -0
  192. package/dist/esm/progress-ring/progress-ring.options.js +2 -0
  193. package/dist/esm/progress-ring/progress-ring.options.js.map +1 -0
  194. package/dist/esm/radio/radio.form-associated.js +14 -0
  195. package/dist/esm/radio/radio.form-associated.js.map +1 -0
  196. package/dist/esm/radio/radio.js +96 -3
  197. package/dist/esm/radio/radio.js.map +1 -1
  198. package/dist/esm/radio/radio.template.js +28 -2
  199. package/dist/esm/radio/radio.template.js.map +1 -1
  200. package/dist/esm/radio-group/index.js +0 -1
  201. package/dist/esm/radio-group/index.js.map +1 -1
  202. package/dist/esm/radio-group/radio-group.js +346 -3
  203. package/dist/esm/radio-group/radio-group.js.map +1 -1
  204. package/dist/esm/radio-group/radio-group.options.js +7 -0
  205. package/dist/esm/radio-group/radio-group.options.js.map +1 -0
  206. package/dist/esm/radio-group/radio-group.template.js +30 -1
  207. package/dist/esm/radio-group/radio-group.template.js.map +1 -1
  208. package/dist/esm/slider/slider-utilities.js +12 -0
  209. package/dist/esm/slider/slider-utilities.js.map +1 -0
  210. package/dist/esm/slider/slider.form-associated.js +14 -0
  211. package/dist/esm/slider/slider.form-associated.js.map +1 -0
  212. package/dist/esm/slider/slider.js +432 -16
  213. package/dist/esm/slider/slider.js.map +1 -1
  214. package/dist/esm/slider/slider.options.js +11 -1
  215. package/dist/esm/slider/slider.options.js.map +1 -1
  216. package/dist/esm/slider/slider.template.js +38 -1
  217. package/dist/esm/slider/slider.template.js.map +1 -1
  218. package/dist/esm/spinner/spinner.definition.js +0 -4
  219. package/dist/esm/spinner/spinner.definition.js.map +1 -1
  220. package/dist/esm/spinner/spinner.js +2 -2
  221. package/dist/esm/spinner/spinner.js.map +1 -1
  222. package/dist/esm/spinner/spinner.template.js +27 -1
  223. package/dist/esm/spinner/spinner.template.js.map +1 -1
  224. package/dist/esm/switch/switch.form-associated.js +14 -0
  225. package/dist/esm/switch/switch.form-associated.js.map +1 -0
  226. package/dist/esm/switch/switch.js +48 -3
  227. package/dist/esm/switch/switch.js.map +1 -1
  228. package/dist/esm/switch/switch.template.js +25 -1
  229. package/dist/esm/switch/switch.template.js.map +1 -1
  230. package/dist/esm/tab/tab.js +14 -3
  231. package/dist/esm/tab/tab.js.map +1 -1
  232. package/dist/esm/tab/tab.template.js +1 -1
  233. package/dist/esm/tab/tab.template.js.map +1 -1
  234. package/dist/esm/tab-panel/tab-panel.js +2 -2
  235. package/dist/esm/tab-panel/tab-panel.js.map +1 -1
  236. package/dist/esm/tab-panel/tab-panel.template.js +8 -1
  237. package/dist/esm/tab-panel/tab-panel.template.js.map +1 -1
  238. package/dist/esm/tabs/tabs.js +278 -5
  239. package/dist/esm/tabs/tabs.js.map +1 -1
  240. package/dist/esm/tabs/tabs.options.js +6 -2
  241. package/dist/esm/tabs/tabs.options.js.map +1 -1
  242. package/dist/esm/tabs/tabs.template.js +14 -1
  243. package/dist/esm/tabs/tabs.template.js.map +1 -1
  244. package/dist/esm/text-input/index.js +0 -1
  245. package/dist/esm/text-input/index.js.map +1 -1
  246. package/dist/esm/text-input/text-field.form-associated.js +14 -0
  247. package/dist/esm/text-input/text-field.form-associated.js.map +1 -0
  248. package/dist/esm/text-input/text-input.js +167 -7
  249. package/dist/esm/text-input/text-input.js.map +1 -1
  250. package/dist/esm/text-input/text-input.options.js +26 -0
  251. package/dist/esm/text-input/text-input.options.js.map +1 -1
  252. package/dist/esm/text-input/text-input.template.js +64 -1
  253. package/dist/esm/text-input/text-input.template.js.map +1 -1
  254. package/dist/esm/toggle-button/toggle-button.definition.js +0 -2
  255. package/dist/esm/toggle-button/toggle-button.definition.js.map +1 -1
  256. package/dist/esm/toggle-button/toggle-button.options.js.map +1 -1
  257. package/dist/esm/toggle-button/toggle-button.template.js +1 -1
  258. package/dist/esm/toggle-button/toggle-button.template.js.map +1 -1
  259. package/dist/esm/utils/direction.js +15 -0
  260. package/dist/esm/utils/direction.js.map +1 -0
  261. package/dist/esm/utils/index.js +5 -0
  262. package/dist/esm/utils/index.js.map +1 -0
  263. package/dist/esm/utils/template-helpers.js +19 -0
  264. package/dist/esm/utils/template-helpers.js.map +1 -0
  265. package/dist/esm/utils/typings.js +3 -0
  266. package/dist/esm/utils/typings.js.map +1 -0
  267. package/dist/esm/utils/whitespace-filter.js +13 -0
  268. package/dist/esm/utils/whitespace-filter.js.map +1 -0
  269. package/dist/fluent-web-components.api.json +9315 -3940
  270. package/dist/storybook/711.b5d63aa3.iframe.bundle.js +2 -0
  271. package/dist/storybook/iframe.html +1 -1
  272. package/dist/storybook/main.588112e6.iframe.bundle.js +2 -0
  273. package/dist/storybook/project.json +1 -1
  274. package/dist/web-components.d.ts +2194 -241
  275. package/dist/web-components.js +1964 -3195
  276. package/dist/web-components.min.js +123 -123
  277. package/docs/api-report.md +600 -90
  278. package/package.json +1 -1
  279. package/dist/storybook/350.e4be85c2.iframe.bundle.js +0 -462
  280. package/dist/storybook/350.e4be85c2.iframe.bundle.js.map +0 -1
  281. package/dist/storybook/main.b095c2e8.iframe.bundle.js +0 -2
  282. /package/dist/storybook/{350.e4be85c2.iframe.bundle.js.LICENSE.txt → 711.b5d63aa3.iframe.bundle.js.LICENSE.txt} +0 -0
  283. /package/dist/storybook/{main.b095c2e8.iframe.bundle.js.LICENSE.txt → main.588112e6.iframe.bundle.js.LICENSE.txt} +0 -0
@@ -1,7 +1,9 @@
1
1
  import { ElementViewTemplate } from '@microsoft/fast-element';
2
2
  import type { Button } from './button.js';
3
+ import { ButtonOptions } from './button.options.js';
3
4
  /**
4
5
  * The template for the Button component.
5
6
  * @public
6
7
  */
8
+ export declare function buttonTemplate<T extends Button>(options?: ButtonOptions): ElementViewTemplate<T>;
7
9
  export declare const template: ElementViewTemplate<Button>;
@@ -1,10 +1,28 @@
1
- import { FASTCheckbox } from '@microsoft/fast-foundation/checkbox.js';
1
+ import type { StaticallyComposableHTML } from '../utils/template-helpers.js';
2
+ import { FormAssociatedCheckbox } from './checkbox.form-associated.js';
2
3
  import { CheckboxLabelPosition, CheckboxShape, CheckboxSize } from './checkbox.options.js';
3
4
  /**
4
- * The base class used for constucting a fluent checkbox custom element
5
+ * Checkbox configuration options
5
6
  * @public
6
7
  */
7
- export declare class Checkbox extends FASTCheckbox {
8
+ export declare type CheckboxOptions = {
9
+ checkedIndicator?: StaticallyComposableHTML<Checkbox>;
10
+ indeterminateIndicator?: StaticallyComposableHTML<Checkbox>;
11
+ };
12
+ /**
13
+ * A Checkbox Custom HTML Element.
14
+ * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#checkbox | ARIA checkbox }.
15
+ *
16
+ * @slot checked-indicator - The checked indicator
17
+ * @slot indeterminate-indicator - The indeterminate indicator
18
+ * @slot - The default slot for the label
19
+ * @csspart control - The element representing the visual checkbox control
20
+ * @csspart label - The label
21
+ * @fires change - Emits a custom change event when the checked state changes
22
+ *
23
+ * @public
24
+ */
25
+ export declare class Checkbox extends FormAssociatedCheckbox {
8
26
  /**
9
27
  * Sets shape of the checkbox.
10
28
  *
@@ -32,4 +50,29 @@ export declare class Checkbox extends FASTCheckbox {
32
50
  * HTML Attribute: label-position
33
51
  */
34
52
  labelPosition?: CheckboxLabelPosition;
53
+ /**
54
+ * The element's value to be included in form submission when checked.
55
+ * Default to "on" to reach parity with input[type="checkbox"]
56
+ *
57
+ * @internal
58
+ */
59
+ initialValue: string;
60
+ /**
61
+ * @internal
62
+ */
63
+ defaultSlottedNodes: Node[];
64
+ /**
65
+ * The indeterminate state of the control
66
+ */
67
+ indeterminate: boolean;
68
+ constructor();
69
+ private toggleChecked;
70
+ /**
71
+ * @internal
72
+ */
73
+ keypressHandler: (e: KeyboardEvent) => void;
74
+ /**
75
+ * @internal
76
+ */
77
+ clickHandler: (e: MouseEvent) => void;
35
78
  }
@@ -0,0 +1,14 @@
1
+ import { FASTElement } from '@microsoft/fast-element';
2
+ import { CheckableFormAssociated } from '../form-associated/form-associated.js';
3
+ declare class _Checkbox extends FASTElement {
4
+ }
5
+ interface _Checkbox extends CheckableFormAssociated {
6
+ }
7
+ declare const FormAssociatedCheckbox_base: typeof _Checkbox;
8
+ /**
9
+ * @beta
10
+ */
11
+ export declare class FormAssociatedCheckbox extends FormAssociatedCheckbox_base {
12
+ proxy: HTMLInputElement;
13
+ }
14
+ export {};
@@ -1,4 +1,4 @@
1
- import type { ValuesOf } from '@microsoft/fast-foundation/utilities.js';
1
+ import type { ValuesOf } from '../utils/index.js';
2
2
  /**
3
3
  * Checkbox shape
4
4
  * @public
@@ -1,5 +1,10 @@
1
1
  import { ElementViewTemplate } from '@microsoft/fast-element';
2
- import type { Checkbox } from './checkbox.js';
2
+ import type { Checkbox, CheckboxOptions } from './checkbox.js';
3
+ /**
4
+ * Template for the Checkbox component
5
+ * @public
6
+ */
7
+ export declare function checkboxTemplate<T extends Checkbox>(options?: CheckboxOptions): ElementViewTemplate<T>;
3
8
  /**
4
9
  * Template for the Checkbox component
5
10
  * @public
@@ -1,8 +1,5 @@
1
1
  import { CompoundButton } from './compound-button.js';
2
2
  /**
3
- * The Fluent Compound Button Element. Implements {@link @microsoft/fast-foundation#Button },
4
- * {@link @microsoft/fast-foundation#buttonTemplate}
5
- *
6
3
  * @public
7
4
  * @remarks
8
5
  * HTML Element: \<fluent-comopund-button\>
@@ -1,5 +1,5 @@
1
- import type { ButtonOptions } from '@microsoft/fast-foundation/button.js';
2
- import type { ValuesOf } from '@microsoft/fast-foundation/utilities.js';
1
+ import type { ButtonOptions } from '../button/button.options.js';
2
+ import type { ValuesOf } from '../utils/index.js';
3
3
  /**
4
4
  * Compound Button Appearance constants
5
5
  * @public
@@ -9,6 +9,10 @@ export declare const CompoundButtonAppearance: {
9
9
  readonly outline: "outline";
10
10
  readonly subtle: "subtle";
11
11
  readonly secondary: "secondary";
12
+ /**
13
+ * A Compound Button can be secondary, primary, outline, subtle, transparent
14
+ * @public
15
+ */
12
16
  readonly transparent: "transparent";
13
17
  };
14
18
  /**
@@ -36,10 +40,6 @@ export declare type CompoundButtonShape = ValuesOf<typeof CompoundButtonShape>;
36
40
  */
37
41
  export declare const CompoundButtonSize: {
38
42
  readonly small: "small";
39
- /**
40
- * A Compound Button can be on of several preset sizes.
41
- * @public
42
- */
43
43
  readonly medium: "medium";
44
44
  readonly large: "large";
45
45
  };
@@ -1,5 +1,5 @@
1
1
  import { FASTElement } from '@microsoft/fast-element';
2
- import { StartEnd } from '@microsoft/fast-foundation/patterns.js';
2
+ import { StartEnd } from '../patterns/index.js';
3
3
  import { CounterBadgeAppearance, CounterBadgeColor, CounterBadgeShape, CounterBadgeSize } from './counter-badge.options.js';
4
4
  /**
5
5
  * The base class used for constructing a fluent-badge custom element
@@ -1,9 +1,5 @@
1
1
  import { CounterBadge } from './counter-badge.js';
2
2
  /**
3
- * The Fluent CounterBadge Element. Implements {@link @microsoft/fast-foundation#Badge },
4
- * {@link @microsoft/fast-foundation#badgeTemplate}
5
- *
6
- *
7
3
  * @public
8
4
  * @remarks
9
5
  * HTML Element: \<fluent-counter-badge\>
@@ -1,5 +1,5 @@
1
- import type { ValuesOf } from '@microsoft/fast-foundation/utilities.js';
2
1
  import { BadgeOptions } from '../badge/badge.options.js';
2
+ import type { ValuesOf } from '../utils/index.js';
3
3
  /**
4
4
  * CounterBadge options
5
5
  * @public
@@ -1,4 +1,4 @@
1
- import type { ValuesOf } from '@microsoft/fast-foundation/utilities.js';
1
+ import type { ValuesOf } from '../utils/index.js';
2
2
  /**
3
3
  * Dialog modal type
4
4
  * @public
@@ -1,12 +1,28 @@
1
- import { FASTDivider } from '@microsoft/fast-foundation/divider.js';
2
- import { DividerAlignContent, DividerAppearance } from './divider.options.js';
1
+ import { FASTElement } from '@microsoft/fast-element';
2
+ import { DividerAlignContent, DividerAppearance, DividerOrientation, DividerRole } from './divider.options.js';
3
3
  /**
4
4
  * @class Divider component
5
5
  *
6
6
  * @remarks
7
- * This class extends the FASTDivider. A divider groups sections of content to create visual rhythm and hierarchy. Use dividers along with spacing and headers to organize content in your layout.
7
+ * A divider groups sections of content to create visual rhythm and hierarchy. Use dividers along with spacing and headers to organize content in your layout.
8
8
  */
9
- export declare class Divider extends FASTDivider {
9
+ export declare class Divider extends FASTElement {
10
+ /**
11
+ * The role of the element.
12
+ *
13
+ * @public
14
+ * @remarks
15
+ * HTML Attribute: role
16
+ */
17
+ role: DividerRole;
18
+ /**
19
+ * The orientation of the divider.
20
+ *
21
+ * @public
22
+ * @remarks
23
+ * HTML Attribute: orientation
24
+ */
25
+ orientation: DividerOrientation;
10
26
  /**
11
27
  * @property alignContent
12
28
  * @default center
@@ -1,15 +1,39 @@
1
- import { DividerOrientation, DividerRole } from '@microsoft/fast-foundation/divider.js';
2
- import type { ValuesOf } from '@microsoft/fast-foundation/utilities.js';
1
+ import type { ValuesOf } from '../utils/index.js';
3
2
  /**
4
- * Fast Foundation DividerRole property
3
+ * Divider roles
5
4
  * @public
6
5
  */
7
- export { DividerRole };
6
+ export declare const DividerRole: {
7
+ /**
8
+ * The divider semantically separates content
9
+ */
10
+ readonly separator: "separator";
11
+ /**
12
+ * The divider has no semantic value and is for visual presentation only.
13
+ */
14
+ readonly presentation: "presentation";
15
+ };
16
+ /**
17
+ * The types for Divider roles
18
+ * @public
19
+ */
20
+ export declare type DividerRole = ValuesOf<typeof DividerRole>;
21
+ /**
22
+ * Divider orientation
23
+ * @public
24
+ */
25
+ export declare const DividerOrientation: {
26
+ readonly horizontal: "horizontal"; /**
27
+ * Divider roles
28
+ * @public
29
+ */
30
+ readonly vertical: "vertical";
31
+ };
8
32
  /**
9
- * Fast Foundation Orientation property
33
+ * The types for Divider orientation
10
34
  * @public
11
35
  */
12
- export { DividerOrientation };
36
+ export declare type DividerOrientation = ValuesOf<typeof DividerOrientation>;
13
37
  /**
14
38
  * Align content within divider
15
39
  * @public
@@ -1,5 +1,6 @@
1
1
  import { ElementViewTemplate } from '@microsoft/fast-element';
2
2
  import type { Divider } from './divider.js';
3
+ export declare function dividerTemplate<T extends Divider>(): ElementViewTemplate<T>;
3
4
  /**
4
5
  * Template for the Divider component
5
6
  * @public
@@ -0,0 +1,178 @@
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
+ /**
76
+ * @alpha
77
+ */
78
+ export declare const supportsElementInternals: boolean;
79
+ /**
80
+ * Base class for providing Custom Element Form Association.
81
+ *
82
+ * @beta
83
+ */
84
+ export interface FormAssociated extends Omit<ElementInternals, 'labels'> {
85
+ dirtyValue: boolean;
86
+ disabled: boolean;
87
+ readonly elementInternals: ElementInternals | null;
88
+ readonly formAssociated: boolean;
89
+ initialValue: string;
90
+ readonly labels: ReadonlyArray<Node[]>;
91
+ name: string;
92
+ required: boolean;
93
+ value: string;
94
+ currentValue: string;
95
+ attachProxy(): void;
96
+ detachProxy(): void;
97
+ disabledChanged?(previous: boolean, next: boolean): void;
98
+ formDisabledCallback?(disabled: boolean): void;
99
+ formResetCallback(): void;
100
+ initialValueChanged?(previous: string, next: string): void;
101
+ nameChanged?(previous: string, next: string): void;
102
+ requiredChanged(prev: boolean, next: boolean): void;
103
+ stopPropagation(e: Event): void;
104
+ /**
105
+ * Sets the validity of the custom element. By default this uses the proxy element to determine
106
+ * validity, but this can be extended or replaced in implementation.
107
+ *
108
+ * @param anchor - The anchor element to provide to ElementInternals.setValidity for surfacing the browser's constraint validation UI
109
+ */
110
+ validate(anchor?: HTMLElement): void;
111
+ valueChanged(previous: string, next: string): void;
112
+ }
113
+ /**
114
+ * Base class for providing Custom Element Form Association with checkable features.
115
+ *
116
+ * @beta
117
+ */
118
+ export interface CheckableFormAssociated extends FormAssociated {
119
+ currentChecked: boolean;
120
+ dirtyChecked: boolean;
121
+ checkedAttribute: boolean;
122
+ defaultChecked: boolean;
123
+ defaultCheckedChanged(oldValue: boolean | undefined, newValue: boolean): void;
124
+ checked: boolean;
125
+ checkedChanged(oldValue: boolean | undefined, newValue: boolean): void;
126
+ }
127
+ /**
128
+ * Avaiable types for the `proxy` property.
129
+ * @beta
130
+ */
131
+ export declare type ProxyElement = HTMLSelectElement | HTMLTextAreaElement | HTMLInputElement;
132
+ /**
133
+ * Identifies a class as having a proxy element and optional submethods related
134
+ * to the proxy element.
135
+ *
136
+ * @beta
137
+ */
138
+ export interface FormAssociatedProxy {
139
+ proxy: ProxyElement;
140
+ disabledChanged?(previous: boolean, next: boolean): void;
141
+ formDisabledCallback?(disabled: boolean): void;
142
+ formResetCallback?(): void;
143
+ initialValueChanged?(previous: string, next: string): void;
144
+ valueChanged?(previous: string, next: string): void;
145
+ nameChanged?(previous: string, next: string): void;
146
+ }
147
+ /**
148
+ * Combined type to describe a Form-associated element.
149
+ *
150
+ * @beta
151
+ */
152
+ export declare type FormAssociatedElement = FormAssociated & FASTElement & HTMLElement & FormAssociatedProxy;
153
+ /**
154
+ * Combined type to describe a checkable Form-associated element.
155
+ *
156
+ * @beta
157
+ */
158
+ export declare type CheckableFormAssociatedElement = FormAssociatedElement & CheckableFormAssociated & {
159
+ proxy: HTMLInputElement;
160
+ };
161
+ /**
162
+ * Combined type to describe a Constructable Form-Associated type.
163
+ *
164
+ * @beta
165
+ */
166
+ export declare type ConstructableFormAssociated = Constructable<HTMLElement & FASTElement>;
167
+ /**
168
+ * Base function for providing Custom Element Form Association.
169
+ *
170
+ * @beta
171
+ */
172
+ export declare function FormAssociated<T extends ConstructableFormAssociated>(BaseCtor: T): T;
173
+ /**
174
+ * Creates a checkable form associated component.
175
+ * @beta
176
+ */
177
+ export declare function CheckableFormAssociated<T extends ConstructableFormAssociated>(BaseCtor: T): T;
178
+ export {};
@@ -1,4 +1,4 @@
1
- import type { ValuesOf } from '@microsoft/fast-foundation/utilities.js';
1
+ import type { ValuesOf } from '../utils/index.js';
2
2
  /**
3
3
  * Image fit
4
4
  * @public
@@ -1,4 +1,4 @@
1
- import type { ValuesOf } from '@microsoft/fast-foundation/utilities.js';
1
+ import type { ValuesOf } from '../utils/index.js';
2
2
  /**
3
3
  * A Labels font size can be small, medium, or large
4
4
  */
@@ -1,8 +1,5 @@
1
1
  import { MenuButton } from './menu-button.js';
2
2
  /**
3
- * The Fluent Menu Button Element. Implements {@link @microsoft/fast-foundation#Button },
4
- * {@link @microsoft/fast-foundation#buttonTemplate}
5
- *
6
3
  * @public
7
4
  * @remarks
8
5
  * HTML Element: \<fluent-button\>
@@ -1,5 +1,5 @@
1
- import type { ButtonOptions } from '@microsoft/fast-foundation/button.js';
2
- import type { ValuesOf } from '@microsoft/fast-foundation/utilities.js';
1
+ import type { ButtonOptions } from '../button/index.js';
2
+ import type { ValuesOf } from '../utils/index.js';
3
3
  /**
4
4
  * Menu Button Appearance constants
5
5
  * @public
@@ -1,9 +1,166 @@
1
- import { FASTMenuItem, MenuItemRole } from '@microsoft/fast-foundation/menu-item.js';
1
+ import { FASTElement } from '@microsoft/fast-element';
2
+ import type { StaticallyComposableHTML } from '../utils/template-helpers.js';
3
+ import type { StartEndOptions } from '../patterns/start-end.js';
4
+ import { StartEnd } from '../patterns/start-end.js';
5
+ import { MenuItemRole, roleForMenuItem } from './menu-item.options.js';
2
6
  export declare type MenuItemColumnCount = 0 | 1 | 2;
3
- export { MenuItemRole };
7
+ export { MenuItemRole, roleForMenuItem };
4
8
  /**
5
- * The base class used for constructing a fluent-menu-item custom element
9
+ * Menu Item configuration options
6
10
  * @public
7
11
  */
8
- export declare class MenuItem extends FASTMenuItem {
12
+ export declare type MenuItemOptions = StartEndOptions<MenuItem> & {
13
+ checkboxIndicator?: StaticallyComposableHTML<MenuItem>;
14
+ expandCollapseGlyph?: StaticallyComposableHTML<MenuItem>;
15
+ radioIndicator?: StaticallyComposableHTML<MenuItem>;
16
+ };
17
+ /**
18
+ * A Switch Custom HTML Element.
19
+ * Implements {@link https://www.w3.org/TR/wai-aria-1.1/#menuitem | ARIA menuitem }, {@link https://www.w3.org/TR/wai-aria-1.1/#menuitemcheckbox | ARIA menuitemcheckbox}, or {@link https://www.w3.org/TR/wai-aria-1.1/#menuitemradio | ARIA menuitemradio }.
20
+ *
21
+ * @slot checked-indicator - The checked indicator
22
+ * @slot radio-indicator - The radio indicator
23
+ * @slot start - Content which can be provided before the menu item content
24
+ * @slot end - Content which can be provided after the menu item content
25
+ * @slot - The default slot for menu item content
26
+ * @slot expand-collapse-indicator - The expand/collapse indicator
27
+ * @slot submenu - Used to nest menu's within menu items
28
+ * @csspart input-container - The element representing the visual checked or radio indicator
29
+ * @csspart checkbox - The element wrapping the `menuitemcheckbox` indicator
30
+ * @csspart radio - The element wrapping the `menuitemradio` indicator
31
+ * @csspart content - The element wrapping the menu item content
32
+ * @csspart expand-collapse-glyph-container - The element wrapping the expand collapse element
33
+ * @csspart expand-collapse - The expand/collapse element
34
+ * @csspart submenu-region - The container for the submenu, used for positioning
35
+ * @fires expanded-change - Fires a custom 'expanded-change' event when the expanded state changes
36
+ * @fires change - Fires a custom 'change' event when a non-submenu item with a role of `menuitemcheckbox`, `menuitemradio`, or `menuitem` is invoked
37
+ *
38
+ * @public
39
+ */
40
+ export declare class MenuItem extends FASTElement {
41
+ /**
42
+ * The disabled state of the element.
43
+ *
44
+ * @public
45
+ * @remarks
46
+ * HTML Attribute: disabled
47
+ */
48
+ disabled: boolean;
49
+ /**
50
+ * The expanded state of the element.
51
+ *
52
+ * @public
53
+ * @remarks
54
+ * HTML Attribute: expanded
55
+ */
56
+ expanded: boolean;
57
+ protected expandedChanged(prev: boolean | undefined, next: boolean): void;
58
+ /**
59
+ * The role of the element.
60
+ *
61
+ * @public
62
+ * @remarks
63
+ * HTML Attribute: role
64
+ */
65
+ role: MenuItemRole;
66
+ /**
67
+ * Cleanup function for the submenu positioner.
68
+ *
69
+ * @public
70
+ */
71
+ cleanup: () => void;
72
+ /**
73
+ * The checked value of the element.
74
+ *
75
+ * @public
76
+ * @remarks
77
+ * HTML Attribute: checked
78
+ */
79
+ checked: boolean;
80
+ protected checkedChanged(oldValue: boolean, newValue: boolean): void;
81
+ /**
82
+ * The hidden attribute.
83
+ *
84
+ * @public
85
+ * @remarks
86
+ * HTML Attribute: hidden
87
+ */
88
+ hidden: boolean;
89
+ /**
90
+ * The submenu slotted content.
91
+ *
92
+ * @internal
93
+ */
94
+ slottedSubmenu: HTMLElement[];
95
+ /**
96
+ * @internal
97
+ */
98
+ get hasSubmenu(): boolean;
99
+ /**
100
+ * Sets the submenu and updates its position.
101
+ *
102
+ * @internal
103
+ */
104
+ protected slottedSubmenuChanged(prev: HTMLElement[] | undefined, next: HTMLElement[]): void;
105
+ /**
106
+ * The container for the submenu.
107
+ *
108
+ * @internal
109
+ */
110
+ submenuContainer: HTMLDivElement;
111
+ /**
112
+ * @internal
113
+ */
114
+ submenu: HTMLElement | undefined;
115
+ private focusSubmenuOnLoad;
116
+ /**
117
+ * @internal
118
+ */
119
+ disconnectedCallback(): void;
120
+ /**
121
+ * @internal
122
+ */
123
+ handleMenuItemKeyDown: (e: KeyboardEvent) => boolean;
124
+ /**
125
+ * @internal
126
+ */
127
+ handleMenuItemClick: (e: MouseEvent) => boolean;
128
+ /**
129
+ * @internal
130
+ */
131
+ submenuLoaded: () => void;
132
+ /**
133
+ * @internal
134
+ */
135
+ handleMouseOver: (e: MouseEvent) => boolean;
136
+ /**
137
+ * @internal
138
+ */
139
+ handleMouseOut: (e: MouseEvent) => boolean;
140
+ /**
141
+ * @internal
142
+ */
143
+ private closeSubMenu;
144
+ /**
145
+ * @internal
146
+ */
147
+ private expandAndFocus;
148
+ /**
149
+ * @internal
150
+ */
151
+ private invoke;
152
+ /**
153
+ * Calculate and apply submenu positioning.
154
+ *
155
+ * @public
156
+ */
157
+ updateSubmenu(): void;
158
+ }
159
+ /**
160
+ * Mark internal because exporting class and interface of the same name
161
+ * confuses API documenter.
162
+ * TODO: https://github.com/microsoft/fast/issues/3317
163
+ * @internal
164
+ */
165
+ export interface MenuItem extends StartEnd {
9
166
  }
@@ -1,9 +1,5 @@
1
1
  import { MenuItem } from './menu-item.js';
2
2
  /**
3
- * The Fluent Menu Item Element. Implements {@link @microsoft/fast-foundation#MenuItem },
4
- * {@link @microsoft/fast-foundation#menuItemTemplate}
5
- *
6
- *
7
3
  * @public
8
4
  * @remarks
9
5
  * HTML Element: <fluent-menu-item>