@vonage/vivid 3.53.0 → 3.54.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 (60) hide show
  1. package/appearance-ui/index.cjs +1 -1
  2. package/appearance-ui/index.js +1 -1
  3. package/custom-elements.json +444 -94
  4. package/lib/appearance-ui/appearance-ui.d.ts +1 -1
  5. package/lib/audio-player/audio-player.d.ts +4 -0
  6. package/lib/audio-player/locale.d.ts +2 -0
  7. package/lib/dial-pad/dial-pad.d.ts +3 -0
  8. package/lib/enums.d.ts +1 -0
  9. package/lib/menu/menu.d.ts +1 -0
  10. package/lib/nav-disclosure/nav-disclosure.d.ts +5 -0
  11. package/lib/text-anchor/text-anchor.d.ts +1 -1
  12. package/lib/video-player/vivid-video-svg.d.ts +1 -0
  13. package/locales/en-GB.cjs +3 -1
  14. package/locales/en-GB.js +3 -1
  15. package/locales/en-US.cjs +3 -1
  16. package/locales/en-US.js +3 -1
  17. package/locales/ja-JP.cjs +3 -1
  18. package/locales/ja-JP.js +3 -1
  19. package/locales/zh-CN.cjs +3 -1
  20. package/locales/zh-CN.js +3 -1
  21. package/package.json +1 -1
  22. package/shared/definition20.cjs +15 -2
  23. package/shared/definition20.js +15 -2
  24. package/shared/definition27.cjs +1 -1
  25. package/shared/definition27.js +1 -1
  26. package/shared/definition29.cjs +39 -10
  27. package/shared/definition29.js +39 -10
  28. package/shared/definition30.cjs +1 -1
  29. package/shared/definition30.js +1 -1
  30. package/shared/definition31.cjs +14 -2
  31. package/shared/definition31.js +14 -2
  32. package/shared/definition32.cjs +1 -1
  33. package/shared/definition32.js +1 -1
  34. package/shared/definition35.cjs +1 -1
  35. package/shared/definition35.js +1 -1
  36. package/shared/definition43.cjs +1 -1
  37. package/shared/definition43.js +1 -1
  38. package/shared/definition5.cjs +99 -18
  39. package/shared/definition5.js +99 -18
  40. package/shared/definition55.cjs +120 -52
  41. package/shared/definition55.js +120 -52
  42. package/shared/definition61.cjs +307 -1
  43. package/shared/definition61.js +307 -1
  44. package/shared/enums.cjs +1 -0
  45. package/shared/enums.js +1 -0
  46. package/shared/icon.cjs +20 -2
  47. package/shared/icon.js +21 -3
  48. package/shared/index2.cjs +15 -8
  49. package/shared/index2.js +15 -8
  50. package/shared/text-field.cjs +1 -1
  51. package/shared/text-field.js +1 -1
  52. package/shared/utils/numberConverter.d.ts +2 -0
  53. package/styles/core/all.css +1 -1
  54. package/styles/core/theme.css +1 -1
  55. package/styles/core/typography.css +1 -1
  56. package/styles/tokens/theme-dark.css +4 -4
  57. package/styles/tokens/theme-light.css +4 -4
  58. package/styles/tokens/vivid-2-compat.css +1 -1
  59. package/vivid.api.json +21 -0
  60. package/style.css +0 -1
@@ -1,6 +1,6 @@
1
1
  import { FoundationElement } from '@microsoft/fast-foundation';
2
2
  import type { Appearance } from '../enums.js';
