@nvidia-elements/core 2.0.1 → 2.0.3

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 (195) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +1 -1
  3. package/dist/_virtual/{_@oxc-project_runtime@0.132.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/decorate.js +1 -1
  4. package/dist/accordion/accordion2.js +5 -5
  5. package/dist/alert/alert-group2.js +2 -2
  6. package/dist/alert/alert2.js +2 -2
  7. package/dist/avatar/avatar-group2.js +1 -1
  8. package/dist/avatar/avatar.examples.js.map +1 -1
  9. package/dist/avatar/avatar.examples.json +1 -1
  10. package/dist/avatar/avatar2.js +2 -2
  11. package/dist/badge/badge2.js +2 -2
  12. package/dist/breadcrumb/breadcrumb2.js +2 -2
  13. package/dist/bundles/index.d.ts +6 -17
  14. package/dist/bundles/index.js +6 -6
  15. package/dist/button/button2.js +2 -2
  16. package/dist/button-group/button-group2.js +2 -2
  17. package/dist/card/card.examples.js.map +1 -1
  18. package/dist/card/card.examples.json +1 -1
  19. package/dist/card/card2.js +5 -5
  20. package/dist/chat-message/chat-message.d.ts +0 -2
  21. package/dist/chat-message/chat-message2.js +2 -2
  22. package/dist/chat-message/chat-message2.js.map +1 -1
  23. package/dist/checkbox/checkbox-group2.js +2 -2
  24. package/dist/checkbox/checkbox2.js +2 -2
  25. package/dist/color/color2.js +2 -2
  26. package/dist/combobox/combobox2.js +8 -8
  27. package/dist/copy-button/copy-button2.js +2 -2
  28. package/dist/custom-elements.json +155 -720
  29. package/dist/data.html.json +26 -3
  30. package/dist/data.snippets.json +27 -27
  31. package/dist/date/date2.js +2 -2
  32. package/dist/datetime/datetime2.js +2 -2
  33. package/dist/dialog/dialog-footer2.js +2 -2
  34. package/dist/dialog/dialog-header2.js +2 -2
  35. package/dist/dialog/dialog2.js +2 -2
  36. package/dist/divider/divider2.js +2 -2
  37. package/dist/dot/dot2.js +2 -2
  38. package/dist/drawer/drawer-content2.js +2 -2
  39. package/dist/drawer/drawer-footer2.js +2 -2
  40. package/dist/drawer/drawer-header2.js +2 -2
  41. package/dist/drawer/drawer2.js +2 -2
  42. package/dist/dropdown/dropdown-footer2.js +2 -2
  43. package/dist/dropdown/dropdown-header2.js +2 -2
  44. package/dist/dropdown/dropdown2.js +2 -2
  45. package/dist/dropdown-group/dropdown-group.d.ts +0 -1
  46. package/dist/dropdown-group/dropdown-group.js +2 -2
  47. package/dist/dropdown-group/dropdown-group.js.map +1 -1
  48. package/dist/dropzone/dropzone.d.ts +0 -1
  49. package/dist/dropzone/dropzone2.js +2 -2
  50. package/dist/dropzone/dropzone2.js.map +1 -1
  51. package/dist/file/file2.js +1 -1
  52. package/dist/format-datetime/format-datetime.d.ts +1 -0
  53. package/dist/format-datetime/format-datetime2.js +2 -2
  54. package/dist/format-datetime/format-datetime2.js.map +1 -1
  55. package/dist/format-number/format-number.d.ts +1 -0
  56. package/dist/format-number/format-number2.js +2 -2
  57. package/dist/format-number/format-number2.js.map +1 -1
  58. package/dist/format-relative-time/format-relative-time.d.ts +1 -0
  59. package/dist/format-relative-time/format-relative-time2.js +6 -3
  60. package/dist/format-relative-time/format-relative-time2.js.map +1 -1
  61. package/dist/forms/control/control.js +1 -1
  62. package/dist/forms/control/control.js.map +1 -1
  63. package/dist/forms/control/control2.js +39 -21
  64. package/dist/forms/control/control2.js.map +1 -1
  65. package/dist/forms/control-group/control-group.js +1 -1
  66. package/dist/forms/control-group/control-group.js.map +1 -1
  67. package/dist/forms/control-group/control-group2.js +2 -2
  68. package/dist/forms/control-group/control-group2.js.map +1 -1
  69. package/dist/forms/control-message/control-message2.js +2 -2
  70. package/dist/forms/utils/states.d.ts +6 -3
  71. package/dist/forms/utils/states.js +40 -32
  72. package/dist/forms/utils/states.js.map +1 -1
  73. package/dist/grid/cell/cell2.js +1 -1
  74. package/dist/grid/column/column2.js +2 -2
  75. package/dist/grid/footer/footer2.js +2 -2
  76. package/dist/grid/grid2.js +2 -2
  77. package/dist/grid/header/header2.js +2 -2
  78. package/dist/grid/placeholder/placeholder2.js +1 -1
  79. package/dist/grid/row/row2.js +2 -2
  80. package/dist/icon/icon2.js +3 -3
  81. package/dist/icon-button/icon-button2.js +2 -2
  82. package/dist/index.js +1 -1
  83. package/dist/input/input-group2.js +1 -1
  84. package/dist/input/input2.js +2 -2
  85. package/dist/internal/controllers/keynav-grid.controller.js +22 -18
  86. package/dist/internal/controllers/keynav-grid.controller.js.map +1 -1
  87. package/dist/internal/controllers/keynav-list.controller.d.ts +1 -0
  88. package/dist/internal/controllers/keynav-list.controller.js +6 -1
  89. package/dist/internal/controllers/keynav-list.controller.js.map +1 -1
  90. package/dist/internal/controllers/type-native-popover.controller.js +70 -40
  91. package/dist/internal/controllers/type-native-popover.controller.js.map +1 -1
  92. package/dist/internal/index.d.ts +0 -9
  93. package/dist/internal/index.js +20 -29
  94. package/dist/internal/services/global.service.js +1 -1
  95. package/dist/internal/services/log.service.js +1 -1
  96. package/dist/internal/services/log.service.js.map +1 -1
  97. package/dist/internal/types/index.d.ts +3 -0
  98. package/dist/internal/types/index.js.map +1 -1
  99. package/dist/internal/utils/dom.d.ts +1 -1
  100. package/dist/internal/utils/dom.js +71 -54
  101. package/dist/internal/utils/dom.js.map +1 -1
  102. package/dist/logo/logo2.js +2 -2
  103. package/dist/menu/menu-item2.js +2 -2
  104. package/dist/menu/menu2.js +2 -2
  105. package/dist/month/month2.js +2 -2
  106. package/dist/notification/notification-group2.js +2 -2
  107. package/dist/notification/notification2.js +2 -2
  108. package/dist/page/page-panel/page-panel-content2.js +1 -1
  109. package/dist/page/page-panel/page-panel-footer2.js +2 -2
  110. package/dist/page/page-panel/page-panel-header2.js +2 -2
  111. package/dist/page/page-panel/page-panel2.js +2 -2
  112. package/dist/page/page.examples.js.map +1 -1
  113. package/dist/page/page.examples.json +1 -1
  114. package/dist/page/page2.js +2 -2
  115. package/dist/page-header/page-header2.js +1 -1
  116. package/dist/page-loader/page-loader2.js +2 -2
  117. package/dist/pagination/pagination2.js +2 -2
  118. package/dist/panel/panel2.js +5 -5
  119. package/dist/password/password2.js +2 -2
  120. package/dist/preferences-input/preferences-input.js +1 -1
  121. package/dist/preferences-input/preferences-input.js.map +1 -1
  122. package/dist/preferences-input/preferences-input2.js +2 -2
  123. package/dist/progress-bar/progress-bar2.js +2 -2
  124. package/dist/progress-ring/progress-ring2.js +2 -2
  125. package/dist/progressive-filter-chip/progressive-filter-chip.examples.js.map +1 -1
  126. package/dist/progressive-filter-chip/progressive-filter-chip.examples.json +1 -1
  127. package/dist/progressive-filter-chip/progressive-filter-chip2.js +2 -2
  128. package/dist/pulse/pulse2.js +2 -2
  129. package/dist/radio/radio-group2.js +2 -2
  130. package/dist/radio/radio2.js +2 -2
  131. package/dist/range/range2.js +2 -2
  132. package/dist/resize-handle/resize-handle2.js +2 -2
  133. package/dist/search/search2.js +2 -2
  134. package/dist/select/select2.js +35 -21
  135. package/dist/select/select2.js.map +1 -1
  136. package/dist/skeleton/skeleton2.js +2 -2
  137. package/dist/sort-button/sort-button2.js +2 -2
  138. package/dist/sparkline/sparkline.utils.js +4 -2
  139. package/dist/sparkline/sparkline.utils.js.map +1 -1
  140. package/dist/sparkline/sparkline2.js +2 -2
  141. package/dist/star-rating/star-rating2.js +2 -2
  142. package/dist/steps/steps2.js +3 -3
  143. package/dist/switch/switch-group2.js +2 -2
  144. package/dist/switch/switch2.js +2 -2
  145. package/dist/tabs/tabs-group2.js +2 -2
  146. package/dist/tabs/tabs.examples.js.map +1 -1
  147. package/dist/tabs/tabs.examples.json +1 -1
  148. package/dist/tabs/tabs2.js +3 -3
  149. package/dist/tag/tag2.js +2 -2
  150. package/dist/textarea/textarea2.js +1 -1
  151. package/dist/time/time2.js +2 -2
  152. package/dist/toast/toast2.js +2 -2
  153. package/dist/toggletip/toggletip-footer.d.ts +1 -1
  154. package/dist/toggletip/toggletip-footer2.js +2 -2
  155. package/dist/toggletip/toggletip-footer2.js.map +1 -1
  156. package/dist/toggletip/toggletip-header.d.ts +1 -1
  157. package/dist/toggletip/toggletip-header2.js +2 -2
  158. package/dist/toggletip/toggletip-header2.js.map +1 -1
  159. package/dist/toggletip/toggletip2.js +2 -2
  160. package/dist/toolbar/toolbar2.js +2 -2
  161. package/dist/tooltip/tooltip2.js +2 -2
  162. package/dist/tree/tree-node2.js +2 -2
  163. package/dist/tree/tree2.js +2 -2
  164. package/dist/week/week2.js +2 -2
  165. package/package.json +8 -8
  166. package/dist/internal/controllers/state-active.controller.d.ts +0 -18
  167. package/dist/internal/controllers/state-active.controller.js +0 -29
  168. package/dist/internal/controllers/state-active.controller.js.map +0 -1
  169. package/dist/internal/controllers/state-current.controller.d.ts +0 -18
  170. package/dist/internal/controllers/state-current.controller.js +0 -28
  171. package/dist/internal/controllers/state-current.controller.js.map +0 -1
  172. package/dist/internal/controllers/state-disabled.controller.d.ts +0 -18
  173. package/dist/internal/controllers/state-disabled.controller.js +0 -20
  174. package/dist/internal/controllers/state-disabled.controller.js.map +0 -1
  175. package/dist/internal/controllers/state-pressed.controller.d.ts +0 -18
  176. package/dist/internal/controllers/state-pressed.controller.js +0 -20
  177. package/dist/internal/controllers/state-pressed.controller.js.map +0 -1
  178. package/dist/internal/controllers/type-button.controller.d.ts +0 -18
  179. package/dist/internal/controllers/type-button.controller.examples.js +0 -6
  180. package/dist/internal/controllers/type-button.controller.examples.js.map +0 -1
  181. package/dist/internal/controllers/type-button.controller.examples.json +0 -16
  182. package/dist/internal/controllers/type-button.controller.js +0 -21
  183. package/dist/internal/controllers/type-button.controller.js.map +0 -1
  184. package/dist/internal/controllers/type-command.controller.d.ts +0 -25
  185. package/dist/internal/controllers/type-command.controller.js +0 -38
  186. package/dist/internal/controllers/type-command.controller.js.map +0 -1
  187. package/dist/internal/controllers/type-interest.controller.d.ts +0 -23
  188. package/dist/internal/controllers/type-interest.controller.js +0 -51
  189. package/dist/internal/controllers/type-interest.controller.js.map +0 -1
  190. package/dist/internal/controllers/type-native-popover-trigger.controller.d.ts +0 -16
  191. package/dist/internal/controllers/type-native-popover-trigger.controller.js +0 -25
  192. package/dist/internal/controllers/type-native-popover-trigger.controller.js.map +0 -1
  193. package/dist/internal/controllers/type-submit.controller.d.ts +0 -22
  194. package/dist/internal/controllers/type-submit.controller.js +0 -49
  195. package/dist/internal/controllers/type-submit.controller.js.map +0 -1
@@ -23,75 +23,105 @@ var c = class {
23
23
  };
24
24
  }
25
25
  async hostConnected() {
26
- i(this.host), this.host.popover = this.host.popoverType ?? null, await this.host.updateComplete, this.host.setAttribute("nve-popover", ""), this.#p(), this.#f(), this.#u(), this.host.inert = this.host.matches(":not(:popover-open)") && !!this.#e.length, this.host.addEventListener("beforetoggle", (e) => {
27
- e.newState === "open" && this.host._internals.states.add("transition-start");
28
- }), this.host.addEventListener("toggle", (e) => {
29
- this.host.behaviorTrigger && (this.host.hidden = e.newState === "closed"), e.newState === "open" && this.host.closeTimeout && this.#a(), e.newState === "closed" && (this.#s(), this.#o()), this.host.inert = this.host.matches(":not(:popover-open)"), this.host.modal && this.#m(e.newState === "open", e.target), this.host.dispatchEvent(new CustomEvent(e.newState === "open" && e.oldState !== "open" ? "open" : "close", {
30
- bubbles: !0,
31
- composed: !0,
32
- detail: { trigger: e.source }
33
- }));
34
- }), this.host.addEventListener("command", ((e) => {
35
- e.command === "toggle-popover" && this.host.togglePopover({ source: e.source }), e.command === "hide-popover" && (this.host.hidePopover(), this.#s()), e.command === "show-popover" && this.host.showPopover({ source: e.source });
36
- })), this.host.addEventListener("interest", ((e) => {
37
- if (e.source?.localName.includes("-")) {
38
- let t = this.host.openDelay ?? this.#c();
39
- t ? this.#t = setTimeout(() => {
40
- this.host.isConnected && this.host.showPopover({ source: e.source });
41
- }, t) : this.host.showPopover({ source: e.source });
42
- }
43
- })), this.host.addEventListener("loseinterest", ((e) => {
44
- e.source?.localName.includes("-") && this.host.hidePopover(), this.#t &&= (clearTimeout(this.#t), null);
45
- }));
26
+ i(this.host), this.host.popover = this.host.popoverType ?? null, await this.host.updateComplete, this.host.isConnected && (this.host.setAttribute("nve-popover", ""), this.#m(), this.#p(), this.#d(), this.host.inert = this.host.matches(":not(:popover-open)") && !!this.#e.length, this.host.addEventListener("beforetoggle", this.#b), this.host.addEventListener("toggle", this.#x), this.host.addEventListener("command", this.#S), this.host.addEventListener("interest", this.#C), this.host.addEventListener("loseinterest", this.#w));
46
27
  }
