@vonage/vivid 4.10.0 → 4.12.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 (94) hide show
  1. package/custom-elements.json +8630 -6433
  2. package/lib/badge/badge.d.ts +1 -1
  3. package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  4. package/lib/button/button.d.ts +1 -1
  5. package/lib/checkbox/checkbox.d.ts +5 -3
  6. package/lib/checkbox/checkbox.form-associated.d.ts +10 -0
  7. package/lib/enums.d.ts +1 -0
  8. package/lib/fab/fab.d.ts +2 -2
  9. package/lib/file-picker/file-picker.d.ts +3 -0
  10. package/lib/slider/slider.d.ts +30 -6
  11. package/lib/slider/slider.form-associated.d.ts +10 -0
  12. package/lib/split-button/split-button.d.ts +1 -1
  13. package/lib/tabs/tabs.d.ts +1 -0
  14. package/package.json +1 -1
  15. package/shared/aria-global2.cjs +93 -0
  16. package/shared/aria-global2.js +91 -0
  17. package/shared/breadcrumb-item.cjs +2 -89
  18. package/shared/breadcrumb-item.js +1 -88
  19. package/shared/definition11.cjs +200 -4
  20. package/shared/definition11.js +198 -3
  21. package/shared/definition15.cjs +34 -91
  22. package/shared/definition15.js +35 -92
  23. package/shared/definition16.cjs +9 -7
  24. package/shared/definition16.js +9 -7
  25. package/shared/definition20.cjs +1 -1
  26. package/shared/definition20.js +1 -1
  27. package/shared/definition21.cjs +1 -1
  28. package/shared/definition21.js +1 -1
  29. package/shared/definition24.cjs +156 -2
  30. package/shared/definition24.js +157 -3
  31. package/shared/definition25.cjs +106 -56
  32. package/shared/definition25.js +106 -56
  33. package/shared/definition35.cjs +2 -2
  34. package/shared/definition35.js +2 -2
  35. package/shared/definition37.cjs +1 -1
  36. package/shared/definition37.js +1 -1
  37. package/shared/definition4.cjs +5 -6
  38. package/shared/definition4.js +1 -2
  39. package/shared/definition40.cjs +11 -4
  40. package/shared/definition40.js +8 -1
  41. package/shared/definition42.cjs +3 -22
  42. package/shared/definition42.js +2 -21
  43. package/shared/definition43.cjs +1 -2
  44. package/shared/definition43.js +1 -2
  45. package/shared/definition44.js +1 -1
  46. package/shared/definition47.cjs +369 -502
  47. package/shared/definition47.js +370 -503
  48. package/shared/definition5.cjs +4 -4
  49. package/shared/definition5.js +1 -1
  50. package/shared/definition51.cjs +1 -1
  51. package/shared/definition51.js +1 -1
  52. package/shared/definition52.cjs +63 -26
  53. package/shared/definition52.js +63 -26
  54. package/shared/definition56.cjs +41 -43
  55. package/shared/definition56.js +41 -43
  56. package/shared/definition57.cjs +1 -1
  57. package/shared/definition57.js +1 -1
  58. package/shared/definition58.cjs +1 -1
  59. package/shared/definition58.js +1 -1
  60. package/shared/definition59.cjs +1 -1
  61. package/shared/definition59.js +1 -1
  62. package/shared/definition64.cjs +278 -90
  63. package/shared/definition64.js +278 -90
  64. package/shared/definition7.cjs +1 -1
  65. package/shared/definition7.js +1 -1
  66. package/shared/definition8.cjs +1 -1
  67. package/shared/definition8.js +1 -1
  68. package/shared/enums.cjs +1 -0
  69. package/shared/enums.js +1 -0
  70. package/shared/form-associated.js +1 -1
  71. package/shared/{patterns → foundation/anchor}/anchor.d.ts +1 -1
  72. package/shared/foundation/button/button.d.ts +27 -0
  73. package/shared/foundation/button/button.template.d.ts +4 -0
  74. package/shared/foundation/button/index.d.ts +2 -0
  75. package/shared/foundation/patterns/index.d.ts +1 -0
  76. package/shared/index.cjs +22 -2
  77. package/shared/index.js +22 -2
  78. package/shared/key-codes2.js +1 -1
  79. package/shared/presentationDate.cjs +4328 -4042
  80. package/shared/presentationDate.js +4327 -4041
  81. package/shared/slider.template.cjs +23 -1
  82. package/shared/slider.template.js +21 -2
  83. package/styles/core/all.css +1 -1
  84. package/styles/core/theme.css +1 -1
  85. package/styles/core/typography.css +1 -1
  86. package/styles/tokens/theme-dark.css +4 -4
  87. package/styles/tokens/theme-light.css +4 -4
  88. package/styles/tokens/vivid-2-compat.css +1 -1
  89. package/vivid.api.json +52 -4
  90. package/shared/aria2.cjs +0 -11
  91. package/shared/aria2.js +0 -9
  92. package/shared/button.cjs +0 -202
  93. package/shared/button.js +0 -200
  94. /package/shared/{patterns → foundation/patterns}/aria-global.d.ts +0 -0
