@nvidia-elements/core 2.7.2 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +8 -0
  3. package/dist/_virtual/{_@oxc-project_runtime@0.139.0 → _@oxc-project_runtime@0.147.0}/helpers/esm/decorate.js +1 -1
  4. package/dist/accordion/accordion2.js +5 -5
  5. package/dist/accordion/accordion2.js.map +1 -1
  6. package/dist/alert/alert-group2.js +2 -2
  7. package/dist/alert/alert-group2.js.map +1 -1
  8. package/dist/alert/alert2.js +2 -2
  9. package/dist/alert/alert2.js.map +1 -1
  10. package/dist/avatar/avatar-group2.js +1 -1
  11. package/dist/avatar/avatar-group2.js.map +1 -1
  12. package/dist/avatar/avatar2.js +2 -2
  13. package/dist/avatar/avatar2.js.map +1 -1
  14. package/dist/badge/badge2.js +2 -2
  15. package/dist/badge/badge2.js.map +1 -1
  16. package/dist/breadcrumb/breadcrumb2.js +2 -2
  17. package/dist/breadcrumb/breadcrumb2.js.map +1 -1
  18. package/dist/bundles/index.d.ts +4 -1
  19. package/dist/bundles/index.js +6 -6
  20. package/dist/button/button2.js +2 -2
  21. package/dist/button/button2.js.map +1 -1
  22. package/dist/button-group/button-group2.js +2 -2
  23. package/dist/button-group/button-group2.js.map +1 -1
  24. package/dist/card/card2.js +5 -5
  25. package/dist/card/card2.js.map +1 -1
  26. package/dist/chat-message/chat-message2.js +2 -2
  27. package/dist/chat-message/chat-message2.js.map +1 -1
  28. package/dist/checkbox/checkbox-group2.js +2 -2
  29. package/dist/checkbox/checkbox-group2.js.map +1 -1
  30. package/dist/checkbox/checkbox2.js +2 -2
  31. package/dist/checkbox/checkbox2.js.map +1 -1
  32. package/dist/color/color2.js +2 -2
  33. package/dist/color/color2.js.map +1 -1
  34. package/dist/combobox/combobox.examples.js.map +1 -1
  35. package/dist/combobox/combobox2.js +7 -5
  36. package/dist/combobox/combobox2.js.map +1 -1
  37. package/dist/copy-button/copy-button2.js +2 -2
  38. package/dist/copy-button/copy-button2.js.map +1 -1
  39. package/dist/custom-elements-jsx.d.ts +5 -2
  40. package/dist/custom-elements-vue.d.ts +5 -2
  41. package/dist/custom-elements.json +17 -5
  42. package/dist/data.html.json +3 -3
  43. package/dist/data.snippets.json +27 -27
  44. package/dist/date/date2.js +2 -2
  45. package/dist/date/date2.js.map +1 -1
  46. package/dist/datetime/datetime2.js +2 -2
  47. package/dist/datetime/datetime2.js.map +1 -1
  48. package/dist/dialog/dialog-footer2.js +2 -2
  49. package/dist/dialog/dialog-footer2.js.map +1 -1
  50. package/dist/dialog/dialog-header2.js +2 -2
  51. package/dist/dialog/dialog-header2.js.map +1 -1
  52. package/dist/dialog/dialog2.js +2 -2
  53. package/dist/dialog/dialog2.js.map +1 -1
  54. package/dist/divider/divider2.js +2 -2
  55. package/dist/divider/divider2.js.map +1 -1
  56. package/dist/dot/dot2.js +2 -2
  57. package/dist/dot/dot2.js.map +1 -1
  58. package/dist/drawer/drawer-content2.js +2 -2
  59. package/dist/drawer/drawer-content2.js.map +1 -1
  60. package/dist/drawer/drawer-footer2.js +2 -2
  61. package/dist/drawer/drawer-footer2.js.map +1 -1
  62. package/dist/drawer/drawer-header2.js +2 -2
  63. package/dist/drawer/drawer-header2.js.map +1 -1
  64. package/dist/drawer/drawer2.js +2 -2
  65. package/dist/drawer/drawer2.js.map +1 -1
  66. package/dist/dropdown/dropdown-footer2.js +2 -2
  67. package/dist/dropdown/dropdown-footer2.js.map +1 -1
  68. package/dist/dropdown/dropdown-header2.js +2 -2
  69. package/dist/dropdown/dropdown-header2.js.map +1 -1
  70. package/dist/dropdown/dropdown2.js +2 -2
  71. package/dist/dropdown/dropdown2.js.map +1 -1
  72. package/dist/dropdown-group/dropdown-group.js +2 -2
  73. package/dist/dropdown-group/dropdown-group.js.map +1 -1
  74. package/dist/dropzone/dropzone.js +1 -1
  75. package/dist/dropzone/dropzone.js.map +1 -1
  76. package/dist/dropzone/dropzone2.js +3 -3
  77. package/dist/dropzone/dropzone2.js.map +1 -1
  78. package/dist/file/file2.js +1 -1
  79. package/dist/file/file2.js.map +1 -1
  80. package/dist/format-bytes/format-bytes.d.ts +1 -1
  81. package/dist/format-bytes/format-bytes2.js +14 -14
  82. package/dist/format-bytes/format-bytes2.js.map +1 -1
  83. package/dist/format-datetime/format-datetime2.js +2 -2
  84. package/dist/format-datetime/format-datetime2.js.map +1 -1
  85. package/dist/format-number/format-number2.js +2 -2
  86. package/dist/format-number/format-number2.js.map +1 -1
  87. package/dist/format-relative-time/format-relative-time2.js +2 -2
  88. package/dist/format-relative-time/format-relative-time2.js.map +1 -1
  89. package/dist/format-truncate/format-truncate2.js +2 -2
  90. package/dist/format-truncate/format-truncate2.js.map +1 -1
  91. package/dist/forms/control/control2.js +2 -2
  92. package/dist/forms/control/control2.js.map +1 -1
  93. package/dist/forms/control-group/control-group2.js +2 -2
  94. package/dist/forms/control-group/control-group2.js.map +1 -1
  95. package/dist/forms/control-message/control-message.d.ts +1 -0
  96. package/dist/forms/control-message/control-message2.js +2 -2
  97. package/dist/forms/control-message/control-message2.js.map +1 -1
  98. package/dist/forms/validation.examples.js.map +1 -1
  99. package/dist/gauge/gauge2.js +2 -2
  100. package/dist/gauge/gauge2.js.map +1 -1
  101. package/dist/grid/cell/cell2.js +1 -1
  102. package/dist/grid/cell/cell2.js.map +1 -1
  103. package/dist/grid/column/column2.js +2 -2
  104. package/dist/grid/column/column2.js.map +1 -1
  105. package/dist/grid/footer/footer2.js +2 -2
  106. package/dist/grid/footer/footer2.js.map +1 -1
  107. package/dist/grid/grid.examples.js.map +1 -1
  108. package/dist/grid/grid2.js +2 -2
  109. package/dist/grid/grid2.js.map +1 -1
  110. package/dist/grid/header/header2.js +2 -2
  111. package/dist/grid/header/header2.js.map +1 -1
  112. package/dist/grid/placeholder/placeholder2.js +1 -1
  113. package/dist/grid/placeholder/placeholder2.js.map +1 -1
  114. package/dist/grid/row/row2.js +2 -2
  115. package/dist/grid/row/row2.js.map +1 -1
  116. package/dist/icon/icon2.js +3 -3
  117. package/dist/icon/icon2.js.map +1 -1
  118. package/dist/icon/icons/pointer-solid.js +1 -1
  119. package/dist/icon/icons/split-horizontal.js +1 -1
  120. package/dist/icon/icons/split-none.js +1 -1
  121. package/dist/icon/icons/split-vertical.js +1 -1
  122. package/dist/icon/icons/stop.js +1 -1
  123. package/dist/icon/server.js +5 -5
  124. package/dist/icon/server.js.map +1 -1
  125. package/dist/icon-button/icon-button2.js +2 -2
  126. package/dist/icon-button/icon-button2.js.map +1 -1
  127. package/dist/index.js +1 -1
  128. package/dist/input/input-group2.js +1 -1
  129. package/dist/input/input-group2.js.map +1 -1
  130. package/dist/input/input2.js +2 -2
  131. package/dist/input/input2.js.map +1 -1
  132. package/dist/internal/controllers/audit.controller.js +9 -7
  133. package/dist/internal/controllers/audit.controller.js.map +1 -1
  134. package/dist/internal/controllers/gesture.controller.examples.js.map +1 -1
  135. package/dist/internal/controllers/gesture.controller.js +1 -3
  136. package/dist/internal/controllers/gesture.controller.js.map +1 -1
  137. package/dist/internal/controllers/i18n.controller.examples.js.map +1 -1
  138. package/dist/internal/controllers/i18n.controller.js.map +1 -1
  139. package/dist/internal/controllers/keynav-grid.controller.js.map +1 -1
  140. package/dist/internal/controllers/keynav-list.controller.js +1 -4
  141. package/dist/internal/controllers/keynav-list.controller.js.map +1 -1
  142. package/dist/internal/controllers/keynav-spatial.controller.js.map +1 -1
  143. package/dist/internal/controllers/state-scroll.controller.js.map +1 -1
  144. package/dist/internal/controllers/type-anchor.controller.js.map +1 -1
  145. package/dist/internal/controllers/type-closable.controller.js.map +1 -1
  146. package/dist/internal/controllers/type-expandable.controller.js.map +1 -1
  147. package/dist/internal/controllers/type-native-popover.controller.js.map +1 -1
  148. package/dist/internal/controllers/type-native-popover.utils.js +2 -2
  149. package/dist/internal/controllers/type-native-popover.utils.js.map +1 -1
  150. package/dist/internal/controllers/type-selectable.controller.js.map +1 -1
  151. package/dist/internal/controllers/type-ssr.controller.js.map +1 -1
  152. package/dist/internal/services/global.service.js +1 -1
  153. package/dist/internal/services/global.utils.js.map +1 -1
  154. package/dist/internal/services/log.service.js.map +1 -1
  155. package/dist/internal/services/transition.service.js.map +1 -1
  156. package/dist/internal/utils/dom.js +2 -1
  157. package/dist/internal/utils/dom.js.map +1 -1
  158. package/dist/internal/utils/strings.js +1 -1
  159. package/dist/internal/utils/strings.js.map +1 -1
  160. package/dist/logo/logo2.js +2 -2
  161. package/dist/logo/logo2.js.map +1 -1
  162. package/dist/menu/menu-item2.js +2 -2
  163. package/dist/menu/menu-item2.js.map +1 -1
  164. package/dist/menu/menu2.js +2 -2
  165. package/dist/menu/menu2.js.map +1 -1
  166. package/dist/month/month2.js +2 -2
  167. package/dist/month/month2.js.map +1 -1
  168. package/dist/notification/notification-group2.js +2 -2
  169. package/dist/notification/notification-group2.js.map +1 -1
  170. package/dist/notification/notification2.js +2 -2
  171. package/dist/notification/notification2.js.map +1 -1
  172. package/dist/page/page-panel/page-panel-content2.js +1 -1
  173. package/dist/page/page-panel/page-panel-content2.js.map +1 -1
  174. package/dist/page/page-panel/page-panel-footer2.js +2 -2
  175. package/dist/page/page-panel/page-panel-footer2.js.map +1 -1
  176. package/dist/page/page-panel/page-panel-header2.js +2 -2
  177. package/dist/page/page-panel/page-panel-header2.js.map +1 -1
  178. package/dist/page/page-panel/page-panel2.js +2 -2
  179. package/dist/page/page-panel/page-panel2.js.map +1 -1
  180. package/dist/page/page2.js +2 -2
  181. package/dist/page/page2.js.map +1 -1
  182. package/dist/page-header/page-header2.js +1 -1
  183. package/dist/page-header/page-header2.js.map +1 -1
  184. package/dist/page-loader/page-loader2.js +2 -2
  185. package/dist/page-loader/page-loader2.js.map +1 -1
  186. package/dist/pagination/pagination2.js +2 -2
  187. package/dist/pagination/pagination2.js.map +1 -1
  188. package/dist/panel/panel2.js +5 -5
  189. package/dist/panel/panel2.js.map +1 -1
  190. package/dist/password/password2.js +2 -2
  191. package/dist/password/password2.js.map +1 -1
  192. package/dist/polyfills/index.js +1 -1
  193. package/dist/polyfills/index.js.map +1 -1
  194. package/dist/preferences-input/preferences-input2.js +2 -2
  195. package/dist/preferences-input/preferences-input2.js.map +1 -1
  196. package/dist/progress-bar/progress-bar2.js +2 -2
  197. package/dist/progress-bar/progress-bar2.js.map +1 -1
  198. package/dist/progress-ring/progress-ring.js +1 -1
  199. package/dist/progress-ring/progress-ring.js.map +1 -1
  200. package/dist/progress-ring/progress-ring2.js +3 -3
  201. package/dist/progress-ring/progress-ring2.js.map +1 -1
  202. package/dist/progressive-filter-chip/progressive-filter-chip2.js +2 -2
  203. package/dist/progressive-filter-chip/progressive-filter-chip2.js.map +1 -1
  204. package/dist/pulse/pulse2.js +2 -2
  205. package/dist/pulse/pulse2.js.map +1 -1
  206. package/dist/radio/radio-group2.js +2 -2
  207. package/dist/radio/radio-group2.js.map +1 -1
  208. package/dist/radio/radio2.js +2 -2
  209. package/dist/radio/radio2.js.map +1 -1
  210. package/dist/range/range2.js +4 -4
  211. package/dist/range/range2.js.map +1 -1
  212. package/dist/resize-handle/resize-handle2.js +2 -2
  213. package/dist/resize-handle/resize-handle2.js.map +1 -1
  214. package/dist/search/search2.js +2 -2
  215. package/dist/search/search2.js.map +1 -1
  216. package/dist/select/select2.js +2 -2
  217. package/dist/select/select2.js.map +1 -1
  218. package/dist/skeleton/skeleton2.js +2 -2
  219. package/dist/skeleton/skeleton2.js.map +1 -1
  220. package/dist/sort-button/sort-button2.js +2 -2
  221. package/dist/sort-button/sort-button2.js.map +1 -1
  222. package/dist/sparkline/sparkline.utils.js +1 -3
  223. package/dist/sparkline/sparkline.utils.js.map +1 -1
  224. package/dist/sparkline/sparkline2.js +8 -6
  225. package/dist/sparkline/sparkline2.js.map +1 -1
  226. package/dist/star-rating/star-rating2.js +2 -2
  227. package/dist/star-rating/star-rating2.js.map +1 -1
  228. package/dist/steps/steps2.js +3 -3
  229. package/dist/steps/steps2.js.map +1 -1
  230. package/dist/switch/switch-group2.js +2 -2
  231. package/dist/switch/switch-group2.js.map +1 -1
  232. package/dist/switch/switch2.js +2 -2
  233. package/dist/switch/switch2.js.map +1 -1
  234. package/dist/tabs/tabs-group2.js +2 -2
  235. package/dist/tabs/tabs-group2.js.map +1 -1
  236. package/dist/tabs/tabs2.js +3 -3
  237. package/dist/tabs/tabs2.js.map +1 -1
  238. package/dist/tag/tag.d.ts +2 -0
  239. package/dist/tag/tag.examples.js.map +1 -1
  240. package/dist/tag/tag.examples.json +20 -3
  241. package/dist/tag/tag.js +1 -1
  242. package/dist/tag/tag.js.map +1 -1
  243. package/dist/tag/tag2.js +3 -3
  244. package/dist/tag/tag2.js.map +1 -1
  245. package/dist/textarea/textarea2.js +1 -1
  246. package/dist/textarea/textarea2.js.map +1 -1
  247. package/dist/time/time2.js +2 -2
  248. package/dist/time/time2.js.map +1 -1
  249. package/dist/toast/toast2.js +2 -2
  250. package/dist/toast/toast2.js.map +1 -1
  251. package/dist/toggletip/toggletip-footer2.js +2 -2
  252. package/dist/toggletip/toggletip-footer2.js.map +1 -1
  253. package/dist/toggletip/toggletip-header2.js +2 -2
  254. package/dist/toggletip/toggletip-header2.js.map +1 -1
  255. package/dist/toggletip/toggletip2.js +2 -2
  256. package/dist/toggletip/toggletip2.js.map +1 -1
  257. package/dist/toolbar/toolbar2.js +2 -2
  258. package/dist/toolbar/toolbar2.js.map +1 -1
  259. package/dist/tooltip/tooltip.examples.js.map +1 -1
  260. package/dist/tooltip/tooltip2.js +2 -2
  261. package/dist/tooltip/tooltip2.js.map +1 -1
  262. package/dist/tree/tree-node2.js +2 -2
  263. package/dist/tree/tree-node2.js.map +1 -1
  264. package/dist/tree/tree.examples.js.map +1 -1
  265. package/dist/tree/tree2.js +2 -2
  266. package/dist/tree/tree2.js.map +1 -1
  267. package/dist/week/week2.js +2 -2
  268. package/dist/week/week2.js.map +1 -1
  269. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"file":"type-native-popover.controller.js","names":["#nativeTriggers","#updateLegacyTriggers","#setupLegacyTriggers","#setupModalLightDismiss","#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;IAEz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,IAAqB,KAAK,KAAK,aAAa,KAAKc,GAAoB;GAC3E,AAAI,IACF,KAAKX,KAAmB,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"}