3
- export type AppearanceUIAppearance = Extract<Appearance, Appearance.Filled | Appearance.Ghost | Appearance.Outlined | Appearance.Duotone | Appearance.Fieldset | Appearance.Subtle | Appearance.Listitem>;
3
+ export type AppearanceUIAppearance = Extract<Appearance, Appearance.Filled | Appearance.Ghost | Appearance.GhostLight | Appearance.Outlined | Appearance.Duotone | Appearance.Fieldset | Appearance.Subtle | Appearance.Listitem>;
4
4
  export declare class AppearanceUi extends FoundationElement {
5
5
  appearance?: AppearanceUIAppearance;
6
6
  hovered: boolean;
@@ -1,15 +1,19 @@
1
1
  import { FoundationElement } from '@microsoft/fast-foundation';
2
2
  import type { Connotation } from '../enums';
3
+ import { MediaSkipBy } from '../enums';
3
4
  import { Localized } from '../../shared/patterns';
4
5
  export type AudioPlayerConnotation = Extract<Connotation, Connotation.Accent | Connotation.CTA>;
5
6
  export declare class AudioPlayer extends FoundationElement {
6
7
  playButtonAriaLabel: string | null;
7
8
  pauseButtonAriaLabel: string | null;
8
9
  sliderAriaLabel: string | null;
10
+ skipForwardButtonAriaLabel: string | null;
11
+ skipBackwardButtonAriaLabel: string | null;
9
12
  connotation?: AudioPlayerConnotation;
10
13
  src?: string;
11
14
  disabled: boolean;
12
15
  notime: boolean;
16
+ skipBy?: MediaSkipBy;
13
17
  connectedCallback(): void;
14
18
  disconnectedCallback(): void;
15
19
  }
@@ -2,4 +2,6 @@ export interface AudioPlayerLocale {
2
2
  playButtonLabel: string;
3
3
  pauseButtonLabel: string;
4
4
  sliderLabel: string;
5
+ skipForwardButton: string;
6
+ skipBackwardButton: string;
5
7
  }
@@ -7,8 +7,11 @@ export declare class DialPad extends FoundationElement {
7
7
  valueChanged(_oldValue: string, newValue: string): void;
8
8
  pattern: string;
9
9
  disabled: boolean;
10
+ pending: boolean;
10
11
  callActive: boolean;
11
12
  noCall: boolean;
13
+ endCallButtonLabel: string | null;
14
+ callButtonLabel: string | null;
12
15
  }
13
16
  export interface DialPad extends Localized {
14
17
  }
package/lib/enums.d.ts CHANGED
@@ -23,6 +23,7 @@ export declare enum Appearance {
23
23
  Fieldset = "fieldset",
24
24
  Subtle = "subtle",
25
25
  Ghost = "ghost",
26
+ GhostLight = "ghost-light",
26
27
  Listitem = "listitem",
27
28
  Elevated = "elevated"
28
29
  }
@@ -5,6 +5,7 @@ export declare class Menu extends FastMenu {
5
5
  #private;
6
6
  ariaLabel: string | null;
7
7
  placement?: Placement;
8
+ trigger?: 'auto' | 'legacy' | 'off';
8
9
  autoDismiss: boolean;
9
10
  autoDismissChanged(oldValue?: boolean): void;
10
11
  open: boolean;
@@ -1,9 +1,14 @@
1
1
  import { FoundationElement } from '@microsoft/fast-foundation';
2
+ import { Appearance, Connotation } from '../enums';
2
3
  import { AffixIcon } from '../../shared/patterns/affix';
4
+ export type NavDisclosureAppearance = Extract<Appearance, Appearance.Ghost | Appearance.GhostLight>;
5
+ export type NavDisclosureConnotation = Extract<Connotation, Connotation.Accent | Connotation.CTA>;
3
6
  export declare class NavDisclosure extends FoundationElement {
4
7
  #private;
5
8
  details: HTMLDetailsElement;
6
9
  label?: string;
10
+ appearance?: NavDisclosureAppearance;
11
+ connotation?: NavDisclosureConnotation;
7
12
  open: boolean;
8
13
  ariaCurrent: string | null;
9
14
  }
@@ -2,7 +2,7 @@ import { Anchor } from '@microsoft/fast-foundation';
2
2
  import { Appearance, Connotation } from '../enums';
3
3
  import { AffixIcon } from '../../shared/patterns/affix';
4
4
  export type TextAnchorConnotation = Extract<Connotation, Connotation.Accent | Connotation.CTA>;
5
- export type TextAnchorAppearance = Extract<Appearance, Appearance.Ghost>;
5
+ export type TextAnchorAppearance = Extract<Appearance, Appearance.Ghost | Appearance.GhostLight>;
6
6
  export declare class TextAnchor extends Anchor {
7
7
  text?: string;
8
8
  connotation?: TextAnchorConnotation;
@@ -0,0 +1 @@
1
+ export declare function renderSvgIcons(): import("@microsoft/fast-element").ViewTemplate<any, any>;
package/locales/en-GB.cjs CHANGED
@@ -109,7 +109,9 @@ const enGB = {
109
109
  audioPlayer: {
110
110
  playButtonLabel: "Play",
111
111
  pauseButtonLabel: "Pause",
112
- sliderLabel: "Audio progress bar"
112
+ sliderLabel: "Audio progress bar",
113
+ skipForwardButton: "Skip Forward",
114
+ skipBackwardButton: "Skip Backward"
113
115
  },
114
116
  alert: {
115
117
  dismissButtonLabel: "Close"
package/locales/en-GB.js CHANGED
@@ -107,7 +107,9 @@ const enGB = {
107
107
  audioPlayer: {
108
108
  playButtonLabel: "Play",
109
109
  pauseButtonLabel: "Pause",
110
- sliderLabel: "Audio progress bar"
110
+ sliderLabel: "Audio progress bar",
111
+ skipForwardButton: "Skip Forward",
112
+ skipBackwardButton: "Skip Backward"
111
113
  },
112
114
  alert: {
113
115
  dismissButtonLabel: "Close"
package/locales/en-US.cjs CHANGED
@@ -277,7 +277,9 @@ const enUS = {
277
277
  audioPlayer: {
278
278
  playButtonLabel: "Play",
279
279
  pauseButtonLabel: "Pause",
280
- sliderLabel: "Audio progress bar"
280
+ sliderLabel: "Audio progress bar",
281
+ skipForwardButton: "Skip Forward",
282
+ skipBackwardButton: "Skip Backward"
281
283
  },
282
284
  alert: {
283
285
  dismissButtonLabel: "Close"
package/locales/en-US.js CHANGED
@@ -275,7 +275,9 @@ const enUS = {
275
275
  audioPlayer: {
276
276
  playButtonLabel: "Play",
277
277
  pauseButtonLabel: "Pause",
278
- sliderLabel: "Audio progress bar"
278
+ sliderLabel: "Audio progress bar",
279
+ skipForwardButton: "Skip Forward",
280
+ skipBackwardButton: "Skip Backward"
279
281
  },
280
282
  alert: {
281
283
  dismissButtonLabel: "Close"
package/locales/ja-JP.cjs CHANGED
@@ -276,7 +276,9 @@ const jaJP = {
276
276
  audioPlayer: {
277
277
  playButtonLabel: "開始",
278
278
  pauseButtonLabel: "休止",
279
- sliderLabel: "オーディオプログレスバー"
279
+ sliderLabel: "オーディオプログレスバー",
280
+ skipForwardButton: "前にスキップ",
281
+ skipBackwardButton: "後方にスキップ"
280
282
  },
281
283
  alert: {
282
284
  dismissButtonLabel: "閉じる"
package/locales/ja-JP.js CHANGED
@@ -274,7 +274,9 @@ const jaJP = {
274
274
  audioPlayer: {
275
275
  playButtonLabel: "開始",
276
276
  pauseButtonLabel: "休止",
277
- sliderLabel: "オーディオプログレスバー"
277
+ sliderLabel: "オーディオプログレスバー",
278
+ skipForwardButton: "前にスキップ",
279
+ skipBackwardButton: "後方にスキップ"
278
280
  },
279
281
  alert: {
280
282
  dismissButtonLabel: "閉じる"
package/locales/zh-CN.cjs CHANGED
@@ -278,7 +278,9 @@ const zhCN = {
278
278
  audioPlayer: {
279
279
  playButtonLabel: "草創",
280
280
  pauseButtonLabel: "停",
281
- sliderLabel: "音訊進度條"
281
+ sliderLabel: "音訊進度條",
282
+ skipForwardButton: "向前跳",
283
+ skipBackwardButton: "向后跳"
282
284
  },
283
285
  alert: {
284
286
  dismissButtonLabel: "关"
package/locales/zh-CN.js CHANGED
@@ -276,7 +276,9 @@ const zhCN = {
276
276
  audioPlayer: {
277
277
  playButtonLabel: "草創",
278
278
  pauseButtonLabel: "停",
279
- sliderLabel: "音訊進度條"
279
+ sliderLabel: "音訊進度條",
280
+ skipForwardButton: "向前跳",
281
+ skipBackwardButton: "向后跳"
280
282
  },
281
283
  alert: {
282
284
  dismissButtonLabel: "关"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vonage/vivid",
3
- "version": "3.53.0",
3
+ "version": "3.54.0",
4
4
  "type": "module",
5
5
  "module": "./index.js",
6
6
  "main": "./index.cjs",
@@ -34,8 +34,11 @@ class DialPad extends index.FoundationElement {
34
34
  this.value = "";
35
35
  this.pattern = "^[0-9#*]*$";
36
36
  this.disabled = false;
37
+ this.pending = false;
37
38
  this.callActive = false;
38
39
  this.noCall = false;
40
+ this.endCallButtonLabel = null;
41
+ this.callButtonLabel = null;
39
42
  /**
40
43
  *
41
44
  * @internal
@@ -113,17 +116,26 @@ __decorateClass([
113
116
  __decorateClass([
114
117
  index.attr({ mode: "boolean" })
115
118
  ], DialPad.prototype, "disabled", 2);
119
+ __decorateClass([
120
+ index.attr({ mode: "boolean" })
121
+ ], DialPad.prototype, "pending", 2);
116
122
  __decorateClass([
117
123
  index.attr({ attribute: "call-active", mode: "boolean" })
118
124
  ], DialPad.prototype, "callActive", 2);
119
125
  __decorateClass([
120
126
  index.attr({ mode: "boolean", attribute: "no-call" })
121
127
  ], DialPad.prototype, "noCall", 2);
128
+ __decorateClass([
129
+ index.attr({ attribute: "end-call-button-label" })
130
+ ], DialPad.prototype, "endCallButtonLabel", 2);
131
+ __decorateClass([
132
+ index.attr({ attribute: "call-button-label" })
133
+ ], DialPad.prototype, "callButtonLabel", 2);
122
134
  applyMixins.applyMixins(DialPad, localized.Localized);
123
135
 
124
136
  const getClasses = (_) => classNames.classNames("base");
125
137
  function handleKeyDown(x, e) {
126
- if (e.key === keyCodes.keyEnter) {
138
+ if (e.key === keyCodes.keyEnter && !x.pending && !x.disabled && !x.callActive && !x.noCall && x.value.length > 0 && e.target instanceof HTMLInputElement) {
127
139
  x._onDial();
128
140
  } else {
129
141
  const key = e.key === "*" ? "Asterisk" : e.key === "#" ? "Hashtag" : e.key;
@@ -203,8 +215,9 @@ function renderDialButton(buttonTag) {
203
215
  icon="${(x) => x.callActive ? "disable-call-line" : "call-line"}"
204
216
  connotation="${(x) => x.callActive ? "alert" : "cta"}"
205
217
  ?disabled="${(x) => x.disabled}"
218
+ ?pending="${(x) => x.pending}"
206
219
  @click="${(x) => x._onDial()}"
207
- label="${(x) => x.callActive ? x.locale.dialPad.endCallButtonLabel : x.locale.dialPad.callButtonLabel}">
220
+ label="${(x) => x.callActive ? x.endCallButtonLabel || x.locale.dialPad.endCallButtonLabel : x.callButtonLabel || x.locale.dialPad.callButtonLabel}">
208
221
  </${buttonTag}>`;
209
222
  }
210
223
  const DialPadTemplate = (context) => {
@@ -32,8 +32,11 @@ class DialPad extends FoundationElement {
32
32
  this.value = "";
33
33
  this.pattern = "^[0-9#*]*$";
34
34
  this.disabled = false;
35
+ this.pending = false;
35
36
  this.callActive = false;
36
37
  this.noCall = false;
38
+ this.endCallButtonLabel = null;
39
+ this.callButtonLabel = null;
37
40
  /**
38
41
  *
39
42
  * @internal
@@ -111,17 +114,26 @@ __decorateClass([
111
114
  __decorateClass([
112
115
  attr({ mode: "boolean" })
113
116
  ], DialPad.prototype, "disabled", 2);
117
+ __decorateClass([
118
+ attr({ mode: "boolean" })
119
+ ], DialPad.prototype, "pending", 2);
114
120
  __decorateClass([
115
121
  attr({ attribute: "call-active", mode: "boolean" })
116
122
  ], DialPad.prototype, "callActive", 2);
117
123
  __decorateClass([
118
124
  attr({ mode: "boolean", attribute: "no-call" })
119
125
  ], DialPad.prototype, "noCall", 2);
126
+ __decorateClass([
127
+ attr({ attribute: "end-call-button-label" })
128
+ ], DialPad.prototype, "endCallButtonLabel", 2);
129
+ __decorateClass([
130
+ attr({ attribute: "call-button-label" })
131
+ ], DialPad.prototype, "callButtonLabel", 2);
120
132
  applyMixins(DialPad, Localized);
121
133
 
122
134
  const getClasses = (_) => classNames("base");
123
135
  function handleKeyDown(x, e) {
124
- if (e.key === keyEnter) {
136
+ if (e.key === keyEnter && !x.pending && !x.disabled && !x.callActive && !x.noCall && x.value.length > 0 && e.target instanceof HTMLInputElement) {
125
137
  x._onDial();
126
138
  } else {
127
139
  const key = e.key === "*" ? "Asterisk" : e.key === "#" ? "Hashtag" : e.key;
@@ -201,8 +213,9 @@ function renderDialButton(buttonTag) {
201
213
  icon="${(x) => x.callActive ? "disable-call-line" : "call-line"}"
202
214
  connotation="${(x) => x.callActive ? "alert" : "cta"}"
203
215
  ?disabled="${(x) => x.disabled}"
216
+ ?pending="${(x) => x.pending}"
204
217
  @click="${(x) => x._onDial()}"
205
- label="${(x) => x.callActive ? x.locale.dialPad.endCallButtonLabel : x.locale.dialPad.callButtonLabel}">
218
+ label="${(x) => x.callActive ? x.endCallButtonLabel || x.locale.dialPad.endCallButtonLabel : x.callButtonLabel || x.locale.dialPad.callButtonLabel}">
206
219
  </${buttonTag}>`;
207
220
  }
208
221
  const DialPadTemplate = (context) => {
@@ -10,7 +10,7 @@ const styles = ":host{display:inline-block;vertical-align:sub}.control{display:f
10
10
  const getClasses = ({ connotation, size }) => classNames.classNames(
11
11
  "control",
12
12
  [`connotation-${connotation}`, Boolean(connotation)],
13
- [`size-${size}`, Boolean(size)]
13
+ [`size-${size}`, typeof size === "number"]
14
14
  );
15
15
  const iconTemplate = () => index.html`
16
16
  <figure class="${getClasses}">
@@ -8,7 +8,7 @@ const styles = ":host{display:inline-block;vertical-align:sub}.control{display:f
8
8
  const getClasses = ({ connotation, size }) => classNames(
9
9
  "control",
10
10
  [`connotation-${connotation}`, Boolean(connotation)],
11
- [`size-${size}`, Boolean(size)]
11
+ [`size-${size}`, typeof size === "number"]
12
12
  );
13
13
  const iconTemplate = () => html`
14
14
  <figure class="${getClasses}">
@@ -600,10 +600,11 @@ var __privateMethod = (obj, member, method) => {
600
600
  __accessCheck(obj, member, "access private method");
601
601
  return method;
602
602
  };
603
- var _setupAnchor, setupAnchor_fn, _updateAnchor, updateAnchor_fn, _cleanupAnchor, cleanupAnchor_fn, _openIfClosed, _updateClickOutsideListeners, _wasOpenBeforeClick, _onClickOutsideCapture, _onClickOutside;
603
+ var _triggerBehaviour, triggerBehaviour_get, _setupAnchor, setupAnchor_fn, _updateAnchor, updateAnchor_fn, _cleanupAnchor, cleanupAnchor_fn, _onAnchorClick, _updateClickOutsideListeners, _wasOpenBeforeClick, _onClickOutsideCapture, _onClickOutside;
604
604
  exports.Menu = class Menu extends Menu$1 {
605
605
  constructor() {
606
606
  super();
607
+ __privateAdd(this, _triggerBehaviour);
607
608
  __privateAdd(this, _setupAnchor);
608
609
  __privateAdd(this, _updateAnchor);
609
610
  __privateAdd(this, _cleanupAnchor);
@@ -611,9 +612,15 @@ exports.Menu = class Menu extends Menu$1 {
611
612
  this.placement = "bottom";
612
613
  this.autoDismiss = false;
613
614
  this.open = false;
614
- __privateAdd(this, _openIfClosed, () => {
615
- if (!this.open)
616
- index.DOM.queueUpdate(() => this.open = true);
615
+ __privateAdd(this, _onAnchorClick, () => {
616
+ if (__privateGet(this, _triggerBehaviour, triggerBehaviour_get) === "off") {
617
+ return;
618
+ }
619
+ if (__privateGet(this, _triggerBehaviour, triggerBehaviour_get) === "legacy" && this.open) {
620
+ return;
621
+ }
622
+ const newValue = !this.open;
623
+ index.DOM.queueUpdate(() => this.open = newValue);
617
624
  });
618
625
  __privateAdd(this, _updateClickOutsideListeners, () => {
619
626
  document.removeEventListener("click", __privateGet(this, _onClickOutsideCapture), true);
@@ -634,15 +641,20 @@ exports.Menu = class Menu extends Menu$1 {
634
641
  });
635
642
  const handleFocusOut = this.handleFocusOut;
636
643
  this.handleFocusOut = (e) => {
637
- const privates = this;
638
- const isSafeToCallSuper = privates.menuItems.some(
639
- privates.isFocusableElement
644
+ const privates2 = this;
645
+ const isSafeToCallSuper = privates2.menuItems.some(
646
+ privates2.isFocusableElement
640
647
  );
641
648
  if (!isSafeToCallSuper) {
642
649
  return;
643
650
  }
644
651
  handleFocusOut(e);
645
652
  };
653
+ const privates = this;
654
+ const domChildren = privates.domChildren;
655
+ privates.domChildren = () => {
656
+ return domChildren.call(this).filter((child) => !child.hasAttribute("slot"));
657
+ };
646
658
  }
647
659
  autoDismissChanged(oldValue) {
648
660
  if (oldValue === void 0)
@@ -672,10 +684,24 @@ exports.Menu = class Menu extends Menu$1 {
672
684
  if (newValue)
673
685
  __privateMethod(this, _setupAnchor, setupAnchor_fn).call(this, newValue);
674
686
  }
687
+ /**
688
+ * @internal
689
+ */
690
+ _onChange(e) {
691
+ const clickedOnNonCheckboxMenuItem = e.target instanceof HTMLElement && (e.target.role === "menuitem" || e.target.role === "menuitemradio");
692
+ if (__privateGet(this, _triggerBehaviour, triggerBehaviour_get) === "auto" && clickedOnNonCheckboxMenuItem) {
693
+ this.open = false;
694
+ }
695
+ return true;
696
+ }
697
+ };
698
+ _triggerBehaviour = new WeakSet();
699
+ triggerBehaviour_get = function() {
700
+ return this.trigger ?? "legacy";
675
701
  };
676
702
  _setupAnchor = new WeakSet();
677
703
  setupAnchor_fn = function(a) {
678
- a.addEventListener("click", __privateGet(this, _openIfClosed), true);
704
+ a.addEventListener("click", __privateGet(this, _onAnchorClick), true);
679
705
  a.setAttribute("aria-haspopup", "menu");
680
706
  __privateMethod(this, _updateAnchor, updateAnchor_fn).call(this, a);
681
707
  };
@@ -685,11 +711,11 @@ updateAnchor_fn = function(a) {
685
711
  };
686
712
  _cleanupAnchor = new WeakSet();
687
713
  cleanupAnchor_fn = function(a) {
688
- a.removeEventListener("click", __privateGet(this, _openIfClosed), true);
714
+ a.removeEventListener("click", __privateGet(this, _onAnchorClick), true);
689
715
  a.removeAttribute("aria-hasPopup");
690
716
  a.removeAttribute("aria-expanded");
691
717
  };
692
- _openIfClosed = new WeakMap();
718
+ _onAnchorClick = new WeakMap();
693
719
  _updateClickOutsideListeners = new WeakMap();
694
720
  _wasOpenBeforeClick = new WeakMap();
695
721
  _onClickOutsideCapture = new WeakMap();
@@ -700,6 +726,9 @@ __decorateClass$1([
700
726
  __decorateClass$1([
701
727
  index.attr({ mode: "fromView" })
702
728
  ], exports.Menu.prototype, "placement", 2);
729
+ __decorateClass$1([
730
+ index.attr
731
+ ], exports.Menu.prototype, "trigger", 2);
703
732
  __decorateClass$1([
704
733
  index.attr({ mode: "boolean", attribute: "auto-dismiss" })
705
734
  ], exports.Menu.prototype, "autoDismiss", 2);
@@ -598,10 +598,11 @@ var __privateMethod = (obj, member, method) => {
598
598
  __accessCheck(obj, member, "access private method");
599
599
  return method;
600
600
  };
601
- var _setupAnchor, setupAnchor_fn, _updateAnchor, updateAnchor_fn, _cleanupAnchor, cleanupAnchor_fn, _openIfClosed, _updateClickOutsideListeners, _wasOpenBeforeClick, _onClickOutsideCapture, _onClickOutside;
601
+ var _triggerBehaviour, triggerBehaviour_get, _setupAnchor, setupAnchor_fn, _updateAnchor, updateAnchor_fn, _cleanupAnchor, cleanupAnchor_fn, _onAnchorClick, _updateClickOutsideListeners, _wasOpenBeforeClick, _onClickOutsideCapture, _onClickOutside;
602
602
  let Menu = class extends Menu$1 {
603
603
  constructor() {
604
604
  super();
605
+ __privateAdd(this, _triggerBehaviour);
605
606
  __privateAdd(this, _setupAnchor);
606
607
  __privateAdd(this, _updateAnchor);
607
608
  __privateAdd(this, _cleanupAnchor);
@@ -609,9 +610,15 @@ let Menu = class extends Menu$1 {
609
610
  this.placement = "bottom";
610
611
  this.autoDismiss = false;
611
612
  this.open = false;
612
- __privateAdd(this, _openIfClosed, () => {
613
- if (!this.open)
614
- DOM.queueUpdate(() => this.open = true);
613
+ __privateAdd(this, _onAnchorClick, () => {
614
+ if (__privateGet(this, _triggerBehaviour, triggerBehaviour_get) === "off") {
615
+ return;
616
+ }
617
+ if (__privateGet(this, _triggerBehaviour, triggerBehaviour_get) === "legacy" && this.open) {
618
+ return;
619
+ }
620
+ const newValue = !this.open;
621
+ DOM.queueUpdate(() => this.open = newValue);
615
622
  });
616
623
  __privateAdd(this, _updateClickOutsideListeners, () => {
617
624
  document.removeEventListener("click", __privateGet(this, _onClickOutsideCapture), true);
@@ -632,15 +639,20 @@ let Menu = class extends Menu$1 {
632
639
  });
633
640
  const handleFocusOut = this.handleFocusOut;
634
641
  this.handleFocusOut = (e) => {
635
- const privates = this;
636
- const isSafeToCallSuper = privates.menuItems.some(
637
- privates.isFocusableElement
642
+ const privates2 = this;
643
+ const isSafeToCallSuper = privates2.menuItems.some(
644
+ privates2.isFocusableElement
638
645
  );
639
646
  if (!isSafeToCallSuper) {
640
647
  return;
641
648
  }
642
649
  handleFocusOut(e);
643
650
  };
651
+ const privates = this;
652
+ const domChildren = privates.domChildren;
653
+ privates.domChildren = () => {
654
+ return domChildren.call(this).filter((child) => !child.hasAttribute("slot"));
655
+ };
644
656
  }
645
657
  autoDismissChanged(oldValue) {
646
658
  if (oldValue === void 0)
@@ -670,10 +682,24 @@ let Menu = class extends Menu$1 {
670
682
  if (newValue)
671
683
  __privateMethod(this, _setupAnchor, setupAnchor_fn).call(this, newValue);
672
684
  }
685
+ /**
686
+ * @internal
687
+ */
688
+ _onChange(e) {
689
+ const clickedOnNonCheckboxMenuItem = e.target instanceof HTMLElement && (e.target.role === "menuitem" || e.target.role === "menuitemradio");
690
+ if (__privateGet(this, _triggerBehaviour, triggerBehaviour_get) === "auto" && clickedOnNonCheckboxMenuItem) {
691
+ this.open = false;
692
+ }
693
+ return true;
694
+ }
695
+ };
696
+ _triggerBehaviour = new WeakSet();
697
+ triggerBehaviour_get = function() {
698
+ return this.trigger ?? "legacy";
673
699
  };
674
700
  _setupAnchor = new WeakSet();
675
701
  setupAnchor_fn = function(a) {
676
- a.addEventListener("click", __privateGet(this, _openIfClosed), true);
702
+ a.addEventListener("click", __privateGet(this, _onAnchorClick), true);
677
703
  a.setAttribute("aria-haspopup", "menu");
678
704
  __privateMethod(this, _updateAnchor, updateAnchor_fn).call(this, a);
679
705
  };
@@ -683,11 +709,11 @@ updateAnchor_fn = function(a) {
683
709
  };
684
710
  _cleanupAnchor = new WeakSet();
685
711
  cleanupAnchor_fn = function(a) {
686
- a.removeEventListener("click", __privateGet(this, _openIfClosed), true);
712
+ a.removeEventListener("click", __privateGet(this, _onAnchorClick), true);
687
713
  a.removeAttribute("aria-hasPopup");
688
714
  a.removeAttribute("aria-expanded");
689
715
  };
690
- _openIfClosed = new WeakMap();
716
+ _onAnchorClick = new WeakMap();
691
717
  _updateClickOutsideListeners = new WeakMap();
692
718
  _wasOpenBeforeClick = new WeakMap();
693
719
  _onClickOutsideCapture = new WeakMap();
@@ -698,6 +724,9 @@ __decorateClass$1([
698
724
  __decorateClass$1([
699
725
  attr({ mode: "fromView" })
700
726
  ], Menu.prototype, "placement", 2);
727
+ __decorateClass$1([
728
+ attr
729
+ ], Menu.prototype, "trigger", 2);
701
730
  __decorateClass$1([
702
731
  attr({ mode: "boolean", attribute: "auto-dismiss" })
703
732
  ], Menu.prototype, "autoDismiss", 2);
@@ -33,7 +33,7 @@ const MenuTemplate = (context) => {
33
33
  x.open = state;
34
34
  }
35
35
  return index.html`
36
- <template role="presentation">
36
+ <template role="presentation" @change="${(x, c) => x._onChange(c.event)}">
37
37
  ${anchorSlotTemplate}
38
38
  <${popupTag}
39
39
  :placement=${(x) => x.placement}
@@ -31,7 +31,7 @@ const MenuTemplate = (context) => {
31
31
  x.open = state;
32
32
  }
33
33
  return html`
34
- <template role="presentation">
34
+ <template role="presentation" @change="${(x, c) => x._onChange(c.event)}">
35
35
  ${anchorSlotTemplate}
36
36
  <${popupTag}
37
37
  :placement=${(x) => x.placement}
@@ -6,8 +6,9 @@ const affix = require('./affix.cjs');
6
6
  const applyMixins = require('./apply-mixins.cjs');
7
7
  const icon = require('./icon.cjs');
8
8
  const ref = require('./ref.cjs');
9
+ const classNames = require('./class-names.cjs');
9
10
 
10
- const styles = ".control{display:flex;box-sizing:border-box;align-items:center;border-radius:8px;background-color:var(--_appearance-color-fill);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);color:var(--_appearance-color-text);cursor:pointer;font:var(--vvd-typography-base);gap:12px;hyphens:auto;inline-size:100%;min-block-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)));padding-block:10px;padding-inline:16px;text-decoration:none;vertical-align:middle}.control{--_connotation-color-primary: var(--vvd-nav-disclosure-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-nav-disclosure-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-nav-disclosure-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-faint: var(--vvd-nav-disclosure-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-nav-disclosure-accent-soft, var(--vvd-color-neutral-100))}.control{--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.control: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}.control: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}.control:where([aria-current]):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: transparent}.control:where([aria-current]):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: transparent}.control: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))}:host(:where([aria-current=true][open])) .control,:host(:not([aria-current=true])) .control{--focus-stroke-gap-color: transparent}@supports (user-select: none){.control{user-select:none}}.control .toggleIcon{margin-inline-start:auto}slot[name=icon]{font-size:20px;line-height:1}.content{display:flex;flex-direction:column;border-inline-start:1px solid var(--vvd-color-neutral-200);gap:4px;margin-block:4px;margin-inline-start:20px;padding-inline-start:12px}details>summary{list-style:none}details>summary::-webkit-details-marker{display:none}\n";
11
+ const styles = ".control{display:flex;box-sizing:border-box;align-items:center;border-radius:8px;background-color:var(--_appearance-color-fill);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);cursor:pointer;font:var(--vvd-typography-base);gap:12px;hyphens:auto;inline-size:100%;min-block-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)));padding-block:10px;padding-inline:16px;text-decoration:none;vertical-align:middle}.control.connotation-cta{--_connotation-color-primary: var(--vvd-nav-disclosure-cta-primary, var(--vvd-color-cta-500));--_connotation-color-primary-text: var(--vvd-nav-disclosure-cta-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-nav-disclosure-cta-primary-increment, var(--vvd-color-cta-600));--_connotation-color-contrast: var(--vvd-nav-disclosure-cta-contrast, var(--vvd-color-cta-800));--_connotation-color-fierce: var(--vvd-nav-disclosure-cta-fierce, var(--vvd-color-cta-700));--_connotation-color-fierce-primary: var(--vvd-nav-disclosure-cta-fierce-primary, var(--vvd-color-cta-700));--_connotation-color-faint: var(--vvd-nav-disclosure-cta-faint, var(--vvd-color-cta-50));--_connotation-color-firm: var(--vvd-nav-disclosure-cta-firm, var(--vvd-color-cta-600));--_connotation-color-soft: var(--vvd-nav-disclosure-cta-soft, var(--vvd-color-cta-100))}.control:not(.connotation-cta){--_connotation-color-primary: var(--vvd-nav-disclosure-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-nav-disclosure-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-nav-disclosure-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-contrast: var(--vvd-nav-disclosure-accent-contrast, var(--vvd-color-neutral-800));--_connotation-color-fierce: var(--vvd-nav-disclosure-accent-fierce, var(--vvd-color-neutral-700));--_connotation-color-fierce-primary: var(--vvd-nav-disclosure-accent-fierce-primary, var(--vvd-color-canvas-text));--_connotation-color-faint: var(--vvd-nav-disclosure-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-firm: var(--vvd-nav-disclosure-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-soft: var(--vvd-nav-disclosure-accent-soft, var(--vvd-color-neutral-100))}.control{--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.control.appearance-ghost-light{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.control: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}.control:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)).appearance-ghost-light{--_appearance-color-text: var(--_connotation-color-fierce-primary);--_appearance-color-fill: color-mix(in srgb, var(--_connotation-color-primary), transparent 90%);--_appearance-color-outline: transparent}.control: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}.control:where(.active,:active):where(:not(.disabled,:disabled)).appearance-ghost-light{--_appearance-color-text: var(--_connotation-color-fierce-primary);--_appearance-color-fill: color-mix(in srgb, var(--_connotation-color-primary), transparent 80%);--_appearance-color-outline: transparent}.control:where([aria-current]):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: transparent}.control:where([aria-current]):where(:not(.disabled,:disabled)).appearance-ghost-light{--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: color-mix(in srgb, var(--_connotation-color-firm), transparent 10%);--_appearance-color-outline: transparent}.control:where([aria-current]):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: transparent}.control:where([aria-current]):where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)).appearance-ghost-light{--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: color-mix(in srgb, var(--_connotation-color-fierce-primary), transparent 20%);--_appearance-color-outline: transparent}.control[aria-current]{color:var(--_appearance-color-text)}.control:not([aria-current]){color:var(--vvd-color-canvas-text)}.control: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))}:host(:where([aria-current=true][open])) .control,:host(:not([aria-current=true])) .control{--focus-stroke-gap-color: transparent}@supports (user-select: none){.control{user-select:none}}.control .toggleIcon{margin-inline-start:auto}slot[name=icon]{font-size:20px;line-height:1}.content{display:flex;flex-direction:column;border-inline-start:1px solid var(--vvd-color-neutral-200);gap:4px;margin-block:4px;margin-inline-start:20px;padding-inline-start:12px}details>summary{list-style:none}details>summary::-webkit-details-marker{display:none}\n";
11
12
 
12
13
  var __defProp = Object.defineProperty;
13
14
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -50,6 +51,12 @@ class NavDisclosure extends index.FoundationElement {
50
51
  __decorateClass([
51
52
  index.attr
52
53
  ], NavDisclosure.prototype, "label", 2);
54
+ __decorateClass([
55
+ index.attr
56
+ ], NavDisclosure.prototype, "appearance", 2);
57
+ __decorateClass([
58
+ index.attr
59
+ ], NavDisclosure.prototype, "connotation", 2);
53
60
  __decorateClass([
54
61
  index.attr({ mode: "boolean" })
55
62
  ], NavDisclosure.prototype, "open", 2);
@@ -61,11 +68,16 @@ applyMixins.applyMixins(NavDisclosure, affix.AffixIcon);
61
68
  function getAriaCurrent(ariaCurrent, open) {
62
69
  return ariaCurrent && !open;
63
70
  }
71
+ const getClasses = ({ appearance, connotation }) => classNames.classNames(
72
+ "control",
73
+ [`appearance-${appearance}`, Boolean(appearance)],
74
+ [`connotation-${connotation}`, Boolean(connotation)]
75
+ );
64
76
  const NavDisclosureTemplate = (context) => {
65
77
  const affixIconTemplate = affix.affixIconTemplateFactory(context);
66
78
  const iconTag = context.tagFor(icon.Icon);
67
79
  return index.html`<details class="base" ${ref.ref("details")} ?open=${(x) => x.open}>
68
- <summary class="control"
80
+ <summary class="${getClasses}"
69
81
  role="button"
70
82
  aria-controls="disclosure-content"
71
83
  aria-expanded="${(x) => x.open}"