@vonage/vivid 3.47.0 → 3.49.0-preview.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/README.md +3 -403
  2. package/accordion/index.cjs +21 -0
  3. package/accordion-item/index.cjs +18 -0
  4. package/action-group/index.cjs +7 -0
  5. package/alert/index.cjs +30 -0
  6. package/alert/index.js +0 -1
  7. package/appearance-ui/index.cjs +96 -0
  8. package/audio-player/index.cjs +34 -0
  9. package/audio-player/index.js +0 -1
  10. package/avatar/index.cjs +11 -0
  11. package/badge/index.cjs +14 -0
  12. package/banner/index.cjs +29 -0
  13. package/banner/index.js +0 -1
  14. package/breadcrumb/index.cjs +13 -0
  15. package/breadcrumb-item/index.cjs +22 -0
  16. package/button/index.cjs +25 -0
  17. package/button/index.js +0 -1
  18. package/calendar/index.cjs +9 -0
  19. package/calendar-event/index.cjs +9 -0
  20. package/card/index.cjs +14 -0
  21. package/checkbox/index.cjs +21 -0
  22. package/combobox/index.cjs +39 -0
  23. package/combobox/index.js +1 -1
  24. package/custom-elements.json +30 -35
  25. package/data-grid/index.cjs +18 -0
  26. package/date-picker/index.cjs +40 -0
  27. package/date-picker/index.js +1 -1
  28. package/date-range-picker/index.cjs +40 -0
  29. package/date-range-picker/index.js +1 -1
  30. package/dialog/index.cjs +31 -0
  31. package/dialog/index.js +1 -1
  32. package/divider/index.cjs +8 -0
  33. package/elevation/index.cjs +7 -0
  34. package/empty-state/index.cjs +12 -0
  35. package/fab/index.cjs +22 -0
  36. package/file-picker/index.cjs +30 -0
  37. package/file-picker/index.js +1 -1
  38. package/focus/index.cjs +7 -0
  39. package/header/index.cjs +8 -0
  40. package/icon/index.cjs +10 -0
  41. package/index.cjs +296 -0
  42. package/index.js +1 -1
  43. package/layout/index.cjs +7 -0
  44. package/lib/menu-item/menu-item.d.ts +1 -0
  45. package/lib/tabs/tabs.d.ts +1 -0
  46. package/listbox/index.cjs +77 -0
  47. package/locales/en-GB.cjs +106 -0
  48. package/locales/en-US.cjs +106 -0
  49. package/locales/ja-JP.cjs +106 -0
  50. package/locales/zh-CN.cjs +106 -0
  51. package/menu/index.cjs +32 -0
  52. package/menu/index.js +0 -1
  53. package/menu-item/index.cjs +22 -0
  54. package/menu-item/index.js +0 -1
  55. package/nav/index.cjs +6 -0
  56. package/nav-disclosure/index.cjs +17 -0
  57. package/nav-disclosure/index.js +0 -1
  58. package/nav-item/index.cjs +22 -0
  59. package/note/index.cjs +16 -0
  60. package/number-field/index.cjs +33 -0
  61. package/number-field/index.js +1 -1
  62. package/option/index.cjs +23 -0
  63. package/package.json +20 -2
  64. package/pagination/index.cjs +28 -0
  65. package/pagination/index.js +0 -1
  66. package/popup/index.cjs +27 -0
  67. package/popup/index.js +0 -1
  68. package/progress/index.cjs +9 -0
  69. package/progress-ring/index.cjs +9 -0
  70. package/radio/index.cjs +14 -0
  71. package/radio-group/index.cjs +14 -0
  72. package/select/index.cjs +38 -0
  73. package/select/index.js +1 -1
  74. package/selectable-box/index.cjs +25 -0
  75. package/shared/Reflector.cjs +67 -0
  76. package/shared/_has.cjs +62 -0
  77. package/shared/affix.cjs +64 -0
  78. package/shared/affix.js +8 -4
  79. package/shared/anchor.cjs +90 -0
  80. package/shared/anchored.cjs +78 -0
  81. package/shared/apply-mixins.cjs +25 -0
  82. package/shared/aria-global.cjs +74 -0
  83. package/shared/aria.cjs +11 -0
  84. package/shared/aria2.cjs +11 -0
  85. package/shared/base-progress.cjs +72 -0
  86. package/shared/breadcrumb-item.cjs +27 -0
  87. package/shared/button.cjs +202 -0
  88. package/shared/calendar-event.cjs +41 -0
  89. package/shared/children.cjs +61 -0
  90. package/shared/class-names.cjs +17 -0
  91. package/shared/definition.cjs +165 -0
  92. package/shared/definition10.cjs +102 -0
  93. package/shared/definition11.cjs +164 -0
  94. package/shared/definition11.js +39 -42
  95. package/shared/definition12.cjs +50 -0
  96. package/shared/definition13.cjs +779 -0
  97. package/shared/definition14.cjs +157 -0
  98. package/shared/definition15.cjs +249 -0
  99. package/shared/definition16.cjs +746 -0
  100. package/shared/definition17.cjs +1372 -0
  101. package/shared/definition18.cjs +175 -0
  102. package/shared/definition19.cjs +416 -0
  103. package/shared/definition2.cjs +232 -0
  104. package/shared/definition20.cjs +278 -0
  105. package/shared/definition21.cjs +83 -0
  106. package/shared/definition22.cjs +74 -0
  107. package/shared/definition23.cjs +106 -0
  108. package/shared/definition24.cjs +2392 -0
  109. package/shared/definition25.cjs +75 -0
  110. package/shared/definition26.cjs +39 -0
  111. package/shared/definition27.cjs +66 -0
  112. package/shared/definition28.cjs +849 -0
  113. package/shared/definition28.js +5 -4
  114. package/shared/definition29.cjs +72 -0
  115. package/shared/definition29.js +1 -1
  116. package/shared/definition3.cjs +72 -0
  117. package/shared/definition30.cjs +98 -0
  118. package/shared/definition30.js +1 -4
  119. package/shared/definition31.cjs +37 -0
  120. package/shared/definition32.cjs +24 -0
  121. package/shared/definition33.cjs +64 -0
  122. package/shared/definition34.cjs +533 -0
  123. package/shared/definition35.cjs +295 -0
  124. package/shared/definition36.cjs +219 -0
  125. package/shared/definition37.cjs +109 -0
  126. package/shared/definition38.cjs +92 -0
  127. package/shared/definition39.cjs +448 -0
  128. package/shared/definition4.cjs +198 -0
  129. package/shared/definition40.cjs +49 -0
  130. package/shared/definition41.cjs +694 -0
  131. package/shared/definition41.js +1 -6
  132. package/shared/definition42.cjs +152 -0
  133. package/shared/definition43.cjs +113 -0
  134. package/shared/definition44.cjs +607 -0
  135. package/shared/definition45.cjs +152 -0
  136. package/shared/definition45.js +1 -6
  137. package/shared/definition46.cjs +166 -0
  138. package/shared/definition46.js +2 -7
  139. package/shared/definition47.cjs +35 -0
  140. package/shared/definition48.cjs +98 -0
  141. package/shared/definition49.cjs +543 -0
  142. package/shared/definition49.js +12 -3
  143. package/shared/definition5.cjs +199 -0
  144. package/shared/definition50.cjs +52 -0
  145. package/shared/definition51.cjs +150 -0
  146. package/shared/definition52.cjs +304 -0
  147. package/shared/definition53.cjs +309 -0
  148. package/shared/definition54.cjs +146 -0
  149. package/shared/definition55.cjs +128 -0
  150. package/shared/definition56.cjs +99 -0
  151. package/shared/definition57.cjs +310 -0
  152. package/shared/definition58.cjs +20 -0
  153. package/shared/definition59.cjs +51 -0
  154. package/shared/definition6.cjs +83 -0
  155. package/shared/definition60.cjs +1810 -0
  156. package/shared/definition7.cjs +72 -0
  157. package/shared/definition8.cjs +152 -0
  158. package/shared/definition9.cjs +69 -0
  159. package/shared/dialog-polyfill.esm.cjs +862 -0
  160. package/shared/direction.cjs +22 -0
  161. package/shared/dom.cjs +23 -0
  162. package/shared/enums.cjs +87 -0
  163. package/shared/focus.cjs +8 -0
  164. package/shared/focus2.cjs +11 -0
  165. package/shared/form-associated.cjs +470 -0
  166. package/shared/icon.cjs +237 -0
  167. package/shared/index.cjs +5061 -0
  168. package/shared/index2.cjs +231 -0
  169. package/shared/key-codes.cjs +115 -0
  170. package/shared/key-codes2.cjs +14 -0
  171. package/shared/listbox.cjs +1072 -0
  172. package/shared/localized.cjs +11 -0
  173. package/shared/numbers.cjs +38 -0
  174. package/shared/patterns/affix.d.ts +5 -1
  175. package/shared/presentationDate.cjs +6192 -0
  176. package/shared/presentationDate.js +1 -6
  177. package/shared/radio.cjs +153 -0
  178. package/shared/ref.cjs +43 -0
  179. package/shared/repeat.cjs +767 -0
  180. package/shared/select.options.cjs +12 -0
  181. package/shared/slotted.cjs +123 -0
  182. package/shared/start-end.cjs +52 -0
  183. package/shared/strings.cjs +11 -0
  184. package/shared/text-anchor.cjs +33 -0
  185. package/shared/text-anchor.template.cjs +48 -0
  186. package/shared/text-field.cjs +5 -0
  187. package/shared/text-field2.cjs +228 -0
  188. package/shared/tree-item.cjs +154 -0
  189. package/shared/when.cjs +31 -0
  190. package/side-drawer/index.cjs +8 -0
  191. package/slider/index.cjs +16 -0
  192. package/split-button/index.cjs +20 -0
  193. package/split-button/index.js +0 -1
  194. package/style.css +1 -1
  195. package/styles/core/all.css +1 -1
  196. package/styles/core/theme.css +1 -1
  197. package/styles/core/typography.css +1 -1
  198. package/styles/tokens/theme-dark.css +4 -4
  199. package/styles/tokens/theme-light.css +4 -4
  200. package/styles/tokens/vivid-2-compat.css +1 -1
  201. package/switch/index.cjs +15 -0
  202. package/switch/index.js +0 -5
  203. package/tab/index.cjs +17 -0
  204. package/tab-panel/index.cjs +6 -0
  205. package/tabs/index.cjs +24 -0
  206. package/tag/index.cjs +17 -0
  207. package/tag-group/index.cjs +7 -0
  208. package/text-anchor/index.cjs +24 -0
  209. package/text-area/index.cjs +25 -0
  210. package/text-field/index.cjs +27 -0
  211. package/toggletip/index.cjs +29 -0
  212. package/toggletip/index.js +0 -1
  213. package/tooltip/index.cjs +29 -0
  214. package/tooltip/index.js +0 -1
  215. package/tree-item/index.cjs +22 -0
  216. package/tree-view/index.cjs +14 -0