1
+ {"version":3,"file":"type-native-popover.controller.js","names":[],"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,IAAI,KAAiC;EACnC,IAAM,IAAO,KAAK,KAAK,YAAY,GAC7B,IAAwB,MAAM,KAClC,EAAK,iBAAiB,mBAAmB,IAAI,SAAS,IAAI,OAAO,KAAK,KAAK,EAAE,IAA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AK,YAAY;CACxB;AACF"}
@@ -10,8 +10,8 @@ function i(r) {
10
10
  if (typeof i == "string" && i?.length) {
11
11
  let a = n(r.parentNode).find((e) => e.id === i);
12
12
  return a || t.warn(e(i)), a ?? globalThis.document.body;
13
- } else if (i && i !== globalThis.document.body) return i;
14
- else return globalThis.document.body;
13
+ }
14
+ return i && i !== globalThis.document.body ? i : globalThis.document.body;
15
15
  }
16
16
  function a(e) {
17
17
  return !!n(e).filter((e) => e.popover && e.matches(":popover-open")).length;
@@ -1 +1 @@
1
- {"version":3,"file":"type-native-popover.utils.js","names":[],"sources":["../../../src/internal/controllers/type-native-popover.utils.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { LogService } from '../services/log.service.js';\nimport { getIdMatchNotFoundWarning } from '../utils/audit-logs.js';\nimport { generateId, getFlattenedDOMTree, getAnchorNames, appendAnchorName } from '../utils/dom.js';\n\nexport function associateAnchor(host: HTMLElement, anchor: HTMLElement) {\n const anchorNames = getAnchorNames(anchor);\n let anchorId = anchorNames.find(name => name.startsWith('--_'));\n if (!anchorId) {\n anchorId = `--${anchor.id && !anchor.id.includes(':') ? `_${anchor.id}` : generateId()}`;\n appendAnchorName(anchor, anchorId);\n }\n host.style.positionAnchor = anchorId;\n}\n\nexport function getHostTrigger(element: HTMLElement, trigger: HTMLElement | string) {\n if (typeof trigger === 'string') {\n return (\n (getFlattenedDOMTree(element.parentNode as HTMLElement)\n .filter(el => el?.id !== '')\n .find(el => el.id === trigger) as HTMLButtonElement) ?? globalThis.document.body\n );\n } else {\n return trigger as HTMLButtonElement;\n }\n}\n\nexport function getHostAnchor(host: HTMLElement & { anchor?: HTMLElement | string; _activeTrigger?: HTMLElement }) {\n const anchor = host.anchor ?? host._activeTrigger;\n\n if (typeof anchor === 'string' && anchor?.length) {\n const match = getFlattenedDOMTree(host.parentNode as HTMLElement).find(el => el.id === anchor);\n\n if (!match) {\n LogService.warn(getIdMatchNotFoundWarning(anchor));\n }\n\n return match ?? globalThis.document.body;\n } else if (anchor && anchor !== globalThis.document.body) {\n return anchor as HTMLElement;\n } else {\n return globalThis.document.body;\n }\n}\n\nexport function hasOpenPopover(host: HTMLElement) {\n return !!getFlattenedDOMTree(host).filter(e => e.popover && e.matches(':popover-open')).length;\n}\n"],"mappings":";;;;AAiBA,SAAgB,EAAe,GAAsB,GAA+B;CAQhF,OAPE,OAAO,KAAY,WAElB,EAAoB,EAAQ,UAAyB,CAAC,CACpD,QAAO,MAAM,GAAI,OAAO,EAAE,CAAC,CAC3B,MAAK,MAAM,EAAG,OAAO,CAAO,KAA2B,WAAW,SAAS,OAGzE;AAEX;AAEA,SAAgB,EAAc,GAAqF;CACjH,IAAM,IAAS,EAAK,UAAU,EAAK;CAEnC,IAAI,OAAO,KAAW,YAAY,GAAQ,QAAQ;EAChD,IAAM,IAAQ,EAAoB,EAAK,UAAyB,CAAC,CAAC,MAAK,MAAM,EAAG,OAAO,CAAM;EAM7F,OAJK,KACH,EAAW,KAAK,EAA0B,CAAM,CAAC,GAG5C,KAAS,WAAW,SAAS;CACtC,OAAO,IAAI,KAAU,MAAW,WAAW,SAAS,MAClD,OAAO;MAEP,OAAO,WAAW,SAAS;AAE/B;AAEA,SAAgB,EAAe,GAAmB;CAChD,OAAO,CAAC,CAAC,EAAoB,CAAI,CAAC,CAAC,QAAO,MAAK,EAAE,WAAW,EAAE,QAAQ,eAAe,CAAC,CAAC,CAAC;AAC1F"}
1
+ {"version":3,"file":"type-native-popover.utils.js","names":[],"sources":["../../../src/internal/controllers/type-native-popover.utils.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { LogService } from '../services/log.service.js';\nimport { getIdMatchNotFoundWarning } from '../utils/audit-logs.js';\nimport { generateId, getFlattenedDOMTree, getAnchorNames, appendAnchorName } from '../utils/dom.js';\n\nexport function associateAnchor(host: HTMLElement, anchor: HTMLElement) {\n const anchorNames = getAnchorNames(anchor);\n let anchorId = anchorNames.find(name => name.startsWith('--_'));\n if (!anchorId) {\n anchorId = `--${anchor.id && !anchor.id.includes(':') ? `_${anchor.id}` : generateId()}`;\n appendAnchorName(anchor, anchorId);\n }\n host.style.positionAnchor = anchorId;\n}\n\nexport function getHostTrigger(element: HTMLElement, trigger: HTMLElement | string) {\n if (typeof trigger === 'string') {\n return (\n (getFlattenedDOMTree(element.parentNode as HTMLElement)\n .filter(el => el?.id !== '')\n .find(el => el.id === trigger) as HTMLButtonElement) ?? globalThis.document.body\n );\n } else {\n return trigger as HTMLButtonElement;\n }\n}\n\nexport function getHostAnchor(host: HTMLElement & { anchor?: HTMLElement | string; _activeTrigger?: HTMLElement }) {\n const anchor = host.anchor ?? host._activeTrigger;\n\n if (typeof anchor === 'string' && anchor?.length) {\n const match = getFlattenedDOMTree(host.parentNode as HTMLElement).find(el => el.id === anchor);\n\n if (!match) {\n LogService.warn(getIdMatchNotFoundWarning(anchor));\n }\n\n return match ?? globalThis.document.body;\n } else if (anchor && anchor !== globalThis.document.body) {\n return anchor as HTMLElement;\n } else {\n return globalThis.document.body;\n }\n}\n\nexport function hasOpenPopover(host: HTMLElement) {\n return !!getFlattenedDOMTree(host).filter(e => e.popover && e.matches(':popover-open')).length;\n}\n"],"mappings":";;;;AAiBA,SAAgB,EAAe,GAAsB,GAA+B;CAQhF,OAPE,OAAO,KAAY,WAElB,EAAoB,EAAQ,UAAyB,CAAC,CACpD,QAAO,MAAM,GAAI,OAAO,EAAE,CAAC,CAC3B,MAAK,MAAM,EAAG,OAAO,CAAO,KAA2B,WAAW,SAAS,OAGzE;AAEX;AAEA,SAAgB,EAAc,GAAqF;CACjH,IAAM,IAAS,EAAK,UAAU,EAAK;CAEnC,IAAI,OAAO,KAAW,YAAY,GAAQ,QAAQ;EAChD,IAAM,IAAQ,EAAoB,EAAK,UAAyB,CAAC,CAAC,MAAK,MAAM,EAAG,OAAO,CAAM;EAM7F,OAJK,KACH,EAAW,KAAK,EAA0B,CAAM,CAAC,GAG5C,KAAS,WAAW,SAAS;CACtC;CAGE,OAHS,KAAU,MAAW,WAAW,SAAS,OAC3C,IAEA,WAAW,SAAS;AAE/B;AAEA,SAAgB,EAAe,GAAmB;CAChD,OAAO,CAAC,CAAC,EAAoB,CAAI,CAAC,CAAC,QAAO,MAAK,EAAE,WAAW,EAAE,QAAQ,eAAe,CAAC,CAAC,CAAC;AAC1F"}
@@ -1 +1 @@
1
- {"version":3,"file":"type-selectable.controller.js","names":["#commandTriggered"],"sources":["../../../src/internal/controllers/type-selectable.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 { attachInternals } from '../utils/a11y.js';\n\nexport type TypeSelectable = ReactiveElement & {\n selected?: boolean;\n behaviorSelect?: boolean;\n selectable?: 'single' | 'multi';\n _internals?: ElementInternals;\n};\n\n/**\n * Controller for enabling selectable behavior for elements.\n * @event select - Dispatched when the selectable element selects.\n * @property selected - selected state\n * @property behaviorSelect - determines if stateful auto behavior should enable\n */\nexport class TypeSelectableController<T extends TypeSelectable> implements ReactiveController {\n #commandTriggered = false;\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n\n this.host.addEventListener('command', ((e: CommandEvent) => {\n this.#commandTriggered = true;\n if (e.command === '--toggle-select') {\n this.toggle();\n }\n\n if (e.command === '--select') {\n this.select();\n }\n\n if (e.command === '--deselect') {\n this.host.selected = false;\n }\n this.#commandTriggered = false;\n }) as EventListener);\n }\n\n hostUpdated() {\n this.host.selectable === 'single'\n ? this.host._internals!.states.add('selectable-single')\n : this.host._internals!.states.delete('selectable-single');\n this.host.selectable === 'multi'\n ? this.host._internals!.states.add('selectable-multi')\n : this.host._internals!.states.delete('selectable-multi');\n }\n\n select() {\n if (this.host.behaviorSelect || this.#commandTriggered) {\n this.host.selected = true;\n }\n\n this.host.dispatchEvent(new CustomEvent('select', { bubbles: true, composed: true, detail: this.host }));\n }\n\n deselect() {\n if (this.host.behaviorSelect || this.#commandTriggered) {\n this.host.selected = false;\n }\n\n this.host.dispatchEvent(new CustomEvent('select', { bubbles: true, composed: true, detail: this.host }));\n }\n\n toggle() {\n if (this.host.selected) {\n this.deselect();\n } else {\n this.select();\n }\n }\n}\n"],"mappings":";;AAmBA,IAAa,IAAb,MAA8F;CAC5F,KAAoB;CACpB,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,IAAI;CAC9B;CAEA,gBAAgB;EAGd,AAFA,EAAgB,KAAK,IAAI,GAEzB,KAAK,KAAK,iBAAiB,aAAa,MAAoB;GAa1D,AAZA,KAAKA,KAAoB,IACrB,EAAE,YAAY,qBAChB,KAAK,OAAO,GAGV,EAAE,YAAY,cAChB,KAAK,OAAO,GAGV,EAAE,YAAY,iBAChB,KAAK,KAAK,WAAW,KAEvB,KAAKA,KAAoB;EAC3B,EAAmB;CACrB;CAEA,cAAc;EAIZ,AAHA,KAAK,KAAK,eAAe,WACrB,KAAK,KAAK,WAAY,OAAO,IAAI,mBAAmB,IACpD,KAAK,KAAK,WAAY,OAAO,OAAO,mBAAmB,GAC3D,KAAK,KAAK,eAAe,UACrB,KAAK,KAAK,WAAY,OAAO,IAAI,kBAAkB,IACnD,KAAK,KAAK,WAAY,OAAO,OAAO,kBAAkB;CAC5D;CAEA,SAAS;EAKP,CAJI,KAAK,KAAK,kBAAkB,KAAKA,QACnC,KAAK,KAAK,WAAW,KAGvB,KAAK,KAAK,cAAc,IAAI,YAAY,UAAU;GAAE,SAAS;GAAM,UAAU;GAAM,QAAQ,KAAK;EAAK,CAAC,CAAC;CACzG;CAEA,WAAW;EAKT,CAJI,KAAK,KAAK,kBAAkB,KAAKA,QACnC,KAAK,KAAK,WAAW,KAGvB,KAAK,KAAK,cAAc,IAAI,YAAY,UAAU;GAAE,SAAS;GAAM,UAAU;GAAM,QAAQ,KAAK;EAAK,CAAC,CAAC;CACzG;CAEA,SAAS;EACP,AAAI,KAAK,KAAK,WACZ,KAAK,SAAS,IAEd,KAAK,OAAO;CAEhB;AACF"}
1
+ {"version":3,"file":"type-selectable.controller.js","names":[],"sources":["../../../src/internal/controllers/type-selectable.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 { attachInternals } from '../utils/a11y.js';\n\nexport type TypeSelectable = ReactiveElement & {\n selected?: boolean;\n behaviorSelect?: boolean;\n selectable?: 'single' | 'multi';\n _internals?: ElementInternals;\n};\n\n/**\n * Controller for enabling selectable behavior for elements.\n * @event select - Dispatched when the selectable element selects.\n * @property selected - selected state\n * @property behaviorSelect - determines if stateful auto behavior should enable\n */\nexport class TypeSelectableController<T extends TypeSelectable> implements ReactiveController {\n #commandTriggered = false;\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n\n this.host.addEventListener('command', ((e: CommandEvent) => {\n this.#commandTriggered = true;\n if (e.command === '--toggle-select') {\n this.toggle();\n }\n\n if (e.command === '--select') {\n this.select();\n }\n\n if (e.command === '--deselect') {\n this.host.selected = false;\n }\n this.#commandTriggered = false;\n }) as EventListener);\n }\n\n hostUpdated() {\n this.host.selectable === 'single'\n ? this.host._internals!.states.add('selectable-single')\n : this.host._internals!.states.delete('selectable-single');\n this.host.selectable === 'multi'\n ? this.host._internals!.states.add('selectable-multi')\n : this.host._internals!.states.delete('selectable-multi');\n }\n\n select() {\n if (this.host.behaviorSelect || this.#commandTriggered) {\n this.host.selected = true;\n }\n\n this.host.dispatchEvent(new CustomEvent('select', { bubbles: true, composed: true, detail: this.host }));\n }\n\n deselect() {\n if (this.host.behaviorSelect || this.#commandTriggered) {\n this.host.selected = false;\n }\n\n this.host.dispatchEvent(new CustomEvent('select', { bubbles: true, composed: true, detail: this.host }));\n }\n\n toggle() {\n if (this.host.selected) {\n this.deselect();\n } else {\n this.select();\n }\n }\n}\n"],"mappings":";;AAmBA,IAAa,IAAb,MAA8F;CAC5F,KAAoB;CACpB,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,IAAI;CAC9B;CAEA,gBAAgB;EAGd,AAFA,EAAgB,KAAK,IAAI,GAEzB,KAAK,KAAK,iBAAiB,aAAa,MAAoB;GAa1D,AAZA,KAAK,KAAoB,IACrB,EAAE,YAAY,qBAChB,KAAK,OAAO,GAGV,EAAE,YAAY,cAChB,KAAK,OAAO,GAGV,EAAE,YAAY,iBAChB,KAAK,KAAK,WAAW,KAEvB,KAAK,KAAoB;EAC3B,EAAmB;CACrB;CAEA,cAAc;EAIZ,AAHA,KAAK,KAAK,eAAe,WACrB,KAAK,KAAK,WAAY,OAAO,IAAI,mBAAmB,IACpD,KAAK,KAAK,WAAY,OAAO,OAAO,mBAAmB,GAC3D,KAAK,KAAK,eAAe,UACrB,KAAK,KAAK,WAAY,OAAO,IAAI,kBAAkB,IACnD,KAAK,KAAK,WAAY,OAAO,OAAO,kBAAkB;CAC5D;CAEA,SAAS;EAKP,CAJI,KAAK,KAAK,kBAAkB,KAAK,QACnC,KAAK,KAAK,WAAW,KAGvB,KAAK,KAAK,cAAc,IAAI,YAAY,UAAU;GAAE,SAAS;GAAM,UAAU;GAAM,QAAQ,KAAK;EAAK,CAAC,CAAC;CACzG;CAEA,WAAW;EAKT,CAJI,KAAK,KAAK,kBAAkB,KAAK,QACnC,KAAK,KAAK,WAAW,KAGvB,KAAK,KAAK,cAAc,IAAI,YAAY,UAAU;GAAE,SAAS;GAAM,UAAU;GAAM,QAAQ,KAAK;EAAK,CAAC,CAAC;CACzG;CAEA,SAAS;EACP,AAAI,KAAK,KAAK,WACZ,KAAK,SAAS,IAEd,KAAK,OAAO;CAEhB;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"type-ssr.controller.js","names":["#firstUpdate"],"sources":["../../../src/internal/controllers/type-ssr.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, RenderOptions, TemplateResult } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { render } from 'lit';\nimport { LogService } from '../services/log.service.js';\nimport { getSSRMismatchWarning } from '../utils/audit-logs.js';\nimport { getEnv } from '../services/global.utils.js';\n\ntype UnprotectedLitElement = ReactiveElement & {\n update: () => void;\n render: () => TemplateResult;\n renderOptions: RenderOptions;\n _internals?: ElementInternals;\n};\n\n/**\n * Catch and manage hydration related fallbacks for SSR\n */\nexport function typeSSR<T extends UnprotectedLitElement>(options: { log?: boolean } = { log: true }): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!(\n (instance: T & { _internals: ElementInternals }) => new TypeSSRController(instance, options)\n );\n}\n\nexport class TypeSSRController<T extends ReactiveElement> implements ReactiveController {\n // https://www.konnorrogers.com/posts/2024/running-lit-ssr-in-web-awesome#hydration-errors\n didSSR = Boolean(this.host.shadowRoot);\n\n constructor(\n private host: T & UnprotectedLitElement,\n private options: { log?: boolean }\n ) {\n this.host.addController(this);\n\n // https://github.com/lit/lit/issues/1434#issuecomment-1598332000\n if (this.didSSR) {\n const controllerOptions = this.options;\n const updateOriginal = host.update;\n Object.defineProperty(host, 'update', {\n value: function () {\n try {\n updateOriginal.call(host);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (_) {\n const renderRoot = host.renderRoot as HTMLElement;\n renderRoot.innerHTML = renderRoot.innerHTML.split('<!--lit-part ')[0]!;\n render(host.render(), renderRoot, host.renderOptions);\n\n if (getEnv() !== 'production' && controllerOptions.log) {\n LogService.warn(getSSRMismatchWarning(host.localName));\n }\n }\n return updateOriginal;\n }\n });\n }\n }\n\n #firstUpdate = true;\n hostUpdated() {\n // https://github.com/lit/lit/discussions/4697\n // https://github.com/w3c/csswg-drafts/issues/6867#issuecomment-1599444407\n if (this.didSSR && this.#firstUpdate) {\n this.#firstUpdate = false;\n this.host.shadowRoot?.querySelectorAll('slot').forEach(slotElement => {\n slotElement.dispatchEvent(new Event('slotchange', { bubbles: true, composed: false, cancelable: false }));\n });\n\n // if SSR reflect role attribute to host\n if (this.host._internals?.role) {\n this.host.setAttribute('role', this.host._internals.role);\n }\n }\n }\n}\n"],"mappings":";;;;;AAoBA,SAAgB,EAAyC,IAA6B,EAAE,KAAK,GAAK,GAAmB;CACnH,QAAQ,MACN,EAAO,gBACJ,MAAmD,IAAI,EAAkB,GAAU,CAAO,CAC7F;AACJ;AAEA,IAAa,IAAb,MAAwF;CAItF,YACE,GACA,GACA;EAIA,IANQ,KAAA,OAAA,GACA,KAAA,UAAA,iBAJD,EAAQ,KAAK,KAAK,sBAgCZ,IA1Bb,KAAK,KAAK,cAAc,IAAI,GAGxB,KAAK,QAAQ;GACf,IAAM,IAAoB,KAAK,SACzB,IAAiB,EAAK;GAC5B,OAAO,eAAe,GAAM,UAAU,EACpC,OAAO,WAAY;IACjB,IAAI;KACF,EAAe,KAAK,CAAI;IAE1B,QAAY;KACV,IAAM,IAAa,EAAK;KAIxB,AAHA,EAAW,YAAY,EAAW,UAAU,MAAM,eAAe,CAAC,CAAC,IACnE,EAAO,EAAK,OAAO,GAAG,GAAY,EAAK,aAAa,GAEhD,EAAO,MAAM,gBAAgB,EAAkB,OACjD,EAAW,KAAK,EAAsB,EAAK,SAAS,CAAC;IAEzD;IACA,OAAO;GACT,EACF,CAAC;EACH;CACF;CAEA;CACA,cAAc;EAGZ,AAAI,KAAK,UAAU,KAAKA,OACtB,KAAKA,KAAe,IACpB,KAAK,KAAK,YAAY,iBAAiB,MAAM,CAAC,CAAC,SAAQ,MAAe;GACpE,EAAY,cAAc,IAAI,MAAM,cAAc;IAAE,SAAS;IAAM,UAAU;IAAO,YAAY;GAAM,CAAC,CAAC;EAC1G,CAAC,GAGG,KAAK,KAAK,YAAY,QACxB,KAAK,KAAK,aAAa,QAAQ,KAAK,KAAK,WAAW,IAAI;CAG9D;AACF"}
1
+ {"version":3,"file":"type-ssr.controller.js","names":[],"sources":["../../../src/internal/controllers/type-ssr.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, RenderOptions, TemplateResult } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { render } from 'lit';\nimport { LogService } from '../services/log.service.js';\nimport { getSSRMismatchWarning } from '../utils/audit-logs.js';\nimport { getEnv } from '../services/global.utils.js';\n\ntype UnprotectedLitElement = ReactiveElement & {\n update: () => void;\n render: () => TemplateResult;\n renderOptions: RenderOptions;\n _internals?: ElementInternals;\n};\n\n/**\n * Catch and manage hydration related fallbacks for SSR\n */\nexport function typeSSR<T extends UnprotectedLitElement>(options: { log?: boolean } = { log: true }): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!(\n (instance: T & { _internals: ElementInternals }) => new TypeSSRController(instance, options)\n );\n}\n\nexport class TypeSSRController<T extends ReactiveElement> implements ReactiveController {\n // https://www.konnorrogers.com/posts/2024/running-lit-ssr-in-web-awesome#hydration-errors\n didSSR = Boolean(this.host.shadowRoot);\n\n constructor(\n private host: T & UnprotectedLitElement,\n private options: { log?: boolean }\n ) {\n this.host.addController(this);\n\n // https://github.com/lit/lit/issues/1434#issuecomment-1598332000\n if (this.didSSR) {\n const controllerOptions = this.options;\n const updateOriginal = host.update;\n Object.defineProperty(host, 'update', {\n value: function () {\n try {\n updateOriginal.call(host);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (_) {\n const renderRoot = host.renderRoot as HTMLElement;\n renderRoot.innerHTML = renderRoot.innerHTML.split('<!--lit-part ')[0]!;\n render(host.render(), renderRoot, host.renderOptions);\n\n if (getEnv() !== 'production' && controllerOptions.log) {\n LogService.warn(getSSRMismatchWarning(host.localName));\n }\n }\n return updateOriginal;\n }\n });\n }\n }\n\n #firstUpdate = true;\n hostUpdated() {\n // https://github.com/lit/lit/discussions/4697\n // https://github.com/w3c/csswg-drafts/issues/6867#issuecomment-1599444407\n if (this.didSSR && this.#firstUpdate) {\n this.#firstUpdate = false;\n this.host.shadowRoot?.querySelectorAll('slot').forEach(slotElement => {\n slotElement.dispatchEvent(new Event('slotchange', { bubbles: true, composed: false, cancelable: false }));\n });\n\n // if SSR reflect role attribute to host\n if (this.host._internals?.role) {\n this.host.setAttribute('role', this.host._internals.role);\n }\n }\n }\n}\n"],"mappings":";;;;;AAoBA,SAAgB,EAAyC,IAA6B,EAAE,KAAK,GAAK,GAAmB;CACnH,QAAQ,MACN,EAAO,gBACJ,MAAmD,IAAI,EAAkB,GAAU,CAAO,CAC7F;AACJ;AAEA,IAAa,IAAb,MAAwF;CAItF,YACE,GACA,GACA;EAIA,IANQ,KAAA,OAAA,GACA,KAAA,UAAA,GAJD,KAAA,SAAA,EAAQ,KAAK,KAAK,YAgCZ,KAAA,KAAA,IA1Bb,KAAK,KAAK,cAAc,IAAI,GAGxB,KAAK,QAAQ;GACf,IAAM,IAAoB,KAAK,SACzB,IAAiB,EAAK;GAC5B,OAAO,eAAe,GAAM,UAAU,EACpC,OAAO,WAAY;IACjB,IAAI;KACF,EAAe,KAAK,CAAI;IAE1B,QAAY;KACV,IAAM,IAAa,EAAK;KAIxB,AAHA,EAAW,YAAY,EAAW,UAAU,MAAM,eAAe,CAAC,CAAC,IACnE,EAAO,EAAK,OAAO,GAAG,GAAY,EAAK,aAAa,GAEhD,EAAO,MAAM,gBAAgB,EAAkB,OACjD,EAAW,KAAK,EAAsB,EAAK,SAAS,CAAC;IAEzD;IACA,OAAO;GACT,EACF,CAAC;EACH;CACF;CAEA;CACA,cAAc;EAGZ,AAAI,KAAK,UAAU,KAAK,OACtB,KAAK,KAAe,IACpB,KAAK,KAAK,YAAY,iBAAiB,MAAM,CAAC,CAAC,SAAQ,MAAe;GACpE,EAAY,cAAc,IAAI,MAAM,cAAc;IAAE,SAAS;IAAM,UAAU;IAAO,YAAY;GAAM,CAAC,CAAC;EAC1G,CAAC,GAGG,KAAK,KAAK,YAAY,QACxB,KAAK,KAAK,aAAa,QAAQ,KAAK,KAAK,WAAW,IAAI;CAG9D;AACF"}
@@ -19,7 +19,7 @@ var a = class {
19
19
  i18nRegistry: {},
20
20
  audit: {}
21
21
  }
22
- }, globalThis.NVE_ELEMENTS.state.versions = Array.from(/* @__PURE__ */ new Set([...globalThis.NVE_ELEMENTS.state.versions, "2.7.2"])), globalThis.NVE_ELEMENTS.state.scopedRegistry ??= {}, globalThis.NVE_ELEMENTS.state.scopedRegistry["2.7.2"] = 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(/* @__PURE__ */ new Set([...globalThis.NVE_ELEMENTS.state.versions, "2.8.0"])), globalThis.NVE_ELEMENTS.state.scopedRegistry ??= {}, globalThis.NVE_ELEMENTS.state.scopedRegistry["2.8.0"] = 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;
@@ -1 +1 @@
1
- {"version":3,"file":"global.utils.js","names":[],"sources":["../../../src/internal/services/global.utils.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\ndeclare global {\n var process: { env?: { NODE_ENV?: string } } | undefined;\n}\n\n/* istanbul ignore next -- @preserve */\nexport function getEnv(): 'development' | 'production' {\n if (\n globalThis.process?.env?.NODE_ENV !== 'production' &&\n (globalThis.location?.hostname === 'localhost' || globalThis.location?.href?.includes('elements-playground'))\n ) {\n return 'development';\n } else {\n return 'production';\n }\n}\n\nexport function getHostDetails(): { moduleHost: string; pageHost: string } {\n const pageHost = globalThis.location?.hostname;\n const moduleHost = new URL(import.meta.url).hostname;\n\n return {\n pageHost,\n moduleHost\n };\n}\n"],"mappings":";;AAQA,SAAgB,IAAuC;CAOnD,OALA,WAAW,SAAS,KAAK,aAAa,iBACrC,WAAW,UAAU,aAAa,eAAe,WAAW,UAAU,MAAM,SAAS,qBAAqB,KAEpG,gBAEA;AAEX;AAEA,SAAgB,IAA2D;CAIzE,OAAO;EACL,UAJe,WAAW,UAAU;EAKpC,YAJiB,IAAI,IAAI,OAAO,KAAK,GAAG,CAAC,CAAC;CAK5C;AACF"}
1
+ {"version":3,"file":"global.utils.js","names":[],"sources":["../../../src/internal/services/global.utils.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\ndeclare global {\n var process: { env?: { NODE_ENV?: string } } | undefined;\n}\n\n/* istanbul ignore next -- @preserve */\nexport function getEnv(): 'development' | 'production' {\n if (\n globalThis.process?.env?.NODE_ENV !== 'production' &&\n (globalThis.location?.hostname === 'localhost' || globalThis.location?.href?.includes('elements-playground'))\n ) {\n return 'development';\n } else {\n return 'production';\n }\n}\n\nexport function getHostDetails(): { moduleHost: string; pageHost: string } {\n const pageHost = globalThis.location?.hostname;\n const moduleHost = new URL(import.meta.url).hostname;\n\n return {\n pageHost,\n moduleHost\n };\n}\n"],"mappings":";;AAQA,SAAgB,IAAuC;CAOnD,OALA,WAAW,SAAS,KAAK,aAAa,iBACrC,WAAW,UAAU,aAAa,eAAe,WAAW,UAAU,MAAM,SAAS,qBAAqB,KAEpG,gBAEA;AAEX;AAEA,SAAgB,IAA2D;CAIzE,OAAO;EACL,UAJe,WAAW,UAAU;EAKpC,YAJiB,IAAI,IAAI,YAAY,GAAG,CAAC,CAAC;CAK5C;AACF"}
@@ -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,UAAU,cAAc,IAAI,YAAY,oBAAoB,EAAE,QAAQ;GAAE;GAAM;GAAO;EAAK,EAAE,CAAC,CAAC;CAC3G;AACF"}
1
+ {"version":3,"file":"log.service.js","names":[],"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,KAAK,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,KAAK,GAAU,SAAS,GAAO,GAAG,CAAI;CAE1C;CAEA,OAAO,GAAU,GAAwB,GAAe,GAAG,GAAiB;EAC1E,WAAW,UAAU,cAAc,IAAI,YAAY,oBAAoB,EAAE,QAAQ;GAAE;GAAM;GAAO;EAAK,EAAE,CAAC,CAAC;CAC3G;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"transition.service.js","names":["#hasSpeculationRules","#nveTransition","#observer","#toggleSpeculationRules","#removeSpeculationRules","#appendSpeculationRules"],"sources":["../../../src/internal/services/transition.service.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nclass TransitionService_ {\n get #hasSpeculationRules() {\n return globalThis.document.querySelector('[type=speculationrules]');\n }\n\n get #nveTransition() {\n return globalThis.document.documentElement.getAttribute('nve-transition');\n }\n\n #observer: MutationObserver;\n\n enable() {\n if (globalThis.document) {\n this.#observer?.disconnect();\n this.#toggleSpeculationRules();\n this.#observer = new MutationObserver(() => this.#toggleSpeculationRules());\n this.#observer.observe(globalThis.document.documentElement, {\n attributeFilter: ['nve-transition']\n });\n }\n }\n\n disable() {\n this.#removeSpeculationRules();\n this.#observer?.disconnect();\n }\n\n #toggleSpeculationRules() {\n if (globalThis.document && this.#nveTransition === 'auto') {\n if (!this.#hasSpeculationRules) {\n this.#appendSpeculationRules();\n }\n } else {\n this.#removeSpeculationRules();\n }\n }\n\n #appendSpeculationRules() {\n const speculationRules = globalThis.document.createElement('script');\n speculationRules.id = 'nve-speculationrules';\n speculationRules.type = 'speculationrules';\n speculationRules.textContent = JSON.stringify({\n prerender: [\n {\n where: { href_matches: '/*' },\n eagerness: 'moderate'\n }\n ]\n });\n globalThis.document.head.appendChild(speculationRules);\n }\n\n #removeSpeculationRules() {\n globalThis.document?.querySelector('#nve-speculationrules')?.remove();\n }\n}\n\n/**\n * The Transition Service provides setup to enable View Transitions APIs.\n * This includes initializing base speculation rules for smooth transition between navigations.\n *\n * https://developer.chrome.com/docs/web-platform/view-transitions/cross-document\n * https://developer.chrome.com/docs/web-platform/prerender-pages#speculation-rules-api\n */\nexport const TransitionService = new TransitionService_();\n"],"mappings":"AAmEA,IAAa,IAAoB,IAAI,MAhEZ;CACvB,IAAIA,KAAuB;EACzB,OAAO,WAAW,SAAS,cAAc,yBAAyB;CACpE;CAEA,IAAIC,KAAiB;EACnB,OAAO,WAAW,SAAS,gBAAgB,aAAa,gBAAgB;CAC1E;CAEA;CAEA,SAAS;EACP,AAAI,WAAW,aACb,KAAKC,IAAW,WAAW,GAC3B,KAAKC,GAAwB,GAC7B,KAAKD,KAAY,IAAI,uBAAuB,KAAKC,GAAwB,CAAC,GAC1E,KAAKD,GAAU,QAAQ,WAAW,SAAS,iBAAiB,EAC1D,iBAAiB,CAAC,gBAAgB,EACpC,CAAC;CAEL;CAEA,UAAU;EAER,AADA,KAAKE,GAAwB,GAC7B,KAAKF,IAAW,WAAW;CAC7B;CAEA,KAA0B;EACxB,AAAI,WAAW,YAAY,KAAKD,OAAmB,SAC5C,KAAKD,MACR,KAAKK,GAAwB,IAG/B,KAAKD,GAAwB;CAEjC;CAEA,KAA0B;EACxB,IAAM,IAAmB,WAAW,SAAS,cAAc,QAAQ;EAWnE,AAVA,EAAiB,KAAK,wBACtB,EAAiB,OAAO,oBACxB,EAAiB,cAAc,KAAK,UAAU,EAC5C,WAAW,CACT;GACE,OAAO,EAAE,cAAc,KAAK;GAC5B,WAAW;EACb,CACF,EACF,CAAC,GACD,WAAW,SAAS,KAAK,YAAY,CAAgB;CACvD;CAEA,KAA0B;EACxB,WAAW,UAAU,cAAc,uBAAuB,CAAC,EAAE,OAAO;CACtE;AACF,EASwD"}
1
+ {"version":3,"file":"transition.service.js","names":[],"sources":["../../../src/internal/services/transition.service.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nclass TransitionService_ {\n get #hasSpeculationRules() {\n return globalThis.document.querySelector('[type=speculationrules]');\n }\n\n get #nveTransition() {\n return globalThis.document.documentElement.getAttribute('nve-transition');\n }\n\n #observer: MutationObserver;\n\n enable() {\n if (globalThis.document) {\n this.#observer?.disconnect();\n this.#toggleSpeculationRules();\n this.#observer = new MutationObserver(() => this.#toggleSpeculationRules());\n this.#observer.observe(globalThis.document.documentElement, {\n attributeFilter: ['nve-transition']\n });\n }\n }\n\n disable() {\n this.#removeSpeculationRules();\n this.#observer?.disconnect();\n }\n\n #toggleSpeculationRules() {\n if (globalThis.document && this.#nveTransition === 'auto') {\n if (!this.#hasSpeculationRules) {\n this.#appendSpeculationRules();\n }\n } else {\n this.#removeSpeculationRules();\n }\n }\n\n #appendSpeculationRules() {\n const speculationRules = globalThis.document.createElement('script');\n speculationRules.id = 'nve-speculationrules';\n speculationRules.type = 'speculationrules';\n speculationRules.textContent = JSON.stringify({\n prerender: [\n {\n where: { href_matches: '/*' },\n eagerness: 'moderate'\n }\n ]\n });\n globalThis.document.head.appendChild(speculationRules);\n }\n\n #removeSpeculationRules() {\n globalThis.document?.querySelector('#nve-speculationrules')?.remove();\n }\n}\n\n/**\n * The Transition Service provides setup to enable View Transitions APIs.\n * This includes initializing base speculation rules for smooth transition between navigations.\n *\n * https://developer.chrome.com/docs/web-platform/view-transitions/cross-document\n * https://developer.chrome.com/docs/web-platform/prerender-pages#speculation-rules-api\n */\nexport const TransitionService = new TransitionService_();\n"],"mappings":"AAmEA,IAAa,IAAoB,IAAI,MAhEZ;CACvB,IAAI,KAAuB;EACzB,OAAO,WAAW,SAAS,cAAc,yBAAyB;CACpE;CAEA,IAAI,KAAiB;EACnB,OAAO,WAAW,SAAS,gBAAgB,aAAa,gBAAgB;CAC1E;CAEA;CAEA,SAAS;EACP,AAAI,WAAW,aACb,KAAK,IAAW,WAAW,GAC3B,KAAK,GAAwB,GAC7B,KAAK,KAAY,IAAI,uBAAuB,KAAK,GAAwB,CAAC,GAC1E,KAAK,GAAU,QAAQ,WAAW,SAAS,iBAAiB,EAC1D,iBAAiB,CAAC,gBAAgB,EACpC,CAAC;CAEL;CAEA,UAAU;EAER,AADA,KAAK,GAAwB,GAC7B,KAAK,IAAW,WAAW;CAC7B;CAEA,KAA0B;EACxB,AAAI,WAAW,YAAY,KAAK,OAAmB,SAC5C,KAAK,MACR,KAAK,GAAwB,IAG/B,KAAK,GAAwB;CAEjC;CAEA,KAA0B;EACxB,IAAM,IAAmB,WAAW,SAAS,cAAc,QAAQ;EAWnE,AAVA,EAAiB,KAAK,wBACtB,EAAiB,OAAO,oBACxB,EAAiB,cAAc,KAAK,UAAU,EAC5C,WAAW,CACT;GACE,OAAO,EAAE,cAAc,KAAK;GAC5B,WAAW;EACb,CACF,EACF,CAAC,GACD,WAAW,SAAS,KAAK,YAAY,CAAgB;CACvD;CAEA,KAA0B;EACxB,WAAW,UAAU,cAAc,uBAAuB,CAAC,EAAE,OAAO;CACtE;AACF,EASwD"}
@@ -8,7 +8,8 @@ function r(e) {
8
8
  if (e instanceof HTMLSlotElement && e.assignedElements) {
9
9
  let t = e.assignedElements();
10
10
  return t.length ? t : Array.from(e.children);
11
- } else return Array.from(e.children);
11
+ }
12
+ return Array.from(e.children);
12
13
  }
13
14
  function i() {
14
15
  return `_${self.crypto.getRandomValues(/* @__PURE__ */ new Uint32Array(1))[0].toString(16)}`;
@@ -1 +1 @@
1
- {"version":3,"file":"dom.js","names":[],"sources":["../../../src/internal/utils/dom.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { GlobalStateService } from '../services/global.service.js';\nimport { LogService } from '../services/log.service.js';\nimport type { ElementDefinition } from '../types/index.js';\nimport { isFocusable } from './focus.js';\n\nexport function getChildren(node: Document | Node | HTMLElement): Element[] {\n if (node instanceof Document && node.documentElement) {\n return Array.from(node.documentElement.children); // root document children\n } else if (node instanceof HTMLElement && node.shadowRoot) {\n return Array.from(node.shadowRoot.children); // shadow root direct children\n } else if (node instanceof HTMLSlotElement && node.assignedElements) {\n const slotted = node.assignedElements(); // slotted elements\n return slotted.length ? slotted : Array.from(node.children); // slot fallback\n } else {\n return Array.from((node as HTMLElement).children); // light DOM direct children\n }\n}\n\nexport function generateId() {\n const uint32 = self.crypto.getRandomValues(new Uint32Array(1))[0]!;\n return `_${uint32.toString(16)}`;\n}\n\nexport function getAttributeChanges(element: HTMLElement, attr: string, fn: (attrValue: string | null) => void) {\n fn(element.getAttribute(attr));\n const observer = new MutationObserver(mutations => {\n mutations.forEach(mutation => {\n if (mutation.attributeName === attr) {\n fn((mutation.target as HTMLElement).getAttribute(attr));\n }\n });\n });\n observer.observe(element, { attributes: true, subtree: true });\n return observer;\n}\n\nexport function getAttributeListChanges(element: HTMLElement, attrs: string[], fn: (mutation: MutationRecord) => void) {\n const observer = new MutationObserver(mutations => {\n mutations.forEach(mutation => {\n if (mutation.attributeName && attrs.includes(mutation.attributeName)) {\n fn(mutation);\n }\n });\n });\n observer.observe(element, { attributes: true, subtree: true });\n return observer;\n}\n\n/**\n * Appends styles to the render root of a given element. This is useful for\n * styles that apply outside the scope of the element's shadow\n * root such as UA styles --webkit-* that won't work in a ::slotted selector\n */\nexport function appendRootNodeStyle(host: HTMLElement, styles: string) {\n const stylesheet = new CSSStyleSheet();\n stylesheet.replaceSync(styles);\n const root = host.getRootNode() as Document | ShadowRoot;\n if (root.adoptedStyleSheets) {\n const hasStyleSheet = root.adoptedStyleSheets\n .map(s => styleSheetToString(s))\n .find(s => s === styleSheetToString(stylesheet));\n if (!hasStyleSheet) {\n root.adoptedStyleSheets = [...Array.from(root.adoptedStyleSheets), stylesheet];\n }\n }\n return stylesheet;\n}\n\nexport function styleSheetToString(stylesheet: CSSStyleSheet) {\n return stylesheet.cssRules\n ? Array.from(stylesheet.cssRules)\n .map(rule => rule.cssText || '')\n .join('\\n')\n : '';\n}\n\n/** Intercepts a property setter on an element so `callback` fires on every assignment. Does not use a MutationObserver. */\nexport function getPropertyChanges(element: HTMLElement, key: string, callback: (value: unknown) => void) {\n const proto = Object.getPrototypeOf(element);\n const descriptor = Object.getOwnPropertyDescriptor(proto, key);\n if (!descriptor) return;\n const own = Object.getOwnPropertyDescriptor(element, key);\n if (own && own.configurable === false) return;\n Object.defineProperty(element, key, {\n configurable: true,\n get: descriptor.get,\n set: (val: unknown) => {\n descriptor.set!.call(element, val);\n callback(val);\n }\n });\n\n return () => {\n if (own) {\n Object.defineProperty(element, key, own);\n return;\n }\n\n Reflect.deleteProperty(element, key);\n };\n}\n\n/* used for cases of needing to know a property update outside of lit, example a native input value prop change */\nexport function getElementUpdate(element: HTMLElement, key: string, callback: (value: unknown) => void) {\n if (element.hasAttribute(key)) {\n callback(element.getAttribute(key));\n } else if ((element as unknown as Record<string, unknown>)[key] !== undefined) {\n callback((element as unknown as Record<string, unknown>)[key]);\n }\n\n const cleanupPropertyChanges = getPropertyChanges(element, key, callback);\n const observer = getAttributeChanges(element, key, val => callback(val));\n const disconnect = observer.disconnect.bind(observer);\n\n observer.disconnect = () => {\n cleanupPropertyChanges?.();\n disconnect();\n };\n\n return observer;\n}\n\nexport function clickOutsideElementBounds(event: PointerEvent | MouseEvent, element: HTMLElement) {\n const { left, right, top, bottom } = element.getBoundingClientRect();\n return event.clientX < left || event.clientX > right || event.clientY < top || event.clientY > bottom;\n}\n\n/** parses number out of basic calc generated by the design tokens */\nexport function parseTokenNumber(value: string) {\n return parseInt(value.includes('calc') ? value.split('*')[1]!.replace('px)', '').trim() : value, 10) || 0;\n}\n\n/** true if the browser supports scoped custom element registries */\nexport const supportsScopedRegistry =\n globalThis.CustomElementRegistry && 'initialize' in CustomElementRegistry.prototype;\n\n/** defines an element with the given custom element registry */\nexport function defineElement(element: ElementDefinition, customElementRegistry: CustomElementRegistry) {\n Object.entries(element.elementDefinitions ?? {})\n .filter(([_tag, e]) => !customElementRegistry.get(e.metadata.tag))\n .forEach(([_tag, e]) => {\n defineElement(e, customElementRegistry);\n });\n\n if (!customElementRegistry.get(element.metadata.tag)) {\n customElementRegistry.define(element.metadata.tag, element);\n\n if (customElementRegistry === customElements) {\n GlobalStateService.dispatch('NVE_ELEMENT_DEFINE', {\n elementRegistry: { [element.metadata.tag]: element.metadata.version }\n });\n }\n }\n}\n\n/** defines an element with the global custom element registry */\nexport function define(element: ElementDefinition) {\n const { version } = element.metadata;\n\n // if scoped registry supported, register only the root element to global registry\n if (supportsScopedRegistry && !customElements.get(element.metadata.tag)) {\n customElements.define(element.metadata.tag, element);\n GlobalStateService.dispatch('NVE_ELEMENT_DEFINE', {\n elementRegistry: { [element.metadata.tag]: element.metadata.version }\n });\n } else {\n // if scoped registry not supported, register the element and all its children to the global registry\n defineElement(element, customElements);\n }\n\n // warn on duplicate version\n if (\n GlobalStateService.state.elementRegistry[element.metadata.tag] !== version &&\n globalThis?.location?.hostname === 'localhost'\n ) {\n void import('./audit-logs.js').then(m =>\n console.warn(m.getDuplicatePackageVersionWarning(element.metadata.tag, version))\n );\n }\n}\n\nexport function isContextMenuClick(event: MouseEvent) {\n return (event.buttons === 2 && !event.ctrlKey) || (event.buttons === 1 && event.ctrlKey);\n}\n\nexport function getFlattenedFocusableItems(element: Node, depth = 10) {\n return getFlattenedDOMTree(element, depth).filter((e: HTMLElement) => isFocusable(e)) as HTMLElement[];\n}\n\n/**\n * Preserves visual DOM ordering when using slots within Shadow DOM\n * See more information/resources on Shadow DOM linear traversal\n * https://nolanlawson.com/2021/02/13/managing-focus-in-the-shadow-dom/\n * https://www.abeautifulsite.net/posts/querying-through-shadow-roots/\n */\nexport function getFlattenedDOMTree(node: Node, depth = 10): HTMLElement[] {\n return (\n Array.from(getChildren(node)).reduce(\n (p: unknown[], n: Node) => [\n ...p,\n [n, [...Array.from(getChildren(n)).map(i => [i, getFlattenedDOMTree(i, depth)])]]\n ],\n []\n ) as unknown as HTMLElement[]\n ).flat(depth);\n}\n\nexport function validKeyNavigationCode(e: KeyboardEvent) {\n return keynavCodes.has(e.code);\n}\n\nexport enum KeynavCode {\n End = 'End',\n Home = 'Home',\n PageUp = 'PageUp',\n PageDown = 'PageDown',\n ArrowUp = 'ArrowUp',\n ArrowDown = 'ArrowDown',\n ArrowLeft = 'ArrowLeft',\n ArrowRight = 'ArrowRight'\n}\n\nconst keynavCodes: Set<string> = new Set(Object.values(KeynavCode));\n\nexport function hasInvalidDOMGrid(rows: HTMLElement[]) {\n return rows.some(row => row.children.length !== rows[0]!.children.length);\n}\n\nexport function removeEmptyTextNode(node: Node) {\n if ((node as Text)?.wholeText?.trim() === '') {\n (node as Text).remove();\n }\n}\n\nexport function scrollBarWidth() {\n const div = globalThis.document.createElement('div');\n div.style.setProperty('width', '100px');\n div.style.setProperty('height', '100px');\n div.style.setProperty('overflow', 'scroll');\n div.style.setProperty('position', 'absolute');\n div.style.setProperty('top', '-9999px');\n globalThis.document.body.appendChild(div);\n const width = div.offsetWidth - div.clientWidth;\n globalThis.document.body.removeChild(div);\n return width;\n}\n\nexport function hasScrollBar(el: HTMLElement) {\n return el.scrollHeight > el.clientHeight;\n}\n\nexport function hasHorizontalScrollBar(el: HTMLElement) {\n return el.scrollWidth > el.clientWidth;\n}\n\nexport function endOfScrollBox(element: HTMLElement, offset = 0) {\n return element.scrollTop + element.offsetHeight + offset >= element.scrollHeight;\n}\n\nexport async function openEyeDropper(): Promise<string> {\n const EyeDropperConstructor = (\n globalThis as unknown as { EyeDropper?: new () => { open: () => Promise<{ sRGBHex: string }> } }\n ).EyeDropper;\n\n if (!EyeDropperConstructor) {\n LogService.warn('EyeDropper API is unavailable');\n return '';\n }\n\n try {\n return (await new EyeDropperConstructor().open()).sRGBHex;\n } catch (e) {\n LogService.warn(`EyeDropper selection failed: ${(e as Error).message}`);\n return '';\n }\n}\n\n/**\n * provides a object with key/value of the currently applied design tokens\n */\nexport function getThemeTokens(element = globalThis.document.querySelector(':root')!) {\n // default root or provided element\n const styles = getComputedStyle(element);\n let parent: CSSStyleSheet[] = [];\n\n // check for parent iframe, same domain iframes change how the browser accesses style sheets\n try {\n parent = Array.from(globalThis.parent.document.styleSheets);\n } catch {\n // if not accessible, skip\n }\n\n return [...parent, ...Array.from(globalThis.document.styleSheets)]\n .reduce((finalArr: string[][], sheet) => {\n let rules: CSSRule[] = [];\n try {\n rules = [...sheet.cssRules];\n } catch {\n // if the style sheet is not accessible, skip\n }\n return finalArr.concat(\n rules\n .filter(rule => rule.type === 1)\n .reduce((propValArr: string[][], rule) => {\n const props = [...(rule as CSSStyleRule).style]\n .filter((p: string) => p.trim().includes('--nve'))\n .map((propName: string) => [\n propName.trim(),\n (rule as CSSStyleRule).style.getPropertyValue(propName).trim()\n ]);\n return [...propValArr, ...props];\n }, [])\n );\n }, [])\n .reduce(\n (p: Record<string, string>, token: string[]) => ({ ...p, [token[0]!]: styles.getPropertyValue(token[0]!) }),\n {}\n );\n}\n\nexport function removeEmptySlotWhitespace(slot: HTMLSlotElement) {\n if (slotContainsOnlyWhitespace(slot)) {\n slot.assignedNodes().forEach((node: Node) => node.parentNode?.removeChild(node));\n }\n}\n\nexport function slotContainsOnlyWhitespace(slot: HTMLSlotElement) {\n const hasNoElements = !slot.assignedNodes().find(i => i.nodeType !== Node.TEXT_NODE);\n const hasOnlyEmptyTextNodes = !slot\n .assignedNodes()\n .find(i => i.nodeType === Node.TEXT_NODE && (i.textContent ?? '').trim() !== '');\n return hasNoElements && hasOnlyEmptyTextNodes;\n}\n\nexport function applySlotContentStates(slot: HTMLSlotElement, element: HTMLElement & { _internals: ElementInternals }) {\n const nodes = slot.assignedNodes();\n const name = slot.name ?? 'slot';\n\n if (nodes.length) {\n element._internals.states.add(`has-${name}`);\n } else {\n element._internals.states.delete(`has-${name}`);\n }\n}\n\nexport function getDisplayValue(option?: { label?: string; value?: string }): string {\n return option?.label || option?.value || '';\n}\n\n/** determines if HTML element matches the given component tag */\nexport function matchesElementName(element: Partial<HTMLElement>, component: { metadata: { tag: string } }) {\n return element.localName === component.metadata.tag;\n}\n\nexport function createGhostElement(sourceElement: HTMLElement) {\n const ghost = globalThis.document.createElement('div');\n const { width } = sourceElement.getBoundingClientRect();\n ghost.setAttribute('nve-ghost', '');\n ghost.style.minWidth = `${width}px`;\n ghost.style.maxWidth = `${width}px`;\n ghost.style.height = '1px';\n ghost.slot = sourceElement.slot;\n return ghost;\n}\n\nexport function sameRenderRoot(element1: HTMLElement, element2: HTMLElement) {\n const root1 = element1.getRootNode();\n const root2 = element2.getRootNode();\n const sameShadowRoot = root1 instanceof ShadowRoot && root2 instanceof ShadowRoot && root1 === root2;\n const sameDocumentRoot = root1 === globalThis.document && root2 === globalThis.document;\n const sameUnattachedRoot = root1 === root2;\n return sameShadowRoot || sameDocumentRoot || sameUnattachedRoot;\n}\n\nexport function getAnchorNames(element: HTMLElement): string[] {\n return (\n element.style.anchorName\n ?.split(',')\n ?.map(name => name.trim())\n ?.filter(name => name !== 'none' && name !== '') ?? []\n );\n}\n\nexport function removeAnchorName(element: HTMLElement, name: string) {\n const anchorNames = getAnchorNames(element);\n element.style.anchorName = anchorNames.filter(i => i !== name).join(',');\n}\n\nexport function appendAnchorName(element: HTMLElement, name: string) {\n element.style.anchorName = Array.from(new Set([...getAnchorNames(element), name])).join(',');\n}\n\n/**\n * Returns true when both arrays have the same length and each index is strictly equal (`===`).\n */\nexport function sameOrderedStringArray(a: readonly string[], b: readonly string[]): boolean {\n return a.length === b.length && a.every((value, index) => value === b[index]);\n}\n\n/**\n * Returns unique non-empty strings in first-seen order (insertion order of a `Set` over the filtered list).\n */\nexport function uniqueNonEmptyStrings(values: Iterable<string | null | undefined>): string[] {\n return Array.from(\n new Set(Array.from(values).filter((value): value is string => typeof value === 'string' && value.length > 0))\n );\n}\n"],"mappings":";;;;AAQA,SAAgB,EAAY,GAAgD;CAC1E,IAAI,aAAgB,YAAY,EAAK,iBACnC,OAAO,MAAM,KAAK,EAAK,gBAAgB,QAAQ;CAC1C,IAAI,aAAgB,eAAe,EAAK,YAC7C,OAAO,MAAM,KAAK,EAAK,WAAW,QAAQ;CACrC,IAAI,aAAgB,mBAAmB,EAAK,kBAAkB;EACnE,IAAM,IAAU,EAAK,iBAAiB;EACtC,OAAO,EAAQ,SAAS,IAAU,MAAM,KAAK,EAAK,QAAQ;CAC5D,OACE,OAAO,MAAM,KAAM,EAAqB,QAAQ;AAEpD;AAEA,SAAgB,IAAa;CAE3B,OAAO,IADQ,KAAK,OAAO,gCAAgB,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC,EACpD,CAAO,SAAS,EAAE;AAC/B;AAEA,SAAgB,EAAoB,GAAsB,GAAc,GAAwC;CAC9G,EAAG,EAAQ,aAAa,CAAI,CAAC;CAC7B,IAAM,IAAW,IAAI,kBAAiB,MAAa;EACjD,EAAU,SAAQ,MAAY;GAC5B,AAAI,EAAS,kBAAkB,KAC7B,EAAI,EAAS,OAAuB,aAAa,CAAI,CAAC;EAE1D,CAAC;CACH,CAAC;CAED,OADA,EAAS,QAAQ,GAAS;EAAE,YAAY;EAAM,SAAS;CAAK,CAAC,GACtD;AACT;AAEA,SAAgB,EAAwB,GAAsB,GAAiB,GAAwC;CACrH,IAAM,IAAW,IAAI,kBAAiB,MAAa;EACjD,EAAU,SAAQ,MAAY;GAC5B,AAAI,EAAS,iBAAiB,EAAM,SAAS,EAAS,aAAa,KACjE,EAAG,CAAQ;EAEf,CAAC;CACH,CAAC;CAED,OADA,EAAS,QAAQ,GAAS;EAAE,YAAY;EAAM,SAAS;CAAK,CAAC,GACtD;AACT;AAOA,SAAgB,EAAoB,GAAmB,GAAgB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AC,CAAC,QAAQ,MAA2B,OAAO,KAAU,YAAY,EAAM,SAAS,CAAC,CAAC,CAC9G;AACF"}
1
+ {"version":3,"file":"dom.js","names":[],"sources":["../../../src/internal/utils/dom.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { GlobalStateService } from '../services/global.service.js';\nimport { LogService } from '../services/log.service.js';\nimport type { ElementDefinition } from '../types/index.js';\nimport { isFocusable } from './focus.js';\n\nexport function getChildren(node: Document | Node | HTMLElement): Element[] {\n if (node instanceof Document && node.documentElement) {\n return Array.from(node.documentElement.children); // root document children\n } else if (node instanceof HTMLElement && node.shadowRoot) {\n return Array.from(node.shadowRoot.children); // shadow root direct children\n } else if (node instanceof HTMLSlotElement && node.assignedElements) {\n const slotted = node.assignedElements(); // slotted elements\n return slotted.length ? slotted : Array.from(node.children); // slot fallback\n } else {\n return Array.from((node as HTMLElement).children); // light DOM direct children\n }\n}\n\nexport function generateId() {\n const uint32 = self.crypto.getRandomValues(new Uint32Array(1))[0]!;\n return `_${uint32.toString(16)}`;\n}\n\nexport function getAttributeChanges(element: HTMLElement, attr: string, fn: (attrValue: string | null) => void) {\n fn(element.getAttribute(attr));\n const observer = new MutationObserver(mutations => {\n mutations.forEach(mutation => {\n if (mutation.attributeName === attr) {\n fn((mutation.target as HTMLElement).getAttribute(attr));\n }\n });\n });\n observer.observe(element, { attributes: true, subtree: true });\n return observer;\n}\n\nexport function getAttributeListChanges(element: HTMLElement, attrs: string[], fn: (mutation: MutationRecord) => void) {\n const observer = new MutationObserver(mutations => {\n mutations.forEach(mutation => {\n if (mutation.attributeName && attrs.includes(mutation.attributeName)) {\n fn(mutation);\n }\n });\n });\n observer.observe(element, { attributes: true, subtree: true });\n return observer;\n}\n\n/**\n * Appends styles to the render root of a given element. This is useful for\n * styles that apply outside the scope of the element's shadow\n * root such as UA styles --webkit-* that won't work in a ::slotted selector\n */\nexport function appendRootNodeStyle(host: HTMLElement, styles: string) {\n const stylesheet = new CSSStyleSheet();\n stylesheet.replaceSync(styles);\n const root = host.getRootNode() as Document | ShadowRoot;\n if (root.adoptedStyleSheets) {\n const hasStyleSheet = root.adoptedStyleSheets\n .map(s => styleSheetToString(s))\n .find(s => s === styleSheetToString(stylesheet));\n if (!hasStyleSheet) {\n root.adoptedStyleSheets = [...Array.from(root.adoptedStyleSheets), stylesheet];\n }\n }\n return stylesheet;\n}\n\nexport function styleSheetToString(stylesheet: CSSStyleSheet) {\n return stylesheet.cssRules\n ? Array.from(stylesheet.cssRules)\n .map(rule => rule.cssText || '')\n .join('\\n')\n : '';\n}\n\n/** Intercepts a property setter on an element so `callback` fires on every assignment. Does not use a MutationObserver. */\nexport function getPropertyChanges(element: HTMLElement, key: string, callback: (value: unknown) => void) {\n const proto = Object.getPrototypeOf(element);\n const descriptor = Object.getOwnPropertyDescriptor(proto, key);\n if (!descriptor) return;\n const own = Object.getOwnPropertyDescriptor(element, key);\n if (own && own.configurable === false) return;\n Object.defineProperty(element, key, {\n configurable: true,\n get: descriptor.get,\n set: (val: unknown) => {\n descriptor.set!.call(element, val);\n callback(val);\n }\n });\n\n return () => {\n if (own) {\n Object.defineProperty(element, key, own);\n return;\n }\n\n Reflect.deleteProperty(element, key);\n };\n}\n\n/* used for cases of needing to know a property update outside of lit, example a native input value prop change */\nexport function getElementUpdate(element: HTMLElement, key: string, callback: (value: unknown) => void) {\n if (element.hasAttribute(key)) {\n callback(element.getAttribute(key));\n } else if ((element as unknown as Record<string, unknown>)[key] !== undefined) {\n callback((element as unknown as Record<string, unknown>)[key]);\n }\n\n const cleanupPropertyChanges = getPropertyChanges(element, key, callback);\n const observer = getAttributeChanges(element, key, val => callback(val));\n const disconnect = observer.disconnect.bind(observer);\n\n observer.disconnect = () => {\n cleanupPropertyChanges?.();\n disconnect();\n };\n\n return observer;\n}\n\nexport function clickOutsideElementBounds(event: PointerEvent | MouseEvent, element: HTMLElement) {\n const { left, right, top, bottom } = element.getBoundingClientRect();\n return event.clientX < left || event.clientX > right || event.clientY < top || event.clientY > bottom;\n}\n\n/** parses number out of basic calc generated by the design tokens */\nexport function parseTokenNumber(value: string) {\n return parseInt(value.includes('calc') ? value.split('*')[1]!.replace('px)', '').trim() : value, 10) || 0;\n}\n\n/** true if the browser supports scoped custom element registries */\nexport const supportsScopedRegistry =\n globalThis.CustomElementRegistry && 'initialize' in CustomElementRegistry.prototype;\n\n/** defines an element with the given custom element registry */\nexport function defineElement(element: ElementDefinition, customElementRegistry: CustomElementRegistry) {\n Object.entries(element.elementDefinitions ?? {})\n .filter(([_tag, e]) => !customElementRegistry.get(e.metadata.tag))\n .forEach(([_tag, e]) => {\n defineElement(e, customElementRegistry);\n });\n\n if (!customElementRegistry.get(element.metadata.tag)) {\n customElementRegistry.define(element.metadata.tag, element);\n\n if (customElementRegistry === customElements) {\n GlobalStateService.dispatch('NVE_ELEMENT_DEFINE', {\n elementRegistry: { [element.metadata.tag]: element.metadata.version }\n });\n }\n }\n}\n\n/** defines an element with the global custom element registry */\nexport function define(element: ElementDefinition) {\n const { version } = element.metadata;\n\n // if scoped registry supported, register only the root element to global registry\n if (supportsScopedRegistry && !customElements.get(element.metadata.tag)) {\n customElements.define(element.metadata.tag, element);\n GlobalStateService.dispatch('NVE_ELEMENT_DEFINE', {\n elementRegistry: { [element.metadata.tag]: element.metadata.version }\n });\n } else {\n // if scoped registry not supported, register the element and all its children to the global registry\n defineElement(element, customElements);\n }\n\n // warn on duplicate version\n if (\n GlobalStateService.state.elementRegistry[element.metadata.tag] !== version &&\n globalThis?.location?.hostname === 'localhost'\n ) {\n void import('./audit-logs.js').then(m =>\n console.warn(m.getDuplicatePackageVersionWarning(element.metadata.tag, version))\n );\n }\n}\n\nexport function isContextMenuClick(event: MouseEvent) {\n return (event.buttons === 2 && !event.ctrlKey) || (event.buttons === 1 && event.ctrlKey);\n}\n\nexport function getFlattenedFocusableItems(element: Node, depth = 10) {\n return getFlattenedDOMTree(element, depth).filter((e: HTMLElement) => isFocusable(e)) as HTMLElement[];\n}\n\n/**\n * Preserves visual DOM ordering when using slots within Shadow DOM\n * See more information/resources on Shadow DOM linear traversal\n * https://nolanlawson.com/2021/02/13/managing-focus-in-the-shadow-dom/\n * https://www.abeautifulsite.net/posts/querying-through-shadow-roots/\n */\nexport function getFlattenedDOMTree(node: Node, depth = 10): HTMLElement[] {\n return (\n Array.from(getChildren(node)).reduce(\n (p: unknown[], n: Node) => [\n ...p,\n [n, [...Array.from(getChildren(n)).map(i => [i, getFlattenedDOMTree(i, depth)])]]\n ],\n []\n ) as unknown as HTMLElement[]\n ).flat(depth);\n}\n\nexport function validKeyNavigationCode(e: KeyboardEvent) {\n return keynavCodes.has(e.code);\n}\n\nexport enum KeynavCode {\n End = 'End',\n Home = 'Home',\n PageUp = 'PageUp',\n PageDown = 'PageDown',\n ArrowUp = 'ArrowUp',\n ArrowDown = 'ArrowDown',\n ArrowLeft = 'ArrowLeft',\n ArrowRight = 'ArrowRight'\n}\n\nconst keynavCodes: Set<string> = new Set(Object.values(KeynavCode));\n\nexport function hasInvalidDOMGrid(rows: HTMLElement[]) {\n return rows.some(row => row.children.length !== rows[0]!.children.length);\n}\n\nexport function removeEmptyTextNode(node: Node) {\n if ((node as Text)?.wholeText?.trim() === '') {\n (node as Text).remove();\n }\n}\n\nexport function scrollBarWidth() {\n const div = globalThis.document.createElement('div');\n div.style.setProperty('width', '100px');\n div.style.setProperty('height', '100px');\n div.style.setProperty('overflow', 'scroll');\n div.style.setProperty('position', 'absolute');\n div.style.setProperty('top', '-9999px');\n globalThis.document.body.appendChild(div);\n const width = div.offsetWidth - div.clientWidth;\n globalThis.document.body.removeChild(div);\n return width;\n}\n\nexport function hasScrollBar(el: HTMLElement) {\n return el.scrollHeight > el.clientHeight;\n}\n\nexport function hasHorizontalScrollBar(el: HTMLElement) {\n return el.scrollWidth > el.clientWidth;\n}\n\nexport function endOfScrollBox(element: HTMLElement, offset = 0) {\n return element.scrollTop + element.offsetHeight + offset >= element.scrollHeight;\n}\n\nexport async function openEyeDropper(): Promise<string> {\n const EyeDropperConstructor = (\n globalThis as unknown as { EyeDropper?: new () => { open: () => Promise<{ sRGBHex: string }> } }\n ).EyeDropper;\n\n if (!EyeDropperConstructor) {\n LogService.warn('EyeDropper API is unavailable');\n return '';\n }\n\n try {\n return (await new EyeDropperConstructor().open()).sRGBHex;\n } catch (e) {\n LogService.warn(`EyeDropper selection failed: ${(e as Error).message}`);\n return '';\n }\n}\n\n/**\n * provides a object with key/value of the currently applied design tokens\n */\nexport function getThemeTokens(element = globalThis.document.querySelector(':root')!) {\n // default root or provided element\n const styles = getComputedStyle(element);\n let parent: CSSStyleSheet[] = [];\n\n // check for parent iframe, same domain iframes change how the browser accesses style sheets\n try {\n parent = Array.from(globalThis.parent.document.styleSheets);\n } catch {\n // if not accessible, skip\n }\n\n return [...parent, ...Array.from(globalThis.document.styleSheets)]\n .reduce((finalArr: string[][], sheet) => {\n let rules: CSSRule[] = [];\n try {\n rules = [...sheet.cssRules];\n } catch {\n // if the style sheet is not accessible, skip\n }\n return finalArr.concat(\n rules\n .filter(rule => rule.type === 1)\n .reduce((propValArr: string[][], rule) => {\n const props = [...(rule as CSSStyleRule).style]\n .filter((p: string) => p.trim().includes('--nve'))\n .map((propName: string) => [\n propName.trim(),\n (rule as CSSStyleRule).style.getPropertyValue(propName).trim()\n ]);\n return [...propValArr, ...props];\n }, [])\n );\n }, [])\n .reduce(\n (p: Record<string, string>, token: string[]) => ({ ...p, [token[0]!]: styles.getPropertyValue(token[0]!) }),\n {}\n );\n}\n\nexport function removeEmptySlotWhitespace(slot: HTMLSlotElement) {\n if (slotContainsOnlyWhitespace(slot)) {\n slot.assignedNodes().forEach((node: Node) => node.parentNode?.removeChild(node));\n }\n}\n\nexport function slotContainsOnlyWhitespace(slot: HTMLSlotElement) {\n const hasNoElements = !slot.assignedNodes().find(i => i.nodeType !== Node.TEXT_NODE);\n const hasOnlyEmptyTextNodes = !slot\n .assignedNodes()\n .find(i => i.nodeType === Node.TEXT_NODE && (i.textContent ?? '').trim() !== '');\n return hasNoElements && hasOnlyEmptyTextNodes;\n}\n\nexport function applySlotContentStates(slot: HTMLSlotElement, element: HTMLElement & { _internals: ElementInternals }) {\n const nodes = slot.assignedNodes();\n const name = slot.name ?? 'slot';\n\n if (nodes.length) {\n element._internals.states.add(`has-${name}`);\n } else {\n element._internals.states.delete(`has-${name}`);\n }\n}\n\nexport function getDisplayValue(option?: { label?: string; value?: string }): string {\n return option?.label || option?.value || '';\n}\n\n/** determines if HTML element matches the given component tag */\nexport function matchesElementName(element: Partial<HTMLElement>, component: { metadata: { tag: string } }) {\n return element.localName === component.metadata.tag;\n}\n\nexport function createGhostElement(sourceElement: HTMLElement) {\n const ghost = globalThis.document.createElement('div');\n const { width } = sourceElement.getBoundingClientRect();\n ghost.setAttribute('nve-ghost', '');\n ghost.style.minWidth = `${width}px`;\n ghost.style.maxWidth = `${width}px`;\n ghost.style.height = '1px';\n ghost.slot = sourceElement.slot;\n return ghost;\n}\n\nexport function sameRenderRoot(element1: HTMLElement, element2: HTMLElement) {\n const root1 = element1.getRootNode();\n const root2 = element2.getRootNode();\n const sameShadowRoot = root1 instanceof ShadowRoot && root2 instanceof ShadowRoot && root1 === root2;\n const sameDocumentRoot = root1 === globalThis.document && root2 === globalThis.document;\n const sameUnattachedRoot = root1 === root2;\n return sameShadowRoot || sameDocumentRoot || sameUnattachedRoot;\n}\n\nexport function getAnchorNames(element: HTMLElement): string[] {\n return (\n element.style.anchorName\n ?.split(',')\n ?.map(name => name.trim())\n ?.filter(name => name !== 'none' && name !== '') ?? []\n );\n}\n\nexport function removeAnchorName(element: HTMLElement, name: string) {\n const anchorNames = getAnchorNames(element);\n element.style.anchorName = anchorNames.filter(i => i !== name).join(',');\n}\n\nexport function appendAnchorName(element: HTMLElement, name: string) {\n element.style.anchorName = Array.from(new Set([...getAnchorNames(element), name])).join(',');\n}\n\n/**\n * Returns true when both arrays have the same length and each index is strictly equal (`===`).\n */\nexport function sameOrderedStringArray(a: readonly string[], b: readonly string[]): boolean {\n return a.length === b.length && a.every((value, index) => value === b[index]);\n}\n\n/**\n * Returns unique non-empty strings in first-seen order (insertion order of a `Set` over the filtered list).\n */\nexport function uniqueNonEmptyStrings(values: Iterable<string | null | undefined>): string[] {\n return Array.from(\n new Set(Array.from(values).filter((value): value is string => typeof value === 'string' && value.length > 0))\n );\n}\n"],"mappings":";;;;AAQA,SAAgB,EAAY,GAAgD;CAC1E,IAAI,aAAgB,YAAY,EAAK,iBACnC,OAAO,MAAM,KAAK,EAAK,gBAAgB,QAAQ;CAC1C,IAAI,aAAgB,eAAe,EAAK,YAC7C,OAAO,MAAM,KAAK,EAAK,WAAW,QAAQ;CACrC,IAAI,aAAgB,mBAAmB,EAAK,kBAAkB;EACnE,IAAM,IAAU,EAAK,iBAAiB;EACtC,OAAO,EAAQ,SAAS,IAAU,MAAM,KAAK,EAAK,QAAQ;CAC5D;CACE,OAAO,MAAM,KAAM,EAAqB,QAAQ;AAEpD;AAEA,SAAgB,IAAa;CAE3B,OAAO,IADQ,KAAK,OAAO,gCAAgB,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC,EACpD,CAAO,SAAS,EAAE;AAC/B;AAEA,SAAgB,EAAoB,GAAsB,GAAc,GAAwC;CAC9G,EAAG,EAAQ,aAAa,CAAI,CAAC;CAC7B,IAAM,IAAW,IAAI,kBAAiB,MAAa;EACjD,EAAU,SAAQ,MAAY;GAC5B,AAAI,EAAS,kBAAkB,KAC7B,EAAI,EAAS,OAAuB,aAAa,CAAI,CAAC;EAE1D,CAAC;CACH,CAAC;CAED,OADA,EAAS,QAAQ,GAAS;EAAE,YAAY;EAAM,SAAS;CAAK,CAAC,GACtD;AACT;AAEA,SAAgB,EAAwB,GAAsB,GAAiB,GAAwC;CACrH,IAAM,IAAW,IAAI,kBAAiB,MAAa;EACjD,EAAU,SAAQ,MAAY;GAC5B,AAAI,EAAS,iBAA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,GAA+B;CAC1F,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,GAAO,MAAU,MAAU,EAAE,EAAM;AAC9E;AAKA,SAAgB,EAAsB,GAAuD;CAC3F,OAAO,MAAM,KACX,IAAI,IAAI,MAAM,KAAK,CAAM,CAAC,CAAC,QAAQ,MAA2B,OAAO,KAAU,YAAY,EAAM,SAAS,CAAC,CAAC,CAC9G;AACF"}
@@ -4,7 +4,7 @@ function e(e) {
4
4
  [1024 ** 4, "TB"],
5
5
  [1024 ** 3, "GB"],
6
6
  [1024 ** 2, "MB"],
7
- [1024 ** 1, "KB"],
7
+ [1024, "KB"],
8
8
  [1, "B"]
9
9
  ]);
10
10
  for (let [n, r] of t.entries()) if (e >= n) return `${(e / n).toFixed(2)} ${r}`;
@@ -1 +1 @@
1
- {"version":3,"file":"strings.js","names":[],"sources":["../../../src/internal/utils/strings.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n/** formats a file size in bytes to a human readable string */\nexport function formatFileSize(size: number): string {\n const thresholds = new Map<number, string>([\n [1024 ** 4, 'TB'],\n [1024 ** 3, 'GB'],\n [1024 ** 2, 'MB'],\n [1024 ** 1, 'KB'],\n [1, 'B']\n ]);\n for (const [threshold, unit] of thresholds.entries()) {\n if (size >= threshold) {\n return `${(size / threshold).toFixed(2)} ${unit}`;\n }\n }\n return `0`;\n}\n\n/** removes leading white space for a multiline string */\nexport function shiftLeft(value: string) {\n const shift = value.replace(/^\\n|\\n$/g, '').search(/\\S|$/);\n return value\n .trim()\n .split('\\n')\n .map(line => {\n return line\n .split('')\n .filter((c, i) => i >= shift || c !== ' ')\n .join('');\n })\n .join('\\n');\n}\n\nexport let DOCS_URL = '';\n/* @ts-expect-error -- VITE_BUNDLE_CONFIG is only defined at build time */\nif (!import.meta.env.VITE_BUNDLE_CONFIG) {\n DOCS_URL = 'https://nvidia.github.io/elements';\n}\n"],"mappings":";AAIA,SAAgB,EAAe,GAAsB;CACnD,IAAM,oBAAa,IAAI,IAAoB;EACzC,CAAC,QAAQ,GAAG,IAAI;EAChB,CAAC,QAAQ,GAAG,IAAI;EAChB,CAAC,QAAQ,GAAG,IAAI;EAChB,CAAC,QAAQ,GAAG,IAAI;EAChB,CAAC,GAAG,GAAG;CACT,CAAC;CACD,KAAK,IAAM,CAAC,GAAW,MAAS,EAAW,QAAQ,GACjD,IAAI,KAAQ,GACV,OAAO,IAAI,IAAO,EAAA,CAAW,QAAQ,CAAC,EAAE,GAAG;CAG/C,OAAO;AACT;AAGA,SAAgB,EAAU,GAAe;CACvC,IAAM,IAAQ,EAAM,QAAQ,YAAY,EAAE,CAAC,CAAC,OAAO,MAAM;CACzD,OAAO,EACJ,KAAK,CAAC,CACN,MAAM,IAAI,CAAC,CACX,KAAI,MACI,EACJ,MAAM,EAAE,CAAC,CACT,QAAQ,GAAG,MAAM,KAAK,KAAS,MAAM,GAAG,CAAC,CACzC,KAAK,EAAE,CACX,CAAC,CACD,KAAK,IAAI;AACd;AAEA,IAAW,IAAW;AAGpB,IAAW"}
1
+ {"version":3,"file":"strings.js","names":[],"sources":["../../../src/internal/utils/strings.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n/** formats a file size in bytes to a human readable string */\nexport function formatFileSize(size: number): string {\n const thresholds = new Map<number, string>([\n [1024 ** 4, 'TB'],\n [1024 ** 3, 'GB'],\n [1024 ** 2, 'MB'],\n [1024 ** 1, 'KB'],\n [1, 'B']\n ]);\n for (const [threshold, unit] of thresholds.entries()) {\n if (size >= threshold) {\n return `${(size / threshold).toFixed(2)} ${unit}`;\n }\n }\n return `0`;\n}\n\n/** removes leading white space for a multiline string */\nexport function shiftLeft(value: string) {\n const shift = value.replace(/^\\n|\\n$/g, '').search(/\\S|$/);\n return value\n .trim()\n .split('\\n')\n .map(line => {\n return line\n .split('')\n .filter((c, i) => i >= shift || c !== ' ')\n .join('');\n })\n .join('\\n');\n}\n\nexport let DOCS_URL = '';\n/* @ts-expect-error -- VITE_BUNDLE_CONFIG is only defined at build time */\nif (!import.meta.env.VITE_BUNDLE_CONFIG) {\n DOCS_URL = 'https://nvidia.github.io/elements';\n}\n"],"mappings":";AAIA,SAAgB,EAAe,GAAsB;CACnD,IAAM,oBAAa,IAAI,IAAoB;EACzC,CAAC,QAAQ,GAAG,IAAI;EAChB,CAAC,QAAQ,GAAG,IAAI;EAChB,CAAC,QAAQ,GAAG,IAAI;EAChB,CAAC,MAAW,IAAI;EAChB,CAAC,GAAG,GAAG;CACT,CAAC;CACD,KAAK,IAAM,CAAC,GAAW,MAAS,EAAW,QAAQ,GACjD,IAAI,KAAQ,GACV,OAAO,IAAI,IAAO,EAAA,CAAW,QAAQ,CAAC,EAAE,GAAG;CAG/C,OAAO;AACT;AAGA,SAAgB,EAAU,GAAe;CACvC,IAAM,IAAQ,EAAM,QAAQ,YAAY,EAAE,CAAC,CAAC,OAAO,MAAM;CACzD,OAAO,EACJ,KAAK,CAAC,CACN,MAAM,IAAI,CAAC,CACX,KAAI,MACI,EACJ,MAAM,EAAE,CAAC,CACT,QAAQ,GAAG,MAAM,KAAK,KAAS,MAAM,GAAG,CAAC,CACzC,KAAK,EAAE,CACX,CAAC,CACD,KAAK,IAAI;AACd;AAEA,IAAW,IAAW;AAGpB,IAAW"}
@@ -1,6 +1,6 @@
1
1
  import { attachInternals as e } from "../internal/utils/a11y.js";
2
2
  import { colorStateStyles as t, useStyles as n } from "../internal/styles/index.js";
3
- import r from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
3
+ import r from "../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorate.js";
4
4
  import i from "./logo.js";
5
5
  import { LitElement as a, html as o } from "lit";
6
6
  import { property as s } from "lit/decorators/property.js";
@@ -12,7 +12,7 @@ var c = class extends a {
12
12
  static {
13
13
  this.metadata = {
14
14
  tag: "nve-logo",
15
- version: "2.7.2"
15
+ version: "2.8.0"
16
16
  };
17
17
  }
18
18
  render() {
@@ -1 +1 @@
1
- {"version":3,"file":"logo2.js","names":[],"sources":["../../src/logo/logo.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport type { Color, Size } from '@nvidia-elements/core/internal';\nimport { useStyles, colorStateStyles, attachInternals } from '@nvidia-elements/core/internal';\nimport styles from './logo.css?inline';\n\n/**\n * @element nve-logo\n * @description A visual indicator for a brand or application.\n * @documentation https://nvidia.github.io/elements/docs/elements/logo/\n * @since 0.10.0\n * @entrypoint \\@nvidia-elements/core/logo\n * @slot - Text, an image, or other visual content representing the brand or application.\n * @cssprop --background\n * @cssprop --gap\n * @cssprop --color\n * @cssprop --height\n * @cssprop --width\n * @cssprop --font-size\n * @cssprop --border-radius\n * @cssprop --font-weight\n * @aria https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img\n */\nexport class Logo extends LitElement {\n /**\n * Visual treatment to represent unique color of an application\n */\n @property({ type: String, reflect: true }) color: Color;\n\n /**\n * Determines size of logo\n */\n @property({ type: String, reflect: true }) size?: Size;\n\n static styles = useStyles([styles, colorStateStyles]);\n\n static readonly metadata = {\n tag: 'nve-logo',\n version: '0.0.0'\n };\n\n _internals: ElementInternals;\n\n render() {\n return html`\n <div internal-host>\n <slot></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'img';\n }\n}\n"],"mappings":";;;;;;;AA0BA,IAAa,IAAb,cAA0B,EAAW;;gBAWnB,EAAU,CAAC,GAAQ,CAAgB,CAAC;;;kBAEzB;GACzB,KAAK;GACL,SAAS;EACX;;CAIA,SAAS;EACP,OAAO,CAAI;CAKb;CAEA,oBAAoB;EAGlB,AAFA,MAAM,kBAAkB,GACxB,EAAgB,IAAI,GACpB,KAAK,WAAW,OAAO;CACzB;AACF;GA7BG,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,SAAA,KAAA,CAAA,MAKxC,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA"}
1
+ {"version":3,"file":"logo2.js","names":[],"sources":["../../src/logo/logo.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport type { Color, Size } from '@nvidia-elements/core/internal';\nimport { useStyles, colorStateStyles, attachInternals } from '@nvidia-elements/core/internal';\nimport styles from './logo.css?inline';\n\n/**\n * @element nve-logo\n * @description A visual indicator for a brand or application.\n * @documentation https://nvidia.github.io/elements/docs/elements/logo/\n * @since 0.10.0\n * @entrypoint \\@nvidia-elements/core/logo\n * @slot - Text, an image, or other visual content representing the brand or application.\n * @cssprop --background\n * @cssprop --gap\n * @cssprop --color\n * @cssprop --height\n * @cssprop --width\n * @cssprop --font-size\n * @cssprop --border-radius\n * @cssprop --font-weight\n * @aria https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img\n */\nexport class Logo extends LitElement {\n /**\n * Visual treatment to represent unique color of an application\n */\n @property({ type: String, reflect: true }) color: Color;\n\n /**\n * Determines size of logo\n */\n @property({ type: String, reflect: true }) size?: Size;\n\n static styles = useStyles([styles, colorStateStyles]);\n\n static readonly metadata = {\n tag: 'nve-logo',\n version: '0.0.0'\n };\n\n _internals: ElementInternals;\n\n render() {\n return html`\n <div internal-host>\n <slot></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'img';\n }\n}\n"],"mappings":";;;;;;;AA0BA,IAAa,IAAb,cAA0B,EAAW;;EAWnB,KAAA,SAAA,EAAU,CAAC,GAAQ,CAAgB,CAAC;;;EAEzB,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;CAIA,SAAS;EACP,OAAO,CAAI;CAKb;CAEA,oBAAoB;EAGlB,AAFA,MAAM,kBAAkB,GACxB,EAAgB,IAAI,GACpB,KAAK,WAAW,OAAO;CACzB;AACF;AA7BG,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,SAAA,KAAA,CAAA,GAKxC,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { audit as e } from "../internal/controllers/audit.controller.js";
2
2
  import { useStyles as t } from "../internal/styles/index.js";
3
- import n from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
3
+ import n from "../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorate.js";
4
4
  import r from "./menu-item.js";
5
5
  import { LitElement as i, html as a } from "lit";
6
6
  import { property as o } from "lit/decorators/property.js";
@@ -13,7 +13,7 @@ var c = class extends s(i) {
13
13
  static {
14
14
  this.metadata = {
15
15
  tag: "nve-menu-item",
16
- version: "2.7.2",
16
+ version: "2.8.0",
17
17
  parents: ["nve-menu"]
18
18
  };
19
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"menu-item2.js","names":[],"sources":["../../src/menu/menu-item.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { ButtonFormControlMixin } from '@nvidia-elements/forms/mixins';\nimport { useStyles, audit } from '@nvidia-elements/core/internal';\nimport styles from './menu-item.css?inline';\n\n/**\n * @element nve-menu-item\n * @description Represents a selectable option within a menu, providing an interactive button for navigation or actions.\n * @documentation https://nvidia.github.io/elements/docs/elements/menu/\n * @since 0.11.0\n * @entrypoint \\@nvidia-elements/core/menu\n * @slot - Label and supporting content for the menu option.\n * @slot suffix - slot for suffix icon\n * @cssprop --background\n * @cssprop --border-radius\n * @cssprop --border-background\n * @cssprop --font-size\n * @cssprop --font-weight\n * @cssprop --color\n * @cssprop --padding\n * @cssprop --gap\n * @cssprop --width\n * @cssprop --min-height\n * @cssprop --line-height\n * @cssprop --cursor\n * @cssprop --opacity\n * @cssprop --text-transform\n\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/menubar/\n */\n@audit()\nexport class MenuItem extends ButtonFormControlMixin(LitElement) {\n static styles = useStyles([styles]);\n\n /** Applies danger styling to destructive or high-risk menu actions. */\n @property({ type: String, reflect: true }) status: 'danger';\n\n static readonly metadata = {\n tag: 'nve-menu-item',\n version: '0.0.0',\n parents: ['nve-menu']\n };\n\n static elementDefinitions = {};\n\n render() {\n return html`\n <div internal-host interaction-state focus-within part=\"_internal\">\n <slot></slot>\n <slot name=\"suffix\"></slot>\n </div>\n `;\n }\n\n constructor() {\n super();\n this.type = 'button';\n }\n\n connectedCallback() {\n super.connectedCallback();\n this._internals.role = 'menuitem';\n }\n}\n"],"mappings":";;;;;;;;AAmCO,IAAA,IAAA,cAAuB,EAAuB,CAAU,CAAC,CAAC;;gBAC/C,EAAU,CAAC,CAAM,CAAC;;;kBAKP;GACzB,KAAK;GACL,SAAS;GACT,SAAS,CAAC,UAAU;EACtB;;;4BAE4B,CAAC;;CAE7B,SAAS;EACP,OAAO,CAAI;CAMb;CAEA,cAAc;EAEZ,AADA,MAAM,GACN,KAAK,OAAO;CACd;CAEA,oBAAoB;EAElB,AADA,MAAM,kBAAkB,GACxB,KAAK,WAAW,OAAO;CACzB;AACF;GA5BG,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,UAAA,KAAA,CAAA,UAL1C,EAAM,CAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"menu-item2.js","names":[],"sources":["../../src/menu/menu-item.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { ButtonFormControlMixin } from '@nvidia-elements/forms/mixins';\nimport { useStyles, audit } from '@nvidia-elements/core/internal';\nimport styles from './menu-item.css?inline';\n\n/**\n * @element nve-menu-item\n * @description Represents a selectable option within a menu, providing an interactive button for navigation or actions.\n * @documentation https://nvidia.github.io/elements/docs/elements/menu/\n * @since 0.11.0\n * @entrypoint \\@nvidia-elements/core/menu\n * @slot - Label and supporting content for the menu option.\n * @slot suffix - slot for suffix icon\n * @cssprop --background\n * @cssprop --border-radius\n * @cssprop --border-background\n * @cssprop --font-size\n * @cssprop --font-weight\n * @cssprop --color\n * @cssprop --padding\n * @cssprop --gap\n * @cssprop --width\n * @cssprop --min-height\n * @cssprop --line-height\n * @cssprop --cursor\n * @cssprop --opacity\n * @cssprop --text-transform\n\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/menubar/\n */\n@audit()\nexport class MenuItem extends ButtonFormControlMixin(LitElement) {\n static styles = useStyles([styles]);\n\n /** Applies danger styling to destructive or high-risk menu actions. */\n @property({ type: String, reflect: true }) status: 'danger';\n\n static readonly metadata = {\n tag: 'nve-menu-item',\n version: '0.0.0',\n parents: ['nve-menu']\n };\n\n static elementDefinitions = {};\n\n render() {\n return html`\n <div internal-host interaction-state focus-within part=\"_internal\">\n <slot></slot>\n <slot name=\"suffix\"></slot>\n </div>\n `;\n }\n\n constructor() {\n super();\n this.type = 'button';\n }\n\n connectedCallback() {\n super.connectedCallback();\n this._internals.role = 'menuitem';\n }\n}\n"],"mappings":";;;;;;;;AAmCO,IAAM,IAAN,cAAuB,EAAuB,CAAU,CAAC,CAAC;;EAC/C,KAAA,SAAA,EAAU,CAAC,CAAM,CAAC;;;EAKP,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;GACT,SAAS,CAAC,UAAU;EACtB;;;EAE4B,KAAA,qBAAA,CAAC;;CAE7B,SAAS;EACP,OAAO,CAAI;CAMb;CAEA,cAAc;EAEZ,AADA,MAAM,GACN,KAAK,OAAO;CACd;CAEA,oBAAoB;EAElB,AADA,MAAM,kBAAkB,GACxB,KAAK,WAAW,OAAO;CACzB;AACF;AA5BG,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,UAAA,KAAA,CAAA,GAL1C,IAAA,EAAA,CAAA,EAAM,CAAA,GAAA,CAAA"}
@@ -3,7 +3,7 @@ import { appendRootNodeStyle as t } from "../internal/utils/dom.js";
3
3
  import { keyNavigationList as n } from "../internal/controllers/keynav-list.controller.js";
4
4
  import { attachInternals as r } from "../internal/utils/a11y.js";
5
5
  import { useStyles as i } from "../internal/styles/index.js";
6
- import a from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
6
+ import a from "../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorate.js";
7
7
  import o from "./menu.js";
8
8
  import s from "./menu.global.js";
9
9
  import { LitElement as c, html as l } from "lit";
@@ -16,7 +16,7 @@ var d = class extends c {
16
16
  static {
17
17
  this.metadata = {
18
18
  tag: "nve-menu",
19
- version: "2.7.2",
19
+ version: "2.8.0",
20
20
  children: ["nve-menu-item", "nve-divider"]
21
21
  };
22
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"menu2.js","names":["#scrollRAF","#handleScroll"],"sources":["../../src/menu/menu.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { queryAssignedElements } from 'lit/decorators/query-assigned-elements.js';\nimport type { KeynavListConfig } from '@nvidia-elements/core/internal';\nimport {\n useStyles,\n attachInternals,\n keyNavigationList,\n appendRootNodeStyle,\n audit\n} from '@nvidia-elements/core/internal';\nimport type { MenuItem } from './menu-item.js';\nimport styles from './menu.css?inline';\nimport globalStyles from './menu.global.css?inline';\n\n/**\n * @element nve-menu\n * @description A menu offers a list of choices to the user, such as a set of actions or functions. Choosing an item in a menu typically opens a sub menu, or invokes a command.\n * @documentation https://nvidia.github.io/elements/docs/elements/menu/\n * @since 0.11.0\n * @entrypoint \\@nvidia-elements/core/menu\n * @slot - default slot for `nve-menu-item`\n * @cssprop --padding\n * @cssprop --gap\n * @cssprop --width\n * @cssprop --max-width\n * @cssprop --min-width\n * @cssprop --max-height\n * @event scroll - Fires when the user scrolls the menu list. Throttled to one dispatch per animation frame. `detail: { scrollTop, scrollHeight, clientHeight }`.\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/menubar/\n */\n@audit()\n@keyNavigationList<Menu>()\nexport class Menu extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-menu',\n version: '0.0.0',\n children: ['nve-menu-item', 'nve-divider']\n };\n\n static elementDefinitions = {};\n\n /** @private */\n get keynavListConfig(): KeynavListConfig {\n return {\n layout: 'vertical',\n items: this.items\n };\n }\n\n /** @private */\n declare _internals: ElementInternals;\n\n @queryAssignedElements() private items!: MenuItem[];\n\n #scrollRAF: number | null = null;\n\n #handleScroll = () => {\n if (this.#scrollRAF !== null) return;\n this.#scrollRAF = requestAnimationFrame(() => {\n this.#scrollRAF = null;\n const container = this.shadowRoot?.querySelector<HTMLElement>('[internal-host]');\n if (!container) return;\n const { scrollTop, scrollHeight, clientHeight } = container;\n this.dispatchEvent(\n new CustomEvent('scroll', {\n bubbles: true,\n composed: true,\n detail: { scrollTop, scrollHeight, clientHeight }\n })\n );\n });\n };\n\n render() {\n return html`\n <div internal-host>\n <slot></slot>\n </div>\n `;\n }\n\n async firstUpdated() {\n await this.updateComplete;\n this.shadowRoot\n ?.querySelector('[internal-host]')\n ?.addEventListener('scroll', this.#handleScroll, { passive: true });\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'menu';\n appendRootNodeStyle(this, globalStyles);\n }\n}\n"],"mappings":";;;;;;;;;;;AAmCO,IAAA,IAAA,cAAmB,EAAW;;gBACnB,EAAU,CAAC,CAAM,CAAC;;;kBAEP;GACzB,KAAK;GACL,SAAS;GACT,UAAU,CAAC,iBAAiB,aAAa;EAC3C;;;4BAE4B,CAAC;;CAG7B,IAAI,mBAAqC;EACvC,OAAO;GACL,QAAQ;GACR,OAAO,KAAK;EACd;CACF;CAOA,KAA4B;CAE5B,WAAsB;EAChB,KAAKA,OAAe,SACxB,KAAKA,KAAa,4BAA4B;GAC5C,KAAKA,KAAa;GAClB,IAAM,IAAY,KAAK,YAAY,cAA2B,iBAAiB;GAC/E,IAAI,CAAC,GAAW;GAChB,IAAM,EAAE,cAAW,iBAAc,oBAAiB;GAClD,KAAK,cACH,IAAI,YAAY,UAAU;IACxB,SAAS;IACT,UAAU;IACV,QAAQ;KAAE;KAAW;KAAc;IAAa;GAClD,CAAC,CACH;EACF,CAAC;CACH;CAEA,SAAS;EACP,OAAO,CAAI;CAKb;CAEA,MAAM,eAAe;EAEnB,AADA,MAAM,KAAK,gBACX,KAAK,YACD,cAAc,iBAAiB,CAAC,EAChC,iBAAiB,UAAU,KAAKC,IAAe,EAAE,SAAS,GAAK,CAAC;CACtE;CAEA,oBAAoB;EAIlB,AAHA,MAAM,kBAAkB,GACxB,EAAgB,IAAI,GACpB,KAAK,WAAW,OAAO,QACvB,EAAoB,MAAM,CAAY;CACxC;AACF;GA1CG,EAAsB,CAAA,GAAA,EAAA,WAAA,SAAA,KAAA,CAAA,UAxBxB,EAAM,GACN,EAAwB,CAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"menu2.js","names":[],"sources":["../../src/menu/menu.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { queryAssignedElements } from 'lit/decorators/query-assigned-elements.js';\nimport type { KeynavListConfig } from '@nvidia-elements/core/internal';\nimport {\n useStyles,\n attachInternals,\n keyNavigationList,\n appendRootNodeStyle,\n audit\n} from '@nvidia-elements/core/internal';\nimport type { MenuItem } from './menu-item.js';\nimport styles from './menu.css?inline';\nimport globalStyles from './menu.global.css?inline';\n\n/**\n * @element nve-menu\n * @description A menu offers a list of choices to the user, such as a set of actions or functions. Choosing an item in a menu typically opens a sub menu, or invokes a command.\n * @documentation https://nvidia.github.io/elements/docs/elements/menu/\n * @since 0.11.0\n * @entrypoint \\@nvidia-elements/core/menu\n * @slot - default slot for `nve-menu-item`\n * @cssprop --padding\n * @cssprop --gap\n * @cssprop --width\n * @cssprop --max-width\n * @cssprop --min-width\n * @cssprop --max-height\n * @event scroll - Fires when the user scrolls the menu list. Throttled to one dispatch per animation frame. `detail: { scrollTop, scrollHeight, clientHeight }`.\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/menubar/\n */\n@audit()\n@keyNavigationList<Menu>()\nexport class Menu extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-menu',\n version: '0.0.0',\n children: ['nve-menu-item', 'nve-divider']\n };\n\n static elementDefinitions = {};\n\n /** @private */\n get keynavListConfig(): KeynavListConfig {\n return {\n layout: 'vertical',\n items: this.items\n };\n }\n\n /** @private */\n declare _internals: ElementInternals;\n\n @queryAssignedElements() private items!: MenuItem[];\n\n #scrollRAF: number | null = null;\n\n #handleScroll = () => {\n if (this.#scrollRAF !== null) return;\n this.#scrollRAF = requestAnimationFrame(() => {\n this.#scrollRAF = null;\n const container = this.shadowRoot?.querySelector<HTMLElement>('[internal-host]');\n if (!container) return;\n const { scrollTop, scrollHeight, clientHeight } = container;\n this.dispatchEvent(\n new CustomEvent('scroll', {\n bubbles: true,\n composed: true,\n detail: { scrollTop, scrollHeight, clientHeight }\n })\n );\n });\n };\n\n render() {\n return html`\n <div internal-host>\n <slot></slot>\n </div>\n `;\n }\n\n async firstUpdated() {\n await this.updateComplete;\n this.shadowRoot\n ?.querySelector('[internal-host]')\n ?.addEventListener('scroll', this.#handleScroll, { passive: true });\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'menu';\n appendRootNodeStyle(this, globalStyles);\n }\n}\n"],"mappings":";;;;;;;;;;;AAmCO,IAAM,IAAN,cAAmB,EAAW;;EACnB,KAAA,SAAA,EAAU,CAAC,CAAM,CAAC;;;EAEP,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;GACT,UAAU,CAAC,iBAAiB,aAAa;EAC3C;;;EAE4B,KAAA,qBAAA,CAAC;;CAG7B,IAAI,mBAAqC;EACvC,OAAO;GACL,QAAQ;GACR,OAAO,KAAK;EACd;CACF;CAOA,KAA4B;CAE5B,WAAsB;EAChB,KAAK,OAAe,SACxB,KAAK,KAAa,4BAA4B;GAC5C,KAAK,KAAa;GAClB,IAAM,IAAY,KAAK,YAAY,cAA2B,iBAAiB;GAC/E,IAAI,CAAC,GAAW;GAChB,IAAM,EAAE,cAAW,iBAAc,oBAAiB;GAClD,KAAK,cACH,IAAI,YAAY,UAAU;IACxB,SAAS;IACT,UAAU;IACV,QAAQ;KAAE;KAAW;KAAc;IAAa;GAClD,CAAC,CACH;EACF,CAAC;CACH;CAEA,SAAS;EACP,OAAO,CAAI;CAKb;CAEA,MAAM,eAAe;EAEnB,AADA,MAAM,KAAK,gBACX,KAAK,YACD,cAAc,iBAAiB,CAAC,EAChC,iBAAiB,UAAU,KAAK,IAAe,EAAE,SAAS,GAAK,CAAC;CACtE;CAEA,oBAAoB;EAIlB,AAHA,MAAM,kBAAkB,GACxB,EAAgB,IAAI,GACpB,KAAK,WAAW,OAAO,QACvB,EAAoB,MAAM,CAAY;CACxC;AACF;AA1CG,EAAA,CAAA,EAAsB,CAAA,GAAA,EAAA,WAAA,SAAA,KAAA,CAAA,GAxBxB,IAAA,EAAA,CAAA,EAAM,GACN,EAAwB,CAAA,GAAA,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { scopedRegistry as e } from "../internal/decorators/scoped-registry.js";
2
2
  import { useStyles as t } from "../internal/styles/index.js";
3
- import n from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
3
+ import n from "../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorate.js";
4
4
  import { Control as r } from "../forms/control/control2.js";
5
5
  import { IconButton as i } from "../icon-button/icon-button2.js";
6
6
  import { inputStyles as a } from "../input/input2.js";
@@ -19,7 +19,7 @@ var l = class extends r {
19
19
  static {
20
20
  this.metadata = {
21
21
  tag: "nve-month",
22
- version: "2.7.2"
22
+ version: "2.8.0"
23
23
  };
24
24
  }
25
25
  static {
@@ -1 +1 @@
1
- {"version":3,"file":"month2.js","names":[],"sources":["../../src/month/month.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport type { ContainerElement } from '@nvidia-elements/core/internal';\nimport { scopedRegistry, useStyles } from '@nvidia-elements/core/internal';\nimport { Control } from '@nvidia-elements/core/forms';\nimport { inputStyles } from '@nvidia-elements/core/input';\nimport { IconButton } from '@nvidia-elements/core/icon-button';\nimport styles from './month.css?inline';\n\n/**\n * @element nve-month\n * @description A month picker is a control that enables users to choose a month value.\n * @documentation https://nvidia.github.io/elements/docs/elements/month/\n * @since 0.3.0\n * @entrypoint \\@nvidia-elements/core/month\n * @cssprop --padding\n * @cssprop --font-size\n * @cssprop --height\n * @cssprop --background\n * @cssprop --border-radius\n * @cssprop --border\n * @cssprop --cursor\n * @csspart icon-button - The calendar icon button element\n * @aria https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/month\n */\n@scopedRegistry()\nexport class Month extends Control implements ContainerElement {\n /**\n * Reduces the visual container for a minimal borderless appearance while preserving whitespace bounds.\n * Use when embedding within another container such as a toolbar.\n */\n @property({ type: String, reflect: true }) container?: 'flat';\n\n static styles = useStyles([...Control.styles, inputStyles, styles]);\n\n static readonly metadata = {\n tag: 'nve-month',\n version: '0.0.0'\n };\n\n static elementDefinitions = {\n [IconButton.metadata.tag]: IconButton\n };\n\n protected get suffixContent() {\n return html`<nve-icon-button part=\"icon-button\" .ariaLabel=${this.i18n.expand} icon-name=\"calendar\" container=\"inline\" @click=${this.showPicker}></nve-icon-button>`;\n }\n}\n"],"mappings":";;;;;;;;;;AA6BO,IAAA,IAAA,cAAoB,EAAoC;;gBAO7C,EAAU;GAAC,GAAG,EAAQ;GAAQ;GAAa;EAAM,CAAC;;;kBAEvC;GACzB,KAAK;GACL,SAAS;EACX;;;4BAE4B,GACzB,EAAW,SAAS,MAAM,EAC7B;;CAEA,IAAc,gBAAgB;EAC5B,OAAO,CAAI,mDAAkD,KAAK,KAAK,OAAO,oDAAkD,KAAK,WAAW;CAClJ;AACF;GAhBG,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,aAAA,KAAA,CAAA,UAN1C,EAAe,CAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"month2.js","names":[],"sources":["../../src/month/month.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport type { ContainerElement } from '@nvidia-elements/core/internal';\nimport { scopedRegistry, useStyles } from '@nvidia-elements/core/internal';\nimport { Control } from '@nvidia-elements/core/forms';\nimport { inputStyles } from '@nvidia-elements/core/input';\nimport { IconButton } from '@nvidia-elements/core/icon-button';\nimport styles from './month.css?inline';\n\n/**\n * @element nve-month\n * @description A month picker is a control that enables users to choose a month value.\n * @documentation https://nvidia.github.io/elements/docs/elements/month/\n * @since 0.3.0\n * @entrypoint \\@nvidia-elements/core/month\n * @cssprop --padding\n * @cssprop --font-size\n * @cssprop --height\n * @cssprop --background\n * @cssprop --border-radius\n * @cssprop --border\n * @cssprop --cursor\n * @csspart icon-button - The calendar icon button element\n * @aria https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/month\n */\n@scopedRegistry()\nexport class Month extends Control implements ContainerElement {\n /**\n * Reduces the visual container for a minimal borderless appearance while preserving whitespace bounds.\n * Use when embedding within another container such as a toolbar.\n */\n @property({ type: String, reflect: true }) container?: 'flat';\n\n static styles = useStyles([...Control.styles, inputStyles, styles]);\n\n static readonly metadata = {\n tag: 'nve-month',\n version: '0.0.0'\n };\n\n static elementDefinitions = {\n [IconButton.metadata.tag]: IconButton\n };\n\n protected get suffixContent() {\n return html`<nve-icon-button part=\"icon-button\" .ariaLabel=${this.i18n.expand} icon-name=\"calendar\" container=\"inline\" @click=${this.showPicker}></nve-icon-button>`;\n }\n}\n"],"mappings":";;;;;;;;;;AA6BO,IAAM,IAAN,cAAoB,EAAoC;;EAO7C,KAAA,SAAA,EAAU;GAAC,GAAG,EAAQ;GAAQ;GAAa;EAAM,CAAC;;;EAEvC,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;;EAE4B,KAAA,qBAAA,GACzB,EAAW,SAAS,MAAM,EAC7B;;CAEA,IAAc,gBAAgB;EAC5B,OAAO,CAAI,mDAAkD,KAAK,KAAK,OAAO,oDAAkD,KAAK,WAAW;CAClJ;AACF;AAhBG,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,aAAA,KAAA,CAAA,GAN1C,IAAA,EAAA,CAAA,EAAe,CAAA,GAAA,CAAA"}
@@ -2,7 +2,7 @@ import { audit as e } from "../internal/controllers/audit.controller.js";
2
2
  import { TypeNativePopoverController as t } from "../internal/controllers/type-native-popover.controller.js";
3
3
  import { useStyles as n } from "../internal/styles/index.js";
4
4
  import { popoverStyles as r } from "../internal/styles/popover2.js";
5
- import i from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
5
+ import i from "../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorate.js";
6
6
  import a from "./notification-group.js";
7
7
  import { LitElement as o, html as s } from "lit";
8
8
  import { property as c } from "lit/decorators/property.js";
@@ -20,7 +20,7 @@ var l = class extends o {
20
20
  static {
21
21
  this.metadata = {
22
22
  tag: "nve-notification-group",
23
- version: "2.7.2",
23
+ version: "2.8.0",
24
24
  children: ["nve-notification"]
25
25
  };
26
26
  }
@@ -1 +1 @@
1
- {"version":3,"file":"notification-group2.js","names":[],"sources":["../../src/notification/notification-group.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport type { PopoverAlign, PopoverPosition, PopoverType } from '@nvidia-elements/core/internal';\nimport { audit, popoverStyles, TypeNativePopoverController, useStyles } from '@nvidia-elements/core/internal';\nimport styles from './notification-group.css?inline';\n\n/**\n * @element nve-notification-group\n * @description Displays real time updates without interrupting the user's workflow to communicate an important message or status.\n * @documentation https://nvidia.github.io/elements/docs/elements/notification/\n * @since 0.6.0\n * @entrypoint \\@nvidia-elements/core/notification\n * @slot - default slot for `nve-notification`\n * @cssprop --box-shadow\n * @cssprop --animation-duration - Duration of notification group open/close animations\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/alertdialog/\n */\n@audit()\nexport class NotificationGroup extends LitElement {\n /**\n * (optional) By default the popover will automatically anchor itself relative to the trigger element.\n * Pass an optional custom anchor element as an idref string within the same render root or a HTMLElement DOM reference.\n */\n @property({ type: String }) anchor: string | HTMLElement = globalThis.document?.body;\n\n /**\n * Sets the position of the popover relative to the anchor element.\n */\n @property({ type: String, reflect: true }) position: PopoverPosition;\n\n /**\n * Sets the alignment of the popover relative to the anchor element.\n */\n @property({ type: String, reflect: true }) alignment: PopoverAlign;\n\n protected typeNativePopoverController = new TypeNativePopoverController<NotificationGroup>(this);\n\n static styles = useStyles([popoverStyles, styles]);\n\n /** @private */\n get popoverType(): PopoverType {\n return 'manual';\n }\n\n static readonly metadata = {\n tag: 'nve-notification-group',\n version: '0.0.0',\n children: ['nve-notification']\n };\n\n render() {\n return html`\n <div internal-host>\n <slot @slotchange=${() => this.showPopover()}></slot>\n </div>\n `;\n }\n}\n"],"mappings":";;;;;;;;;AAqBO,IAAA,IAAA,cAAgC,EAAW;;6BAKW,WAAW,UAAU,yCAYxC,IAAI,EAA+C,IAAI;;;gBAE/E,EAAU,CAAC,GAAe,CAAM,CAAC;;CAGjD,IAAI,cAA2B;EAC7B,OAAO;CACT;;kBAE2B;GACzB,KAAK;GACL,SAAS;GACT,UAAU,CAAC,kBAAkB;EAC/B;;CAEA,SAAS;EACP,OAAO,CAAI,+CAEiB,KAAK,YAAY,EAAE;CAGjD;AACF;GAlCG,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,EAAA,WAAA,UAAA,KAAA,CAAA,MAKzB,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,YAAA,KAAA,CAAA,MAKxC,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,aAAA,KAAA,CAAA,UAhB1C,EAAM,CAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"notification-group2.js","names":[],"sources":["../../src/notification/notification-group.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport type { PopoverAlign, PopoverPosition, PopoverType } from '@nvidia-elements/core/internal';\nimport { audit, popoverStyles, TypeNativePopoverController, useStyles } from '@nvidia-elements/core/internal';\nimport styles from './notification-group.css?inline';\n\n/**\n * @element nve-notification-group\n * @description Displays real time updates without interrupting the user's workflow to communicate an important message or status.\n * @documentation https://nvidia.github.io/elements/docs/elements/notification/\n * @since 0.6.0\n * @entrypoint \\@nvidia-elements/core/notification\n * @slot - default slot for `nve-notification`\n * @cssprop --box-shadow\n * @cssprop --animation-duration - Duration of notification group open/close animations\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/alertdialog/\n */\n@audit()\nexport class NotificationGroup extends LitElement {\n /**\n * (optional) By default the popover will automatically anchor itself relative to the trigger element.\n * Pass an optional custom anchor element as an idref string within the same render root or a HTMLElement DOM reference.\n */\n @property({ type: String }) anchor: string | HTMLElement = globalThis.document?.body;\n\n /**\n * Sets the position of the popover relative to the anchor element.\n */\n @property({ type: String, reflect: true }) position: PopoverPosition;\n\n /**\n * Sets the alignment of the popover relative to the anchor element.\n */\n @property({ type: String, reflect: true }) alignment: PopoverAlign;\n\n protected typeNativePopoverController = new TypeNativePopoverController<NotificationGroup>(this);\n\n static styles = useStyles([popoverStyles, styles]);\n\n /** @private */\n get popoverType(): PopoverType {\n return 'manual';\n }\n\n static readonly metadata = {\n tag: 'nve-notification-group',\n version: '0.0.0',\n children: ['nve-notification']\n };\n\n render() {\n return html`\n <div internal-host>\n <slot @slotchange=${() => this.showPopover()}></slot>\n </div>\n `;\n }\n}\n"],"mappings":";;;;;;;;;AAqBO,IAAM,IAAN,cAAgC,EAAW;;EAiBR,aAZmB,KAAA,SAAA,WAAW,UAAU,MAYxC,KAAA,8BAAA,IAAI,EAA+C,IAAI;;;EAE/E,KAAA,SAAA,EAAU,CAAC,GAAe,CAAM,CAAC;;CAGjD,IAAI,cAA2B;EAC7B,OAAO;CACT;;EAE2B,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;GACT,UAAU,CAAC,kBAAkB;EAC/B;;CAEA,SAAS;EACP,OAAO,CAAI,+CAEiB,KAAK,YAAY,EAAE;CAGjD;AACF;AAlCG,EAAA,CAAA,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,EAAA,WAAA,UAAA,KAAA,CAAA,GAKzB,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,YAAA,KAAA,CAAA,GAKxC,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,aAAA,KAAA,CAAA,GAhB1C,IAAA,EAAA,CAAA,EAAM,CAAA,GAAA,CAAA"}
@@ -5,7 +5,7 @@ import { scopedRegistry as r } from "../internal/decorators/scoped-registry.js";
5
5
  import { useStyles as i } from "../internal/styles/index.js";
6
6
  import { popoverStyles as a } from "../internal/styles/popover2.js";
7
7
  import { statusIcons as o } from "../internal/types/index.js";
8
- import s from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
8
+ import s from "../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorate.js";
9
9
  import { Icon as c } from "../icon/icon2.js";
10
10
  import { IconButton as l } from "../icon-button/icon-button2.js";
11
11
  import u from "./notification.js";
@@ -34,7 +34,7 @@ var m = class extends d {
34
34
  static {
35
35
  this.metadata = {
36
36
  tag: "nve-notification",
37
- version: "2.7.2"
37
+ version: "2.8.0"
38
38
  };
39
39
  }
40
40
  static {