47
28
  #t = null;
48
29
  #n = null;
49
30
  #r = [];
50
31
  #i = null;
32
+ #a = null;
51
33
  async hostUpdated() {
52
- this.host.popover = this.host.popoverType ?? null, this.#p();
34
+ this.host.popover = this.host.popoverType ?? null, this.#m();
53
35
  }
54
36
  hostDisconnected() {
55
- this.#r.forEach((e) => e.disconnect()), this.#s(), this.#o();
56
- }
57
- #a() {
58
- this.#o(), this.host.closeTimeout && (this.#n = setTimeout(() => this.host.hidePopover(), this.host.closeTimeout));
37
+ this.#r.forEach((e) => e.disconnect()), this.#r.length = 0, this.host.removeEventListener("beforetoggle", this.#b), this.host.removeEventListener("toggle", this.#x), this.host.removeEventListener("command", this.#S), this.host.removeEventListener("interest", this.#C), this.host.removeEventListener("loseinterest", this.#w), this.host.removeEventListener("pointerdown", this.#T), this.host.removeEventListener("pointerup", this.#E), this.#y(), this.#c(), this.#s();
59
38
  }
60
39
  #o() {
61
- this.#n &&= (clearTimeout(this.#n), null);
40
+ this.#s(), this.host.closeTimeout && (this.#n = setTimeout(() => this.host.hidePopover(), this.host.closeTimeout));
62
41
  }
63
42
  #s() {
64
- this.#t &&= (clearTimeout(this.#t), null);
43
+ this.#n &&= (clearTimeout(this.#n), null);
65
44
  }
66
45
  #c() {
46
+ this.#t &&= (clearTimeout(this.#t), null);
47
+ }
48
+ #l() {
67
49
  let e = getComputedStyle(this.host).interestDelayStart;
68
50
  if (!e) return 0;
69
51
  let t = parseFloat(e);
70
52
  return e.endsWith("ms") ? t : t * 1e3;
71
53
  }
72
- #l = !1;
73
- #u() {
74
- this.host.addEventListener("pointerdown", (e) => {
75
- this.host.modal && this.host.matches(":popover-open") && (this.#l = t(e, this.host));
76
- }), this.host.addEventListener("pointerup", (e) => {
77
- this.#l && this.host.popoverDismissible && this.host.modal && this.host.matches(":popover-open") && !s(this.host) && t(e, this.host) && this.host.hidePopover();
78
- });
54
+ #u = !1;
55
+ #d() {
56
+ this.host.removeEventListener("pointerdown", this.#T), this.host.removeEventListener("pointerup", this.#E), this.host.addEventListener("pointerdown", this.#T), this.host.addEventListener("pointerup", this.#E);
79
57
  }
80
- get #d() {
58
+ get #f() {
81
59
  return this.host.trigger ? o(this.host, this.host.trigger) : null;
82
60
  }
83
- async #f() {
61
+ async #p() {
84
62
  await new Promise((e) => requestAnimationFrame(e)), this.#r.push(r(this.host, ["hidden"], () => {
85
63
  this.host.isConnected && !this.host.hidden && !this.host.matches(":popover-open") && this.host.showPopover(), this.host.isConnected && this.host.hidden && this.host.matches(":popover-open") && this.host.hidePopover();
86
64
  })), this.host.isConnected && !this.#e.length && !this.host.hidden && !this.host.matches(":popover-open") && (this.host.popover = "manual", this.host.showPopover());
87
65
  }
88
- #p() {
89
- let e = this.#d;
90
- this.#i && this.#i !== e && (this.#i.popoverTargetElement = null, this.#i.removeAttribute("popovertarget")), e && (this.host.popoverType === "hint" ? (e.addEventListener("mouseenter", () => this.host.showPopover({ source: e })), e.addEventListener("mouseleave", () => this.host.hidePopover()), e.addEventListener("focusout", () => this.host.hidePopover())) : (this.host.id = this.host.id ? this.host.id : n(), e.popoverTargetElement = this.host, e.setAttribute("popovertarget", this.host.id)), this.#i = e);
66
+ #m() {
67
+ let e = this.#f;
68
+ if (this.#i && this.#i !== e && this.#v(this.#i), this.#a && this.#a !== e && this.#y(), !e) {
69
+ this.#i = null;
70
+ return;
71
+ }
72
+ this.host.popoverType === "hint" ? this.#h(e) : this.#g(e), this.#i = e;
73
+ }
74
+ #h(e) {
75
+ this.#a !== e && (e.addEventListener("mouseenter", this.#D), e.addEventListener("mouseleave", this.#O), e.addEventListener("focusout", this.#O), this.#a = e);
76
+ }
77
+ #g(e) {
78
+ this.#y(), this.host.id = this.host.id ? this.host.id : n(), e.popoverTargetElement = this.host, e.setAttribute("popovertarget", this.host.id);
91
79
  }
92
- #m(t, n) {
80
+ #_(t, n) {
93
81
  t ? this.host.getRootNode().activeElement !== this.host && !this.host.shadowRoot.activeElement && e(this.host) : e(n);
94
82
  }
83
+ #v(e) {
84
+ e.popoverTargetElement = null, e.removeAttribute("popovertarget"), this.#a === e && this.#y();
85
+ }
86
+ #y() {
87
+ this.#a?.removeEventListener("mouseenter", this.#D), this.#a?.removeEventListener("mouseleave", this.#O), this.#a?.removeEventListener("focusout", this.#O), this.#a = null;
88
+ }
89
+ #b = (e) => {
90
+ e.newState === "open" && this.host._internals.states.add("transition-start");
91
+ };
92
+ #x = (e) => {
93
+ this.host.behaviorTrigger && (this.host.hidden = e.newState === "closed"), e.newState === "open" && this.host.closeTimeout && this.#o(), e.newState === "closed" && (this.#c(), this.#s()), this.host.inert = this.host.matches(":not(:popover-open)"), this.host.modal && this.#_(e.newState === "open", e.target), this.host.dispatchEvent(new CustomEvent(e.newState === "open" && e.oldState !== "open" ? "open" : "close", {
94
+ bubbles: !0,
95
+ composed: !0,
96
+ detail: { trigger: e.source }
97
+ }));
98
+ };
99
+ #S = (e) => {
100
+ e.command === "toggle-popover" && this.host.togglePopover({ source: e.source }), e.command === "hide-popover" && (this.host.hidePopover(), this.#c()), e.command === "show-popover" && this.host.showPopover({ source: e.source });
101
+ };
102
+ #C = (e) => {
103
+ if (e.source?.localName.includes("-")) {
104
+ let t = this.host.openDelay ?? this.#l();
105
+ t ? this.#t = setTimeout(() => {
106
+ this.host.isConnected && this.host.showPopover({ source: e.source });
107
+ }, t) : this.host.showPopover({ source: e.source });
108
+ }
109
+ };
110
+ #w = (e) => {
111
+ e.source?.localName.includes("-") && this.host.hidePopover(), this.#c();
112
+ };
113
+ #T = (e) => {
114
+ this.host.modal && this.host.matches(":popover-open") && (this.#u = t(e, this.host));
115
+ };
116
+ #E = (e) => {
117
+ this.#u && this.host.popoverDismissible && this.host.modal && this.host.matches(":popover-open") && !s(this.host) && t(e, this.host) && this.host.hidePopover();
118
+ };
119
+ #D = (e) => {
120
+ this.host.showPopover({ source: e.currentTarget });
121
+ };
122
+ #O = () => {
123
+ this.host.hidePopover();
124
+ };
95
125
  };
96
126
  //#endregion
97
127
  export { c as TypeNativePopoverController };
