@nvidia-elements/core 2.23.4 → 2.23.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/accordion/accordion2.js +49 -49
  3. package/dist/accordion/accordion2.js.map +1 -1
  4. package/dist/alert/alert-group2.js +22 -21
  5. package/dist/alert/alert-group2.js.map +1 -1
  6. package/dist/alert/alert2.js +29 -28
  7. package/dist/alert/alert2.js.map +1 -1
  8. package/dist/avatar/avatar-group2.js +9 -9
  9. package/dist/avatar/avatar-group2.js.map +1 -1
  10. package/dist/avatar/avatar2.js +12 -11
  11. package/dist/avatar/avatar2.js.map +1 -1
  12. package/dist/badge/badge2.js +27 -26
  13. package/dist/badge/badge2.js.map +1 -1
  14. package/dist/breadcrumb/breadcrumb2.js +17 -17
  15. package/dist/breadcrumb/breadcrumb2.js.map +1 -1
  16. package/dist/bundles/index.js +6 -6
  17. package/dist/button/button2.js +12 -12
  18. package/dist/button/button2.js.map +1 -1
  19. package/dist/button-group/button-group2.js +18 -18
  20. package/dist/button-group/button-group2.js.map +1 -1
  21. package/dist/card/card2.js +28 -28
  22. package/dist/card/card2.js.map +1 -1
  23. package/dist/chat-message/chat-message2.js +15 -14
  24. package/dist/chat-message/chat-message2.js.map +1 -1
  25. package/dist/checkbox/checkbox-group2.js +8 -8
  26. package/dist/checkbox/checkbox-group2.js.map +1 -1
  27. package/dist/checkbox/checkbox2.js +8 -8
  28. package/dist/checkbox/checkbox2.js.map +1 -1
  29. package/dist/color/color2.js +21 -21
  30. package/dist/color/color2.js.map +1 -1
  31. package/dist/combobox/combobox2.js +37 -37
  32. package/dist/combobox/combobox2.js.map +1 -1
  33. package/dist/copy-button/copy-button.d.ts +1 -1
  34. package/dist/copy-button/copy-button2.js +21 -21
  35. package/dist/copy-button/copy-button2.js.map +1 -1
  36. package/dist/custom-elements.json +0 -76
  37. package/dist/date/date2.js +19 -19
  38. package/dist/date/date2.js.map +1 -1
  39. package/dist/datetime/datetime2.js +19 -19
  40. package/dist/datetime/datetime2.js.map +1 -1
  41. package/dist/dialog/dialog-footer2.js +7 -7
  42. package/dist/dialog/dialog-footer2.js.map +1 -1
  43. package/dist/dialog/dialog-header2.js +7 -7
  44. package/dist/dialog/dialog-header2.js.map +1 -1
  45. package/dist/dialog/dialog2.js +25 -25
  46. package/dist/dialog/dialog2.js.map +1 -1
  47. package/dist/divider/divider2.js +12 -12
  48. package/dist/divider/divider2.js.map +1 -1
  49. package/dist/dot/dot2.js +17 -16
  50. package/dist/dot/dot2.js.map +1 -1
  51. package/dist/drag-handle/drag-handle2.js +12 -12
  52. package/dist/drag-handle/drag-handle2.js.map +1 -1
  53. package/dist/drawer/drawer-content2.js +7 -7
  54. package/dist/drawer/drawer-content2.js.map +1 -1
  55. package/dist/drawer/drawer-footer2.js +7 -7
  56. package/dist/drawer/drawer-footer2.js.map +1 -1
  57. package/dist/drawer/drawer-header2.js +7 -7
  58. package/dist/drawer/drawer-header2.js.map +1 -1
  59. package/dist/drawer/drawer2.js +21 -21
  60. package/dist/drawer/drawer2.js.map +1 -1
  61. package/dist/dropdown/dropdown-footer2.js +7 -7
  62. package/dist/dropdown/dropdown-footer2.js.map +1 -1
  63. package/dist/dropdown/dropdown-header2.js +7 -7
  64. package/dist/dropdown/dropdown-header2.js.map +1 -1
  65. package/dist/dropdown/dropdown2.js +21 -21
  66. package/dist/dropdown/dropdown2.js.map +1 -1
  67. package/dist/dropdown-group/dropdown-group.js +10 -10
  68. package/dist/dropdown-group/dropdown-group.js.map +1 -1
  69. package/dist/dropzone/dropzone2.js +19 -19
  70. package/dist/dropzone/dropzone2.js.map +1 -1
  71. package/dist/file/file2.js +8 -8
  72. package/dist/file/file2.js.map +1 -1
  73. package/dist/format-bytes/format-bytes2.js +13 -13
  74. package/dist/format-bytes/format-bytes2.js.map +1 -1
  75. package/dist/format-datetime/format-datetime2.js +14 -14
  76. package/dist/format-datetime/format-datetime2.js.map +1 -1
  77. package/dist/format-number/format-number2.js +20 -20
  78. package/dist/format-number/format-number2.js.map +1 -1
  79. package/dist/format-relative-time/format-relative-time2.js +11 -11
  80. package/dist/format-relative-time/format-relative-time2.js.map +1 -1
  81. package/dist/format-truncate/format-truncate2.js +21 -21
  82. package/dist/format-truncate/format-truncate2.js.map +1 -1
  83. package/dist/forms/control/control2.js +30 -29
  84. package/dist/forms/control/control2.js.map +1 -1
  85. package/dist/forms/control-group/control-group2.js +19 -18
  86. package/dist/forms/control-group/control-group2.js.map +1 -1
  87. package/dist/forms/control-message/control-message2.js +15 -15
  88. package/dist/forms/control-message/control-message2.js.map +1 -1
  89. package/dist/gauge/gauge2.js +20 -20
  90. package/dist/gauge/gauge2.js.map +1 -1
  91. package/dist/ghost/ghost2.js +10 -10
  92. package/dist/ghost/ghost2.js.map +1 -1
  93. package/dist/grid/cell/cell2.js +9 -9
  94. package/dist/grid/cell/cell2.js.map +1 -1
  95. package/dist/grid/column/column2.js +16 -16
  96. package/dist/grid/column/column2.js.map +1 -1
  97. package/dist/grid/footer/footer2.js +12 -12
  98. package/dist/grid/footer/footer2.js.map +1 -1
  99. package/dist/grid/grid2.js +30 -30
  100. package/dist/grid/grid2.js.map +1 -1
  101. package/dist/grid/header/header2.js +20 -20
  102. package/dist/grid/header/header2.js.map +1 -1
  103. package/dist/grid/placeholder/placeholder2.js +9 -9
  104. package/dist/grid/placeholder/placeholder2.js.map +1 -1
  105. package/dist/grid/row/row2.js +15 -15
  106. package/dist/grid/row/row2.js.map +1 -1
  107. package/dist/icon/icon2.js +40 -40
  108. package/dist/icon/icon2.js.map +1 -1
  109. package/dist/icon-button/icon-button2.js +17 -17
  110. package/dist/icon-button/icon-button2.js.map +1 -1
  111. package/dist/iframe/iframe2.js +7 -7
  112. package/dist/iframe/iframe2.js.map +1 -1
  113. package/dist/index.js +1 -1
  114. package/dist/input/input-group2.js +8 -8
  115. package/dist/input/input-group2.js.map +1 -1
  116. package/dist/input/input2.js +10 -10
  117. package/dist/input/input2.js.map +1 -1
  118. package/dist/internal/controllers/state-expanded.controller.js +1 -1
  119. package/dist/internal/controllers/state-expanded.controller.js.map +1 -1
  120. package/dist/internal/controllers/state-highlighted.controller.js +1 -1
  121. package/dist/internal/controllers/state-highlighted.controller.js.map +1 -1
  122. package/dist/internal/controllers/state-scroll.controller.js +1 -1
  123. package/dist/internal/controllers/state-scroll.controller.js.map +1 -1
  124. package/dist/internal/controllers/state-selected.controller.js +1 -1
  125. package/dist/internal/controllers/state-selected.controller.js.map +1 -1
  126. package/dist/internal/controllers/type-anchor.controller.js +1 -1
  127. package/dist/internal/controllers/type-anchor.controller.js.map +1 -1
  128. package/dist/internal/controllers/type-closable.controller.js +1 -1
  129. package/dist/internal/controllers/type-closable.controller.js.map +1 -1
  130. package/dist/internal/controllers/type-expandable.controller.js +1 -1
  131. package/dist/internal/controllers/type-expandable.controller.js.map +1 -1
  132. package/dist/internal/controllers/type-native-popover.controller.js +6 -6
  133. package/dist/internal/controllers/type-native-popover.controller.js.map +1 -1
  134. package/dist/internal/controllers/type-popover.controller.examples.js.map +1 -1
  135. package/dist/internal/controllers/type-selectable.controller.js +1 -1
  136. package/dist/internal/controllers/type-selectable.controller.js.map +1 -1
  137. package/dist/internal/index.d.ts +0 -1
  138. package/dist/internal/index.js +57 -61
  139. package/dist/internal/index.js.map +1 -1
  140. package/dist/internal/styles/index.d.ts +0 -1
  141. package/dist/internal/styles/index.js +5 -15
  142. package/dist/internal/styles/index.js.map +1 -1
  143. package/dist/internal/utils/a11y.d.ts +0 -3
  144. package/dist/internal/utils/a11y.js +6 -9
  145. package/dist/internal/utils/a11y.js.map +1 -1
  146. package/dist/joystick/joystick2.js +19 -19
  147. package/dist/joystick/joystick2.js.map +1 -1
  148. package/dist/logo/logo2.js +14 -13
  149. package/dist/logo/logo2.js.map +1 -1
  150. package/dist/menu/menu-group2.js +20 -20
  151. package/dist/menu/menu-group2.js.map +1 -1
  152. package/dist/menu/menu-item2.js +11 -11
  153. package/dist/menu/menu-item2.js.map +1 -1
  154. package/dist/menu/menu2.js +14 -14
  155. package/dist/menu/menu2.js.map +1 -1
  156. package/dist/month/month2.js +19 -19
  157. package/dist/month/month2.js.map +1 -1
  158. package/dist/notification/notification-group2.js +13 -13
  159. package/dist/notification/notification-group2.js.map +1 -1
  160. package/dist/notification/notification2.js +31 -31
  161. package/dist/notification/notification2.js.map +1 -1
  162. package/dist/page/page-panel/page-panel-content2.js +7 -7
  163. package/dist/page/page-panel/page-panel-content2.js.map +1 -1
  164. package/dist/page/page-panel/page-panel-footer2.js +9 -9
  165. package/dist/page/page-panel/page-panel-footer2.js.map +1 -1
  166. package/dist/page/page-panel/page-panel-header2.js +9 -9
  167. package/dist/page/page-panel/page-panel-header2.js.map +1 -1
  168. package/dist/page/page-panel/page-panel2.js +15 -15
  169. package/dist/page/page-panel/page-panel2.js.map +1 -1
  170. package/dist/page/page2.js +13 -13
  171. package/dist/page/page2.js.map +1 -1
  172. package/dist/page-header/page-header2.js +10 -10
  173. package/dist/page-header/page-header2.js.map +1 -1
  174. package/dist/page-loader/page-loader2.js +13 -13
  175. package/dist/page-loader/page-loader2.js.map +1 -1
  176. package/dist/pagination/pagination2.js +34 -34
  177. package/dist/pagination/pagination2.js.map +1 -1
  178. package/dist/panel/panel2.js +36 -36
  179. package/dist/panel/panel2.js.map +1 -1
  180. package/dist/password/password2.js +19 -19
  181. package/dist/password/password2.js.map +1 -1
  182. package/dist/preferences-input/preferences-input.d.ts +1 -1
  183. package/dist/preferences-input/preferences-input2.js +25 -25
  184. package/dist/preferences-input/preferences-input2.js.map +1 -1
  185. package/dist/progress-bar/progress-bar2.js +13 -13
  186. package/dist/progress-bar/progress-bar2.js.map +1 -1
  187. package/dist/progress-dot/progress-dot2.js +15 -15
  188. package/dist/progress-dot/progress-dot2.js.map +1 -1
  189. package/dist/progress-ring/progress-ring2.js +20 -20
  190. package/dist/progress-ring/progress-ring2.js.map +1 -1
  191. package/dist/progressive-filter-chip/progressive-filter-chip2.js +28 -28
  192. package/dist/progressive-filter-chip/progressive-filter-chip2.js.map +1 -1
  193. package/dist/pulse/pulse2.js +15 -15
  194. package/dist/pulse/pulse2.js.map +1 -1
  195. package/dist/radio/radio-group2.js +8 -8
  196. package/dist/radio/radio-group2.js.map +1 -1
  197. package/dist/radio/radio2.js +8 -8
  198. package/dist/radio/radio2.js.map +1 -1
  199. package/dist/range/range2.js +16 -16
  200. package/dist/range/range2.js.map +1 -1
  201. package/dist/resize-handle/resize-handle2.js +17 -17
  202. package/dist/resize-handle/resize-handle2.js.map +1 -1
  203. package/dist/search/search2.js +20 -20
  204. package/dist/search/search2.js.map +1 -1
  205. package/dist/select/select2.js +32 -32
  206. package/dist/select/select2.js.map +1 -1
  207. package/dist/skeleton/skeleton2.js +14 -14
  208. package/dist/skeleton/skeleton2.js.map +1 -1
  209. package/dist/sort-button/sort-button.d.ts +1 -1
  210. package/dist/sort-button/sort-button2.js +16 -16
  211. package/dist/sort-button/sort-button2.js.map +1 -1
  212. package/dist/sparkline/sparkline2.js +45 -44
  213. package/dist/sparkline/sparkline2.js.map +1 -1
  214. package/dist/star-rating/star-rating2.js +14 -14
  215. package/dist/star-rating/star-rating2.js.map +1 -1
  216. package/dist/steps/steps2.js +32 -32
  217. package/dist/steps/steps2.js.map +1 -1
  218. package/dist/switch/switch-group2.js +8 -8
  219. package/dist/switch/switch-group2.js.map +1 -1
  220. package/dist/switch/switch2.js +8 -8
  221. package/dist/switch/switch2.js.map +1 -1
  222. package/dist/tabs/tabs-group2.js +18 -18
  223. package/dist/tabs/tabs-group2.js.map +1 -1
  224. package/dist/tabs/tabs-item-group2.js +9 -9
  225. package/dist/tabs/tabs-item-group2.js.map +1 -1
  226. package/dist/tabs/tabs2.js +28 -28
  227. package/dist/tabs/tabs2.js.map +1 -1
  228. package/dist/tag/tag2.js +19 -18
  229. package/dist/tag/tag2.js.map +1 -1
  230. package/dist/textarea/textarea2.js +9 -9
  231. package/dist/textarea/textarea2.js.map +1 -1
  232. package/dist/time/time2.js +19 -19
  233. package/dist/time/time2.js.map +1 -1
  234. package/dist/toast/toast2.js +28 -28
  235. package/dist/toast/toast2.js.map +1 -1
  236. package/dist/toggletip/toggletip-footer2.js +7 -7
  237. package/dist/toggletip/toggletip-footer2.js.map +1 -1
  238. package/dist/toggletip/toggletip-header2.js +7 -7
  239. package/dist/toggletip/toggletip-header2.js.map +1 -1
  240. package/dist/toggletip/toggletip2.js +23 -23
  241. package/dist/toggletip/toggletip2.js.map +1 -1
  242. package/dist/toolbar/toolbar2.js +20 -19
  243. package/dist/toolbar/toolbar2.js.map +1 -1
  244. package/dist/tooltip/tooltip2.js +20 -20
  245. package/dist/tooltip/tooltip2.js.map +1 -1
  246. package/dist/tree/tree-node2.js +39 -39
  247. package/dist/tree/tree-node2.js.map +1 -1
  248. package/dist/tree/tree2.js +20 -20
  249. package/dist/tree/tree2.js.map +1 -1
  250. package/dist/week/week2.js +19 -19
  251. package/dist/week/week2.js.map +1 -1
  252. package/dist/workspace/panel/panel2.js +14 -14
  253. package/dist/workspace/panel/panel2.js.map +1 -1
  254. package/dist/workspace/panel-content/panel-content2.js +7 -7
  255. package/dist/workspace/panel-content/panel-content2.js.map +1 -1
  256. package/dist/workspace/panel-footer/panel-footer2.js +9 -9
  257. package/dist/workspace/panel-footer/panel-footer2.js.map +1 -1
  258. package/dist/workspace/panel-header/panel-header2.js +16 -16
  259. package/dist/workspace/panel-header/panel-header2.js.map +1 -1
  260. package/dist/workspace/workspace2.js +97 -97
  261. package/dist/workspace/workspace2.js.map +1 -1
  262. package/package.json +2 -2
  263. package/dist/internal/decorators/scoped-registry.d.ts +0 -2
  264. package/dist/internal/decorators/scoped-registry.js +0 -36
  265. package/dist/internal/decorators/scoped-registry.js.map +0 -1
  266. package/dist/internal/styles/base.js +0 -5
  267. package/dist/internal/styles/base.js.map +0 -1
  268. package/dist/internal/styles/interaction-state.js +0 -5
  269. package/dist/internal/styles/interaction-state.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"select2.js","names":["styles","globalStyles","_decorate","__decorate","select_default","select_global_default","i18nDefaults","Select","Control","_args","#i18nController","I18nController","#observers","#optionObservers","useStyles","Icon","Dropdown","Menu","MenuItem","Tag","#select","#options","#dropdown","#menuItems","#input","#tags","#caret","#placeholderOption","o","#multipleSelectLabel","option","label","#selectValue","nothing","#menu","ifDefined","i","#closeDropdown","#openDropdown","props","#setupCustomSelectUI","getElementUpdate","onChildListMutation","#syncOptionSelectedStates","#disconnectObservers","#setupOverflowListener","#syncSelectValueStates","observer","#overflowObserver","#observedTags","options","appendRootNodeStyle","#setupObservers","#observeTags","onListboxActivate","focusElementTimeout","input","inputWidth","inputEntry","entries","entry","#updateMultipleOverflow","tags","selected","width","property","i18n","scopedRegistry"],"sources":["../../src/select/select.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { PropertyValues } from 'lit';\nimport { html, nothing } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport {\n focusElementTimeout,\n onListboxActivate,\n useStyles,\n onChildListMutation,\n getElementUpdate,\n scopedRegistry,\n appendRootNodeStyle\n} from '@nvidia-elements/core/internal';\nimport { i18n, I18nController, type I18nDefaults } from '@nvidia-elements/foundations/internal/i18n';\nimport { Control } from '@nvidia-elements/core/forms';\nimport { Icon } from '@nvidia-elements/core/icon';\nimport { Menu, MenuItem } from '@nvidia-elements/core/menu';\nimport { Dropdown } from '@nvidia-elements/core/dropdown';\nimport { Tag } from '@nvidia-elements/core/tag';\nimport styles from './select.css?inline';\nimport globalStyles from './select.global.css?inline';\n\nconst i18nDefaults = {\n select: 'select',\n selected: 'selected'\n} satisfies I18nDefaults;\n\n/**\n * @element nve-select\n * @description A select is a control that enables users to select an option from a list of options.\n * @documentation https://nvidia.github.io/elements/docs/elements/select/\n * @since 0.3.0\n * @entrypoint \\@nvidia-elements/core/select\n * @cssprop --padding\n * @cssprop --font-size\n * @cssprop --height\n * @cssprop --background\n * @cssprop --color\n * @cssprop --border-radius\n * @cssprop --border\n * @cssprop --border-bottom\n * @cssprop --cursor\n * @cssprop --font-weight\n * @cssprop --text-align\n * @cssprop --scroll-height\n * @cssprop --width\n * @cssprop --control-width\n * @cssprop --max-width\n * @cssprop --min-width\n * @cssprop --box-shadow\n * @cssprop --max-height\n * @cssprop --text-transform\n * @csspart tag\n * @csspart menu - The dropdown menu element\n * @csspart menu-item - The menu item elements\n * @csspart icon - The icon element\n * @csspart caret - The caret/chevron icon element\n * @csspart dropdown - The dropdown popup element\n * @slot - Select input element\n * @aria https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select\n */\n@i18n<Select>()\n@scopedRegistry()\nexport class Select extends Control {\n static styles = useStyles([...Control.styles, styles]);\n\n static readonly metadata = {\n tag: 'nve-select',\n version: '0.0.0'\n };\n\n static elementDefinitions = {\n [Icon.metadata.tag]: Icon,\n [Dropdown.metadata.tag]: Dropdown,\n [Menu.metadata.tag]: Menu,\n [MenuItem.metadata.tag]: MenuItem,\n [Tag.metadata.tag]: Tag\n };\n\n /** Flat container option applies when embedding the component within another containing element */\n @property({ type: String, reflect: true }) container?: 'flat' | 'inline';\n\n #i18nController: I18nController<this> = new I18nController<this>(this, i18nDefaults);\n\n /** Updates internal string values for internationalization. */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n get #select() {\n return this.input as unknown as HTMLSelectElement;\n }\n\n get #options() {\n return Array.from(this.#select?.options ? this.#select.options : []);\n }\n\n get #dropdown() {\n return this.shadowRoot!.querySelector<Dropdown>(Dropdown.metadata.tag);\n }\n\n get #menuItems() {\n return this.shadowRoot!.querySelectorAll<MenuItem>(MenuItem.metadata.tag);\n }\n\n get #input() {\n return this.shadowRoot!.querySelector<HTMLElement>('[input]');\n }\n\n get #tags() {\n return this.shadowRoot!.querySelector('.tags');\n }\n\n get #caret() {\n return this.shadowRoot!.querySelector<Icon>('[name=\"caret\"]');\n }\n\n get #placeholderOption() {\n return this.#options.find(o => o.selected && o.hidden && o.disabled);\n }\n\n #observers: (MutationObserver | ResizeObserver)[] = [];\n #overflowObserver?: ResizeObserver;\n #observedTags?: Element | null;\n\n get #multipleSelectLabel() {\n const option = this.#placeholderOption;\n const label = option ? option.innerText : `${this.#select.selectedOptions.length} ${this.i18n.selected}`;\n return html`<div class=\"tags-label ${option ? 'placeholder' : ''}\" aria-hidden=\"true\">${label}</div>`;\n }\n\n protected get prefixContent() {\n return this.#select?.multiple && this.#select?.size === 0\n ? html`\n ${this.#multipleSelectLabel}\n <div class=\"tags\">\n ${this.#options\n .filter(o => o.selected && o !== this.#placeholderOption)\n .map(\n o => html`\n <nve-tag part=\"tag\" readonly color=\"gray-slate\" closable .value=${o.value} @click=${() => this.#selectValue(o, false)}>${o.textContent}</nve-tag>`\n )}\n </div>`\n : nothing;\n }\n\n get #menu() {\n return html`\n <nve-menu part=\"menu\" role=\"listbox\" style=\"--width: 100%; --min-width: fit-content\" aria-label=${ifDefined(this.i18n.select)}>\n ${this.#options\n .filter(o => o !== this.#placeholderOption)\n .map(\n (o, i) => html`\n <nve-menu-item part=\"menu-item\" role=\"option\" @click=${() => this.#selectValue(o, !o.selected)} ?selected=${o.selected} ?disabled=${o.disabled} ?hidden=${!!o.hidden} aria-selected=${o.selected}>\n <slot name=\"option-${i + 1}\">\n <nve-icon part=\"icon\" name=\"check\" size=\"sm\" aria-hidden=\"true\"></nve-icon> ${o.innerText}\n </slot>\n </nve-menu-item>`\n )}\n </nve-menu>`;\n }\n\n protected get suffixContent() {\n return this.#select?.size === 0\n ? html`\n <nve-icon name=\"caret\" part=\"caret\" direction=\"down\" size=\"sm\" aria-hidden=\"true\"></nve-icon>\n <nve-dropdown part=\"dropdown\" @close=${this.#closeDropdown} @open=${this.#openDropdown} hidden .anchor=${this.#input} position=\"bottom\">\n ${this.#menu}\n </nve-dropdown>`\n : this.#menu;\n }\n\n async firstUpdated(props: PropertyValues<this>) {\n super.firstUpdated(props);\n await this.updateComplete;\n this.#setupCustomSelectUI();\n }\n\n #syncSelectValueStates() {\n this.#observers.push(\n getElementUpdate(this.#select, 'value', () => this.requestUpdate()),\n onChildListMutation(this.#select, () => this.requestUpdate(), { attributes: true, subtree: true }),\n onChildListMutation(this.#select, () => this.#syncOptionSelectedStates(), { subtree: true })\n );\n }\n\n #optionObservers = new Map<HTMLOptionElement, MutationObserver>();\n\n #setupObservers() {\n this.#disconnectObservers();\n this.#setupOverflowListener();\n this.#syncSelectValueStates();\n this.#syncOptionSelectedStates();\n }\n\n #disconnectObservers() {\n this.#observers.forEach(observer => observer.disconnect());\n this.#observers = [];\n this.#optionObservers.clear();\n this.#overflowObserver = undefined;\n this.#observedTags = undefined;\n }\n\n #syncOptionSelectedStates() {\n const options = new Set(this.#options);\n\n this.#optionObservers.forEach((observer, option) => {\n if (!options.has(option)) {\n observer.disconnect();\n this.#optionObservers.delete(option);\n this.#observers = this.#observers.filter(o => o !== observer);\n }\n });\n\n this.#options.forEach(o => {\n if (!this.#optionObservers.has(o)) {\n const observer = getElementUpdate(o, 'selected', () => this.requestUpdate());\n this.#optionObservers.set(o, observer);\n this.#observers.push(observer);\n }\n });\n }\n\n connectedCallback() {\n super.connectedCallback();\n appendRootNodeStyle(this, globalStyles);\n void this.updateComplete.then(() => {\n if (this.isConnected) {\n this.#setupObservers();\n }\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.#disconnectObservers();\n }\n\n async updated(props: PropertyValues<this>) {\n super.updated(props);\n if (this.#select?.size && this.#select?.size !== 0) {\n this._internals.states.add('size');\n this.style.setProperty('--size', `${this.#select.size}`);\n } else {\n this._internals.states.delete('size');\n this.style.removeProperty('--size');\n }\n\n if (this.#select?.multiple && this.#select?.size === 0) {\n this._internals.states.add('multiple');\n } else {\n this._internals.states.delete('multiple');\n }\n this.#observeTags();\n }\n\n #setupCustomSelectUI() {\n if (this.#select?.size === 0) {\n onListboxActivate(this.#select, () => {\n this.requestUpdate(); // update menu items\n this.#dropdown!.style.setProperty('--min-width', `${this.#input!.getBoundingClientRect().width}px`);\n this.#dropdown!.showPopover();\n focusElementTimeout(this.#menuItems[0] as HTMLElement);\n });\n }\n }\n\n #openDropdown() {\n this.#dropdown!.hidden = false;\n this.#caret!.direction = 'up';\n }\n\n #closeDropdown() {\n this.#dropdown!.hidden = true;\n this.#caret!.direction = 'down';\n }\n\n #setupOverflowListener() {\n const input = this.#input;\n if (!input) return;\n let inputWidth: number | undefined;\n const observer = new ResizeObserver(entries => {\n const inputEntry = entries.find(entry => entry.target === input);\n if (inputEntry) inputWidth = inputEntry.contentRect.width;\n if (this.isConnected && inputWidth !== undefined) this.#updateMultipleOverflow(inputWidth);\n });\n this.#overflowObserver = observer;\n this.#observers.push(observer);\n observer.observe(input);\n this.#observeTags();\n }\n\n #observeTags() {\n const observer = this.#overflowObserver;\n if (!observer) return;\n const tags = this.#tags;\n if (tags === this.#observedTags) return;\n if (this.#observedTags) observer.unobserve(this.#observedTags);\n this.#observedTags = tags;\n if (tags) observer.observe(tags);\n else this._internals.states.delete('multiple-overflow');\n }\n\n async #selectValue(option: HTMLOptionElement, selected: boolean) {\n if (this.#select.multiple || (!this.#select.multiple && option.value !== this.#select.value)) {\n option.selected = selected;\n }\n\n // native select only the first selected option determines the select input value\n if (this.#select.selectedOptions.length < 1) {\n this.#select.value = selected ? option.value : '';\n }\n\n this.#select.dispatchEvent(new Event('input', { bubbles: true }));\n this.#select.dispatchEvent(new Event('change', { bubbles: true }));\n this.requestUpdate();\n\n if (!this.#select.multiple && this.#dropdown) {\n this.#dropdown.hidePopover();\n } else {\n await this.updateComplete;\n this.#updateMultipleOverflow(this.#input!.getBoundingClientRect().width);\n }\n }\n\n #updateMultipleOverflow(width: number) {\n const tags = this.#tags;\n if (this.#select?.multiple && tags && tags.getBoundingClientRect().width > width - 48) {\n this._internals.states.add('multiple-overflow');\n } else {\n this._internals.states.delete('multiple-overflow');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E,EAAa,GACbC,EAAe,CAAA,GAAA5D,CAAA"}
