@nvidia-elements/core 2.0.4 → 2.1.1

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 (436) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/_virtual/{_@oxc-project_runtime@0.133.0 → _@oxc-project_runtime@0.139.0}/helpers/esm/decorate.js +2 -2
  3. package/dist/accordion/accordion.d.ts +17 -12
  4. package/dist/accordion/accordion2.js +5 -5
  5. package/dist/accordion/accordion2.js.map +1 -1
  6. package/dist/accordion/define.d.ts +1 -1
  7. package/dist/alert/alert-group.d.ts +6 -4
  8. package/dist/alert/alert-group2.js +2 -2
  9. package/dist/alert/alert-group2.js.map +1 -1
  10. package/dist/alert/alert.d.ts +7 -6
  11. package/dist/alert/alert2.js +2 -2
  12. package/dist/alert/alert2.js.map +1 -1
  13. package/dist/alert/define.d.ts +1 -1
  14. package/dist/avatar/avatar-group.d.ts +2 -2
  15. package/dist/avatar/avatar-group2.js +1 -1
  16. package/dist/avatar/avatar.d.ts +4 -3
  17. package/dist/avatar/avatar2.js +2 -2
  18. package/dist/avatar/avatar2.js.map +1 -1
  19. package/dist/avatar/define.d.ts +1 -1
  20. package/dist/badge/badge.d.ts +8 -6
  21. package/dist/badge/badge2.js +2 -2
  22. package/dist/badge/badge2.js.map +1 -1
  23. package/dist/badge/define.d.ts +1 -1
  24. package/dist/breadcrumb/breadcrumb.d.ts +5 -4
  25. package/dist/breadcrumb/breadcrumb2.js +2 -2
  26. package/dist/breadcrumb/breadcrumb2.js.map +1 -1
  27. package/dist/breadcrumb/define.d.ts +1 -1
  28. package/dist/bundle.d.ts +136 -67
  29. package/dist/bundles/index.d.ts +152 -0
  30. package/dist/bundles/index.js +4 -4
  31. package/dist/button/button.d.ts +5 -4
  32. package/dist/button/button2.js +2 -2
  33. package/dist/button/button2.js.map +1 -1
  34. package/dist/button/define.d.ts +1 -1
  35. package/dist/button-group/button-group.d.ts +6 -4
  36. package/dist/button-group/button-group2.js +2 -2
  37. package/dist/button-group/button-group2.js.map +1 -1
  38. package/dist/button-group/define.d.ts +1 -1
  39. package/dist/card/card.d.ts +13 -9
  40. package/dist/card/card2.js +5 -5
  41. package/dist/card/card2.js.map +1 -1
  42. package/dist/card/define.d.ts +1 -1
  43. package/dist/chat-message/chat-message.d.ts +4 -3
  44. package/dist/chat-message/chat-message2.js +2 -2
  45. package/dist/chat-message/chat-message2.js.map +1 -1
  46. package/dist/chat-message/define.d.ts +1 -1
  47. package/dist/checkbox/checkbox-group.d.ts +2 -2
  48. package/dist/checkbox/checkbox-group2.js +2 -2
  49. package/dist/checkbox/checkbox.d.ts +3 -2
  50. package/dist/checkbox/checkbox2.js +2 -2
  51. package/dist/checkbox/checkbox2.js.map +1 -1
  52. package/dist/checkbox/define.d.ts +1 -1
  53. package/dist/color/color.d.ts +6 -5
  54. package/dist/color/color2.js +2 -2
  55. package/dist/color/color2.js.map +1 -1
  56. package/dist/color/define.d.ts +1 -1
  57. package/dist/combobox/combobox.d.ts +13 -11
  58. package/dist/combobox/combobox2.js +2 -2
  59. package/dist/combobox/combobox2.js.map +1 -1
  60. package/dist/combobox/define.d.ts +1 -1
  61. package/dist/copy-button/copy-button.d.ts +8 -7
  62. package/dist/copy-button/copy-button2.js +2 -2
  63. package/dist/copy-button/copy-button2.js.map +1 -1
  64. package/dist/copy-button/define.d.ts +1 -1
  65. package/dist/custom-elements-jsx.d.ts +52 -0
  66. package/dist/custom-elements-vue.d.ts +52 -0
  67. package/dist/custom-elements.json +518 -1
  68. package/dist/data.html.json +388 -349
  69. package/dist/date/date.d.ts +6 -5
  70. package/dist/date/date2.js +2 -2
  71. package/dist/date/date2.js.map +1 -1
  72. package/dist/date/define.d.ts +1 -1
  73. package/dist/datetime/datetime.d.ts +6 -5
  74. package/dist/datetime/datetime2.js +2 -2
  75. package/dist/datetime/datetime2.js.map +1 -1
  76. package/dist/datetime/define.d.ts +1 -1
  77. package/dist/dialog/define.d.ts +1 -1
  78. package/dist/dialog/dialog-footer.d.ts +3 -2
  79. package/dist/dialog/dialog-footer2.js +2 -2
  80. package/dist/dialog/dialog-footer2.js.map +1 -1
  81. package/dist/dialog/dialog-header.d.ts +3 -2
  82. package/dist/dialog/dialog-header2.js +2 -2
  83. package/dist/dialog/dialog-header2.js.map +1 -1
  84. package/dist/dialog/dialog.d.ts +7 -5
  85. package/dist/dialog/dialog2.js +2 -2
  86. package/dist/dialog/dialog2.js.map +1 -1
  87. package/dist/divider/define.d.ts +1 -1
  88. package/dist/divider/divider.d.ts +5 -3
  89. package/dist/divider/divider2.js +2 -2
  90. package/dist/divider/divider2.js.map +1 -1
  91. package/dist/dot/define.d.ts +1 -1
  92. package/dist/dot/dot.d.ts +4 -3
  93. package/dist/dot/dot2.js +2 -2
  94. package/dist/dot/dot2.js.map +1 -1
  95. package/dist/drawer/define.d.ts +1 -1
  96. package/dist/drawer/drawer-content.d.ts +2 -2
  97. package/dist/drawer/drawer-content2.js +2 -2
  98. package/dist/drawer/drawer-footer.d.ts +3 -2
  99. package/dist/drawer/drawer-footer2.js +2 -2
  100. package/dist/drawer/drawer-footer2.js.map +1 -1
  101. package/dist/drawer/drawer-header.d.ts +3 -2
  102. package/dist/drawer/drawer-header2.js +2 -2
  103. package/dist/drawer/drawer-header2.js.map +1 -1
  104. package/dist/drawer/drawer.d.ts +7 -5
  105. package/dist/drawer/drawer2.js +2 -2
  106. package/dist/drawer/drawer2.js.map +1 -1
  107. package/dist/dropdown/define.d.ts +1 -1
  108. package/dist/dropdown/dropdown-footer.d.ts +3 -2
  109. package/dist/dropdown/dropdown-footer2.js +2 -2
  110. package/dist/dropdown/dropdown-footer2.js.map +1 -1
  111. package/dist/dropdown/dropdown-header.d.ts +3 -2
  112. package/dist/dropdown/dropdown-header2.js +2 -2
  113. package/dist/dropdown/dropdown-header2.js.map +1 -1
  114. package/dist/dropdown/dropdown.d.ts +7 -5
  115. package/dist/dropdown/dropdown2.js +2 -2
  116. package/dist/dropdown/dropdown2.js.map +1 -1
  117. package/dist/dropdown-group/define.d.ts +1 -1
  118. package/dist/dropdown-group/dropdown-group.d.ts +4 -3
  119. package/dist/dropdown-group/dropdown-group.js +2 -2
  120. package/dist/dropdown-group/dropdown-group.js.map +1 -1
  121. package/dist/dropzone/define.d.ts +1 -1
  122. package/dist/dropzone/dropzone.d.ts +13 -12
  123. package/dist/dropzone/dropzone.util.d.ts +1 -1
  124. package/dist/dropzone/dropzone.util.js.map +1 -1
  125. package/dist/dropzone/dropzone2.js +2 -2
  126. package/dist/dropzone/dropzone2.js.map +1 -1
  127. package/dist/file/define.d.ts +1 -1
  128. package/dist/file/file.d.ts +3 -2
  129. package/dist/file/file2.js +1 -1
  130. package/dist/file/file2.js.map +1 -1
  131. package/dist/format-datetime/define.d.ts +1 -1
  132. package/dist/format-datetime/format-datetime.d.ts +3 -2
  133. package/dist/format-datetime/format-datetime2.js +2 -2
  134. package/dist/format-datetime/format-datetime2.js.map +1 -1
  135. package/dist/format-number/define.d.ts +1 -1
  136. package/dist/format-number/format-number.d.ts +3 -2
  137. package/dist/format-number/format-number2.js +3 -3
  138. package/dist/format-number/format-number2.js.map +1 -1
  139. package/dist/format-relative-time/define.d.ts +1 -1
  140. package/dist/format-relative-time/format-relative-time.d.ts +3 -2
  141. package/dist/format-relative-time/format-relative-time2.js +2 -2
  142. package/dist/format-relative-time/format-relative-time2.js.map +1 -1
  143. package/dist/forms/control/control.d.ts +5 -3
  144. package/dist/forms/control/control2.js +2 -2
  145. package/dist/forms/control/control2.js.map +1 -1
  146. package/dist/forms/control-group/control-group.d.ts +5 -3
  147. package/dist/forms/control-group/control-group2.js +2 -2
  148. package/dist/forms/control-group/control-group2.js.map +1 -1
  149. package/dist/forms/control-message/control-message.d.ts +5 -4
  150. package/dist/forms/control-message/control-message2.js +2 -2
  151. package/dist/forms/control-message/control-message2.js.map +1 -1
  152. package/dist/forms/define.d.ts +1 -1
  153. package/dist/forms/utils/layout.d.ts +2 -2
  154. package/dist/forms/utils/layout.js +1 -1
  155. package/dist/forms/utils/layout.js.map +1 -1
  156. package/dist/forms/utils/states.d.ts +2 -2
  157. package/dist/forms/utils/states.js +1 -1
  158. package/dist/forms/utils/states.js.map +1 -1
  159. package/dist/gauge/define.d.ts +6 -0
  160. package/dist/gauge/define.js +7 -0
  161. package/dist/gauge/define.js.map +1 -0
  162. package/dist/gauge/gauge.d.ts +53 -0
  163. package/dist/gauge/gauge.examples.js +6 -0
  164. package/dist/gauge/gauge.examples.js.map +1 -0
  165. package/dist/gauge/gauge.examples.json +147 -0
  166. package/dist/gauge/gauge.js +6 -0
  167. package/dist/gauge/gauge.js.map +1 -0
  168. package/dist/gauge/gauge2.js +106 -0
  169. package/dist/gauge/gauge2.js.map +1 -0
  170. package/dist/gauge/index.d.ts +1 -0
  171. package/dist/gauge/index.js +2 -0
  172. package/dist/grid/cell/cell.d.ts +3 -2
  173. package/dist/grid/cell/cell2.js +1 -1
  174. package/dist/grid/cell/cell2.js.map +1 -1
  175. package/dist/grid/column/column.d.ts +5 -3
  176. package/dist/grid/column/column2.js +2 -2
  177. package/dist/grid/column/column2.js.map +1 -1
  178. package/dist/grid/define.d.ts +1 -1
  179. package/dist/grid/footer/footer.d.ts +2 -2
  180. package/dist/grid/footer/footer2.js +2 -2
  181. package/dist/grid/grid.d.ts +7 -5
  182. package/dist/grid/grid2.js +2 -2
  183. package/dist/grid/grid2.js.map +1 -1
  184. package/dist/grid/header/header.d.ts +5 -3
  185. package/dist/grid/header/header2.js +2 -2
  186. package/dist/grid/header/header2.js.map +1 -1
  187. package/dist/grid/placeholder/placeholder.d.ts +2 -2
  188. package/dist/grid/placeholder/placeholder2.js +1 -1
  189. package/dist/grid/row/row.d.ts +3 -2
  190. package/dist/grid/row/row2.js +2 -2
  191. package/dist/grid/row/row2.js.map +1 -1
  192. package/dist/icon/define.d.ts +1 -1
  193. package/dist/icon/icon.d.ts +7 -5
  194. package/dist/icon/icon2.js +3 -3
  195. package/dist/icon/icon2.js.map +1 -1
  196. package/dist/icon/icons.js.map +1 -1
  197. package/dist/icon-button/define.d.ts +1 -1
  198. package/dist/icon-button/icon-button.d.ts +7 -5
  199. package/dist/icon-button/icon-button2.js +2 -2
  200. package/dist/icon-button/icon-button2.js.map +1 -1
  201. package/dist/index.d.ts +1 -1
  202. package/dist/index.js +1 -1
  203. package/dist/input/define.d.ts +1 -1
  204. package/dist/input/input-group.d.ts +3 -2
  205. package/dist/input/input-group2.js +1 -1
  206. package/dist/input/input-group2.js.map +1 -1
  207. package/dist/input/input.d.ts +4 -3
  208. package/dist/input/input2.js +2 -2
  209. package/dist/input/input2.js.map +1 -1
  210. package/dist/internal/controllers/audit.controller.d.ts +1 -1
  211. package/dist/internal/controllers/i18n.controller.d.ts +3 -3
  212. package/dist/internal/controllers/i18n.controller.js +1 -1
  213. package/dist/internal/controllers/i18n.controller.js.map +1 -1
  214. package/dist/internal/controllers/keynav-grid.controller.d.ts +1 -1
  215. package/dist/internal/controllers/keynav-grid.controller.js.map +1 -1
  216. package/dist/internal/controllers/keynav-list.controller.d.ts +1 -1
  217. package/dist/internal/controllers/keynav-list.controller.js.map +1 -1
  218. package/dist/internal/controllers/state-expanded.controller.d.ts +1 -1
  219. package/dist/internal/controllers/state-highlighted.controller.d.ts +1 -1
  220. package/dist/internal/controllers/state-scroll.controller.d.ts +1 -1
  221. package/dist/internal/controllers/state-selected.controller.d.ts +1 -1
  222. package/dist/internal/controllers/state-selected.controller.js.map +1 -1
  223. package/dist/internal/controllers/type-anchor.controller.d.ts +1 -1
  224. package/dist/internal/controllers/type-anchor.controller.js.map +1 -1
  225. package/dist/internal/controllers/type-closable.controller.d.ts +1 -1
  226. package/dist/internal/controllers/type-expandable.controller.d.ts +1 -1
  227. package/dist/internal/controllers/type-native-popover.controller.d.ts +2 -2
  228. package/dist/internal/controllers/type-native-popover.controller.js.map +1 -1
  229. package/dist/internal/controllers/type-native-popover.utils.js.map +1 -1
  230. package/dist/internal/controllers/type-selectable.controller.d.ts +1 -1
  231. package/dist/internal/controllers/type-ssr.controller.d.ts +1 -1
  232. package/dist/internal/controllers/type-ssr.controller.js.map +1 -1
  233. package/dist/internal/controllers/type-touch.controller.d.ts +2 -2
  234. package/dist/internal/controllers/type-touch.controller.js.map +1 -1
  235. package/dist/internal/decorators/host-attr.d.ts +2 -2
  236. package/dist/internal/services/global.service.d.ts +1 -1
  237. package/dist/internal/services/global.service.js +1 -1
  238. package/dist/internal/services/global.service.js.map +1 -1
  239. package/dist/internal/services/global.utils.js.map +1 -1
  240. package/dist/internal/services/i18n.service.js.map +1 -1
  241. package/dist/internal/services/transition.service.js.map +1 -1
  242. package/dist/internal/styles/index.d.ts +1 -1
  243. package/dist/internal/types/index.d.ts +3 -3
  244. package/dist/internal/utils/a11y.js.map +1 -1
  245. package/dist/internal/utils/audit-logs.js +1 -1
  246. package/dist/internal/utils/audit.js.map +1 -1
  247. package/dist/internal/utils/dom.d.ts +1 -1
  248. package/dist/internal/utils/dom.js +10 -10
  249. package/dist/internal/utils/dom.js.map +1 -1
  250. package/dist/internal/utils/focus.js.map +1 -1
  251. package/dist/internal/utils/objects.js.map +1 -1
  252. package/dist/internal/utils/strings.js +1 -1
  253. package/dist/internal/utils/strings.js.map +1 -1
  254. package/dist/logo/define.d.ts +1 -1
  255. package/dist/logo/logo.d.ts +4 -3
  256. package/dist/logo/logo2.js +2 -2
  257. package/dist/logo/logo2.js.map +1 -1
  258. package/dist/menu/define.d.ts +1 -1
  259. package/dist/menu/menu-item.d.ts +4 -3
  260. package/dist/menu/menu-item2.js +2 -2
  261. package/dist/menu/menu-item2.js.map +1 -1
  262. package/dist/menu/menu.d.ts +5 -4
  263. package/dist/menu/menu2.js +2 -2
  264. package/dist/menu/menu2.js.map +1 -1
  265. package/dist/month/define.d.ts +1 -1
  266. package/dist/month/month.d.ts +6 -5
  267. package/dist/month/month2.js +2 -2
  268. package/dist/month/month2.js.map +1 -1
  269. package/dist/notification/define.d.ts +1 -1
  270. package/dist/notification/notification-group.d.ts +5 -3
  271. package/dist/notification/notification-group2.js +2 -2
  272. package/dist/notification/notification-group2.js.map +1 -1
  273. package/dist/notification/notification.d.ts +10 -7
  274. package/dist/notification/notification2.js +2 -2
  275. package/dist/notification/notification2.js.map +1 -1
  276. package/dist/page/define.d.ts +1 -1
  277. package/dist/page/page-panel/page-panel-content.d.ts +3 -2
  278. package/dist/page/page-panel/page-panel-content2.js +1 -1
  279. package/dist/page/page-panel/page-panel-content2.js.map +1 -1
  280. package/dist/page/page-panel/page-panel-footer.d.ts +3 -2
  281. package/dist/page/page-panel/page-panel-footer2.js +2 -2
  282. package/dist/page/page-panel/page-panel-footer2.js.map +1 -1
  283. package/dist/page/page-panel/page-panel-header.d.ts +3 -2
  284. package/dist/page/page-panel/page-panel-header2.js +2 -2
  285. package/dist/page/page-panel/page-panel-header2.js.map +1 -1
  286. package/dist/page/page-panel/page-panel.d.ts +5 -4
  287. package/dist/page/page-panel/page-panel2.js +2 -2
  288. package/dist/page/page-panel/page-panel2.js.map +1 -1
  289. package/dist/page/page.d.ts +3 -2
  290. package/dist/page/page2.js +2 -2
  291. package/dist/page/page2.js.map +1 -1
  292. package/dist/page-header/define.d.ts +1 -1
  293. package/dist/page-header/page-header.d.ts +3 -2
  294. package/dist/page-header/page-header2.js +1 -1
  295. package/dist/page-header/page-header2.js.map +1 -1
  296. package/dist/page-loader/define.d.ts +1 -1
  297. package/dist/page-loader/page-loader.d.ts +6 -4
  298. package/dist/page-loader/page-loader2.js +2 -2
  299. package/dist/page-loader/page-loader2.js.map +1 -1
  300. package/dist/pagination/define.d.ts +1 -1
  301. package/dist/pagination/pagination.d.ts +9 -8
  302. package/dist/pagination/pagination2.js +2 -2
  303. package/dist/pagination/pagination2.js.map +1 -1
  304. package/dist/panel/define.d.ts +1 -1
  305. package/dist/panel/panel.d.ts +14 -10
  306. package/dist/panel/panel2.js +5 -5
  307. package/dist/panel/panel2.js.map +1 -1
  308. package/dist/password/define.d.ts +1 -1
  309. package/dist/password/password.d.ts +6 -5
  310. package/dist/password/password2.js +2 -2
  311. package/dist/password/password2.js.map +1 -1
  312. package/dist/polyfills/custom-state-set.js.map +1 -1
  313. package/dist/polyfills/index.d.ts +13 -0
  314. package/dist/preferences-input/define.d.ts +1 -1
  315. package/dist/preferences-input/preferences-input.d.ts +14 -13
  316. package/dist/preferences-input/preferences-input2.js +2 -2
  317. package/dist/preferences-input/preferences-input2.js.map +1 -1
  318. package/dist/progress-bar/define.d.ts +1 -1
  319. package/dist/progress-bar/progress-bar.d.ts +4 -3
  320. package/dist/progress-bar/progress-bar2.js +2 -2
  321. package/dist/progress-bar/progress-bar2.js.map +1 -1
  322. package/dist/progress-ring/define.d.ts +1 -1
  323. package/dist/progress-ring/progress-ring.d.ts +8 -6
  324. package/dist/progress-ring/progress-ring2.js +4 -4
  325. package/dist/progress-ring/progress-ring2.js.map +1 -1
  326. package/dist/progressive-filter-chip/define.d.ts +1 -1
  327. package/dist/progressive-filter-chip/progressive-filter-chip.d.ts +8 -7
  328. package/dist/progressive-filter-chip/progressive-filter-chip2.js +2 -2
  329. package/dist/progressive-filter-chip/progressive-filter-chip2.js.map +1 -1
  330. package/dist/pulse/define.d.ts +1 -1
  331. package/dist/pulse/pulse.d.ts +5 -4
  332. package/dist/pulse/pulse2.js +2 -2
  333. package/dist/pulse/pulse2.js.map +1 -1
  334. package/dist/radio/define.d.ts +1 -1
  335. package/dist/radio/radio-group.d.ts +2 -2
  336. package/dist/radio/radio-group2.js +2 -2
  337. package/dist/radio/radio.d.ts +3 -2
  338. package/dist/radio/radio2.js +2 -2
  339. package/dist/radio/radio2.js.map +1 -1
  340. package/dist/range/define.d.ts +1 -1
  341. package/dist/range/range.d.ts +6 -4
  342. package/dist/range/range2.js +2 -2
  343. package/dist/range/range2.js.map +1 -1
  344. package/dist/resize-handle/define.d.ts +1 -1
  345. package/dist/resize-handle/resize-handle.d.ts +7 -6
  346. package/dist/resize-handle/resize-handle2.js +2 -2
  347. package/dist/resize-handle/resize-handle2.js.map +1 -1
  348. package/dist/search/define.d.ts +1 -1
  349. package/dist/search/search.d.ts +6 -5
  350. package/dist/search/search2.js +2 -2
  351. package/dist/search/search2.js.map +1 -1
  352. package/dist/select/define.d.ts +1 -1
  353. package/dist/select/select.d.ts +12 -10
  354. package/dist/select/select2.js +2 -2
  355. package/dist/select/select2.js.map +1 -1
  356. package/dist/skeleton/define.d.ts +1 -1
  357. package/dist/skeleton/skeleton.d.ts +4 -3
  358. package/dist/skeleton/skeleton2.js +2 -2
  359. package/dist/skeleton/skeleton2.js.map +1 -1
  360. package/dist/sort-button/define.d.ts +1 -1
  361. package/dist/sort-button/sort-button.d.ts +6 -5
  362. package/dist/sort-button/sort-button2.js +2 -2
  363. package/dist/sort-button/sort-button2.js.map +1 -1
  364. package/dist/sparkline/define.d.ts +1 -1
  365. package/dist/sparkline/sparkline.d.ts +6 -4
  366. package/dist/sparkline/sparkline.utils.d.ts +1 -1
  367. package/dist/sparkline/sparkline.utils.js.map +1 -1
  368. package/dist/sparkline/sparkline2.js +2 -2
  369. package/dist/sparkline/sparkline2.js.map +1 -1
  370. package/dist/star-rating/define.d.ts +1 -1
  371. package/dist/star-rating/star-rating.d.ts +6 -5
  372. package/dist/star-rating/star-rating2.js +2 -2
  373. package/dist/star-rating/star-rating2.js.map +1 -1
  374. package/dist/steps/define.d.ts +1 -1
  375. package/dist/steps/steps.d.ts +12 -9
  376. package/dist/steps/steps2.js +3 -3
  377. package/dist/steps/steps2.js.map +1 -1
  378. package/dist/switch/define.d.ts +1 -1
  379. package/dist/switch/switch-group.d.ts +2 -2
  380. package/dist/switch/switch-group2.js +2 -2
  381. package/dist/switch/switch.d.ts +3 -2
  382. package/dist/switch/switch2.js +2 -2
  383. package/dist/switch/switch2.js.map +1 -1
  384. package/dist/tabs/define.d.ts +1 -1
  385. package/dist/tabs/tabs-group.d.ts +5 -3
  386. package/dist/tabs/tabs-group2.js +2 -2
  387. package/dist/tabs/tabs-group2.js.map +1 -1
  388. package/dist/tabs/tabs.d.ts +10 -7
  389. package/dist/tabs/tabs2.js +3 -3
  390. package/dist/tabs/tabs2.js.map +1 -1
  391. package/dist/tag/define.d.ts +1 -1
  392. package/dist/tag/tag.d.ts +7 -6
  393. package/dist/tag/tag2.js +2 -2
  394. package/dist/tag/tag2.js.map +1 -1
  395. package/dist/textarea/define.d.ts +1 -1
  396. package/dist/textarea/textarea.d.ts +3 -2
  397. package/dist/textarea/textarea2.js +1 -1
  398. package/dist/textarea/textarea2.js.map +1 -1
  399. package/dist/time/define.d.ts +1 -1
  400. package/dist/time/time.d.ts +6 -5
  401. package/dist/time/time2.js +2 -2
  402. package/dist/time/time2.js.map +1 -1
  403. package/dist/toast/define.d.ts +1 -1
  404. package/dist/toast/toast.d.ts +8 -6
  405. package/dist/toast/toast2.js +2 -2
  406. package/dist/toast/toast2.js.map +1 -1
  407. package/dist/toggletip/define.d.ts +1 -1
  408. package/dist/toggletip/toggletip-footer.d.ts +3 -2
  409. package/dist/toggletip/toggletip-footer2.js +2 -2
  410. package/dist/toggletip/toggletip-footer2.js.map +1 -1
  411. package/dist/toggletip/toggletip-header.d.ts +3 -2
  412. package/dist/toggletip/toggletip-header2.js +2 -2
  413. package/dist/toggletip/toggletip-header2.js.map +1 -1
  414. package/dist/toggletip/toggletip.d.ts +7 -5
  415. package/dist/toggletip/toggletip2.js +2 -2
  416. package/dist/toggletip/toggletip2.js.map +1 -1
  417. package/dist/toolbar/define.d.ts +1 -1
  418. package/dist/toolbar/toolbar.d.ts +6 -4
  419. package/dist/toolbar/toolbar2.js +2 -2
  420. package/dist/toolbar/toolbar2.js.map +1 -1
  421. package/dist/tooltip/define.d.ts +1 -1
  422. package/dist/tooltip/tooltip.d.ts +5 -3
  423. package/dist/tooltip/tooltip2.js +2 -2
  424. package/dist/tooltip/tooltip2.js.map +1 -1
  425. package/dist/tree/define.d.ts +1 -1
  426. package/dist/tree/tree-node.d.ts +7 -6
  427. package/dist/tree/tree-node2.js +2 -2
  428. package/dist/tree/tree-node2.js.map +1 -1
  429. package/dist/tree/tree.d.ts +6 -4
  430. package/dist/tree/tree2.js +2 -2
  431. package/dist/tree/tree2.js.map +1 -1
  432. package/dist/week/define.d.ts +1 -1
  433. package/dist/week/week.d.ts +6 -5
  434. package/dist/week/week2.js +2 -2
  435. package/dist/week/week2.js.map +1 -1
  436. package/package.json +23 -11