@@ -1 +1 @@
1
- {"version":3,"file":"type-native-popover.controller.js","names":["#nativeTriggers","#updateLegacyTriggers","#setupLegacyTriggers","#setupModalLightDismiss","#setCloseTimeout","#clearInterestTimeout","#clearCloseTimeout","#toggleFocus","#parseInterestDelay","#interestTimeout","#observers","#closeTimeout","#pointerdownWithinModal","#legacyHostTrigger","#previousLegacyTrigger"],"sources":["../../../src/internal/controllers/type-native-popover.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport { clickOutsideElementBounds, generateId, getAttributeListChanges } from '../utils/dom.js';\nimport { attachInternals } from '../utils/a11y.js';\nimport { focusElement } from '../utils/focus.js';\nimport { getHostAnchor, getHostTrigger, hasOpenPopover } from './type-native-popover.utils.js';\nimport type { PopoverType } from '../types/index.js';\nimport type { InterestEvent } from './type-interest.controller.js';\n\nexport interface NativePopover extends ReactiveElement {\n anchor?: HTMLElement | string;\n closeTimeout?: number;\n popoverType?: PopoverType;\n modal?: boolean;\n popoverDismissible?: boolean;\n _activeTrigger?: HTMLElement;\n _internals?: ElementInternals;\n\n /** @deprecated */\n trigger?: HTMLElement | string;\n /** @deprecated */\n openDelay?: number;\n /** @deprecated */\n behaviorTrigger?: boolean;\n}\n\n/**\n * https://open-ui.org/components/popup.research.explainer\n */\nexport class TypeNativePopoverController<T extends NativePopover> implements ReactiveController {\n get #nativeTriggers(): HTMLElement[] {\n const root = this.host.getRootNode() as HTMLElement;\n const popoverTargetTriggers = Array.from(\n root.querySelectorAll(`[popovertarget=\"${CSS.escape ? CSS.escape(this.host.id) : this.host.id}\"]`)\n ) as HTMLElement[];\n\n const commandForTriggers = Array.from(\n root.querySelectorAll(`[commandfor=\"${CSS.escape ? CSS.escape(this.host.id) : this.host.id}\"]`)\n ) as HTMLElement[];\n\n const interestForTriggers = Array.from(\n root.querySelectorAll(`[interestfor=\"${CSS.escape ? CSS.escape(this.host.id) : this.host.id}\"]`)\n ) as HTMLElement[];\n\n return [...popoverTargetTriggers, ...commandForTriggers, ...interestForTriggers];\n }\n\n constructor(private host: T) {\n this.host.addController(this);\n\n const showPopover = this.host.showPopover;\n this.host.showPopover = (options?: ShowPopoverOptions) => {\n if (this.host.isConnected) {\n // provide legacy fallback for source anchor or trigger if not provided, this can happen if the popover is dynamically created in the DOM without the use of the standard popover api or legacy trigger based api\n let source: HTMLElement | Element | null = options?.source ?? null;\n if (!source) {\n if (this.host.anchor) {\n source = getHostAnchor(this.host);\n } else if (this.host.trigger) {\n source = getHostTrigger(this.host, this.host.trigger);\n } else {\n source = globalThis.document.activeElement;\n }\n }\n\n showPopover.call(this.host, { source: source as HTMLElement });\n }\n };\n }\n\n // eslint-disable-next-line max-lines-per-function\n async hostConnected() {\n attachInternals(this.host);\n this.host.popover = this.host.popoverType ?? null;\n await this.host.updateComplete;\n this.host.setAttribute('nve-popover', '');\n this.#updateLegacyTriggers();\n this.#setupLegacyTriggers(); // eslint-disable-line @typescript-eslint/no-floating-promises\n this.#setupModalLightDismiss();\n this.host.inert = this.host.matches(':not(:popover-open)') && !!this.#nativeTriggers.length;\n\n this.host.addEventListener('beforetoggle', e => {\n if (e.newState === 'open') {\n this.host._internals!.states.add('transition-start');\n }\n });\n\n this.host.addEventListener('toggle', (e: ToggleEvent) => {\n if (this.host.behaviorTrigger) {\n this.host.hidden = e.newState === 'closed';\n }\n\n if (e.newState === 'open' && this.host.closeTimeout) {\n this.#setCloseTimeout();\n }\n\n if (e.newState === 'closed') {\n this.#clearInterestTimeout();\n this.#clearCloseTimeout();\n }\n\n this.host.inert = this.host.matches(':not(:popover-open)');\n\n if (this.host.modal) {\n this.#toggleFocus(e.newState === 'open', e.target as HTMLElement);\n }\n\n this.host.dispatchEvent(\n new CustomEvent(e.newState === 'open' && e.oldState !== 'open' ? 'open' : 'close', {\n bubbles: true,\n composed: true,\n detail: { trigger: e.source }\n })\n );\n });\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API#creating_declarative_popovers\n this.host.addEventListener('command', ((e: CommandEvent) => {\n if (e.command === 'toggle-popover') {\n this.host.togglePopover({ source: e.source as HTMLElement });\n }\n\n if (e.command === 'hide-popover') {\n this.host.hidePopover();\n this.#clearInterestTimeout();\n }\n\n if (e.command === 'show-popover') {\n this.host.showPopover({ source: e.source as HTMLElement });\n }\n }) as EventListener);\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Popover_API/Using_interest_invokers\n this.host.addEventListener('interest', ((e: InterestEvent) => {\n const isCustomElement = e.source?.localName.includes('-');\n if (isCustomElement) {\n const interestDelayStart = this.host.openDelay ?? this.#parseInterestDelay();\n if (interestDelayStart) {\n this.#interestTimeout = setTimeout(() => {\n if (this.host.isConnected) {\n this.host.showPopover({ source: e.source as HTMLElement });\n }\n }, interestDelayStart);\n } else {\n this.host.showPopover({ source: e.source as HTMLElement });\n }\n }\n }) as EventListener);\n\n this.host.addEventListener('loseinterest', ((e: InterestEvent) => {\n const isCustomElement = e.source?.localName.includes('-');\n if (isCustomElement) {\n this.host.hidePopover();\n }\n\n if (this.#interestTimeout) {\n clearTimeout(this.#interestTimeout);\n this.#interestTimeout = null;\n }\n }) as EventListener);\n }\n\n #interestTimeout: ReturnType<typeof setTimeout> | null = null;\n #closeTimeout: ReturnType<typeof setTimeout> | null = null;\n #observers: MutationObserver[] = [];\n #previousLegacyTrigger: HTMLButtonElement | null = null;\n\n async hostUpdated() {\n this.host.popover = this.host.popoverType ?? null;\n this.#updateLegacyTriggers();\n }\n\n hostDisconnected() {\n this.#observers.forEach(observer => observer.disconnect());\n this.#clearInterestTimeout();\n this.#clearCloseTimeout();\n }\n\n #setCloseTimeout() {\n this.#clearCloseTimeout();\n if (this.host.closeTimeout) {\n this.#closeTimeout = setTimeout(() => this.host.hidePopover(), this.host.closeTimeout);\n }\n }\n\n #clearCloseTimeout() {\n if (this.#closeTimeout) {\n clearTimeout(this.#closeTimeout);\n this.#closeTimeout = null;\n }\n }\n\n #clearInterestTimeout() {\n if (this.#interestTimeout) {\n clearTimeout(this.#interestTimeout);\n this.#interestTimeout = null;\n }\n }\n\n #parseInterestDelay(): number {\n const style = getComputedStyle(this.host);\n const raw = (style as unknown as { interestDelayStart: string }).interestDelayStart;\n if (!raw) {\n return 0;\n }\n const value = parseFloat(raw);\n return raw.endsWith('ms') ? value : value * 1000;\n }\n\n #pointerdownWithinModal = false;\n\n #setupModalLightDismiss() {\n this.host.addEventListener('pointerdown', e => {\n if (this.host.modal && this.host.matches(':popover-open')) {\n this.#pointerdownWithinModal = clickOutsideElementBounds(e, this.host);\n }\n });\n\n this.host.addEventListener('pointerup', e => {\n if (\n this.#pointerdownWithinModal &&\n this.host.popoverDismissible &&\n this.host.modal &&\n this.host.matches(':popover-open') &&\n !hasOpenPopover(this.host) &&\n clickOutsideElementBounds(e, this.host)\n ) {\n this.host.hidePopover();\n }\n });\n }\n\n get #legacyHostTrigger(): HTMLElement | null {\n return this.host.trigger ? (getHostTrigger(this.host, this.host.trigger) as HTMLButtonElement) : null;\n }\n\n /**\n * @deprecated Legacy behavior that allows popovers to show as open by default when using the legacy trigger based api\n */\n async #setupLegacyTriggers() {\n await new Promise(r => requestAnimationFrame(r));\n\n // setup hidden updates for legacy triggers\n this.#observers.push(\n getAttributeListChanges(this.host, ['hidden'], () => {\n if (this.host.isConnected && !this.host.hidden && !this.host.matches(':popover-open')) {\n this.host.showPopover();\n }\n\n if (this.host.isConnected && this.host.hidden && this.host.matches(':popover-open')) {\n this.host.hidePopover();\n }\n })\n );\n\n // determine if popover is open by default\n if (\n this.host.isConnected &&\n !this.#nativeTriggers.length &&\n !this.host.hidden &&\n !this.host.matches(':popover-open')\n ) {\n this.host.popover = 'manual';\n this.host.showPopover();\n }\n }\n\n /**\n * @deprecated Legacy behavior that allows popovers to show as open by default when using the legacy trigger based api\n */\n #updateLegacyTriggers() {\n const trigger = this.#legacyHostTrigger as HTMLButtonElement;\n\n // Clean up previous trigger if it changed\n if (this.#previousLegacyTrigger && this.#previousLegacyTrigger !== trigger) {\n this.#previousLegacyTrigger.popoverTargetElement = null;\n this.#previousLegacyTrigger.removeAttribute('popovertarget');\n }\n\n // if not a hint type setup native popovertarget\n if (trigger) {\n if (this.host.popoverType === 'hint') {\n trigger.addEventListener('mouseenter', () => this.host.showPopover({ source: trigger as HTMLElement }));\n trigger.addEventListener('mouseleave', () => this.host.hidePopover());\n trigger.addEventListener('focusout', () => this.host.hidePopover());\n } else {\n this.host.id = this.host.id ? this.host.id : generateId();\n trigger.popoverTargetElement = this.host;\n trigger.setAttribute('popovertarget', this.host.id);\n }\n this.#previousLegacyTrigger = trigger;\n }\n }\n\n #toggleFocus(open: boolean, target: HTMLElement) {\n if (open) {\n // only focus popover if not the active element and not containing the active element already\n if ((this.host.getRootNode() as Document).activeElement !== this.host && !this.host.shadowRoot!.activeElement) {\n focusElement(this.host);\n }\n } else {\n focusElement(target);\n }\n }\n}\n"],"mappings":";;;;;AA+BA,IAAa,IAAb,MAAgG;CAC9F,IAAIA,KAAiC;EACnC,IAAM,IAAO,KAAK,KAAK,YAAY,GAC7B,IAAwB,MAAM,KAClC,EAAK,iBAAiB,mBAAmB,IAAI,SAAS,IAAI,OAAO,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,GAAG,GAAG,CACnG,GAEM,IAAqB,MAAM,KAC/B,EAAK,iBAAiB,gBAAgB,IAAI,SAAS,IAAI,OAAO,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,GAAG,GAAG,CAChG,GAEM,IAAsB,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onBeforeToggle","#onToggle","#onCommand","#onInterest","#onLoseInterest","#observers","#onPointerDown","#onPointerUp","#removeHintTrigger","#clearInterestTimeout","#clearCloseTimeout","#closeTimeout","#interestTimeout","#legacyHostTrigger","#previousLegacyTrigger","#clearLegacyTrigger","#hintTrigger","#setupHintTrigger","#setupPopoverTargetTrigger","#onHintMouseEnter","#onHintMouseLeave","#setCloseTimeout","#toggleFocus","#parseInterestDelay","#pointerdownWithinModal"],"sources":["../../../src/internal/controllers/type-native-popover.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport { clickOutsideElementBounds, generateId, getAttributeListChanges } from '../utils/dom.js';\nimport { attachInternals } from '../utils/a11y.js';\nimport { focusElement } from '../utils/focus.js';\nimport { getHostAnchor, getHostTrigger, hasOpenPopover } from './type-native-popover.utils.js';\nimport type { InterestEvent, PopoverType } from '../types/index.js';\n\nexport interface NativePopover extends ReactiveElement {\n anchor?: HTMLElement | string;\n closeTimeout?: number;\n popoverType?: PopoverType;\n modal?: boolean;\n popoverDismissible?: boolean;\n _activeTrigger?: HTMLElement;\n _internals?: ElementInternals;\n\n /** @deprecated */\n trigger?: HTMLElement | string;\n /** @deprecated */\n openDelay?: number;\n /** @deprecated */\n behaviorTrigger?: boolean;\n}\n\n/**\n * https://open-ui.org/components/popup.research.explainer\n */\nexport class TypeNativePopoverController<T extends NativePopover> implements ReactiveController {\n get #nativeTriggers(): HTMLElement[] {\n const root = this.host.getRootNode() as HTMLElement;\n const popoverTargetTriggers = Array.from(\n root.querySelectorAll(`[popovertarget=\"${CSS.escape ? CSS.escape(this.host.id) : this.host.id}\"]`)\n ) as HTMLElement[];\n\n const commandForTriggers = Array.from(\n root.querySelectorAll(`[commandfor=\"${CSS.escape ? CSS.escape(this.host.id) : this.host.id}\"]`)\n ) as HTMLElement[];\n\n const interestForTriggers = Array.from(\n root.querySelectorAll(`[interestfor=\"${CSS.escape ? CSS.escape(this.host.id) : this.host.id}\"]`)\n ) as HTMLElement[];\n\n return [...popoverTargetTriggers, ...commandForTriggers, ...interestForTriggers];\n }\n\n constructor(private host: T) {\n this.host.addController(this);\n\n const showPopover = this.host.showPopover;\n this.host.showPopover = (options?: ShowPopoverOptions) => {\n if (this.host.isConnected) {\n // provide legacy fallback for source anchor or trigger if not provided, this can happen if the popover is dynamically created in the DOM without the use of the standard popover api or legacy trigger based api\n let source: HTMLElement | Element | null = options?.source ?? null;\n if (!source) {\n if (this.host.anchor) {\n source = getHostAnchor(this.host);\n } else if (this.host.trigger) {\n source = getHostTrigger(this.host, this.host.trigger);\n } else {\n source = globalThis.document.activeElement;\n }\n }\n\n showPopover.call(this.host, { source: source as HTMLElement });\n }\n };\n }\n\n async hostConnected() {\n attachInternals(this.host);\n this.host.popover = this.host.popoverType ?? null;\n await this.host.updateComplete;\n if (!this.host.isConnected) return;\n\n this.host.setAttribute('nve-popover', '');\n this.#updateLegacyTriggers();\n this.#setupLegacyTriggers(); // eslint-disable-line @typescript-eslint/no-floating-promises\n this.#setupModalLightDismiss();\n this.host.inert = this.host.matches(':not(:popover-open)') && !!this.#nativeTriggers.length;\n\n this.host.addEventListener('beforetoggle', this.#onBeforeToggle);\n this.host.addEventListener('toggle', this.#onToggle as EventListener);\n this.host.addEventListener('command', this.#onCommand as EventListener);\n this.host.addEventListener('interest', this.#onInterest as EventListener);\n this.host.addEventListener('loseinterest', this.#onLoseInterest as EventListener);\n }\n\n #interestTimeout: ReturnType<typeof setTimeout> | null = null;\n #closeTimeout: ReturnType<typeof setTimeout> | null = null;\n #observers: MutationObserver[] = [];\n #previousLegacyTrigger: HTMLButtonElement | null = null;\n #hintTrigger: HTMLButtonElement | null = null;\n\n async hostUpdated() {\n this.host.popover = this.host.popoverType ?? null;\n this.#updateLegacyTriggers();\n }\n\n hostDisconnected() {\n this.#observers.forEach(observer => observer.disconnect());\n this.#observers.length = 0;\n this.host.removeEventListener('beforetoggle', this.#onBeforeToggle);\n this.host.removeEventListener('toggle', this.#onToggle as EventListener);\n this.host.removeEventListener('command', this.#onCommand as EventListener);\n this.host.removeEventListener('interest', this.#onInterest as EventListener);\n this.host.removeEventListener('loseinterest', this.#onLoseInterest as EventListener);\n this.host.removeEventListener('pointerdown', this.#onPointerDown);\n this.host.removeEventListener('pointerup', this.#onPointerUp);\n this.#removeHintTrigger();\n this.#clearInterestTimeout();\n this.#clearCloseTimeout();\n }\n\n #setCloseTimeout() {\n this.#clearCloseTimeout();\n if (this.host.closeTimeout) {\n this.#closeTimeout = setTimeout(() => this.host.hidePopover(), this.host.closeTimeout);\n }\n }\n\n #clearCloseTimeout() {\n if (this.#closeTimeout) {\n clearTimeout(this.#closeTimeout);\n this.#closeTimeout = null;\n }\n }\n\n #clearInterestTimeout() {\n if (this.#interestTimeout) {\n clearTimeout(this.#interestTimeout);\n this.#interestTimeout = null;\n }\n }\n\n #parseInterestDelay(): number {\n const style = getComputedStyle(this.host);\n const raw = (style as unknown as { interestDelayStart: string }).interestDelayStart;\n if (!raw) {\n return 0;\n }\n const value = parseFloat(raw);\n return raw.endsWith('ms') ? value : value * 1000;\n }\n\n #pointerdownWithinModal = false;\n\n #setupModalLightDismiss() {\n this.host.removeEventListener('pointerdown', this.#onPointerDown);\n this.host.removeEventListener('pointerup', this.#onPointerUp);\n this.host.addEventListener('pointerdown', this.#onPointerDown);\n this.host.addEventListener('pointerup', this.#onPointerUp);\n }\n\n get #legacyHostTrigger(): HTMLElement | null {\n return this.host.trigger ? (getHostTrigger(this.host, this.host.trigger) as HTMLButtonElement) : null;\n }\n\n /**\n * @deprecated Legacy behavior that allows popovers to show as open by default when using the legacy trigger based api\n */\n async #setupLegacyTriggers() {\n await new Promise(r => requestAnimationFrame(r));\n\n // setup hidden updates for legacy triggers\n this.#observers.push(\n getAttributeListChanges(this.host, ['hidden'], () => {\n if (this.host.isConnected && !this.host.hidden && !this.host.matches(':popover-open')) {\n this.host.showPopover();\n }\n\n if (this.host.isConnected && this.host.hidden && this.host.matches(':popover-open')) {\n this.host.hidePopover();\n }\n })\n );\n\n // determine if popover is open by default\n if (\n this.host.isConnected &&\n !this.#nativeTriggers.length &&\n !this.host.hidden &&\n !this.host.matches(':popover-open')\n ) {\n this.host.popover = 'manual';\n this.host.showPopover();\n }\n }\n\n /**\n * @deprecated Legacy behavior that allows popovers to show as open by default when using the legacy trigger based api\n */\n #updateLegacyTriggers() {\n const trigger = this.#legacyHostTrigger as HTMLButtonElement;\n\n if (this.#previousLegacyTrigger && this.#previousLegacyTrigger !== trigger) {\n this.#clearLegacyTrigger(this.#previousLegacyTrigger);\n }\n\n if (this.#hintTrigger && this.#hintTrigger !== trigger) {\n this.#removeHintTrigger();\n }\n\n if (!trigger) {\n this.#previousLegacyTrigger = null;\n return;\n }\n\n if (this.host.popoverType === 'hint') {\n this.#setupHintTrigger(trigger);\n } else {\n this.#setupPopoverTargetTrigger(trigger);\n }\n this.#previousLegacyTrigger = trigger;\n }\n\n #setupHintTrigger(trigger: HTMLButtonElement) {\n if (this.#hintTrigger === trigger) return;\n\n trigger.addEventListener('mouseenter', this.#onHintMouseEnter);\n trigger.addEventListener('mouseleave', this.#onHintMouseLeave);\n trigger.addEventListener('focusout', this.#onHintMouseLeave);\n this.#hintTrigger = trigger;\n }\n\n #setupPopoverTargetTrigger(trigger: HTMLButtonElement) {\n this.#removeHintTrigger();\n this.host.id = this.host.id ? this.host.id : generateId();\n trigger.popoverTargetElement = this.host;\n trigger.setAttribute('popovertarget', this.host.id);\n }\n\n #toggleFocus(open: boolean, target: HTMLElement) {\n if (open) {\n // only focus popover if not the active element and not containing the active element already\n if ((this.host.getRootNode() as Document).activeElement !== this.host && !this.host.shadowRoot!.activeElement) {\n focusElement(this.host);\n }\n } else {\n focusElement(target);\n }\n }\n\n #clearLegacyTrigger(trigger: HTMLButtonElement) {\n trigger.popoverTargetElement = null;\n trigger.removeAttribute('popovertarget');\n if (this.#hintTrigger === trigger) {\n this.#removeHintTrigger();\n }\n }\n\n #removeHintTrigger() {\n this.#hintTrigger?.removeEventListener('mouseenter', this.#onHintMouseEnter);\n this.#hintTrigger?.removeEventListener('mouseleave', this.#onHintMouseLeave);\n this.#hintTrigger?.removeEventListener('focusout', this.#onHintMouseLeave);\n this.#hintTrigger = null;\n }\n\n #onBeforeToggle = (e: ToggleEvent) => {\n if (e.newState === 'open') {\n this.host._internals!.states.add('transition-start');\n }\n };\n\n #onToggle = (e: ToggleEvent) => {\n if (this.host.behaviorTrigger) {\n this.host.hidden = e.newState === 'closed';\n }\n\n if (e.newState === 'open' && this.host.closeTimeout) {\n this.#setCloseTimeout();\n }\n\n if (e.newState === 'closed') {\n this.#clearInterestTimeout();\n this.#clearCloseTimeout();\n }\n\n this.host.inert = this.host.matches(':not(:popover-open)');\n\n if (this.host.modal) {\n this.#toggleFocus(e.newState === 'open', e.target as HTMLElement);\n }\n\n this.host.dispatchEvent(\n new CustomEvent(e.newState === 'open' && e.oldState !== 'open' ? 'open' : 'close', {\n bubbles: true,\n composed: true,\n detail: { trigger: e.source }\n })\n );\n };\n\n #onCommand = (e: CommandEvent) => {\n if (e.command === 'toggle-popover') {\n this.host.togglePopover({ source: e.source as HTMLElement });\n }\n\n if (e.command === 'hide-popover') {\n this.host.hidePopover();\n this.#clearInterestTimeout();\n }\n\n if (e.command === 'show-popover') {\n this.host.showPopover({ source: e.source as HTMLElement });\n }\n };\n\n #onInterest = (e: InterestEvent) => {\n const isCustomElement = e.source?.localName.includes('-');\n if (isCustomElement) {\n const interestDelayStart = this.host.openDelay ?? this.#parseInterestDelay();\n if (interestDelayStart) {\n this.#interestTimeout = setTimeout(() => {\n if (this.host.isConnected) {\n this.host.showPopover({ source: e.source as HTMLElement });\n }\n }, interestDelayStart);\n } else {\n this.host.showPopover({ source: e.source as HTMLElement });\n }\n }\n };\n\n #onLoseInterest = (e: InterestEvent) => {\n const isCustomElement = e.source?.localName.includes('-');\n if (isCustomElement) {\n this.host.hidePopover();\n }\n\n this.#clearInterestTimeout();\n };\n\n #onPointerDown = (e: PointerEvent) => {\n if (this.host.modal && this.host.matches(':popover-open')) {\n this.#pointerdownWithinModal = clickOutsideElementBounds(e, this.host);\n }\n };\n\n #onPointerUp = (e: PointerEvent) => {\n if (\n this.#pointerdownWithinModal &&\n this.host.popoverDismissible &&\n this.host.modal &&\n this.host.matches(':popover-open') &&\n !hasOpenPopover(this.host) &&\n clickOutsideElementBounds(e, this.host)\n ) {\n this.host.hidePopover();\n }\n };\n\n #onHintMouseEnter = (e: MouseEvent) => {\n this.host.showPopover({ source: e.currentTarget as HTMLElement });\n };\n\n #onHintMouseLeave = () => {\n this.host.hidePopover();\n };\n}\n"],"mappings":";;;;;AA8BA,IAAa,IAAb,MAAgG;CAC9F,IAAIA,KAAiC;EACnC,IAAM,IAAO,KAAK,KAAK,YAAY,GAC7B,IAAwB,MAAM,KAClC,EAAK,iBAAiB,mBAAmB,IAAI,SAAS,IAAI,OAAO,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,GAAG,GAAG,CACnG,GAEM,IAAqB,MAAM,KAC/B,EAAK,iBAAiB,gBAAgB,IAAI,SAAS,IAAI,OAAO,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,GAAG,GAAG,CAChG,GAEM,IAAsB,MAAM,KAChC,EAAK,iBAAiB,iBAAiB,IAAI,SAAS,IAAI,OAAO,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,GAAG,GAAG,CACjG;EAEA,OAAO;GAAC,GAAG;GAAuB,GAAG;GAAoB,GAAG;EAAmB;CACjF;CAEA,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,IAAI;EAE5B,IAAM,IAAc,KAAK,KAAK;EAC9B,KAAK,KAAK,eAAe,MAAiC;GACxD,IAAI,KAAK,KAAK,aAAa;IAEzB,IAAI,IAAuC,GAAS,UAAU;IAW9D,AAVA,AAMI,MALE,KAAK,K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B,iBAAiB;IACvC,AAAI,KAAK,KAAK,eACZ,KAAK,KAAK,YAAY,EAAE,QAAQ,EAAE,OAAsB,CAAC;GAE7D,GAAG,CAAkB,IAErB,KAAK,KAAK,YAAY,EAAE,QAAQ,EAAE,OAAsB,CAAC;EAE7D;CACF;CAEA,MAAmB,MAAqB;EAMtC,AALwB,EAAE,QAAQ,UAAU,SAAS,GAAG,KAEtD,KAAK,KAAK,YAAY,GAGxB,KAAKH,GAAsB;CAC7B;CAEA,MAAkB,MAAoB;EACpC,AAAI,KAAK,KAAK,SAAS,KAAK,KAAK,QAAQ,eAAe,MACtD,KAAKe,KAA0B,EAA0B,GAAG,KAAK,IAAI;CAEzE;CAEA,MAAgB,MAAoB;EAClC,AACE,KAAKA,MACL,KAAK,KAAK,sBACV,KAAK,KAAK,SACV,KAAK,KAAK,QAAQ,eAAe,KACjC,CAAC,EAAe,KAAK,IAAI,KACzB,EAA0B,GAAG,KAAK,IAAI,KAEtC,KAAK,KAAK,YAAY;CAE1B;CAEA,MAAqB,MAAkB;EACrC,KAAK,KAAK,YAAY,EAAE,QAAQ,EAAE,cAA6B,CAAC;CAClE;CAEA,WAA0B;EACxB,KAAK,KAAK,YAAY;CACxB;AACF"}
@@ -5,25 +5,16 @@ export * from './controllers/audit.controller.js';
5
5
  export * from './controllers/i18n.controller.js';
