@nvidia-elements/core 0.0.7 → 0.0.9

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 (212) hide show
  1. package/CHANGELOG.md +25 -16
  2. package/README.md +1 -1
  3. package/dist/accordion/accordion-group.js.map +1 -1
  4. package/dist/accordion/accordion.js.map +1 -1
  5. package/dist/accordion/accordion2.js +4 -4
  6. package/dist/alert/alert-group.js.map +1 -1
  7. package/dist/alert/alert-group2.js +1 -1
  8. package/dist/alert/alert-group2.js.map +1 -1
  9. package/dist/alert/alert.global.js.map +1 -1
  10. package/dist/alert/alert.js.map +1 -1
  11. package/dist/alert/alert2.js +1 -1
  12. package/dist/avatar/avatar-group2.js +1 -1
  13. package/dist/avatar/avatar2.js +1 -1
  14. package/dist/badge/badge.js +1 -1
  15. package/dist/badge/badge.js.map +1 -1
  16. package/dist/badge/badge2.js +2 -2
  17. package/dist/badge/badge2.js.map +1 -1
  18. package/dist/breadcrumb/breadcrumb.js +1 -1
  19. package/dist/breadcrumb/breadcrumb.js.map +1 -1
  20. package/dist/breadcrumb/breadcrumb2.js +2 -2
  21. package/dist/breadcrumb/breadcrumb2.js.map +1 -1
  22. package/dist/bundles/index.d.ts +2 -2
  23. package/dist/bundles/index.js +3 -3
  24. package/dist/button/button.js.map +1 -1
  25. package/dist/button/button2.js +1 -1
  26. package/dist/button-group/button-group.global.js.map +1 -1
  27. package/dist/button-group/button-group.js +1 -1
  28. package/dist/button-group/button-group.js.map +1 -1
  29. package/dist/button-group/button-group2.js +3 -3
  30. package/dist/button-group/button-group2.js.map +1 -1
  31. package/dist/card/card-content.js +1 -1
  32. package/dist/card/card-content.js.map +1 -1
  33. package/dist/card/card-header.js +1 -1
  34. package/dist/card/card-header.js.map +1 -1
  35. package/dist/card/card2.js +4 -4
  36. package/dist/chat-message/chat-message2.js +1 -1
  37. package/dist/checkbox/checkbox-group2.js +1 -1
  38. package/dist/checkbox/checkbox.js.map +1 -1
  39. package/dist/checkbox/checkbox2.js +1 -1
  40. package/dist/color/color.global.js.map +1 -1
  41. package/dist/color/color2.js +1 -1
  42. package/dist/combobox/combobox.examples.js.map +1 -1
  43. package/dist/combobox/combobox2.js +1 -1
  44. package/dist/copy-button/copy-button2.js +1 -1
  45. package/dist/copy-button/copy-button2.js.map +1 -1
  46. package/dist/custom-elements-jsx.d.ts +2 -2
  47. package/dist/custom-elements-vue.d.ts +2 -2
  48. package/dist/custom-elements.json +7 -29
  49. package/dist/data.html.json +3 -3
  50. package/dist/data.snippets.json +42 -42
  51. package/dist/date/date2.js +1 -1
  52. package/dist/datetime/datetime2.js +1 -1
  53. package/dist/dialog/dialog-footer2.js +1 -1
  54. package/dist/dialog/dialog-header2.js +1 -1
  55. package/dist/dialog/dialog2.js +1 -1
  56. package/dist/divider/divider2.js +1 -1
  57. package/dist/dot/dot.js.map +1 -1
  58. package/dist/dot/dot2.js +1 -1
  59. package/dist/drawer/drawer-content.js.map +1 -1
  60. package/dist/drawer/drawer-content2.js +1 -1
  61. package/dist/drawer/drawer-footer2.js +1 -1
  62. package/dist/drawer/drawer-header2.js +1 -1
  63. package/dist/drawer/drawer2.js +1 -1
  64. package/dist/dropdown/dropdown-footer2.js +1 -1
  65. package/dist/dropdown/dropdown-header2.js +1 -1
  66. package/dist/dropdown/dropdown.js.map +1 -1
  67. package/dist/dropdown/dropdown2.js +1 -1
  68. package/dist/dropdown-group/dropdown-group.js +1 -1
  69. package/dist/dropdown-group/dropdown-group.js.map +1 -1
  70. package/dist/dropzone/dropzone.util.js +4 -1
  71. package/dist/dropzone/dropzone.util.js.map +1 -1
  72. package/dist/dropzone/dropzone2.js +1 -1
  73. package/dist/dropzone/dropzone2.js.map +1 -1
  74. package/dist/file/file.global.js.map +1 -1
  75. package/dist/file/file2.js +1 -1
  76. package/dist/format-datetime/format-datetime2.js +1 -1
  77. package/dist/format-relative-time/format-relative-time2.js +1 -1
  78. package/dist/forms/control/control.js.map +1 -1
  79. package/dist/forms/control/control2.js +2 -2
  80. package/dist/forms/control/control2.js.map +1 -1
  81. package/dist/forms/control-group/control-group.js.map +1 -1
  82. package/dist/forms/control-group/control-group2.js +23 -24
  83. package/dist/forms/control-group/control-group2.js.map +1 -1
  84. package/dist/forms/control-message/control-message2.js +1 -1
  85. package/dist/forms/utils/states.d.ts +1 -1
  86. package/dist/forms/utils/states.js +25 -25
  87. package/dist/forms/utils/states.js.map +1 -1
  88. package/dist/grid/cell/cell2.js +1 -1
  89. package/dist/grid/column/column.js.map +1 -1
  90. package/dist/grid/column/column2.js +23 -23
  91. package/dist/grid/column/column2.js.map +1 -1
  92. package/dist/grid/define.js.map +1 -1
  93. package/dist/grid/footer/footer.js.map +1 -1
  94. package/dist/grid/footer/footer2.js +1 -1
  95. package/dist/grid/grid.global.js.map +1 -1
  96. package/dist/grid/grid.js.map +1 -1
  97. package/dist/grid/grid2.js +31 -31
  98. package/dist/grid/grid2.js.map +1 -1
  99. package/dist/grid/header/header2.js +24 -25
  100. package/dist/grid/header/header2.js.map +1 -1
  101. package/dist/grid/placeholder/placeholder2.js +1 -1
  102. package/dist/grid/row/row.js.map +1 -1
  103. package/dist/grid/row/row2.js +1 -1
  104. package/dist/icon/define.js.map +1 -1
  105. package/dist/icon/icon.js.map +1 -1
  106. package/dist/icon/icon2.js +2 -2
  107. package/dist/icon/icons.js.map +1 -1
  108. package/dist/icon/server.js.map +1 -1
  109. package/dist/icon-button/icon-button.js.map +1 -1
  110. package/dist/icon-button/icon-button2.js +1 -1
  111. package/dist/index.js +1 -1
  112. package/dist/input/input-group.global.js.map +1 -1
  113. package/dist/input/input-group.js.map +1 -1
  114. package/dist/input/input-group2.js +1 -1
  115. package/dist/input/input.js.map +1 -1
  116. package/dist/input/input2.js +1 -1
  117. package/dist/internal/controllers/audit.controller.js.map +1 -1
  118. package/dist/internal/controllers/type-native-popover.controller.js.map +1 -1
  119. package/dist/internal/controllers/type-ssr.controller.js.map +1 -1
  120. package/dist/internal/index.js +40 -40
  121. package/dist/internal/services/global.service.js +1 -1
  122. package/dist/internal/services/i18n.service.d.ts +1 -1
  123. package/dist/internal/services/i18n.service.js.map +1 -1
  124. package/dist/internal/utils/dom.d.ts +0 -2
  125. package/dist/internal/utils/dom.js +12 -15
  126. package/dist/internal/utils/dom.js.map +1 -1
  127. package/dist/logo/logo.js.map +1 -1
  128. package/dist/logo/logo2.js +1 -1
  129. package/dist/menu/menu-item.js.map +1 -1
  130. package/dist/menu/menu-item2.js +1 -1
  131. package/dist/menu/menu.global.js.map +1 -1
  132. package/dist/menu/menu2.js +1 -1
  133. package/dist/menu/menu2.js.map +1 -1
  134. package/dist/month/month2.js +1 -1
  135. package/dist/notification/notification-group2.js +1 -1
  136. package/dist/notification/notification.js.map +1 -1
  137. package/dist/notification/notification2.js +1 -1
  138. package/dist/page/page-panel/page-panel-content.js.map +1 -1
  139. package/dist/page/page-panel/page-panel-content2.js +1 -1
  140. package/dist/page/page-panel/page-panel-footer2.js +1 -1
  141. package/dist/page/page-panel/page-panel-header2.js +1 -1
  142. package/dist/page/page-panel/page-panel2.js +1 -1
  143. package/dist/page/page2.js +1 -1
  144. package/dist/page-header/page-header2.js +1 -1
  145. package/dist/page-loader/page-loader2.js +1 -1
  146. package/dist/pagination/pagination2.js +1 -1
  147. package/dist/panel/panel-content.js.map +1 -1
  148. package/dist/panel/panel-footer.js.map +1 -1
  149. package/dist/panel/panel2.js +4 -4
  150. package/dist/password/password2.js +1 -1
  151. package/dist/polyfills/index.js +2 -1
  152. package/dist/polyfills/index.js.map +1 -1
  153. package/dist/preferences-input/preferences-input2.js +1 -1
  154. package/dist/preferences-input/preferences-input2.js.map +1 -1
  155. package/dist/progress-bar/progress-bar2.js +1 -1
  156. package/dist/progress-ring/progress-ring.js.map +1 -1
  157. package/dist/progress-ring/progress-ring2.js +1 -1
  158. package/dist/progress-ring/progress-ring2.js.map +1 -1
  159. package/dist/progressive-filter-chip/progressive-filter-chip.global.js.map +1 -1
  160. package/dist/progressive-filter-chip/progressive-filter-chip.js.map +1 -1
  161. package/dist/progressive-filter-chip/progressive-filter-chip2.js +2 -2
  162. package/dist/progressive-filter-chip/progressive-filter-chip2.js.map +1 -1
  163. package/dist/pulse/pulse2.js +1 -1
  164. package/dist/radio/radio-group2.js +1 -1
  165. package/dist/radio/radio2.js +1 -1
  166. package/dist/range/range.global.js.map +1 -1
  167. package/dist/range/range2.js +1 -1
  168. package/dist/resize-handle/resize-handle2.js +1 -1
  169. package/dist/search/search2.js +1 -1
  170. package/dist/select/select2.js +1 -1
  171. package/dist/skeleton/skeleton.d.ts +2 -2
  172. package/dist/skeleton/skeleton2.js +1 -1
  173. package/dist/skeleton/skeleton2.js.map +1 -1
  174. package/dist/sort-button/sort-button2.js +1 -1
  175. package/dist/sparkline/sparkline2.js +1 -1
  176. package/dist/star-rating/star-rating2.js +1 -1
  177. package/dist/steps/steps.js.map +1 -1
  178. package/dist/steps/steps2.js +4 -4
  179. package/dist/steps/steps2.js.map +1 -1
  180. package/dist/switch/switch-group2.js +1 -1
  181. package/dist/switch/switch2.js +1 -1
  182. package/dist/tabs/tabs-group2.js +1 -1
  183. package/dist/tabs/tabs-item.js.map +1 -1
  184. package/dist/tabs/tabs.global.js.map +1 -1
  185. package/dist/tabs/tabs.js.map +1 -1
  186. package/dist/tabs/tabs2.js +3 -3
  187. package/dist/tabs/tabs2.js.map +1 -1
  188. package/dist/tag/tag.js.map +1 -1
  189. package/dist/tag/tag2.js +1 -1
  190. package/dist/textarea/textarea2.js +1 -1
  191. package/dist/time/time2.js +1 -1
  192. package/dist/toast/toast.js +1 -1
  193. package/dist/toast/toast.js.map +1 -1
  194. package/dist/toast/toast2.js +1 -1
  195. package/dist/toggletip/toggletip-footer2.js +1 -1
  196. package/dist/toggletip/toggletip-header.js.map +1 -1
  197. package/dist/toggletip/toggletip-header2.js +1 -1
  198. package/dist/toggletip/toggletip.js.map +1 -1
  199. package/dist/toggletip/toggletip2.js +1 -1
  200. package/dist/toolbar/toolbar.js +1 -1
  201. package/dist/toolbar/toolbar.js.map +1 -1
  202. package/dist/toolbar/toolbar2.js +2 -2
  203. package/dist/toolbar/toolbar2.js.map +1 -1
  204. package/dist/tooltip/tooltip.js.map +1 -1
  205. package/dist/tooltip/tooltip2.js +1 -1
  206. package/dist/tree/tree-node.js +1 -1
  207. package/dist/tree/tree-node.js.map +1 -1
  208. package/dist/tree/tree-node2.js +1 -1
  209. package/dist/tree/tree2.js +1 -1
  210. package/dist/tree/utils.js.map +1 -1
  211. package/dist/week/week2.js +1 -1
  212. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"icon-button.js","names":[],"sources":["../../src/icon-button/icon-button.css?inline"],"sourcesContent":["/* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. */\n/* SPDX-License-Identifier: Apache-2.0 */\n\n:host {\n --color: var(--nve-sys-text-muted-color);\n --border-radius: var(--nve-ref-border-radius-full);\n --padding: 0;\n --line-height: 0;\n --gap: 0;\n --height: var(--nve-ref-size-800);\n --width: var(--nve-ref-size-800);\n --font-size: calc(var(--width) / 2.3);\n}\n\n/* override base button inline style */\n:host([container*='inline']) {\n --height: var(--nve-ref-size-800);\n --line-height: 0;\n}\n\n:host([size='sm']) {\n --padding: 0;\n --height: var(--nve-ref-size-700);\n --width: var(--nve-ref-size-700);\n}\n\n:host([size='lg']) {\n --width: var(--nve-ref-size-1000);\n --height: var(--nve-ref-size-1000);\n --padding: 0;\n}\n\n[internal-host] {\n font-size: var(--font-size);\n}\n\n/* disable pseudo element on base button */\n[internal-host]::after {\n display: none !important;\n}\n\nnve-icon {\n --color: var(--_icon-color);\n pointer-events: none;\n}\n\n::slotted(a) {\n text-decoration: none !important;\n color: var(--color) !important;\n outline: 0;\n}\n\n::slotted(a)::after {\n display: block;\n content: ' ';\n inset: 0;\n position: absolute;\n}\n\n/* deprecated */\n:host([interaction*='flat']) [interaction-state] {\n --nve-sys-interaction-state-ratio: 0 !important;\n}\n\n/* deprecated */\n:host([interaction*='flat']:state(pressed)) {\n --color: var(--nve-sys-text-emphasis-color) !important;\n --background: none !important;\n}\n\n"],"mappings":""}