@@ -1 +1 @@
1
- {"version":3,"file":"type-anchor.controller.js","names":["#anchor","#slottedAnchor","#parentAnchor","#defaultSlot","#anchorSlot","#updateAnchorSlotAssignment"],"sources":["../../../src/internal/controllers/type-anchor.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 type { LegacyDecoratorTarget } from '../types/index.js';\nimport { removeEmptyTextNode } from '../utils/dom.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds anchor/link support for interactive custom elements.\n */\nexport function typeAnchor<T extends Anchor>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) => target.addInitializer!((instance: T) => new TypeAnchorController(instance));\n}\n\nexport interface Anchor extends ReactiveElement {\n disabled: boolean;\n readOnly: boolean;\n _internals: ElementInternals;\n}\n\nexport class TypeAnchorController<T extends Anchor> implements ReactiveController {\n get #anchor() {\n return this.#slottedAnchor ? this.#slottedAnchor : this.#parentAnchor;\n }\n\n get #slottedAnchor() {\n // return elements that nest in a slot\n return this.host\n .shadowRoot!.querySelector<HTMLSlotElement>('slot, slot[name=anchor]')\n ?.assignedElements()\n ?.find(e => e?.tagName === 'A');\n }\n\n get #parentAnchor() {\n return this.host.parentElement?.tagName === 'A' ? (this.host.parentElement as HTMLAnchorElement) : null;\n }\n\n get #defaultSlot() {\n return this.host.shadowRoot!.querySelector<HTMLSlotElement>('slot:not([name])');\n }\n\n get #anchorSlot() {\n return this.host.shadowRoot!.querySelector<HTMLSlotElement>('slot[name=anchor]');\n }\n\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n async hostConnected() {\n attachInternals(this.host);\n await this.host.updateComplete;\n\n this.#updateAnchorSlotAssignment();\n\n if (this.#anchor) {\n this.host.readOnly = true;\n this.host._internals?.states.add('anchor');\n } else {\n this.host._internals?.states.delete('anchor');\n }\n\n if (this.#parentAnchor) {\n this.#parentAnchor.style.textDecoration = 'none';\n this.host.style.cursor = 'pointer';\n }\n\n this.#anchor?.addEventListener('click', e => {\n if (this.host.disabled) {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n });\n }\n\n #updateAnchorSlotAssignment() {\n if (this.#anchor && this.#anchorSlot) {\n this.#anchor.slot = 'anchor';\n this.#defaultSlot?.assignedNodes().forEach(node => removeEmptyTextNode(node));\n }\n }\n}\n"],"mappings":";;;AAWA,SAAgB,IAA+C;CAC7D,QAAQ,MAAkC,EAAO,gBAAiB,MAAgB,IAAI,EAAqB,CAAQ,CAAC;AACtH;AAQA,IAAa,IAAb,MAAkF;CAChF,IAAIA,KAAU;EACZ,OAAO,KAAKC,KAAiB,KAAKA,KAAiB,KAAKC;CAC1D;CAEA,IAAID,KAAiB;EAEnB,OAAO,KAAK,KACT,WAAY,cAA+B,yBAAyB,GACnE,iBAAiB,GACjB,MAAK,MAAK,GAAG,YAAY,GAAG;CAClC;CAEA,IAAIC,KAAgB;EAClB,OAAO,KAAK,KAAK,eAAe,YAAY,MAAO,KAAK,KAAK,gBAAsC;CACrG;CAEA,IAAIC,KAAe;EACjB,OAAO,KAAK,KAAK,WAAY,cAA+B,kBAAkB;CAChF;CAEA,IAAIC,KAAc;EAChB,OAAO,KAAK,KAAK,WAAY,cAA+B,mBAAmB;CACjF;CAEA,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,IAAI;CAC9B;CAEA,MAAM,gBAAgB;EAkBpB,AAjBA,EAAgB,KAAK,IAAI,GACzB,MAAM,KAAK,KAAK,gBAEhB,KAAKC,GAA4B,GAE7B,KAAKL,MACP,KAAK,KAAK,WAAW,IACrB,KAAK,KAAK,YAAY,OAAO,IAAI,QAAQ,KAEzC,KAAK,KAAK,YAAY,OAAO,OAAO,QAAQ,GAG1C,KAAKE,OACP,KAAKA,GAAc,MAAM,iBAAiB,QAC1C,KAAK,KAAK,MAAM,SAAS,YAG3B,KAAKF,IAAS,iBAAiB,UAAS,MAAK;GAC3C,AAAI,KAAK,KAAK,aACZ,EAAE,eAAe,GACjB,EAAE,yBAAyB;EAE/B,CAAC;CACH;CAEA,KAA8B;EAC5B,AAAI,KAAKA,MAAW,KAAKI,OACvB,KAAKJ,GAAQ,OAAO,UACpB,KAAKG,IAAc,cAAc,EAAE,SAAQ,MAAQ,EAAoB,CAAI,CAAC;CAEhF;AACF"}
1
+ {"version":3,"file":"type-anchor.controller.js","names":["#anchor","#slottedAnchor","#parentAnchor","#defaultSlot","#anchorSlot","#updateAnchorSlotAssignment"],"sources":["../../../src/internal/controllers/type-anchor.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 type { LegacyDecoratorTarget } from '../types/index.js';\nimport { removeEmptyTextNode } from '../utils/dom.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds anchor/link support for interactive custom elements.\n */\nexport function typeAnchor<T extends Anchor>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) => target.addInitializer!((instance: T) => new TypeAnchorController(instance));\n}\n\nexport interface Anchor extends ReactiveElement {\n disabled: boolean;\n readOnly: boolean;\n _internals: ElementInternals;\n}\n\nexport class TypeAnchorController<T extends Anchor> implements ReactiveController {\n get #anchor() {\n return this.#slottedAnchor ? this.#slottedAnchor : this.#parentAnchor;\n }\n\n get #slottedAnchor() {\n // return elements that nest in a slot\n return this.host\n .shadowRoot!.querySelector<HTMLSlotElement>('slot, slot[name=anchor]')\n ?.assignedElements()\n ?.find(e => e?.tagName === 'A');\n }\n\n get #parentAnchor() {\n return this.host.parentElement?.tagName === 'A' ? (this.host.parentElement as HTMLAnchorElement) : null;\n }\n\n get #defaultSlot() {\n return this.host.shadowRoot!.querySelector<HTMLSlotElement>('slot:not([name])');\n }\n\n get #anchorSlot() {\n return this.host.shadowRoot!.querySelector<HTMLSlotElement>('slot[name=anchor]');\n }\n\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n async hostConnected() {\n attachInternals(this.host);\n await this.host.updateComplete;\n\n this.#updateAnchorSlotAssignment();\n\n if (this.#anchor) {\n this.host.readOnly = true;\n this.host._internals?.states.add('anchor');\n } else {\n this.host._internals?.states.delete('anchor');\n }\n\n if (this.#parentAnchor) {\n this.#parentAnchor.style.textDecoration = 'none';\n this.host.style.cursor = 'pointer';\n }\n\n this.#anchor?.addEventListener('click', e => {\n if (this.host.disabled) {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n });\n }\n\n #updateAnchorSlotAssignment() {\n if (this.#anchor && this.#anchorSlot) {\n this.#anchor.slot = 'anchor';\n this.#defaultSlot?.assignedNodes().forEach(node => removeEmptyTextNode(node));\n }\n }\n}\n"],"mappings":";;;AAWA,SAAgB,IAA+C;CAC7D,QAAQ,MAAkC,EAAO,gBAAiB,MAAgB,IAAI,EAAqB,CAAQ,CAAC;AACtH;AAQA,IAAa,IAAb,MAAkF;CAChF,IAAIA,KAAU;EACZ,OAAO,KAAKC,KAAiB,KAAKA,KAAiB,KAAKC;CAC1D;CAEA,IAAID,KAAiB;EAEnB,OAAO,KAAK,KACT,WAAY,cAA+B,yBAAyB,CAAC,EACpE,iBAAiB,CAAC,EAClB,MAAK,MAAK,GAAG,YAAY,GAAG;CAClC;CAEA,IAAIC,KAAgB;EAClB,OAAO,KAAK,KAAK,eAAe,YAAY,MAAO,KAAK,KAAK,gBAAsC;CACrG;CAEA,IAAIC,KAAe;EACjB,OAAO,KAAK,KAAK,WAAY,cAA+B,kBAAkB;CAChF;CAEA,IAAIC,KAAc;EAChB,OAAO,KAAK,KAAK,WAAY,cAA+B,mBAAmB;CACjF;CAEA,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,IAAI;CAC9B;CAEA,MAAM,gBAAgB;EAkBpB,AAjBA,EAAgB,KAAK,IAAI,GACzB,MAAM,KAAK,KAAK,gBAEhB,KAAKC,GAA4B,GAE7B,KAAKL,MACP,KAAK,KAAK,WAAW,IACrB,KAAK,KAAK,YAAY,OAAO,IAAI,QAAQ,KAEzC,KAAK,KAAK,YAAY,OAAO,OAAO,QAAQ,GAG1C,KAAKE,OACP,KAAKA,GAAc,MAAM,iBAAiB,QAC1C,KAAK,KAAK,MAAM,SAAS,YAG3B,KAAKF,IAAS,iBAAiB,UAAS,MAAK;GAC3C,AAAI,KAAK,KAAK,aACZ,EAAE,eAAe,GACjB,EAAE,yBAAyB;EAE/B,CAAC;CACH;CAEA,KAA8B;EAC5B,AAAI,KAAKA,MAAW,KAAKI,OACvB,KAAKJ,GAAQ,OAAO,UACpB,KAAKG,IAAc,cAAc,CAAC,CAAC,SAAQ,MAAQ,EAAoB,CAAI,CAAC;CAEhF;AACF"}
@@ -1,4 +1,4 @@
1
- import { ReactiveController, ReactiveElement } from 'lit';
1
+ import type { ReactiveController, ReactiveElement } from 'lit';
2
2
  export type TypeClosable = ReactiveElement & {
3
3
  closable: boolean;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { ReactiveController, ReactiveElement } from 'lit';
1
+ import type { ReactiveController, ReactiveElement } from 'lit';
2
2
  export type TypeExpandable = ReactiveElement & {
3
3
  expanded?: boolean;
4
4
  behaviorExpand?: boolean;
@@ -1,5 +1,5 @@
1
- import { ReactiveController, ReactiveElement } from 'lit';
2
- import { PopoverType } from '../types/index.js';
1
+ import type { ReactiveController, ReactiveElement } from 'lit';
2
+ import type { PopoverType } from '../types/index.js';
3
3
  export interface NativePopover extends ReactiveElement {
4
4
  anchor?: HTMLElement | string;
5
5
  closeTimeout?: number;
@@ -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,KA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AE,QAAQ,UAAU,SAAS,GAAG,GACnC;GACnB,IAAM,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":["#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;IAEzB,IAAI,IAAuC,GAAS,UAAU;IAW9D,AAVA,AAMI,MALE,KAAK,KAAK,SACH,EAAc,KAAK,IAAI,IACvB,KAAK,KAAK,UACV,EAAe,KAAK,MAAM,KAAK,KAAK,OAAO,IAE3C,WAAW,SAAS,eAIjC,EAAY,KAAK,KAAK,MAAM,EAAU,UAAsB,CAAC;GAC/D;EACF;CACF;CAEA,MAAM,gBAAgB;EACpB,EAAgB,KAAK,IAAI,GACzB,KAAK,KAAK,UAAU,KAAK,KAAK,eAAe,MAC7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AAK,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 +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,EACnD,QAAO,MAAM,GAAI,OAAO,EAAE,EAC1B,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,EAAE,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,EAAE,QAAO,MAAK,EAAE,WAAW,EAAE,QAAQ,eAAe,CAAC,EAAE;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,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,4 +1,4 @@
1
- import { ReactiveController, ReactiveElement } from 'lit';
1
+ import type { ReactiveController, ReactiveElement } from 'lit';
2
2
  export type TypeSelectable = ReactiveElement & {
3
3
  selected?: boolean;
4
4
  behaviorSelect?: boolean;
@@ -1,4 +1,4 @@
1
- import { ReactiveController, ReactiveElement, RenderOptions, TemplateResult } from 'lit';
1
+ import type { ReactiveController, ReactiveElement, RenderOptions, TemplateResult } from 'lit';
2
2
  type UnprotectedLitElement = ReactiveElement & {
3
3
  update: () => void;
4
4
  render: () => TemplateResult;
@@ -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,EAAE,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,EAAE,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":["#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,5 +1,5 @@
1
- import { ReactiveElement, ReactiveController } from 'lit';
2
- import { OffsetPoint, Point } from '../types/index.js';
1
+ import type { ReactiveElement, ReactiveController } from 'lit';
2
+ import type { OffsetPoint, Point } from '../types/index.js';
3
3
  export declare class NveTouchEvent extends Event {
4
4
  x: number;
5
5
  y: number;
@@ -1 +1 @@
1
- {"version":3,"file":"type-touch.controller.js","names":["#start","#end","#move","#startPosition","#pointerId","#getCoordinatesFromPointerEvent"],"sources":["../../../src/internal/controllers/type-touch.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveElement, ReactiveController } from 'lit';\nimport type { LegacyDecoratorTarget, OffsetPoint, Point } from '../types/index.js';\nimport { getDifference } from '../utils/objects.js';\n\nexport class NveTouchEvent extends Event {\n x: number;\n y: number;\n offsetX: number;\n offsetY: number;\n\n constructor(event: 'nve-touch-start' | 'nve-touch-move' | 'nve-touch-end', point: Point & OffsetPoint) {\n super(event);\n this.x = point.x;\n this.y = point.y;\n this.offsetX = point.offsetX;\n this.offsetY = point.offsetY;\n }\n}\n\n/**\n * @event nve-touch-start\n * @event nve-touch-move\n * @event nve-touch-end\n */\nexport function typeTouch<T extends ReactiveElement>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) => target.addInitializer!((instance: T) => new TypeTouchController(instance));\n}\n\nexport class TypeTouchController<T extends ReactiveElement> implements ReactiveController {\n #startPosition: Point;\n #pointerId: number;\n\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n this.host.addEventListener('pointerdown', this.#start);\n }\n\n hostDisconnected() {\n this.host.removeEventListener('pointerdown', this.#start);\n globalThis.document.removeEventListener('pointerup', this.#end);\n globalThis.document.removeEventListener('pointermove', this.#move);\n }\n\n #start = (e: PointerEvent) => {\n if (e.composedPath().find(el => el === this.host)) {\n this.#startPosition = { x: e.clientX, y: e.clientY };\n this.#pointerId = e.pointerId;\n this.host.setPointerCapture(this.#pointerId);\n globalThis.document.addEventListener('pointerup', this.#end);\n globalThis.document.addEventListener('pointermove', this.#move);\n this.host.dispatchEvent(new NveTouchEvent('nve-touch-start', { ...this.#startPosition, offsetX: 0, offsetY: 0 }));\n }\n };\n\n #move = (e: PointerEvent) => {\n requestAnimationFrame(() => {\n const point = this.#getCoordinatesFromPointerEvent(e);\n this.host.dispatchEvent(new NveTouchEvent('nve-touch-move', point));\n this.#startPosition = { x: e.clientX, y: e.clientY };\n });\n };\n\n #end = (e: PointerEvent) => {\n /* istanbul ignore else -- #start registers #end only after setting #startPosition. */\n if (this.#startPosition) {\n globalThis.document.removeEventListener('pointerup', this.#end, false);\n globalThis.document.removeEventListener('pointermove', this.#move, false);\n this.host.dispatchEvent(new NveTouchEvent('nve-touch-end', this.#getCoordinatesFromPointerEvent(e)));\n this.host.releasePointerCapture(this.#pointerId);\n this.#pointerId = null as unknown as number;\n }\n };\n\n #getCoordinatesFromPointerEvent(e: PointerEvent) {\n const value = {\n offsetX: getDifference(this.#startPosition.x, e.clientX),\n offsetY: getDifference(this.#startPosition.y, e.clientY),\n x: e.clientX,\n y: e.clientY\n };\n return value;\n }\n}\n"],"mappings":";;AAOA,IAAa,IAAb,cAAmC,MAAM;CAMvC,YAAY,GAA+D,GAA4B;EAKrG,AAJA,MAAM,CAAK,GACX,KAAK,IAAI,EAAM,GACf,KAAK,IAAI,EAAM,GACf,KAAK,UAAU,EAAM,SACrB,KAAK,UAAU,EAAM;CACvB;AACF;AAOA,SAAgB,IAAuD;CACrE,QAAQ,MAAkC,EAAO,gBAAiB,MAAgB,IAAI,EAAoB,CAAQ,CAAC;AACrH;AAEA,IAAa,IAAb,MAA0F;CACxF;CACA;CAEA,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,IAAI;CAC9B;CAEA,gBAAgB;EACd,KAAK,KAAK,iBAAiB,eAAe,KAAKA,EAAM;CACvD;CAEA,mBAAmB;EAGjB,AAFA,KAAK,KAAK,oBAAoB,eAAe,KAAKA,EAAM,GACxD,WAA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["#start","#end","#move","#startPosition","#pointerId","#getCoordinatesFromPointerEvent"],"sources":["../../../src/internal/controllers/type-touch.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveElement, ReactiveController } from 'lit';\nimport type { LegacyDecoratorTarget, OffsetPoint, Point } from '../types/index.js';\nimport { getDifference } from '../utils/objects.js';\n\nexport class NveTouchEvent extends Event {\n x: number;\n y: number;\n offsetX: number;\n offsetY: number;\n\n constructor(event: 'nve-touch-start' | 'nve-touch-move' | 'nve-touch-end', point: Point & OffsetPoint) {\n super(event);\n this.x = point.x;\n this.y = point.y;\n this.offsetX = point.offsetX;\n this.offsetY = point.offsetY;\n }\n}\n\n/**\n * @event nve-touch-start\n * @event nve-touch-move\n * @event nve-touch-end\n */\nexport function typeTouch<T extends ReactiveElement>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) => target.addInitializer!((instance: T) => new TypeTouchController(instance));\n}\n\nexport class TypeTouchController<T extends ReactiveElement> implements ReactiveController {\n #startPosition: Point;\n #pointerId: number;\n\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n this.host.addEventListener('pointerdown', this.#start);\n }\n\n hostDisconnected() {\n this.host.removeEventListener('pointerdown', this.#start);\n globalThis.document.removeEventListener('pointerup', this.#end);\n globalThis.document.removeEventListener('pointermove', this.#move);\n }\n\n #start = (e: PointerEvent) => {\n if (e.composedPath().find(el => el === this.host)) {\n this.#startPosition = { x: e.clientX, y: e.clientY };\n this.#pointerId = e.pointerId;\n this.host.setPointerCapture(this.#pointerId);\n globalThis.document.addEventListener('pointerup', this.#end);\n globalThis.document.addEventListener('pointermove', this.#move);\n this.host.dispatchEvent(new NveTouchEvent('nve-touch-start', { ...this.#startPosition, offsetX: 0, offsetY: 0 }));\n }\n };\n\n #move = (e: PointerEvent) => {\n requestAnimationFrame(() => {\n const point = this.#getCoordinatesFromPointerEvent(e);\n this.host.dispatchEvent(new NveTouchEvent('nve-touch-move', point));\n this.#startPosition = { x: e.clientX, y: e.clientY };\n });\n };\n\n #end = (e: PointerEvent) => {\n /* istanbul ignore else -- #start registers #end only after setting #startPosition. */\n if (this.#startPosition) {\n globalThis.document.removeEventListener('pointerup', this.#end, false);\n globalThis.document.removeEventListener('pointermove', this.#move, false);\n this.host.dispatchEvent(new NveTouchEvent('nve-touch-end', this.#getCoordinatesFromPointerEvent(e)));\n this.host.releasePointerCapture(this.#pointerId);\n this.#pointerId = null as unknown as number;\n }\n };\n\n #getCoordinatesFromPointerEvent(e: PointerEvent) {\n const value = {\n offsetX: getDifference(this.#startPosition.x, e.clientX),\n offsetY: getDifference(this.#startPosition.y, e.clientY),\n x: e.clientX,\n y: e.clientY\n };\n return value;\n }\n}\n"],"mappings":";;AAOA,IAAa,IAAb,cAAmC,MAAM;CAMvC,YAAY,GAA+D,GAA4B;EAKrG,AAJA,MAAM,CAAK,GACX,KAAK,IAAI,EAAM,GACf,KAAK,IAAI,EAAM,GACf,KAAK,UAAU,EAAM,SACrB,KAAK,UAAU,EAAM;CACvB;AACF;AAOA,SAAgB,IAAuD;CACrE,QAAQ,MAAkC,EAAO,gBAAiB,MAAgB,IAAI,EAAoB,CAAQ,CAAC;AACrH;AAEA,IAAa,IAAb,MAA0F;CACxF;CACA;CAEA,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,IAAI;CAC9B;CAEA,gBAAgB;EACd,KAAK,KAAK,iBAAiB,eAAe,KAAKA,EAAM;CACvD;CAEA,mBAAmB;EAGjB,AAFA,KAAK,KAAK,oBAAoB,eAAe,KAAKA,EAAM,GACxD,WAAW,SAAS,oBAAoB,aAAa,KAAKC,EAAI,GAC9D,WAAW,SAAS,oBAAoB,eAAe,KAAKC,EAAK;CACnE;CAEA,MAAU,MAAoB;EAC5B,AAAI,EAAE,aAAa,CAAC,CAAC,MAAK,MAAM,MAAO,KAAK,IAAI,MAC9C,KAAKC,KAAiB;GAAE,GAAG,EAAE;GAAS,GAAG,EAAE;EAAQ,GACnD,KAAKC,KAAa,EAAE,WACpB,KAAK,KAAK,kBAAkB,KAAKA,EAAU,GAC3C,WAAW,SAAS,iBAAiB,aAAa,KAAKH,EAAI,GAC3D,WAAW,SAAS,iBAAiB,eAAe,KAAKC,EAAK,GAC9D,KAAK,KAAK,cAAc,IAAI,EAAc,mBAAmB;GAAE,GAAG,KAAKC;GAAgB,SAAS;GAAG,SAAS;EAAE,CAAC,CAAC;CAEpH;CAEA,MAAS,MAAoB;EAC3B,4BAA4B;GAC1B,IAAM,IAAQ,KAAKE,GAAgC,CAAC;GAEpD,AADA,KAAK,KAAK,cAAc,IAAI,EAAc,kBAAkB,CAAK,CAAC,GAClE,KAAKF,KAAiB;IAAE,GAAG,EAAE;IAAS,GAAG,EAAE;GAAQ;EACrD,CAAC;CACH;CAEA,MAAQ,MAAoB;;EAE1B,AAAI,KAAKA,OACP,WAAW,SAAS,oBAAoB,aAAa,KAAKF,IAAM,EAAK,GACrE,WAAW,SAAS,oBAAoB,eAAe,KAAKC,IAAO,EAAK,GACxE,KAAK,KAAK,cAAc,IAAI,EAAc,iBAAiB,KAAKG,GAAgC,CAAC,CAAC,CAAC,GACnG,KAAK,KAAK,sBAAsB,KAAKD,EAAU,GAC/C,KAAKA,KAAa;CAEtB;CAEA,GAAgC,GAAiB;EAO/C,OAAO;GALL,SAAS,EAAc,KAAKD,GAAe,GAAG,EAAE,OAAO;GACvD,SAAS,EAAc,KAAKA,GAAe,GAAG,EAAE,OAAO;GACvD,GAAG,EAAE;GACL,GAAG,EAAE;EAEA;CACT;AACF"}
@@ -1,6 +1,6 @@
1
- import { PropertyDeclaration } from 'lit';
1
+ import type { PropertyDeclaration } from 'lit';
2
2
  /**
3
3
  * Enables declarative way to set host element attributes such as slots.
4
4
  * Use when needing to set host attributes but not create a public API property/attr for consumer.
5
5
  */
6
- export declare function hostAttr(options?: PropertyDeclaration): import('lit/decorators/property.js').PropertyDecorator;
6
+ export declare function hostAttr(options?: PropertyDeclaration): import("lit/decorators/property.js").PropertyDecorator;
@@ -2,7 +2,7 @@ export declare class GlobalState {
2
2
  constructor();
3
3
  get state(): {
4
4
  bundle: boolean;
5
- env: "watch" | "production" | "development";
5
+ env: 'watch' | 'production' | 'development';
6
6
  pageHost: string;
7
7
  moduleHost: string;
8
8
  versions: string[];
@@ -19,7 +19,7 @@ var a = class {
19
19
  i18nRegistry: {},
20
20
  audit: {}
21
21
  }
22
- }, globalThis.NVE_ELEMENTS.state.versions = Array.from(new Set([...globalThis.NVE_ELEMENTS.state.versions, "2.0.4"])), globalThis.NVE_ELEMENTS.state.scopedRegistry ??= {}, globalThis.NVE_ELEMENTS.state.scopedRegistry["2.0.4"] = 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.1.1"])), globalThis.NVE_ELEMENTS.state.scopedRegistry ??= {}, globalThis.NVE_ELEMENTS.state.scopedRegistry["2.1.1"] = i(), globalThis.NVE_ELEMENTS.state.versions.length > 1 && globalThis.NVE_ELEMENTS.state.env !== "production" && console.warn(e(), `\n\n${JSON.stringify(globalThis.NVE_ELEMENTS.state.versions, null, 2)}`);
23
23
  }
24
24
  get state() {
25
25
  return globalThis.NVE_ELEMENTS.state;
@@ -1 +1 @@
1
- {"version":3,"file":"global.service.js","names":[],"sources":["../../../src/internal/services/global.service.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { getDuplicatePackageGlobalVersionWarning } from '../utils/audit-logs.js';\nimport { deepMerge } from '../utils/objects.js';\nimport { getEnv, getHostDetails } from './global.utils.js';\n\nfunction createScopedRegistry(): CustomElementRegistry {\n const supported = globalThis.CustomElementRegistry && 'initialize' in CustomElementRegistry.prototype;\n return supported ? new CustomElementRegistry() : globalThis.customElements;\n}\n\nexport class GlobalState {\n constructor() {\n globalThis.NVE_ELEMENTS ??= {\n debug: (log = console.log) =>\n log(\n `%cElements\\n%c${JSON.stringify(globalThis.NVE_ELEMENTS.state, null, 2)}`,\n 'color: #69b027',\n 'color: inherit'\n ),\n state: {\n bundle: false,\n env: getEnv(),\n ...getHostDetails(),\n versions: [],\n scopedRegistry: {},\n elementRegistry: {},\n i18nRegistry: {},\n audit: {}\n }\n };\n globalThis.NVE_ELEMENTS.state.versions = Array.from(new Set([...globalThis.NVE_ELEMENTS.state.versions, '0.0.0']));\n globalThis.NVE_ELEMENTS.state.scopedRegistry ??= {}; // if older versions used, they may not have a scopedRegistry\n globalThis.NVE_ELEMENTS.state.scopedRegistry['0.0.0'] = createScopedRegistry();\n\n if (globalThis.NVE_ELEMENTS.state.versions.length > 1 && globalThis.NVE_ELEMENTS.state.env !== 'production') {\n console.warn(\n getDuplicatePackageGlobalVersionWarning(),\n `\\n\\n${JSON.stringify(globalThis.NVE_ELEMENTS.state.versions, null, 2)}`\n );\n }\n }\n\n get state() {\n return globalThis.NVE_ELEMENTS.state;\n }\n\n dispatch(type: string, state: Partial<typeof globalThis.NVE_ELEMENTS.state>) {\n globalThis.NVE_ELEMENTS.state = deepMerge(\n globalThis.NVE_ELEMENTS.state as unknown as Record<string, unknown>,\n state as unknown as Record<string, unknown>\n ) as unknown as typeof globalThis.NVE_ELEMENTS.state;\n globalThis?.document?.dispatchEvent(new CustomEvent(type, { detail: globalThis.NVE_ELEMENTS.state }));\n }\n}\n\nexport const GlobalStateService = new GlobalState();\n"],"mappings":";;;;AAOA,SAAS,IAA8C;CAErD,OADkB,WAAW,yBAAyB,gBAAgB,sBAAsB,YACzE,IAAI,sBAAsB,IAAI,WAAW;AAC9D;AAEA,IAAa,IAAb,MAAyB;CACvB,cAAc;EAuBZ,AAtBA,WAAW,iBAAiB;GAC1B,QAAQ,IAAM,QAAQ,QACpB,EACE,iBAAiB,KAAK,UAAU,WAAW,aAAa,OAAO,MAAM,CAAC,KACtE,kBACA,gBACF;GACF,OAAO;IACL,QAAQ;IACR,KAAK,EAAO;IACZ,GAAG,EAAe;IAClB,UAAU,CAAC;IACX,gBAAgB,CAAC;IACjB,iBAAiB,CAAC;IAClB,cAAc,CAAC;IACf,OAAO,CAAC;GACV;EACF,GACA,WAAW,aAAa,MAAM,WAAW,MAAM,KAAK,IAAI,IAAI,CAAC,GAAG,WAAW,aAAa,MAAM,UAAU,OAAO,CAAC,CAAC,GACjH,WAAW,aAAa,MAAM,mBAAmB,CAAC,GAClD,WAAW,aAAa,MAAM,eAAe,WAAW,EAAqB,GAEzE,WAAW,aAAa,MAAM,SAAS,SAAS,KAAK,WAAW,aAAa,MAAM,QAAQ,gBAC7F,QAAQ,KACN,EAAwC,GACxC,OAAO,KAAK,UAAU,WAAW,aAAa,MAAM,UAAU,MAAM,CAAC,GACvE;CAEJ;CAEA,IAAI,QAAQ;EACV,OAAO,WAAW,aAAa;CACjC;CAEA,SAAS,GAAc,GAAsD;EAK3E,AAJA,WAAW,aAAa,QAAQ,EAC9B,WAAW,aAAa,OACxB,CACF,GACA,YAAY,UAAU,cAAc,IAAI,YAAY,GAAM,EAAE,QAAQ,WAAW,aAAa,MAAM,CAAC,CAAC;CACtG;AACF,GAEa,IAAqB,IAAI,EAAY"}
1
+ {"version":3,"file":"global.service.js","names":[],"sources":["../../../src/internal/services/global.service.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { getDuplicatePackageGlobalVersionWarning } from '../utils/audit-logs.js';\nimport { deepMerge } from '../utils/objects.js';\nimport { getEnv, getHostDetails } from './global.utils.js';\n\nfunction createScopedRegistry(): CustomElementRegistry {\n const supported = globalThis.CustomElementRegistry && 'initialize' in CustomElementRegistry.prototype;\n return supported ? new CustomElementRegistry() : globalThis.customElements;\n}\n\nexport class GlobalState {\n constructor() {\n globalThis.NVE_ELEMENTS ??= {\n debug: (log = console.log) =>\n log(\n `%cElements\\n%c${JSON.stringify(globalThis.NVE_ELEMENTS.state, null, 2)}`,\n 'color: #69b027',\n 'color: inherit'\n ),\n state: {\n bundle: false,\n env: getEnv(),\n ...getHostDetails(),\n versions: [],\n scopedRegistry: {},\n elementRegistry: {},\n i18nRegistry: {},\n audit: {}\n }\n };\n globalThis.NVE_ELEMENTS.state.versions = Array.from(new Set([...globalThis.NVE_ELEMENTS.state.versions, '0.0.0']));\n globalThis.NVE_ELEMENTS.state.scopedRegistry ??= {}; // if older versions used, they may not have a scopedRegistry\n globalThis.NVE_ELEMENTS.state.scopedRegistry['0.0.0'] = createScopedRegistry();\n\n if (globalThis.NVE_ELEMENTS.state.versions.length > 1 && globalThis.NVE_ELEMENTS.state.env !== 'production') {\n console.warn(\n getDuplicatePackageGlobalVersionWarning(),\n `\\n\\n${JSON.stringify(globalThis.NVE_ELEMENTS.state.versions, null, 2)}`\n );\n }\n }\n\n get state() {\n return globalThis.NVE_ELEMENTS.state;\n }\n\n dispatch(type: string, state: Partial<typeof globalThis.NVE_ELEMENTS.state>) {\n globalThis.NVE_ELEMENTS.state = deepMerge(\n globalThis.NVE_ELEMENTS.state as unknown as Record<string, unknown>,\n state as unknown as Record<string, unknown>\n ) as unknown as typeof globalThis.NVE_ELEMENTS.state;\n globalThis?.document?.dispatchEvent(new CustomEvent(type, { detail: globalThis.NVE_ELEMENTS.state }));\n }\n}\n\nexport const GlobalStateService = new GlobalState();\n"],"mappings":";;;;AAOA,SAAS,IAA8C;CAErD,OADkB,WAAW,yBAAyB,gBAAgB,sBAAsB,YACzE,IAAI,sBAAsB,IAAI,WAAW;AAC9D;AAEA,IAAa,IAAb,MAAyB;CACvB,cAAc;EAuBZ,AAtBA,WAAW,iBAAiB;GAC1B,QAAQ,IAAM,QAAQ,QACpB,EACE,iBAAiB,KAAK,UAAU,WAAW,aAAa,OAAO,MAAM,CAAC,KACtE,kBACA,gBACF;GACF,OAAO;IACL,QAAQ;IACR,KAAK,EAAO;IACZ,GAAG,EAAe;IAClB,UAAU,CAAC;IACX,gBAAgB,CAAC;IACjB,iBAAiB,CAAC;IAClB,cAAc,CAAC;IACf,OAAO,CAAC;GACV;EACF,GACA,WAAW,aAAa,MAAM,WAAW,MAAM,qBAAK,IAAI,IAAI,CAAC,GAAG,WAAW,aAAa,MAAM,UAAU,OAAO,CAAC,CAAC,GACjH,WAAW,aAAa,MAAM,mBAAmB,CAAC,GAClD,WAAW,aAAa,MAAM,eAAe,WAAW,EAAqB,GAEzE,WAAW,aAAa,MAAM,SAAS,SAAS,KAAK,WAAW,aAAa,MAAM,QAAQ,gBAC7F,QAAQ,KACN,EAAwC,GACxC,OAAO,KAAK,UAAU,WAAW,aAAa,MAAM,UAAU,MAAM,CAAC,GACvE;CAEJ;CAEA,IAAI,QAAQ;EACV,OAAO,WAAW,aAAa;CACjC;CAEA,SAAS,GAAc,GAAsD;EAK3E,AAJA,WAAW,aAAa,QAAQ,EAC9B,WAAW,aAAa,OACxB,CACF,GACA,YAAY,UAAU,cAAc,IAAI,YAAY,GAAM,EAAE,QAAQ,WAAW,aAAa,MAAM,CAAC,CAAC;CACtG;AACF,GAEa,IAAqB,IAAI,EAAY"}
@@ -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,EAAE;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,OAAO,KAAK,GAAG,CAAC,CAAC;CAK5C;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.service.js","names":[],"sources":["../../../src/internal/services/i18n.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\nexport interface I18nStrings {\n close: string;\n copy: string;\n copied: string;\n expand: string;\n select: string;\n selected: string;\n sort: string;\n show: string;\n hide: string;\n loading: string;\n previous: string;\n next: string;\n start: string;\n end: string;\n currentPage: string;\n noResults: string;\n status: string;\n information: string;\n warning: string;\n success: string;\n danger: string;\n trend: string;\n down: string;\n up: string;\n neutral: string;\n of: string;\n theme: string;\n scale: string;\n reducedMotion: string;\n colorScheme: string;\n resize: string;\n or: string;\n files: string;\n dragAndDrop: string;\n browseFiles: string;\n maxFileSize: string;\n create: string;\n}\n\nconst i18nRegistry = {\n close: 'close',\n copy: 'copy',\n copied: 'copied',\n expand: 'expand',\n select: 'select',\n selected: 'selected',\n sort: 'sort',\n show: 'show',\n hide: 'hide',\n loading: 'loading',\n previous: 'previous',\n next: 'next',\n start: 'start',\n end: 'end',\n currentPage: 'current page',\n noResults: 'no results',\n status: 'status',\n information: 'information',\n warning: 'warning',\n success: 'success',\n danger: 'danger',\n trend: 'trend',\n down: 'down',\n up: 'up',\n neutral: 'neutral',\n of: 'of',\n theme: 'theme',\n scale: 'scale',\n reducedMotion: 'reduced motion',\n colorScheme: 'color scheme',\n resize: 'resize',\n or: 'or',\n files: 'files',\n dragAndDrop: 'drag & drop',\n browseFiles: 'browse files',\n maxFileSize: 'max file size',\n create: 'create'\n};\n\nexport class I18nService_ {\n get i18n(): Partial<I18nStrings> {\n return { ...GlobalStateService.state.i18nRegistry };\n }\n\n constructor() {\n if (Object.keys(GlobalStateService.state.i18nRegistry).length === 0) {\n GlobalStateService.dispatch('NVE_ELEMENTS_I18N_UPDATE', { i18nRegistry });\n }\n }\n\n update(registry: Partial<typeof globalThis.NVE_ELEMENTS.state.i18nRegistry>) {\n GlobalStateService.dispatch('NVE_ELEMENTS_I18N_UPDATE', { i18nRegistry: registry } as Partial<\n typeof globalThis.NVE_ELEMENTS.state\n >);\n }\n}\n\nexport const I18nService = new I18nService_();\n"],"mappings":";;AA6CA,IAAM,IAAe;CACnB,OAAO;CACP,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,UAAU;CACV,MAAM;CACN,MAAM;CACN,MAAM;CACN,SAAS;CACT,UAAU;CACV,MAAM;CACN,OAAO;CACP,KAAK;CACL,aAAa;CACb,WAAW;CACX,QAAQ;CACR,aAAa;CACb,SAAS;CACT,SAAS;CACT,QAAQ;CACR,OAAO;CACP,MAAM;CACN,IAAI;CACJ,SAAS;CACT,IAAI;CACJ,OAAO;CACP,OAAO;CACP,eAAe;CACf,aAAa;CACb,QAAQ;CACR,IAAI;CACJ,OAAO;CACP,aAAa;CACb,aAAa;CACb,aAAa;CACb,QAAQ;AACV,GAEa,IAAb,MAA0B;CACxB,IAAI,OAA6B;EAC/B,OAAO,EAAE,GAAG,EAAmB,MAAM,aAAa;CACpD;CAEA,cAAc;EACZ,AAAI,OAAO,KAAK,EAAmB,MAAM,YAAY,EAAE,WAAW,KAChE,EAAmB,SAAS,4BAA4B,EAAE,gBAAa,CAAC;CAE5E;CAEA,OAAO,GAAsE;EAC3E,EAAmB,SAAS,4BAA4B,EAAE,cAAc,EAAS,CAEhF;CACH;AACF,GAEa,IAAc,IAAI,EAAa"}
1
+ {"version":3,"file":"i18n.service.js","names":[],"sources":["../../../src/internal/services/i18n.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\nexport interface I18nStrings {\n close: string;\n copy: string;\n copied: string;\n expand: string;\n select: string;\n selected: string;\n sort: string;\n show: string;\n hide: string;\n loading: string;\n previous: string;\n next: string;\n start: string;\n end: string;\n currentPage: string;\n noResults: string;\n status: string;\n information: string;\n warning: string;\n success: string;\n danger: string;\n trend: string;\n down: string;\n up: string;\n neutral: string;\n of: string;\n theme: string;\n scale: string;\n reducedMotion: string;\n colorScheme: string;\n resize: string;\n or: string;\n files: string;\n dragAndDrop: string;\n browseFiles: string;\n maxFileSize: string;\n create: string;\n}\n\nconst i18nRegistry = {\n close: 'close',\n copy: 'copy',\n copied: 'copied',\n expand: 'expand',\n select: 'select',\n selected: 'selected',\n sort: 'sort',\n show: 'show',\n hide: 'hide',\n loading: 'loading',\n previous: 'previous',\n next: 'next',\n start: 'start',\n end: 'end',\n currentPage: 'current page',\n noResults: 'no results',\n status: 'status',\n information: 'information',\n warning: 'warning',\n success: 'success',\n danger: 'danger',\n trend: 'trend',\n down: 'down',\n up: 'up',\n neutral: 'neutral',\n of: 'of',\n theme: 'theme',\n scale: 'scale',\n reducedMotion: 'reduced motion',\n colorScheme: 'color scheme',\n resize: 'resize',\n or: 'or',\n files: 'files',\n dragAndDrop: 'drag & drop',\n browseFiles: 'browse files',\n maxFileSize: 'max file size',\n create: 'create'\n};\n\nexport class I18nService_ {\n get i18n(): Partial<I18nStrings> {\n return { ...GlobalStateService.state.i18nRegistry };\n }\n\n constructor() {\n if (Object.keys(GlobalStateService.state.i18nRegistry).length === 0) {\n GlobalStateService.dispatch('NVE_ELEMENTS_I18N_UPDATE', { i18nRegistry });\n }\n }\n\n update(registry: Partial<typeof globalThis.NVE_ELEMENTS.state.i18nRegistry>) {\n GlobalStateService.dispatch('NVE_ELEMENTS_I18N_UPDATE', { i18nRegistry: registry } as Partial<\n typeof globalThis.NVE_ELEMENTS.state\n >);\n }\n}\n\nexport const I18nService = new I18nService_();\n"],"mappings":";;AA6CA,IAAM,IAAe;CACnB,OAAO;CACP,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,UAAU;CACV,MAAM;CACN,MAAM;CACN,MAAM;CACN,SAAS;CACT,UAAU;CACV,MAAM;CACN,OAAO;CACP,KAAK;CACL,aAAa;CACb,WAAW;CACX,QAAQ;CACR,aAAa;CACb,SAAS;CACT,SAAS;CACT,QAAQ;CACR,OAAO;CACP,MAAM;CACN,IAAI;CACJ,SAAS;CACT,IAAI;CACJ,OAAO;CACP,OAAO;CACP,eAAe;CACf,aAAa;CACb,QAAQ;CACR,IAAI;CACJ,OAAO;CACP,aAAa;CACb,aAAa;CACb,aAAa;CACb,QAAQ;AACV,GAEa,IAAb,MAA0B;CACxB,IAAI,OAA6B;EAC/B,OAAO,EAAE,GAAG,EAAmB,MAAM,aAAa;CACpD;CAEA,cAAc;EACZ,AAAI,OAAO,KAAK,EAAmB,MAAM,YAAY,CAAC,CAAC,WAAW,KAChE,EAAmB,SAAS,4BAA4B,EAAE,gBAAa,CAAC;CAE5E;CAEA,OAAO,GAAsE;EAC3E,EAAmB,SAAS,4BAA4B,EAAE,cAAc,EAAS,CAEhF;CACH;AACF,GAEa,IAAc,IAAI,EAAa"}
@@ -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,GAAG,OAAO;CACtE;AACF,EASwD"}
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,4 +1,4 @@
1
1
  export declare const colorStateStyles: string;
2
2
  export declare const statusStateStyles: string;
3
3
  export declare const supportStateStyles: string;
4
- export declare function useStyles(styles: unknown[]): import('lit').CSSResult[];
4
+ export declare function useStyles(styles: unknown[]): import("lit").CSSResult[];
@@ -1,6 +1,6 @@
1
- import { TemplateResult } from 'lit';
2
- import { IconName } from '../../icon';
3
- import { I18nStrings } from '../services/i18n.service.js';
1
+ import type { TemplateResult } from 'lit';
2
+ import type { IconName } from '@nvidia-elements/core/icon';
3
+ import type { I18nStrings } from '../services/i18n.service.js';
4
4
  export type Color = 'red-cardinal' | 'gray-slate' | 'gray-denim' | 'blue-indigo' | 'blue-cobalt' | 'blue-sky' | 'teal-cyan' | 'green-mint' | 'teal-seafoam' | 'green-grass' | 'yellow-amber' | 'orange-pumpkin' | 'red-tomato' | 'pink-magenta' | 'purple-plum' | 'purple-violet' | 'purple-lavender' | 'pink-rose' | 'green-jade' | 'lime-pear' | 'yellow-nova' | 'brand-green';
5
5
  /** Controls the visual scale of an element to match its importance and available space.
6
6
  * - `sm` - Compact size for dense layouts or secondary elements with less visual prominence.
@@ -1 +1 @@
1
- {"version":3,"file":"a11y.js","names":[],"sources":["../../../src/internal/utils/a11y.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { generateId } from './dom.js';\n\nexport function attachInternals(element: HTMLElement & { _internals?: ElementInternals }) {\n if (element._internals === undefined) {\n element._internals = element.attachInternals() as unknown as ElementInternals;\n }\n}\n\nexport function associateLabel(label: HTMLLabelElement, input: HTMLInputElement) {\n if (label && input) {\n input.id = input.id ? input.id : generateId();\n label.htmlFor = input.id;\n }\n}\n\nexport function associateAriaLabel(label: HTMLElement, element: HTMLElement) {\n if (label && element) {\n label.id = label.id ? label.id : generateId();\n element.setAttribute('aria-labelledby', label.id);\n }\n}\n\nexport function associateAriaDescribedBy(messages: HTMLElement[], element: HTMLElement) {\n if (messages.length && element) {\n const ids = messages.map(m => (m.id = generateId())).join(' ');\n element.setAttribute('aria-describedby', ids);\n }\n}\n\nexport function associateDataList(datalist: HTMLDataListElement, element: HTMLInputElement) {\n if (datalist) {\n datalist.id = datalist.id?.length ? datalist.id : generateId();\n element.setAttribute('list', datalist.id);\n }\n}\n\nexport function associateControlGroup(elements: HTMLInputElement[]) {\n if (!elements.find(e => e?.name?.length)) {\n const name = generateId();\n elements.forEach(e => (e.name = name));\n }\n}\n"],"mappings":";;AAKA,SAAgB,EAAgB,GAA0D;CACxF,AAAI,EAAQ,eAAe,KAAA,MACzB,EAAQ,aAAa,EAAQ,gBAAgB;AAEjD;AAEA,SAAgB,EAAe,GAAyB,GAAyB;CAC/E,AAAI,KAAS,MACX,EAAM,KAAK,EAAM,KAAK,EAAM,KAAK,EAAW,GAC5C,EAAM,UAAU,EAAM;AAE1B;AAEA,SAAgB,EAAmB,GAAoB,GAAsB;CAC3E,AAAI,KAAS,MACX,EAAM,KAAK,EAAM,KAAK,EAAM,KAAK,EAAW,GAC5C,EAAQ,aAAa,mBAAmB,EAAM,EAAE;AAEpD;AAEA,SAAgB,EAAyB,GAAyB,GAAsB;CACtF,IAAI,EAAS,UAAU,GAAS;EAC9B,IAAM,IAAM,EAAS,KAAI,MAAM,EAAE,KAAK,EAAW,CAAE,EAAE,KAAK,GAAG;EAC7D,EAAQ,aAAa,oBAAoB,CAAG;CAC9C;AACF;AAEA,SAAgB,EAAkB,GAA+B,GAA2B;CAC1F,AAAI,MACF,EAAS,KAAK,EAAS,IAAI,SAAS,EAAS,KAAK,EAAW,GAC7D,EAAQ,aAAa,QAAQ,EAAS,EAAE;AAE5C;AAEA,SAAgB,EAAsB,GAA8B;CAClE,IAAI,CAAC,EAAS,MAAK,MAAK,GAAG,MAAM,MAAM,GAAG;EACxC,IAAM,IAAO,EAAW;EACxB,EAAS,SAAQ,MAAM,EAAE,OAAO,CAAK;CACvC;AACF"}
1
+ {"version":3,"file":"a11y.js","names":[],"sources":["../../../src/internal/utils/a11y.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { generateId } from './dom.js';\n\nexport function attachInternals(element: HTMLElement & { _internals?: ElementInternals }) {\n if (element._internals === undefined) {\n element._internals = element.attachInternals() as unknown as ElementInternals;\n }\n}\n\nexport function associateLabel(label: HTMLLabelElement, input: HTMLInputElement) {\n if (label && input) {\n input.id = input.id ? input.id : generateId();\n label.htmlFor = input.id;\n }\n}\n\nexport function associateAriaLabel(label: HTMLElement, element: HTMLElement) {\n if (label && element) {\n label.id = label.id ? label.id : generateId();\n element.setAttribute('aria-labelledby', label.id);\n }\n}\n\nexport function associateAriaDescribedBy(messages: HTMLElement[], element: HTMLElement) {\n if (messages.length && element) {\n const ids = messages.map(m => (m.id = generateId())).join(' ');\n element.setAttribute('aria-describedby', ids);\n }\n}\n\nexport function associateDataList(datalist: HTMLDataListElement, element: HTMLInputElement) {\n if (datalist) {\n datalist.id = datalist.id?.length ? datalist.id : generateId();\n element.setAttribute('list', datalist.id);\n }\n}\n\nexport function associateControlGroup(elements: HTMLInputElement[]) {\n if (!elements.find(e => e?.name?.length)) {\n const name = generateId();\n elements.forEach(e => (e.name = name));\n }\n}\n"],"mappings":";;AAKA,SAAgB,EAAgB,GAA0D;CACxF,AAAI,EAAQ,eAAe,KAAA,MACzB,EAAQ,aAAa,EAAQ,gBAAgB;AAEjD;AAEA,SAAgB,EAAe,GAAyB,GAAyB;CAC/E,AAAI,KAAS,MACX,EAAM,KAAK,EAAM,KAAK,EAAM,KAAK,EAAW,GAC5C,EAAM,UAAU,EAAM;AAE1B;AAEA,SAAgB,EAAmB,GAAoB,GAAsB;CAC3E,AAAI,KAAS,MACX,EAAM,KAAK,EAAM,KAAK,EAAM,KAAK,EAAW,GAC5C,EAAQ,aAAa,mBAAmB,EAAM,EAAE;AAEpD;AAEA,SAAgB,EAAyB,GAAyB,GAAsB;CACtF,IAAI,EAAS,UAAU,GAAS;EAC9B,IAAM,IAAM,EAAS,KAAI,MAAM,EAAE,KAAK,EAAW,CAAE,CAAC,CAAC,KAAK,GAAG;EAC7D,EAAQ,aAAa,oBAAoB,CAAG;CAC9C;AACF;AAEA,SAAgB,EAAkB,GAA+B,GAA2B;CAC1F,AAAI,MACF,EAAS,KAAK,EAAS,IAAI,SAAS,EAAS,KAAK,EAAW,GAC7D,EAAQ,aAAa,QAAQ,EAAS,EAAE;AAE5C;AAEA,SAAgB,EAAsB,GAA8B;CAClE,IAAI,CAAC,EAAS,MAAK,MAAK,GAAG,MAAM,MAAM,GAAG;EACxC,IAAM,IAAO,EAAW;EACxB,EAAS,SAAQ,MAAM,EAAE,OAAO,CAAK;CACvC;AACF"}
@@ -23,6 +23,6 @@ function c() {
23
23
  return `@nve: Multiple versions of Elements loaded, please check for duplicate package versions. ${t}#duplicate-package-version`;
24
24
  }
25
25
  //#endregion
26
- export { c as getDuplicatePackageGlobalVersionWarning, s as getDuplicatePackageVersionWarning, n as getExcessiveInstanceLimitWarning, a as getIdMatchNotFoundWarning, i as getInvalidParentWarning, r as getInvalidSlottedChildrenWarning, o as getSSRMismatchWarning };
26
+ export { t as DOCS_LOG_URL, c as getDuplicatePackageGlobalVersionWarning, s as getDuplicatePackageVersionWarning, n as getExcessiveInstanceLimitWarning, a as getIdMatchNotFoundWarning, i as getInvalidParentWarning, r as getInvalidSlottedChildrenWarning, o as getSSRMismatchWarning };
27
27
 
28
28
  //# sourceMappingURL=audit-logs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"audit.js","names":[],"sources":["../../../src/internal/utils/audit.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport function auditSlots(\n host: HTMLElement & { constructor: { metadata?: { children?: string[]; disallowedChildren?: string[] } } }\n): [Element[], string[]] {\n const validElements = ['template', ...(host.constructor.metadata?.children ?? [])].filter(c => typeof c === 'string');\n const invalidElements = Array.from(host.shadowRoot!.querySelectorAll('slot')).flatMap(slot =>\n slot.assignedElements().filter(e => !validElements.map(i => i).includes(e.localName))\n );\n return [invalidElements, validElements];\n}\n\nexport function auditParentElement(\n host: HTMLElement & { constructor: { metadata?: { parents?: string[] } } }\n): [boolean, string[]] {\n const validParentTags = host.constructor.metadata?.parents ?? [];\n return validParentTags.length\n ? [!!validParentTags.find(p => host.parentElement?.localName === p), validParentTags]\n : [true, []];\n}\n"],"mappings":";AAGA,SAAgB,EACd,GACuB;CACvB,IAAM,IAAgB,CAAC,YAAY,GAAI,EAAK,YAAY,UAAU,YAAY,CAAC,CAAE,EAAE,QAAO,MAAK,OAAO,KAAM,QAAQ;CAIpH,OAAO,CAHiB,MAAM,KAAK,EAAK,WAAY,iBAAiB,MAAM,CAAC,EAAE,SAAQ,MACpF,EAAK,iBAAiB,EAAE,QAAO,MAAK,CAAC,EAAc,KAAI,MAAK,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAE9E,GAAiB,CAAa;AACxC;AAEA,SAAgB,EACd,GACqB;CACrB,IAAM,IAAkB,EAAK,YAAY,UAAU,WAAW,CAAC;CAC/D,OAAO,EAAgB,SACnB,CAAC,CAAC,CAAC,EAAgB,MAAK,MAAK,EAAK,eAAe,cAAc,CAAC,GAAG,CAAe,IAClF,CAAC,IAAM,CAAC,CAAC;AACf"}
1
+ {"version":3,"file":"audit.js","names":[],"sources":["../../../src/internal/utils/audit.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport function auditSlots(\n host: HTMLElement & { constructor: { metadata?: { children?: string[]; disallowedChildren?: string[] } } }\n): [Element[], string[]] {\n const validElements = ['template', ...(host.constructor.metadata?.children ?? [])].filter(c => typeof c === 'string');\n const invalidElements = Array.from(host.shadowRoot!.querySelectorAll('slot')).flatMap(slot =>\n slot.assignedElements().filter(e => !validElements.map(i => i).includes(e.localName))\n );\n return [invalidElements, validElements];\n}\n\nexport function auditParentElement(\n host: HTMLElement & { constructor: { metadata?: { parents?: string[] } } }\n): [boolean, string[]] {\n const validParentTags = host.constructor.metadata?.parents ?? [];\n return validParentTags.length\n ? [!!validParentTags.find(p => host.parentElement?.localName === p), validParentTags]\n : [true, []];\n}\n"],"mappings":";AAGA,SAAgB,EACd,GACuB;CACvB,IAAM,IAAgB,CAAC,YAAY,GAAI,EAAK,YAAY,UAAU,YAAY,CAAC,CAAE,CAAC,CAAC,QAAO,MAAK,OAAO,KAAM,QAAQ;CAIpH,OAAO,CAHiB,MAAM,KAAK,EAAK,WAAY,iBAAiB,MAAM,CAAC,CAAC,CAAC,SAAQ,MACpF,EAAK,iBAAiB,CAAC,CAAC,QAAO,MAAK,CAAC,EAAc,KAAI,MAAK,CAAC,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,CAE9E,GAAiB,CAAa;AACxC;AAEA,SAAgB,EACd,GACqB;CACrB,IAAM,IAAkB,EAAK,YAAY,UAAU,WAAW,CAAC;CAC/D,OAAO,EAAgB,SACnB,CAAC,CAAC,CAAC,EAAgB,MAAK,MAAK,EAAK,eAAe,cAAc,CAAC,GAAG,CAAe,IAClF,CAAC,IAAM,CAAC,CAAC;AACf"}
@@ -1,4 +1,4 @@
1
- import { ElementDefinition } from '../types/index.js';
1
+ import type { ElementDefinition } from '../types/index.js';
2
2
  export declare function getChildren(node: Document | Node | HTMLElement): Element[];
3
3
  export declare function generateId(): string;
4
4
  export declare function getAttributeChanges(element: HTMLElement, attr: string, fn: (attrValue: string | null) => void): MutationObserver;
@@ -11,7 +11,7 @@ function r(e) {
11
11
  } else return Array.from(e.children);
12
12
  }
13
13
  function i() {
14
- return `_${self.crypto.getRandomValues(new Uint32Array(1))[0].toString(16)}`;
14
+ return `_${self.crypto.getRandomValues(/* @__PURE__ */ new Uint32Array(1))[0].toString(16)}`;
15
15
  }
16
16
  function a(e, t, n) {
17
17
  n(e.getAttribute(t));
@@ -46,18 +46,18 @@ function c(e) {
46
46
  return e.cssRules ? Array.from(e.cssRules).map((e) => e.cssText || "").join("\n") : "";
47
47
  }
48
48
  function l(e, t, n) {
49
- let r = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e), t);
50
- if (!r) return;
51
- let i = Object.getOwnPropertyDescriptor(e, t);
52
- if (!(i && i.configurable === !1)) return Object.defineProperty(e, t, {
49
+ let r = Object.getPrototypeOf(e), i = Object.getOwnPropertyDescriptor(r, t);
50
+ if (!i) return;
51
+ let a = Object.getOwnPropertyDescriptor(e, t);
52
+ if (!(a && a.configurable === !1)) return Object.defineProperty(e, t, {
53
53
  configurable: !0,
54
- get: r.get,
54
+ get: i.get,
55
55
  set: (t) => {
56
- r.set.call(e, t), n(t);
56
+ i.set.call(e, t), n(t);
57
57
  }
58
58
  }), () => {
59
- if (i) {
60
- Object.defineProperty(e, t, i);
59
+ if (a) {
60
+ Object.defineProperty(e, t, a);
61
61
  return;
62
62
  }
63
63
  Reflect.deleteProperty(e, t);
@@ -184,7 +184,7 @@ function R(e, t) {
184
184
  e.style.anchorName = n.filter((e) => e !== t).join(",");
185
185
  }
186
186
  function z(e, t) {
187
- e.style.anchorName = Array.from(new Set([...L(e), t])).join(",");
187
+ e.style.anchorName = Array.from(/* @__PURE__ */ new Set([...L(e), t])).join(",");
188
188
  }
189
189
  function B(e, t) {
190
190
  return e.length === t.length && e.every((e, n) => e === t[n]);
@@ -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,IA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,aAAiB,cAAc,aAAiB,cAAc,MAAU,GACzF,IAAmB,MAAU,WAAW,YAAY,MAAU,WAAW;CAE/E,OAAO,KAAkB,KADE,MAAU;AAEvC;AAEA,SAAgB,EAAe,GAAgC;CAC7D,OACE,EAAQ,MAAM,YACV,MAAM,GAAG,GACT,KAAI,MAAQ,EAAK,KAAK,CAAC,GACvB,QAAO,MAAQ,MAAS,UAAU,MAAS,EAAE,KAAK,CAAC;AAE3D;AAEA,SAAgB,EAAiB,GAAsB,GAAc;CACnE,IAAM,IAAc,EAAe,CAAO;CAC1C,EAAQ,MAAM,aAAa,EAAY,QAAO,MAAK,MAAM,CAAI,EAAE,KAAK,GAAG;AACzE;AAEA,SAAgB,EAAiB,GAAsB,GAAc;CACnE,EAAQ,MAAM,aAAa,MAAM,KAAK,IAAI,IAAI,CAAC,GAAG,EAAe,CAAO,GAAG,CAAI,CAAC,CAAC,EAAE,KAAK,GAAG;AAC7F;AAKA,SAAgB,EAAuB,GAAsB,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,EAAE,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,MAA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,SAAS,OACrB,EAAM,OAAO,EAAc,MACpB;AACT;AAEA,SAAgB,EAAe,GAAuB,GAAuB;CAC3E,IAAM,IAAQ,EAAS,YAAY,GAC7B,IAAQ,EAAS,YAAY,GAC7B,IAAiB,aAAiB,cAAc,aAAiB,cAAc,MAAU,GACzF,IAAmB,MAAU,WAAW,YAAY,MAAU,WAAW;CAE/E,OAAO,KAAkB,KADE,MAAU;AAEvC;AAEA,SAAgB,EAAe,GAAgC;CAC7D,OACE,EAAQ,MAAM,YACV,MAAM,GAAG,CAAC,EACV,KAAI,MAAQ,EAAK,KAAK,CAAC,CAAC,EACxB,QAAO,MAAQ,MAAS,UAAU,MAAS,EAAE,KAAK,CAAC;AAE3D;AAEA,SAAgB,EAAiB,GAAsB,GAAc;CACnE,IAAM,IAAc,EAAe,CAAO;CAC1C,EAAQ,MAAM,aAAa,EAAY,QAAO,MAAK,MAAM,CAAI,CAAC,CAAC,KAAK,GAAG;AACzE;AAEA,SAAgB,EAAiB,GAAsB,GAAc;CACnE,EAAQ,MAAM,aAAa,MAAM,qBAAK,IAAI,IAAI,CAAC,GAAG,EAAe,CAAO,GAAG,CAAI,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG;AAC7F;AAKA,SAAgB,EAAuB,GAAsB,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"focus.js","names":[],"sources":["../../../src/internal/utils/focus.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport function isFocusable(element: Element) {\n return (\n element.matches(\n [\n 'a[href]',\n 'area[href]',\n 'input',\n 'button',\n 'select',\n 'textarea',\n 'iframe',\n 'object',\n 'embed',\n '*[tabindex]',\n '*[contenteditable=true]',\n '[role=button]'\n ].join(',')\n ) &&\n element.matches(':not([disabled], [inert])') &&\n !element.closest(`[inert]`) &&\n !element.closest('[popover]')?.matches(':not(:popover-open)')\n );\n}\n\n/** returns interactive elements that does not require advanced keyboard interactions like arrow/navigation */\nexport function isSimpleFocusable(element: Element) {\n return element.matches(\n [\n 'a[href]',\n 'button:not([disabled])',\n 'input[type=checkbox]',\n 'input[type=radio]',\n 'object',\n 'embed',\n '*[tabindex]',\n '[role=button]:not([disabled])'\n ].join(',')\n );\n}\n\nexport function getActiveElement(root: Document | ShadowRoot = globalThis.document): Element | null {\n if (root.activeElement && root.activeElement.shadowRoot) {\n return getActiveElement(root.activeElement.shadowRoot) ?? root.activeElement;\n } else {\n return root.activeElement;\n }\n}\n\nexport function focusElement(element: HTMLElement) {\n if (element && !isFocusable(element)) {\n element.setAttribute('tabindex', '-1');\n element.focus();\n element.addEventListener('blur', () => element.removeAttribute('tabindex'), { once: true });\n } else {\n element?.focus();\n }\n}\n\nexport function focusElementTimeout(element: HTMLElement) {\n setTimeout(() => focusElement(element));\n}\n\nexport function setActiveKeyListItem(items: NodeListOf<HTMLElement> | HTMLElement[], item: HTMLElement) {\n items.forEach(i => (i.tabIndex = -1));\n item.tabIndex = 0;\n}\n\nexport function initializeKeyListItems(items: NodeListOf<HTMLElement> | HTMLElement[]) {\n items.forEach(i => (i.tabIndex = -1));\n items[0] && (items[0].tabIndex = 0);\n}\n\n/** determines if user interaction is a valid interaction for activating a listbox type */\nexport function onListboxActivate(\n element: HTMLElement & { disabled?: boolean },\n fn: (event: KeyboardEvent | PointerEvent) => void\n) {\n const validKey = (e: KeyboardEvent) => e.code === 'Space' || e.code === 'ArrowUp' || e.code === 'ArrowDown';\n\n element.addEventListener('pointerdown', (e: PointerEvent) => {\n e.preventDefault();\n });\n\n // Chrome's LightDismissFromClick runs auto-popover light dismiss from click;\n // opening on pointerup can close immediately in the same gesture.\n // https://issues.chromium.org/issues/408010435\n element.addEventListener('click', (e: PointerEvent) => {\n e.preventDefault();\n\n if (!element.disabled) {\n fn(e);\n }\n });\n\n element.addEventListener('keyup', (e: KeyboardEvent) => {\n if (validKey(e) && !element.disabled) {\n fn(e);\n }\n });\n\n element.addEventListener('keydown', (e: KeyboardEvent) => {\n if (validKey(e) && !element.disabled) {\n e.preventDefault();\n }\n });\n}\n"],"mappings":";AAGA,SAAgB,EAAY,GAAkB;CAC5C,OACE,EAAQ,QACN;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,EAAE,KAAK,GAAG,CACZ,KACA,EAAQ,QAAQ,2BAA2B,KAC3C,CAAC,EAAQ,QAAQ,SAAS,KAC1B,CAAC,EAAQ,QAAQ,WAAW,GAAG,QAAQ,qBAAqB;AAEhE;AAGA,SAAgB,EAAkB,GAAkB;CAClD,OAAO,EAAQ,QACb;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,EAAE,KAAK,GAAG,CACZ;AACF;AAEA,SAAgB,EAAiB,IAA8B,WAAW,UAA0B;CAIhG,OAHE,EAAK,iBAAiB,EAAK,cAAc,aACpC,EAAiB,EAAK,cAAc,UAAU,KAAK,EAAK,gBAExD,EAAK;AAEhB;AAEA,SAAgB,EAAa,GAAsB;CACjD,AAAI,KAAW,CAAC,EAAY,CAAO,KACjC,EAAQ,aAAa,YAAY,IAAI,GACrC,EAAQ,MAAM,GACd,EAAQ,iBAAiB,cAAc,EAAQ,gBAAgB,UAAU,GAAG,EAAE,MAAM,GAAK,CAAC,KAE1F,GAAS,MAAM;AAEnB;AAEA,SAAgB,EAAoB,GAAsB;CACxD,iBAAiB,EAAa,CAAO,CAAC;AACxC;AAEA,SAAgB,EAAqB,GAAgD,GAAmB;CAEtG,AADA,EAAM,SAAQ,MAAM,EAAE,WAAW,EAAG,GACpC,EAAK,WAAW;AAClB;AAEA,SAAgB,EAAuB,GAAgD;CAErF,AADA,EAAM,SAAQ,MAAM,EAAE,WAAW,EAAG,GACpC,EAAM,OAAO,EAAM,GAAG,WAAW;AACnC;AAGA,SAAgB,EACd,GACA,GACA;CACA,IAAM,KAAY,MAAqB,EAAE,SAAS,WAAW,EAAE,SAAS,aAAa,EAAE,SAAS;CAuBhG,AArBA,EAAQ,iBAAiB,gBAAgB,MAAoB;EAC3D,EAAE,eAAe;CACnB,CAAC,GAKD,EAAQ,iBAAiB,UAAU,MAAoB;EAGrD,AAFA,EAAE,eAAe,GAEZ,EAAQ,YACX,EAAG,CAAC;CAER,CAAC,GAED,EAAQ,iBAAiB,UAAU,MAAqB;EACtD,AAAI,EAAS,CAAC,KAAK,CAAC,EAAQ,YAC1B,EAAG,CAAC;CAER,CAAC,GAED,EAAQ,iBAAiB,YAAY,MAAqB;EACxD,AAAI,EAAS,CAAC,KAAK,CAAC,EAAQ,YAC1B,EAAE,eAAe;CAErB,CAAC;AACH"}
1
+ {"version":3,"file":"focus.js","names":[],"sources":["../../../src/internal/utils/focus.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport function isFocusable(element: Element) {\n return (\n element.matches(\n [\n 'a[href]',\n 'area[href]',\n 'input',\n 'button',\n 'select',\n 'textarea',\n 'iframe',\n 'object',\n 'embed',\n '*[tabindex]',\n '*[contenteditable=true]',\n '[role=button]'\n ].join(',')\n ) &&\n element.matches(':not([disabled], [inert])') &&\n !element.closest(`[inert]`) &&\n !element.closest('[popover]')?.matches(':not(:popover-open)')\n );\n}\n\n/** returns interactive elements that does not require advanced keyboard interactions like arrow/navigation */\nexport function isSimpleFocusable(element: Element) {\n return element.matches(\n [\n 'a[href]',\n 'button:not([disabled])',\n 'input[type=checkbox]',\n 'input[type=radio]',\n 'object',\n 'embed',\n '*[tabindex]',\n '[role=button]:not([disabled])'\n ].join(',')\n );\n}\n\nexport function getActiveElement(root: Document | ShadowRoot = globalThis.document): Element | null {\n if (root.activeElement && root.activeElement.shadowRoot) {\n return getActiveElement(root.activeElement.shadowRoot) ?? root.activeElement;\n } else {\n return root.activeElement;\n }\n}\n\nexport function focusElement(element: HTMLElement) {\n if (element && !isFocusable(element)) {\n element.setAttribute('tabindex', '-1');\n element.focus();\n element.addEventListener('blur', () => element.removeAttribute('tabindex'), { once: true });\n } else {\n element?.focus();\n }\n}\n\nexport function focusElementTimeout(element: HTMLElement) {\n setTimeout(() => focusElement(element));\n}\n\nexport function setActiveKeyListItem(items: NodeListOf<HTMLElement> | HTMLElement[], item: HTMLElement) {\n items.forEach(i => (i.tabIndex = -1));\n item.tabIndex = 0;\n}\n\nexport function initializeKeyListItems(items: NodeListOf<HTMLElement> | HTMLElement[]) {\n items.forEach(i => (i.tabIndex = -1));\n items[0] && (items[0].tabIndex = 0);\n}\n\n/** determines if user interaction is a valid interaction for activating a listbox type */\nexport function onListboxActivate(\n element: HTMLElement & { disabled?: boolean },\n fn: (event: KeyboardEvent | PointerEvent) => void\n) {\n const validKey = (e: KeyboardEvent) => e.code === 'Space' || e.code === 'ArrowUp' || e.code === 'ArrowDown';\n\n element.addEventListener('pointerdown', (e: PointerEvent) => {\n e.preventDefault();\n });\n\n // Chrome's LightDismissFromClick runs auto-popover light dismiss from click;\n // opening on pointerup can close immediately in the same gesture.\n // https://issues.chromium.org/issues/408010435\n element.addEventListener('click', (e: PointerEvent) => {\n e.preventDefault();\n\n if (!element.disabled) {\n fn(e);\n }\n });\n\n element.addEventListener('keyup', (e: KeyboardEvent) => {\n if (validKey(e) && !element.disabled) {\n fn(e);\n }\n });\n\n element.addEventListener('keydown', (e: KeyboardEvent) => {\n if (validKey(e) && !element.disabled) {\n e.preventDefault();\n }\n });\n}\n"],"mappings":";AAGA,SAAgB,EAAY,GAAkB;CAC5C,OACE,EAAQ,QACN;EACE;EACA;E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