6
6
  export * from './controllers/keynav-grid.controller.js';
7
7
  export * from './controllers/keynav-list.controller.js';
8
- export * from './controllers/state-active.controller.js';
9
- export * from './controllers/state-current.controller.js';
10
- export * from './controllers/state-disabled.controller.js';
11
8
  export * from './controllers/state-expanded.controller.js';
12
9
  export * from './controllers/state-highlighted.controller.js';
13
10
  export * from './controllers/state-scroll.controller.js';
14
11
  export * from './controllers/state-selected.controller.js';
15
- export * from './controllers/state-pressed.controller.js';
16
12
  export * from './controllers/type-anchor.controller.js';
17
13
  export * from './controllers/type-closable.controller.js';
18
- export * from './controllers/type-command.controller.js';
19
- export * from './controllers/type-interest.controller.js';
20
14
  export * from './controllers/type-expandable.controller.js';
21
15
  export * from './controllers/type-selectable.controller.js';
22
- export * from './controllers/type-button.controller.js';
23
- export * from './controllers/type-native-popover-trigger.controller.js';
24
16
  export * from './controllers/type-native-popover.controller.js';
25
17
  export * from './controllers/type-ssr.controller.js';
26
- export * from './controllers/type-submit.controller.js';
27
18
  export * from './controllers/type-touch.controller.js';
28
19
  export * from './decorators/host-attr.js';
29
20
  export * from './decorators/scoped-registry.js';