1
+ {"version":3,"file":"icon-button.js","names":[],"sources":["../../src/icon-button/icon-button.css?inline"],"sourcesContent":["/* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. */\n/* SPDX-License-Identifier: Apache-2.0 */\n\n:host {\n --color: var(--nve-sys-text-muted-color);\n --border-radius: var(--nve-ref-border-radius-full);\n --padding: 0;\n --line-height: 0;\n --gap: 0;\n --height: var(--nve-ref-size-800);\n --width: var(--nve-ref-size-800);\n --font-size: calc(var(--width) / 2.3);\n}\n\n/* override base button inline style */\n:host([container*='inline']) {\n --height: var(--nve-ref-size-800);\n --line-height: 0;\n}\n\n:host([size='sm']) {\n --padding: 0;\n --height: var(--nve-ref-size-700);\n --width: var(--nve-ref-size-700);\n}\n\n:host([size='lg']) {\n --width: var(--nve-ref-size-1000);\n --height: var(--nve-ref-size-1000);\n --padding: 0;\n}\n\n[internal-host] {\n font-size: var(--font-size);\n}\n\n/* disable pseudo element on base button */\n[internal-host]::after {\n display: none !important;\n}\n\nnve-icon {\n --color: var(--_icon-color);\n pointer-events: none;\n}\n\n::slotted(a) {\n text-decoration: none !important;\n color: var(--color) !important;\n outline: 0;\n}\n\n::slotted(a)::after {\n display: block;\n content: ' ';\n inset: 0;\n position: absolute;\n}\n\n/* deprecated */\n:host([interaction*='flat']) [interaction-state] {\n --nve-sys-interaction-state-ratio: 0 !important;\n}\n\n/* deprecated */\n:host([interaction*='flat']:state(pressed)) {\n --color: var(--nve-sys-text-emphasis-color) !important;\n --background: none !important;\n}\n"],"mappings":""}
@@ -15,7 +15,7 @@ var l = class extends a {
15
15
  static {
16
16
  this.metadata = {
17
17
  tag: "nve-icon-button",
18
- version: "0.0.7"
18
+ version: "0.0.9"
19
19
  };
20
20
  }
21
21
  static {
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { getThemeTokens as e } from "./internal/utils/dom.js";
2
2
  import { I18nService as t } from "./internal/services/i18n.service.js";
3
3
  import { statusIcons as n } from "./internal/types/index.js";
4
4
  //#region src/index.ts
5
- var r = "0.0.7", i = "@nvidia-elements";
5
+ var r = "0.0.9", i = "@nvidia-elements";
6
6
  //#endregion
7
7
  export { t as I18nService, i as SCOPE, r as VERSION, e as getThemeTokens, n as statusIcons };
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"input-group.global.js","names":[],"sources":["../../src/input/input-group.global.css?inline"],"sourcesContent":["/* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. */\n/* SPDX-License-Identifier: Apache-2.0 */\n\nnve-input-group[type='filter'] > nve-select::part(_caret),\nnve-input-group[type='filter'] > nve-select::part(_caret) {\n display: none !important;\n}\n\nnve-input-group > [nve-control],\nnve-input-group > nve-button,\nnve-input-group > [nve-control],\nnve-input-group > nve-button {\n --border-radius: 0;\n}\n\nnve-input-group[type='filter'] [nve-control]:nth-child(odd),\nnve-input-group[type='filter'] nve-button:nth-child(odd),\nnve-input-group[type='filter'] [nve-control]:nth-child(odd),\nnve-input-group[type='filter'] nve-button:nth-child(odd) {\n --font-weight: var(--nve-ref-font-weight-medium);\n --text-align: center;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"input-group.global.js","names":[],"sources":["../../src/input/input-group.global.css?inline"],"sourcesContent":["/* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. */\n/* SPDX-License-Identifier: Apache-2.0 */\n\nnve-input-group[type='filter'] > nve-select::part(_caret) {\n display: none !important;\n}\n\nnve-input-group > [nve-control],\nnve-input-group > nve-button {\n --border-radius: 0;\n}\n\nnve-input-group[type='filter'] [nve-control]:nth-child(odd),\nnve-input-group[type='filter'] nve-button:nth-child(odd) {\n --font-weight: var(--nve-ref-font-weight-medium);\n --text-align: center;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"input-group.js","names":[],"sources":["../../src/input/input-group.css?inline"],"sourcesContent":["/* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. */\n/* SPDX-License-Identifier: Apache-2.0 */\n\n:host {\n --background: var(--nve-ref-border-color);\n --color: var(--nve-sys-interaction-field-color);\n --border-radius: var(--nve-ref-border-radius-sm);\n --gap: calc(var(--nve-ref-space-xxxs) / 2);\n --border: none;\n width: fit-content;\n contain: none;\n}\n\n[internal-host] {\n border-radius: var(--border-radius);\n overflow: hidden;\n width: max-content;\n border: var(--border);\n}\n\n.input-slot {\n background: var(--background);\n border-radius: var(--border-radius);\n flex-flow: row nowrap;\n gap: var(--gap);\n}\n\nslot[name='label'] {\n align-self: center;\n}\n\n::slotted(nve-icon-button),\n::slotted(nve-icon-button) {\n --background: var(--nve-sys-interaction-field-background);\n --color: var(--nve-sys-support-emphasis-color);\n --border-radius: 0;\n}\n\n::slotted(nve-select),\n::slotted(nve-select) {\n --padding: 0 var(--nve-ref-size-200);\n width: fit-content;\n}\n\n::slotted([nve-control]),\n::slotted([nve-control]) {\n --border-radius: 0 !important;\n}\n\n::slotted([first-control]) {\n --border-radius: var(--nve-ref-border-radius-sm) 0 0 var(--nve-ref-border-radius-sm) !important;\n}\n\n::slotted([last-control]) {\n --border-radius: 0 var(--nve-ref-border-radius-sm) var(--nve-ref-border-radius-sm) 0 !important;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"input-group.js","names":[],"sources":["../../src/input/input-group.css?inline"],"sourcesContent":["/* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. */\n/* SPDX-License-Identifier: Apache-2.0 */\n\n:host {\n --background: var(--nve-ref-border-color);\n --color: var(--nve-sys-interaction-field-color);\n --border-radius: var(--nve-ref-border-radius-sm);\n --gap: calc(var(--nve-ref-space-xxxs) / 2);\n --border: none;\n width: fit-content;\n contain: none;\n}\n\n[internal-host] {\n border-radius: var(--border-radius);\n overflow: hidden;\n width: max-content;\n border: var(--border);\n}\n\n.input-slot {\n background: var(--background);\n border-radius: var(--border-radius);\n flex-flow: row nowrap;\n gap: var(--gap);\n}\n\nslot[name='label'] {\n align-self: center;\n}\n\n::slotted(nve-icon-button) {\n --background: var(--nve-sys-interaction-field-background);\n --color: var(--nve-sys-support-emphasis-color);\n --border-radius: 0;\n}\n\n::slotted(nve-select) {\n --padding: 0 var(--nve-ref-size-200);\n width: fit-content;\n}\n\n::slotted([nve-control]) {\n --border-radius: 0 !important;\n}\n\n::slotted([first-control]) {\n --border-radius: var(--nve-ref-border-radius-sm) 0 0 var(--nve-ref-border-radius-sm) !important;\n}\n\n::slotted([last-control]) {\n --border-radius: 0 var(--nve-ref-border-radius-sm) var(--nve-ref-border-radius-sm) 0 !important;\n}\n"],"mappings":""}
@@ -11,7 +11,7 @@ var a = class extends n {
11
11
  static {
12
12
  this.metadata = {
13
13
  tag: "nve-input-group",
14
- version: "0.0.7"
14
+ version: "0.0.9"
15
15
  };
16
16
  }
17
17
  async connectedCallback() {
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","names":[],"sources":["../../src/input/input.css?inline"],"sourcesContent":["/* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. */\n/* SPDX-License-Identifier: Apache-2.0 */\n\n:host {\n --padding: 0 var(--nve-ref-size-200);\n --font-size: var(--nve-ref-font-size-100);\n --height: var(--nve-ref-size-800);\n --background: var(--nve-sys-interaction-field-background);\n --color: var(--nve-sys-interaction-field-color);\n --border-radius: var(--nve-ref-border-radius-sm);\n --border: var(--nve-ref-border-width-md) solid transparent;\n --border-bottom: var(--border);\n --cursor: text;\n --font-weight: normal;\n --_icon-height: var(--height);\n --_font-size: var(--font-size);\n --width: 100%;\n --max-width: 100%;\n --min-width: initial;\n width: var(--width);\n max-width: var(--max-width);\n min-width: var(--min-width);\n}\n\n:host([fit-text]) {\n --max-width: fit-content;\n}\n\n[input] {\n height: var(--height);\n background: var(--background);\n border: var(--border);\n border-bottom: var(--border-bottom);\n border-radius: var(--border-radius);\n color: var(--color);\n cursor: var(--cursor);\n width: var(--control-width);\n display: flex;\n align-content: stretch;\n}\n\n::slotted(input) {\n /* https://web.dev/accent-color/#guaranteeing-contrast */\n accent-color: var(--accent-color) !important;\n cursor: var(--cursor) !important;\n padding: var(--padding) !important;\n font-size: var(--font-size) !important;\n color: var(--color) !important;\n line-height: var(--height) !important;\n border: 0 !important;\n background: none !important;\n display: block !important;\n width: 100% !important;\n font-weight: var(--font-weight) !important;\n}\n\nnve-icon-button,\n::slotted(nve-icon-button),\n::slotted(nve-icon-button) {\n --height: var(--_icon-height);\n align-self: center;\n}\n\n::slotted(nve-button:not([slot])),\n::slotted(nve-button:not([slot])) {\n --font-size: var(--_font-size);\n --padding: 0 var(--nve-ref-size-200);\n --color: var(--label-color);\n --height: 100%;\n}\n\n:host([rounded]) {\n --border-radius: var(--nve-ref-border-radius-full);\n}\n\n:host([status='error']),\n:host(:state(invalid)),\n:host(:state(error)) {\n --border: var(--nve-ref-border-width-md) solid var(--nve-sys-support-danger-emphasis-color);\n}\n\n:host([status='success']),\n:host(:state(success)) {\n --border: var(--nve-ref-border-width-md) solid var(--nve-sys-support-success-emphasis-color);\n}\n\n:host(:state(disabled)) {\n --border: var(--nve-ref-border-width-md) solid transparent;\n}\n\n:host([container='flat']) {\n --border-radius: 0;\n --box-shadow: none;\n --border-bottom: var(--nve-ref-border-width-md) solid var(--nve-ref-border-color-muted);\n}\n\n:host([container='flat']) [input] {\n background: inherit;\n}\n\n:host([container='flat']:focus-within) {\n --border-bottom: var(--nve-ref-border-width-md) solid var(--nve-ref-border-color-emphasis);\n}\n\n:host([container='flat']:focus-within) [input] {\n outline: 0 !important;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"input.js","names":[],"sources":["../../src/input/input.css?inline"],"sourcesContent":["/* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. */\n/* SPDX-License-Identifier: Apache-2.0 */\n\n:host {\n --padding: 0 var(--nve-ref-size-200);\n --font-size: var(--nve-ref-font-size-100);\n --height: var(--nve-ref-size-800);\n --background: var(--nve-sys-interaction-field-background);\n --color: var(--nve-sys-interaction-field-color);\n --border-radius: var(--nve-ref-border-radius-sm);\n --border: var(--nve-ref-border-width-md) solid transparent;\n --border-bottom: var(--border);\n --cursor: text;\n --font-weight: normal;\n --_icon-height: var(--height);\n --_font-size: var(--font-size);\n --width: 100%;\n --max-width: 100%;\n --min-width: initial;\n width: var(--width);\n max-width: var(--max-width);\n min-width: var(--min-width);\n}\n\n:host([fit-text]) {\n --max-width: fit-content;\n}\n\n[input] {\n height: var(--height);\n background: var(--background);\n border: var(--border);\n border-bottom: var(--border-bottom);\n border-radius: var(--border-radius);\n color: var(--color);\n cursor: var(--cursor);\n width: var(--control-width);\n display: flex;\n align-content: stretch;\n}\n\n::slotted(input) {\n /* https://web.dev/accent-color/#guaranteeing-contrast */\n accent-color: var(--accent-color) !important;\n cursor: var(--cursor) !important;\n padding: var(--padding) !important;\n font-size: var(--font-size) !important;\n color: var(--color) !important;\n line-height: var(--height) !important;\n border: 0 !important;\n background: none !important;\n display: block !important;\n width: 100% !important;\n font-weight: var(--font-weight) !important;\n}\n\nnve-icon-button,\n::slotted(nve-icon-button) {\n --height: var(--_icon-height);\n align-self: center;\n}\n\n::slotted(nve-button:not([slot])) {\n --font-size: var(--_font-size);\n --padding: 0 var(--nve-ref-size-200);\n --color: var(--label-color);\n --height: 100%;\n}\n\n:host([rounded]) {\n --border-radius: var(--nve-ref-border-radius-full);\n}\n\n:host([status='error']),\n:host(:state(invalid)),\n:host(:state(error)) {\n --border: var(--nve-ref-border-width-md) solid var(--nve-sys-support-danger-emphasis-color);\n}\n\n:host([status='success']),\n:host(:state(success)) {\n --border: var(--nve-ref-border-width-md) solid var(--nve-sys-support-success-emphasis-color);\n}\n\n:host(:state(disabled)) {\n --border: var(--nve-ref-border-width-md) solid transparent;\n}\n\n:host([container='flat']) {\n --border-radius: 0;\n --box-shadow: none;\n --border-bottom: var(--nve-ref-border-width-md) solid var(--nve-ref-border-color-muted);\n}\n\n:host([container='flat']) [input] {\n background: inherit;\n}\n\n:host([container='flat']:focus-within) {\n --border-bottom: var(--nve-ref-border-width-md) solid var(--nve-ref-border-color-emphasis);\n}\n\n:host([container='flat']:focus-within) [input] {\n outline: 0 !important;\n}\n"],"mappings":""}
@@ -14,7 +14,7 @@ var a = r, o = class extends n {
14
14
  static {
15
15
  this.metadata = {
16
16
  tag: "nve-input",
17
- version: "0.0.7"
17
+ version: "0.0.9"
18
18
  };
19
19
  }
20
20
  };
@@ -1 +1 @@
1
- {"version":3,"file":"audit.controller.js","names":["#hostAuditState","#production","#hostMetadata","#initializeAudit","#auditExcessiveInstanceLimit","#auditSlots","#auditParentElement","#cleanupExcessiveInstanceLimit","#update"],"sources":["../../../src/internal/controllers/audit.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 { GlobalStateService } from '../services/global.service.js';\nimport { auditSlots, auditParentElement } from '../utils/audit.js';\n\nexport const excessiveInstanceLimit = 50;\n\nexport interface AuditOptions {\n excessiveInstanceLimit?: number;\n alternates?: { name: string; use: string }[];\n}\n\nexport interface AuditMetadata {\n parents?: string[];\n children?: string[];\n disallowedChildren?: string[];\n}\n\ninterface AuditRegistry {\n [key: string]: {\n count?: number;\n excessiveInstanceLimitAudited?: boolean;\n };\n}\n\nasync function log(message: string) {\n const { LogService } = await import('../services/log.service.js');\n LogService.warn(message);\n}\n\nexport function audit<T extends Audit>(options: AuditOptions = {}): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new AuditController(instance, options));\n}\n\nexport type Audit = ReactiveElement;\n\nexport class AuditController<T extends Audit> implements ReactiveController {\n get #hostAuditState() {\n return GlobalStateService.state.audit[this.host.localName] ?? { count: 0 };\n }\n\n get #production() {\n return GlobalStateService.state.env === 'production';\n }\n\n get #hostMetadata() {\n return (this.host.constructor as unknown as { metadata: AuditMetadata }).metadata;\n }\n\n constructor(\n private host: T,\n private options: AuditOptions\n ) {\n if (!this.#production) {\n this.host.addController(this);\n this.#initializeAudit();\n }\n }\n\n async hostConnected() {\n await this.host.updateComplete;\n if (!this.#production) {\n void this.#auditExcessiveInstanceLimit();\n void this.#auditSlots();\n void this.#auditParentElement();\n }\n }\n\n hostDisconnected() {\n this.#cleanupExcessiveInstanceLimit();\n }\n\n #initializeAudit() {\n if (!GlobalStateService.state.audit[this.host.localName]) {\n this.#update({ [this.host.localName]: { count: 0 } });\n }\n }\n\n async #auditExcessiveInstanceLimit() {\n if (this.options.excessiveInstanceLimit !== undefined) {\n if (\n this.#hostAuditState.count! > this.options.excessiveInstanceLimit &&\n !this.#hostAuditState.excessiveInstanceLimitAudited\n ) {\n const { getExcessiveInstanceLimitWarning } = await import('../utils/audit-logs.js');\n void log(getExcessiveInstanceLimitWarning(this.#hostAuditState.count!, this.host.localName));\n this.#update({\n [this.host.localName]: { count: this.#hostAuditState.count! + 1, excessiveInstanceLimitAudited: true }\n });\n } else {\n this.#update({ [this.host.localName]: { count: this.#hostAuditState.count! + 1 } });\n }\n }\n }\n\n #cleanupExcessiveInstanceLimit() {\n if (this.options.excessiveInstanceLimit) {\n this.#update({\n [this.host.localName]: { count: this.#hostAuditState.count! - 1, excessiveInstanceLimitAudited: false }\n });\n }\n }\n\n #update(audit: AuditRegistry) {\n GlobalStateService.dispatch('NVE_ELEMENTS_AUDIT_UPDATE', { audit } as Partial<\n typeof globalThis.NVE_ELEMENTS.state\n >);\n }\n\n async #auditSlots() {\n if (this.#hostMetadata.children || this.#hostMetadata.disallowedChildren) {\n const [invalidElements, validElements] = auditSlots(this.host);\n if (invalidElements.length) {\n const { getInvalidSlottedChildrenWarning } = await import('../utils/audit-logs.js');\n void log(getInvalidSlottedChildrenWarning(this.host.localName, validElements));\n }\n }\n }\n\n async #auditParentElement() {\n if (this.#hostMetadata.parents) {\n const [valid, validParents] = auditParentElement(this.host);\n if (!valid) {\n const { getInvalidParentWarning } = await import('../utils/audit-logs.js');\n void log(getInvalidParentWarning(this.host.localName, validParents.join(', ')));\n }\n }\n }\n}\n"],"mappings":";;;AAQA,IAAa,IAAyB;AAoBtC,eAAe,EAAI,GAAiB;CAClC,IAAM,EAAE,kBAAe,MAAM,OAAO;AACpC,GAAW,KAAK,EAAQ;;AAG1B,SAAgB,EAAuB,IAAwB,EAAE,EAAkB;AACjF,SAAQ,MACN,EAAO,gBAAiB,MAAgB,IAAI,EAAgB,GAAU,EAAQ,CAAC;;AAKnF,IAAa,IAAb,MAA4E;CAC1E,KAAA,IAAsB;AACpB,SAAO,EAAmB,MAAM,MAAM,KAAK,KAAK,cAAc,EAAE,OAAO,GAAG;;CAG5E,KAAA,IAAkB;AAChB,SAAO,EAAmB,MAAM,QAAQ;;CAG1C,KAAA,IAAoB;AAClB,SAAQ,KAAK,KAAK,YAAuD;;CAG3E,YACE,GACA,GACA;AACA,EAHQ,KAAA,OAAA,GACA,KAAA,UAAA,GAEH,MAAA,MACH,KAAK,KAAK,cAAc,KAAK,EAC7B,MAAA,GAAuB;;CAI3B,MAAM,gBAAgB;AAEpB,EADA,MAAM,KAAK,KAAK,gBACX,MAAA,MACE,MAAA,GAAmC,EACnC,MAAA,GAAkB,EAClB,MAAA,GAA0B;;CAInC,mBAAmB;AACjB,QAAA,GAAqC;;CAGvC,KAAmB;AACjB,EAAK,EAAmB,MAAM,MAAM,KAAK,KAAK,cAC5C,MAAA,EAAa,GAAG,KAAK,KAAK,YAAY,EAAE,OAAO,GAAG,EAAE,CAAC;;CAIzD,OAAA,IAAqC;AACnC,MAAI,KAAK,QAAQ,2BAA2B,KAAA,EAC1C,KACE,MAAA,EAAqB,QAAS,KAAK,QAAQ,0BAC3C,CAAC,MAAA,EAAqB,+BACtB;GACA,IAAM,EAAE,wCAAqC,MAAM,OAAO;AAE1D,GADK,EAAI,EAAiC,MAAA,EAAqB,OAAQ,KAAK,KAAK,UAAU,CAAC,EAC5F,MAAA,EAAa,GACV,KAAK,KAAK,YAAY;IAAE,OAAO,MAAA,EAAqB,QAAS;IAAG,+BAA+B;IAAM,EACvG,CAAC;QAEF,OAAA,EAAa,GAAG,KAAK,KAAK,YAAY,EAAE,OAAO,MAAA,EAAqB,QAAS,GAAG,EAAE,CAAC;;CAKzF,KAAiC;AAC/B,EAAI,KAAK,QAAQ,0BACf,MAAA,EAAa,GACV,KAAK,KAAK,YAAY;GAAE,OAAO,MAAA,EAAqB,QAAS;GAAG,+BAA+B;GAAO,EACxG,CAAC;;CAIN,GAAQ,GAAsB;AAC5B,IAAmB,SAAS,6BAA6B,EAAE,UAAO,CAEhE;;CAGJ,OAAA,IAAoB;AAClB,MAAI,MAAA,EAAmB,YAAY,MAAA,EAAmB,oBAAoB;GACxE,IAAM,CAAC,GAAiB,KAAiB,EAAW,KAAK,KAAK;AAC9D,OAAI,EAAgB,QAAQ;IAC1B,IAAM,EAAE,wCAAqC,MAAM,OAAO;AACrD,MAAI,EAAiC,KAAK,KAAK,WAAW,EAAc,CAAC;;;;CAKpF,OAAA,IAA4B;AAC1B,MAAI,MAAA,EAAmB,SAAS;GAC9B,IAAM,CAAC,GAAO,KAAgB,EAAmB,KAAK,KAAK;AAC3D,OAAI,CAAC,GAAO;IACV,IAAM,EAAE,+BAA4B,MAAM,OAAO;AAC5C,MAAI,EAAwB,KAAK,KAAK,WAAW,EAAa,KAAK,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"audit.controller.js","names":["#hostAuditState","#production","#hostMetadata","#initializeAudit","#auditExcessiveInstanceLimit","#auditSlots","#auditParentElement","#cleanupExcessiveInstanceLimit","#update"],"sources":["../../../src/internal/controllers/audit.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 { GlobalStateService } from '../services/global.service.js';\nimport { auditSlots, auditParentElement } from '../utils/audit.js';\n\nexport const excessiveInstanceLimit = 50;\n\nexport interface AuditOptions {\n excessiveInstanceLimit?: number;\n alternates?: { name: string; use: string }[];\n}\n\nexport interface AuditMetadata {\n parents?: string[];\n children?: string[];\n disallowedChildren?: string[];\n}\n\ninterface AuditRegistry {\n [key: string]: {\n count?: number;\n excessiveInstanceLimitAudited?: boolean;\n };\n}\n\nasync function log(message: string) {\n const { LogService } = await import('../services/log.service.js');\n LogService.warn(message);\n}\n\nexport function audit<T extends Audit>(options: AuditOptions = {}): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new AuditController(instance, options));\n}\n\nexport type Audit = ReactiveElement;\n\nexport class AuditController<T extends Audit> implements ReactiveController {\n get #hostAuditState() {\n return GlobalStateService.state.audit[this.host.localName] ?? { count: 0 };\n }\n\n get #production() {\n return GlobalStateService.state.env === 'production';\n }\n\n get #hostMetadata() {\n return (this.host.constructor as unknown as { metadata: AuditMetadata }).metadata;\n }\n\n constructor(\n private host: T,\n private options: AuditOptions\n ) {\n if (!this.#production) {\n this.host.addController(this);\n this.#initializeAudit();\n }\n }\n\n async hostConnected() {\n await this.host.updateComplete;\n if (!this.#production) {\n void this.#auditExcessiveInstanceLimit();\n void this.#auditSlots();\n void this.#auditParentElement();\n }\n }\n\n hostDisconnected() {\n this.#cleanupExcessiveInstanceLimit();\n }\n\n #initializeAudit() {\n if (!GlobalStateService.state.audit[this.host.localName]) {\n this.#update({ [this.host.localName]: { count: 0 } });\n }\n }\n\n async #auditExcessiveInstanceLimit() {\n if (this.options.excessiveInstanceLimit !== undefined) {\n if (\n this.#hostAuditState.count! > this.options.excessiveInstanceLimit &&\n !this.#hostAuditState.excessiveInstanceLimitAudited\n ) {\n const { getExcessiveInstanceLimitWarning } = await import('../utils/audit-logs.js');\n void log(getExcessiveInstanceLimitWarning(this.#hostAuditState.count!, this.host.localName));\n this.#update({\n [this.host.localName]: { count: this.#hostAuditState.count! + 1, excessiveInstanceLimitAudited: true }\n });\n } else {\n this.#update({ [this.host.localName]: { count: this.#hostAuditState.count! + 1 } });\n }\n }\n }\n\n #cleanupExcessiveInstanceLimit() {\n if (this.options.excessiveInstanceLimit) {\n this.#update({\n [this.host.localName]: { count: this.#hostAuditState.count! - 1, excessiveInstanceLimitAudited: false }\n });\n }\n }\n\n #update(registry: AuditRegistry) {\n GlobalStateService.dispatch('NVE_ELEMENTS_AUDIT_UPDATE', { audit: registry } as Partial<\n typeof globalThis.NVE_ELEMENTS.state\n >);\n }\n\n async #auditSlots() {\n if (this.#hostMetadata.children || this.#hostMetadata.disallowedChildren) {\n const [invalidElements, validElements] = auditSlots(this.host);\n if (invalidElements.length) {\n const { getInvalidSlottedChildrenWarning } = await import('../utils/audit-logs.js');\n void log(getInvalidSlottedChildrenWarning(this.host.localName, validElements));\n }\n }\n }\n\n async #auditParentElement() {\n if (this.#hostMetadata.parents) {\n const [valid, validParents] = auditParentElement(this.host);\n if (!valid) {\n const { getInvalidParentWarning } = await import('../utils/audit-logs.js');\n void log(getInvalidParentWarning(this.host.localName, validParents.join(', ')));\n }\n }\n }\n}\n"],"mappings":";;;AAQA,IAAa,IAAyB;AAoBtC,eAAe,EAAI,GAAiB;CAClC,IAAM,EAAE,kBAAe,MAAM,OAAO;AACpC,GAAW,KAAK,EAAQ;;AAG1B,SAAgB,EAAuB,IAAwB,EAAE,EAAkB;AACjF,SAAQ,MACN,EAAO,gBAAiB,MAAgB,IAAI,EAAgB,GAAU,EAAQ,CAAC;;AAKnF,IAAa,IAAb,MAA4E;CAC1E,KAAA,IAAsB;AACpB,SAAO,EAAmB,MAAM,MAAM,KAAK,KAAK,cAA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AAClB,MAAI,MAAA,EAAmB,YAAY,MAAA,EAAmB,oBAAoB;GACxE,IAAM,CAAC,GAAiB,KAAiB,EAAW,KAAK,KAAK;AAC9D,OAAI,EAAgB,QAAQ;IAC1B,IAAM,EAAE,wCAAqC,MAAM,OAAO;AACrD,MAAI,EAAiC,KAAK,KAAK,WAAW,EAAc,CAAC;;;;CAKpF,OAAA,IAA4B;AAC1B,MAAI,MAAA,EAAmB,SAAS;GAC9B,IAAM,CAAC,GAAO,KAAgB,EAAmB,KAAK,KAAK;AAC3D,OAAI,CAAC,GAAO;IACV,IAAM,EAAE,+BAA4B,MAAM,OAAO;AAC5C,MAAI,EAAwB,KAAK,KAAK,WAAW,EAAa,KAAK,KAAK,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"type-native-popover.controller.js","names":["#nativeTriggers","#updateLegacyTriggers","#setupLegacyTriggers","#setupModalLightDismiss","#toggleFocus","#parseInterestDelay","#interestTimeout","#observers","#pointerdownWithinModal","#legacyHostTrigger","#previousLegacyTrigger"],"sources":["../../../src/internal/controllers/type-native-popover.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport { clickOutsideElementBounds, generateId, getAttributeListChanges } from '../utils/dom.js';\nimport { attachInternals } from '../utils/a11y.js';\nimport { focusElement } from '../utils/focus.js';\nimport { getHostAnchor, getHostTrigger, hasOpenPopover } from './type-native-popover.utils.js';\nimport type { PopoverType } from '../types/index.js';\nimport type { InterestEvent } from './type-interest.controller.js';\n\nexport interface NativePopover extends ReactiveElement {\n anchor?: HTMLElement | string;\n closeTimeout?: number;\n popoverType?: PopoverType;\n modal?: boolean;\n popoverDismissible?: boolean;\n _activeTrigger?: HTMLElement;\n _internals?: ElementInternals;\n\n /** @deprecated */\n trigger?: HTMLElement | string;\n /** @deprecated */\n openDelay?: number;\n /** @deprecated */\n behaviorTrigger?: boolean;\n}\n\n/**\n * https://open-ui.org/components/popup.research.explainer\n */\nexport class TypeNativePopoverController<T extends NativePopover> implements ReactiveController {\n get #nativeTriggers(): HTMLElement[] {\n const root = this.host.getRootNode() as HTMLElement;\n const popoverTargetTriggers = Array.from(\n root.querySelectorAll(`[popovertarget=\"${CSS.escape ? CSS.escape(this.host.id) : this.host.id}\"]`)\n ) as HTMLElement[];\n\n const commandForTriggers = Array.from(\n root.querySelectorAll(`[commandfor=\"${CSS.escape ? CSS.escape(this.host.id) : this.host.id}\"]`)\n ) as HTMLElement[];\n\n const interestForTriggers = Array.from(\n root.querySelectorAll(`[interestfor=\"${CSS.escape ? CSS.escape(this.host.id) : this.host.id}\"]`)\n ) as HTMLElement[];\n\n return [...popoverTargetTriggers, ...commandForTriggers, ...interestForTriggers];\n }\n\n constructor(private host: T) {\n this.host.addController(this);\n\n const showPopover = this.host.showPopover;\n this.host.showPopover = (options?: ShowPopoverOptions) => {\n if (this.host.isConnected) {\n // provide legacy fallback for source anchor or trigger if not provided, this can happen if the popover is dynamically created in the DOM without the use of the standard popover api or legacy trigger based api\n let source: HTMLElement | Element | null = options?.source ?? null;\n if (!source) {\n if (this.host.anchor) {\n source = getHostAnchor(this.host);\n } else if (this.host.trigger) {\n source = getHostTrigger(this.host, this.host.trigger);\n } else {\n source = globalThis.document.activeElement;\n }\n }\n\n showPopover.call(this.host, { source: source as HTMLElement });\n }\n };\n }\n\n async hostConnected() {\n attachInternals(this.host);\n this.host.popover = this.host.popoverType ?? null;\n await this.host.updateComplete;\n this.host.setAttribute('nve-popover', '');\n this.#updateLegacyTriggers();\n this.#setupLegacyTriggers(); // eslint-disable-line @typescript-eslint/no-floating-promises\n this.#setupModalLightDismiss();\n this.host.inert = this.host.matches(':not(:popover-open)') && !!this.#nativeTriggers.length;\n\n this.host.addEventListener('beforetoggle', e => {\n if (e.newState === 'open') {\n this.host._internals!.states.add('transition-start');\n }\n });\n\n this.host.addEventListener('toggle', (e: ToggleEvent) => {\n if (this.host.behaviorTrigger) {\n this.host.hidden = e.newState === 'closed';\n }\n\n if (e.newState === 'open' && this.host.closeTimeout) {\n setTimeout(() => this.host.hidePopover(), this.host.closeTimeout);\n }\n\n this.host.inert = this.host.matches(':not(:popover-open)');\n\n if (this.host.modal) {\n this.#toggleFocus(e.newState === 'open', e.target as HTMLElement);\n }\n\n this.host.dispatchEvent(\n new CustomEvent(e.newState === 'open' && e.oldState !== 'open' ? 'open' : 'close', {\n bubbles: true,\n composed: true,\n detail: { trigger: e.source }\n })\n );\n });\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API#creating_declarative_popovers\n this.host.addEventListener('command', ((e: CommandEvent) => {\n if (e.command === 'toggle-popover') {\n this.host.togglePopover({ source: e.source as HTMLElement });\n }\n\n if (e.command === 'hide-popover') {\n this.host.hidePopover();\n }\n\n if (e.command === 'show-popover') {\n this.host.showPopover({ source: e.source as HTMLElement });\n }\n }) as EventListener);\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Popover_API/Using_interest_invokers\n this.host.addEventListener('interest', ((e: InterestEvent) => {\n const isCustomElement = e.source?.localName.includes('-');\n if (isCustomElement) {\n const interestDelayStart = this.host.openDelay ?? this.#parseInterestDelay();\n if (interestDelayStart) {\n this.#interestTimeout = setTimeout(() => {\n if (this.host.isConnected) {\n this.host.showPopover({ source: e.source as HTMLElement });\n }\n }, interestDelayStart);\n } else {\n this.host.showPopover({ source: e.source as HTMLElement });\n }\n }\n }) as EventListener);\n\n this.host.addEventListener('loseinterest', ((e: InterestEvent) => {\n const isCustomElement = e.source?.localName.includes('-');\n if (isCustomElement) {\n this.host.hidePopover();\n }\n\n if (this.#interestTimeout) {\n clearTimeout(this.#interestTimeout);\n this.#interestTimeout = null;\n }\n }) as EventListener);\n }\n\n #interestTimeout: ReturnType<typeof setTimeout> | null = null;\n #observers: MutationObserver[] = [];\n #previousLegacyTrigger: HTMLButtonElement | null = null;\n\n async hostUpdated() {\n this.host.popover = this.host.popoverType ?? null;\n this.#updateLegacyTriggers();\n }\n\n hostDisconnected() {\n this.#observers.forEach(observer => observer.disconnect());\n\n if (this.#interestTimeout) {\n clearTimeout(this.#interestTimeout);\n this.#interestTimeout = null;\n }\n }\n\n #parseInterestDelay(): number {\n const style = getComputedStyle(this.host);\n const raw = (style as unknown as { interestDelayStart: string }).interestDelayStart;\n if (!raw) {\n return 0;\n }\n const value = parseFloat(raw);\n return raw.endsWith('ms') ? value : value * 1000;\n }\n\n #pointerdownWithinModal = false;\n\n #setupModalLightDismiss() {\n this.host.addEventListener('pointerdown', e => {\n if (this.host.modal && this.host.matches(':popover-open')) {\n this.#pointerdownWithinModal = clickOutsideElementBounds(e, this.host);\n }\n });\n\n this.host.addEventListener('pointerup', e => {\n if (\n this.#pointerdownWithinModal &&\n this.host.popoverDismissible &&\n this.host.modal &&\n this.host.matches(':popover-open') &&\n !hasOpenPopover(this.host) &&\n clickOutsideElementBounds(e, this.host)\n ) {\n this.host.hidePopover();\n }\n });\n }\n\n get #legacyHostTrigger(): HTMLElement | null {\n return this.host.trigger ? (getHostTrigger(this.host, this.host.trigger) as HTMLButtonElement) : null;\n }\n\n /**\n * @deprecated Legacy behavior that allows popovers to show as open by default when using the legacy trigger based api\n */\n async #setupLegacyTriggers() {\n await new Promise(r => requestAnimationFrame(r));\n\n // setup hidden updates for legacy triggers\n this.#observers.push(\n getAttributeListChanges(this.host, ['hidden'], () => {\n if (this.host.isConnected && !this.host.hidden && !this.host.matches(':popover-open')) {\n this.host.showPopover();\n }\n\n if (this.host.isConnected && this.host.hidden && this.host.matches(':popover-open')) {\n this.host.hidePopover();\n }\n })\n );\n\n // determine if popover is open by default\n if (\n this.host.isConnected &&\n !this.#nativeTriggers.length &&\n !this.host.hidden &&\n !this.host.matches(':popover-open')\n ) {\n this.host.popover = 'manual';\n this.host.showPopover();\n }\n }\n\n /**\n * @deprecated Legacy behavior that allows popovers to show as open by default when using the legacy trigger based api\n */\n #updateLegacyTriggers() {\n const trigger = this.#legacyHostTrigger as HTMLButtonElement;\n\n // Clean up previous trigger if it changed\n if (this.#previousLegacyTrigger && this.#previousLegacyTrigger !== trigger) {\n this.#previousLegacyTrigger.popoverTargetElement = null;\n this.#previousLegacyTrigger.removeAttribute('popovertarget');\n }\n\n // if not a hint type setup native popovertarget\n if (trigger) {\n if (this.host.popoverType === 'hint') {\n trigger.addEventListener('mouseenter', () => this.host.showPopover({ source: trigger as HTMLElement }));\n trigger.addEventListener('mouseleave', () => this.host.hidePopover());\n trigger.addEventListener('focusout', () => this.host.hidePopover());\n } else {\n this.host.id = this.host.id ? this.host.id : generateId();\n trigger.popoverTargetElement = this.host;\n trigger.setAttribute('popovertarget', this.host.id);\n }\n this.#previousLegacyTrigger = trigger;\n }\n }\n\n #toggleFocus(open: boolean, target: HTMLElement) {\n if (open) {\n // only focus popover if not the active element and not containing the active element already\n if ((this.host.getRootNode() as Document).activeElement !== this.host && !this.host.shadowRoot!.activeElement) {\n focusElement(this.host);\n }\n } else {\n focusElement(target);\n }\n }\n}\n"],"mappings":";;;;;AA+BA,IAAa,IAAb,MAAgG;CAC9F,KAAA,IAAqC;EACnC,IAAM,IAAO,KAAK,KAAK,aAAa,EAC9B,IAAwB,MAAM,KAClC,EAAK,iBAAiB,mBAAmB,IAAI,SAAS,IAAI,OAAO,KAAK,KAAK,GAAG,GAAG,KAAK,KAAK,GAAG,IAAI,CACnG,EAEK,IAAqB,MAAM,KAC/B,EAAK,iBAAiB,gBAAgB,IAAI,SAAS,IAAI,OAAO,KAAK,KAAK,GAAG,GAAG,KAAK,KAAK,GAAG,IAAI,CAChG,EAEK,IAAsB,MAAM,KAChC,EAAK,iBAAiB,iBAAiB,IAAI,SAAS,IAAI,OAAO,KAAK,KAAK,GAAG,GAAG,KAAK,KAAK,GAAG,IAAI,CACjG;AAED,SAAO;GAAC,GAAG;GAAuB,GAAG;GAAoB,GAAG;GAAoB;;CAGlF,YAAY,GAAiB;AAC3B,EADkB,K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KAAK,YAAY,EAAE,QAAQ,GAAwB,CAAC,CAAC,EACvG,EAAQ,iBAAiB,oBAAoB,KAAK,KAAK,aAAa,CAAC,EACrE,EAAQ,iBAAiB,kBAAkB,KAAK,KAAK,aAAa,CAAC,KAEnE,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,GAAY,EACzD,EAAQ,uBAAuB,KAAK,MACpC,EAAQ,aAAa,iBAAiB,KAAK,KAAK,GAAG,GAErD,MAAA,IAA8B;;CAIlC,GAAa,GAAe,GAAqB;AAC/C,EAAI,IAEG,KAAK,KAAK,aAAa,CAAc,kBAAkB,KAAK,QAAQ,CAAC,KAAK,KAAK,WAAY,iBAC9F,EAAa,KAAK,KAAK,GAGzB,EAAa,EAAO"}
1
+ {"version":3,"file":"type-native-popover.controller.js","names":["#nativeTriggers","#updateLegacyTriggers","#setupLegacyTriggers","#setupModalLightDismiss","#toggleFocus","#parseInterestDelay","#interestTimeout","#observers","#pointerdownWithinModal","#legacyHostTrigger","#previousLegacyTrigger"],"sources":["../../../src/internal/controllers/type-native-popover.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport { clickOutsideElementBounds, generateId, getAttributeListChanges } from '../utils/dom.js';\nimport { attachInternals } from '../utils/a11y.js';\nimport { focusElement } from '../utils/focus.js';\nimport { getHostAnchor, getHostTrigger, hasOpenPopover } from './type-native-popover.utils.js';\nimport type { PopoverType } from '../types/index.js';\nimport type { InterestEvent } from './type-interest.controller.js';\n\nexport interface NativePopover extends ReactiveElement {\n anchor?: HTMLElement | string;\n closeTimeout?: number;\n popoverType?: PopoverType;\n modal?: boolean;\n popoverDismissible?: boolean;\n _activeTrigger?: HTMLElement;\n _internals?: ElementInternals;\n\n /** @deprecated */\n trigger?: HTMLElement | string;\n /** @deprecated */\n openDelay?: number;\n /** @deprecated */\n behaviorTrigger?: boolean;\n}\n\n/**\n * https://open-ui.org/components/popup.research.explainer\n */\nexport class TypeNativePopoverController<T extends NativePopover> implements ReactiveController {\n get #nativeTriggers(): HTMLElement[] {\n const root = this.host.getRootNode() as HTMLElement;\n const popoverTargetTriggers = Array.from(\n root.querySelectorAll(`[popovertarget=\"${CSS.escape ? CSS.escape(this.host.id) : this.host.id}\"]`)\n ) as HTMLElement[];\n\n const commandForTriggers = Array.from(\n root.querySelectorAll(`[commandfor=\"${CSS.escape ? CSS.escape(this.host.id) : this.host.id}\"]`)\n ) as HTMLElement[];\n\n const interestForTriggers = Array.from(\n root.querySelectorAll(`[interestfor=\"${CSS.escape ? CSS.escape(this.host.id) : this.host.id}\"]`)\n ) as HTMLElement[];\n\n return [...popoverTargetTriggers, ...commandForTriggers, ...interestForTriggers];\n }\n\n constructor(private host: T) {\n this.host.addController(this);\n\n const showPopover = this.host.showPopover;\n this.host.showPopover = (options?: ShowPopoverOptions) => {\n if (this.host.isConnected) {\n // provide legacy fallback for source anchor or trigger if not provided, this can happen if the popover is dynamically created in the DOM without the use of the standard popover api or legacy trigger based api\n let source: HTMLElement | Element | null = options?.source ?? null;\n if (!source) {\n if (this.host.anchor) {\n source = getHostAnchor(this.host);\n } else if (this.host.trigger) {\n source = getHostTrigger(this.host, this.host.trigger);\n } else {\n source = globalThis.document.activeElement;\n }\n }\n\n showPopover.call(this.host, { source: source as HTMLElement });\n }\n };\n }\n\n // eslint-disable-next-line max-lines-per-function\n async hostConnected() {\n attachInternals(this.host);\n this.host.popover = this.host.popoverType ?? null;\n await this.host.updateComplete;\n this.host.setAttribute('nve-popover', '');\n this.#updateLegacyTriggers();\n this.#setupLegacyTriggers(); // eslint-disable-line @typescript-eslint/no-floating-promises\n this.#setupModalLightDismiss();\n this.host.inert = this.host.matches(':not(:popover-open)') && !!this.#nativeTriggers.length;\n\n this.host.addEventListener('beforetoggle', e => {\n if (e.newState === 'open') {\n this.host._internals!.states.add('transition-start');\n }\n });\n\n this.host.addEventListener('toggle', (e: ToggleEvent) => {\n if (this.host.behaviorTrigger) {\n this.host.hidden = e.newState === 'closed';\n }\n\n if (e.newState === 'open' && this.host.closeTimeout) {\n setTimeout(() => this.host.hidePopover(), this.host.closeTimeout);\n }\n\n this.host.inert = this.host.matches(':not(:popover-open)');\n\n if (this.host.modal) {\n this.#toggleFocus(e.newState === 'open', e.target as HTMLElement);\n }\n\n this.host.dispatchEvent(\n new CustomEvent(e.newState === 'open' && e.oldState !== 'open' ? 'open' : 'close', {\n bubbles: true,\n composed: true,\n detail: { trigger: e.source }\n })\n );\n });\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API#creating_declarative_popovers\n this.host.addEventListener('command', ((e: CommandEvent) => {\n if (e.command === 'toggle-popover') {\n this.host.togglePopover({ source: e.source as HTMLElement });\n }\n\n if (e.command === 'hide-popover') {\n this.host.hidePopover();\n }\n\n if (e.command === 'show-popover') {\n this.host.showPopover({ source: e.source as HTMLElement });\n }\n }) as EventListener);\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Popover_API/Using_interest_invokers\n this.host.addEventListener('interest', ((e: InterestEvent) => {\n const isCustomElement = e.source?.localName.includes('-');\n if (isCustomElement) {\n const interestDelayStart = this.host.openDelay ?? this.#parseInterestDelay();\n if (interestDelayStart) {\n this.#interestTimeout = setTimeout(() => {\n if (this.host.isConnected) {\n this.host.showPopover({ source: e.source as HTMLElement });\n }\n }, interestDelayStart);\n } else {\n this.host.showPopover({ source: e.source as HTMLElement });\n }\n }\n }) as EventListener);\n\n this.host.addEventListener('loseinterest', ((e: InterestEvent) => {\n const isCustomElement = e.source?.localName.includes('-');\n if (isCustomElement) {\n this.host.hidePopover();\n }\n\n if (this.#interestTimeout) {\n clearTimeout(this.#interestTimeout);\n this.#interestTimeout = null;\n }\n }) as EventListener);\n }\n\n #interestTimeout: ReturnType<typeof setTimeout> | null = null;\n #observers: MutationObserver[] = [];\n #previousLegacyTrigger: HTMLButtonElement | null = null;\n\n async hostUpdated() {\n this.host.popover = this.host.popoverType ?? null;\n this.#updateLegacyTriggers();\n }\n\n hostDisconnected() {\n this.#observers.forEach(observer => observer.disconnect());\n\n if (this.#interestTimeout) {\n clearTimeout(this.#interestTimeout);\n this.#interestTimeout = null;\n }\n }\n\n #parseInterestDelay(): number {\n const style = getComputedStyle(this.host);\n const raw = (style as unknown as { interestDelayStart: string }).interestDelayStart;\n if (!raw) {\n return 0;\n }\n const value = parseFloat(raw);\n return raw.endsWith('ms') ? value : value * 1000;\n }\n\n #pointerdownWithinModal = false;\n\n #setupModalLightDismiss() {\n this.host.addEventListener('pointerdown', e => {\n if (this.host.modal && this.host.matches(':popover-open')) {\n this.#pointerdownWithinModal = clickOutsideElementBounds(e, this.host);\n }\n });\n\n this.host.addEventListener('pointerup', e => {\n if (\n this.#pointerdownWithinModal &&\n this.host.popoverDismissible &&\n this.host.modal &&\n this.host.matches(':popover-open') &&\n !hasOpenPopover(this.host) &&\n clickOutsideElementBounds(e, this.host)\n ) {\n this.host.hidePopover();\n }\n });\n }\n\n get #legacyHostTrigger(): HTMLElement | null {\n return this.host.trigger ? (getHostTrigger(this.host, this.host.trigger) as HTMLButtonElement) : null;\n }\n\n /**\n * @deprecated Legacy behavior that allows popovers to show as open by default when using the legacy trigger based api\n */\n async #setupLegacyTriggers() {\n await new Promise(r => requestAnimationFrame(r));\n\n // setup hidden updates for legacy triggers\n this.#observers.push(\n getAttributeListChanges(this.host, ['hidden'], () => {\n if (this.host.isConnected && !this.host.hidden && !this.host.matches(':popover-open')) {\n this.host.showPopover();\n }\n\n if (this.host.isConnected && this.host.hidden && this.host.matches(':popover-open')) {\n this.host.hidePopover();\n }\n })\n );\n\n // determine if popover is open by default\n if (\n this.host.isConnected &&\n !this.#nativeTriggers.length &&\n !this.host.hidden &&\n !this.host.matches(':popover-open')\n ) {\n this.host.popover = 'manual';\n this.host.showPopover();\n }\n }\n\n /**\n * @deprecated Legacy behavior that allows popovers to show as open by default when using the legacy trigger based api\n */\n #updateLegacyTriggers() {\n const trigger = this.#legacyHostTrigger as HTMLButtonElement;\n\n // Clean up previous trigger if it changed\n if (this.#previousLegacyTrigger && this.#previousLegacyTrigger !== trigger) {\n this.#previousLegacyTrigger.popoverTargetElement = null;\n this.#previousLegacyTrigger.removeAttribute('popovertarget');\n }\n\n // if not a hint type setup native popovertarget\n if (trigger) {\n if (this.host.popoverType === 'hint') {\n trigger.addEventListener('mouseenter', () => this.host.showPopover({ source: trigger as HTMLElement }));\n trigger.addEventListener('mouseleave', () => this.host.hidePopover());\n trigger.addEventListener('focusout', () => this.host.hidePopover());\n } else {\n this.host.id = this.host.id ? this.host.id : generateId();\n trigger.popoverTargetElement = this.host;\n trigger.setAttribute('popovertarget', this.host.id);\n }\n this.#previousLegacyTrigger = trigger;\n }\n }\n\n #toggleFocus(open: boolean, target: HTMLElement) {\n if (open) {\n // only focus popover if not the active element and not containing the active element already\n if ((this.host.getRootNode() as Document).activeElement !== this.host && !this.host.shadowRoot!.activeElement) {\n focusElement(this.host);\n }\n } else {\n focusElement(target);\n }\n }\n}\n"],"mappings":";;;;;AA+BA,IAAa,IAAb,MAAgG;CAC9F,KAAA,IAAqC;EACnC,IAAM,IAAO,KAAK,KAAK,aAAa,EAC9B,IAAwB,MAAM,KAClC,EAAK,iBAAiB,mBAAmB,IAAI,SAAS,IAAI,OAAO,KAAK,KAAK,GAAG,GAAG,KAAK,KAAK,GAAG,IAAI,CACnG,EAEK,IAAqB,MAAM,KAC/B,EAAK,iBAAiB,gBAAgB,IAAI,SAAS,IAAI,OAAO,KAAK,KAAK,GAAG,GAAG,KAAK,KAAK,GAAG,IAAI,CAChG,EAEK,IAAsB,MAAM,KAChC,EAAK,iBAAiB,iBAAiB,IAAI,SAAS,IAAI,OAAO,KAAK,KAAK,GAAG,GAAG,KAAK,KAAK,GAAG,IAAI,CACjG;AAED,SAAO;GAAC,GAAG;GAAuB,GAAG;GAAoB,GAAG;GAAoB;;CAGlF,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AQ,iBAAiB,oBAAoB,KAAK,KAAK,YAAY,EAAE,QAAQ,GAAwB,CAAC,CAAC,EACvG,EAAQ,iBAAiB,oBAAoB,KAAK,KAAK,aAAa,CAAC,EACrE,EAAQ,iBAAiB,kBAAkB,KAAK,KAAK,aAAa,CAAC,KAEnE,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,GAAY,EACzD,EAAQ,uBAAuB,KAAK,MACpC,EAAQ,aAAa,iBAAiB,KAAK,KAAK,GAAG,GAErD,MAAA,IAA8B;;CAIlC,GAAa,GAAe,GAAqB;AAC/C,EAAI,IAEG,KAAK,KAAK,aAAa,CAAc,kBAAkB,KAAK,QAAQ,CAAC,KAAK,KAAK,WAAY,iBAC9F,EAAa,KAAK,KAAK,GAGzB,EAAa,EAAO"}
@@ -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 options = 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' && options.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,IAAM,EAAkB;AACnH,SAAQ,MACN,EAAO,gBACJ,MAAmD,IAAI,EAAkB,GAAU,EAAQ,CAC7F;;AAGL,IAAa,IAAb,MAAwF;CAItF,YACE,GACA,GACA;AAIA,MANQ,KAAA,OAAA,GACA,KAAA,UAAA,iBAJD,EAAQ,KAAK,KAAK,YAMzB,KAAK,KAAK,cAAc,KAAK,EAGzB,KAAK,QAAQ;GACf,IAAM,IAAU,KAAK,SACf,IAAiB,EAAK;AAC5B,UAAO,eAAe,GAAM,UAAU,EACpC,OAAO,WAAY;AACjB,QAAI;AACF,OAAe,KAAK,EAAK;YAEf;KACV,IAAM,IAAa,EAAK;AAIxB,KAHA,EAAW,YAAY,EAAW,UAAU,MAAM,gBAAgB,CAAC,IACnE,EAAO,EAAK,QAAQ,EAAE,GAAY,EAAK,cAAc,EAEjD,GAAQ,KAAK,gBAAgB,EAAQ,OACvC,EAAW,KAAK,EAAsB,EAAK,UAAU,CAAC;;AAG1D,WAAO;MAEV,CAAC;;;CAIN,KAAe;CACf,cAAc;AAGZ,EAAI,KAAK,UAAU,MAAA,MACjB,MAAA,IAAoB,IACpB,KAAK,KAAK,YAAY,iBAAiB,OAAO,CAAC,SAAQ,MAAe;AACpE,KAAY,cAAc,IAAI,MAAM,cAAc;IAAE,SAAS;IAAM,UAAU;IAAO,YAAY;IAAO,CAAC,CAAC;IACzG,EAGE,KAAK,KAAK,YAAY,QACxB,KAAK,KAAK,aAAa,QAAQ,KAAK,KAAK,WAAW,KAAK"}
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,IAAM,EAAkB;AACnH,SAAQ,MACN,EAAO,gBACJ,MAAmD,IAAI,EAAkB,GAAU,EAAQ,CAC7F;;AAGL,IAAa,IAAb,MAAwF;CAItF,YACE,GACA,GACA;AAIA,MANQ,KAAA,OAAA,GACA,KAAA,UAAA,iBAJD,EAAQ,KAAK,KAAK,YAMzB,KAAK,KAAK,cAAc,KAAK,EAGzB,KAAK,QAAQ;GACf,IAAM,IAAoB,KAAK,SACzB,IAAiB,EAAK;AAC5B,UAAO,eAAe,GAAM,UAAU,EACpC,OAAO,WAAY;AACjB,QAAI;AACF,OAAe,KAAK,EAAK;YAEf;KACV,IAAM,IAAa,EAAK;AAIxB,KAHA,EAAW,YAAY,EAAW,UAAU,MAAM,gBAAgB,CAAC,IACnE,EAAO,EAAK,QAAQ,EAAE,GAAY,EAAK,cAAc,EAEjD,GAAQ,KAAK,gBAAgB,EAAkB,OACjD,EAAW,KAAK,EAAsB,EAAK,UAAU,CAAC;;AAG1D,WAAO;MAEV,CAAC;;;CAIN,KAAe;CACf,cAAc;AAGZ,EAAI,KAAK,UAAU,MAAA,MACjB,MAAA,IAAoB,IACpB,KAAK,KAAK,YAAY,iBAAiB,OAAO,CAAC,SAAQ,MAAe;AACpE,KAAY,cAAc,IAAI,MAAM,cAAc;IAAE,SAAS;IAAM,UAAU;IAAO,YAAY;IAAO,CAAC,CAAC;IACzG,EAGE,KAAK,KAAK,YAAY,QACxB,KAAK,KAAK,aAAa,QAAQ,KAAK,KAAK,WAAW,KAAK"}
@@ -2,43 +2,43 @@ import { DOCS_URL as e, formatFileSize as t, shiftLeft as n } from "./utils/stri
2
2
  import { deepMerge as r, formatStandardNumber as i, getDifference as a, isObject as o, isObjectLiteral as s, parseVersion as c } from "./utils/objects.js";
3
3
  import { GlobalState as l, GlobalStateService as u } from "./services/global.service.js";
4
4
  import { focusElement as d, focusElementTimeout as f, getActiveElement as p, initializeKeyListItems as m, isFocusable as h, isSimpleFocusable as g, onListboxActivate as _, setActiveKeyListItem as v } from "./utils/focus.js";
5
- import { KeynavCode as y, appendAnchorName as b, appendRootNodeStyle as x, applySlotContentStates as S, clickOutsideElementBounds as C, createGhostElement as w, define as T, defineElement as E, endOfScrollBox as D, generateId as O, getAnchorNames as k, getAttributeChanges as A, getAttributeListChanges as j, getChildren as M, getDisplayValue as N, getElementUpdate as P, getFlattenedDOMTree as F, getFlattenedFocusableItems as I, getPropertyChanges as L, getThemeTokens as R, hasHorizontalScrollBar as z, hasInvalidDOMGrid as B, hasScrollBar as V, isContextMenuClick as H, matchesElementName as U, openEyeDropper as W, parseTokenNumber as G, removeAnchorName as K, removeEmptySlotWhitespace as q, removeEmptyTextNode as J, sameOrderedStringArray as Y, sameRenderRoot as X, scrollBarWidth as Z, slotContainsOnlyWhitespace as Q, styleSheetToString as $, supportsScopedRegistry as ee, tagSelector as te, uniqueNonEmptyStrings as ne, validKeyNavigationCode as re } from "./utils/dom.js";
6
- import { associateAriaDescribedBy as ie, associateAriaLabel as ae, associateControlGroup as oe, associateDataList as se, associateLabel as ce, attachInternals as le } from "./utils/a11y.js";
7
- import { StateActiveController as ue, stateActive as de } from "./controllers/state-active.controller.js";
8
- import { StateDisabledController as fe, stateDisabled as pe } from "./controllers/state-disabled.controller.js";
9
- import { StateExpandedController as me, stateExpanded as he } from "./controllers/state-expanded.controller.js";
10
- import { StatePressedController as ge, statePressed as _e } from "./controllers/state-pressed.controller.js";
11
- import { StateSelectedController as ve, stateSelected as ye } from "./controllers/state-selected.controller.js";
12
- import { TypeButtonController as be, typeButton as xe } from "./controllers/type-button.controller.js";
13
- import { TypeAnchorController as Se, typeAnchor as Ce } from "./controllers/type-anchor.controller.js";
14
- import { debounce as we, onChildListMutation as Te, stopEvent as Ee, throttle as De } from "./utils/events.js";
15
- import { createLightDismiss as Oe, onKeys as ke } from "./utils/keynav.js";
16
- import { TypeSubmitController as Ae, typeSubmit as je } from "./controllers/type-submit.controller.js";
17
- import { LogService as Me } from "./services/log.service.js";
18
- import { TypeNativePopoverTriggerController as Ne, typeNativePopoverTrigger as Pe } from "./controllers/type-native-popover-trigger.controller.js";
19
- import { StateCurrentController as Fe, stateCurrent as Ie } from "./controllers/state-current.controller.js";
20
- import { TypeCommandController as Le, typeCommand as Re } from "./controllers/type-command.controller.js";
21
- import { TypeInterestController as ze, typeInterest as Be } from "./controllers/type-interest.controller.js";
22
- import { BaseButton as Ve } from "./base/button.js";
23
- import { auditParentElement as He, auditSlots as Ue } from "./utils/audit.js";
24
- import { AuditController as We, audit as Ge, excessiveInstanceLimit as Ke } from "./controllers/audit.controller.js";
25
- import { I18nService as qe, I18nService_ as Je } from "./services/i18n.service.js";
26
- import { I18nController as Ye, i18n as Xe } from "./controllers/i18n.controller.js";
27
- import { KeyNavigationGridController as Ze, getNextKeyGridItem as Qe, keyNavigationGrid as $e } from "./controllers/keynav-grid.controller.js";
28
- import { KeyNavigationListController as et, getNextKeyListItem as tt, keyNavigationList as nt } from "./controllers/keynav-list.controller.js";
29
- import { StateHighlightedController as rt, stateHighlighted as it } from "./controllers/state-highlighted.controller.js";
30
- import { StateScrollController as at, stateScroll as ot } from "./controllers/state-scroll.controller.js";
31
- import { TypeClosableController as st } from "./controllers/type-closable.controller.js";
32
- import { TypeExpandableController as ct } from "./controllers/type-expandable.controller.js";
33
- import { TypeSelectableController as lt } from "./controllers/type-selectable.controller.js";
34
- import { TypeNativePopoverController as ut } from "./controllers/type-native-popover.controller.js";
35
- import { TypeSSRController as dt, typeSSR as ft } from "./controllers/type-ssr.controller.js";
36
- import { NveTouchEvent as pt, TypeTouchController as mt, typeTouch as ht } from "./controllers/type-touch.controller.js";
37
- import { hostAttr as gt } from "./decorators/host-attr.js";
38
- import { scopedRegistry as _t } from "./decorators/scoped-registry.js";
39
- import { colorStateStyles as vt, statusStateStyles as yt, supportStateStyles as bt, useStyles as xt } from "./styles/index.js";
40
- import { supportsCSSLegacyInsetArea as St, supportsCSSPositionArea as Ct, supportsNativeCSSAnchorPosition as wt } from "./utils/supports.js";
41
- import { popoverStyles as Tt } from "./styles/popover2.js";
42
- import { TransitionService as Et } from "./services/transition.service.js";
43
- import { statusIcons as Dt } from "./types/index.js";
44
- export { We as AuditController, Ve as BaseButton, e as DOCS_URL, l as GlobalState, u as GlobalStateService, Ye as I18nController, qe as I18nService, Je as I18nService_, Ze as KeyNavigationGridController, et as KeyNavigationListController, y as KeynavCode, Me as LogService, pt as NveTouchEvent, ue as StateActiveController, Fe as StateCurrentController, fe as StateDisabledController, me as StateExpandedController, rt as StateHighlightedController, ge as StatePressedController, at as StateScrollController, ve as StateSelectedController, Et as TransitionService, Se as TypeAnchorController, be as TypeButtonController, st as TypeClosableController, Le as TypeCommandController, ct as TypeExpandableController, ze as TypeInterestController, ut as TypeNativePopoverController, Ne as TypeNativePopoverTriggerController, dt as TypeSSRController, lt as TypeSelectableController, Ae as TypeSubmitController, mt as TypeTouchController, b as appendAnchorName, x as appendRootNodeStyle, S as applySlotContentStates, ie as associateAriaDescribedBy, ae as associateAriaLabel, oe as associateControlGroup, se as associateDataList, ce as associateLabel, le as attachInternals, Ge as audit, He as auditParentElement, Ue as auditSlots, C as clickOutsideElementBounds, vt as colorStateStyles, w as createGhostElement, Oe as createLightDismiss, we as debounce, r as deepMerge, T as define, E as defineElement, D as endOfScrollBox, Ke as excessiveInstanceLimit, d as focusElement, f as focusElementTimeout, t as formatFileSize, i as formatStandardNumber, O as generateId, p as getActiveElement, k as getAnchorNames, A as getAttributeChanges, j as getAttributeListChanges, M as getChildren, a as getDifference, N as getDisplayValue, P as getElementUpdate, F as getFlattenedDOMTree, I as getFlattenedFocusableItems, Qe as getNextKeyGridItem, tt as getNextKeyListItem, L as getPropertyChanges, R as getThemeTokens, z as hasHorizontalScrollBar, B as hasInvalidDOMGrid, V as hasScrollBar, gt as hostAttr, Xe as i18n, m as initializeKeyListItems, H as isContextMenuClick, h as isFocusable, o as isObject, s as isObjectLiteral, g as isSimpleFocusable, $e as keyNavigationGrid, nt as keyNavigationList, U as matchesElementName, Te as onChildListMutation, ke as onKeys, _ as onListboxActivate, W as openEyeDropper, G as parseTokenNumber, c as parseVersion, Tt as popoverStyles, K as removeAnchorName, q as removeEmptySlotWhitespace, J as removeEmptyTextNode, Y as sameOrderedStringArray, X as sameRenderRoot, _t as scopedRegistry, Z as scrollBarWidth, v as setActiveKeyListItem, n as shiftLeft, Q as slotContainsOnlyWhitespace, de as stateActive, Ie as stateCurrent, pe as stateDisabled, he as stateExpanded, it as stateHighlighted, _e as statePressed, ot as stateScroll, ye as stateSelected, Dt as statusIcons, yt as statusStateStyles, Ee as stopEvent, $ as styleSheetToString, bt as supportStateStyles, St as supportsCSSLegacyInsetArea, Ct as supportsCSSPositionArea, wt as supportsNativeCSSAnchorPosition, ee as supportsScopedRegistry, te as tagSelector, De as throttle, Ce as typeAnchor, xe as typeButton, Re as typeCommand, Be as typeInterest, Pe as typeNativePopoverTrigger, ft as typeSSR, je as typeSubmit, ht as typeTouch, ne as uniqueNonEmptyStrings, xt as useStyles, re as validKeyNavigationCode };
5
+ import { KeynavCode as y, appendAnchorName as b, appendRootNodeStyle as x, applySlotContentStates as S, clickOutsideElementBounds as C, createGhostElement as w, define as T, defineElement as E, endOfScrollBox as D, generateId as O, getAnchorNames as k, getAttributeChanges as A, getAttributeListChanges as j, getChildren as M, getDisplayValue as N, getElementUpdate as P, getFlattenedDOMTree as F, getFlattenedFocusableItems as I, getPropertyChanges as L, getThemeTokens as R, hasHorizontalScrollBar as z, hasInvalidDOMGrid as B, hasScrollBar as V, isContextMenuClick as H, matchesElementName as U, openEyeDropper as W, parseTokenNumber as G, removeAnchorName as K, removeEmptySlotWhitespace as q, removeEmptyTextNode as J, sameOrderedStringArray as Y, sameRenderRoot as X, scrollBarWidth as Z, slotContainsOnlyWhitespace as Q, styleSheetToString as $, supportsScopedRegistry as ee, uniqueNonEmptyStrings as te, validKeyNavigationCode as ne } from "./utils/dom.js";
6
+ import { associateAriaDescribedBy as re, associateAriaLabel as ie, associateControlGroup as ae, associateDataList as oe, associateLabel as se, attachInternals as ce } from "./utils/a11y.js";
7
+ import { StateActiveController as le, stateActive as ue } from "./controllers/state-active.controller.js";
8
+ import { StateDisabledController as de, stateDisabled as fe } from "./controllers/state-disabled.controller.js";
9
+ import { StateExpandedController as pe, stateExpanded as me } from "./controllers/state-expanded.controller.js";
10
+ import { StatePressedController as he, statePressed as ge } from "./controllers/state-pressed.controller.js";
11
+ import { StateSelectedController as _e, stateSelected as ve } from "./controllers/state-selected.controller.js";
12
+ import { TypeButtonController as ye, typeButton as be } from "./controllers/type-button.controller.js";
13
+ import { TypeAnchorController as xe, typeAnchor as Se } from "./controllers/type-anchor.controller.js";
14
+ import { debounce as Ce, onChildListMutation as we, stopEvent as Te, throttle as Ee } from "./utils/events.js";
15
+ import { createLightDismiss as De, onKeys as Oe } from "./utils/keynav.js";
16
+ import { TypeSubmitController as ke, typeSubmit as Ae } from "./controllers/type-submit.controller.js";
17
+ import { LogService as je } from "./services/log.service.js";
18
+ import { TypeNativePopoverTriggerController as Me, typeNativePopoverTrigger as Ne } from "./controllers/type-native-popover-trigger.controller.js";
19
+ import { StateCurrentController as Pe, stateCurrent as Fe } from "./controllers/state-current.controller.js";
20
+ import { TypeCommandController as Ie, typeCommand as Le } from "./controllers/type-command.controller.js";
21
+ import { TypeInterestController as Re, typeInterest as ze } from "./controllers/type-interest.controller.js";
22
+ import { BaseButton as Be } from "./base/button.js";
23
+ import { auditParentElement as Ve, auditSlots as He } from "./utils/audit.js";
24
+ import { AuditController as Ue, audit as We, excessiveInstanceLimit as Ge } from "./controllers/audit.controller.js";
25
+ import { I18nService as Ke, I18nService_ as qe } from "./services/i18n.service.js";
26
+ import { I18nController as Je, i18n as Ye } from "./controllers/i18n.controller.js";
27
+ import { KeyNavigationGridController as Xe, getNextKeyGridItem as Ze, keyNavigationGrid as Qe } from "./controllers/keynav-grid.controller.js";
28
+ import { KeyNavigationListController as $e, getNextKeyListItem as et, keyNavigationList as tt } from "./controllers/keynav-list.controller.js";
29
+ import { StateHighlightedController as nt, stateHighlighted as rt } from "./controllers/state-highlighted.controller.js";
30
+ import { StateScrollController as it, stateScroll as at } from "./controllers/state-scroll.controller.js";
31
+ import { TypeClosableController as ot } from "./controllers/type-closable.controller.js";
32
+ import { TypeExpandableController as st } from "./controllers/type-expandable.controller.js";
33
+ import { TypeSelectableController as ct } from "./controllers/type-selectable.controller.js";
34
+ import { TypeNativePopoverController as lt } from "./controllers/type-native-popover.controller.js";
35
+ import { TypeSSRController as ut, typeSSR as dt } from "./controllers/type-ssr.controller.js";
36
+ import { NveTouchEvent as ft, TypeTouchController as pt, typeTouch as mt } from "./controllers/type-touch.controller.js";
37
+ import { hostAttr as ht } from "./decorators/host-attr.js";
38
+ import { scopedRegistry as gt } from "./decorators/scoped-registry.js";
39
+ import { colorStateStyles as _t, statusStateStyles as vt, supportStateStyles as yt, useStyles as bt } from "./styles/index.js";
40
+ import { supportsCSSLegacyInsetArea as xt, supportsCSSPositionArea as St, supportsNativeCSSAnchorPosition as Ct } from "./utils/supports.js";
41
+ import { popoverStyles as wt } from "./styles/popover2.js";
42
+ import { TransitionService as Tt } from "./services/transition.service.js";
43
+ import { statusIcons as Et } from "./types/index.js";
44
+ export { Ue as AuditController, Be as BaseButton, e as DOCS_URL, l as GlobalState, u as GlobalStateService, Je as I18nController, Ke as I18nService, qe as I18nService_, Xe as KeyNavigationGridController, $e as KeyNavigationListController, y as KeynavCode, je as LogService, ft as NveTouchEvent, le as StateActiveController, Pe as StateCurrentController, de as StateDisabledController, pe as StateExpandedController, nt as StateHighlightedController, he as StatePressedController, it as StateScrollController, _e as StateSelectedController, Tt as TransitionService, xe as TypeAnchorController, ye as TypeButtonController, ot as TypeClosableController, Ie as TypeCommandController, st as TypeExpandableController, Re as TypeInterestController, lt as TypeNativePopoverController, Me as TypeNativePopoverTriggerController, ut as TypeSSRController, ct as TypeSelectableController, ke as TypeSubmitController, pt as TypeTouchController, b as appendAnchorName, x as appendRootNodeStyle, S as applySlotContentStates, re as associateAriaDescribedBy, ie as associateAriaLabel, ae as associateControlGroup, oe as associateDataList, se as associateLabel, ce as attachInternals, We as audit, Ve as auditParentElement, He as auditSlots, C as clickOutsideElementBounds, _t as colorStateStyles, w as createGhostElement, De as createLightDismiss, Ce as debounce, r as deepMerge, T as define, E as defineElement, D as endOfScrollBox, Ge as excessiveInstanceLimit, d as focusElement, f as focusElementTimeout, t as formatFileSize, i as formatStandardNumber, O as generateId, p as getActiveElement, k as getAnchorNames, A as getAttributeChanges, j as getAttributeListChanges, M as getChildren, a as getDifference, N as getDisplayValue, P as getElementUpdate, F as getFlattenedDOMTree, I as getFlattenedFocusableItems, Ze as getNextKeyGridItem, et as getNextKeyListItem, L as getPropertyChanges, R as getThemeTokens, z as hasHorizontalScrollBar, B as hasInvalidDOMGrid, V as hasScrollBar, ht as hostAttr, Ye as i18n, m as initializeKeyListItems, H as isContextMenuClick, h as isFocusable, o as isObject, s as isObjectLiteral, g as isSimpleFocusable, Qe as keyNavigationGrid, tt as keyNavigationList, U as matchesElementName, we as onChildListMutation, Oe as onKeys, _ as onListboxActivate, W as openEyeDropper, G as parseTokenNumber, c as parseVersion, wt as popoverStyles, K as removeAnchorName, q as removeEmptySlotWhitespace, J as removeEmptyTextNode, Y as sameOrderedStringArray, X as sameRenderRoot, gt as scopedRegistry, Z as scrollBarWidth, v as setActiveKeyListItem, n as shiftLeft, Q as slotContainsOnlyWhitespace, ue as stateActive, Fe as stateCurrent, fe as stateDisabled, me as stateExpanded, rt as stateHighlighted, ge as statePressed, at as stateScroll, ve as stateSelected, Et as statusIcons, vt as statusStateStyles, Te as stopEvent, $ as styleSheetToString, yt as supportStateStyles, xt as supportsCSSLegacyInsetArea, St as supportsCSSPositionArea, Ct as supportsNativeCSSAnchorPosition, ee as supportsScopedRegistry, Ee as throttle, Se as typeAnchor, be as typeButton, Le as typeCommand, ze as typeInterest, Ne as typeNativePopoverTrigger, dt as typeSSR, Ae as typeSubmit, mt as typeTouch, te as uniqueNonEmptyStrings, bt as useStyles, ne as validKeyNavigationCode };
@@ -19,7 +19,7 @@ var a = class {
19
19
  i18nRegistry: {},
20
20
  audit: {}
21
21
  }
22
- }, globalThis.NVE_ELEMENTS.state.versions = Array.from(new Set([...globalThis.NVE_ELEMENTS.state.versions, "0.0.7"])), globalThis.NVE_ELEMENTS.state.scopedRegistry ??= {}, globalThis.NVE_ELEMENTS.state.scopedRegistry["0.0.7"] = i(), globalThis.NVE_ELEMENTS.state.versions.length > 1 && globalThis.NVE_ELEMENTS.state.env !== "production" && console.warn(e(), `\n\n${JSON.stringify(globalThis.NVE_ELEMENTS.state.versions, null, 2)}`);
22
+ }, globalThis.NVE_ELEMENTS.state.versions = Array.from(new Set([...globalThis.NVE_ELEMENTS.state.versions, "0.0.9"])), globalThis.NVE_ELEMENTS.state.scopedRegistry ??= {}, globalThis.NVE_ELEMENTS.state.scopedRegistry["0.0.9"] = 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;
@@ -40,6 +40,6 @@ export interface I18nStrings {
40
40
  export declare class I18nService_ {
41
41
  get i18n(): Partial<I18nStrings>;
42
42
  constructor();
43
- update(i18nRegistry: Partial<typeof globalThis.NVE_ELEMENTS.state.i18nRegistry>): void;
43
+ update(registry: Partial<typeof globalThis.NVE_ELEMENTS.state.i18nRegistry>): void;
44
44
  }
45
45
  export declare const I18nService: I18nService_;
@@ -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(i18nRegistry: Partial<typeof globalThis.NVE_ELEMENTS.state.i18nRegistry>) {\n GlobalStateService.dispatch('NVE_ELEMENTS_I18N_UPDATE', { i18nRegistry } 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;CACT,EAEY,IAAb,MAA0B;CACxB,IAAI,OAA6B;AAC/B,SAAO,EAAE,GAAG,EAAmB,MAAM,cAAc;;CAGrD,cAAc;AACZ,EAAI,OAAO,KAAK,EAAmB,MAAM,aAAa,CAAC,WAAW,KAChE,EAAmB,SAAS,4BAA4B,EAAE,iBAAc,CAAC;;CAI7E,OAAO,GAA0E;AAC/E,IAAmB,SAAS,4BAA4B,EAAE,iBAAc,CAEtE;;GAIO,IAAc,IAAI,GAAc"}
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;CACT,EAEY,IAAb,MAA0B;CACxB,IAAI,OAA6B;AAC/B,SAAO,EAAE,GAAG,EAAmB,MAAM,cAAc;;CAGrD,cAAc;AACZ,EAAI,OAAO,KAAK,EAAmB,MAAM,aAAa,CAAC,WAAW,KAChE,EAAmB,SAAS,4BAA4B,EAAE,iBAAc,CAAC;;CAI7E,OAAO,GAAsE;AAC3E,IAAmB,SAAS,4BAA4B,EAAE,cAAc,GAAU,CAEhF;;GAIO,IAAc,IAAI,GAAc"}
@@ -64,8 +64,6 @@ export declare function getDisplayValue(option?: {
64
64
  label?: string;
65
65
  value?: string;
66
66
  }): string;
67
- /** returns a combination of nve and mlv for a prefixed tag selector */
68
- export declare function tagSelector(selector: string): string;
69
67
  /** determines if HTML element matches the given component tag */
70
68
  export declare function matchesElementName(element: Partial<HTMLElement>, component: {
71
69
  metadata: {
@@ -148,37 +148,34 @@ function j(e, t) {
148
148
  function M(e) {
149
149
  return e?.label || e?.value || "";
150
150
  }
151
- function N(e) {
152
- return `${e.replaceAll("nve-", "nve-")}, ${e.replaceAll("nve-", "nve-")}`;
151
+ function N(e, t) {
152
+ return e.localName === t.metadata.tag;
153
153
  }
154
- function P(e, t) {
155
- return e.localName === t.metadata.tag.replace("nve-", "nve-") || e.localName === t.metadata.tag.replace("nve-", "nve-");
156
- }
157
- function F(e) {
154
+ function P(e) {
158
155
  let t = globalThis.document.createElement("div"), { width: n } = e.getBoundingClientRect();
159
156
  return t.setAttribute("nve-ghost", ""), t.style.minWidth = `${n}px`, t.style.maxWidth = `${n}px`, t.style.height = "1px", t.slot = e.slot, t;
160
157
  }
161
- function I(e, t) {
158
+ function F(e, t) {
162
159
  let n = e.getRootNode(), r = t.getRootNode(), i = n instanceof ShadowRoot && r instanceof ShadowRoot && n === r, a = n === globalThis.document && r === globalThis.document;
163
160
  return i || a || n === r;
164
161
  }
165
- function L(e) {
162
+ function I(e) {
166
163
  return e.style.anchorName?.split(",")?.map((e) => e.trim())?.filter((e) => e !== "none" && e !== "") ?? [];
167
164
  }
168
- function R(e, t) {
169
- let n = L(e);
165
+ function L(e, t) {
166
+ let n = I(e);
170
167
  e.style.anchorName = n.filter((e) => e !== t).join(",");
171
168
  }
172
- function z(e, t) {
173
- e.style.anchorName = Array.from(new Set([...L(e), t])).join(",");
169
+ function R(e, t) {
170
+ e.style.anchorName = Array.from(new Set([...I(e), t])).join(",");
174
171
  }
175
- function B(e, t) {
172
+ function z(e, t) {
176
173
  return e.length === t.length && e.every((e, n) => e === t[n]);
177
174
  }
178
- function V(e) {
175
+ function B(e) {
179
176
  return Array.from(new Set(Array.from(e).filter((e) => typeof e == "string" && e.length > 0)));
180
177
  }
181
178
  //#endregion
182
- export { y as KeynavCode, z as appendAnchorName, o as appendRootNodeStyle, j as applySlotContentStates, u as clickOutsideElementBounds, F as createGhostElement, m as define, p as defineElement, E as endOfScrollBox, r as generateId, L as getAnchorNames, i as getAttributeChanges, a as getAttributeListChanges, n as getChildren, M as getDisplayValue, l as getElementUpdate, _ as getFlattenedDOMTree, g as getFlattenedFocusableItems, c as getPropertyChanges, O as getThemeTokens, T as hasHorizontalScrollBar, x as hasInvalidDOMGrid, w as hasScrollBar, h as isContextMenuClick, P as matchesElementName, D as openEyeDropper, d as parseTokenNumber, R as removeAnchorName, k as removeEmptySlotWhitespace, S as removeEmptyTextNode, B as sameOrderedStringArray, I as sameRenderRoot, C as scrollBarWidth, A as slotContainsOnlyWhitespace, s as styleSheetToString, f as supportsScopedRegistry, N as tagSelector, V as uniqueNonEmptyStrings, v as validKeyNavigationCode };
179
+ export { y as KeynavCode, R as appendAnchorName, o as appendRootNodeStyle, j as applySlotContentStates, u as clickOutsideElementBounds, P as createGhostElement, m as define, p as defineElement, E as endOfScrollBox, r as generateId, I as getAnchorNames, i as getAttributeChanges, a as getAttributeListChanges, n as getChildren, M as getDisplayValue, l as getElementUpdate, _ as getFlattenedDOMTree, g as getFlattenedFocusableItems, c as getPropertyChanges, O as getThemeTokens, T as hasHorizontalScrollBar, x as hasInvalidDOMGrid, w as hasScrollBar, h as isContextMenuClick, N as matchesElementName, D as openEyeDropper, d as parseTokenNumber, L as removeAnchorName, k as removeEmptySlotWhitespace, S as removeEmptyTextNode, z as sameOrderedStringArray, F as sameRenderRoot, C as scrollBarWidth, A as slotContainsOnlyWhitespace, s as styleSheetToString, f as supportsScopedRegistry, B as uniqueNonEmptyStrings, v as validKeyNavigationCode };
183
180
 
184
181
  //# sourceMappingURL=dom.js.map
@@ -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 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\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 getPropertyChanges(element, key, callback);\n return getAttributeChanges(element, key, val => callback(val));\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 return await new (\n globalThis as unknown as { EyeDropper: new () => { open: () => Promise<{ sRGBHex: string }> } }\n ).EyeDropper()\n .open()\n .then((color: { sRGBHex: string }) => color.sRGBHex);\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/** returns a combination of nve and mlv for a prefixed tag selector */\nexport function tagSelector(selector: string) {\n return `${selector.replaceAll('nve-', 'nve-')}, ${selector.replaceAll('nve-', 'nve-')}`;\n}\n\n/** determines if HTML element matches the given component tag */\nexport function matchesElementName(element: Partial<HTMLElement>, component: { metadata: { tag: string } }) {\n return (\n element.localName === component.metadata.tag.replace('nve-', 'nve-') ||\n element.localName === component.metadata.tag.replace('nve-', 'nve-')\n );\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":";;;AAOA,SAAgB,EAAY,GAAgD;AAC1E,KAAI,aAAgB,YAAY,EAAK,gBACnC,QAAO,MAAM,KAAK,EAAK,gBAAgB,SAAS;KACvC,aAAgB,eAAe,EAAK,WAC7C,QAAO,MAAM,KAAK,EAAK,WAAW,SAAS;KAClC,aAAgB,mBAAmB,EAAK,kBAAkB;EACnE,IAAM,IAAU,EAAK,kBAAkB;AACvC,SAAO,EAAQ,SAAS,IAAU,MAAM,KAAK,EAAK,SAAS;OAE3D,QAAO,MAAM,KAAM,EAAqB,SAAS;;AAIrD,SAAgB,IAAa;AAE3B,QAAO,IADQ,KAAK,OAAO,gBAAgB,IAAI,YAAY,EAAE,CAAC,CAAC,GAC7C,SAAS,GAAG;;AAGhC,SAAgB,EAAoB,GAAsB,GAAc,GAAwC;AAC9G,GAAG,EAAQ,aAAa,EAAK,CAAC;CAC9B,IAAM,IAAW,IAAI,kBAAiB,MAAa;AACjD,IAAU,SAAQ,MAAY;AAC5B,GAAI,EAAS,kBAAkB,KAC7B,EAAI,EAAS,OAAuB,aAAa,EAAK,CAAC;IAEzD;GACF;AAEF,QADA,EAAS,QAAQ,GAAS;EAAE,YAAY;EAAM,SAAS;EAAM,CAAC,EACvD;;AAGT,SAAgB,EAAwB,GAAsB,GAAiB,GAAwC;CACrH,IAAM,IAAW,IAAI,kBAAiB,MAAa;AACjD,IAAU,SAAQ,MAAY;AAC5B,GAAI,EAAS,iBAAiB,EAAM,SAAS,EAAS,cAAc,IAClE,EAAG,EAAS;IAEd;GACF;AAEF,QADA,EAAS,QAAQ,GAAS;EAAE,YAAY;EAAM,SAAS;EAAM,CAAC,EACvD;;AAQT,SAAgB,EAAoB,GAAmB,GAAgB;CACrE,IAAM,IAAa,IAAI,eAAe;AACtC,GAAW,YAAY,EAAO;CAC9B,IAAM,IAAO,EAAK,aAAa;AAS/B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,EAAK,MAAM,CAAC,EACxB,QAAO,MAAQ,MAAS,UAAU,MAAS,GAAG,IAAI,EAAE;;AAI5D,SAAgB,EAAiB,GAAsB,GAAc;CACnE,IAAM,IAAc,EAAe,EAAQ;AAC3C,GAAQ,MAAM,aAAa,EAAY,QAAO,MAAK,MAAM,EAAK,CAAC,KAAK,IAAI;;AAG1E,SAAgB,EAAiB,GAAsB,GAAc;AACnE,GAAQ,MAAM,aAAa,MAAM,KAAK,IAAI,IAAI,CAAC,GAAG,EAAe,EAAQ,EAAE,EAAK,CAAC,CAAC,CAAC,KAAK,IAAI;;AAM9F,SAAgB,EAAuB,GAAsB,GAA+B;AAC1F,QAAO,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,GAAO,MAAU,MAAU,EAAE,GAAO;;AAM/E,SAAgB,EAAsB,GAAuD;AAC3F,QAAO,MAAM,KACX,IAAI,IAAI,MAAM,KAAK,EAAO,CAAC,QAAQ,MAA2B,OAAO,KAAU,YAAY,EAAM,SAAS,EAAE,CAAC,CAC9G"}
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 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\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 getPropertyChanges(element, key, callback);\n return getAttributeChanges(element, key, val => callback(val));\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 return await new (\n globalThis as unknown as { EyeDropper: new () => { open: () => Promise<{ sRGBHex: string }> } }\n ).EyeDropper()\n .open()\n .then((color: { sRGBHex: string }) => color.sRGBHex);\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":";;;AAOA,SAAgB,EAAY,GAAgD;AAC1E,KAAI,aAAgB,YAAY,EAAK,gBACnC,QAAO,MAAM,KAAK,EAAK,gBAAgB,SAAS;KACvC,aAAgB,eAAe,EAAK,WAC7C,QAAO,MAAM,KAAK,EAAK,WAAW,SAAS;KAClC,aAAgB,mBAAmB,EAAK,kBAAkB;EACnE,IAAM,IAAU,EAAK,kBAAkB;AACvC,SAAO,EAAQ,SAAS,IAAU,MAAM,KAAK,EAAK,SAAS;OAE3D,QAAO,MAAM,KAAM,EAAqB,SAAS;;AAIrD,SAAgB,IAAa;AAE3B,QAAO,IADQ,KAAK,OAAO,gBAAgB,IAAI,YAAY,EAAE,CAAC,CAAC,GAC7C,SAAS,GAAG;;AAGhC,SAAgB,EAAoB,GAAsB,GAAc,GAAwC;AAC9G,GAAG,EAAQ,aAAa,EAAK,CAAC;CAC9B,IAAM,IAAW,IAAI,kBAAiB,MAAa;AACjD,IAAU,SAAQ,MAAY;AAC5B,GAAI,EAAS,kBAAkB,KAC7B,EAAI,EAAS,OAAuB,aAAa,EAAK,CAAC;IAEzD;GACF;AAEF,QADA,EAAS,QAAQ,GAAS;EAAE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B,IAAQ,EAAS,aAAa,EAC9B,IAAiB,aAAiB,cAAc,aAAiB,cAAc,MAAU,GACzF,IAAmB,MAAU,WAAW,YAAY,MAAU,WAAW;AAE/E,QAAO,KAAkB,KADE,MAAU;;AAIvC,SAAgB,EAAe,GAAgC;AAC7D,QACE,EAAQ,MAAM,YACV,MAAM,IAAI,EACV,KAAI,MAAQ,EAAK,MAAM,CAAC,EACxB,QAAO,MAAQ,MAAS,UAAU,MAAS,GAAG,IAAI,EAAE;;AAI5D,SAAgB,EAAiB,GAAsB,GAAc;CACnE,IAAM,IAAc,EAAe,EAAQ;AAC3C,GAAQ,MAAM,aAAa,EAAY,QAAO,MAAK,MAAM,EAAK,CAAC,KAAK,IAAI;;AAG1E,SAAgB,EAAiB,GAAsB,GAAc;AACnE,GAAQ,MAAM,aAAa,MAAM,KAAK,IAAI,IAAI,CAAC,GAAG,EAAe,EAAQ,EAAE,EAAK,CAAC,CAAC,CAAC,KAAK,IAAI;;AAM9F,SAAgB,EAAuB,GAAsB,GAA+B;AAC1F,QAAO,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,GAAO,MAAU,MAAU,EAAE,GAAO;;AAM/E,SAAgB,EAAsB,GAAuD;AAC3F,QAAO,MAAM,KACX,IAAI,IAAI,MAAM,KAAK,EAAO,CAAC,QAAQ,MAA2B,OAAO,KAAU,YAAY,EAAM,SAAS,EAAE,CAAC,CAC9G"}
@@ -1 +1 @@
1
- {"version":3,"file":"logo.js","names":[],"sources":["../../src/logo/logo.css?inline"],"sourcesContent":["/* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. */\n/* SPDX-License-Identifier: Apache-2.0 */\n\n:host {\n --background: var(--state-color-background);\n --color: var(--state-color);\n --gap: var(--nve-ref-space-xs);\n --height: var(--nve-ref-size-800);\n --width: var(--nve-ref-size-800);\n --font-size: calc(var(--width) / 2);\n --border-radius: calc(var(--height) * 0.2);\n --font-weight: var(--nve-ref-font-weight-bold);\n width: var(--width);\n height: var(--height);\n display: inline-block;\n}\n\n@supports not (background: color-mix(in oklab, #000 0%, #fff)) {\n :host([color]) [internal-host] {\n --background: var(--color);\n border: 1px solid transparent;\n background-image: linear-gradient(hsl(0 0% 0% / 0.8) 0 0) !important;\n }\n}\n\n[internal-host] {\n font-weight: var(--font-weight);\n font-size: var(--font-size);\n gap: var(--gap);\n color: var(--color);\n width: var(--width);\n height: var(--height);\n border-radius: var(--border-radius);\n display: inline-flex;\n place-items: center;\n place-content: center;\n line-height: 0;\n}\n\n::slotted([nve-text]),\n::slotted([nve-text]) {\n color: inherit !important;\n}\n\n::slotted(nve-icon) {\n --color: var(--state-color);\n --width: var(--font-size);\n --height: var(--font-size);\n}\n\n:host([size='sm']) {\n --width: var(--nve-ref-size-600);\n --height: var(--nve-ref-size-600);\n}\n\n:host([size='lg']) {\n --width: calc(var(--nve-ref-size-1000) * 1.55);\n --height: calc(var(--nve-ref-size-1000) * 1.55);\n}\n\n:host([color]) [internal-host] {\n background: var(--background);\n}\n"],"mappings":""}
1
+ {"version":3,"file":"logo.js","names":[],"sources":["../../src/logo/logo.css?inline"],"sourcesContent":["/* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. */\n/* SPDX-License-Identifier: Apache-2.0 */\n\n:host {\n --background: var(--state-color-background);\n --color: var(--state-color);\n --gap: var(--nve-ref-space-xs);\n --height: var(--nve-ref-size-800);\n --width: var(--nve-ref-size-800);\n --font-size: calc(var(--width) / 2);\n --border-radius: calc(var(--height) * 0.2);\n --font-weight: var(--nve-ref-font-weight-bold);\n width: var(--width);\n height: var(--height);\n display: inline-block;\n}\n\n@supports not (background: color-mix(in oklab, #000 0%, #fff)) {\n :host([color]) [internal-host] {\n --background: var(--color);\n border: 1px solid transparent;\n background-image: linear-gradient(hsl(0 0% 0% / 0.8) 0 0) !important;\n }\n}\n\n[internal-host] {\n font-weight: var(--font-weight);\n font-size: var(--font-size);\n gap: var(--gap);\n color: var(--color);\n width: var(--width);\n height: var(--height);\n border-radius: var(--border-radius);\n display: inline-flex;\n place-items: center;\n place-content: center;\n line-height: 0;\n}\n\n::slotted([nve-text]) {\n color: inherit !important;\n}\n\n::slotted(nve-icon) {\n --color: var(--state-color);\n --width: var(--font-size);\n --height: var(--font-size);\n}\n\n:host([size='sm']) {\n --width: var(--nve-ref-size-600);\n --height: var(--nve-ref-size-600);\n}\n\n:host([size='lg']) {\n --width: calc(var(--nve-ref-size-1000) * 1.55);\n --height: calc(var(--nve-ref-size-1000) * 1.55);\n}\n\n:host([color]) [internal-host] {\n background: var(--background);\n}\n"],"mappings":""}
@@ -12,7 +12,7 @@ var c = class extends a {
12
12
  static {
13
13
  this.metadata = {
14
14
  tag: "nve-logo",
15
- version: "0.0.7"
15
+ version: "0.0.9"
16
16
  };
17
17
  }
18
18
  render() {