1
+ {"version":3,"file":"select2.js","names":["styles","globalStyles","_decorate","__decorate","select_default","select_global_default","i18nDefaults","Select","Control","_args","#i18nController","I18nController","#observers","#optionObservers","useStyles","Icon","Dropdown","Menu","MenuItem","Tag","#select","#options","#dropdown","#menuItems","#input","#tags","#caret","#placeholderOption","o","#multipleSelectLabel","option","label","#selectValue","nothing","#menu","ifDefined","i","#closeDropdown","#openDropdown","props","#setupCustomSelectUI","getElementUpdate","onChildListMutation","#syncOptionSelectedStates","#disconnectObservers","#setupOverflowListener","#syncSelectValueStates","observer","#overflowObserver","#observedTags","options","appendRootNodeStyle","#setupObservers","#observeTags","onListboxActivate","focusElementTimeout","input","inputWidth","inputEntry","entries","entry","#updateMultipleOverflow","tags","selected","width","property","i18n","scopedRegistry"],"sources":["../../src/select/select.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { PropertyValues } from 'lit';\nimport { html, nothing } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport {\n focusElementTimeout,\n onListboxActivate,\n onChildListMutation,\n getElementUpdate,\n appendRootNodeStyle\n} from '@nvidia-elements/core/internal';\nimport { scopedRegistry } from '@nvidia-elements/foundations/internal/decorators';\nimport { useStyles } from '@nvidia-elements/foundations/internal/styles';\nimport { i18n, I18nController, type I18nDefaults } from '@nvidia-elements/foundations/internal/i18n';\nimport { Control } from '@nvidia-elements/core/forms';\nimport { Icon } from '@nvidia-elements/core/icon';\nimport { Menu, MenuItem } from '@nvidia-elements/core/menu';\nimport { Dropdown } from '@nvidia-elements/core/dropdown';\nimport { Tag } from '@nvidia-elements/core/tag';\nimport styles from './select.css?inline';\nimport globalStyles from './select.global.css?inline';\n\nconst i18nDefaults = {\n select: 'select',\n selected: 'selected'\n} satisfies I18nDefaults;\n\n/**\n * @element nve-select\n * @description A select is a control that enables users to select an option from a list of options.\n * @documentation https://nvidia.github.io/elements/docs/elements/select/\n * @since 0.3.0\n * @entrypoint \\@nvidia-elements/core/select\n * @cssprop --padding\n * @cssprop --font-size\n * @cssprop --height\n * @cssprop --background\n * @cssprop --color\n * @cssprop --border-radius\n * @cssprop --border\n * @cssprop --border-bottom\n * @cssprop --cursor\n * @cssprop --font-weight\n * @cssprop --text-align\n * @cssprop --scroll-height\n * @cssprop --width\n * @cssprop --control-width\n * @cssprop --max-width\n * @cssprop --min-width\n * @cssprop --box-shadow\n * @cssprop --max-height\n * @cssprop --text-transform\n * @csspart tag\n * @csspart menu - The dropdown menu element\n * @csspart menu-item - The menu item elements\n * @csspart icon - The icon element\n * @csspart caret - The caret/chevron icon element\n * @csspart dropdown - The dropdown popup element\n * @slot - Select input element\n * @aria https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select\n */\n@i18n<Select>()\n@scopedRegistry()\nexport class Select extends Control {\n static styles = useStyles([...Control.styles, styles]);\n\n static readonly metadata = {\n tag: 'nve-select',\n version: '0.0.0'\n };\n\n static elementDefinitions = {\n [Icon.metadata.tag]: Icon,\n [Dropdown.metadata.tag]: Dropdown,\n [Menu.metadata.tag]: Menu,\n [MenuItem.metadata.tag]: MenuItem,\n [Tag.metadata.tag]: Tag\n };\n\n /** Flat container option applies when embedding the component within another containing element */\n @property({ type: String, reflect: true }) container?: 'flat' | 'inline';\n\n #i18nController: I18nController<this> = new I18nController<this>(this, i18nDefaults);\n\n /** Updates internal string values for internationalization. */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n get #select() {\n return this.input as unknown as HTMLSelectElement;\n }\n\n get #options() {\n return Array.from(this.#select?.options ? this.#select.options : []);\n }\n\n get #dropdown() {\n return this.shadowRoot!.querySelector<Dropdown>(Dropdown.metadata.tag);\n }\n\n get #menuItems() {\n return this.shadowRoot!.querySelectorAll<MenuItem>(MenuItem.metadata.tag);\n }\n\n get #input() {\n return this.shadowRoot!.querySelector<HTMLElement>('[input]');\n }\n\n get #tags() {\n return this.shadowRoot!.querySelector('.tags');\n }\n\n get #caret() {\n return this.shadowRoot!.querySelector<Icon>('[name=\"caret\"]');\n }\n\n get #placeholderOption() {\n return this.#options.find(o => o.selected && o.hidden && o.disabled);\n }\n\n #observers: (MutationObserver | ResizeObserver)[] = [];\n #overflowObserver?: ResizeObserver;\n #observedTags?: Element | null;\n\n get #multipleSelectLabel() {\n const option = this.#placeholderOption;\n const label = option ? option.innerText : `${this.#select.selectedOptions.length} ${this.i18n.selected}`;\n return html`<div class=\"tags-label ${option ? 'placeholder' : ''}\" aria-hidden=\"true\">${label}</div>`;\n }\n\n protected get prefixContent() {\n return this.#select?.multiple && this.#select?.size === 0\n ? html`\n ${this.#multipleSelectLabel}\n <div class=\"tags\">\n ${this.#options\n .filter(o => o.selected && o !== this.#placeholderOption)\n .map(\n o => html`\n <nve-tag part=\"tag\" readonly color=\"gray-slate\" closable .value=${o.value} @click=${() => this.#selectValue(o, false)}>${o.textContent}</nve-tag>`\n )}\n </div>`\n : nothing;\n }\n\n get #menu() {\n return html`\n <nve-menu part=\"menu\" role=\"listbox\" style=\"--width: 100%; --min-width: fit-content\" aria-label=${ifDefined(this.i18n.select)}>\n ${this.#options\n .filter(o => o !== this.#placeholderOption)\n .map(\n (o, i) => html`\n <nve-menu-item part=\"menu-item\" role=\"option\" @click=${() => this.#selectValue(o, !o.selected)} ?selected=${o.selected} ?disabled=${o.disabled} ?hidden=${!!o.hidden} aria-selected=${o.selected}>\n <slot name=\"option-${i + 1}\">\n <nve-icon part=\"icon\" name=\"check\" size=\"sm\" aria-hidden=\"true\"></nve-icon> ${o.innerText}\n </slot>\n </nve-menu-item>`\n )}\n </nve-menu>`;\n }\n\n protected get suffixContent() {\n return this.#select?.size === 0\n ? html`\n <nve-icon name=\"caret\" part=\"caret\" direction=\"down\" size=\"sm\" aria-hidden=\"true\"></nve-icon>\n <nve-dropdown part=\"dropdown\" @close=${this.#closeDropdown} @open=${this.#openDropdown} hidden .anchor=${this.#input} position=\"bottom\">\n ${this.#menu}\n </nve-dropdown>`\n : this.#menu;\n }\n\n async firstUpdated(props: PropertyValues<this>) {\n super.firstUpdated(props);\n await this.updateComplete;\n this.#setupCustomSelectUI();\n }\n\n #syncSelectValueStates() {\n this.#observers.push(\n getElementUpdate(this.#select, 'value', () => this.requestUpdate()),\n onChildListMutation(this.#select, () => this.requestUpdate(), { attributes: true, subtree: true }),\n onChildListMutation(this.#select, () => this.#syncOptionSelectedStates(), { subtree: true })\n );\n }\n\n #optionObservers = new Map<HTMLOptionElement, MutationObserver>();\n\n #setupObservers() {\n this.#disconnectObservers();\n this.#setupOverflowListener();\n this.#syncSelectValueStates();\n this.#syncOptionSelectedStates();\n }\n\n #disconnectObservers() {\n this.#observers.forEach(observer => observer.disconnect());\n this.#observers = [];\n this.#optionObservers.clear();\n this.#overflowObserver = undefined;\n this.#observedTags = undefined;\n }\n\n #syncOptionSelectedStates() {\n const options = new Set(this.#options);\n\n this.#optionObservers.forEach((observer, option) => {\n if (!options.has(option)) {\n observer.disconnect();\n this.#optionObservers.delete(option);\n this.#observers = this.#observers.filter(o => o !== observer);\n }\n });\n\n this.#options.forEach(o => {\n if (!this.#optionObservers.has(o)) {\n const observer = getElementUpdate(o, 'selected', () => this.requestUpdate());\n this.#optionObservers.set(o, observer);\n this.#observers.push(observer);\n }\n });\n }\n\n connectedCallback() {\n super.connectedCallback();\n appendRootNodeStyle(this, globalStyles);\n void this.updateComplete.then(() => {\n if (this.isConnected) {\n this.#setupObservers();\n }\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.#disconnectObservers();\n }\n\n async updated(props: PropertyValues<this>) {\n super.updated(props);\n if (this.#select?.size && this.#select?.size !== 0) {\n this._internals.states.add('size');\n this.style.setProperty('--size', `${this.#select.size}`);\n } else {\n this._internals.states.delete('size');\n this.style.removeProperty('--size');\n }\n\n if (this.#select?.multiple && this.#select?.size === 0) {\n this._internals.states.add('multiple');\n } else {\n this._internals.states.delete('multiple');\n }\n this.#observeTags();\n }\n\n #setupCustomSelectUI() {\n if (this.#select?.size === 0) {\n onListboxActivate(this.#select, () => {\n this.requestUpdate(); // update menu items\n this.#dropdown!.style.setProperty('--min-width', `${this.#input!.getBoundingClientRect().width}px`);\n this.#dropdown!.showPopover();\n focusElementTimeout(this.#menuItems[0] as HTMLElement);\n });\n }\n }\n\n #openDropdown() {\n this.#dropdown!.hidden = false;\n this.#caret!.direction = 'up';\n }\n\n #closeDropdown() {\n this.#dropdown!.hidden = true;\n this.#caret!.direction = 'down';\n }\n\n #setupOverflowListener() {\n const input = this.#input;\n if (!input) return;\n let inputWidth: number | undefined;\n const observer = new ResizeObserver(entries => {\n const inputEntry = entries.find(entry => entry.target === input);\n if (inputEntry) inputWidth = inputEntry.contentRect.width;\n if (this.isConnected && inputWidth !== undefined) this.#updateMultipleOverflow(inputWidth);\n });\n this.#overflowObserver = observer;\n this.#observers.push(observer);\n observer.observe(input);\n this.#observeTags();\n }\n\n #observeTags() {\n const observer = this.#overflowObserver;\n if (!observer) return;\n const tags = this.#tags;\n if (tags === this.#observedTags) return;\n if (this.#observedTags) observer.unobserve(this.#observedTags);\n this.#observedTags = tags;\n if (tags) observer.observe(tags);\n else this._internals.states.delete('multiple-overflow');\n }\n\n async #selectValue(option: HTMLOptionElement, selected: boolean) {\n if (this.#select.multiple || (!this.#select.multiple && option.value !== this.#select.value)) {\n option.selected = selected;\n }\n\n // native select only the first selected option determines the select input value\n if (this.#select.selectedOptions.length < 1) {\n this.#select.value = selected ? option.value : '';\n }\n\n this.#select.dispatchEvent(new Event('input', { bubbles: true }));\n this.#select.dispatchEvent(new Event('change', { bubbles: true }));\n this.requestUpdate();\n\n if (!this.#select.multiple && this.#dropdown) {\n this.#dropdown.hidePopover();\n } else {\n await this.updateComplete;\n this.#updateMultipleOverflow(this.#input!.getBoundingClientRect().width);\n }\n }\n\n #updateMultipleOverflow(width: number) {\n const tags = this.#tags;\n if (this.#select?.multiple && tags && tags.getBoundingClientRect().width > width - 48) {\n this._internals.states.add('multiple-overflow');\n } else {\n this._internals.states.delete('multiple-overflow');\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAyBA,IAAMM,IAAe;CACnB,QAAQ;CACR,UAAU;AACZ,GAsCaC,IAAN,cAAqBC,EAAQ;;EAyHf,A,aAtGqB,KAAAE,KAAA,IAAIC,EAAqB,MAAML,CAAY,GAGhD,KAAA,OAAA,KAAKI,GAAgB,MAkCJ,KAAAE,KAAA,CAAC,GAiElC,KAAAC,qBAAA,IAAI,IAAyC;;;EAxHhD,KAAA,SAAAC,EAAU,CAAC,GAAGN,EAAQ,QAAQR,CAAM,CAAC;;;EAE1B,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;;EAE4B,KAAA,qBAAA;IACzBe,EAAK,SAAS,MAAMA;IACpBC,EAAS,SAAS,MAAMA;IACxBC,EAAK,SAAS,MAAMA;IACpBC,EAAS,SAAS,MAAMA;IACxBC,EAAI,SAAS,MAAMA;EACtB;;CAKA;CAKA,IAAIC,KAAU;EACZ,OAAO,KAAK;CACd;CAEA,IAAIC,KAAW;EACb,OAAO,MAAM,KAAK,KAAKD,IAAS,UAAU,KAAKA,GAAQ,UAAU,CAAC,CAAC;CACrE;CAEA,IAAIE,KAAY;EACd,OAAO,KAAK,WAAY,cAAwBN,EAAS,SAAS,GAAG;CACvE;CAEA,IAAIO,KAAa;EACf,OAAO,KAAK,WAAY,iBAA2BL,EAAS,SAAS,GAAG;CAC1E;CAEA,IAAIM,KAAS;EACX,OAAO,KAAK,WAAY,cAA2B,SAAS;CAC9D;CAEA,IAAIC,KAAQ;EACV,OAAO,KAAK,WAAY,cAAc,OAAO;CAC/C;CAEA,IAAIC,KAAS;EACX,OAAO,KAAK,WAAY,cAAoB,kBAAgB;CAC9D;CAEA,IAAIC,KAAqB;EACvB,OAAO,KAAKN,GAAS,MAAK,MAAKO,EAAE,YAAYA,EAAE,U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AAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA1D,EAAA,WAAA,QAAA,KAAA,CAAA,GAxB3B,IAAAL,EAAA,CAAAgE,EAAa,GACbC,EAAe,CAAA,GAAA5D,CAAA"}
@@ -1,28 +1,28 @@
1
- import { attachInternals as e } from "../internal/utils/a11y.js";
2
- import { useStyles as t } from "../internal/styles/index.js";
3
- import n from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
4
- import r from "./skeleton.js";
5
- import { LitElement as i, html as a } from "lit";
6
- import { property as o } from "lit/decorators/property.js";
1
+ import e from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
2
+ import t from "./skeleton.js";
3
+ import { attachInternals as n } from "@nvidia-elements/foundations/internal/a11y";
4
+ import { LitElement as r, html as i } from "lit";
5
+ import { property as a } from "lit/decorators/property.js";
6
+ import { useStyles as o } from "@nvidia-elements/foundations/internal/styles";
7
7
  // src/skeleton/skeleton.ts
8
- var s = class extends i {
8
+ var s = class extends r {
9
9
  constructor(...e) {
10
10
  super(...e), this.hidden = !1;
11
11
  }
12
12
  static {
13
- this.styles = t([r]);
13
+ this.styles = o([t]);
14
14
  }
15
15
  static {
16
16
  this.metadata = {
17
17
  tag: "nve-skeleton",
18
- version: "2.23.4"
18
+ version: "2.23.5"
19
19
  };
20
20
  }
21
21
  render() {
22
- return a`<div internal-host><div class="animate"></div><slot @slotchange="${this.#e}"></slot></div>`;
22
+ return i`<div internal-host><div class="animate"></div><slot @slotchange="${this.#e}"></slot></div>`;
23
23
  }
24
24
  connectedCallback() {
25
- super.connectedCallback(), e(this), this._internals.ariaBusy = "true";
25
+ super.connectedCallback(), n(this), this._internals.ariaBusy = "true";
26
26
  }
27
27
  updated(e) {
28
28
  super.updated(e), this._internals.ariaBusy = `${!this.hidden}`;
@@ -31,13 +31,13 @@ var s = class extends i {
31
31
  e.target.assignedNodes().some((e) => e.nodeType === Node.ELEMENT_NODE || e.nodeType === Node.TEXT_NODE && e.textContent?.trim() !== "") ? this._internals.states.add("slotted") : this._internals.states.delete("slotted");
32
32
  }
33
33
  };
34
- n([o({
34
+ e([a({
35
35
  type: String,
36
36
  reflect: !0
37
- })], s.prototype, "effect", void 0), n([o({
37
+ })], s.prototype, "effect", void 0), e([a({
38
38
  type: String,
39
39
  reflect: !0
40
- })], s.prototype, "shape", void 0), n([o({
40
+ })], s.prototype, "shape", void 0), e([a({
41
41
  type: Boolean,
42
42
  reflect: !0
43
43
  })], s.prototype, "hidden", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"skeleton2.js","names":["styles","_decorate","__decorate","skeleton_default","Skeleton","LitElement","_args","useStyles","#slotchange","attachInternals","props","event","node","property"],"sources":["../../src/skeleton/skeleton.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement, type PropertyValues } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { attachInternals, useStyles } from '@nvidia-elements/core/internal';\nimport styles from './skeleton.css?inline';\n\n/**\n * @element nve-skeleton\n * @description A loading placeholder component that displays animated placeholder shapes while content loads.\n * @documentation https://nvidia.github.io/elements/docs/elements/skeleton/\n * @since 1.44.0\n * @entrypoint \\@nvidia-elements/core/skeleton\n * @slot - Loaded content that replaces the placeholder when provided.\n * @cssprop --background\n * @cssprop --border-radius\n * @cssprop --min-height\n * @aria https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-live\n */\nexport class Skeleton extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-skeleton',\n version: '0.0.0'\n };\n\n /** Visual animation style shown while content loads. */\n @property({ type: String, reflect: true }) effect: 'shimmer' | 'pulse';\n\n /** Geometry of the placeholder — rounded corners or a full pill outline. */\n @property({ type: String, reflect: true }) shape: 'round' | 'pill';\n\n /** Hides the skeleton host when `true` and sets `aria-busy` to the inverse visibility state. */\n @property({ type: Boolean, reflect: true }) hidden = false;\n\n /** @private */\n declare _internals: ElementInternals;\n\n render() {\n return html`\n <div internal-host>\n <div class=\"animate\"></div>\n <slot @slotchange=${this.#slotchange}></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.ariaBusy = 'true';\n }\n\n updated(props: PropertyValues<this>) {\n super.updated(props);\n this._internals.ariaBusy = `${!this.hidden}`;\n }\n\n #slotchange(event: Event) {\n const target = event.target as HTMLSlotElement;\n const hasContent = target\n .assignedNodes()\n .some(\n node =>\n node.nodeType === Node.ELEMENT_NODE || (node.nodeType === Node.TEXT_NODE && node.textContent?.trim() !== '')\n );\n\n if (hasContent) {\n this._internals.states.add('slotted');\n } else {\n this._internals.states.delete('slotted');\n }\n }\n}\n"],"mappings":";;;;;;;AAoBA,IAAaI,IAAb,cAA8BC,EAAW;;EAec,A,aAAA,KAAA,SAAA;;;EAdrC,KAAA,SAAAE,EAAU,CAACP,CAAM,CAAC;;;EAEP,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;CAcA,SAAS;EACP,OAAO,CAAI,oEAGa,KAAKQ,GAAY;CAG3C;CAEA,oBAAoB;EAGlB,AAFA,MAAM,kBAAkB,GACxBC,EAAgB,IAAI,GACpB,KAAK,WAAW,WAAW;CAC7B;CAEA,QAAQ,GAA6B;EAEnC,AADA,MAAM,QAAQC,CAAK,GACnB,KAAK,WAAW,WAAW,GAAG,CAAC,KAAK;CACtC;CAEA,GAAY,GAAc;EASxB,AAReC,EAAM,OAElB,cAAc,CAAC,CACf,MACC,MACEC,EAAK,aAAa,KAAK,gBAAiBA,EAAK,aAAa,KAAK,aAAaA,EAAK,aAAa,KAAK,MAAM,EAG3G,IACF,KAAK,WAAW,OAAO,IAAI,SAAS,IAEpC,KAAK,WAAW,OAAO,OAAO,SAAS;CAE3C;AACF;AA9CGX,EAAA,CAAAY,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAAT,EAAA,WAAA,UAAA,KAAA,CAAA,GAGxCH,EAAA,CAAAY,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAAT,EAAA,WAAA,SAAA,KAAA,CAAA,GAGxCH,EAAA,CAAAY,EAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAAT,EAAA,WAAA,UAAA,KAAA,CAAA"}
1
+ {"version":3,"file":"skeleton2.js","names":["styles","_decorate","__decorate","skeleton_default","Skeleton","LitElement","_args","useStyles","#slotchange","attachInternals","props","event","node","property"],"sources":["../../src/skeleton/skeleton.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement, type PropertyValues } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { attachInternals } from '@nvidia-elements/foundations/internal/a11y';\nimport { useStyles } from '@nvidia-elements/foundations/internal/styles';\nimport styles from './skeleton.css?inline';\n\n/**\n * @element nve-skeleton\n * @description A loading placeholder component that displays animated placeholder shapes while content loads.\n * @documentation https://nvidia.github.io/elements/docs/elements/skeleton/\n * @since 1.44.0\n * @entrypoint \\@nvidia-elements/core/skeleton\n * @slot - Loaded content that replaces the placeholder when provided.\n * @cssprop --background\n * @cssprop --border-radius\n * @cssprop --min-height\n * @aria https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-live\n */\nexport class Skeleton extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-skeleton',\n version: '0.0.0'\n };\n\n /** Visual animation style shown while content loads. */\n @property({ type: String, reflect: true }) effect: 'shimmer' | 'pulse';\n\n /** Geometry of the placeholder — rounded corners or a full pill outline. */\n @property({ type: String, reflect: true }) shape: 'round' | 'pill';\n\n /** Hides the skeleton host when `true` and sets `aria-busy` to the inverse visibility state. */\n @property({ type: Boolean, reflect: true }) hidden = false;\n\n /** @private */\n declare _internals: ElementInternals;\n\n render() {\n return html`\n <div internal-host>\n <div class=\"animate\"></div>\n <slot @slotchange=${this.#slotchange}></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.ariaBusy = 'true';\n }\n\n updated(props: PropertyValues<this>) {\n super.updated(props);\n this._internals.ariaBusy = `${!this.hidden}`;\n }\n\n #slotchange(event: Event) {\n const target = event.target as HTMLSlotElement;\n const hasContent = target\n .assignedNodes()\n .some(\n node =>\n node.nodeType === Node.ELEMENT_NODE || (node.nodeType === Node.TEXT_NODE && node.textContent?.trim() !== '')\n );\n\n if (hasContent) {\n this._internals.states.add('slotted');\n } else {\n this._internals.states.delete('slotted');\n }\n }\n}\n"],"mappings":";;;;;;;AAqBA,IAAaI,IAAb,cAA8BC,EAAW;;EAec,A,aAAA,KAAA,SAAA;;;EAdrC,KAAA,SAAAE,EAAU,CAACP,CAAM,CAAC;;;EAEP,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;CAcA,SAAS;EACP,OAAO,CAAI,oEAGa,KAAKQ,GAAY;CAG3C;CAEA,oBAAoB;EAGlB,AAFA,MAAM,kBAAkB,GACxBC,EAAgB,IAAI,GACpB,KAAK,WAAW,WAAW;CAC7B;CAEA,QAAQ,GAA6B;EAEnC,AADA,MAAM,QAAQC,CAAK,GACnB,KAAK,WAAW,WAAW,GAAG,CAAC,KAAK;CACtC;CAEA,GAAY,GAAc;EASxB,AAReC,EAAM,OAElB,cAAc,CAAC,CACf,MACC,MACEC,EAAK,aAAa,KAAK,gBAAiBA,EAAK,aAAa,KAAK,aAAaA,EAAK,aAAa,KAAK,MAAM,EAG3G,IACF,KAAK,WAAW,OAAO,IAAI,SAAS,IAEpC,KAAK,WAAW,OAAO,OAAO,SAAS;CAE3C;AACF;AA9CGX,EAAA,CAAAY,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAAT,EAAA,WAAA,UAAA,KAAA,CAAA,GAGxCH,EAAA,CAAAY,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAAT,EAAA,WAAA,SAAA,KAAA,CAAA,GAGxCH,EAAA,CAAAY,EAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAAT,EAAA,WAAA,UAAA,KAAA,CAAA"}
@@ -32,7 +32,7 @@ export declare class SortButton extends SortButton_base {
32
32
  /**
33
33
  * Updates internal string values for internationalization.
34
34
  */
35
- i18n: Partial<import("@nvidia-elements/core/internal").I18nStrings & {
35
+ i18n: Partial<import("@nvidia-elements/foundations/internal/i18n").I18nStrings & {
36
36
  __set: boolean;
37
37
  }>;
38
38
  render(): import("lit-html").TemplateResult<1>;
@@ -1,36 +1,36 @@
1
- import { scopedRegistry as e } from "../internal/decorators/scoped-registry.js";
2
- import { useStyles as t } from "../internal/styles/index.js";
3
- import n from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
4
- import { Icon as r } from "../icon/icon2.js";
5
- import i from "./sort-button.js";
6
- import { LitElement as a, html as o } from "lit";
7
- import { property as s } from "lit/decorators/property.js";
8
- import { I18nController as c } from "@nvidia-elements/foundations/internal/i18n";
1
+ import e from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
2
+ import { Icon as t } from "../icon/icon2.js";
3
+ import n from "./sort-button.js";
4
+ import { LitElement as r, html as i } from "lit";
5
+ import { property as a } from "lit/decorators/property.js";
6
+ import { I18nController as o } from "@nvidia-elements/foundations/internal/i18n";
7
+ import { scopedRegistry as s } from "@nvidia-elements/foundations/internal/decorators";
8
+ import { useStyles as c } from "@nvidia-elements/foundations/internal/styles";
9
9
  import { ButtonFormControlMixin as l } from "@nvidia-elements/forms/mixins";
10
10
  // src/sort-button/sort-button.ts
11
11
  var u = { sort: "sort" }, d = {
12
12
  none: "ascending",
13
13
  ascending: "descending",
14
14
  descending: "none"
15
- }, f = class extends l(a) {
15
+ }, f = class extends l(r) {
16
16
  static {
17
- this.styles = t([i]);
17
+ this.styles = c([n]);
18
18
  }
19
19
  static {
20
20
  this.metadata = {
21
21
  tag: "nve-sort-button",
22
- version: "2.23.4"
22
+ version: "2.23.5"
23
23
  };
24
24
  }
25
25
  static {
26
- this.elementDefinitions = { [r.metadata.tag]: r };
26
+ this.elementDefinitions = { [t.metadata.tag]: t };
27
27
  }
28
28
  #e;
29
29
  render() {
30
- return o`<div internal-host focus-within><nve-icon part="icon" .name="${this.sort === "descending" ? "sort-descending" : "sort-ascending"}" aria-hidden="true"></nve-icon></div>`;
30
+ return i`<div internal-host focus-within><nve-icon part="icon" .name="${this.sort === "descending" ? "sort-descending" : "sort-ascending"}" aria-hidden="true"></nve-icon></div>`;
31
31
  }
32
32
  constructor() {
33
- super(), this.sort = "none", this.#e = new c(this, u), this.i18n = this.#e.i18n, this.#t = () => {
33
+ super(), this.sort = "none", this.#e = new o(this, u), this.i18n = this.#e.i18n, this.#t = () => {
34
34
  this._internals.ariaLabel = `${this.#e.i18n.sort} ${d[this.sort]}`, this.dispatchEvent(new CustomEvent("sort", {
35
35
  detail: {
36
36
  value: this.sort,
@@ -49,10 +49,10 @@ var u = { sort: "sort" }, d = {
49
49
  }
50
50
  #t;
51
51
  };
52
- n([s({
52
+ e([a({
53
53
  type: String,
54
54
  reflect: !0
55
- })], f.prototype, "sort", void 0), n([s({ type: Object })], f.prototype, "i18n", void 0), f = n([e()], f);
55
+ })], f.prototype, "sort", void 0), e([a({ type: Object })], f.prototype, "i18n", void 0), f = e([s()], f);
56
56
  export { f as SortButton };
57
57
 
58
58
  //# sourceMappingURL=sort-button2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sort-button2.js","names":["styles","_decorate","__decorate","sort_button_default","i18nDefaults","nextSort","SortButton","ButtonFormControlMixin","LitElement","useStyles","Icon","#i18nController","I18nController","#onClick","property","scopedRegistry"],"sources":["../../src/sort-button/sort-button.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { ButtonFormControlMixin } from '@nvidia-elements/forms/mixins';\nimport { Icon } from '@nvidia-elements/core/icon';\nimport { useStyles, scopedRegistry } from '@nvidia-elements/core/internal';\nimport { I18nController, type I18nDefaults } from '@nvidia-elements/foundations/internal/i18n';\nimport styles from './sort-button.css?inline';\n\nconst i18nDefaults = {\n sort: 'sort'\n} satisfies I18nDefaults;\n\nconst nextSort = {\n none: 'ascending',\n ascending: 'descending',\n descending: 'none'\n};\n\n/**\n * @element nve-sort-button\n * @description A sort button is a control that enables users to sort a list of items in ascending or descending order.\n * @documentation https://nvidia.github.io/elements/docs/elements/sort-button/\n * @since 0.11.0\n * @entrypoint \\@nvidia-elements/core/sort-button\n * @event sort - Dispatched on activation with `detail: { value, next }`, where `value` is the current sort and `next` follows the cycle `none` → `ascending` → `descending` → `none`.\n * @cssprop --width\n * @cssprop --height\n * @cssprop --border-radius\n * @cssprop --color\n * @csspart icon - The icon element\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/spinbutton/\n */\n@scopedRegistry()\nexport class SortButton extends ButtonFormControlMixin(LitElement) {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-sort-button',\n version: '0.0.0'\n };\n\n static elementDefinitions = {\n [Icon.metadata.tag]: Icon\n };\n\n /**\n * The current sort value, can be ascending, descending, or none.\n */\n @property({ type: String, reflect: true }) sort: 'ascending' | 'descending' | 'none' = 'none';\n\n #i18nController: I18nController<this> = new I18nController<this>(this, i18nDefaults);\n\n /**\n * Updates internal string values for internationalization.\n */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n render() {\n return html`\n <div internal-host focus-within>\n <nve-icon part=\"icon\" .name=${this.sort === 'descending' ? 'sort-descending' : 'sort-ascending'} aria-hidden=\"true\"></nve-icon>\n </div>\n `;\n }\n\n constructor() {\n super();\n this.type = 'button';\n }\n\n connectedCallback() {\n super.connectedCallback();\n this._internals.role = 'spinbutton';\n this.addEventListener('click', this.#onClick);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('click', this.#onClick);\n }\n\n #onClick = () => {\n this._internals.ariaLabel = `${this.#i18nController.i18n.sort} ${nextSort[this.sort]}`;\n this.dispatchEvent(\n new CustomEvent('sort', {\n detail: { value: this.sort, next: nextSort[this.sort] },\n bubbles: true,\n composed: true\n })\n );\n };\n}\n"],"mappings":";;;;;;;;;;AAWA,IAAMI,IAAe,EACnB,MAAM,OACR,GAEMC,IAAW;CACf,MAAM;CACN,WAAW;CACX,YAAY;AACd,GAiBaC,IAAN,cAAyBC,EAAuBC,CAAU,CAAC,CAAC;;EACjD,KAAA,SAAAC,EAAU,CAACT,CAAM,CAAC;;;EAEP,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;;EAE4B,KAAA,qBAAA,GACzBU,EAAK,SAAS,MAAMA,EACvB;;CAOA;CAOA,SAAS;EACP,OAAO,CAAI,gEAEuB,KAAK,SAAS,eAAe,oBAAoB,iBAAiB;CAGtG;CAEA,cAAc;EAEZ,AADA,MAAM,GAlB+E,KAAA,OAAA,QAE/C,KAAAC,KAAA,IAAIC,EAAqB,MAAMR,CAAY,GAKhD,KAAA,OAAA,KAAKO,GAAgB,MA0BvC,KAAAE,WAAA;GAEf,AADA,KAAK,WAAW,YAAY,GAAG,KAAKF,GAAgB,KAAK,KAAK,GAAGN,EAAS,KAAK,SAC/E,KAAK,cACH,IAAI,YAAY,QAAQ;IACtB,QAAQ;KAAE,OAAO,KAAK;KAAM,MAAMA,EAAS,KAAK;IAAM;IACtD,SAAS;IACT,UAAU;GACZ,CAAC,CACH;EACF,GAvBE,KAAK,OAAO;CACd;CAEA,oBAAoB;EAGlB,AAFA,MAAM,kBAAkB,GACxB,KAAK,WAAW,OAAO,cACvB,KAAK,iBAAiB,SAAS,KAAKQ,EAAQ;CAC9C;CAEA,uBAAuB;EAErB,AADA,MAAM,qBAAqB,GAC3B,KAAK,oBAAoB,SAAS,KAAKA,EAAQ;CACjD;CAEA;AAUF;AA3CGZ,EAAA,CAAAa,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAAR,EAAA,WAAA,QAAA,KAAA,CAAA,GAOxCL,EAAA,CAAAa,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAAR,EAAA,WAAA,QAAA,KAAA,CAAA,GAvB3B,IAAAL,EAAA,CAAAc,EAAe,CAAA,GAAAT,CAAA"}
1
+ {"version":3,"file":"sort-button2.js","names":["styles","_decorate","__decorate","sort_button_default","i18nDefaults","nextSort","SortButton","ButtonFormControlMixin","LitElement","useStyles","Icon","#i18nController","I18nController","#onClick","property","scopedRegistry"],"sources":["../../src/sort-button/sort-button.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { ButtonFormControlMixin } from '@nvidia-elements/forms/mixins';\nimport { Icon } from '@nvidia-elements/core/icon';\nimport { scopedRegistry } from '@nvidia-elements/foundations/internal/decorators';\nimport { useStyles } from '@nvidia-elements/foundations/internal/styles';\nimport { I18nController, type I18nDefaults } from '@nvidia-elements/foundations/internal/i18n';\nimport styles from './sort-button.css?inline';\n\nconst i18nDefaults = {\n sort: 'sort'\n} satisfies I18nDefaults;\n\nconst nextSort = {\n none: 'ascending',\n ascending: 'descending',\n descending: 'none'\n};\n\n/**\n * @element nve-sort-button\n * @description A sort button is a control that enables users to sort a list of items in ascending or descending order.\n * @documentation https://nvidia.github.io/elements/docs/elements/sort-button/\n * @since 0.11.0\n * @entrypoint \\@nvidia-elements/core/sort-button\n * @event sort - Dispatched on activation with `detail: { value, next }`, where `value` is the current sort and `next` follows the cycle `none` → `ascending` → `descending` → `none`.\n * @cssprop --width\n * @cssprop --height\n * @cssprop --border-radius\n * @cssprop --color\n * @csspart icon - The icon element\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/spinbutton/\n */\n@scopedRegistry()\nexport class SortButton extends ButtonFormControlMixin(LitElement) {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-sort-button',\n version: '0.0.0'\n };\n\n static elementDefinitions = {\n [Icon.metadata.tag]: Icon\n };\n\n /**\n * The current sort value, can be ascending, descending, or none.\n */\n @property({ type: String, reflect: true }) sort: 'ascending' | 'descending' | 'none' = 'none';\n\n #i18nController: I18nController<this> = new I18nController<this>(this, i18nDefaults);\n\n /**\n * Updates internal string values for internationalization.\n */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n render() {\n return html`\n <div internal-host focus-within>\n <nve-icon part=\"icon\" .name=${this.sort === 'descending' ? 'sort-descending' : 'sort-ascending'} aria-hidden=\"true\"></nve-icon>\n </div>\n `;\n }\n\n constructor() {\n super();\n this.type = 'button';\n }\n\n connectedCallback() {\n super.connectedCallback();\n this._internals.role = 'spinbutton';\n this.addEventListener('click', this.#onClick);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('click', this.#onClick);\n }\n\n #onClick = () => {\n this._internals.ariaLabel = `${this.#i18nController.i18n.sort} ${nextSort[this.sort]}`;\n this.dispatchEvent(\n new CustomEvent('sort', {\n detail: { value: this.sort, next: nextSort[this.sort] },\n bubbles: true,\n composed: true\n })\n );\n };\n}\n"],"mappings":";;;;;;;;;;AAYA,IAAMI,IAAe,EACnB,MAAM,OACR,GAEMC,IAAW;CACf,MAAM;CACN,WAAW;CACX,YAAY;AACd,GAiBaC,IAAN,cAAyBC,EAAuBC,CAAU,CAAC,CAAC;;EACjD,KAAA,SAAAC,EAAU,CAACT,CAAM,CAAC;;;EAEP,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;;EAE4B,KAAA,qBAAA,GACzBU,EAAK,SAAS,MAAMA,EACvB;;CAOA;CAOA,SAAS;EACP,OAAO,CAAI,gEAEuB,KAAK,SAAS,eAAe,oBAAoB,iBAAiB;CAGtG;CAEA,cAAc;EAEZ,AADA,MAAM,GAlB+E,KAAA,OAAA,QAE/C,KAAAC,KAAA,IAAIC,EAAqB,MAAMR,CAAY,GAKhD,KAAA,OAAA,KAAKO,GAAgB,MA0BvC,KAAAE,WAAA;GAEf,AADA,KAAK,WAAW,YAAY,GAAG,KAAKF,GAAgB,KAAK,KAAK,GAAGN,EAAS,KAAK,SAC/E,KAAK,cACH,IAAI,YAAY,QAAQ;IACtB,QAAQ;KAAE,OAAO,KAAK;KAAM,MAAMA,EAAS,KAAK;IAAM;IACtD,SAAS;IACT,UAAU;GACZ,CAAC,CACH;EACF,GAvBE,KAAK,OAAO;CACd;CAEA,oBAAoB;EAGlB,AAFA,MAAM,kBAAkB,GACxB,KAAK,WAAW,OAAO,cACvB,KAAK,iBAAiB,SAAS,KAAKQ,EAAQ;CAC9C;CAEA,uBAAuB;EAErB,AADA,MAAM,qBAAqB,GAC3B,KAAK,oBAAoB,SAAS,KAAKA,EAAQ;CACjD;CAEA;AAUF;AA3CGZ,EAAA,CAAAa,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAAR,EAAA,WAAA,QAAA,KAAA,CAAA,GAOxCL,EAAA,CAAAa,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAAR,EAAA,WAAA,QAAA,KAAA,CAAA,GAvB3B,IAAAL,EAAA,CAAAc,EAAe,CAAA,GAAAT,CAAA"}
@@ -1,127 +1,128 @@
1
- import { attachInternals as e } from "../internal/utils/a11y.js";
2
- import { statusStateStyles as t, supportStateStyles as n, useStyles as r } from "../internal/styles/index.js";
3
- import i from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
4
- import { calculateDomain as a, calculateSymbolIndices as o, calculateViewBox as s, toAreaPath as c, toColumnRects as l, toInterpolation as u, toLinePath as d, toPlotPoints as f, toValidData as p, toWinLossRects as m, valueToY as h } from "./sparkline.utils.js";
5
- import g from "./sparkline.js";
6
- import { LitElement as _, html as v, nothing as y, svg as b } from "lit";
7
- import { property as x } from "lit/decorators/property.js";
1
+ import { statusStateStyles as e, supportStateStyles as t } from "../internal/styles/index.js";
2
+ import n from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
3
+ import { calculateDomain as r, calculateSymbolIndices as i, calculateViewBox as a, toAreaPath as o, toColumnRects as s, toInterpolation as c, toLinePath as l, toPlotPoints as u, toValidData as d, toWinLossRects as f, valueToY as p } from "./sparkline.utils.js";
4
+ import m from "./sparkline.js";
5
+ import { attachInternals as h } from "@nvidia-elements/foundations/internal/a11y";
6
+ import { LitElement as g, html as _, nothing as v, svg as y } from "lit";
7
+ import { property as b } from "lit/decorators/property.js";
8
+ import { useStyles as x } from "@nvidia-elements/foundations/internal/styles";
8
9
  import { state as S } from "lit/decorators/state.js";
9
10
  // src/sparkline/sparkline.ts
10
- var C = class extends _ {
11
+ var C = class extends g {
11
12
  constructor(...e) {
12
13
  super(...e), this.data = [], this.mark = "line", this.interpolation = "linear", this.denoteFirst = !1, this.denoteLast = !1, this.denoteMin = !1, this.denoteMax = !1, this.intervalLength = .6, this.validData = [];
13
14
  }
14
15
  static {
15
- this.styles = r([
16
- g,
17
- t,
18
- n
16
+ this.styles = x([
17
+ m,
18
+ e,
19
+ t
19
20
  ]);
20
21
  }
21
22
  static {
22
23
  this.metadata = {
23
24
  tag: "nve-sparkline",
24
- version: "2.23.4"
25
+ version: "2.23.5"
25
26
  };
26
27
  }
27
28
  render() {
28
- return v`<div internal-host>${this.#e()}</div>`;
29
+ return _`<div internal-host>${this.#e()}</div>`;
29
30
  }
30
31
  connectedCallback() {
31
- super.connectedCallback(), e(this), this._internals.role = "img";
32
+ super.connectedCallback(), h(this), this._internals.role = "img";
32
33
  }
33
34
  willUpdate(e) {
34
- super.willUpdate(e), e.has("data") && (this.validData = p(this.data));
35
+ super.willUpdate(e), e.has("data") && (this.validData = d(this.data));
35
36
  }
36
37
  #e() {
37
- let { width: e, height: t } = s(this.mark, this.validData.length, this.intervalLength);
38
+ let { width: e, height: t } = a(this.mark, this.validData.length, this.intervalLength);
38
39
  switch (this.mark) {
39
40
  case "line":
40
41
  case "area":
41
42
  case "gradient": return this.#t(e, t);
42
43
  case "column": return this.#a(e, t);
43
44
  case "winloss": return this.#o(50, e, t);
44
- default: return this.mark, y;
45
+ default: return this.mark, v;
45
46
  }
46
47
  }
47
48
  updated(e) {
48
49
  super.updated(e);
49
- let { width: t, height: n } = s(this.mark, this.validData.length, this.intervalLength), r = t / n, i = Number.isFinite(r) && r > 0 ? r : 1;
50
+ let { width: t, height: n } = a(this.mark, this.validData.length, this.intervalLength), r = t / n, i = Number.isFinite(r) && r > 0 ? r : 1;
50
51
  this.style.setProperty("--_aspect-ratio", i.toFixed(4));
51
52
  }
52
53
  #t(e, t) {
53
- let n = a(this.validData, {
54
+ let n = r(this.validData, {
54
55
  explicitMin: this.min,
55
56
  explicitMax: this.max
56
57
  });
57
- if (!n) return y;
58
- let r = h(0, n), i = n.min < 0 && n.max > 0, s = f(this.validData, n, { width: e }), l = o(this.validData, {
58
+ if (!n) return v;
59
+ let a = p(0, n), s = n.min < 0 && n.max > 0, d = u(this.validData, n, { width: e }), f = i(this.validData, {
59
60
  first: this.denoteFirst,
60
61
  last: this.denoteLast,
61
62
  min: this.denoteMin,
62
63
  max: this.denoteMax
63
- }), p = u(this.interpolation), m = d(s, p, e), g = this.mark === "area" || this.mark === "gradient" ? c(s, p, 100) : "";
64
- return b`<svg viewBox="0 0 ${e} ${t}" preserveAspectRatio="xMidYMid meet" aria-hidden="true">${this.mark === "gradient" ? this.#n(t) : y} ${g.length ? this.mark === "gradient" ? b`<path class="area" d="${g}" style="fill:url(#gradient)"></path>` : b`<path class="area" d="${g}"></path>` : y} ${i ? this.#r(r, e) : y} ${m ? b`<path class="line" d="${m}" vector-effect="non-scaling-stroke"></path>` : y}</svg> ${this.#i(s, l)}`;
64
+ }), m = c(this.interpolation), h = l(d, m, e), g = this.mark === "area" || this.mark === "gradient" ? o(d, m, 100) : "";
65
+ return y`<svg viewBox="0 0 ${e} ${t}" preserveAspectRatio="xMidYMid meet" aria-hidden="true">${this.mark === "gradient" ? this.#n(t) : v} ${g.length ? this.mark === "gradient" ? y`<path class="area" d="${g}" style="fill:url(#gradient)"></path>` : y`<path class="area" d="${g}"></path>` : v} ${s ? this.#r(a, e) : v} ${h ? y`<path class="line" d="${h}" vector-effect="non-scaling-stroke"></path>` : v}</svg> ${this.#i(d, f)}`;
65
66
  }
66
67
  #n(e) {
67
- return b`<defs><linearGradient id="gradient" x1="0" y1="0" x2="0" y2="${e}" gradientUnits="userSpaceOnUse"><stop offset="0%" style="stop-color:var(--gradient-max-color)"></stop><stop offset="100%" style="stop-color:var(--gradient-min-color)"></stop></linearGradient></defs>`;
68
+ return y`<defs><linearGradient id="gradient" x1="0" y1="0" x2="0" y2="${e}" gradientUnits="userSpaceOnUse"><stop offset="0%" style="stop-color:var(--gradient-max-color)"></stop><stop offset="100%" style="stop-color:var(--gradient-min-color)"></stop></linearGradient></defs>`;
68
69
  }
69
70
  #r(e, t) {
70
- return b`<line class="zero-line" vector-effect="non-scaling-stroke" x1="0" y1="${e.toFixed(2)}" x2="${t}" y2="${e.toFixed(2)}"></line>`;
71
+ return y`<line class="zero-line" vector-effect="non-scaling-stroke" x1="0" y1="${e.toFixed(2)}" x2="${t}" y2="${e.toFixed(2)}"></line>`;
71
72
  }
72
73
  #i(e, t) {
73
- return e.length === 0 || t.size === 0 ? y : v`${Array.from(t).map((t) => {
74
+ return e.length === 0 || t.size === 0 ? v : _`${Array.from(t).map((t) => {
74
75
  let n = e[t];
75
- if (!n) return y;
76
+ if (!n) return v;
76
77
  let r = `--x: ${n.x.toFixed(2)}; --y: ${n.y.toFixed(2)}`;
77
- return v`<span style="${r}" class="accent"></span>`;
78
+ return _`<span style="${r}" class="accent"></span>`;
78
79
  })}`;
79
80
  }
80
81
  #a(e, t) {
81
- let n = a(this.validData, {
82
+ let n = r(this.validData, {
82
83
  explicitMin: this.min,
83
84
  explicitMax: this.max,
84
85
  includeZero: !0
85
86
  });
86
- if (!n) return y;
87
- let r = h(0, n), i = n.min < 0 && n.max > 0, o = f(this.validData, n, { width: e }), s = l(o, r, e);
88
- return b`<svg viewBox="0 0 ${e} ${t}" preserveAspectRatio="xMidYMid meet" aria-hidden="true">${i ? this.#r(r, e) : y} ${s.map((e) => b`<rect class="column" x="${e.x.toFixed(2)}" y="${e.y.toFixed(2)}" width="${e.width.toFixed(2)}" height="${e.height.toFixed(2)}"></rect>`)}</svg>`;
87
+ if (!n) return v;
88
+ let i = p(0, n), a = n.min < 0 && n.max > 0, o = u(this.validData, n, { width: e }), c = s(o, i, e);
89
+ return y`<svg viewBox="0 0 ${e} ${t}" preserveAspectRatio="xMidYMid meet" aria-hidden="true">${a ? this.#r(i, e) : v} ${c.map((e) => y`<rect class="column" x="${e.x.toFixed(2)}" y="${e.y.toFixed(2)}" width="${e.width.toFixed(2)}" height="${e.height.toFixed(2)}"></rect>`)}</svg>`;
89
90
  }
90
91
  #o(e, t, n) {
91
- if (this.validData.length === 0) return y;
92
- let r = m(this.validData, e, {
92
+ if (this.validData.length === 0) return v;
93
+ let r = f(this.validData, e, {
93
94
  width: t,
94
95
  height: n
95
96
  });
96
- return b`<svg viewBox="0 0 ${t} ${n}" preserveAspectRatio="xMidYMid meet" aria-hidden="true">${this.#r(e, t)} ${r.map((e) => b`<rect class="${e.className}" x="${e.x.toFixed(2)}" y="${e.y.toFixed(2)}" width="${e.width.toFixed(2)}" height="${e.height.toFixed(2)}"></rect>`)}</svg>`;
97
+ return y`<svg viewBox="0 0 ${t} ${n}" preserveAspectRatio="xMidYMid meet" aria-hidden="true">${this.#r(e, t)} ${r.map((e) => y`<rect class="${e.className}" x="${e.x.toFixed(2)}" y="${e.y.toFixed(2)}" width="${e.width.toFixed(2)}" height="${e.height.toFixed(2)}"></rect>`)}</svg>`;
97
98
  }
98
99
  };
99
- i([x({ type: Array })], C.prototype, "data", void 0), i([x({ type: String })], C.prototype, "mark", void 0), i([x({ type: String })], C.prototype, "interpolation", void 0), i([x({
100
+ n([b({ type: Array })], C.prototype, "data", void 0), n([b({ type: String })], C.prototype, "mark", void 0), n([b({ type: String })], C.prototype, "interpolation", void 0), n([b({
100
101
  type: String,
101
102
  reflect: !0
102
- })], C.prototype, "status", void 0), i([x({
103
+ })], C.prototype, "status", void 0), n([b({
103
104
  type: String,
104
105
  reflect: !0
105
- })], C.prototype, "size", void 0), i([x({
106
+ })], C.prototype, "size", void 0), n([b({
106
107
  type: Boolean,
107
108
  attribute: "denote-first",
108
109
  reflect: !0
109
- })], C.prototype, "denoteFirst", void 0), i([x({
110
+ })], C.prototype, "denoteFirst", void 0), n([b({
110
111
  type: Boolean,
111
112
  attribute: "denote-last",
112
113
  reflect: !0
113
- })], C.prototype, "denoteLast", void 0), i([x({
114
+ })], C.prototype, "denoteLast", void 0), n([b({
114
115
  type: Boolean,
115
116
  attribute: "denote-min",
116
117
  reflect: !0
117
- })], C.prototype, "denoteMin", void 0), i([x({
118
+ })], C.prototype, "denoteMin", void 0), n([b({
118
119
  type: Boolean,
119
120
  attribute: "denote-max",
120
121
  reflect: !0
121
- })], C.prototype, "denoteMax", void 0), i([x({
122
+ })], C.prototype, "denoteMax", void 0), n([b({
122
123
  type: Number,
123
124
  attribute: "interval-length"
124
- })], C.prototype, "intervalLength", void 0), i([x({ type: Number })], C.prototype, "min", void 0), i([x({ type: Number })], C.prototype, "max", void 0), i([S()], C.prototype, "validData", void 0);
125
+ })], C.prototype, "intervalLength", void 0), n([b({ type: Number })], C.prototype, "min", void 0), n([b({ type: Number })], C.prototype, "max", void 0), n([S()], C.prototype, "validData", void 0);
125
126
  export { C as Sparkline };
126
127
 
127
128
  //# sourceMappingURL=sparkline2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sparkline2.js","names":["styles","_decorate","__decorate","sparkline_default","Sparkline","LitElement","_args","useStyles","statusStateStyles","supportStateStyles","#renderChart","attachInternals","changedProperties","toValidData","calculateViewBox","#renderLineVariant","width","height","#renderColumn","#renderWinLoss","nothing","props","aspectRatio","validAspectRatio","domain","calculateDomain","baselineY","valueToY","drawZeroLine","plotPoints","toPlotPoints","symbolIndices","calculateSymbolIndices","interpolation","toInterpolation","linePath","toLinePath","areaPath","toAreaPath","#renderGradientDef","#renderZeroLine","#renderAccents","position","points","accentIndices","point","index","style","showZeroLine","rects","toColumnRects","rect","toWinLossRects","property","state"],"sources":["../../src/sparkline/sparkline.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { PropertyValues, SVGTemplateResult } from 'lit';\nimport { html, LitElement, nothing, svg } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { state } from 'lit/decorators/state.js';\nimport type {\n DataElement,\n Interpolation,\n Point,\n SizeExpanded,\n SparklineMark,\n SupportStatus,\n TaskStatus\n} from '@nvidia-elements/core/internal';\nimport { attachInternals, statusStateStyles, supportStateStyles, useStyles } from '@nvidia-elements/core/internal';\nimport {\n calculateDomain,\n calculateSymbolIndices,\n calculateViewBox,\n PRECISION,\n toAreaPath,\n toColumnRects,\n toInterpolation,\n toLinePath,\n toPlotPoints,\n toValidData,\n toWinLossRects,\n valueToY,\n VIEW_HEIGHT\n} from './sparkline.utils.js';\nimport styles from './sparkline.css?inline';\n\n/**\n * @element nve-sparkline\n * @description A sparkline is a compact, word-sized chart with typographic scale, for data-dense layouts (text, tables, cards, dashboards).\n * @documentation https://nvidia.github.io/elements/docs/elements/sparkline/\n * @since 0.0.0\n * @entrypoint \\@nvidia-elements/core/sparkline\n * @cssprop --height - Height (defaults to 1em and scales with parent font-size).\n * @cssprop --line-color\n * @cssprop --line-width\n * @cssprop --fill-color - Color used by area and column marks.\n * @cssprop --gradient-max-color\n * @cssprop --gradient-min-color\n * @cssprop --zero-line-color\n * @cssprop --zero-line-width\n * @cssprop --win-color Color used to represent positive values (wins).\n * @cssprop --loss-color Color used to represent negative values (losses).\n * @cssprop --draw-color Color used to represent zero values (draws / neutral outcomes).\n * @cssprop --symbol-color\n * @cssprop --symbol-border-color\n * @cssprop --symbol-border-width\n * @cssprop --symbol-radius - symbol circle radius in SVG units.\n * @aria https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img\n */\nexport class Sparkline extends LitElement implements DataElement<number[]> {\n static styles = useStyles([styles, statusStateStyles, supportStateStyles]);\n\n static readonly metadata = {\n tag: 'nve-sparkline',\n version: '0.0.0'\n };\n\n /** Numeric values representing a data series. */\n @property({ type: Array }) data: number[] = [];\n\n /** Controls the visual representation of data points. */\n @property({ type: String }) mark: SparklineMark = 'line';\n\n /** Controls how the chart connects intermediate values between points in a data series. Defaults to `linear`. */\n @property({ type: String }) interpolation: Interpolation = 'linear';\n\n /** Applies semantic status colors used across Elements status patterns. */\n @property({ type: String, reflect: true }) status?: TaskStatus | SupportStatus;\n\n /** Controls the sparkline size with explicit font-size tokens. Omit to auto-scale with parent font-size (1em). */\n @property({ type: String, reflect: true }) size?: SizeExpanded;\n\n /** Denotes the first data point by rendering a symbol at its position. */\n @property({ type: Boolean, attribute: 'denote-first', reflect: true })\n denoteFirst = false;\n\n /** Denotes the last data point by rendering a symbol at its position. */\n @property({ type: Boolean, attribute: 'denote-last', reflect: true })\n denoteLast = false;\n\n /** Denotes all minimum-value data points by rendering symbols at their positions. */\n @property({ type: Boolean, attribute: 'denote-min', reflect: true })\n denoteMin = false;\n\n /** Denotes all maximum-value data points by rendering symbols at their positions. */\n @property({ type: Boolean, attribute: 'denote-max', reflect: true })\n denoteMax = false;\n\n /** Controls spacing between points in a line, in em (1 = chart height). Defaults to `0.6`. */\n @property({ type: Number, attribute: 'interval-length' }) intervalLength = 0.6;\n\n /** Lower bound for the y-axis domain. When undefined, derives the bound from data. */\n @property({ type: Number }) min?: number;\n\n /** Upper bound for the y-axis domain. When undefined, derives the bound from data. */\n @property({ type: Number }) max?: number;\n\n /** Cached valid numeric values derived from data property. */\n @state() private validData: number[] = [];\n\n /** @private */\n declare _internals: ElementInternals;\n\n render() {\n return html`<div internal-host>${this.#renderChart()}</div>`;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'img';\n }\n\n willUpdate(changedProperties: PropertyValues<this>) {\n super.willUpdate(changedProperties);\n\n if (changedProperties.has('data')) {\n this.validData = toValidData(this.data);\n }\n }\n\n #renderChart(): SVGTemplateResult | typeof nothing {\n const { width, height } = calculateViewBox(this.mark, this.validData.length, this.intervalLength);\n\n switch (this.mark) {\n case 'line':\n case 'area':\n case 'gradient':\n return this.#renderLineVariant(width, height);\n case 'column':\n return this.#renderColumn(width, height);\n case 'winloss':\n return this.#renderWinLoss(VIEW_HEIGHT / 2, width, height);\n default:\n const _exhaustiveCheck: never = this.mark;\n return nothing;\n }\n }\n\n updated(props: PropertyValues<this>) {\n super.updated(props);\n\n const { width, height } = calculateViewBox(this.mark, this.validData.length, this.intervalLength);\n const aspectRatio = width / height;\n const validAspectRatio = Number.isFinite(aspectRatio) && aspectRatio > 0 ? aspectRatio : 1;\n this.style.setProperty('--_aspect-ratio', validAspectRatio.toFixed(4));\n }\n\n #renderLineVariant(width: number, height: number) {\n const domain = calculateDomain(this.validData, { explicitMin: this.min, explicitMax: this.max });\n if (!domain) return nothing;\n\n const baselineY = valueToY(0, domain);\n const drawZeroLine = domain.min < 0 && domain.max > 0;\n\n const plotPoints = toPlotPoints(this.validData, domain, { width });\n const symbolIndices = calculateSymbolIndices(this.validData, {\n first: this.denoteFirst,\n last: this.denoteLast,\n min: this.denoteMin,\n max: this.denoteMax\n });\n const interpolation = toInterpolation(this.interpolation);\n\n const linePath = toLinePath(plotPoints, interpolation, width);\n const drawArea = this.mark === 'area' || this.mark === 'gradient';\n const areaPath = drawArea ? toAreaPath(plotPoints, interpolation, VIEW_HEIGHT) : '';\n\n return svg`\n <svg viewBox=\"0 0 ${width} ${height}\" preserveAspectRatio=\"xMidYMid meet\" aria-hidden=\"true\">\n ${this.mark === 'gradient' ? this.#renderGradientDef(height) : nothing}\n\n ${\n areaPath.length\n ? this.mark === 'gradient'\n ? svg`<path class=\"area\" d=${areaPath} style=\"fill: url(#gradient)\"></path>`\n : svg`<path class=\"area\" d=${areaPath}></path>`\n : nothing\n }\n\n ${drawZeroLine ? this.#renderZeroLine(baselineY, width) : nothing}\n\n ${linePath ? svg`<path class=\"line\" d=${linePath} vector-effect=\"non-scaling-stroke\"></path>` : nothing}\n </svg>\n ${this.#renderAccents(plotPoints, symbolIndices)}\n `;\n }\n\n #renderGradientDef(height: number) {\n return svg`\n <defs>\n <linearGradient id=\"gradient\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"${height}\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0%\" style=\"stop-color: var(--gradient-max-color)\"></stop>\n <stop offset=\"100%\" style=\"stop-color: var(--gradient-min-color)\"></stop>\n </linearGradient>\n </defs>\n `;\n }\n\n #renderZeroLine(position: number, width: number) {\n return svg`\n <line\n class=\"zero-line\"\n vector-effect=\"non-scaling-stroke\"\n x1=\"0\"\n y1=\"${position.toFixed(PRECISION)}\"\n x2=\"${width}\"\n y2=\"${position.toFixed(PRECISION)}\">\n </line>\n `;\n }\n\n #renderAccents(points: Point[], accentIndices: Set<number>) {\n if (points.length === 0 || accentIndices.size === 0) return nothing;\n\n return html`\n ${Array.from(accentIndices).map(index => {\n const point = points[index];\n if (!point) return nothing;\n\n const style = `--x: ${point.x.toFixed(PRECISION)}; --y: ${point.y.toFixed(PRECISION)}`;\n return html`\n <span style=${style} class=\"accent\"></span>\n `;\n })}\n `;\n }\n\n #renderColumn(width: number, height: number) {\n const domain = calculateDomain(this.validData, {\n explicitMin: this.min,\n explicitMax: this.max,\n includeZero: true\n });\n if (!domain) return nothing;\n\n const baselineY = valueToY(0, domain);\n const showZeroLine = domain.min < 0 && domain.max > 0;\n const plotPoints = toPlotPoints(this.validData, domain, { width });\n const rects = toColumnRects(plotPoints, baselineY, width);\n\n return svg`\n <svg viewBox=\"0 0 ${width} ${height}\" preserveAspectRatio=\"xMidYMid meet\" aria-hidden=\"true\">\n ${showZeroLine ? this.#renderZeroLine(baselineY, width) : nothing}\n\n ${rects.map(rect => {\n return svg`<rect class=\"column\" x=\"${rect.x.toFixed(PRECISION)}\" y=\"${rect.y.toFixed(PRECISION)}\" width=\"${rect.width.toFixed(PRECISION)}\" height=\"${rect.height.toFixed(PRECISION)}\"></rect>`;\n })}\n </svg>\n `;\n }\n\n #renderWinLoss(baselineY: number, width: number, height: number) {\n if (this.validData.length === 0) return nothing;\n\n const rects = toWinLossRects(this.validData, baselineY, { width, height });\n\n return svg`\n <svg viewBox=\"0 0 ${width} ${height}\" preserveAspectRatio=\"xMidYMid meet\" aria-hidden=\"true\">\n ${this.#renderZeroLine(baselineY, width)}\n\n ${rects.map(rect => {\n return svg`<rect class=\"${rect.className}\" x=\"${rect.x.toFixed(PRECISION)}\" y=\"${rect.y.toFixed(PRECISION)}\" width=\"${rect.width.toFixed(PRECISION)}\" height=\"${rect.height.toFixed(PRECISION)}\"></rect>`;\n })}\n </svg>\n `;\n }\n}\n"],"mappings":";;;;;;;;;AAyDA,IAAaI,IAAb,cAA+BC,EAA4C;;EAiDlC,A,aAxCK,KAAA,OAAA,CAAC,GAGK,KAAA,OAAA,QAGS,KAAA,gBAAA,UAU7C,KAAA,cAAA,IAID,KAAA,aAAA,IAID,KAAA,YAAA,IAIA,KAAA,YAAA,IAG+D,KAAA,iBAAA,IASpC,KAAA,YAAA,CAAC;;;EAhDxB,KAAA,SAAAE,EAAU;GAACP;GAAQQ;GAAmBC;EAAkB,CAAC;;;EAE9C,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;CAgDA,SAAS;EACP,OAAO,CAAI,sBAAsB,KAAKC,GAAa,EAAE;CACvD;CAEA,oBAAoB;EAGlB,AAFA,MAAM,kB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WAAA,iBAAA,KAAA,CAAA,GAGzBH,EAAA,CAAAoD,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAAjD,EAAA,WAAA,UAAA,KAAA,CAAA,GAGxCH,EAAA,CAAAoD,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAAjD,EAAA,WAAA,QAAA,KAAA,CAAA,GAGxCH,EAAA,CAAAoD,EAAS;CAAE,MAAM;CAAS,WAAW;CAAgB,SAAS;AAAK,CAAC,CAAA,GAAAjD,EAAA,WAAA,eAAA,KAAA,CAAA,GAIpEH,EAAA,CAAAoD,EAAS;CAAE,MAAM;CAAS,WAAW;CAAe,SAAS;AAAK,CAAC,CAAA,GAAAjD,EAAA,WAAA,cAAA,KAAA,CAAA,GAInEH,EAAA,CAAAoD,EAAS;CAAE,MAAM;CAAS,WAAW;CAAc,SAAS;AAAK,CAAC,CAAA,GAAAjD,EAAA,WAAA,aAAA,KAAA,CAAA,GAIlEH,EAAA,CAAAoD,EAAS;CAAE,MAAM;CAAS,WAAW;CAAc,SAAS;AAAK,CAAC,CAAA,GAAAjD,EAAA,WAAA,aAAA,KAAA,CAAA,GAIlEH,EAAA,CAAAoD,EAAS;CAAE,MAAM;CAAQ,WAAW;AAAkB,CAAC,CAAA,GAAAjD,EAAA,WAAA,kBAAA,KAAA,CAAA,GAGvDH,EAAA,CAAAoD,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAAjD,EAAA,WAAA,OAAA,KAAA,CAAA,GAGzBH,EAAA,CAAAoD,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAAjD,EAAA,WAAA,OAAA,KAAA,CAAA,GAGzBH,EAAA,CAAAqD,EAAM,CAAA,GAAAlD,EAAA,WAAA,aAAA,KAAA,CAAA"}
1
+ {"version":3,"file":"sparkline2.js","names":["styles","_decorate","__decorate","sparkline_default","Sparkline","LitElement","_args","useStyles","statusStateStyles","supportStateStyles","#renderChart","attachInternals","changedProperties","toValidData","calculateViewBox","#renderLineVariant","width","height","#renderColumn","#renderWinLoss","nothing","props","aspectRatio","validAspectRatio","domain","calculateDomain","baselineY","valueToY","drawZeroLine","plotPoints","toPlotPoints","symbolIndices","calculateSymbolIndices","interpolation","toInterpolation","linePath","toLinePath","areaPath","toAreaPath","#renderGradientDef","#renderZeroLine","#renderAccents","position","points","accentIndices","point","index","style","showZeroLine","rects","toColumnRects","rect","toWinLossRects","property","state"],"sources":["../../src/sparkline/sparkline.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { PropertyValues, SVGTemplateResult } from 'lit';\nimport { html, LitElement, nothing, svg } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { state } from 'lit/decorators/state.js';\nimport type {\n DataElement,\n Interpolation,\n Point,\n SizeExpanded,\n SparklineMark,\n SupportStatus,\n TaskStatus\n} from '@nvidia-elements/core/internal';\nimport { statusStateStyles, supportStateStyles } from '@nvidia-elements/core/internal';\nimport { attachInternals } from '@nvidia-elements/foundations/internal/a11y';\nimport { useStyles } from '@nvidia-elements/foundations/internal/styles';\nimport {\n calculateDomain,\n calculateSymbolIndices,\n calculateViewBox,\n PRECISION,\n toAreaPath,\n toColumnRects,\n toInterpolation,\n toLinePath,\n toPlotPoints,\n toValidData,\n toWinLossRects,\n valueToY,\n VIEW_HEIGHT\n} from './sparkline.utils.js';\nimport styles from './sparkline.css?inline';\n\n/**\n * @element nve-sparkline\n * @description A sparkline is a compact, word-sized chart with typographic scale, for data-dense layouts (text, tables, cards, dashboards).\n * @documentation https://nvidia.github.io/elements/docs/elements/sparkline/\n * @since 0.0.0\n * @entrypoint \\@nvidia-elements/core/sparkline\n * @cssprop --height - Height (defaults to 1em and scales with parent font-size).\n * @cssprop --line-color\n * @cssprop --line-width\n * @cssprop --fill-color - Color used by area and column marks.\n * @cssprop --gradient-max-color\n * @cssprop --gradient-min-color\n * @cssprop --zero-line-color\n * @cssprop --zero-line-width\n * @cssprop --win-color Color used to represent positive values (wins).\n * @cssprop --loss-color Color used to represent negative values (losses).\n * @cssprop --draw-color Color used to represent zero values (draws / neutral outcomes).\n * @cssprop --symbol-color\n * @cssprop --symbol-border-color\n * @cssprop --symbol-border-width\n * @cssprop --symbol-radius - symbol circle radius in SVG units.\n * @aria https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img\n */\nexport class Sparkline extends LitElement implements DataElement<number[]> {\n static styles = useStyles([styles, statusStateStyles, supportStateStyles]);\n\n static readonly metadata = {\n tag: 'nve-sparkline',\n version: '0.0.0'\n };\n\n /** Numeric values representing a data series. */\n @property({ type: Array }) data: number[] = [];\n\n /** Controls the visual representation of data points. */\n @property({ type: String }) mark: SparklineMark = 'line';\n\n /** Controls how the chart connects intermediate values between points in a data series. Defaults to `linear`. */\n @property({ type: String }) interpolation: Interpolation = 'linear';\n\n /** Applies semantic status colors used across Elements status patterns. */\n @property({ type: String, reflect: true }) status?: TaskStatus | SupportStatus;\n\n /** Controls the sparkline size with explicit font-size tokens. Omit to auto-scale with parent font-size (1em). */\n @property({ type: String, reflect: true }) size?: SizeExpanded;\n\n /** Denotes the first data point by rendering a symbol at its position. */\n @property({ type: Boolean, attribute: 'denote-first', reflect: true })\n denoteFirst = false;\n\n /** Denotes the last data point by rendering a symbol at its position. */\n @property({ type: Boolean, attribute: 'denote-last', reflect: true })\n denoteLast = false;\n\n /** Denotes all minimum-value data points by rendering symbols at their positions. */\n @property({ type: Boolean, attribute: 'denote-min', reflect: true })\n denoteMin = false;\n\n /** Denotes all maximum-value data points by rendering symbols at their positions. */\n @property({ type: Boolean, attribute: 'denote-max', reflect: true })\n denoteMax = false;\n\n /** Controls spacing between points in a line, in em (1 = chart height). Defaults to `0.6`. */\n @property({ type: Number, attribute: 'interval-length' }) intervalLength = 0.6;\n\n /** Lower bound for the y-axis domain. When undefined, derives the bound from data. */\n @property({ type: Number }) min?: number;\n\n /** Upper bound for the y-axis domain. When undefined, derives the bound from data. */\n @property({ type: Number }) max?: number;\n\n /** Cached valid numeric values derived from data property. */\n @state() private validData: number[] = [];\n\n /** @private */\n declare _internals: ElementInternals;\n\n render() {\n return html`<div internal-host>${this.#renderChart()}</div>`;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'img';\n }\n\n willUpdate(changedProperties: PropertyValues<this>) {\n super.willUpdate(changedProperties);\n\n if (changedProperties.has('data')) {\n this.validData = toValidData(this.data);\n }\n }\n\n #renderChart(): SVGTemplateResult | typeof nothing {\n const { width, height } = calculateViewBox(this.mark, this.validData.length, this.intervalLength);\n\n switch (this.mark) {\n case 'line':\n case 'area':\n case 'gradient':\n return this.#renderLineVariant(width, height);\n case 'column':\n return this.#renderColumn(width, height);\n case 'winloss':\n return this.#renderWinLoss(VIEW_HEIGHT / 2, width, height);\n default:\n const _exhaustiveCheck: never = this.mark;\n return nothing;\n }\n }\n\n updated(props: PropertyValues<this>) {\n super.updated(props);\n\n const { width, height } = calculateViewBox(this.mark, this.validData.length, this.intervalLength);\n const aspectRatio = width / height;\n const validAspectRatio = Number.isFinite(aspectRatio) && aspectRatio > 0 ? aspectRatio : 1;\n this.style.setProperty('--_aspect-ratio', validAspectRatio.toFixed(4));\n }\n\n #renderLineVariant(width: number, height: number) {\n const domain = calculateDomain(this.validData, { explicitMin: this.min, explicitMax: this.max });\n if (!domain) return nothing;\n\n const baselineY = valueToY(0, domain);\n const drawZeroLine = domain.min < 0 && domain.max > 0;\n\n const plotPoints = toPlotPoints(this.validData, domain, { width });\n const symbolIndices = calculateSymbolIndices(this.validData, {\n first: this.denoteFirst,\n last: this.denoteLast,\n min: this.denoteMin,\n max: this.denoteMax\n });\n const interpolation = toInterpolation(this.interpolation);\n\n const linePath = toLinePath(plotPoints, interpolation, width);\n const drawArea = this.mark === 'area' || this.mark === 'gradient';\n const areaPath = drawArea ? toAreaPath(plotPoints, interpolation, VIEW_HEIGHT) : '';\n\n return svg`\n <svg viewBox=\"0 0 ${width} ${height}\" preserveAspectRatio=\"xMidYMid meet\" aria-hidden=\"true\">\n ${this.mark === 'gradient' ? this.#renderGradientDef(height) : nothing}\n\n ${\n areaPath.length\n ? this.mark === 'gradient'\n ? svg`<path class=\"area\" d=${areaPath} style=\"fill: url(#gradient)\"></path>`\n : svg`<path class=\"area\" d=${areaPath}></path>`\n : nothing\n }\n\n ${drawZeroLine ? this.#renderZeroLine(baselineY, width) : nothing}\n\n ${linePath ? svg`<path class=\"line\" d=${linePath} vector-effect=\"non-scaling-stroke\"></path>` : nothing}\n </svg>\n ${this.#renderAccents(plotPoints, symbolIndices)}\n `;\n }\n\n #renderGradientDef(height: number) {\n return svg`\n <defs>\n <linearGradient id=\"gradient\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"${height}\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0%\" style=\"stop-color: var(--gradient-max-color)\"></stop>\n <stop offset=\"100%\" style=\"stop-color: var(--gradient-min-color)\"></stop>\n </linearGradient>\n </defs>\n `;\n }\n\n #renderZeroLine(position: number, width: number) {\n return svg`\n <line\n class=\"zero-line\"\n vector-effect=\"non-scaling-stroke\"\n x1=\"0\"\n y1=\"${position.toFixed(PRECISION)}\"\n x2=\"${width}\"\n y2=\"${position.toFixed(PRECISION)}\">\n </line>\n `;\n }\n\n #renderAccents(points: Point[], accentIndices: Set<number>) {\n if (points.length === 0 || accentIndices.size === 0) return nothing;\n\n return html`\n ${Array.from(accentIndices).map(index => {\n const point = points[index];\n if (!point) return nothing;\n\n const style = `--x: ${point.x.toFixed(PRECISION)}; --y: ${point.y.toFixed(PRECISION)}`;\n return html`\n <span style=${style} class=\"accent\"></span>\n `;\n })}\n `;\n }\n\n #renderColumn(width: number, height: number) {\n const domain = calculateDomain(this.validData, {\n explicitMin: this.min,\n explicitMax: this.max,\n includeZero: true\n });\n if (!domain) return nothing;\n\n const baselineY = valueToY(0, domain);\n const showZeroLine = domain.min < 0 && domain.max > 0;\n const plotPoints = toPlotPoints(this.validData, domain, { width });\n const rects = toColumnRects(plotPoints, baselineY, width);\n\n return svg`\n <svg viewBox=\"0 0 ${width} ${height}\" preserveAspectRatio=\"xMidYMid meet\" aria-hidden=\"true\">\n ${showZeroLine ? this.#renderZeroLine(baselineY, width) : nothing}\n\n ${rects.map(rect => {\n return svg`<rect class=\"column\" x=\"${rect.x.toFixed(PRECISION)}\" y=\"${rect.y.toFixed(PRECISION)}\" width=\"${rect.width.toFixed(PRECISION)}\" height=\"${rect.height.toFixed(PRECISION)}\"></rect>`;\n })}\n </svg>\n `;\n }\n\n #renderWinLoss(baselineY: number, width: number, height: number) {\n if (this.validData.length === 0) return nothing;\n\n const rects = toWinLossRects(this.validData, baselineY, { width, height });\n\n return svg`\n <svg viewBox=\"0 0 ${width} ${height}\" preserveAspectRatio=\"xMidYMid meet\" aria-hidden=\"true\">\n ${this.#renderZeroLine(baselineY, width)}\n\n ${rects.map(rect => {\n return svg`<rect class=\"${rect.className}\" x=\"${rect.x.toFixed(PRECISION)}\" y=\"${rect.y.toFixed(PRECISION)}\" width=\"${rect.width.toFixed(PRECISION)}\" height=\"${rect.height.toFixed(PRECISION)}\"></rect>`;\n })}\n </svg>\n `;\n }\n}\n"],"mappings":";;;;;;;;;;AA2DA,IAAaI,IAAb,cAA+BC,EAA4C;;EAiDlC,A,aAxCK,KAAA,OAAA,CAAC,GAGK,KAAA,OAAA,QAGS,KAAA,gBAAA,UAU7C,KAAA,cAAA,IAID,KAAA,aAAA,IAID,KAAA,YAAA,IAIA,KAAA,YAAA,IAG+D,KAAA,iBAAA,IASpC,KAAA,YAAA,CAAC;;;EAhDxB,KAAA,SAAAE,EAAU;GAACP;GAAQQ;GAAmBC;EAAkB,CAAC;;;EAE9C,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;CAgDA,SAAS;EACP,OAAO,CAAI,sBAAsB,KAAKC,GAAa,EAAE;CACvD;CAEA,oBAAoB;EAGlB,AAFA,MA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les as n } from "../internal/styles/index.js";
4
- import r from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
5
- import { Icon as i } from "../icon/icon2.js";
6
- import { Control as a } from "../forms/control/control2.js";
7
- import o from "./star-rating.js";
8
- import { html as s } from "lit";
2
+ import t from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
3
+ import { Icon as n } from "../icon/icon2.js";
4
+ import { Control as r } from "../forms/control/control2.js";
5
+ import i from "./star-rating.js";
6
+ import { html as a } from "lit";
7
+ import { scopedRegistry as o } from "@nvidia-elements/foundations/internal/decorators";
8
+ import { useStyles as s } from "@nvidia-elements/foundations/internal/styles";
9
9
  import { state as c } from "lit/decorators/state.js";
10
10
  // src/star-rating/star-rating.ts
11
- var l = class extends a {
11
+ var l = class extends r {
12
12
  constructor(...e) {
13
13
  super(...e), this.min = 0, this.max = 5, this.value = 0, this.active = 0, this.precision = .5;
14
14
  }
15
15
  static {
16
- this.styles = n([...a.styles, o]);
16
+ this.styles = s([...r.styles, i]);
17
17
  }
18
18
  static {
19
19
  this.metadata = {
20
20
  tag: "nve-star-rating",
21
- version: "2.23.4"
21
+ version: "2.23.5"
22
22
  };
23
23
  }
24
24
  static {
25
- this.elementDefinitions = { [i.metadata.tag]: i };
25
+ this.elementDefinitions = { [n.metadata.tag]: n };
26
26
  }
27
27
  firstUpdated(t) {
28
28
  super.firstUpdated(t), e(this.input, "max", (e) => {
@@ -34,9 +34,9 @@ var l = class extends a {
34
34
  }), this.input.addEventListener("input", () => this.value = this.input.valueAsNumber), this.value = this.input.valueAsNumber;
35
35
  }
36
36
  get prefixContent() {
37
- return s`<div aria-hidden="true" class="stars" @mouseleave="${() => this.active = 0}">${Array(this.max).fill("").map((e, t) => {
37
+ return a`<div aria-hidden="true" class="stars" @mouseleave="${() => this.active = 0}">${Array(this.max).fill("").map((e, t) => {
38
38
  let n = t + 1, r = (this.active || this.value) - t;
39
- return s`<nve-icon part="icon" @click="${() => this.#n(this.#t(t, n))}" @mousemove="${(e) => this.#e(e, t, n)}" name="${r >= 1 ? "star" : r >= .5 ? "star-half" : "star-stroke"}"></nve-icon>`;
39
+ return a`<nve-icon part="icon" @click="${() => this.#n(this.#t(t, n))}" @mousemove="${(e) => this.#e(e, t, n)}" name="${r >= 1 ? "star" : r >= .5 ? "star-half" : "star-stroke"}"></nve-icon>`;
40
40
  })}</div>`;
41
41
  }
42
42
  #e(e, t, n) {
@@ -50,7 +50,7 @@ var l = class extends a {
50
50
  this.input.valueAsNumber = e === this.value ? 0 : e, this.input.dispatchEvent(new Event("input", { bubbles: !0 })), this.input.dispatchEvent(new Event("change", { bubbles: !0 }));
51
51
  }
52
52
  };
53
- r([c()], l.prototype, "min", void 0), r([c()], l.prototype, "max", void 0), r([c()], l.prototype, "value", void 0), r([c()], l.prototype, "active", void 0), r([c()], l.prototype, "precision", void 0), l = r([t()], l);
53
+ t([c()], l.prototype, "min", void 0), t([c()], l.prototype, "max", void 0), t([c()], l.prototype, "value", void 0), t([c()], l.prototype, "active", void 0), t([c()], l.prototype, "precision", void 0), l = t([o()], l);
54
54
  export { l as StarRating };
55
55
 
56
56
  //# sourceMappingURL=star-rating2.js.map