@@ -12,32 +12,23 @@ import { KeynavCode as N, appendAnchorName as P, appendRootNodeStyle as F, apply
12
12
  import { KeyNavigationGridController as _e, getNextKeyGridItem as ve, keyNavigationGrid as ye } from "./controllers/keynav-grid.controller.js";
13
13
  import { KeyNavigationListController as be, getNextKeyListItem as xe, keyNavigationList as Se } from "./controllers/keynav-list.controller.js";
14
14
  import { associateAriaDescribedBy as Ce, associateAriaLabel as we, associateControlGroup as Te, associateDataList as Ee, associateLabel as De, attachInternals as Oe } from "./utils/a11y.js";
15
- import { StateActiveController as ke, stateActive as Ae } from "./controllers/state-active.controller.js";
16
- import { StateCurrentController as je, stateCurrent as Me } from "./controllers/state-current.controller.js";
17
- import { StateDisabledController as Ne, stateDisabled as Pe } from "./controllers/state-disabled.controller.js";
18
- import { StateExpandedController as Fe, stateExpanded as Ie } from "./controllers/state-expanded.controller.js";
19
- import { StateHighlightedController as Le, stateHighlighted as Re } from "./controllers/state-highlighted.controller.js";
20
- import { StateScrollController as ze, stateScroll as Be } from "./controllers/state-scroll.controller.js";
21
- import { StateSelectedController as Ve, stateSelected as He } from "./controllers/state-selected.controller.js";
22
- import { StatePressedController as Ue, statePressed as We } from "./controllers/state-pressed.controller.js";
23
- import { TypeAnchorController as Ge, typeAnchor as Ke } from "./controllers/type-anchor.controller.js";
24
- import { TypeClosableController as qe } from "./controllers/type-closable.controller.js";
25
- import { TypeCommandController as Je, typeCommand as Ye } from "./controllers/type-command.controller.js";
26
- import { TypeInterestController as Xe, typeInterest as Ze } from "./controllers/type-interest.controller.js";
27
- import { TypeExpandableController as Qe } from "./controllers/type-expandable.controller.js";
28
- import { TypeSelectableController as $e } from "./controllers/type-selectable.controller.js";
29
- import { TypeButtonController as et, typeButton as tt } from "./controllers/type-button.controller.js";
30
- import { TypeNativePopoverTriggerController as nt, typeNativePopoverTrigger as rt } from "./controllers/type-native-popover-trigger.controller.js";
31
- import { TypeNativePopoverController as it } from "./controllers/type-native-popover.controller.js";
32
- import { TypeSSRController as at, typeSSR as ot } from "./controllers/type-ssr.controller.js";
33
- import { createLightDismiss as st, onKeys as ct } from "./utils/keynav.js";
34
- import { TypeSubmitController as lt, typeSubmit as ut } from "./controllers/type-submit.controller.js";
35
- import { NveTouchEvent as dt, TypeTouchController as ft, typeTouch as pt } from "./controllers/type-touch.controller.js";
36
- import { hostAttr as mt } from "./decorators/host-attr.js";
37
- import { scopedRegistry as ht } from "./decorators/scoped-registry.js";
38
- import { colorStateStyles as gt, statusStateStyles as _t, supportStateStyles as vt, useStyles as yt } from "./styles/index.js";
39
- import { supportsCSSLegacyInsetArea as bt, supportsCSSPositionArea as xt, supportsNativeCSSAnchorPosition as St } from "./utils/supports.js";
40
- import { popoverStyles as Ct } from "./styles/popover2.js";
41
- import { TransitionService as wt } from "./services/transition.service.js";
42
- import { statusIcons as Tt } from "./types/index.js";
43
- export { p as AuditController, e as DOCS_URL, l as GlobalState, u as GlobalStateService, v as I18nController, g as I18nService, _ as I18nService_, _e as KeyNavigationGridController, be as KeyNavigationListController, N as KeynavCode, w as LogService, dt as NveTouchEvent, ke as StateActiveController, je as StateCurrentController, Ne as StateDisabledController, Fe as StateExpandedController, Le as StateHighlightedController, Ue as StatePressedController, ze as StateScrollController, Ve as StateSelectedController, wt as TransitionService, Ge as TypeAnchorController, et as TypeButtonController, qe as TypeClosableController, Je as TypeCommandController, Qe as TypeExpandableController, Xe as TypeInterestController, it as TypeNativePopoverController, nt as TypeNativePopoverTriggerController, at as TypeSSRController, $e as TypeSelectableController, lt as TypeSubmitController, ft as TypeTouchController, P as appendAnchorName, F as appendRootNodeStyle, I as applySlotContentStates, Ce as associateAriaDescribedBy, we as associateAriaLabel, Te as associateControlGroup, Ee as associateDataList, De as associateLabel, Oe as attachInternals, m as audit, d as auditParentElement, f as auditSlots, L as clickOutsideElementBounds, gt as colorStateStyles, R as createGhostElement, st as createLightDismiss, b as debounce, r as deepMerge, z as define, B as defineElement, V as endOfScrollBox, h as excessiveInstanceLimit, T as focusElement, E as focusElementTimeout, t as formatFileSize, i as formatStandardNumber, H as generateId, D as getActiveElement, U as getAnchorNames, W as getAttributeChanges, G as getAttributeListChanges, K as getChildren, a as getDifference, q as getDisplayValue, J as getElementUpdate, Y as getFlattenedDOMTree, X as getFlattenedFocusableItems, ve as getNextKeyGridItem, xe as getNextKeyListItem, Z as getPropertyChanges, Q as getThemeTokens, $ as hasHorizontalScrollBar, ee as hasInvalidDOMGrid, te as hasScrollBar, mt as hostAttr, y as i18n, O as initializeKeyListItems, ne as isContextMenuClick, k as isFocusable, o as isObject, s as isObjectLiteral, A as isSimpleFocusable, ye as keyNavigationGrid, Se as keyNavigationList, re as matchesElementName, x as onChildListMutation, ct as onKeys, j as onListboxActivate, ie as openEyeDropper, ae as parseTokenNumber, c as parseVersion, Ct as popoverStyles, oe as removeAnchorName, se as removeEmptySlotWhitespace, ce as removeEmptyTextNode, le as sameOrderedStringArray, ue as sameRenderRoot, ht as scopedRegistry, de as scrollBarWidth, M as setActiveKeyListItem, n as shiftLeft, fe as slotContainsOnlyWhitespace, Ae as stateActive, Me as stateCurrent, Pe as stateDisabled, Ie as stateExpanded, Re as stateHighlighted, We as statePressed, Be as stateScroll, He as stateSelected, Tt as statusIcons, _t as statusStateStyles, S as stopEvent, pe as styleSheetToString, vt as supportStateStyles, bt as supportsCSSLegacyInsetArea, xt as supportsCSSPositionArea, St as supportsNativeCSSAnchorPosition, me as supportsScopedRegistry, C as throttle, Ke as typeAnchor, tt as typeButton, Ye as typeCommand, Ze as typeInterest, rt as typeNativePopoverTrigger, ot as typeSSR, ut as typeSubmit, pt as typeTouch, he as uniqueNonEmptyStrings, yt as useStyles, ge as validKeyNavigationCode };
15
+ import { StateExpandedController as ke, stateExpanded as Ae } from "./controllers/state-expanded.controller.js";
16
+ import { StateHighlightedController as je, stateHighlighted as Me } from "./controllers/state-highlighted.controller.js";
17
+ import { StateScrollController as Ne, stateScroll as Pe } from "./controllers/state-scroll.controller.js";
18
+ import { StateSelectedController as Fe, stateSelected as Ie } from "./controllers/state-selected.controller.js";
19
+ import { TypeAnchorController as Le, typeAnchor as Re } from "./controllers/type-anchor.controller.js";
20
+ import { TypeClosableController as ze } from "./controllers/type-closable.controller.js";
21
+ import { TypeExpandableController as Be } from "./controllers/type-expandable.controller.js";
22
+ import { TypeSelectableController as Ve } from "./controllers/type-selectable.controller.js";
23
+ import { TypeNativePopoverController as He } from "./controllers/type-native-popover.controller.js";
24
+ import { TypeSSRController as Ue, typeSSR as We } from "./controllers/type-ssr.controller.js";
25
+ import { NveTouchEvent as Ge, TypeTouchController as Ke, typeTouch as qe } from "./controllers/type-touch.controller.js";
26
+ import { hostAttr as Je } from "./decorators/host-attr.js";
27
+ import { scopedRegistry as Ye } from "./decorators/scoped-registry.js";
28
+ import { colorStateStyles as Xe, statusStateStyles as Ze, supportStateStyles as Qe, useStyles as $e } from "./styles/index.js";
29
+ import { supportsCSSLegacyInsetArea as et, supportsCSSPositionArea as tt, supportsNativeCSSAnchorPosition as nt } from "./utils/supports.js";
30
+ import { popoverStyles as rt } from "./styles/popover2.js";
31
+ import { TransitionService as it } from "./services/transition.service.js";
32
+ import { statusIcons as at } from "./types/index.js";
33
+ import { createLightDismiss as ot, onKeys as st } from "./utils/keynav.js";
34
+ export { p as AuditController, e as DOCS_URL, l as GlobalState, u as GlobalStateService, v as I18nController, g as I18nService, _ as I18nService_, _e as KeyNavigationGridController, be as KeyNavigationListController, N as KeynavCode, w as LogService, Ge as NveTouchEvent, ke as StateExpandedController, je as StateHighlightedController, Ne as StateScrollController, Fe as StateSelectedController, it as TransitionService, Le as TypeAnchorController, ze as TypeClosableController, Be as TypeExpandableController, He as TypeNativePopoverController, Ue as TypeSSRController, Ve as TypeSelectableController, Ke as TypeTouchController, P as appendAnchorName, F as appendRootNodeStyle, I as applySlotContentStates, Ce as associateAriaDescribedBy, we as associateAriaLabel, Te as associateControlGroup, Ee as associateDataList, De as associateLabel, Oe as attachInternals, m as audit, d as auditParentElement, f as auditSlots, L as clickOutsideElementBounds, Xe as colorStateStyles, R as createGhostElement, ot as createLightDismiss, b as debounce, r as deepMerge, z as define, B as defineElement, V as endOfScrollBox, h as excessiveInstanceLimit, T as focusElement, E as focusElementTimeout, t as formatFileSize, i as formatStandardNumber, H as generateId, D as getActiveElement, U as getAnchorNames, W as getAttributeChanges, G as getAttributeListChanges, K as getChildren, a as getDifference, q as getDisplayValue, J as getElementUpdate, Y as getFlattenedDOMTree, X as getFlattenedFocusableItems, ve as getNextKeyGridItem, xe as getNextKeyListItem, Z as getPropertyChanges, Q as getThemeTokens, $ as hasHorizontalScrollBar, ee as hasInvalidDOMGrid, te as hasScrollBar, Je as hostAttr, y as i18n, O as initializeKeyListItems, ne as isContextMenuClick, k as isFocusable, o as isObject, s as isObjectLiteral, A as isSimpleFocusable, ye as keyNavigationGrid, Se as keyNavigationList, re as matchesElementName, x as onChildListMutation, st as onKeys, j as onListboxActivate, ie as openEyeDropper, ae as parseTokenNumber, c as parseVersion, rt as popoverStyles, oe as removeAnchorName, se as removeEmptySlotWhitespace, ce as removeEmptyTextNode, le as sameOrderedStringArray, ue as sameRenderRoot, Ye as scopedRegistry, de as scrollBarWidth, M as setActiveKeyListItem, n as shiftLeft, fe as slotContainsOnlyWhitespace, Ae as stateExpanded, Me as stateHighlighted, Pe as stateScroll, Ie as stateSelected, at as statusIcons, Ze as statusStateStyles, S as stopEvent, pe as styleSheetToString, Qe as supportStateStyles, et as supportsCSSLegacyInsetArea, tt as supportsCSSPositionArea, nt as supportsNativeCSSAnchorPosition, me as supportsScopedRegistry, C as throttle, Re as typeAnchor, We as typeSSR, qe as typeTouch, he as uniqueNonEmptyStrings, $e as useStyles, ge as validKeyNavigationCode };
@@ -19,7 +19,7 @@ var a = class {
19
19
  i18nRegistry: {},
20
20
  audit: {}
21
21
  }
22
- }, globalThis.NVE_ELEMENTS.state.versions = Array.from(new Set([...globalThis.NVE_ELEMENTS.state.versions, "2.0.1"])), globalThis.NVE_ELEMENTS.state.scopedRegistry ??= {}, globalThis.NVE_ELEMENTS.state.scopedRegistry["2.0.1"] = i(), globalThis.NVE_ELEMENTS.state.versions.length > 1 && globalThis.NVE_ELEMENTS.state.env !== "production" && console.warn(e(), `\n\n${JSON.stringify(globalThis.NVE_ELEMENTS.state.versions, null, 2)}`);
22
+ }, globalThis.NVE_ELEMENTS.state.versions = Array.from(new Set([...globalThis.NVE_ELEMENTS.state.versions, "2.0.3"])), globalThis.NVE_ELEMENTS.state.scopedRegistry ??= {}, globalThis.NVE_ELEMENTS.state.scopedRegistry["2.0.3"] = i(), globalThis.NVE_ELEMENTS.state.versions.length > 1 && globalThis.NVE_ELEMENTS.state.env !== "production" && console.warn(e(), `\n\n${JSON.stringify(globalThis.NVE_ELEMENTS.state.versions, null, 2)}`);
23
23
  }
