@vonage/vivid 4.1.0 → 4.3.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 (138) hide show
  1. package/appearance-ui/index.cjs +1 -2
  2. package/appearance-ui/index.js +1 -2
  3. package/custom-elements.json +62 -0
  4. package/lib/button/button.d.ts +1 -0
  5. package/lib/switch/switch.d.ts +1 -1
  6. package/package.json +1 -1
  7. package/shared/affix.cjs +1 -2
  8. package/shared/affix.js +1 -2
  9. package/shared/anchored.cjs +1 -2
  10. package/shared/anchored.js +1 -2
  11. package/shared/calendar-event.cjs +1 -2
  12. package/shared/calendar-event.js +1 -2
  13. package/shared/definition.cjs +1 -2
  14. package/shared/definition.js +1 -2
  15. package/shared/definition11.cjs +29 -13
  16. package/shared/definition11.js +29 -14
  17. package/shared/definition12.cjs +1 -1
  18. package/shared/definition12.js +1 -1
  19. package/shared/definition13.cjs +1 -2
  20. package/shared/definition13.js +1 -2
  21. package/shared/definition14.cjs +1 -2
  22. package/shared/definition14.js +1 -2
  23. package/shared/definition15.cjs +1 -2
  24. package/shared/definition15.js +1 -2
  25. package/shared/definition16.cjs +1 -2
  26. package/shared/definition16.js +1 -2
  27. package/shared/definition17.cjs +5 -9
  28. package/shared/definition17.js +5 -9
  29. package/shared/definition18.cjs +14 -22
  30. package/shared/definition18.js +14 -22
  31. package/shared/definition19.cjs +29 -50
  32. package/shared/definition19.js +29 -50
  33. package/shared/definition20.cjs +1 -2
  34. package/shared/definition20.js +1 -2
  35. package/shared/definition21.cjs +1 -2
  36. package/shared/definition21.js +1 -2
  37. package/shared/definition23.cjs +1 -2
  38. package/shared/definition23.js +1 -2
  39. package/shared/definition24.cjs +2 -3
  40. package/shared/definition24.js +2 -3
  41. package/shared/definition25.cjs +22 -47
  42. package/shared/definition25.js +22 -47
  43. package/shared/definition26.cjs +1 -2
  44. package/shared/definition26.js +1 -2
  45. package/shared/definition28.cjs +1 -2
  46. package/shared/definition28.js +1 -2
  47. package/shared/definition29.cjs +69 -39
  48. package/shared/definition29.js +69 -39
  49. package/shared/definition3.cjs +1 -2
  50. package/shared/definition3.js +1 -2
  51. package/shared/definition31.cjs +1 -2
  52. package/shared/definition31.js +1 -2
  53. package/shared/definition34.cjs +1 -2
  54. package/shared/definition34.js +1 -2
  55. package/shared/definition35.cjs +14 -26
  56. package/shared/definition35.js +14 -26
  57. package/shared/definition36.cjs +1 -2
  58. package/shared/definition36.js +1 -2
  59. package/shared/definition37.cjs +8 -16
  60. package/shared/definition37.js +8 -16
  61. package/shared/definition38.cjs +1 -2
  62. package/shared/definition38.js +1 -2
  63. package/shared/definition39.cjs +1 -2
  64. package/shared/definition39.js +1 -2
  65. package/shared/definition4.cjs +7 -13
  66. package/shared/definition4.js +7 -13
  67. package/shared/definition40.cjs +1 -2
  68. package/shared/definition40.js +1 -2
  69. package/shared/definition42.cjs +52 -91
  70. package/shared/definition42.js +52 -91
  71. package/shared/definition43.cjs +7 -6
  72. package/shared/definition43.js +5 -4
  73. package/shared/definition44.cjs +4 -8
  74. package/shared/definition44.js +4 -8
  75. package/shared/definition45.cjs +1 -2
  76. package/shared/definition45.js +1 -2
  77. package/shared/definition46.cjs +1 -2
  78. package/shared/definition46.js +1 -2
  79. package/shared/definition47.cjs +1 -2
  80. package/shared/definition47.js +1 -2
  81. package/shared/definition48.cjs +2 -3
  82. package/shared/definition48.js +2 -3
  83. package/shared/definition5.cjs +1 -2
  84. package/shared/definition5.js +1 -2
  85. package/shared/definition50.cjs +1 -2
  86. package/shared/definition50.js +1 -2
  87. package/shared/definition51.cjs +5 -10
  88. package/shared/definition51.js +5 -10
  89. package/shared/definition52.cjs +1 -2
  90. package/shared/definition52.js +1 -2
  91. package/shared/definition53.cjs +1 -2
  92. package/shared/definition53.js +1 -2
  93. package/shared/definition54.cjs +9 -21
  94. package/shared/definition54.js +9 -21
  95. package/shared/definition55.cjs +24 -43
  96. package/shared/definition55.js +24 -43
  97. package/shared/definition56.cjs +23 -38
  98. package/shared/definition56.js +23 -38
  99. package/shared/definition57.cjs +22 -45
  100. package/shared/definition57.js +22 -45
  101. package/shared/definition58.cjs +18 -37
  102. package/shared/definition58.js +18 -37
  103. package/shared/definition59.cjs +1 -2
  104. package/shared/definition59.js +1 -2
  105. package/shared/definition6.cjs +1 -2
  106. package/shared/definition6.js +1 -2
  107. package/shared/definition62.cjs +1 -2
  108. package/shared/definition62.js +1 -2
  109. package/shared/definition63.cjs +1 -2
  110. package/shared/definition63.js +1 -2
  111. package/shared/definition7.cjs +1 -2
  112. package/shared/definition7.js +1 -2
  113. package/shared/definition8.cjs +1 -2
  114. package/shared/definition8.js +1 -2
  115. package/shared/definition9.cjs +1 -2
  116. package/shared/definition9.js +1 -2
  117. package/shared/icon.cjs +2 -3
  118. package/shared/icon.js +2 -3
  119. package/shared/index2.cjs +3 -6
  120. package/shared/index2.js +3 -6
  121. package/shared/listbox.cjs +1 -2
  122. package/shared/listbox.js +1 -2
  123. package/shared/patterns/chevron.d.ts +2 -0
  124. package/shared/presentationDate.cjs +1 -2
  125. package/shared/presentationDate.js +1 -2
  126. package/shared/radio.cjs +1 -2
  127. package/shared/radio.js +1 -2
  128. package/shared/text-anchor.cjs +1 -2
  129. package/shared/text-anchor.js +1 -2
  130. package/shared/video-player.cjs +4 -8
  131. package/shared/video-player.js +4 -8
  132. package/styles/core/all.css +1 -1
  133. package/styles/core/theme.css +1 -1
  134. package/styles/core/typography.css +1 -1
  135. package/styles/tokens/theme-dark.css +4 -4
  136. package/styles/tokens/theme-light.css +4 -4
  137. package/styles/tokens/vivid-2-compat.css +1 -1
  138. package/vivid.api.json +3021 -1112