@@ -0,0 +1,74 @@
1
+ 'use strict';
2
+
3
+ const index = require('./index.cjs');
4
+
5
+ /**
6
+ * Some states and properties are applicable to all host language elements regardless of whether a role is applied.
7
+ * The following global states and properties are supported by all roles and by all base markup elements.
8
+ * {@link https://www.w3.org/TR/wai-aria-1.1/#global_states}
9
+ *
10
+ * This is intended to be used as a mixin. Be sure you extend FASTElement.
11
+ *
12
+ * @public
13
+ */
14
+ class ARIAGlobalStatesAndProperties {
15
+ }
16
+ index.__decorate([
17
+ index.attr({ attribute: "aria-atomic" })
18
+ ], ARIAGlobalStatesAndProperties.prototype, "ariaAtomic", void 0);
19
+ index.__decorate([
20
+ index.attr({ attribute: "aria-busy" })
21
+ ], ARIAGlobalStatesAndProperties.prototype, "ariaBusy", void 0);
22
+ index.__decorate([
23
+ index.attr({ attribute: "aria-controls" })
24
+ ], ARIAGlobalStatesAndProperties.prototype, "ariaControls", void 0);
25
+ index.__decorate([
26
+ index.attr({ attribute: "aria-current" })
27
+ ], ARIAGlobalStatesAndProperties.prototype, "ariaCurrent", void 0);
28
+ index.__decorate([
29
+ index.attr({ attribute: "aria-describedby" })
30
+ ], ARIAGlobalStatesAndProperties.prototype, "ariaDescribedby", void 0);
31
+ index.__decorate([
32
+ index.attr({ attribute: "aria-details" })
33
+ ], ARIAGlobalStatesAndProperties.prototype, "ariaDetails", void 0);
34
+ index.__decorate([
35
+ index.attr({ attribute: "aria-disabled" })
36
+ ], ARIAGlobalStatesAndProperties.prototype, "ariaDisabled", void 0);
37
+ index.__decorate([
38
+ index.attr({ attribute: "aria-errormessage" })
39
+ ], ARIAGlobalStatesAndProperties.prototype, "ariaErrormessage", void 0);
40
+ index.__decorate([
41
+ index.attr({ attribute: "aria-flowto" })
42
+ ], ARIAGlobalStatesAndProperties.prototype, "ariaFlowto", void 0);
43
+ index.__decorate([
44
+ index.attr({ attribute: "aria-haspopup" })
45
+ ], ARIAGlobalStatesAndProperties.prototype, "ariaHaspopup", void 0);
46
+ index.__decorate([
47
+ index.attr({ attribute: "aria-hidden" })
48
+ ], ARIAGlobalStatesAndProperties.prototype, "ariaHidden", void 0);
49
+ index.__decorate([
50
+ index.attr({ attribute: "aria-invalid" })
51
+ ], ARIAGlobalStatesAndProperties.prototype, "ariaInvalid", void 0);
52
+ index.__decorate([
53
+ index.attr({ attribute: "aria-keyshortcuts" })
54
+ ], ARIAGlobalStatesAndProperties.prototype, "ariaKeyshortcuts", void 0);
55
+ index.__decorate([
56
+ index.attr({ attribute: "aria-label" })
57
+ ], ARIAGlobalStatesAndProperties.prototype, "ariaLabel", void 0);
58
+ index.__decorate([
59
+ index.attr({ attribute: "aria-labelledby" })
60
+ ], ARIAGlobalStatesAndProperties.prototype, "ariaLabelledby", void 0);
61
+ index.__decorate([
62
+ index.attr({ attribute: "aria-live" })
63
+ ], ARIAGlobalStatesAndProperties.prototype, "ariaLive", void 0);
64
+ index.__decorate([
65
+ index.attr({ attribute: "aria-owns" })
66
+ ], ARIAGlobalStatesAndProperties.prototype, "ariaOwns", void 0);
67
+ index.__decorate([
68
+ index.attr({ attribute: "aria-relevant" })
69
+ ], ARIAGlobalStatesAndProperties.prototype, "ariaRelevant", void 0);
70
+ index.__decorate([
71
+ index.attr({ attribute: "aria-roledescription" })
72
+ ], ARIAGlobalStatesAndProperties.prototype, "ariaRoledescription", void 0);
73
+
74
+ exports.ARIAGlobalStatesAndProperties = ARIAGlobalStatesAndProperties;
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Standard orientation values
5
+ */
6
+ const Orientation = {
7
+ horizontal: "horizontal",
8
+ vertical: "vertical",
9
+ };
10
+
11
+ exports.Orientation = Orientation;
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Standard orientation values
5
+ */
6
+ const Orientation = {
7
+ horizontal: "horizontal",
8
+ vertical: "vertical",
9
+ };
10
+
11
+ exports.Orientation = Orientation;
@@ -0,0 +1,72 @@
1
+ 'use strict';
2
+
3
+ const index = require('./index.cjs');
4
+
5
+ /**
6
+ * An Progress HTML Element.
7
+ * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#progressbar | ARIA progressbar }.
8
+ *
9
+ * @slot indeterminate - The slot for a custom indeterminate indicator
10
+ * @csspart progress - Represents the progress element
11
+ * @csspart determinate - The determinate indicator
12
+ * @csspart indeterminate - The indeterminate indicator
13
+ *
14
+ * @public
15
+ */
16
+ class BaseProgress extends index.FoundationElement {
17
+ constructor() {
18
+ super(...arguments);
19
+ /**
20
+ * Indicates progress in %
21
+ * @internal
22
+ */
23
+ this.percentComplete = 0;
24
+ }
25
+ valueChanged() {
26
+ if (this.$fastController.isConnected) {
27
+ this.updatePercentComplete();
28
+ }
29
+ }
30
+ minChanged() {
31
+ if (this.$fastController.isConnected) {
32
+ this.updatePercentComplete();
33
+ }
34
+ }
35
+ maxChanged() {
36
+ if (this.$fastController.isConnected) {
37
+ this.updatePercentComplete();
38
+ }
39
+ }
40
+ /**
41
+ * @internal
42
+ */
43
+ connectedCallback() {
44
+ super.connectedCallback();
45
+ this.updatePercentComplete();
46
+ }
47
+ updatePercentComplete() {
48
+ const min = typeof this.min === "number" ? this.min : 0;
49
+ const max = typeof this.max === "number" ? this.max : 100;
50
+ const value = typeof this.value === "number" ? this.value : 0;
51
+ const range = max - min;
52
+ this.percentComplete =
53
+ range === 0 ? 0 : Math.fround(((value - min) / range) * 100);
54
+ }
55
+ }
56
+ index.__decorate([
57
+ index.attr({ converter: index.nullableNumberConverter })
58
+ ], BaseProgress.prototype, "value", void 0);
59
+ index.__decorate([
60
+ index.attr({ converter: index.nullableNumberConverter })
61
+ ], BaseProgress.prototype, "min", void 0);
62
+ index.__decorate([
63
+ index.attr({ converter: index.nullableNumberConverter })
64
+ ], BaseProgress.prototype, "max", void 0);
65
+ index.__decorate([
66
+ index.attr({ mode: "boolean" })
67
+ ], BaseProgress.prototype, "paused", void 0);
68
+ index.__decorate([
69
+ index.observable
70
+ ], BaseProgress.prototype, "percentComplete", void 0);
71
+
72
+ exports.BaseProgress = BaseProgress;
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ const index = require('./index.cjs');
4
+ const anchor = require('./anchor.cjs');
5
+ const applyMixins = require('./apply-mixins.cjs');
6
+ const startEnd = require('./start-end.cjs');
7
+
8
+ /**
9
+ * A Breadcrumb Item Custom HTML Element.
10
+ *
11
+ * @public
12
+ */
13
+ let BreadcrumbItem$1 = class BreadcrumbItem extends anchor.Anchor {
14
+ constructor() {
15
+ super(...arguments);
16
+ /**
17
+ * @internal
18
+ */
19
+ this.separator = true;
20
+ }
21
+ };
22
+ index.__decorate([
23
+ index.observable
24
+ ], BreadcrumbItem$1.prototype, "separator", void 0);
25
+ applyMixins.applyMixins(BreadcrumbItem$1, startEnd.StartEnd, anchor.DelegatesARIALink);
26
+
27
+ exports.BreadcrumbItem = BreadcrumbItem$1;
@@ -0,0 +1,202 @@
1
+ 'use strict';
2
+
3
+ const index = require('./index.cjs');
4
+ const applyMixins = require('./apply-mixins.cjs');
5
+ const formAssociated = require('./form-associated.cjs');
6
+ const ariaGlobal = require('./aria-global.cjs');
7
+ const startEnd = require('./start-end.cjs');
8
+
9
+ class _Button extends index.FoundationElement {
10
+ }
11
+ /**
12
+ * A form-associated base class for the {@link @microsoft/fast-foundation#(Button:class)} component.
13
+ *
14
+ * @internal
15
+ */
16
+ class FormAssociatedButton extends formAssociated.FormAssociated(_Button) {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.proxy = document.createElement("input");
20
+ }
21
+ }
22
+
23
+ /**
24
+ * A Button Custom HTML Element.
25
+ * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button | <button> element }.
26
+ *
27
+ * @slot start - Content which can be provided before the button content
28
+ * @slot end - Content which can be provided after the button content
29
+ * @slot - The default slot for button content
30
+ * @csspart control - The button element
31
+ * @csspart content - The element wrapping button content
32
+ *
33
+ * @public
34
+ */
35
+ let Button$1 = class Button extends FormAssociatedButton {
36
+ constructor() {
37
+ super(...arguments);
38
+ /**
39
+ * Prevent events to propagate if disabled and has no slotted content wrapped in HTML elements
40
+ * @internal
41
+ */
42
+ this.handleClick = (e) => {
43
+ var _a;
44
+ if (this.disabled && ((_a = this.defaultSlottedContent) === null || _a === void 0 ? void 0 : _a.length) <= 1) {
45
+ e.stopPropagation();
46
+ }
47
+ };
48
+ /**
49
+ * Submits the parent form
50
+ */
51
+ this.handleSubmission = () => {
52
+ if (!this.form) {
53
+ return;
54
+ }
55
+ const attached = this.proxy.isConnected;
56
+ if (!attached) {
57
+ this.attachProxy();
58
+ }
59
+ // Browser support for requestSubmit is not comprehensive
60
+ // so click the proxy if it isn't supported
61
+ typeof this.form.requestSubmit === "function"
62
+ ? this.form.requestSubmit(this.proxy)
63
+ : this.proxy.click();
64
+ if (!attached) {
65
+ this.detachProxy();
66
+ }
67
+ };
68
+ /**
69
+ * Resets the parent form
70
+ */
71
+ this.handleFormReset = () => {
72
+ var _a;
73
+ (_a = this.form) === null || _a === void 0 ? void 0 : _a.reset();
74
+ };
75
+ /**
76
+ * Overrides the focus call for where delegatesFocus is unsupported.
77
+ * This check works for Chrome, Edge Chromium, FireFox, and Safari
78
+ * Relevant PR on the Firefox browser: https://phabricator.services.mozilla.com/D123858
79
+ */
80
+ this.handleUnsupportedDelegatesFocus = () => {
81
+ var _a;
82
+ // Check to see if delegatesFocus is supported
83
+ if (window.ShadowRoot &&
84
+ !window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") &&
85
+ ((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) {
86
+ this.focus = () => {
87
+ this.control.focus();
88
+ };
89
+ }
90
+ };
91
+ }
92
+ formactionChanged() {
93
+ if (this.proxy instanceof HTMLInputElement) {
94
+ this.proxy.formAction = this.formaction;
95
+ }
96
+ }
97
+ formenctypeChanged() {
98
+ if (this.proxy instanceof HTMLInputElement) {
99
+ this.proxy.formEnctype = this.formenctype;
100
+ }
101
+ }
102
+ formmethodChanged() {
103
+ if (this.proxy instanceof HTMLInputElement) {
104
+ this.proxy.formMethod = this.formmethod;
105
+ }
106
+ }
107
+ formnovalidateChanged() {
108
+ if (this.proxy instanceof HTMLInputElement) {
109
+ this.proxy.formNoValidate = this.formnovalidate;
110
+ }
111
+ }
112
+ formtargetChanged() {
113
+ if (this.proxy instanceof HTMLInputElement) {
114
+ this.proxy.formTarget = this.formtarget;
115
+ }
116
+ }
117
+ typeChanged(previous, next) {
118
+ if (this.proxy instanceof HTMLInputElement) {
119
+ this.proxy.type = this.type;
120
+ }
121
+ next === "submit" && this.addEventListener("click", this.handleSubmission);
122
+ previous === "submit" && this.removeEventListener("click", this.handleSubmission);
123
+ next === "reset" && this.addEventListener("click", this.handleFormReset);
124
+ previous === "reset" && this.removeEventListener("click", this.handleFormReset);
125
+ }
126
+ /** {@inheritDoc (FormAssociated:interface).validate} */
127
+ validate() {
128
+ super.validate(this.control);
129
+ }
130
+ /**
131
+ * @internal
132
+ */
133
+ connectedCallback() {
134
+ var _a;
135
+ super.connectedCallback();
136
+ this.proxy.setAttribute("type", this.type);
137
+ this.handleUnsupportedDelegatesFocus();
138
+ const elements = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children);
139
+ if (elements) {
140
+ elements.forEach((span) => {
141
+ span.addEventListener("click", this.handleClick);
142
+ });
143
+ }
144
+ }
145
+ /**
146
+ * @internal
147
+ */
148
+ disconnectedCallback() {
149
+ var _a;
150
+ super.disconnectedCallback();
151
+ const elements = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children);
152
+ if (elements) {
153
+ elements.forEach((span) => {
154
+ span.removeEventListener("click", this.handleClick);
155
+ });
156
+ }
157
+ }
158
+ };
159
+ index.__decorate([
160
+ index.attr({ mode: "boolean" })
161
+ ], Button$1.prototype, "autofocus", void 0);
162
+ index.__decorate([
163
+ index.attr({ attribute: "form" })
164
+ ], Button$1.prototype, "formId", void 0);
165
+ index.__decorate([
166
+ index.attr
167
+ ], Button$1.prototype, "formaction", void 0);
168
+ index.__decorate([
169
+ index.attr
170
+ ], Button$1.prototype, "formenctype", void 0);
171
+ index.__decorate([
172
+ index.attr
173
+ ], Button$1.prototype, "formmethod", void 0);
174
+ index.__decorate([
175
+ index.attr({ mode: "boolean" })
176
+ ], Button$1.prototype, "formnovalidate", void 0);
177
+ index.__decorate([
178
+ index.attr
179
+ ], Button$1.prototype, "formtarget", void 0);
180
+ index.__decorate([
181
+ index.attr
182
+ ], Button$1.prototype, "type", void 0);
183
+ index.__decorate([
184
+ index.observable
185
+ ], Button$1.prototype, "defaultSlottedContent", void 0);
186
+ /**
187
+ * Includes ARIA states and properties relating to the ARIA button role
188
+ *
189
+ * @public
190
+ */
191
+ class DelegatesARIAButton {
192
+ }
193
+ index.__decorate([
194
+ index.attr({ attribute: "aria-expanded" })
195
+ ], DelegatesARIAButton.prototype, "ariaExpanded", void 0);
196
+ index.__decorate([
197
+ index.attr({ attribute: "aria-pressed" })
198
+ ], DelegatesARIAButton.prototype, "ariaPressed", void 0);
199
+ applyMixins.applyMixins(DelegatesARIAButton, ariaGlobal.ARIAGlobalStatesAndProperties);
200
+ applyMixins.applyMixins(Button$1, startEnd.StartEnd, DelegatesARIAButton);
201
+
202
+ exports.Button = Button$1;
@@ -0,0 +1,41 @@
1
+ 'use strict';
2
+
3
+ const index = require('./index.cjs');
4
+
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __decorateClass = (decorators, target, key, kind) => {
8
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
9
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
10
+ if (decorator = decorators[i])
11
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
12
+ if (kind && result)
13
+ __defProp(target, key, result);
14
+ return result;
15
+ };
16
+ class CalendarEvent extends index.FoundationElement {
17
+ // TODO should be converted to allowed range
18
+ }
19
+ __decorateClass([
20
+ index.attr
21
+ ], CalendarEvent.prototype, "heading", 2);
22
+ __decorateClass([
23
+ index.attr
24
+ ], CalendarEvent.prototype, "description", 2);
25
+ __decorateClass([
26
+ index.attr
27
+ ], CalendarEvent.prototype, "connotation", 2);
28
+ __decorateClass([
29
+ index.attr
30
+ ], CalendarEvent.prototype, "appearance", 2);
31
+ __decorateClass([
32
+ index.attr({ converter: index.nullableNumberConverter, attribute: "overlap-count" })
33
+ ], CalendarEvent.prototype, "overlapCount", 2);
34
+ __decorateClass([
35
+ index.attr({ converter: index.nullableNumberConverter })
36
+ ], CalendarEvent.prototype, "start", 2);
37
+ __decorateClass([
38
+ index.attr({ converter: index.nullableNumberConverter })
39
+ ], CalendarEvent.prototype, "duration", 2);
40
+
41
+ exports.CalendarEvent = CalendarEvent;
@@ -0,0 +1,61 @@
1
+ 'use strict';
2
+
3
+ const index = require('./index.cjs');
4
+ const slotted = require('./slotted.cjs');
5
+
6
+ /**
7
+ * The runtime behavior for child node observation.
8
+ * @public
9
+ */
10
+ class ChildrenBehavior extends slotted.NodeObservationBehavior {
11
+ /**
12
+ * Creates an instance of ChildrenBehavior.
13
+ * @param target - The element target to observe children on.
14
+ * @param options - The options to use when observing the element children.
15
+ */
16
+ constructor(target, options) {
17
+ super(target, options);
18
+ this.observer = null;
19
+ options.childList = true;
20
+ }
21
+ /**
22
+ * Begins observation of the nodes.
23
+ */
24
+ observe() {
25
+ if (this.observer === null) {
26
+ this.observer = new MutationObserver(this.handleEvent.bind(this));
27
+ }
28
+ this.observer.observe(this.target, this.options);
29
+ }
30
+ /**
31
+ * Disconnects observation of the nodes.
32
+ */
33
+ disconnect() {
34
+ this.observer.disconnect();
35
+ }
36
+ /**
37
+ * Retrieves the nodes that should be assigned to the target.
38
+ */
39
+ getNodes() {
40
+ if ("subtree" in this.options) {
41
+ return Array.from(this.target.querySelectorAll(this.options.selector));
42
+ }
43
+ return Array.from(this.target.childNodes);
44
+ }
45
+ }
46
+ /**
47
+ * A directive that observes the `childNodes` of an element and updates a property
48
+ * whenever they change.
49
+ * @param propertyOrOptions - The options used to configure child node observation.
50
+ * @public
51
+ */
52
+ function children(propertyOrOptions) {
53
+ if (typeof propertyOrOptions === "string") {
54
+ propertyOrOptions = {
55
+ property: propertyOrOptions,
56
+ };
57
+ }
58
+ return new index.AttachedBehaviorHTMLDirective("fast-children", ChildrenBehavior, propertyOrOptions);
59
+ }
60
+
61
+ exports.children = children;
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ function classNames(...args) {
4
+ return args.reduce((accum, value) => {
5
+ const leadingChar = accum.length ? " " : "";
6
+ const normalizedValue = Array.isArray(value) && value[1]
7
+ ? classNames.call(null, value[0])
8
+ : typeof value === "function"
9
+ ? value()
10
+ : typeof value === "string"
11
+ ? value
12
+ : "";
13
+ return !normalizedValue.length ? accum : accum + leadingChar + normalizedValue;
14
+ }, "");
15
+ }
16
+
17
+ exports.classNames = classNames;
@@ -0,0 +1,165 @@
1
+ 'use strict';
2
+
3
+ const index = require('./index.cjs');
4
+ const definition = require('./definition26.cjs');
5
+ const definition$1 = require('./definition58.cjs');
6
+ const affix = require('./affix.cjs');
7
+ const applyMixins = require('./apply-mixins.cjs');
8
+ const startEnd = require('./start-end.cjs');
9
+ const ref = require('./ref.cjs');
10
+ const when = require('./when.cjs');
11
+
12
+ /**
13
+ * An individual item in an {@link @microsoft/fast-foundation#(Accordion:class) }.
14
+ *
15
+ * @slot start - Content which can be provided between the heading and the icon
16
+ * @slot end - Content which can be provided between the start slot and icon
17
+ * @slot heading - Content which serves as the accordion item heading and text of the expand button
18
+ * @slot - The default slot for accordion item content
19
+ * @slot expanded-icon - The expanded icon
20
+ * @slot collapsed-icon - The collapsed icon
21
+ * @fires change - Fires a custom 'change' event when the button is invoked
22
+ * @csspart heading - Wraps the button
23
+ * @csspart button - The button which serves to invoke the item
24
+ * @csspart heading-content - Wraps the slot for the heading content within the button
25
+ * @csspart icon - The icon container
26
+ * @csspart expanded-icon - The expanded icon slot
27
+ * @csspart collapsed-icon - The collapsed icon
28
+ * @csspart region - The wrapper for the accordion item content
29
+ *
30
+ * @public
31
+ */
32
+ let AccordionItem$1 = class AccordionItem extends index.FoundationElement {
33
+ constructor() {
34
+ super(...arguments);
35
+ /**
36
+ * Configures the {@link https://www.w3.org/TR/wai-aria-1.1/#aria-level | level} of the
37
+ * heading element.
38
+ *
39
+ * @defaultValue 2
40
+ * @public
41
+ * @remarks
42
+ * HTML attribute: heading-level
43
+ */
44
+ this.headinglevel = 2;
45
+ /**
46
+ * Expands or collapses the item.
47
+ *
48
+ * @public
49
+ * @remarks
50
+ * HTML attribute: expanded
51
+ */
52
+ this.expanded = false;
53
+ /**
54
+ * @internal
55
+ */
56
+ this.clickHandler = (e) => {
57
+ this.expanded = !this.expanded;
58
+ this.change();
59
+ };
60
+ this.change = () => {
61
+ this.$emit("change");
62
+ };
63
+ }
64
+ };
65
+ index.__decorate([
66
+ index.attr({
67
+ attribute: "heading-level",
68
+ mode: "fromView",
69
+ converter: index.nullableNumberConverter,
70
+ })
71
+ ], AccordionItem$1.prototype, "headinglevel", void 0);
72
+ index.__decorate([
73
+ index.attr({ mode: "boolean" })
74
+ ], AccordionItem$1.prototype, "expanded", void 0);
75
+ index.__decorate([
76
+ index.attr
77
+ ], AccordionItem$1.prototype, "id", void 0);
78
+ applyMixins.applyMixins(AccordionItem$1, startEnd.StartEnd);
79
+
80
+ const styles = ":host{display:flex;box-sizing:border-box;flex-direction:column}.heading-container{margin:0}.heading-button{--focus-stroke-gap-color: transparent;display:flex;width:100%;align-items:center;padding:16px;border:none;background-color:var(--_appearance-color-fill);color:var(--_appearance-color-text);cursor:pointer;text-align:left}.heading-button{--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.heading-button:where(:hover,.hover):where(:not(:disabled,.disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.heading-button:where(:active,.active):where(:not(:disabled,.disabled)){--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.heading-button{--_connotation-color-primary: var(--vvd-accordion-item-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-faint: var(--vvd-accordion-item-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-accordion-item-accent-soft, var(--vvd-color-neutral-100))}.heading-button:focus-visible{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px))}.heading-button.size-condensed{font:var(--vvd-typography-base-bold);gap:12px}.heading-button:not(.size-condensed){font:var(--vvd-typography-heading-4);gap:16px}.heading-content{flex:auto}.meta{overflow:hidden;max-width:20%;flex-shrink:0;color:var(--vvd-color-neutral-600);text-align:end;text-overflow:ellipsis;white-space:nowrap}.heading-button:not(.size-condensed) .meta{font:var(--vvd-typography-base-bold)}.heading-button.size-condensed .meta{font:var(--vvd-typography-base-condensed-bold)}.region{display:none;padding:8px 32px 24px 16px}.region:not(.size-condensed).padded{padding-inline-start:52px}:host([expanded]) .region{display:block}.region.size-condensed.padded{padding-inline-start:44px}slot[name=icon]{color:var(--vvd-color-neutral-600)}.heading-button:not(.size-condensed) slot[name=icon]{font:inherit}.heading-button.size-condensed slot[name=icon]{font:var(--vvd-typography-base-extended)}:host(:not([icon-trailing])) slot[name=icon]:last-of-type{color:var(--_appearance-color-text)}\n";
81
+
82
+ var __defProp = Object.defineProperty;
83
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
84
+ var __decorateClass = (decorators, target, key, kind) => {
85
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
86
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
87
+ if (decorator = decorators[i])
88
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
89
+ if (kind && result)
90
+ __defProp(target, key, result);
91
+ return result;
92
+ };
93
+ class AccordionItem extends AccordionItem$1 {
94
+ constructor() {
95
+ super(...arguments);
96
+ this.noIndicator = false;
97
+ }
98
+ }
99
+ __decorateClass([
100
+ index.attr
101
+ ], AccordionItem.prototype, "heading", 2);
102
+ __decorateClass([
103
+ index.attr({ mode: "boolean", attribute: "no-indicator" })
104
+ ], AccordionItem.prototype, "noIndicator", 2);
105
+ __decorateClass([
106
+ index.attr
107
+ ], AccordionItem.prototype, "meta", 2);
108
+ __decorateClass([
109
+ index.attr
110
+ ], AccordionItem.prototype, "size", 2);
111
+ applyMixins.applyMixins(AccordionItem, affix.AffixIconWithTrailing);
112
+
113
+ const header = (context, hTag) => {
114
+ const affixIconTemplate = affix.affixIconTemplateFactory(context);
115
+ return index.html`
116
+ <${hTag} class="heading-container">
117
+ <button
118
+ class="heading-button ${(x) => x.size ? `size-${x.size}` : ""}"
119
+ id="${(x) => x.id}"
120
+ aria-expanded="${(x) => x.expanded}"
121
+ aria-controls="${(x) => x.id}-panel"
122
+ @click="${(x, c) => x.clickHandler(c.event)}"
123
+ ${ref.ref("expandbutton")}
124
+ >
125
+
126
+ ${(x) => !x.iconTrailing ? affixIconTemplate(x.icon, affix.IconWrapper.Slot) : null}
127
+
128
+ <span class="heading-content">${(x) => x.heading}</span>
129
+
130
+ ${when.when((x) => x.meta, index.html`<span class="meta">${(x) => x.meta}</span>`)}
131
+
132
+ ${(x) => x.icon && x.iconTrailing ? affixIconTemplate(x.icon) : null}
133
+ ${(x) => !(x.icon && x.iconTrailing) && !x.noIndicator ? affixIconTemplate(x.expanded ? "chevron-up-solid" : "chevron-down-solid") : null}
134
+
135
+ </button>
136
+ </${hTag}>
137
+ `;
138
+ };
139
+ const AccordionItemTemplate = (context) => index.html`
140
+ ${(x) => header(context, "h" + x.headinglevel)}
141
+ <div
142
+ id="${(x) => x.id}-panel"
143
+ aria-labelledby="${(x) => x.id}"
144
+ role="region"
145
+ class="region ${(x) => x.icon && !x.iconTrailing ? "padded" : ""} ${(x) => x.size ? `size-${x.size}` : ""}"
146
+ >
147
+ <slot></slot>
148
+ </div>
149
+ `;
150
+
151
+ const accordionItemDefinition = AccordionItem.compose({
152
+ baseName: "accordion-item",
153
+ template: AccordionItemTemplate,
154
+ styles,
155
+ shadowOptions: {
156
+ delegatesFocus: true
157
+ }
158
+ });
159
+ const accordionItemRegistries = [accordionItemDefinition(), ...definition.iconRegistries, ...definition$1.focusRegistries];
160
+ const registerAccordionItem = index.registerFactory(accordionItemRegistries);
161
+
162
+ exports.AccordionItem = AccordionItem$1;
163
+ exports.accordionItemDefinition = accordionItemDefinition;
164
+ exports.accordionItemRegistries = accordionItemRegistries;
165
+ exports.registerAccordionItem = registerAccordionItem;