@@ -4,14 +4,209 @@ const index = require('./index.cjs');
4
4
  const definition$1 = require('./definition27.cjs');
5
5
  const definition = require('./definition38.cjs');
6
6
  const affix = require('./affix.cjs');
7
- const button = require('./button.cjs');
8
7
  const applyMixins = require('./apply-mixins.cjs');
8
+ const formAssociated = require('./form-associated.cjs');
9
+ const ariaGlobal = require('./aria-global.cjs');
10
+ const startEnd = require('./start-end.cjs');
9
11
  const enums = require('./enums.cjs');
10
12
  const icon = require('./icon.cjs');
11
13
  const when = require('./when.cjs');
12
14
  const ref = require('./ref.cjs');
13
15
  const classNames = require('./class-names.cjs');
14
16
 
17
+ class _Button extends index.FoundationElement {
18
+ }
19
+ /**
20
+ * A form-associated base class for the {@link @microsoft/fast-foundation#(Button:class)} component.
21
+ *
22
+ * @internal
23
+ */
24
+ class FormAssociatedButton extends formAssociated.FormAssociated(_Button) {
25
+ constructor() {
26
+ super(...arguments);
27
+ this.proxy = document.createElement("input");
28
+ }
29
+ }
30
+
31
+ /**
32
+ * A Button Custom HTML Element.
33
+ * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button | <button> element }.
34
+ *
35
+ * @slot start - Content which can be provided before the button content
36
+ * @slot end - Content which can be provided after the button content
37
+ * @slot - The default slot for button content
38
+ * @csspart control - The button element
39
+ * @csspart content - The element wrapping button content
40
+ *
41
+ * @public
42
+ */
43
+ let Button$1 = class Button extends FormAssociatedButton {
44
+ constructor() {
45
+ super(...arguments);
46
+ /**
47
+ * Prevent events to propagate if disabled and has no slotted content wrapped in HTML elements
48
+ * @internal
49
+ */
50
+ this.handleClick = (e) => {
51
+ var _a;
52
+ if (this.disabled && ((_a = this.defaultSlottedContent) === null || _a === void 0 ? void 0 : _a.length) <= 1) {
53
+ e.stopPropagation();
54
+ }
55
+ };
56
+ /**
57
+ * Submits the parent form
58
+ */
59
+ this.handleSubmission = () => {
60
+ if (!this.form) {
61
+ return;
62
+ }
63
+ const attached = this.proxy.isConnected;
64
+ if (!attached) {
65
+ this.attachProxy();
66
+ }
67
+ // Browser support for requestSubmit is not comprehensive
68
+ // so click the proxy if it isn't supported
69
+ typeof this.form.requestSubmit === "function"
70
+ ? this.form.requestSubmit(this.proxy)
71
+ : this.proxy.click();
72
+ if (!attached) {
73
+ this.detachProxy();
74
+ }
75
+ };
76
+ /**
77
+ * Resets the parent form
78
+ */
79
+ this.handleFormReset = () => {
80
+ var _a;
81
+ (_a = this.form) === null || _a === void 0 ? void 0 : _a.reset();
82
+ };
83
+ /**
84
+ * Overrides the focus call for where delegatesFocus is unsupported.
85
+ * This check works for Chrome, Edge Chromium, FireFox, and Safari
86
+ * Relevant PR on the Firefox browser: https://phabricator.services.mozilla.com/D123858
87
+ */
88
+ this.handleUnsupportedDelegatesFocus = () => {
89
+ var _a;
90
+ // Check to see if delegatesFocus is supported
91
+ if (window.ShadowRoot &&
92
+ !window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") &&
93
+ ((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) {
94
+ this.focus = () => {
95
+ this.control.focus();
96
+ };
97
+ }
98
+ };
99
+ }
100
+ formactionChanged() {
101
+ if (this.proxy instanceof HTMLInputElement) {
102
+ this.proxy.formAction = this.formaction;
103
+ }
104
+ }
105
+ formenctypeChanged() {
106
+ if (this.proxy instanceof HTMLInputElement) {
107
+ this.proxy.formEnctype = this.formenctype;
108
+ }
109
+ }
110
+ formmethodChanged() {
111
+ if (this.proxy instanceof HTMLInputElement) {
112
+ this.proxy.formMethod = this.formmethod;
113
+ }
114
+ }
115
+ formnovalidateChanged() {
116
+ if (this.proxy instanceof HTMLInputElement) {
117
+ this.proxy.formNoValidate = this.formnovalidate;
118
+ }
119
+ }
120
+ formtargetChanged() {
121
+ if (this.proxy instanceof HTMLInputElement) {
122
+ this.proxy.formTarget = this.formtarget;
123
+ }
124
+ }
125
+ typeChanged(previous, next) {
126
+ if (this.proxy instanceof HTMLInputElement) {
127
+ this.proxy.type = this.type;
128
+ }
129
+ next === "submit" && this.addEventListener("click", this.handleSubmission);
130
+ previous === "submit" && this.removeEventListener("click", this.handleSubmission);
131
+ next === "reset" && this.addEventListener("click", this.handleFormReset);
132
+ previous === "reset" && this.removeEventListener("click", this.handleFormReset);
133
+ }
134
+ /** {@inheritDoc (FormAssociated:interface).validate} */
135
+ validate() {
136
+ super.validate(this.control);
137
+ }
138
+ /**
139
+ * @internal
140
+ */
141
+ connectedCallback() {
142
+ var _a;
143
+ super.connectedCallback();
144
+ this.proxy.setAttribute("type", this.type);
145
+ this.handleUnsupportedDelegatesFocus();
146
+ const elements = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children);
147
+ if (elements) {
148
+ elements.forEach((span) => {
149
+ span.addEventListener("click", this.handleClick);
150
+ });
151
+ }
152
+ }
153
+ /**
154
+ * @internal
155
+ */
156
+ disconnectedCallback() {
157
+ var _a;
158
+ super.disconnectedCallback();
159
+ const elements = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children);
160
+ if (elements) {
161
+ elements.forEach((span) => {
162
+ span.removeEventListener("click", this.handleClick);
163
+ });
164
+ }
165
+ }
166
+ };
167
+ index.__decorate([
168
+ index.attr({ mode: "boolean" })
169
+ ], Button$1.prototype, "autofocus", void 0);
170
+ index.__decorate([
171
+ index.attr({ attribute: "form" })
172
+ ], Button$1.prototype, "formId", void 0);
173
+ index.__decorate([
174
+ index.attr
175
+ ], Button$1.prototype, "formaction", void 0);
176
+ index.__decorate([
177
+ index.attr
178
+ ], Button$1.prototype, "formenctype", void 0);
179
+ index.__decorate([
180
+ index.attr
181
+ ], Button$1.prototype, "formmethod", void 0);
182
+ index.__decorate([
183
+ index.attr({ mode: "boolean" })
184
+ ], Button$1.prototype, "formnovalidate", void 0);
185
+ index.__decorate([
186
+ index.attr
187
+ ], Button$1.prototype, "formtarget", void 0);
188
+ index.__decorate([
189
+ index.attr
190
+ ], Button$1.prototype, "type", void 0);
191
+ index.__decorate([
192
+ index.observable
193
+ ], Button$1.prototype, "defaultSlottedContent", void 0);
194
+ /**
195
+ * Includes ARIA states and properties relating to the ARIA button role
196
+ *
197
+ * @public
198
+ */
199
+ class DelegatesARIAButton {
200
+ }
201
+ index.__decorate([
202
+ index.attr({ attribute: "aria-expanded" })
203
+ ], DelegatesARIAButton.prototype, "ariaExpanded", void 0);
204
+ index.__decorate([
205
+ index.attr({ attribute: "aria-pressed" })
206
+ ], DelegatesARIAButton.prototype, "ariaPressed", void 0);
207
+ applyMixins.applyMixins(DelegatesARIAButton, ariaGlobal.ARIAGlobalStatesAndProperties);
208
+ applyMixins.applyMixins(Button$1, startEnd.StartEnd, DelegatesARIAButton);
209
+
15
210
  var __defProp = Object.defineProperty;