@@ -2150,49 +2150,29 @@ class FormAssociatedFilePicker extends FormAssociated(_FilePicker) {
2150
2150
 
2151
2151
  var __defProp = Object.defineProperty;
2152
2152
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
2153
+ var __typeError = (msg) => {
2154
+ throw TypeError(msg);
2155
+ };
2153
2156
  var __decorateClass = (decorators, target, key, kind) => {
2154
2157
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
2155
2158
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
2156
2159
  if (decorator = decorators[i])
2157
2160
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
2158
- if (kind && result)
2159
- __defProp(target, key, result);
2161
+ if (kind && result) __defProp(target, key, result);
2160
2162
  return result;
2161
2163
  };
2162
- var __accessCheck = (obj, member, msg) => {
2163
- if (!member.has(obj))
2164
- throw TypeError("Cannot " + msg);
2165
- };
2166
- var __privateGet = (obj, member, getter) => {
2167
- __accessCheck(obj, member, "read from private field");
2168
- return getter ? getter.call(obj) : member.get(obj);
2169
- };
2170
- var __privateAdd = (obj, member, value) => {
2171
- if (member.has(obj))
2172
- throw TypeError("Cannot add the same private member more than once");
2173
- member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
2174
- };
2175
- var __privateSet = (obj, member, value, setter) => {
2176
- __accessCheck(obj, member, "write to private field");
2177
- member.set(obj, value);
2178
- return value;
2179
- };
2180
- var __privateMethod = (obj, member, method) => {
2181
- __accessCheck(obj, member, "access private method");
2182
- return method;
2183
- };
2184
- var _dropzone, _chooseFile, chooseFile_fn, _updateHiddenFileInput, updateHiddenFileInput_fn, _handleFilesChanged, handleFilesChanged_fn, _updateFormValue, updateFormValue_fn, _setValueToAFakePathLikeNativeInput, setValueToAFakePathLikeNativeInput_fn, _formatNumbersInMessage, formatNumbersInMessage_fn;
2164
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
2165
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
2166
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
2167
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
2168
+ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
2169
+ var _dropzone, _FilePicker_instances, chooseFile_fn, updateHiddenFileInput_fn, handleFilesChanged_fn, updateFormValue_fn, setValueToAFakePathLikeNativeInput_fn, formatNumbersInMessage_fn;
2185
2170
  const isFormAssociatedTryingToSetFormValueToFakePath = (value) => typeof value === "string";
2186
2171
  let FilePicker = class extends FormAssociatedFilePicker {
2187
2172
  constructor() {
2188
2173
  super();
2189
- __privateAdd(this, _chooseFile);
2190
- __privateAdd(this, _updateHiddenFileInput);
2191
- __privateAdd(this, _handleFilesChanged);
2192
- __privateAdd(this, _updateFormValue);
2193
- __privateAdd(this, _setValueToAFakePathLikeNativeInput);
2194
- __privateAdd(this, _formatNumbersInMessage);
2195
- __privateAdd(this, _dropzone, void 0);
2174
+ __privateAdd(this, _FilePicker_instances);
2175
+ __privateAdd(this, _dropzone);
2196
2176
  this.maxFileSize = 256;
2197
2177
  /**
2198
2178
  * Used internally to hold the tag that button is registered at.
@@ -2219,7 +2199,7 @@ let FilePicker = class extends FormAssociatedFilePicker {
2219
2199
  return;
2220
2200
  }
2221
2201
  __privateGet(this, _dropzone).options.maxFiles = newValue;
2222
- __privateMethod(this, _updateHiddenFileInput, updateHiddenFileInput_fn).call(this);
2202
+ __privateMethod(this, _FilePicker_instances, updateHiddenFileInput_fn).call(this);
2223
2203
  }
2224
2204
  maxFileSizeChanged(_oldValue, newValue) {
2225
2205
  if (!__privateGet(this, _dropzone)) {
@@ -2235,7 +2215,7 @@ let FilePicker = class extends FormAssociatedFilePicker {
2235
2215
  }
2236
2216
  nameChanged(previous, next) {
2237
2217
  super.nameChanged(previous, next);
2238
- __privateMethod(this, _updateFormValue, updateFormValue_fn).call(this);
2218
+ __privateMethod(this, _FilePicker_instances, updateFormValue_fn).call(this);
2239
2219
  }
2240
2220
  connectedCallback() {
2241
2221
  super.connectedCallback();
@@ -2277,13 +2257,13 @@ let FilePicker = class extends FormAssociatedFilePicker {
2277
2257
  for (const node of file.previewElement.querySelectorAll(
2278
2258
  "[data-dz-errormessage]"
2279
2259
  )) {
2280
- node.textContent = __privateMethod(this, _formatNumbersInMessage, formatNumbersInMessage_fn).call(this, message);
2260
+ node.textContent = __privateMethod(this, _FilePicker_instances, formatNumbersInMessage_fn).call(this, message);
2281
2261
  }
2282
2262
  }
2283
2263
  }
2284
2264
  }));
2285
2265
  __privateGet(this, _dropzone).filesize = (size) => {
2286
- return __privateMethod(this, _formatNumbersInMessage, formatNumbersInMessage_fn).call(this, $3ed269f2f0fb224b$export$2e2bcd8739ae039.prototype.filesize.call(__privateGet(this, _dropzone), size));
2266
+ return __privateMethod(this, _FilePicker_instances, formatNumbersInMessage_fn).call(this, $3ed269f2f0fb224b$export$2e2bcd8739ae039.prototype.filesize.call(__privateGet(this, _dropzone), size));
2287
2267
  };
2288
2268
  __privateGet(this, _dropzone).on("addedfiles", (files) => {
2289
2269
  for (const file of files) {
@@ -2298,10 +2278,10 @@ let FilePicker = class extends FormAssociatedFilePicker {
2298
2278
  });
2299
2279
  }
2300
2280
  }
2301
- __privateMethod(this, _handleFilesChanged, handleFilesChanged_fn).call(this);
2281
+ __privateMethod(this, _FilePicker_instances, handleFilesChanged_fn).call(this);
2302
2282
  });
2303
2283
  __privateGet(this, _dropzone).on("removedfile", () => {
2304
- __privateMethod(this, _handleFilesChanged, handleFilesChanged_fn).call(this);
2284
+ __privateMethod(this, _FilePicker_instances, handleFilesChanged_fn).call(this);
2305
2285
  });
2306
2286
  __privateGet(this, _dropzone).on("error", (file) => {
2307
2287
  if (file.previewElement) {
@@ -2328,7 +2308,7 @@ let FilePicker = class extends FormAssociatedFilePicker {
2328
2308
  */
2329
2309
  handleKeydown(e) {
2330
2310
  if (e.key === "Enter" || e.key === " ") {
2331
- __privateMethod(this, _chooseFile, chooseFile_fn).call(this);
2311
+ __privateMethod(this, _FilePicker_instances, chooseFile_fn).call(this);
2332
2312
  }
2333
2313
  return true;
2334
2314
  }
@@ -2341,13 +2321,12 @@ let FilePicker = class extends FormAssociatedFilePicker {
2341
2321
  }
2342
2322
  };
2343
2323
  _dropzone = new WeakMap();
2344
- _chooseFile = new WeakSet();
2324
+ _FilePicker_instances = new WeakSet();
2345
2325
  chooseFile_fn = function() {
2346
2326
  if (__privateGet(this, _dropzone).hiddenFileInput) {
2347
2327
  __privateGet(this, _dropzone).hiddenFileInput.click();
2348
2328
  }
2349
2329
  };
2350
- _updateHiddenFileInput = new WeakSet();
2351
2330
  updateHiddenFileInput_fn = function() {
2352
2331
  if (__privateGet(this, _dropzone).hiddenFileInput) {
2353
2332
  __privateGet(this, _dropzone).hiddenFileInput.dispatchEvent(
@@ -2355,12 +2334,10 @@ updateHiddenFileInput_fn = function() {
2355
2334
  );
2356
2335
  }
2357
2336
  };
2358
- _handleFilesChanged = new WeakSet();
2359
2337
  handleFilesChanged_fn = function() {
2360
2338
  this.$emit("change");
2361
- __privateMethod(this, _updateFormValue, updateFormValue_fn).call(this);
2339
+ __privateMethod(this, _FilePicker_instances, updateFormValue_fn).call(this);
2362
2340
  };
2363
- _updateFormValue = new WeakSet();
2364
2341
  updateFormValue_fn = function() {
2365
2342
  const files = this.files;
2366
2343
  if (!this.name) {
@@ -2372,13 +2349,11 @@ updateFormValue_fn = function() {
2372
2349
  }
2373
2350
  this.setFormValue(formData);
2374
2351
  }
2375
- __privateMethod(this, _setValueToAFakePathLikeNativeInput, setValueToAFakePathLikeNativeInput_fn).call(this);
2352
+ __privateMethod(this, _FilePicker_instances, setValueToAFakePathLikeNativeInput_fn).call(this);
2376
2353
  };
2377
- _setValueToAFakePathLikeNativeInput = new WeakSet();
2378
2354
  setValueToAFakePathLikeNativeInput_fn = function() {
2379
2355
  this.value = this.files.length > 0 ? `C:\\fakepath\\${this.files[0].name}` : "";
2380
2356
  };
2381
- _formatNumbersInMessage = new WeakSet();
2382
2357
  formatNumbersInMessage_fn = function(message) {
2383
2358
  if (this.locale.common.useCommaAsDecimalSeparator) {
2384
2359
  return message.replace(/(\d+)\.(\d+)/g, "$1,$2");
@@ -12,8 +12,7 @@ var __decorateClass = (decorators, target, key, kind) => {
12
12
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
13
13
  if (decorator = decorators[i])
14
14
  result = (decorator(target, key, result) ) || result;
15
- if (result)
16
- __defProp(target, key, result);
15
+ if (result) __defProp(target, key, result);
17
16
  return result;
18
17
  };
19
18
  class Header extends index.FoundationElement {
@@ -10,8 +10,7 @@ var __decorateClass = (decorators, target, key, kind) => {
10
10
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
11
11
  if (decorator = decorators[i])
12
12
  result = (decorator(target, key, result) ) || result;
13
- if (result)
14
- __defProp(target, key, result);
13
+ if (result) __defProp(target, key, result);
15
14
  return result;
16
15
  };
17
16
  class Header extends FoundationElement {
@@ -9,8 +9,7 @@ var __decorateClass = (decorators, target, key, kind) => {
9
9
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
10
10
  if (decorator = decorators[i])
11
11
  result = (decorator(target, key, result) ) || result;
12
- if (result)
13
- __defProp(target, key, result);
12
+ if (result) __defProp(target, key, result);
14
13
  return result;
15
14
  };
16
15
  class Layout extends index.FoundationElement {
@@ -7,8 +7,7 @@ var __decorateClass = (decorators, target, key, kind) => {
7
7
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8
8
  if (decorator = decorators[i])
9
9
  result = (decorator(target, key, result) ) || result;
10
- if (result)
11
- __defProp(target, key, result);
10
+ if (result) __defProp(target, key, result);
12
11
  return result;
13
12
  };
14
13
  class Layout extends FoundationElement {
@@ -2,6 +2,7 @@
2
2
 
3
3
  const index = require('./index.cjs');
4
4
  const definition = require('./definition27.cjs');
5
+ const keyCodes$1 = require('./key-codes2.cjs');
5
6
  const affix = require('./affix.cjs');
6
7
  const anchored = require('./anchored.cjs');
7
8
  const startEnd = require('./start-end.cjs');
@@ -574,49 +575,35 @@ const styles = ":host(:focus-visible){outline:none}:host([disabled]){pointer-eve
574
575
 
575
576
  var __defProp$1 = Object.defineProperty;
576
577
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
578
+ var __typeError = (msg) => {
579
+ throw TypeError(msg);
580
+ };
577
581
  var __decorateClass$1 = (decorators, target, key, kind) => {
578
582
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
579
583
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
580
584
  if (decorator = decorators[i])
581
585
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
582
- if (kind && result)
583
- __defProp$1(target, key, result);
586
+ if (kind && result) __defProp$1(target, key, result);
584
587
  return result;
585
588
  };
586
- var __accessCheck = (obj, member, msg) => {
587
- if (!member.has(obj))
588
- throw TypeError("Cannot " + msg);
589
- };
590
- var __privateGet = (obj, member, getter) => {
591
- __accessCheck(obj, member, "read from private field");
592
- return getter ? getter.call(obj) : member.get(obj);
593
- };
594
- var __privateAdd = (obj, member, value) => {
595
- if (member.has(obj))
596
- throw TypeError("Cannot add the same private member more than once");
597
- member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
598
- };
599
- var __privateMethod = (obj, member, method) => {
600
- __accessCheck(obj, member, "access private method");
601
- return method;
602
- };
603
- var _triggerBehaviour, triggerBehaviour_get, _setupAnchor, setupAnchor_fn, _updateAnchor, updateAnchor_fn, _cleanupAnchor, cleanupAnchor_fn, _onAnchorClick;
589
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
590
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
591
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
592
+ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
593
+ var _Menu_instances, triggerBehaviour_get, setupAnchor_fn, updateAnchor_fn, cleanupAnchor_fn, _onAnchorClick;
604
594
  exports.Menu = class Menu extends Menu$1 {
605
595
  constructor() {
606
596
  super();
607
- __privateAdd(this, _triggerBehaviour);
608
- __privateAdd(this, _setupAnchor);
609
- __privateAdd(this, _updateAnchor);
610
- __privateAdd(this, _cleanupAnchor);
597
+ __privateAdd(this, _Menu_instances);
611
598
  this.ariaLabel = null;
612
599
  this.placement = "bottom";
613
600
  this.autoDismiss = false;
614
601
  this.open = false;
615
602
  __privateAdd(this, _onAnchorClick, () => {
616
- if (__privateGet(this, _triggerBehaviour, triggerBehaviour_get) === "off") {
603
+ if (__privateGet(this, _Menu_instances, triggerBehaviour_get) === "off") {
617
604
  return;
618
605
  }
619
- if (__privateGet(this, _triggerBehaviour, triggerBehaviour_get) === "legacy" && this.open) {
606
+ if (__privateGet(this, _Menu_instances, triggerBehaviour_get) === "legacy" && this.open) {
620
607
  return;
621
608
  }
622
609
  const newValue = !this.open;
@@ -649,45 +636,40 @@ exports.Menu = class Menu extends Menu$1 {
649
636
  openChanged(_, newValue) {
650
637
  newValue ? this.$emit("open", void 0, { bubbles: false }) : this.$emit("close", void 0, { bubbles: false });
651
638
  if (this._anchorEl) {
652
- __privateMethod(this, _updateAnchor, updateAnchor_fn).call(this, this._anchorEl);
639
+ __privateMethod(this, _Menu_instances, updateAnchor_fn).call(this, this._anchorEl);
653
640
  }
654
641
  }
655
642
  /**
656
643
  * @internal
657
644
  */
658
645
  _anchorElChanged(oldValue, newValue) {
659
- if (oldValue)
660
- __privateMethod(this, _cleanupAnchor, cleanupAnchor_fn).call(this, oldValue);
661
- if (newValue)
662
- __privateMethod(this, _setupAnchor, setupAnchor_fn).call(this, newValue);
646
+ if (oldValue) __privateMethod(this, _Menu_instances, cleanupAnchor_fn).call(this, oldValue);
647
+ if (newValue) __privateMethod(this, _Menu_instances, setupAnchor_fn).call(this, newValue);
663
648
  }
664
649
  /**
665
650
  * @internal
666
651
  */
667
652
  _onChange(e) {
668
653
  const clickedOnNonCheckboxMenuItem = e.target instanceof HTMLElement && (e.target.role === "menuitem" || e.target.role === "menuitemradio");
669
- if (__privateGet(this, _triggerBehaviour, triggerBehaviour_get) === "auto" && clickedOnNonCheckboxMenuItem) {
654
+ if (__privateGet(this, _Menu_instances, triggerBehaviour_get) === "auto" && clickedOnNonCheckboxMenuItem) {
670
655
  this.open = false;
671
656
  }
672
657
  return true;
673
658
  }
674
659
  };
675
- _triggerBehaviour = new WeakSet();
660
+ _Menu_instances = new WeakSet();
676
661
  triggerBehaviour_get = function() {
677
662
  return this.trigger ?? "legacy";
678
663
  };
679
- _setupAnchor = new WeakSet();
680
664
  setupAnchor_fn = function(a) {
681
665
  a.addEventListener("click", __privateGet(this, _onAnchorClick), true);
682
666
  a.addEventListener("focusout", this._onFocusout);
683
667
  a.setAttribute("aria-haspopup", "menu");
684
- __privateMethod(this, _updateAnchor, updateAnchor_fn).call(this, a);
668
+ __privateMethod(this, _Menu_instances, updateAnchor_fn).call(this, a);
685
669
  };
686
- _updateAnchor = new WeakSet();
687
670
  updateAnchor_fn = function(a) {
688
671
  a.setAttribute("aria-expanded", this.open.toString());
689
672
  };
690
- _cleanupAnchor = new WeakSet();
691
673
  cleanupAnchor_fn = function(a) {
692
674
  a.removeEventListener("click", __privateGet(this, _onAnchorClick), true);
693
675
  a.removeEventListener("focusout", this._onFocusout);
@@ -726,8 +708,7 @@ var __decorateClass = (decorators, target, key, kind) => {
726
708
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
727
709
  if (decorator = decorators[i])
728
710
  result = (decorator(target, key, result) ) || result;
729
- if (result)
730
- __defProp(target, key, result);
711
+ if (result) __defProp(target, key, result);
731
712
  return result;
732
713
  };
733
714
  const MenuItemRole = {
@@ -744,8 +725,38 @@ class MenuItem extends MenuItem$1 {
744
725
  super();
745
726
  this.checkTrailing = false;
746
727
  this.#submenuArray = [];
728
+ this.#handleMenuItemKeyDown = (e) => {
729
+ if (e.defaultPrevented) {
730
+ return false;
731
+ }
732
+ switch (e.key) {
733
+ case keyCodes$1.keyEnter:
734
+ case keyCodes$1.keySpace:
735
+ this.invoke();
736
+ if (!this.disabled) {
737
+ this.#emitSyntheticClick();
738
+ }
739
+ return false;
740
+ case keyCodes$1.keyArrowRight:
741
+ this.expandAndFocus();
742
+ if (this.hasSubmenu) {
743
+ this.#emitSyntheticClick();
744
+ }
745
+ return false;
746
+ case keyCodes$1.keyArrowLeft:
747
+ if (this.expanded) {
748
+ this.expanded = false;
749
+ this.focus();
750
+ this.#emitSyntheticClick();
751
+ return false;
752
+ }
753
+ }
754
+ return true;
755
+ };
756
+ this.#syntheticClickEvents = /* @__PURE__ */ new WeakSet();
747
757
  this.updateSubmenu = () => this.#updateSubmenu();
748
758
  this.addEventListener("expanded-change", this.#expandedChange);
759
+ this.handleMenuItemKeyDown = this.#handleMenuItemKeyDown;
749
760
  }
750
761
  #submenuArray;
751
762
  /**
@@ -773,6 +784,22 @@ class MenuItem extends MenuItem$1 {
773
784
  this.submenu.open = this.expanded;
774
785
  }
775
786
  }
787
+ #handleMenuItemKeyDown;
788
+ #syntheticClickEvents;
789
+ /**
790
+ * @internal
791
+ */
792
+ _isSyntheticClickEvent(event) {
793
+ return this.#syntheticClickEvents.has(event);
794
+ }
795
+ #emitSyntheticClick() {
796
+ const mouseEvent = new MouseEvent("click", {
797
+ bubbles: true,
798
+ composed: true
799
+ });
800
+ this.#syntheticClickEvents.add(mouseEvent);
801
+ this.dispatchEvent(mouseEvent);
802
+ }
776
803
  }
777
804
  __decorateClass([
778
805
  index.attr
@@ -833,6 +860,9 @@ const getClasses = ({
833
860
  ["has-meta", Boolean(metaSlottedContent?.length)]
834
861
  );
835
862
  function handleClick(x, { event }) {
863
+ if (x._isSyntheticClickEvent(event)) {
864
+ return true;
865
+ }
836
866
  x.handleMenuItemClick(event);
837
867
  return x.role === MenuItemRole.presentation;
838
868
  }
@@ -1,5 +1,6 @@
1
1
  import { F as FoundationElement, D as DOM, _ 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
+ import { k as keyArrowLeft$1, a as keyArrowRight$1, g as keySpace$1, b as keyEnter$1 } from './key-codes2.js';
3
4
  import { A as AffixIcon, a as affixIconTemplateFactory } from './affix.js';
4
5
  import { b as anchored } from './anchored.js';
5
6
  import { S as StartEnd } from './start-end.js';
@@ -572,49 +573,35 @@ const styles = ":host(:focus-visible){outline:none}:host([disabled]){pointer-eve
572
573
 
573
574
  var __defProp$1 = Object.defineProperty;
574
575
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
576
+ var __typeError = (msg) => {
577
+ throw TypeError(msg);
578
+ };
575
579
  var __decorateClass$1 = (decorators, target, key, kind) => {
576
580
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
577
581
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
578
582
  if (decorator = decorators[i])
579
583
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
580
- if (kind && result)
581
- __defProp$1(target, key, result);
584
+ if (kind && result) __defProp$1(target, key, result);
582
585
  return result;
583
586
  };
584
- var __accessCheck = (obj, member, msg) => {
585
- if (!member.has(obj))
586
- throw TypeError("Cannot " + msg);
587
- };
588
- var __privateGet = (obj, member, getter) => {
589
- __accessCheck(obj, member, "read from private field");
590
- return getter ? getter.call(obj) : member.get(obj);
591
- };
592
- var __privateAdd = (obj, member, value) => {
593
- if (member.has(obj))
594
- throw TypeError("Cannot add the same private member more than once");
595
- member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
596
- };
597
- var __privateMethod = (obj, member, method) => {
598
- __accessCheck(obj, member, "access private method");
599
- return method;
600
- };
601
- var _triggerBehaviour, triggerBehaviour_get, _setupAnchor, setupAnchor_fn, _updateAnchor, updateAnchor_fn, _cleanupAnchor, cleanupAnchor_fn, _onAnchorClick;
587
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
588
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
589
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
590
+ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
591
+ var _Menu_instances, triggerBehaviour_get, setupAnchor_fn, updateAnchor_fn, cleanupAnchor_fn, _onAnchorClick;
602
592
  let Menu = class extends Menu$1 {
603
593
  constructor() {
604
594
  super();
605
- __privateAdd(this, _triggerBehaviour);
606
- __privateAdd(this, _setupAnchor);
607
- __privateAdd(this, _updateAnchor);
608
- __privateAdd(this, _cleanupAnchor);
595
+ __privateAdd(this, _Menu_instances);
609
596
  this.ariaLabel = null;
610
597
  this.placement = "bottom";
611
598
  this.autoDismiss = false;
612
599
  this.open = false;
613
600
  __privateAdd(this, _onAnchorClick, () => {
614
- if (__privateGet(this, _triggerBehaviour, triggerBehaviour_get) === "off") {
601
+ if (__privateGet(this, _Menu_instances, triggerBehaviour_get) === "off") {
615
602
  return;
616
603
  }
617
- if (__privateGet(this, _triggerBehaviour, triggerBehaviour_get) === "legacy" && this.open) {
604
+ if (__privateGet(this, _Menu_instances, triggerBehaviour_get) === "legacy" && this.open) {
618
605
  return;
619
606
  }
620
607
  const newValue = !this.open;
@@ -647,45 +634,40 @@ let Menu = class extends Menu$1 {
647
634
  openChanged(_, newValue) {
648
635
  newValue ? this.$emit("open", void 0, { bubbles: false }) : this.$emit("close", void 0, { bubbles: false });
649
636
  if (this._anchorEl) {
650
- __privateMethod(this, _updateAnchor, updateAnchor_fn).call(this, this._anchorEl);
637
+ __privateMethod(this, _Menu_instances, updateAnchor_fn).call(this, this._anchorEl);
651
638
  }
652
639
  }
653
640
  /**
654
641
  * @internal
655
642
  */
656
643
  _anchorElChanged(oldValue, newValue) {
657
- if (oldValue)
658
- __privateMethod(this, _cleanupAnchor, cleanupAnchor_fn).call(this, oldValue);
659
- if (newValue)
660
- __privateMethod(this, _setupAnchor, setupAnchor_fn).call(this, newValue);
644
+ if (oldValue) __privateMethod(this, _Menu_instances, cleanupAnchor_fn).call(this, oldValue);
645
+ if (newValue) __privateMethod(this, _Menu_instances, setupAnchor_fn).call(this, newValue);
661
646
  }
662
647
  /**
663
648
  * @internal
664
649
  */
665
650
  _onChange(e) {
666
651
  const clickedOnNonCheckboxMenuItem = e.target instanceof HTMLElement && (e.target.role === "menuitem" || e.target.role === "menuitemradio");
667
- if (__privateGet(this, _triggerBehaviour, triggerBehaviour_get) === "auto" && clickedOnNonCheckboxMenuItem) {
652
+ if (__privateGet(this, _Menu_instances, triggerBehaviour_get) === "auto" && clickedOnNonCheckboxMenuItem) {
668
653
  this.open = false;
669
654
  }
670
655
  return true;
671
656
  }
672
657
  };
673
- _triggerBehaviour = new WeakSet();
658
+ _Menu_instances = new WeakSet();
674
659
  triggerBehaviour_get = function() {
675
660
  return this.trigger ?? "legacy";
676
661
  };
677
- _setupAnchor = new WeakSet();
678
662
  setupAnchor_fn = function(a) {
679
663
  a.addEventListener("click", __privateGet(this, _onAnchorClick), true);
680
664
  a.addEventListener("focusout", this._onFocusout);
681
665
  a.setAttribute("aria-haspopup", "menu");
682
- __privateMethod(this, _updateAnchor, updateAnchor_fn).call(this, a);
666
+ __privateMethod(this, _Menu_instances, updateAnchor_fn).call(this, a);
683
667
  };
684
- _updateAnchor = new WeakSet();
685
668
  updateAnchor_fn = function(a) {
686
669
  a.setAttribute("aria-expanded", this.open.toString());
687
670
  };
688
- _cleanupAnchor = new WeakSet();
689
671
  cleanupAnchor_fn = function(a) {
690
672
  a.removeEventListener("click", __privateGet(this, _onAnchorClick), true);
691
673
  a.removeEventListener("focusout", this._onFocusout);
@@ -724,8 +706,7 @@ var __decorateClass = (decorators, target, key, kind) => {
724
706
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
725
707
  if (decorator = decorators[i])
726
708
  result = (decorator(target, key, result) ) || result;
727
- if (result)
728
- __defProp(target, key, result);
709
+ if (result) __defProp(target, key, result);
729
710
  return result;
730
711
  };
731
712
  const MenuItemRole = {
@@ -742,8 +723,38 @@ class MenuItem extends MenuItem$1 {
742
723
  super();
743
724
  this.checkTrailing = false;
744
725
  this.#submenuArray = [];
726
+ this.#handleMenuItemKeyDown = (e) => {
727
+ if (e.defaultPrevented) {
728
+ return false;
729
+ }
730
+ switch (e.key) {
731
+ case keyEnter$1:
732
+ case keySpace$1:
733
+ this.invoke();
734
+ if (!this.disabled) {
735
+ this.#emitSyntheticClick();
736
+ }
737
+ return false;
738
+ case keyArrowRight$1:
739
+ this.expandAndFocus();
740
+ if (this.hasSubmenu) {
741
+ this.#emitSyntheticClick();
742
+ }
743
+ return false;
744
+ case keyArrowLeft$1:
745
+ if (this.expanded) {
746
+ this.expanded = false;
747
+ this.focus();
748
+ this.#emitSyntheticClick();
749
+ return false;
750
+ }
751
+ }
752
+ return true;
753
+ };
754
+ this.#syntheticClickEvents = /* @__PURE__ */ new WeakSet();
745
755
  this.updateSubmenu = () => this.#updateSubmenu();
746
756
  this.addEventListener("expanded-change", this.#expandedChange);
757
+ this.handleMenuItemKeyDown = this.#handleMenuItemKeyDown;
747
758
  }
748
759
  #submenuArray;
749
760
  /**
@@ -771,6 +782,22 @@ class MenuItem extends MenuItem$1 {
771
782
  this.submenu.open = this.expanded;
772
783
  }
773
784
  }
785
+ #handleMenuItemKeyDown;
786
+ #syntheticClickEvents;
787
+ /**
788
+ * @internal
789
+ */
790
+ _isSyntheticClickEvent(event) {
791
+ return this.#syntheticClickEvents.has(event);
792
+ }
793
+ #emitSyntheticClick() {
794
+ const mouseEvent = new MouseEvent("click", {
795
+ bubbles: true,
796
+ composed: true
797
+ });
798
+ this.#syntheticClickEvents.add(mouseEvent);
799
+ this.dispatchEvent(mouseEvent);
800
+ }
774
801
  }
775
802
  __decorateClass([
776
803
  attr
@@ -831,6 +858,9 @@ const getClasses = ({
831
858
  ["has-meta", Boolean(metaSlottedContent?.length)]
832
859
  );
833
860
  function handleClick(x, { event }) {
861
+ if (x._isSyntheticClickEvent(event)) {
862
+ return true;
863
+ }
834
864
  x.handleMenuItemClick(event);
835
865
  return x.role === MenuItemRole.presentation;
836
866
  }
@@ -11,8 +11,7 @@ var __decorateClass = (decorators, target, key, kind) => {
11
11
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
12
12
  if (decorator = decorators[i])
13
13
  result = (decorator(target, key, result) ) || result;
14
- if (result)
15
- __defProp(target, key, result);
14
+ if (result) __defProp(target, key, result);
16
15
  return result;
17
16
  };
18
17
  class ActionGroup extends index.FoundationElement {
@@ -9,8 +9,7 @@ var __decorateClass = (decorators, target, key, kind) => {
9
9
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
10
10
  if (decorator = decorators[i])
11
11
  result = (decorator(target, key, result) ) || result;
12
- if (result)
13
- __defProp(target, key, result);
12
+ if (result) __defProp(target, key, result);
14
13
  return result;
15
14
  };
16
15
  class ActionGroup extends FoundationElement {
@@ -16,8 +16,7 @@ var __decorateClass = (decorators, target, key, kind) => {
16
16
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
17
17
  if (decorator = decorators[i])
18
18
  result = (decorator(target, key, result) ) || result;
19
- if (result)
20
- __defProp(target, key, result);
19
+ if (result) __defProp(target, key, result);
21
20
  return result;
22
21
  };
23
22
  class NavDisclosure extends index.FoundationElement {
@@ -14,8 +14,7 @@ var __decorateClass = (decorators, target, key, kind) => {
14
14
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
15
15
  if (decorator = decorators[i])
16
16
  result = (decorator(target, key, result) ) || result;
17
- if (result)
18
- __defProp(target, key, result);
17
+ if (result) __defProp(target, key, result);
19
18
  return result;
20
19
  };
21
20
  class NavDisclosure extends FoundationElement {
@@ -16,8 +16,7 @@ var __decorateClass = (decorators, target, key, kind) => {
16
16
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
17
17
  if (decorator = decorators[i])
18
18
  result = (decorator(target, key, result) ) || result;
19
- if (result)
20
- __defProp(target, key, result);
19
+ if (result) __defProp(target, key, result);
21
20
  return result;
22
21
  };
23
22
  class Note extends index.FoundationElement {