24
24
  get state() {
25
25
  return globalThis.NVE_ELEMENTS.state;
@@ -11,7 +11,7 @@ var t = "@nve: ", n = class {
11
11
  e.state.env !== "production" && (console.error(`${t}${n}`, ...r), this.#e("error", n, ...r));
12
12
  }
13
13
  static #e(e, t, ...n) {
14
- globalThis.document.dispatchEvent(new CustomEvent("NVE_ELEMENTS_LOG", { detail: {
14
+ globalThis.document?.dispatchEvent(new CustomEvent("NVE_ELEMENTS_LOG", { detail: {
15
15
  type: e,
16
16
  value: t,
17
17
  args: n
@@ -1 +1 @@
1
- {"version":3,"file":"log.service.js","names":["#dispatch"],"sources":["../../../src/internal/services/log.service.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { GlobalStateService } from './global.service.js';\n\nconst prefix = '@nve: ';\n\nexport class LogService {\n static log(value: string, ...args: unknown[]) {\n if (GlobalStateService.state.env !== 'production') {\n console.log(`${prefix}${value}`, ...args);\n }\n }\n\n static warn(value: string, ...args: unknown[]) {\n if (GlobalStateService.state.env !== 'production') {\n console.warn(`${prefix}${value}`, ...args);\n this.#dispatch('warn', value, ...args);\n }\n }\n\n static error(value: string, ...args: unknown[]) {\n if (GlobalStateService.state.env !== 'production') {\n console.error(`${prefix}${value}`, ...args);\n this.#dispatch('error', value, ...args);\n }\n }\n\n static #dispatch(type: 'warn' | 'error', value: string, ...args: unknown[]) {\n globalThis.document.dispatchEvent(new CustomEvent('NVE_ELEMENTS_LOG', { detail: { type, value, args } }));\n }\n}\n"],"mappings":";;AAKA,IAAM,IAAS,UAEF,IAAb,MAAwB;CACtB,OAAO,IAAI,GAAe,GAAG,GAAiB;EAC5C,AAAI,EAAmB,MAAM,QAAQ,gBACnC,QAAQ,IAAI,GAAG,IAAS,KAAS,GAAG,CAAI;CAE5C;CAEA,OAAO,KAAK,GAAe,GAAG,GAAiB;EAC7C,AAAI,EAAmB,MAAM,QAAQ,iBACnC,QAAQ,KAAK,GAAG,IAAS,KAAS,GAAG,CAAI,GACzC,KAAKA,GAAU,QAAQ,GAAO,GAAG,CAAI;CAEzC;CAEA,OAAO,MAAM,GAAe,GAAG,GAAiB;EAC9C,AAAI,EAAmB,MAAM,QAAQ,iBACnC,QAAQ,MAAM,GAAG,IAAS,KAAS,GAAG,CAAI,GAC1C,KAAKA,GAAU,SAAS,GAAO,GAAG,CAAI;CAE1C;CAEA,OAAOA,GAAU,GAAwB,GAAe,GAAG,GAAiB;EAC1E,WAAW,SAAS,cAAc,IAAI,YAAY,oBAAoB,EAAE,QAAQ;GAAE;GAAM;GAAO;EAAK,EAAE,CAAC,CAAC;CAC1G;AACF"}
1
+ {"version":3,"file":"log.service.js","names":["#dispatch"],"sources":["../../../src/internal/services/log.service.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { GlobalStateService } from './global.service.js';\n\nconst prefix = '@nve: ';\n\nexport class LogService {\n static log(value: string, ...args: unknown[]) {\n if (GlobalStateService.state.env !== 'production') {\n console.log(`${prefix}${value}`, ...args);\n }\n }\n\n static warn(value: string, ...args: unknown[]) {\n if (GlobalStateService.state.env !== 'production') {\n console.warn(`${prefix}${value}`, ...args);\n this.#dispatch('warn', value, ...args);\n }\n }\n\n static error(value: string, ...args: unknown[]) {\n if (GlobalStateService.state.env !== 'production') {\n console.error(`${prefix}${value}`, ...args);\n this.#dispatch('error', value, ...args);\n }\n }\n\n static #dispatch(type: 'warn' | 'error', value: string, ...args: unknown[]) {\n globalThis.document?.dispatchEvent(new CustomEvent('NVE_ELEMENTS_LOG', { detail: { type, value, args } }));\n }\n}\n"],"mappings":";;AAKA,IAAM,IAAS,UAEF,IAAb,MAAwB;CACtB,OAAO,IAAI,GAAe,GAAG,GAAiB;EAC5C,AAAI,EAAmB,MAAM,QAAQ,gBACnC,QAAQ,IAAI,GAAG,IAAS,KAAS,GAAG,CAAI;CAE5C;CAEA,OAAO,KAAK,GAAe,GAAG,GAAiB;EAC7C,AAAI,EAAmB,MAAM,QAAQ,iBACnC,QAAQ,KAAK,GAAG,IAAS,KAAS,GAAG,CAAI,GACzC,KAAKA,GAAU,QAAQ,GAAO,GAAG,CAAI;CAEzC;CAEA,OAAO,MAAM,GAAe,GAAG,GAAiB;EAC9C,AAAI,EAAmB,MAAM,QAAQ,iBACnC,QAAQ,MAAM,GAAG,IAAS,KAAS,GAAG,CAAI,GAC1C,KAAKA,GAAU,SAAS,GAAO,GAAG,CAAI;CAE1C;CAEA,OAAOA,GAAU,GAAwB,GAAe,GAAG,GAAiB;EAC1E,WAAW,UAAU,cAAc,IAAI,YAAY,oBAAoB,EAAE,QAAQ;GAAE;GAAM;GAAO;EAAK,EAAE,CAAC,CAAC;CAC3G;AACF"}
@@ -66,6 +66,9 @@ export type TaskStatus = 'scheduled' | 'queued' | 'pending' | 'starting' | 'runn
66
66
  * - `hint` no light dismiss, no auto focus, open/close on hover/focus
67
67
  */
68
68
  export type PopoverType = 'auto' | 'manual' | 'hint' | 'inline';
69
+ export type InterestEvent = Event & {
70
+ source: HTMLElement;
71
+ };
69
72
  /** Controls how the popover aligns along the edge of its anchor element.
70
73
  * - `start` - Aligns the popover to the beginning edge of the anchor for left or top alignment.
71
74
  * - `end` - Aligns the popover to the ending edge of the anchor for right or bottom alignment.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/internal/types/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { TemplateResult } from 'lit';\nimport type { IconName } from '@nvidia-elements/core/icon';\nimport type { I18nStrings } from '../services/i18n.service.js';\n\nexport type Color =\n | 'red-cardinal'\n | 'gray-slate'\n | 'gray-denim'\n | 'blue-indigo'\n | 'blue-cobalt'\n | 'blue-sky'\n | 'teal-cyan'\n | 'green-mint'\n | 'teal-seafoam'\n | 'green-grass'\n | 'yellow-amber'\n | 'orange-pumpkin'\n | 'red-tomato'\n | 'pink-magenta'\n | 'purple-plum'\n | 'purple-violet'\n | 'purple-lavender'\n | 'pink-rose'\n | 'green-jade'\n | 'lime-pear'\n | 'yellow-nova'\n | 'brand-green';\n\n/** Controls the visual scale of an element to match its importance and available space.\n * - `sm` - Compact size for dense layouts or secondary elements with less visual prominence.\n * - `md` - Standard size that works well in most contexts and provides balanced visibility.\n * - `lg` - Larger size for emphasizing important elements or improving touch targets in spacious layouts.\n */\nexport type Size = 'sm' | 'md' | 'lg';\n\n/** Controls the visual scale of an element to match its importance and available space.\n * - `xs` - Extra small size for minimal elements or highly dense layouts.\n * - `sm` - Compact size for dense layouts or secondary elements with less visual prominence.\n * - `md` - Standard size that works well in most contexts and provides balanced visibility.\n * - `lg` - Larger size for emphasizing important elements or improving touch targets in spacious layouts.\n * - `xl` - Extra large size for emphasizing elements or sparse layouts.\n */\nexport type SizeExpanded = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n/** Controls the visual prominence to establish hierarchy and guide user attention.\n * - `emphasis` - Increases visual weight to draw attention and highlight important elements.\n * - `muted` - Reduces visual weight for supporting content that should remain subtle and unobtrusive.\n */\nexport type Prominence = 'emphasis' | 'muted';\n\n/**\n * Determines the container bounds of the element\n * - `flat` Element has white space bounds but reduced visual container.\n * - `inline` Element container reduces to fit within inline content such as a block of text.\n * - `inset` Element container optimizes for embedding or inset placement inside another containing element.\n * - `full` Element container optimizes for filling its container bounds.\n * - `condensed` Element container optimizes for small, summarized or contained spaces.\n */\nexport type Container = 'inline' | 'flat' | 'inset' | 'full' | 'condensed';\n\n/** Communicates the intent and semantic meaning of an element to help users understand the outcome of their actions.\n * - `accent` - Highlights important actions or draws attention to primary interactive elements.\n * - `warning` - Indicates cautionary actions that require careful consideration before proceeding.\n * - `success` - Represents positive outcomes, confirmations, or constructive actions.\n * - `danger` - Signals destructive or irreversible actions that need extra attention and confirmation.\n */\nexport type SupportStatus = 'accent' | 'warning' | 'success' | 'danger';\n\n/** Controls how the chart connects intermediate values between points in a data series.\n * - `linear` - Connects points with straight line segments.\n * - `smooth` - Connects points with smooth bezier curves.\n * - `step` - Connects points with horizontal and vertical step segments.\n */\nexport type Interpolation = 'linear' | 'smooth' | 'step';\n\n/** Determines the orientation of an element. */\nexport type Orientation = 'vertical' | 'horizontal';\n\n/** Communicates the current state of a task or process to keep users informed of progress and outcomes.\n * - `scheduled` - Task has a scheduled future execution at a specific time.\n * - `queued` - Task is waiting in line to begin after other tasks complete.\n * - `pending` - Task is awaiting approval, user input, or external conditions before proceeding.\n * - `starting` - Task is initializing and preparing to begin active execution.\n * - `running` - Task is actively executing and making progress.\n * - `restarting` - Task restarts after an interruption or reset.\n * - `stopping` - Task is gracefully shutting down and completing cleanup operations.\n * - `finished` - Task has completed successfully with the expected outcome.\n * - `failed` - Task encountered an error and did not complete as intended.\n * - `unknown` - Task status remains unknown or unavailable.\n * - `ignored` - Task was intentionally skipped or excluded from execution.\n */\nexport type TaskStatus =\n | 'scheduled'\n | 'queued'\n | 'pending'\n | 'starting'\n | 'running'\n | 'restarting'\n | 'stopping'\n | 'finished'\n | 'failed'\n | 'unknown'\n | 'ignored';\n\n/**\n * https://open-ui.org/components/popup.research.explainer#api-shape\n * - `auto` light dismiss, focus on open, return to trigger\n * - `manual` no light dismiss, no auto focus\n * - `hint` no light dismiss, no auto focus, open/close on hover/focus\n */\nexport type PopoverType = 'auto' | 'manual' | 'hint' | 'inline';\n\n/** Controls how the popover aligns along the edge of its anchor element.\n * - `start` - Aligns the popover to the beginning edge of the anchor for left or top alignment.\n * - `end` - Aligns the popover to the ending edge of the anchor for right or bottom alignment.\n * - `center` - Centers the popover along the anchor's edge for balanced positioning.\n */\nexport type PopoverAlign = 'start' | 'end' | 'center';\n\n/** Determines the popover position relative to its assigned anchor and alignment.\n * - `top` - Positions the popover above the anchor element.\n * - `bottom` - Positions the popover below the anchor element.\n * - `left` - Positions the popover to the left side of the anchor element.\n * - `right` - Positions the popover to the right side of the anchor element.\n */\nexport type PopoverSides = 'top' | 'bottom' | 'left' | 'right';\n\n/** Controls the placement of the popover relative to its anchor element.\n * - `center` - Centers the popover directly over the anchor element.\n * - `top` - Positions the popover above the anchor element.\n * - `bottom` - Positions the popover below the anchor element.\n * - `left` - Positions the popover to the left side of the anchor element.\n * - `right` - Positions the popover to the right side of the anchor element.\n */\nexport type PopoverPosition = 'center' | 'top' | 'bottom' | 'left' | 'right';\n\n/** Determines the position of an element relative to its anchor */\nexport type Placement = PopoverPosition | `${PopoverSides}-${PopoverAlign}`;\n\n/** Controls the directional arrangement and spacing behavior of the element's content.\n * - `vertical` - Arranges content in a vertical stack with block-level spacing.\n * - `vertical-inline` - Arranges content vertically with compact inline spacing for dense layouts.\n * - `horizontal` - Arranges content in a horizontal row with block-level spacing.\n * - `horizontal-inline` - Arranges content horizontally with compact inline spacing.\n */\nexport type ControlLayout = 'vertical' | 'vertical-inline' | 'horizontal' | 'horizontal-inline';\n\n/** Indicates the element that represents the user's current location or position within a set. [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current)\n * - `page` - Marks the current page within a set of navigation links.\n * - `step` - Marks the current step within a multi-step process or workflow.\n */\nexport type Current = 'page' | 'step';\n\n/** Controls how data points are visually encoded in a sparkline chart.\n * - `line` - Renders data as a connected line to emphasize macro trend.\n * - `area` - Renders data as a filled area beneath a line to emphasize magnitude over time.\n * - `gradient` - Renders a line with gradient color treatment to communicate value intensity across the series.\n * - `column` - Renders data as vertical columns for easy comparison of discrete values.\n * - `winloss` - Renders outcomes as binary or ternary bars to highlight wins, losses, and optional ties.\n */\nexport type SparklineMark = 'line' | 'area' | 'gradient' | 'column' | 'winloss';\n\nexport interface NveElement {\n /**\n * This Boolean attribute prevents the user from interacting with the element: it cannot receive press or focus events. [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-disabled)\n * - `true` - The element has a disabled state and does not accept interaction.\n * - `false` - The element has an enabled state and accepts interaction.\n */\n disabled?: boolean;\n\n /** Indicates whether the element is currently actively engaged through user interaction. [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/:active)\n * - `true` - The user is pressing or activating the element (mousedown, keydown, or touch).\n * - `false` - No active user engagement on the element.\n */\n active?: boolean;\n\n /** Indicates whether collapsible content is currently visible or hidden from the user. [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-expanded)\n * - `true` - The associated content expands and becomes visible to the user.\n * - `false` - The associated content collapses and hides from the user.\n */\n expanded?: boolean;\n\n /** Indicates the current state of a toggle button that switches on or off. [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-pressed)\n * - `true` - The button is in the pressed (on) state and the associated action or setting is active.\n * - `false` - The button is in the unpressed (off) state and the associated action or setting is inactive.\n */\n pressed?: boolean;\n\n /** Indicates whether an element currently holds selection within a multi-option selection group. [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected)\n * - `true` - The element holds selection and represents the user's current choice within the group.\n * - `false` - The element does not hold selection and the user can choose it.\n */\n selected?: boolean;\n\n /** Indicates whether the user can change the element's value while it remains visible and focusable. [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly)\n * - `true` - The element has a readonly state: the user cannot change its value, but can still focus and copy it.\n * - `false` - The element allows editing and the user can change its value through interaction.\n */\n readOnly?: boolean;\n\n /** Defines the value associated with the element's name when submitting the form data. The server receives this value in params when the form submits through this button. [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value) */\n value?: string;\n\n /** The name of the element, submitted as a pair with the element value as part of the form data. [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-name) */\n name?: string;\n\n /** Indicates whether the user can dismiss or close the element.\n * - `true` - The element displays a close control and the user can dismiss it.\n * - `false` - The user cannot close the element and must dismiss it programmatically.\n */\n closable?: boolean;\n\n /** Enables updating internal string values for internationalization. */\n i18n?: Partial<I18nStrings & { __set: boolean }>;\n\n /** Indicates the element that represents the user's current location or position within a set. [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current)\n * - `page` - Marks the current page within a set of navigation links.\n * - `step` - Marks the current step within a multi-step process or workflow.\n */\n current?: 'page' | 'step';\n\n /** Controls the horizontal alignment of the element within its container, respecting the text direction. [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_grid_layout/Box_alignment_in_grid_layout#the_two_axes_of_a_grid_layout)\n * - `start` - Aligns the element to the beginning of the inline axis (left in LTR, right in RTL).\n * - `center` - Centers the element along the inline axis for balanced visual positioning.\n * - `end` - Aligns the element to the end of the inline axis (right in LTR, left in RTL).\n */\n inlinePosition?: 'start' | 'center' | 'end';\n\n /** Controls the vertical alignment of the element within its container. [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_grid_layout/Box_alignment_in_grid_layout#the_two_axes_of_a_grid_layout)\n * - `start` - Aligns the element to the top of the block axis for top-aligned positioning.\n * - `center` - Centers the element along the block axis for balanced vertical positioning.\n * - `end` - Aligns the element to the bottom of the block axis for bottom-aligned positioning.\n */\n blockPosition?: 'start' | 'center' | 'end';\n\n /** Controls the directional arrangement and spacing behavior of the element's content.\n * - `vertical` - Arranges content in a vertical stack with block-level spacing.\n * - `vertical-inline` - Arranges content vertically with compact inline spacing for dense layouts.\n * - `horizontal` - Arranges content in a horizontal row with block-level spacing.\n * - `horizontal-inline` - Arranges content horizontally with compact inline spacing.\n */\n layout?: 'vertical' | 'vertical-inline' | 'horizontal' | 'horizontal-inline';\n\n /** Controls the directional flow of the element's layout and interaction pattern.\n * - `vertical` - Element orients vertically with top-to-bottom flow.\n * - `horizontal` - Element orients horizontally with left-to-right flow.\n */\n orientation?: 'vertical' | 'horizontal';\n\n /** Controls the visual prominence to establish hierarchy and guide user attention.\n * - `emphasis` - Increases visual weight to draw attention and highlight important elements.\n * - `muted` - Reduces visual weight for supporting content that should remain subtle and unobtrusive.\n */\n prominence?: 'emphasis' | 'muted';\n\n /** The Interaction type provides a way to show the intent of an interactive element. This can help users quickly understand what each interaction does and reduce the potential for confusion or errors.\n * - `emphasis` Shows the interaction targets emphasis or highlighting primary actions.\n * - `destructive` Shows the interaction targets destructive actions such as deleting or removing.\n */\n interaction?: 'emphasis' | 'destructive';\n\n /** Defines a base color from the theme color palette */\n color?:\n | 'red-cardinal'\n | 'gray-slate'\n | 'gray-denim'\n | 'blue-indigo'\n | 'blue-cobalt'\n | 'blue-sky'\n | 'teal-cyan'\n | 'green-mint'\n | 'teal-seafoam'\n | 'green-grass'\n | 'yellow-amber'\n | 'orange-pumpkin'\n | 'red-tomato'\n | 'pink-magenta'\n | 'purple-plum'\n | 'purple-violet'\n | 'purple-lavender'\n | 'pink-rose'\n | 'green-jade'\n | 'lime-pear'\n | 'yellow-nova'\n | 'brand-green';\n\n /** Communicates the intent and semantic meaning of an element to help users understand the outcome of their actions.\n * - `accent` - Highlights important actions or draws attention to primary interactive elements.\n * - `warning` - Indicates cautionary actions that require careful consideration before proceeding.\n * - `success` - Represents positive outcomes, confirmations, or constructive actions.\n * - `danger` - Signals destructive or irreversible actions that need extra attention and confirmation.\n */\n status?: 'accent' | 'warning' | 'success' | 'danger';\n\n /** Controls the visual scale of an element to match its importance and available space.\n * - `sm` - Compact size for dense layouts or secondary elements with less visual prominence.\n * - `md` - Standard size that works well in most contexts and provides balanced visibility.\n * - `lg` - Larger size for emphasizing important elements or improving touch targets in spacious layouts.\n */\n size?: 'sm' | 'md' | 'lg';\n\n /**\n * Demonstrates different container styles to accommodate visual weight and context.\n * - `flat` Element has white space bounds but reduced visual container.\n * - `inline` Element container reduces to fit within inline content such as a block of text.\n * - `inset` Element container optimizes for embedding or inset placement inside another containing element.\n * - `full` Element container optimizes for filling its container bounds.\n */\n container?: 'inline' | 'flat' | 'inset' | 'full';\n\n /** Determines the position of an element along both inline and block axis. [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_grid_layout/Box_alignment_in_grid_layout#the_two_axes_of_a_grid_layout) */\n position?:\n | 'top-start'\n | 'top-end'\n | 'top-center'\n | 'bottom-start'\n | 'bottom-end'\n | 'bottom-center'\n | 'left-start'\n | 'left-end'\n | 'left-center'\n | 'right-start'\n | 'right-end'\n | 'right-center';\n\n /** Determines the alignment of the popover relative to the provided anchor element. */\n alignment?: 'start' | 'end' | 'center';\n\n /** Provides the element that the popover should position relative to. Anchor can accept a idref string within the same render root or a HTMLElement DOM reference. */\n anchor?: string | HTMLElement;\n\n /** Defines what element triggers an `open` interaction event. A trigger can accept a idref string within the same render root or a HTMLElement DOM reference. */\n trigger?: string | HTMLElement;\n\n /** Defines named content areas where users can insert custom markup into the element.\n * - `default` - The primary content area for the element.\n * - `prefix` - Content that appears before the main element content.\n * - `suffix` - Content that appears after the main element content.\n * - `header` - Content that appears at the top of the element, used for titles or introductory information.\n * - `footer` - Content that appears at the bottom of the element, used for supplementary information or actions.\n * - `actions` - Content area specifically for interactive controls like buttons or links.\n * - `icon` - Content area for displaying an icon that represents the element's purpose or state.\n */\n slots?: 'default' | 'prefix' | 'suffix' | 'header' | 'footer' | 'actions' | 'icon';\n\n /**\n * Sets the automatic dismissal time in milliseconds before the element emits a `close` event. Allow ~200-250ms per word for comfortable reading.\n * - `0` - Warning or error messages requiring immediate acknowledgment.\n * - `3000` - Brief success or confirmation messages.\n * - `7000` - Standard informational messages.\n * - `10000` - Messages with actions or requiring user decision.\n */\n closeTimeout?: number;\n\n /**\n * Sets the delay in milliseconds before the element emits a `open` event.\n * - `0` - Keyboard focus interactions (always immediate for accessibility).\n * - `500` - Dense interfaces with many tooltips to reduce visual noise and prevent accidental triggers.\n */\n openDelay?: number;\n\n /** @private An instance of `ElementInternals` that decorators/controllers set dynamically */\n _internals: ElementInternals;\n\n render: TemplateResult;\n}\n\n/** Defines named content areas where users can insert custom markup into the element.\n * - `default` - The primary content area for the element.\n * - `prefix` - Content that appears before the main element content.\n * - `suffix` - Content that appears after the main element content.\n * - `header` - Content that appears at the top of the element, used for titles or introductory information.\n * - `footer` - Content that appears at the bottom of the element, used for supplementary information or actions.\n * - `actions` - Content area specifically for interactive controls like buttons or links.\n * - `icon` - Content area for displaying an icon that represents the element's purpose or state.\n */\nexport type SlotName = 'default' | 'prefix' | 'suffix' | 'header' | 'footer' | 'actions' | 'icon';\n\n/** The Interaction type provides a way to show the intent of an interactive element. This can help users quickly understand what each interaction does and reduce the potential for confusion or errors.\n * - `emphasis` Shows the interaction targets emphasis or highlighting primary actions.\n * - `destructive` Shows the interaction targets destructive actions such as deleting or removing.\n */\nexport type Interaction = 'emphasis' | 'destructive';\n\nexport interface ContainerElement {\n container?: Partial<Container>;\n}\n\n/** An element that renders complex data structures (e.g., arrays, series, matrices) rather than composable UI content and values expressible with primitive attributes. */\nexport interface DataElement<T extends unknown[] | Record<string, unknown>> {\n data?: T;\n}\n\nexport const statusIcons: { [key: string]: IconName } = {\n '': 'information-circle-stroke',\n undefined: 'information-circle-stroke',\n default: 'information-circle-stroke',\n accent: 'information-circle-stroke',\n warning: 'exclamation-triangle',\n success: 'checkmark-circle',\n danger: 'exclamation-circle',\n scheduled: 'clock',\n failed: 'x-circle',\n finished: 'checkmark-circle',\n unknown: 'question-mark-circle',\n queued: 'bar-pill-stack',\n running: 'running',\n restarting: 'refresh',\n stopping: 'stop-sign',\n pending: 'circle-dash',\n starting: 'circle-dot',\n ignored: 'circle-angled-line'\n} as const;\n\ndeclare global {\n var NVE_ELEMENTS: {\n state: {\n bundle: boolean;\n env: 'watch' | 'production' | 'development';\n pageHost: string;\n moduleHost: string;\n versions: string[];\n scopedRegistry: { [key: string]: CustomElementRegistry };\n elementRegistry: Readonly<{ [key: string]: string }>;\n i18nRegistry: Readonly<{ [key: string]: string }>;\n audit: Readonly<{\n [key: string]: {\n count?: number;\n excessiveInstanceLimitAudited?: boolean;\n };\n }>;\n };\n debug: (log?: (...args: unknown[]) => void) => void;\n };\n\n interface HTMLElement {\n 'nve-text': string;\n 'nve-layout': string;\n }\n\n interface CustomElementRegistry {\n initialize(root: ShadowRoot | Document): void;\n }\n\n var CustomElementRegistry: {\n new (): CustomElementRegistry;\n prototype: CustomElementRegistry;\n };\n}\n\nexport interface ElementDefinition extends CustomElementConstructor {\n metadata: { version: string; tag: string };\n elementDefinitions?: { [key: string]: ElementDefinition };\n shadowRootOptions?: { customElementRegistry?: CustomElementRegistry | null };\n}\n\nexport interface Point {\n x: number;\n y: number;\n}\n\nexport interface OffsetPoint {\n offsetX: number;\n offsetY: number;\n}\n\nexport interface Dimensions {\n width: number;\n height: number;\n}\n\nexport type Rect = Point & Dimensions;\n\nexport interface Scale {\n min: number;\n max: number;\n}\n\n/** https://github.com/tc39/proposal-decorators */\n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\nexport type LegacyDecoratorTarget = Function & {\n addInitializer?: (initializer: (instance: any) => void) => void; // eslint-disable-line @typescript-eslint/no-explicit-any\n};\n"],"mappings":";AA4YA,IAAa,IAA2C;CACtD,IAAI;CACJ,WAAW;CACX,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACT,QAAQ;CACR,WAAW;CACX,QAAQ;CACR,UAAU;CACV,SAAS;CACT,QAAQ;CACR,SAAS;CACT,YAAY;CACZ,UAAU;CACV,SAAS;CACT,UAAU;CACV,SAAS;AACX"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/internal/types/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { TemplateResult } from 'lit';\nimport type { IconName } from '@nvidia-elements/core/icon';\nimport type { I18nStrings } from '../services/i18n.service.js';\n\nexport type Color =\n | 'red-cardinal'\n | 'gray-slate'\n | 'gray-denim'\n | 'blue-indigo'\n | 'blue-cobalt'\n | 'blue-sky'\n | 'teal-cyan'\n | 'green-mint'\n | 'teal-seafoam'\n | 'green-grass'\n | 'yellow-amber'\n | 'orange-pumpkin'\n | 'red-tomato'\n | 'pink-magenta'\n | 'purple-plum'\n | 'purple-violet'\n | 'purple-lavender'\n | 'pink-rose'\n | 'green-jade'\n | 'lime-pear'\n | 'yellow-nova'\n | 'brand-green';\n\n/** Controls the visual scale of an element to match its importance and available space.\n * - `sm` - Compact size for dense layouts or secondary elements with less visual prominence.\n * - `md` - Standard size that works well in most contexts and provides balanced visibility.\n * - `lg` - Larger size for emphasizing important elements or improving touch targets in spacious layouts.\n */\nexport type Size = 'sm' | 'md' | 'lg';\n\n/** Controls the visual scale of an element to match its importance and available space.\n * - `xs` - Extra small size for minimal elements or highly dense layouts.\n * - `sm` - Compact size for dense layouts or secondary elements with less visual prominence.\n * - `md` - Standard size that works well in most contexts and provides balanced visibility.\n * - `lg` - Larger size for emphasizing important elements or improving touch targets in spacious layouts.\n * - `xl` - Extra large size for emphasizing elements or sparse layouts.\n */\nexport type SizeExpanded = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n/** Controls the visual prominence to establish hierarchy and guide user attention.\n * - `emphasis` - Increases visual weight to draw attention and highlight important elements.\n * - `muted` - Reduces visual weight for supporting content that should remain subtle and unobtrusive.\n */\nexport type Prominence = 'emphasis' | 'muted';\n\n/**\n * Determines the container bounds of the element\n * - `flat` Element has white space bounds but reduced visual container.\n * - `inline` Element container reduces to fit within inline content such as a block of text.\n * - `inset` Element container optimizes for embedding or inset placement inside another containing element.\n * - `full` Element container optimizes for filling its container bounds.\n * - `condensed` Element container optimizes for small, summarized or contained spaces.\n */\nexport type Container = 'inline' | 'flat' | 'inset' | 'full' | 'condensed';\n\n/** Communicates the intent and semantic meaning of an element to help users understand the outcome of their actions.\n * - `accent` - Highlights important actions or draws attention to primary interactive elements.\n * - `warning` - Indicates cautionary actions that require careful consideration before proceeding.\n * - `success` - Represents positive outcomes, confirmations, or constructive actions.\n * - `danger` - Signals destructive or irreversible actions that need extra attention and confirmation.\n */\nexport type SupportStatus = 'accent' | 'warning' | 'success' | 'danger';\n\n/** Controls how the chart connects intermediate values between points in a data series.\n * - `linear` - Connects points with straight line segments.\n * - `smooth` - Connects points with smooth bezier curves.\n * - `step` - Connects points with horizontal and vertical step segments.\n */\nexport type Interpolation = 'linear' | 'smooth' | 'step';\n\n/** Determines the orientation of an element. */\nexport type Orientation = 'vertical' | 'horizontal';\n\n/** Communicates the current state of a task or process to keep users informed of progress and outcomes.\n * - `scheduled` - Task has a scheduled future execution at a specific time.\n * - `queued` - Task is waiting in line to begin after other tasks complete.\n * - `pending` - Task is awaiting approval, user input, or external conditions before proceeding.\n * - `starting` - Task is initializing and preparing to begin active execution.\n * - `running` - Task is actively executing and making progress.\n * - `restarting` - Task restarts after an interruption or reset.\n * - `stopping` - Task is gracefully shutting down and completing cleanup operations.\n * - `finished` - Task has completed successfully with the expected outcome.\n * - `failed` - Task encountered an error and did not complete as intended.\n * - `unknown` - Task status remains unknown or unavailable.\n * - `ignored` - Task was intentionally skipped or excluded from execution.\n */\nexport type TaskStatus =\n | 'scheduled'\n | 'queued'\n | 'pending'\n | 'starting'\n | 'running'\n | 'restarting'\n | 'stopping'\n | 'finished'\n | 'failed'\n | 'unknown'\n | 'ignored';\n\n/**\n * https://open-ui.org/components/popup.research.explainer#api-shape\n * - `auto` light dismiss, focus on open, return to trigger\n * - `manual` no light dismiss, no auto focus\n * - `hint` no light dismiss, no auto focus, open/close on hover/focus\n */\nexport type PopoverType = 'auto' | 'manual' | 'hint' | 'inline';\n\nexport type InterestEvent = Event & {\n source: HTMLElement;\n};\n\n/** Controls how the popover aligns along the edge of its anchor element.\n * - `start` - Aligns the popover to the beginning edge of the anchor for left or top alignment.\n * - `end` - Aligns the popover to the ending edge of the anchor for right or bottom alignment.\n * - `center` - Centers the popover along the anchor's edge for balanced positioning.\n */\nexport type PopoverAlign = 'start' | 'end' | 'center';\n\n/** Determines the popover position relative to its assigned anchor and alignment.\n * - `top` - Positions the popover above the anchor element.\n * - `bottom` - Positions the popover below the anchor element.\n * - `left` - Positions the popover to the left side of the anchor element.\n * - `right` - Positions the popover to the right side of the anchor element.\n */\nexport type PopoverSides = 'top' | 'bottom' | 'left' | 'right';\n\n/** Controls the placement of the popover relative to its anchor element.\n * - `center` - Centers the popover directly over the anchor element.\n * - `top` - Positions the popover above the anchor element.\n * - `bottom` - Positions the popover below the anchor element.\n * - `left` - Positions the popover to the left side of the anchor element.\n * - `right` - Positions the popover to the right side of the anchor element.\n */\nexport type PopoverPosition = 'center' | 'top' | 'bottom' | 'left' | 'right';\n\n/** Determines the position of an element relative to its anchor */\nexport type Placement = PopoverPosition | `${PopoverSides}-${PopoverAlign}`;\n\n/** Controls the directional arrangement and spacing behavior of the element's content.\n * - `vertical` - Arranges content in a vertical stack with block-level spacing.\n * - `vertical-inline` - Arranges content vertically with compact inline spacing for dense layouts.\n * - `horizontal` - Arranges content in a horizontal row with block-level spacing.\n * - `horizontal-inline` - Arranges content horizontally with compact inline spacing.\n */\nexport type ControlLayout = 'vertical' | 'vertical-inline' | 'horizontal' | 'horizontal-inline';\n\n/** Indicates the element that represents the user's current location or position within a set. [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current)\n * - `page` - Marks the current page within a set of navigation links.\n * - `step` - Marks the current step within a multi-step process or workflow.\n */\nexport type Current = 'page' | 'step';\n\n/** Controls how data points are visually encoded in a sparkline chart.\n * - `line` - Renders data as a connected line to emphasize macro trend.\n * - `area` - Renders data as a filled area beneath a line to emphasize magnitude over time.\n * - `gradient` - Renders a line with gradient color treatment to communicate value intensity across the series.\n * - `column` - Renders data as vertical columns for easy comparison of discrete values.\n * - `winloss` - Renders outcomes as binary or ternary bars to highlight wins, losses, and optional ties.\n */\nexport type SparklineMark = 'line' | 'area' | 'gradient' | 'column' | 'winloss';\n\nexport interface NveElement {\n /**\n * This Boolean attribute prevents the user from interacting with the element: it cannot receive press or focus events. [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-disabled)\n * - `true` - The element has a disabled state and does not accept interaction.\n * - `false` - The element has an enabled state and accepts interaction.\n */\n disabled?: boolean;\n\n /** Indicates whether the element is currently actively engaged through user interaction. [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/:active)\n * - `true` - The user is pressing or activating the element (mousedown, keydown, or touch).\n * - `false` - No active user engagement on the element.\n */\n active?: boolean;\n\n /** Indicates whether collapsible content is currently visible or hidden from the user. [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-expanded)\n * - `true` - The associated content expands and becomes visible to the user.\n * - `false` - The associated content collapses and hides from the user.\n */\n expanded?: boolean;\n\n /** Indicates the current state of a toggle button that switches on or off. [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-pressed)\n * - `true` - The button is in the pressed (on) state and the associated action or setting is active.\n * - `false` - The button is in the unpressed (off) state and the associated action or setting is inactive.\n */\n pressed?: boolean;\n\n /** Indicates whether an element currently holds selection within a multi-option selection group. [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected)\n * - `true` - The element holds selection and represents the user's current choice within the group.\n * - `false` - The element does not hold selection and the user can choose it.\n */\n selected?: boolean;\n\n /** Indicates whether the user can change the element's value while it remains visible and focusable. [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly)\n * - `true` - The element has a readonly state: the user cannot change its value, but can still focus and copy it.\n * - `false` - The element allows editing and the user can change its value through interaction.\n */\n readOnly?: boolean;\n\n /** Defines the value associated with the element's name when submitting the form data. The server receives this value in params when the form submits through this button. [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value) */\n value?: string;\n\n /** The name of the element, submitted as a pair with the element value as part of the form data. [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-name) */\n name?: string;\n\n /** Indicates whether the user can dismiss or close the element.\n * - `true` - The element displays a close control and the user can dismiss it.\n * - `false` - The user cannot close the element and must dismiss it programmatically.\n */\n closable?: boolean;\n\n /** Enables updating internal string values for internationalization. */\n i18n?: Partial<I18nStrings & { __set: boolean }>;\n\n /** Indicates the element that represents the user's current location or position within a set. [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current)\n * - `page` - Marks the current page within a set of navigation links.\n * - `step` - Marks the current step within a multi-step process or workflow.\n */\n current?: 'page' | 'step';\n\n /** Controls the horizontal alignment of the element within its container, respecting the text direction. [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_grid_layout/Box_alignment_in_grid_layout#the_two_axes_of_a_grid_layout)\n * - `start` - Aligns the element to the beginning of the inline axis (left in LTR, right in RTL).\n * - `center` - Centers the element along the inline axis for balanced visual positioning.\n * - `end` - Aligns the element to the end of the inline axis (right in LTR, left in RTL).\n */\n inlinePosition?: 'start' | 'center' | 'end';\n\n /** Controls the vertical alignment of the element within its container. [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_grid_layout/Box_alignment_in_grid_layout#the_two_axes_of_a_grid_layout)\n * - `start` - Aligns the element to the top of the block axis for top-aligned positioning.\n * - `center` - Centers the element along the block axis for balanced vertical positioning.\n * - `end` - Aligns the element to the bottom of the block axis for bottom-aligned positioning.\n */\n blockPosition?: 'start' | 'center' | 'end';\n\n /** Controls the directional arrangement and spacing behavior of the element's content.\n * - `vertical` - Arranges content in a vertical stack with block-level spacing.\n * - `vertical-inline` - Arranges content vertically with compact inline spacing for dense layouts.\n * - `horizontal` - Arranges content in a horizontal row with block-level spacing.\n * - `horizontal-inline` - Arranges content horizontally with compact inline spacing.\n */\n layout?: 'vertical' | 'vertical-inline' | 'horizontal' | 'horizontal-inline';\n\n /** Controls the directional flow of the element's layout and interaction pattern.\n * - `vertical` - Element orients vertically with top-to-bottom flow.\n * - `horizontal` - Element orients horizontally with left-to-right flow.\n */\n orientation?: 'vertical' | 'horizontal';\n\n /** Controls the visual prominence to establish hierarchy and guide user attention.\n * - `emphasis` - Increases visual weight to draw attention and highlight important elements.\n * - `muted` - Reduces visual weight for supporting content that should remain subtle and unobtrusive.\n */\n prominence?: 'emphasis' | 'muted';\n\n /** The Interaction type provides a way to show the intent of an interactive element. This can help users quickly understand what each interaction does and reduce the potential for confusion or errors.\n * - `emphasis` Shows the interaction targets emphasis or highlighting primary actions.\n * - `destructive` Shows the interaction targets destructive actions such as deleting or removing.\n */\n interaction?: 'emphasis' | 'destructive';\n\n /** Defines a base color from the theme color palette */\n color?:\n | 'red-cardinal'\n | 'gray-slate'\n | 'gray-denim'\n | 'blue-indigo'\n | 'blue-cobalt'\n | 'blue-sky'\n | 'teal-cyan'\n | 'green-mint'\n | 'teal-seafoam'\n | 'green-grass'\n | 'yellow-amber'\n | 'orange-pumpkin'\n | 'red-tomato'\n | 'pink-magenta'\n | 'purple-plum'\n | 'purple-violet'\n | 'purple-lavender'\n | 'pink-rose'\n | 'green-jade'\n | 'lime-pear'\n | 'yellow-nova'\n | 'brand-green';\n\n /** Communicates the intent and semantic meaning of an element to help users understand the outcome of their actions.\n * - `accent` - Highlights important actions or draws attention to primary interactive elements.\n * - `warning` - Indicates cautionary actions that require careful consideration before proceeding.\n * - `success` - Represents positive outcomes, confirmations, or constructive actions.\n * - `danger` - Signals destructive or irreversible actions that need extra attention and confirmation.\n */\n status?: 'accent' | 'warning' | 'success' | 'danger';\n\n /** Controls the visual scale of an element to match its importance and available space.\n * - `sm` - Compact size for dense layouts or secondary elements with less visual prominence.\n * - `md` - Standard size that works well in most contexts and provides balanced visibility.\n * - `lg` - Larger size for emphasizing important elements or improving touch targets in spacious layouts.\n */\n size?: 'sm' | 'md' | 'lg';\n\n /**\n * Demonstrates different container styles to accommodate visual weight and context.\n * - `flat` Element has white space bounds but reduced visual container.\n * - `inline` Element container reduces to fit within inline content such as a block of text.\n * - `inset` Element container optimizes for embedding or inset placement inside another containing element.\n * - `full` Element container optimizes for filling its container bounds.\n */\n container?: 'inline' | 'flat' | 'inset' | 'full';\n\n /** Determines the position of an element along both inline and block axis. [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_grid_layout/Box_alignment_in_grid_layout#the_two_axes_of_a_grid_layout) */\n position?:\n | 'top-start'\n | 'top-end'\n | 'top-center'\n | 'bottom-start'\n | 'bottom-end'\n | 'bottom-center'\n | 'left-start'\n | 'left-end'\n | 'left-center'\n | 'right-start'\n | 'right-end'\n | 'right-center';\n\n /** Determines the alignment of the popover relative to the provided anchor element. */\n alignment?: 'start' | 'end' | 'center';\n\n /** Provides the element that the popover should position relative to. Anchor can accept a idref string within the same render root or a HTMLElement DOM reference. */\n anchor?: string | HTMLElement;\n\n /** Defines what element triggers an `open` interaction event. A trigger can accept a idref string within the same render root or a HTMLElement DOM reference. */\n trigger?: string | HTMLElement;\n\n /** Defines named content areas where users can insert custom markup into the element.\n * - `default` - The primary content area for the element.\n * - `prefix` - Content that appears before the main element content.\n * - `suffix` - Content that appears after the main element content.\n * - `header` - Content that appears at the top of the element, used for titles or introductory information.\n * - `footer` - Content that appears at the bottom of the element, used for supplementary information or actions.\n * - `actions` - Content area specifically for interactive controls like buttons or links.\n * - `icon` - Content area for displaying an icon that represents the element's purpose or state.\n */\n slots?: 'default' | 'prefix' | 'suffix' | 'header' | 'footer' | 'actions' | 'icon';\n\n /**\n * Sets the automatic dismissal time in milliseconds before the element emits a `close` event. Allow ~200-250ms per word for comfortable reading.\n * - `0` - Warning or error messages requiring immediate acknowledgment.\n * - `3000` - Brief success or confirmation messages.\n * - `7000` - Standard informational messages.\n * - `10000` - Messages with actions or requiring user decision.\n */\n closeTimeout?: number;\n\n /**\n * Sets the delay in milliseconds before the element emits a `open` event.\n * - `0` - Keyboard focus interactions (always immediate for accessibility).\n * - `500` - Dense interfaces with many tooltips to reduce visual noise and prevent accidental triggers.\n */\n openDelay?: number;\n\n /** @private An instance of `ElementInternals` that decorators/controllers set dynamically */\n _internals: ElementInternals;\n\n render: TemplateResult;\n}\n\n/** Defines named content areas where users can insert custom markup into the element.\n * - `default` - The primary content area for the element.\n * - `prefix` - Content that appears before the main element content.\n * - `suffix` - Content that appears after the main element content.\n * - `header` - Content that appears at the top of the element, used for titles or introductory information.\n * - `footer` - Content that appears at the bottom of the element, used for supplementary information or actions.\n * - `actions` - Content area specifically for interactive controls like buttons or links.\n * - `icon` - Content area for displaying an icon that represents the element's purpose or state.\n */\nexport type SlotName = 'default' | 'prefix' | 'suffix' | 'header' | 'footer' | 'actions' | 'icon';\n\n/** The Interaction type provides a way to show the intent of an interactive element. This can help users quickly understand what each interaction does and reduce the potential for confusion or errors.\n * - `emphasis` Shows the interaction targets emphasis or highlighting primary actions.\n * - `destructive` Shows the interaction targets destructive actions such as deleting or removing.\n */\nexport type Interaction = 'emphasis' | 'destructive';\n\nexport interface ContainerElement {\n container?: Partial<Container>;\n}\n\n/** An element that renders complex data structures (e.g., arrays, series, matrices) rather than composable UI content and values expressible with primitive attributes. */\nexport interface DataElement<T extends unknown[] | Record<string, unknown>> {\n data?: T;\n}\n\nexport const statusIcons: { [key: string]: IconName } = {\n '': 'information-circle-stroke',\n undefined: 'information-circle-stroke',\n default: 'information-circle-stroke',\n accent: 'information-circle-stroke',\n warning: 'exclamation-triangle',\n success: 'checkmark-circle',\n danger: 'exclamation-circle',\n scheduled: 'clock',\n failed: 'x-circle',\n finished: 'checkmark-circle',\n unknown: 'question-mark-circle',\n queued: 'bar-pill-stack',\n running: 'running',\n restarting: 'refresh',\n stopping: 'stop-sign',\n pending: 'circle-dash',\n starting: 'circle-dot',\n ignored: 'circle-angled-line'\n} as const;\n\ndeclare global {\n var NVE_ELEMENTS: {\n state: {\n bundle: boolean;\n env: 'watch' | 'production' | 'development';\n pageHost: string;\n moduleHost: string;\n versions: string[];\n scopedRegistry: { [key: string]: CustomElementRegistry };\n elementRegistry: Readonly<{ [key: string]: string }>;\n i18nRegistry: Readonly<{ [key: string]: string }>;\n audit: Readonly<{\n [key: string]: {\n count?: number;\n excessiveInstanceLimitAudited?: boolean;\n };\n }>;\n };\n debug: (log?: (...args: unknown[]) => void) => void;\n };\n\n interface HTMLElement {\n 'nve-text': string;\n 'nve-layout': string;\n }\n\n interface CustomElementRegistry {\n initialize(root: ShadowRoot | Document): void;\n }\n\n var CustomElementRegistry: {\n new (): CustomElementRegistry;\n prototype: CustomElementRegistry;\n };\n}\n\nexport interface ElementDefinition extends CustomElementConstructor {\n metadata: { version: string; tag: string };\n elementDefinitions?: { [key: string]: ElementDefinition };\n shadowRootOptions?: { customElementRegistry?: CustomElementRegistry | null };\n}\n\nexport interface Point {\n x: number;\n y: number;\n}\n\nexport interface OffsetPoint {\n offsetX: number;\n offsetY: number;\n}\n\nexport interface Dimensions {\n width: number;\n height: number;\n}\n\nexport type Rect = Point & Dimensions;\n\nexport interface Scale {\n min: number;\n max: number;\n}\n\n/** https://github.com/tc39/proposal-decorators */\n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\nexport type LegacyDecoratorTarget = Function & {\n addInitializer?: (initializer: (instance: any) => void) => void; // eslint-disable-line @typescript-eslint/no-explicit-any\n};\n"],"mappings":";AAgZA,IAAa,IAA2C;CACtD,IAAI;CACJ,WAAW;CACX,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACT,QAAQ;CACR,WAAW;CACX,QAAQ;CACR,UAAU;CACV,SAAS;CACT,QAAQ;CACR,SAAS;CACT,YAAY;CACZ,UAAU;CACV,SAAS;CACT,UAAU;CACV,SAAS;AACX"}
@@ -11,7 +11,7 @@ export declare function getAttributeListChanges(element: HTMLElement, attrs: str
11
11
  export declare function appendRootNodeStyle(host: HTMLElement, styles: string): CSSStyleSheet;
12
12
  export declare function styleSheetToString(stylesheet: CSSStyleSheet): string;
13
13
  /** Intercepts a property setter on an element so `callback` fires on every assignment. Does not use a MutationObserver. */
14
- export declare function getPropertyChanges(element: HTMLElement, key: string, callback: (value: unknown) => void): void;
14
+ export declare function getPropertyChanges(element: HTMLElement, key: string, callback: (value: unknown) => void): (() => void) | undefined;
15
15
  export declare function getElementUpdate(element: HTMLElement, key: string, callback: (value: unknown) => void): MutationObserver;
16
16
  export declare function clickOutsideElementBounds(event: PointerEvent | MouseEvent, element: HTMLElement): boolean;
17
17
  /** parses number out of basic calc generated by the design tokens */