16
211
  var __decorateClass = (decorators, target, key, kind) => {
17
212
  var result = void 0 ;
@@ -21,7 +216,7 @@ var __decorateClass = (decorators, target, key, kind) => {
21
216
  if (result) __defProp(target, key, result);
22
217
  return result;
23
218
  };
24
- class Button extends button.Button {
219
+ class Button extends Button$1 {
25
220
  constructor() {
26
221
  super();
27
222
  this.stacked = false;
@@ -240,7 +435,7 @@ const buttonTemplate = (context) => {
240
435
 
241
436
  const buttonDefinition = Button.compose({
242
437
  baseName: "button",
243
- baseClass: button.Button,
438
+ baseClass: Button$1,
244
439
  template: buttonTemplate,
245
440
  styles,
246
441
  shadowOptions: {
@@ -254,7 +449,8 @@ const buttonRegistries = [
254
449
  ];
255
450
  const registerButton = index.registerFactory(buttonRegistries);
256
451
 
257
- exports.Button = Button;
452
+ exports.Button = Button$1;
453
+ exports.Button$1 = Button;
258
454
  exports.buttonDefinition = buttonDefinition;
259
455
  exports.buttonRegistries = buttonRegistries;
260
456
  exports.chevronTemplateFactory = chevronTemplateFactory;
@@ -1,15 +1,210 @@
1
- import { a as attr, h as html, r as registerFactory } from './index.js';
1
+ import { F as FoundationElement, _ as __decorate, a as attr, o as observable, h as html, r as registerFactory } from './index.js';
2
2
  import { a as iconRegistries } from './definition27.js';
3
3
  import { P as ProgressRing, a as progressRingRegistries } from './definition38.js';
4
4
  import { b as AffixIconWithTrailing, a as affixIconTemplateFactory, I as IconWrapper } from './affix.js';
5
- import { B as Button$1 } from './button.js';
6
5
  import { a as applyMixins } from './apply-mixins.js';
6
+ import { F as FormAssociated } from './form-associated.js';
7
+ import { A as ARIAGlobalStatesAndProperties } from './aria-global.js';
8
+ import { S as StartEnd } from './start-end.js';
7
9
  import { b as Size } from './enums.js';
8
10
  import { I as Icon } from './icon.js';
9
11
  import { w as when } from './when.js';
10
12
  import { r as ref } from './ref.js';
11
13
  import { c as classNames } from './class-names.js';
12
14
 
15
+ class _Button extends FoundationElement {
16
+ }
17
+ /**
18
+ * A form-associated base class for the {@link @microsoft/fast-foundation#(Button:class)} component.
19
+ *
20
+ * @internal
21
+ */
22
+ class FormAssociatedButton extends FormAssociated(_Button) {
23
+ constructor() {
24
+ super(...arguments);
25
+ this.proxy = document.createElement("input");
26
+ }
27
+ }
28
+
29
+ /**
30
+ * A Button Custom HTML Element.
31
+ * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button | <button> element }.
32
+ *
33
+ * @slot start - Content which can be provided before the button content
34
+ * @slot end - Content which can be provided after the button content
35
+ * @slot - The default slot for button content
36
+ * @csspart control - The button element
37
+ * @csspart content - The element wrapping button content
38
+ *
39
+ * @public
40
+ */
41
+ let Button$1 = class Button extends FormAssociatedButton {
42
+ constructor() {
43
+ super(...arguments);
44
+ /**
45
+ * Prevent events to propagate if disabled and has no slotted content wrapped in HTML elements
46
+ * @internal
47
+ */
48
+ this.handleClick = (e) => {
49
+ var _a;
50
+ if (this.disabled && ((_a = this.defaultSlottedContent) === null || _a === void 0 ? void 0 : _a.length) <= 1) {
51
+ e.stopPropagation();
52
+ }
53
+ };
54
+ /**
55
+ * Submits the parent form
56
+ */
57
+ this.handleSubmission = () => {
58
+ if (!this.form) {
59
+ return;
60
+ }
61
+ const attached = this.proxy.isConnected;
62
+ if (!attached) {
63
+ this.attachProxy();
64
+ }
65
+ // Browser support for requestSubmit is not comprehensive
66
+ // so click the proxy if it isn't supported
67
+ typeof this.form.requestSubmit === "function"
68
+ ? this.form.requestSubmit(this.proxy)
69
+ : this.proxy.click();
70
+ if (!attached) {
71
+ this.detachProxy();
72
+ }
73
+ };
74
+ /**
75
+ * Resets the parent form
76
+ */
77
+ this.handleFormReset = () => {
78
+ var _a;
79
+ (_a = this.form) === null || _a === void 0 ? void 0 : _a.reset();
80
+ };
81
+ /**
82
+ * Overrides the focus call for where delegatesFocus is unsupported.
83
+ * This check works for Chrome, Edge Chromium, FireFox, and Safari
84
+ * Relevant PR on the Firefox browser: https://phabricator.services.mozilla.com/D123858
85
+ */
86
+ this.handleUnsupportedDelegatesFocus = () => {
87
+ var _a;
88
+ // Check to see if delegatesFocus is supported
89
+ if (window.ShadowRoot &&
90
+ !window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") &&
91
+ ((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) {
92
+ this.focus = () => {
93
+ this.control.focus();
94
+ };
95
+ }
96
+ };
97
+ }
98
+ formactionChanged() {
99
+ if (this.proxy instanceof HTMLInputElement) {
100
+ this.proxy.formAction = this.formaction;
101
+ }
102
+ }
103
+ formenctypeChanged() {
104
+ if (this.proxy instanceof HTMLInputElement) {
105
+ this.proxy.formEnctype = this.formenctype;
106
+ }
107
+ }
108
+ formmethodChanged() {
109
+ if (this.proxy instanceof HTMLInputElement) {
110
+ this.proxy.formMethod = this.formmethod;
111
+ }
112
+ }
113
+ formnovalidateChanged() {
114
+ if (this.proxy instanceof HTMLInputElement) {
115
+ this.proxy.formNoValidate = this.formnovalidate;
116
+ }
117
+ }
118
+ formtargetChanged() {
119
+ if (this.proxy instanceof HTMLInputElement) {
120
+ this.proxy.formTarget = this.formtarget;
121
+ }
122
+ }
123
+ typeChanged(previous, next) {
124
+ if (this.proxy instanceof HTMLInputElement) {
125
+ this.proxy.type = this.type;
126
+ }
127
+ next === "submit" && this.addEventListener("click", this.handleSubmission);
128
+ previous === "submit" && this.removeEventListener("click", this.handleSubmission);
129
+ next === "reset" && this.addEventListener("click", this.handleFormReset);
130
+ previous === "reset" && this.removeEventListener("click", this.handleFormReset);
131
+ }
132
+ /** {@inheritDoc (FormAssociated:interface).validate} */
133
+ validate() {
134
+ super.validate(this.control);
135
+ }
136
+ /**
137
+ * @internal
138
+ */
139
+ connectedCallback() {
140
+ var _a;
141
+ super.connectedCallback();
142
+ this.proxy.setAttribute("type", this.type);
143
+ this.handleUnsupportedDelegatesFocus();
144
+ const elements = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children);
145
+ if (elements) {
146
+ elements.forEach((span) => {
147
+ span.addEventListener("click", this.handleClick);
148
+ });
149
+ }
150
+ }
151
+ /**
152
+ * @internal
153
+ */
154
+ disconnectedCallback() {
155
+ var _a;
156
+ super.disconnectedCallback();
157
+ const elements = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children);
158
+ if (elements) {
159
+ elements.forEach((span) => {
160
+ span.removeEventListener("click", this.handleClick);
161
+ });
162
+ }
163
+ }
164
+ };
165
+ __decorate([
166
+ attr({ mode: "boolean" })
167
+ ], Button$1.prototype, "autofocus", void 0);
168
+ __decorate([
169
+ attr({ attribute: "form" })
170
+ ], Button$1.prototype, "formId", void 0);
171
+ __decorate([
172
+ attr
173
+ ], Button$1.prototype, "formaction", void 0);
174
+ __decorate([
175
+ attr
176
+ ], Button$1.prototype, "formenctype", void 0);
177
+ __decorate([
178
+ attr
179
+ ], Button$1.prototype, "formmethod", void 0);
180
+ __decorate([
181
+ attr({ mode: "boolean" })
182
+ ], Button$1.prototype, "formnovalidate", void 0);
183
+ __decorate([
184
+ attr
185
+ ], Button$1.prototype, "formtarget", void 0);
186
+ __decorate([
187
+ attr
188
+ ], Button$1.prototype, "type", void 0);
189
+ __decorate([
190
+ observable
191
+ ], Button$1.prototype, "defaultSlottedContent", void 0);
192
+ /**
193
+ * Includes ARIA states and properties relating to the ARIA button role
194
+ *
195
+ * @public
196
+ */
197
+ class DelegatesARIAButton {
198
+ }
199
+ __decorate([
200
+ attr({ attribute: "aria-expanded" })
201
+ ], DelegatesARIAButton.prototype, "ariaExpanded", void 0);
202
+ __decorate([
203
+ attr({ attribute: "aria-pressed" })
204
+ ], DelegatesARIAButton.prototype, "ariaPressed", void 0);
205
+ applyMixins(DelegatesARIAButton, ARIAGlobalStatesAndProperties);
206
+ applyMixins(Button$1, StartEnd, DelegatesARIAButton);
207
+
13
208
  var __defProp = Object.defineProperty;
14
209
  var __decorateClass = (decorators, target, key, kind) => {
15
210
  var result = void 0 ;
@@ -252,4 +447,4 @@ const buttonRegistries = [
252
447
  ];
253
448
  const registerButton = registerFactory(buttonRegistries);
254
449
 
255
- export { Button as B, buttonRegistries as a, buttonDefinition as b, chevronTemplateFactory as c, registerButton as r };
450
+ export { Button$1 as B, buttonRegistries as a, buttonDefinition as b, Button as c, chevronTemplateFactory as d, registerButton as r };
@@ -4,101 +4,23 @@ const index = require('./index.cjs');
4
4
  const definition = require('./definition27.cjs');
5
5
  const applyMixinsWithObservables = require('./applyMixinsWithObservables.cjs');
6
6
  const formAssociated = require('./form-associated.cjs');
7
- const keyCodes = require('./key-codes.cjs');
8
7
  const formElements = require('./form-elements.cjs');
9
8
  const icon = require('./icon.cjs');
10
9
  const when = require('./when.cjs');
11
10
  const slotted = require('./slotted.cjs');
12
11
  const classNames = require('./class-names.cjs');
13
12
 
13
+ const styles = ":host{display:inline-flex;flex-direction:column;vertical-align:middle}:host([disabled]){cursor:not-allowed}.base.connotation-cta{--_connotation-color-primary: var(--vvd-checkbox-cta-primary, var(--vvd-color-cta-500));--_connotation-color-primary-text: var(--vvd-checkbox-cta-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-checkbox-cta-primary-increment, var(--vvd-color-cta-600));--_connotation-color-fierce: var(--vvd-checkbox-cta-fierce, var(--vvd-color-cta-700));--_connotation-color-intermediate: var(--vvd-checkbox-cta-intermediate, var(--vvd-color-cta-500));--_connotation-color-firm: var(--vvd-checkbox-cta-firm, var(--vvd-color-cta-600))}.base:not(.connotation-cta){--_connotation-color-primary: var(--vvd-checkbox-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-checkbox-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-checkbox-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-fierce: var(--vvd-checkbox-accent-fierce, var(--vvd-color-neutral-700));--_connotation-color-intermediate: var(--vvd-checkbox-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-firm: var(--vvd-checkbox-accent-firm, var(--vvd-color-canvas-text))}.base{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-intermediate)}.base:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-fierce)}.base:where(.checked,:checked):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: var(--_connotation-color-primary)}.base:where(.checked,:checked):where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary-increment);--_appearance-color-outline: var(--_connotation-color-primary-increment)}.base:where(.disabled,:disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.base:where(.readonly):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: var(--vvd-color-neutral-400)}.base{display:inline-flex;align-items:center;gap:8px;vertical-align:middle}.base:focus-visible{outline:none}@supports (user-select: none){.base{user-select:none}}.base:not(.disabled){cursor:pointer}.base.disabled{pointer-events:none}.control{position:relative;display:flex;flex-shrink:0;align-items:center;justify-content:center;border-radius:4px;background-color:var(--_appearance-color-fill);block-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)));box-shadow:inset 0 0 0 2px var(--_appearance-color-outline);color:var(--_appearance-color-text);inline-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.base:focus-visible .control{--focus-inset: -3px;--focus-stroke-gap-color: transparent}.base:focus-visible .control:before{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));position:absolute;display:block;border-radius:2px;block-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)));content:\"\";inline-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.base.error:not(.checked) .control{background-color:var(--vvd-color-alert-50);box-shadow:inset 0 0 0 2px var(--vvd-color-alert-500)}.indicator{font-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)) - 4px)}.base:not(.checked) .indicator.checkmark{display:none}.base.checked .indicator.minus,.base:not(.indeterminate) .indicator.minus{display:none}label{display:flex;flex-wrap:wrap;align-items:center;color:var(--vvd-color-canvas-text);column-gap:4px;cursor:pointer;font:var(--vvd-typography-base)}.hide-label label{display:none}.icon{font-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2))*.6);line-height:1}.message{margin-block-start:4px;--_low-ink-color: var(--vvd-color-neutral-600)}";
14
+
14
15
  class _Checkbox extends index.FoundationElement {
15
16
  }
16
- /**
17
- * A form-associated base class for the {@link @microsoft/fast-foundation#(Checkbox:class)} component.
18
- *
19
- * @internal
20
- */
21
17
  class FormAssociatedCheckbox extends formAssociated.CheckableFormAssociated(_Checkbox) {
22
- constructor() {
23
- super(...arguments);
24
- this.proxy = document.createElement("input");
25
- }
18
+ constructor() {
19
+ super(...arguments);
20
+ this.proxy = document.createElement("input");
21
+ }
26
22
  }
27
23
 
28
- /**
29
- * A Checkbox Custom HTML Element.
30
- * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#checkbox | ARIA checkbox }.
31
- *
32
- * @slot checked-indicator - The checked indicator
33
- * @slot indeterminate-indicator - The indeterminate indicator
34
- * @slot - The default slot for the label
35
- * @csspart control - The element representing the visual checkbox control
36
- * @csspart label - The label
37
- * @fires change - Emits a custom change event when the checked state changes
38
- *
39
- * @public
40
- */
41
- let Checkbox$1 = class Checkbox extends FormAssociatedCheckbox {
42
- constructor() {
43
- super();
44
- /**
45
- * The element's value to be included in form submission when checked.
46
- * Default to "on" to reach parity with input[type="checkbox"]
47
- *
48
- * @internal
49
- */
50
- this.initialValue = "on";
51
- /**
52
- * The indeterminate state of the control
53
- */
54
- this.indeterminate = false;
55
- /**
56
- * @internal
57
- */
58
- this.keypressHandler = (e) => {
59
- if (this.readOnly) {
60
- return;
61
- }
62
- switch (e.key) {
63
- case keyCodes.keySpace:
64
- if (this.indeterminate) {
65
- this.indeterminate = false;
66
- }
67
- this.checked = !this.checked;
68
- break;
69
- }
70
- };
71
- /**
72
- * @internal
73
- */
74
- this.clickHandler = (e) => {
75
- if (!this.disabled && !this.readOnly) {
76
- if (this.indeterminate) {
77
- this.indeterminate = false;
78
- }
79
- this.checked = !this.checked;
80
- }
81
- };
82
- this.proxy.setAttribute("type", "checkbox");
83
- }
84
- readOnlyChanged() {
85
- if (this.proxy instanceof HTMLInputElement) {
86
- this.proxy.readOnly = this.readOnly;
87
- }
88
- }
89
- };
90
- index.__decorate([
91
- index.attr({ attribute: "readonly", mode: "boolean" })
92
- ], Checkbox$1.prototype, "readOnly", void 0);
93
- index.__decorate([
94
- index.observable
95
- ], Checkbox$1.prototype, "defaultSlottedNodes", void 0);
96
- index.__decorate([
97
- index.observable
98
- ], Checkbox$1.prototype, "indeterminate", void 0);
99
-
100
- const styles = ":host{display:inline-flex;flex-direction:column;vertical-align:middle}:host([disabled]){cursor:not-allowed}.base.connotation-cta{--_connotation-color-primary: var(--vvd-checkbox-cta-primary, var(--vvd-color-cta-500));--_connotation-color-primary-text: var(--vvd-checkbox-cta-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-checkbox-cta-primary-increment, var(--vvd-color-cta-600));--_connotation-color-fierce: var(--vvd-checkbox-cta-fierce, var(--vvd-color-cta-700));--_connotation-color-intermediate: var(--vvd-checkbox-cta-intermediate, var(--vvd-color-cta-500));--_connotation-color-firm: var(--vvd-checkbox-cta-firm, var(--vvd-color-cta-600))}.base:not(.connotation-cta){--_connotation-color-primary: var(--vvd-checkbox-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-checkbox-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-checkbox-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-fierce: var(--vvd-checkbox-accent-fierce, var(--vvd-color-neutral-700));--_connotation-color-intermediate: var(--vvd-checkbox-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-firm: var(--vvd-checkbox-accent-firm, var(--vvd-color-canvas-text))}.base{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-intermediate)}.base:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-fierce)}.base:where(.checked,:checked):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: var(--_connotation-color-primary)}.base:where(.checked,:checked):where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary-increment);--_appearance-color-outline: var(--_connotation-color-primary-increment)}.base:where(.disabled,:disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.base:where(.readonly):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: var(--vvd-color-neutral-400)}.base{display:inline-flex;align-items:center;gap:8px;vertical-align:middle}.base:focus-visible{outline:none}@supports (user-select: none){.base{user-select:none}}.base:not(.disabled){cursor:pointer}.base.disabled{pointer-events:none}.control{position:relative;display:flex;flex-shrink:0;align-items:center;justify-content:center;border-radius:4px;background-color:var(--_appearance-color-fill);block-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)));box-shadow:inset 0 0 0 2px var(--_appearance-color-outline);color:var(--_appearance-color-text);inline-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.base:focus-visible .control{--focus-inset: -3px;--focus-stroke-gap-color: transparent}.base:focus-visible .control:before{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));position:absolute;display:block;border-radius:2px;block-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)));content:\"\";inline-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.base.error:not(.checked) .control{background-color:var(--vvd-color-alert-50);box-shadow:inset 0 0 0 2px var(--vvd-color-alert-500)}.indicator{font-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)) - 4px)}.base:not(.checked) .indicator.checkmark{display:none}.base.checked .indicator.minus,.base:not(.indeterminate) .indicator.minus{display:none}label{display:flex;flex-wrap:wrap;align-items:center;color:var(--vvd-color-canvas-text);column-gap:4px;cursor:pointer;font:var(--vvd-typography-base)}.hide-label label{display:none}.icon{font-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2))*.6);line-height:1}.message{margin-block-start:4px;--_low-ink-color: var(--vvd-color-neutral-600)}";
101
-
102
24
  var __defProp = Object.defineProperty;
103
25
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
104
26
  var __decorateClass = (decorators, target, key, kind) => {
@@ -110,17 +32,24 @@ var __decorateClass = (decorators, target, key, kind) => {
110
32
  return result;
111
33
  };
112
34
  const keySpace = " ";
113
- exports.Checkbox = class Checkbox extends Checkbox$1 {
35
+ exports.Checkbox = class Checkbox extends FormAssociatedCheckbox {
114
36
  constructor() {
115
- super(...arguments);
37
+ super();
116
38
  this.ariaLabel = null;
117
39
  this.tabindex = null;
118
40
  this.ariaChecked = null;
119
41
  /**
120
- * !remove method as will be implemented by fast-foundation in version after 2.46.9
42
+ * The element's value to be included in form submission when checked.
43
+ * Default to "on" to reach parity with input[type="checkbox"]
121
44
  *
122
45
  * @internal
123
46
  */
47
+ this.initialValue = "on";
48
+ this.defaultSlottedNodes = [];
49
+ this.indeterminate = false;
50
+ /**
51
+ * @internal
52
+ */
124
53
  this.keypressHandler = (event) => {
125
54
  if (event.target instanceof HTMLAnchorElement) {
126
55
  return true;
@@ -138,8 +67,6 @@ exports.Checkbox = class Checkbox extends Checkbox$1 {
138
67
  return false;
139
68
  };
140
69
  /**
141
- * !remove method as will be implemented by fast-foundation in version after 2.46.9
142
- *
143
70
  * @internal
144
71
  */
145
72
  this.clickHandler = (event) => {
@@ -154,9 +81,16 @@ exports.Checkbox = class Checkbox extends Checkbox$1 {
154
81
  }
155
82
  return false;
156
83
  };
84
+ this.proxy.setAttribute("type", "checkbox");
157
85
  }
158
- indeterminateChanged(_, next) {
159
- this.checked = !next;
86
+ // Map to proxy element
87
+ /**
88
+ * @internal
89
+ */
90
+ readOnlyChanged() {
91
+ if (this.proxy instanceof HTMLInputElement) {
92
+ this.proxy.readOnly = this.readOnly;
93
+ }
160
94
  }
161
95
  ariaCheckedChanged() {
162
96
  if (this.ariaChecked === "mixed") {
@@ -189,6 +123,15 @@ __decorateClass([
189
123
  __decorateClass([
190
124
  index.attr({ attribute: "aria-checked" })
191
125
  ], exports.Checkbox.prototype, "ariaChecked", 2);
126
+ __decorateClass([
127
+ index.attr({ attribute: "readonly", mode: "boolean" })
128
+ ], exports.Checkbox.prototype, "readOnly", 2);
129
+ __decorateClass([
130
+ index.observable
131
+ ], exports.Checkbox.prototype, "defaultSlottedNodes", 2);
132
+ __decorateClass([
133
+ index.observable
134
+ ], exports.Checkbox.prototype, "indeterminate", 2);
192
135
  __decorateClass([
193
136
  index.observable
194
137
  ], exports.Checkbox.prototype, "slottedContent", 2);