@nvidia-elements/core 2.19.0 → 2.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/_virtual/_rolldown/runtime.js +17 -0
  3. package/dist/accordion/accordion2.js +60 -57
  4. package/dist/accordion/accordion2.js.map +1 -1
  5. package/dist/alert/alert-group2.js +1 -1
  6. package/dist/alert/alert2.js +37 -31
  7. package/dist/alert/alert2.js.map +1 -1
  8. package/dist/avatar/avatar-group2.js +1 -1
  9. package/dist/avatar/avatar2.js +1 -1
  10. package/dist/badge/badge.d.ts +0 -6
  11. package/dist/badge/badge2.js +31 -36
  12. package/dist/badge/badge2.js.map +1 -1
  13. package/dist/breadcrumb/breadcrumb2.js +1 -1
  14. package/dist/bundle.d.ts +2 -0
  15. package/dist/bundles/index.d.ts +153 -27
  16. package/dist/bundles/index.js +9 -9
  17. package/dist/button/button2.js +1 -1
  18. package/dist/button-group/button-group2.js +1 -1
  19. package/dist/card/card2.js +4 -4
  20. package/dist/chat-message/chat-message2.js +1 -1
  21. package/dist/checkbox/checkbox-group2.js +1 -1
  22. package/dist/checkbox/checkbox2.js +1 -1
  23. package/dist/color/color.d.ts +2 -0
  24. package/dist/color/color2.js +7 -4
  25. package/dist/color/color2.js.map +1 -1
  26. package/dist/combobox/combobox.d.ts +2 -0
  27. package/dist/combobox/combobox2.js +14 -6
  28. package/dist/combobox/combobox2.js.map +1 -1
  29. package/dist/copy-button/copy-button2.js +26 -23
  30. package/dist/copy-button/copy-button2.js.map +1 -1
  31. package/dist/custom-elements-jsx.d.ts +166 -4
  32. package/dist/custom-elements-vue.d.ts +160 -4
  33. package/dist/custom-elements.json +1239 -220
  34. package/dist/data.html.json +117 -10
  35. package/dist/date/date.d.ts +2 -0
  36. package/dist/date/date2.js +7 -4
  37. package/dist/date/date2.js.map +1 -1
  38. package/dist/datetime/datetime.d.ts +2 -0
  39. package/dist/datetime/datetime2.js +7 -4
  40. package/dist/datetime/datetime2.js.map +1 -1
  41. package/dist/dialog/dialog-footer2.js +1 -1
  42. package/dist/dialog/dialog-header2.js +1 -1
  43. package/dist/dialog/dialog2.js +27 -27
  44. package/dist/dialog/dialog2.js.map +1 -1
  45. package/dist/divider/divider2.js +1 -1
  46. package/dist/dot/dot2.js +1 -1
  47. package/dist/drag-handle/drag-handle2.js +1 -1
  48. package/dist/drawer/drawer-content2.js +1 -1
  49. package/dist/drawer/drawer-footer2.js +1 -1
  50. package/dist/drawer/drawer-header2.js +1 -1
  51. package/dist/drawer/drawer2.js +27 -27
  52. package/dist/drawer/drawer2.js.map +1 -1
  53. package/dist/dropdown/dropdown-footer2.js +1 -1
  54. package/dist/dropdown/dropdown-header2.js +1 -1
  55. package/dist/dropdown/dropdown2.js +23 -23
  56. package/dist/dropdown/dropdown2.js.map +1 -1
  57. package/dist/dropdown-group/dropdown-group.js +1 -1
  58. package/dist/dropzone/dropzone2.js +28 -22
  59. package/dist/dropzone/dropzone2.js.map +1 -1
  60. package/dist/file/file2.js +1 -1
  61. package/dist/format-bytes/format-bytes2.js +1 -1
  62. package/dist/format-datetime/format-datetime2.js +1 -1
  63. package/dist/format-number/format-number2.js +1 -1
  64. package/dist/format-relative-time/format-relative-time2.js +1 -1
  65. package/dist/format-truncate/format-truncate2.js +1 -1
  66. package/dist/forms/control/control.d.ts +3 -0
  67. package/dist/forms/control/control2.js +34 -31
  68. package/dist/forms/control/control2.js.map +1 -1
  69. package/dist/forms/control-group/control-group2.js +1 -1
  70. package/dist/forms/control-message/control-message2.js +1 -1
  71. package/dist/gauge/gauge2.js +26 -21
  72. package/dist/gauge/gauge2.js.map +1 -1
  73. package/dist/grid/cell/cell2.js +1 -1
  74. package/dist/grid/column/column2.js +1 -1
  75. package/dist/grid/footer/footer2.js +1 -1
  76. package/dist/grid/grid2.js +1 -1
  77. package/dist/grid/header/header2.js +1 -1
  78. package/dist/grid/placeholder/placeholder2.js +1 -1
  79. package/dist/grid/row/row2.js +1 -1
  80. package/dist/icon/icon2.js +2 -2
  81. package/dist/icon-button/icon-button2.js +1 -1
  82. package/dist/iframe/iframe2.js +1 -1
  83. package/dist/index.js +5 -6
  84. package/dist/input/input-group2.js +1 -1
  85. package/dist/input/input2.js +1 -1
  86. package/dist/internal/index.d.ts +1 -2
  87. package/dist/internal/index.js +150 -33
  88. package/dist/internal/index.js.map +1 -0
  89. package/dist/internal/types/index.d.ts +1 -1
  90. package/dist/internal/types/index.js.map +1 -1
  91. package/dist/joystick/define.d.ts +6 -0
  92. package/dist/joystick/define.js +7 -0
  93. package/dist/joystick/define.js.map +1 -0
  94. package/dist/joystick/index.d.ts +1 -0
  95. package/dist/joystick/index.js +2 -0
  96. package/dist/joystick/joystick.d.ts +126 -0
  97. package/dist/joystick/joystick.examples.js +6 -0
  98. package/dist/joystick/joystick.examples.js.map +1 -0
  99. package/dist/joystick/joystick.examples.json +107 -0
  100. package/dist/joystick/joystick.js +6 -0
  101. package/dist/joystick/joystick.js.map +1 -0
  102. package/dist/joystick/joystick2.js +347 -0
  103. package/dist/joystick/joystick2.js.map +1 -0
  104. package/dist/logo/logo2.js +1 -1
  105. package/dist/menu/menu-group2.js +1 -1
  106. package/dist/menu/menu-item2.js +1 -1
  107. package/dist/menu/menu2.js +1 -1
  108. package/dist/month/month.d.ts +2 -0
  109. package/dist/month/month2.js +7 -4
  110. package/dist/month/month2.js.map +1 -1
  111. package/dist/notification/notification-group2.js +1 -1
  112. package/dist/notification/notification2.js +38 -32
  113. package/dist/notification/notification2.js.map +1 -1
  114. package/dist/page/page-panel/page-panel-content2.js +1 -1
  115. package/dist/page/page-panel/page-panel-footer2.js +1 -1
  116. package/dist/page/page-panel/page-panel-header2.js +1 -1
  117. package/dist/page/page-panel/page-panel.d.ts +0 -7
  118. package/dist/page/page-panel/page-panel2.js +18 -20
  119. package/dist/page/page-panel/page-panel2.js.map +1 -1
  120. package/dist/page/page2.js +1 -1
  121. package/dist/page-header/page-header2.js +1 -1
  122. package/dist/page-loader/page-loader2.js +1 -1
  123. package/dist/pagination/pagination2.js +45 -38
  124. package/dist/pagination/pagination2.js.map +1 -1
  125. package/dist/panel/panel2.js +43 -38
  126. package/dist/panel/panel2.js.map +1 -1
  127. package/dist/password/password.d.ts +2 -0
  128. package/dist/password/password2.js +10 -4
  129. package/dist/password/password2.js.map +1 -1
  130. package/dist/preferences-input/preferences-input2.js +32 -27
  131. package/dist/preferences-input/preferences-input2.js.map +1 -1
  132. package/dist/progress-bar/progress-bar2.js +1 -1
  133. package/dist/progress-dot/progress-dot2.js +17 -17
  134. package/dist/progress-dot/progress-dot2.js.map +1 -1
  135. package/dist/progress-ring/progress-ring2.js +27 -22
  136. package/dist/progress-ring/progress-ring2.js.map +1 -1
  137. package/dist/progressive-filter-chip/progressive-filter-chip2.js +30 -30
  138. package/dist/progressive-filter-chip/progressive-filter-chip2.js.map +1 -1
  139. package/dist/pulse/pulse2.js +1 -1
  140. package/dist/radio/radio-group2.js +1 -1
  141. package/dist/radio/radio2.js +1 -1
  142. package/dist/range/range2.js +1 -1
  143. package/dist/resize-handle/resize-handle2.js +17 -17
  144. package/dist/resize-handle/resize-handle2.js.map +1 -1
  145. package/dist/search/search2.js +1 -1
  146. package/dist/select/select2.js +44 -41
  147. package/dist/select/select2.js.map +1 -1
  148. package/dist/skeleton/skeleton2.js +1 -1
  149. package/dist/sort-button/sort-button2.js +20 -20
  150. package/dist/sort-button/sort-button2.js.map +1 -1
  151. package/dist/sparkline/sparkline2.js +1 -1
  152. package/dist/star-rating/star-rating2.js +1 -1
  153. package/dist/steps/steps2.js +2 -2
  154. package/dist/switch/switch-group2.js +1 -1
  155. package/dist/switch/switch2.js +1 -1
  156. package/dist/tabs/tabs-group2.js +1 -1
  157. package/dist/tabs/tabs-item-group2.js +1 -1
  158. package/dist/tabs/tabs2.js +2 -2
  159. package/dist/tag/tag2.js +19 -19
  160. package/dist/tag/tag2.js.map +1 -1
  161. package/dist/textarea/textarea2.js +1 -1
  162. package/dist/time/time.d.ts +2 -0
  163. package/dist/time/time2.js +7 -4
  164. package/dist/time/time2.js.map +1 -1
  165. package/dist/toast/toast2.js +35 -29
  166. package/dist/toast/toast2.js.map +1 -1
  167. package/dist/toggletip/toggletip-footer2.js +1 -1
  168. package/dist/toggletip/toggletip-header2.js +1 -1
  169. package/dist/toggletip/toggletip2.js +25 -25
  170. package/dist/toggletip/toggletip2.js.map +1 -1
  171. package/dist/toolbar/toolbar2.js +1 -1
  172. package/dist/tooltip/tooltip2.js +1 -1
  173. package/dist/tree/tree-node2.js +45 -45
  174. package/dist/tree/tree-node2.js.map +1 -1
  175. package/dist/tree/tree2.js +1 -1
  176. package/dist/week/week.d.ts +2 -0
  177. package/dist/week/week2.js +7 -4
  178. package/dist/week/week2.js.map +1 -1
  179. package/package.json +14 -2
  180. package/dist/internal/controllers/i18n.controller.d.ts +0 -19
  181. package/dist/internal/controllers/i18n.controller.examples.js +0 -6
  182. package/dist/internal/controllers/i18n.controller.examples.js.map +0 -1
  183. package/dist/internal/controllers/i18n.controller.examples.json +0 -16
  184. package/dist/internal/controllers/i18n.controller.js +0 -38
  185. package/dist/internal/controllers/i18n.controller.js.map +0 -1
  186. package/dist/internal/services/i18n.service.d.ts +0 -64
  187. package/dist/internal/services/i18n.service.js +0 -73
  188. package/dist/internal/services/i18n.service.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"control2.js","names":[],"sources":["../../../src/forms/control/control.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { TemplateResult } from 'lit';\nimport { LitElement, html, nothing, isServer } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport {\n attachInternals,\n useStyles,\n associateLabel,\n associateAriaDescribedBy,\n associateDataList,\n appendRootNodeStyle,\n getAttributeListChanges,\n I18nController,\n hostAttr,\n typeSSR\n} from '@nvidia-elements/core/internal';\nimport type { ControlMessage } from '../control-message/control-message.js';\nimport {\n setupControlValidationStates,\n setupControlStates,\n setupControlStatusStates,\n inputQuery,\n type ControlStateCleanup\n} from '../utils/states.js';\nimport { setupControlLayoutStates } from '../utils/layout.js';\nimport globalStyles from './control.global.css?inline';\nimport styles from './control.css?inline';\n\ninterface ResettableControl {\n getAttribute: Element['getAttribute'];\n value: string;\n}\n\ntype ControlInput = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | ResettableControl;\n\n/**\n * @element nve-control\n * @description Wraps a form input with its associated label and validation messages, managing layout and accessibility associations.\n * @documentation https://nvidia.github.io/elements/docs/elements/control/\n * @since 0.3.0\n * @entrypoint \\@nvidia-elements/core/forms\n * @slot - Control input element\n * @slot label - Label element\n * @cssprop --cursor\n * @cssprop --accent-color\n * @cssprop --color\n * @cssprop --label-color\n * @cssprop --label-width\n * @cssprop --label-font-weight\n * @cssprop --label-font-size\n * @cssprop --control-width\n * @cssprop --control-height\n\n * @aria https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals\n * @package true\n */\n@typeSSR()\nexport class Control extends LitElement {\n /** Set current visual state for control. This overrides any validation states active. */\n @property({ type: String }) status: 'warning' | 'error' | 'success' | 'disabled';\n\n /** Set current control + label + control message layout. Layouts will collapse based on available container space. */\n @property({ type: String, reflect: true }) layout:\n | 'vertical'\n | 'vertical-inline'\n | 'horizontal'\n | 'horizontal-inline';\n\n /** Sets the input to match the width of the active text content of the control value. Only applicable to vertical input box type controls (input, select) */\n @property({ type: Boolean, reflect: true, attribute: 'fit-text' }) fitText = false;\n\n /** Sets the input to match native default content block */\n @property({ type: Boolean, reflect: true, attribute: 'fit-content' }) fitContent = false;\n\n #i18nController: I18nController<this> = new I18nController<this>(this);\n\n /** Enables internal string values to update for internationalization. */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n /** Set the visual prominence of the control */\n @property({ type: String, reflect: true }) prominence: 'muted';\n\n get #label() {\n return this.shadowRoot\n ?.querySelector<HTMLSlotElement>('slot[name=\"label\"]')\n ?.assignedElements({ flatten: true })?.[0] as HTMLLabelElement;\n }\n\n get #messages() {\n return (this.shadowRoot\n ?.querySelector<HTMLSlotElement>('slot[name=\"messages\"]')\n ?.assignedElements({ flatten: true }) ?? []) as ControlMessage[];\n }\n\n #input: HTMLInputElement;\n\n /** @private */\n get input(): HTMLInputElement {\n if (!isServer && !this.#input) {\n const slotted =\n this.querySelector('slot')\n ?.assignedElements()\n ?.find(i => i.matches(inputQuery)) ??\n Array.from(this.shadowRoot!.querySelector('slot')?.assignedElements({ flatten: true }) ?? []).find(i =>\n i.matches(inputQuery)\n );\n this.#input = (slotted ? slotted : this.querySelector(inputQuery)) as HTMLInputElement;\n }\n\n return this.#input;\n }\n\n /** @private */\n protected get prefixContent(): typeof nothing | TemplateResult {\n return nothing;\n }\n\n /** @private */\n protected get suffixContent(): typeof nothing | TemplateResult {\n return nothing;\n }\n\n @hostAttr({ attribute: 'nve-control' }) protected nveControl = '';\n\n /** @private */\n declare _internals: ElementInternals;\n\n #observers: (MutationObserver | ResizeObserver | ControlStateCleanup)[] = [];\n\n protected _associateDatalist = true;\n\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-control',\n version: '0.0.0'\n };\n\n render() {\n return this.nveControl !== 'inline'\n ? html`\n <div internal-host part=\"_internal-host\">\n <slot name=\"label\" part=\"_label\"></slot>\n <div input part=\"_input\">\n ${this.prefixContent}\n <slot></slot>\n ${this.suffixContent}\n </div>\n <slot name=\"messages\" part=\"_messages\"></slot>\n </div>\n `\n : html`\n <div internal-host part=\"_internal-host\">\n <div input part=\"_input\"><slot interaction-state></slot></div>\n <slot name=\"label\" part=\"_label\"></slot>\n <slot name=\"messages\" part=\"_messages\"></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n appendRootNodeStyle(this, globalStyles);\n this.shadowRoot!.addEventListener('slotchange', this.#onRootSlotchange);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.shadowRoot!.removeEventListener('slotchange', this.#onRootSlotchange);\n this.shadowRoot!.removeEventListener('slotchange', this.#onInputSlotchange);\n this.#observers.forEach(observer => observer.disconnect());\n this.#observers.length = 0;\n }\n\n #onRootSlotchange = () => {\n this.#updateStyleStates();\n\n if (this.input && this.#observers.length === 0) {\n this.#setupInput();\n }\n };\n\n /** Resets control value to initial attribute value and clears any active validation rules. */\n reset() {\n this.#resetInputValue(this.input);\n this.requestUpdate();\n this.dispatchEvent(new CustomEvent('reset', { bubbles: true, composed: true }));\n }\n\n #resetInputValue(input: ControlInput) {\n if (input instanceof HTMLSelectElement) {\n this.#resetSelectValue(input);\n return;\n }\n\n if (this.#isCheckedInput(input)) {\n input.checked = input.defaultChecked;\n input.indeterminate = false;\n return;\n }\n\n input.value =\n input instanceof HTMLInputElement || input instanceof HTMLTextAreaElement\n ? input.defaultValue\n : (input.getAttribute('value') ?? '');\n }\n\n #resetSelectValue(input: HTMLSelectElement) {\n const hasDefaultSelection = Array.from(input.options).some(option => option.defaultSelected);\n Array.from(input.options).forEach(option => (option.selected = option.defaultSelected));\n if (!input.multiple && !hasDefaultSelection) input.selectedIndex = 0;\n }\n\n #isCheckedInput(input: ControlInput): input is HTMLInputElement {\n return input instanceof HTMLInputElement && (input.type === 'checkbox' || input.type === 'radio');\n }\n\n #setupInput() {\n this.#observers.push(\n ...setupControlValidationStates(this, this.#messages),\n ...setupControlStates(this),\n ...setupControlStatusStates(this, this.#messages),\n setupControlLayoutStates(this),\n getAttributeListChanges(this, ['hidden', 'status'], () => this.#updateStyleStates())\n );\n\n this.#polyfillShowPicker();\n this.#updateAssociations();\n this.shadowRoot!.addEventListener('slotchange', this.#onInputSlotchange);\n }\n\n #onInputSlotchange = () => {\n this.#updateStyleStates();\n this.#updateAssociations();\n };\n\n #polyfillShowPicker() {\n if (!this.input.showPicker) {\n this.input.showPicker = () => this.input.focus();\n }\n }\n\n #updateStyleStates() {\n if (this.input) {\n this.toggleAttribute('multiple', this.input?.multiple);\n this.input?.hasAttribute('size') ? this.setAttribute('size', '') : this.removeAttribute('size');\n }\n }\n\n #updateAssociations() {\n this.#assignLabel();\n associateLabel(this.#label, this.input);\n associateAriaDescribedBy(Array.from(this.#messages), this.input);\n\n if (this._associateDatalist) {\n associateDataList(this.querySelector<HTMLDataListElement>('datalist')!, this.input);\n }\n }\n\n #assignLabel() {\n const label =\n this.querySelector('label') ||\n (this.shadowRoot!.querySelector('slot')!\n .assignedNodes({ flatten: true })\n .find((i: Node) => (i as HTMLElement).tagName === 'LABEL') as HTMLLabelElement);\n if (label) {\n label.slot = 'label';\n }\n }\n\n protected showPicker() {\n try {\n this.input.showPicker();\n } catch {\n //\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AA2DO,IAAM,IAAN,cAAsB,EAAW;;EA+KX,aAnKkD,KAAA,UAAA,IAGM,KAAA,aAAA,IAE3C,KAAA,KAAA,IAAI,EAAqB,IAAI,GAGlC,KAAA,OAAA,KAAK,GAAgB,MA6CO,KAAA,aAAA,IAKW,KAAA,KAAA,CAAC,GAE5C,KAAA,qBAAA,IA8CL,KAAA,WAAA;GAGxB,AAFA,KAAK,GAAmB,GAEpB,KAAK,SAAS,KAAK,GAAW,WAAW,KAC3C,KAAK,GAAY;EAErB,GAmD2B,KAAA,WAAA;GAEzB,AADA,KAAK,GAAmB,GACxB,KAAK,GAAoB;EAC3B;;CAjKA;CAQA,IAAI,KAAS;EACX,OAAO,KAAK,YACR,cAA+B,sBAAoB,CAAC,EACpD,iBAAiB,EAAE,SAAS,GAAK,CAAC,CAAC,GAAG;CAC5C;CAEA,IAAI,KAAY;EACd,OAAQ,KAAK,YACT,cAA+B,yBAAuB,CAAC,EACvD,iBAAiB,EAAE,SAAS,GAAK,CAAC,KAAK,CAAC;CAC9C;CAEA;CAGA,IAAI,QAA0B;EAC5B,IAAI,CAAC,KAAY,CAAC,KAAK,IAAQ;GAC7B,IAAM,IACJ,KAAK,cAAc,MAAM,CAAC,EACtB,iBAAi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F;CAEA,KAAe;EACb,IAAM,IACJ,KAAK,cAAc,OAAO,KACzB,KAAK,WAAY,cAAc,MAAM,CAAC,CACpC,cAAc,EAAE,SAAS,GAAK,CAAC,CAAC,CAChC,MAAM,MAAa,EAAkB,YAAY,OAAO;EAC7D,AAAI,MACF,EAAM,OAAO;CAEjB;CAEA,aAAuB;EACrB,IAAI;GACF,KAAK,MAAM,WAAW;EACxB,QAAQ,CAER;CACF;AACF;AA3NG,EAAA,CAAA,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,EAAA,WAAA,UAAA,KAAA,CAAA,GAGzB,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,UAAA,KAAA,CAAA,GAOxC,EAAA,CAAA,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,WAAW;AAAW,CAAC,CAAA,GAAA,EAAA,WAAA,WAAA,KAAA,CAAA,GAGhE,EAAA,CAAA,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,WAAW;AAAc,CAAC,CAAA,GAAA,EAAA,WAAA,cAAA,KAAA,CAAA,GAKnE,EAAA,CAAA,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA,GAGzB,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,cAAA,KAAA,CAAA,GA0CxC,EAAA,CAAA,EAAS,EAAE,WAAW,cAAc,CAAC,CAAA,GAAA,EAAA,WAAA,cAAA,KAAA,CAAA,GAlEvC,IAAA,EAAA,CAAA,EAAQ,CAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"control2.js","names":[],"sources":["../../../src/forms/control/control.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { TemplateResult } from 'lit';\nimport { LitElement, html, nothing, isServer } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport {\n attachInternals,\n useStyles,\n associateLabel,\n associateAriaDescribedBy,\n associateDataList,\n appendRootNodeStyle,\n getAttributeListChanges,\n hostAttr,\n typeSSR\n} from '@nvidia-elements/core/internal';\nimport { I18nController, type I18nDefaults } from '@nvidia-elements/foundations/internal/i18n';\nimport type { ControlMessage } from '../control-message/control-message.js';\nimport {\n setupControlValidationStates,\n setupControlStates,\n setupControlStatusStates,\n inputQuery,\n type ControlStateCleanup\n} from '../utils/states.js';\nimport { setupControlLayoutStates } from '../utils/layout.js';\nimport globalStyles from './control.global.css?inline';\nimport styles from './control.css?inline';\n\ninterface ResettableControl {\n getAttribute: Element['getAttribute'];\n value: string;\n}\n\ntype ControlInput = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | ResettableControl;\n\n/**\n * @element nve-control\n * @description Wraps a form input with its associated label and validation messages, managing layout and accessibility associations.\n * @documentation https://nvidia.github.io/elements/docs/elements/control/\n * @since 0.3.0\n * @entrypoint \\@nvidia-elements/core/forms\n * @slot - Control input element\n * @slot label - Label element\n * @cssprop --cursor\n * @cssprop --accent-color\n * @cssprop --color\n * @cssprop --label-color\n * @cssprop --label-width\n * @cssprop --label-font-weight\n * @cssprop --label-font-size\n * @cssprop --control-width\n * @cssprop --control-height\n\n * @aria https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals\n * @package true\n */\n@typeSSR()\nexport class Control extends LitElement {\n /** Set current visual state for control. This overrides any validation states active. */\n @property({ type: String }) status: 'warning' | 'error' | 'success' | 'disabled';\n\n /** Set current control + label + control message layout. Layouts will collapse based on available container space. */\n @property({ type: String, reflect: true }) layout:\n | 'vertical'\n | 'vertical-inline'\n | 'horizontal'\n | 'horizontal-inline';\n\n /** Sets the input to match the width of the active text content of the control value. Only applicable to vertical input box type controls (input, select) */\n @property({ type: Boolean, reflect: true, attribute: 'fit-text' }) fitText = false;\n\n /** Sets the input to match native default content block */\n @property({ type: Boolean, reflect: true, attribute: 'fit-content' }) fitContent = false;\n\n /** Component-specific defaults supplied by a derived control. */\n protected get i18nDefaults(): I18nDefaults {\n return {};\n }\n\n #i18nController: I18nController<this> = new I18nController<this>(this, this.i18nDefaults);\n\n /** Enables internal string values to update for internationalization. */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n /** Set the visual prominence of the control */\n @property({ type: String, reflect: true }) prominence: 'muted';\n\n get #label() {\n return this.shadowRoot\n ?.querySelector<HTMLSlotElement>('slot[name=\"label\"]')\n ?.assignedElements({ flatten: true })?.[0] as HTMLLabelElement;\n }\n\n get #messages() {\n return (this.shadowRoot\n ?.querySelector<HTMLSlotElement>('slot[name=\"messages\"]')\n ?.assignedElements({ flatten: true }) ?? []) as ControlMessage[];\n }\n\n #input: HTMLInputElement;\n\n /** @private */\n get input(): HTMLInputElement {\n if (!isServer && !this.#input) {\n const slotted =\n this.querySelector('slot')\n ?.assignedElements()\n ?.find(i => i.matches(inputQuery)) ??\n Array.from(this.shadowRoot!.querySelector('slot')?.assignedElements({ flatten: true }) ?? []).find(i =>\n i.matches(inputQuery)\n );\n this.#input = (slotted ? slotted : this.querySelector(inputQuery)) as HTMLInputElement;\n }\n\n return this.#input;\n }\n\n /** @private */\n protected get prefixContent(): typeof nothing | TemplateResult {\n return nothing;\n }\n\n /** @private */\n protected get suffixContent(): typeof nothing | TemplateResult {\n return nothing;\n }\n\n @hostAttr({ attribute: 'nve-control' }) protected nveControl = '';\n\n /** @private */\n declare _internals: ElementInternals;\n\n #observers: (MutationObserver | ResizeObserver | ControlStateCleanup)[] = [];\n\n protected _associateDatalist = true;\n\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-control',\n version: '0.0.0'\n };\n\n render() {\n return this.nveControl !== 'inline'\n ? html`\n <div internal-host part=\"_internal-host\">\n <slot name=\"label\" part=\"_label\"></slot>\n <div input part=\"_input\">\n ${this.prefixContent}\n <slot></slot>\n ${this.suffixContent}\n </div>\n <slot name=\"messages\" part=\"_messages\"></slot>\n </div>\n `\n : html`\n <div internal-host part=\"_internal-host\">\n <div input part=\"_input\"><slot interaction-state></slot></div>\n <slot name=\"label\" part=\"_label\"></slot>\n <slot name=\"messages\" part=\"_messages\"></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n appendRootNodeStyle(this, globalStyles);\n this.shadowRoot!.addEventListener('slotchange', this.#onRootSlotchange);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.shadowRoot!.removeEventListener('slotchange', this.#onRootSlotchange);\n this.shadowRoot!.removeEventListener('slotchange', this.#onInputSlotchange);\n this.#observers.forEach(observer => observer.disconnect());\n this.#observers.length = 0;\n }\n\n #onRootSlotchange = () => {\n this.#updateStyleStates();\n\n if (this.input && this.#observers.length === 0) {\n this.#setupInput();\n }\n };\n\n /** Resets control value to initial attribute value and clears any active validation rules. */\n reset() {\n this.#resetInputValue(this.input);\n this.requestUpdate();\n this.dispatchEvent(new CustomEvent('reset', { bubbles: true, composed: true }));\n }\n\n #resetInputValue(input: ControlInput) {\n if (input instanceof HTMLSelectElement) {\n this.#resetSelectValue(input);\n return;\n }\n\n if (this.#isCheckedInput(input)) {\n input.checked = input.defaultChecked;\n input.indeterminate = false;\n return;\n }\n\n input.value =\n input instanceof HTMLInputElement || input instanceof HTMLTextAreaElement\n ? input.defaultValue\n : (input.getAttribute('value') ?? '');\n }\n\n #resetSelectValue(input: HTMLSelectElement) {\n const hasDefaultSelection = Array.from(input.options).some(option => option.defaultSelected);\n Array.from(input.options).forEach(option => (option.selected = option.defaultSelected));\n if (!input.multiple && !hasDefaultSelection) input.selectedIndex = 0;\n }\n\n #isCheckedInput(input: ControlInput): input is HTMLInputElement {\n return input instanceof HTMLInputElement && (input.type === 'checkbox' || input.type === 'radio');\n }\n\n #setupInput() {\n this.#observers.push(\n ...setupControlValidationStates(this, this.#messages),\n ...setupControlStates(this),\n ...setupControlStatusStates(this, this.#messages),\n setupControlLayoutStates(this),\n getAttributeListChanges(this, ['hidden', 'status'], () => this.#updateStyleStates())\n );\n\n this.#polyfillShowPicker();\n this.#updateAssociations();\n this.shadowRoot!.addEventListener('slotchange', this.#onInputSlotchange);\n }\n\n #onInputSlotchange = () => {\n this.#updateStyleStates();\n this.#updateAssociations();\n };\n\n #polyfillShowPicker() {\n if (!this.input.showPicker) {\n this.input.showPicker = () => this.input.focus();\n }\n }\n\n #updateStyleStates() {\n if (this.input) {\n this.toggleAttribute('multiple', this.input?.multiple);\n this.input?.hasAttribute('size') ? this.setAttribute('size', '') : this.removeAttribute('size');\n }\n }\n\n #updateAssociations() {\n this.#assignLabel();\n associateLabel(this.#label, this.input);\n associateAriaDescribedBy(Array.from(this.#messages), this.input);\n\n if (this._associateDatalist) {\n associateDataList(this.querySelector<HTMLDataListElement>('datalist')!, this.input);\n }\n }\n\n #assignLabel() {\n const label =\n this.querySelector('label') ||\n (this.shadowRoot!.querySelector('slot')!\n .assignedNodes({ flatten: true })\n .find((i: Node) => (i as HTMLElement).tagName === 'LABEL') as HTMLLabelElement);\n if (label) {\n label.slot = 'label';\n }\n }\n\n protected showPicker() {\n try {\n this.input.showPicker();\n } catch {\n //\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AA2DO,IAAM,IAAN,cAAsB,EAAW;;EAoLX,aAxKkD,KAAA,UAAA,IAGM,KAAA,aAAA,IAO3C,KAAA,KAAA,IAAI,EAAqB,MAAM,KAAK,YAAY,GAGrD,KAAA,OAAA,KAAK,GAAgB,MA6CO,KAAA,aAAA,IAKW,KAAA,KAAA,CAAC,GAE5C,KAAA,qBAAA,IA8CL,KAAA,WAAA;GAGxB,AAFA,KAAK,GAAmB,GAEpB,KAAK,SAAS,KAAK,GAAW,WAAW,KAC3C,KAAK,GAAY;EAErB,GAmD2B,KAAA,WAAA;GAEzB,AADA,KAAK,GAAmB,GACxB,KAAK,GAAoB;EAC3B;;CArKA,IAAc,eAA6B;EACzC,OAAO,CAAC;CACV;CAEA;C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A,EAAA,WAAA,cAAA,KAAA,CAAA,GA0CxC,EAAA,CAAA,EAAS,EAAE,WAAW,cAAc,CAAC,CAAA,GAAA,EAAA,WAAA,cAAA,KAAA,CAAA,GAvEvC,IAAA,EAAA,CAAA,EAAQ,CAAA,GAAA,CAAA"}
@@ -24,7 +24,7 @@ var m = class extends d {
24
24
  static {
25
25
  this.metadata = {
26
26
  tag: "nve-control-group",
27
- version: "2.19.0"
27
+ version: "2.20.0"
28
28
  };
29
29
  }
30
30
  render() {
@@ -23,7 +23,7 @@ var l = {
23
23
  static {
24
24
  this.metadata = {
25
25
  tag: "nve-control-message",
26
- version: "2.19.0"
26
+ version: "2.20.0"
27
27
  };
28
28
  }
29
29
  static {
@@ -1,10 +1,10 @@
1
- import { I18nController as e } from "../internal/controllers/i18n.controller.js";
2
- import { attachInternals as t } from "../internal/utils/a11y.js";
3
- import { useStyles as n } from "../internal/styles/index.js";
4
- import r from "../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorate.js";
5
- import i from "./gauge.js";
6
- import { LitElement as a, html as o } from "lit";
7
- import { property as s } from "lit/decorators/property.js";
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.147.0/helpers/esm/decorate.js";
4
+ import r from "./gauge.js";
5
+ import { LitElement as i, html as a } from "lit";
6
+ import { property as o } from "lit/decorators/property.js";
7
+ import { I18nController as s } from "@nvidia-elements/foundations/internal/i18n";
8
8
  import { styleMap as c } from "lit/directives/style-map.js";
9
9
  //#region src/gauge/gauge.ts
10
10
  var l = {
@@ -30,17 +30,22 @@ var l = {
30
30
  [`--_${e}-angle`]: `${t}deg`,
31
31
  [`--_${e}-origin`]: `${n.center}px ${n.center}px`,
32
32
  [`--_${e}-start-angle`]: `${n.startAngle}deg`
33
- }), d = class extends a {
34
- constructor(...t) {
35
- super(...t), this.value = 0, this.max = 100, this.status = "neutral", this.thumb = "fill", this.#e = new e(this), this.i18n = this.#e.i18n, this.#t = 0, this.#r = 0;
33
+ }), d = {
34
+ danger: "danger",
35
+ information: "information",
36
+ success: "success",
37
+ warning: "warning"
38
+ }, f = class extends i {
39
+ constructor(...e) {
40
+ super(...e), this.value = 0, this.max = 100, this.status = "neutral", this.thumb = "fill", this.#e = new s(this, d), this.i18n = this.#e.i18n, this.#t = 0, this.#r = 0;
36
41
  }
37
42
  static {
38
- this.styles = n([i]);
43
+ this.styles = t([r]);
39
44
  }
40
45
  static {
41
46
  this.metadata = {
42
47
  tag: "nve-gauge",
43
- version: "2.19.0"
48
+ version: "2.20.0"
44
49
  };
45
50
  }
46
51
  #e;
@@ -55,11 +60,11 @@ var l = {
55
60
  };
56
61
  }
57
62
  render() {
58
- let e = this.#f(), t = this.#t, n = this.#p(), r = this.#l(e, t), i = this.#u(e, t), a = n === "fill", s = t > 0 && (n === "fill" || n === "dot");
59
- return o`<div internal-host><svg viewBox="${e.viewBox}" role="presentation" aria-hidden="true"><defs><mask id="background-mask" maskUnits="userSpaceOnUse" x="0" y="0" width="128" height="${e.surfaceHeight}"><path d="${e.path}" class="background"></path></mask><mask id="fill-mask" maskUnits="userSpaceOnUse" x="0" y="0" width="128" height="${e.surfaceHeight}"><path d="${i}" class="gauge" ?empty="${t <= 0}"></path></mask></defs><foreignObject width="128" height="${e.surfaceHeight}" mask="url(#background-mask)"><div xmlns="http://www.w3.org/1999/xhtml" class="background-surface"></div></foreignObject><foreignObject class="fill-layer" width="128" height="${e.surfaceHeight}" mask="url(#fill-mask)" ?hidden="${!a || t <= 0}"><div xmlns="http://www.w3.org/1999/xhtml" class="fill-surface"></div></foreignObject><circle class="fill-dot-end" cx="${e.center + e.radius}" cy="${e.center}" ?hidden="${!s}" style="${c(u("dot", r, e))}"></circle><g class="needle" ?hidden="${n !== "needle"}" style="${c(u("needle", r, e))}"><line class="needle-line" x1="${e.center}" y1="${e.center}" x2="${e.center + 40}" y2="${e.center}"></line><circle class="needle-hub" cx="${e.center}" cy="${e.center}"></circle></g></svg><slot></slot></div>`;
63
+ let e = this.#f(), t = this.#t, n = this.#p(), r = this.#l(e, t), i = this.#u(e, t), o = n === "fill", s = t > 0 && (n === "fill" || n === "dot");
64
+ return a`<div internal-host><svg viewBox="${e.viewBox}" role="presentation" aria-hidden="true"><defs><mask id="background-mask" maskUnits="userSpaceOnUse" x="0" y="0" width="128" height="${e.surfaceHeight}"><path d="${e.path}" class="background"></path></mask><mask id="fill-mask" maskUnits="userSpaceOnUse" x="0" y="0" width="128" height="${e.surfaceHeight}"><path d="${i}" class="gauge" ?empty="${t <= 0}"></path></mask></defs><foreignObject width="128" height="${e.surfaceHeight}" mask="url(#background-mask)"><div xmlns="http://www.w3.org/1999/xhtml" class="background-surface"></div></foreignObject><foreignObject class="fill-layer" width="128" height="${e.surfaceHeight}" mask="url(#fill-mask)" ?hidden="${!o || t <= 0}"><div xmlns="http://www.w3.org/1999/xhtml" class="fill-surface"></div></foreignObject><circle class="fill-dot-end" cx="${e.center + e.radius}" cy="${e.center}" ?hidden="${!s}" style="${c(u("dot", r, e))}"></circle><g class="needle" ?hidden="${n !== "needle"}" style="${c(u("needle", r, e))}"><line class="needle-line" x1="${e.center}" y1="${e.center}" x2="${e.center + 40}" y2="${e.center}"></line><circle class="needle-hub" cx="${e.center}" cy="${e.center}"></circle></g></svg><slot></slot></div>`;
60
65
  }
61
66
  connectedCallback() {
62
- super.connectedCallback(), t(this), this._internals.role = "progressbar";
67
+ super.connectedCallback(), e(this), this._internals.role = "progressbar";
63
68
  }
64
69
  disconnectedCallback() {
65
70
  super.disconnectedCallback(), this.#n && (this.#s(), this.#t = this.#a(), this.requestUpdate());
@@ -124,20 +129,20 @@ var l = {
124
129
  return this.thumb === "dot" || this.thumb === "needle" ? this.thumb : "fill";
125
130
  }
126
131
  };
127
- r([s({ type: Number })], d.prototype, "value", void 0), r([s({ type: Number })], d.prototype, "max", void 0), r([s({
132
+ n([o({ type: Number })], f.prototype, "value", void 0), n([o({ type: Number })], f.prototype, "max", void 0), n([o({
128
133
  type: String,
129
134
  reflect: !0
130
- })], d.prototype, "status", void 0), r([s({
135
+ })], f.prototype, "status", void 0), n([o({
131
136
  type: String,
132
137
  reflect: !0
133
- })], d.prototype, "shape", void 0), r([s({
138
+ })], f.prototype, "shape", void 0), n([o({
134
139
  type: String,
135
140
  reflect: !0
136
- })], d.prototype, "thumb", void 0), r([s({
141
+ })], f.prototype, "thumb", void 0), n([o({
137
142
  type: String,
138
143
  reflect: !0
139
- })], d.prototype, "size", void 0), r([s({ type: Object })], d.prototype, "i18n", void 0);
144
+ })], f.prototype, "size", void 0), n([o({ type: Object })], f.prototype, "i18n", void 0);
140
145
  //#endregion
141
- export { d as Gauge };
146
+ export { f as Gauge };
142
147
 
143
148
  //# sourceMappingURL=gauge2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gauge2.js","names":[],"sources":["../../src/gauge/gauge.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, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport type { Size, SupportStatus } from '@nvidia-elements/core/internal';\nimport { attachInternals, I18nController, useStyles } from '@nvidia-elements/core/internal';\nimport styles from './gauge.css?inline';\n\nconst GAUGE_GEOMETRY = {\n default: {\n center: 64,\n path: 'M 27.23 100.77 A 52 52 0 1 1 100.77 100.77',\n radius: 52,\n startAngle: 135,\n sweepAngle: 270,\n surfaceHeight: 128,\n viewBox: '8.53 8.53 110.93 95.7'\n },\n half: {\n center: 64,\n path: 'M 12 64 A 52 52 0 0 1 116 64',\n radius: 52,\n startAngle: 180,\n sweepAngle: 180,\n surfaceHeight: 64,\n viewBox: '8.53 8.53 110.93 58.93'\n }\n} as const;\n\ntype GaugeGeometry = (typeof GAUGE_GEOMETRY)[keyof typeof GAUGE_GEOMETRY];\n\nconst thumbStyle = (thumb: 'dot' | 'needle', progressAngle: number, geometry: GaugeGeometry) => ({\n [`--_${thumb}-angle`]: `${progressAngle}deg`,\n [`--_${thumb}-origin`]: `${geometry.center}px ${geometry.center}px`,\n [`--_${thumb}-start-angle`]: `${geometry.startAngle}deg`\n});\n\n/**\n * @element nve-gauge\n * @description Use a gauge to show system resource usage.\n * @documentation https://nvidia.github.io/elements/docs/elements/gauge/\n * @since 2.0.4\n * @entrypoint \\@nvidia-elements/core/gauge\n * @slot - Content to display in the gauge center.\n * @cssprop --track-width\n * @cssprop --accent-color\n * @cssprop --background\n * @cssprop --needle-background\n * @cssprop --track-background\n * @cssprop --thumb-background\n * @cssprop --color\n * @cssprop --width\n * @cssprop --height\n * @cssprop --font-size\n * @cssprop --gap\n * @aria https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/progressbar_role\n * @stable false\n */\nexport class Gauge extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-gauge',\n version: '0.0.0'\n };\n\n /** @private */\n declare _internals: ElementInternals;\n\n /** The current `value` of the gauge. */\n @property({ type: Number }) value = 0;\n\n /** The `max` value of the gauge that the `value` is proportionally scaled to. */\n @property({ type: Number }) max? = 100;\n\n /** Four visual treatments represent the `status` of tasks. */\n @property({ type: String, reflect: true }) status?: SupportStatus | 'neutral' = 'neutral';\n\n /** Determines the gauge shape. Set `half` for a compact semi-circular arc. */\n @property({ type: String, reflect: true }) shape?: 'half';\n\n /** Controls the value indicator. Set `dot` for only the end dot or `needle` for a pointer. */\n @property({ type: String, reflect: true }) thumb: 'fill' | 'dot' | 'needle' = 'fill';\n\n /** T-shirt `size` of the gauge. */\n @property({ type: String, reflect: true }) size?: Size;\n\n #i18nController: I18nController<this> = new I18nController<this>(this);\n\n /** Enables updating internal string values for internationalization. */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n /** Progress the gauge paints, which eases toward the value instead of jumping to it. */\n #paintedProgress = 0;\n\n #progressAnimation?: Animation;\n\n #progressFrame = 0;\n\n #normalizedValues() {\n const sourceMax = this.max;\n const max = sourceMax !== undefined && Number.isFinite(sourceMax) && sourceMax > 0 ? sourceMax : 100;\n const value = Number.isFinite(this.value) ? Math.min(Math.max(this.value, 0), max) : 0;\n return { value, max };\n }\n\n render() {\n const geometry = this.#geometry();\n const progress = this.#paintedProgress;\n const thumb = this.#normalizedThumb();\n const progressAngle = this.#angleAtProgress(geometry, progress);\n const fillPath = this.#pathAtProgress(geometry, progress);\n const showFill = thumb === 'fill';\n const showDot = progress > 0 && (thumb === 'fill' || thumb === 'dot');\n\n return html`\n <div internal-host>\n <svg viewBox=${geometry.viewBox} role=\"presentation\" aria-hidden=\"true\">\n <defs>\n <mask id=\"background-mask\" maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\" width=\"128\" height=${geometry.surfaceHeight}>\n <path d=${geometry.path} class=\"background\"></path>\n </mask>\n <mask id=\"fill-mask\" maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\" width=\"128\" height=${geometry.surfaceHeight}>\n <path d=${fillPath} class=\"gauge\" ?empty=${progress <= 0}></path>\n </mask>\n </defs>\n <foreignObject width=\"128\" height=${geometry.surfaceHeight} mask=\"url(#background-mask)\">\n <div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"background-surface\"></div>\n </foreignObject>\n <foreignObject class=\"fill-layer\" width=\"128\" height=${geometry.surfaceHeight} mask=\"url(#fill-mask)\"\n ?hidden=${!showFill || progress <= 0}>\n <div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"fill-surface\"></div>\n </foreignObject>\n <circle class=\"fill-dot-end\" cx=${geometry.center + geometry.radius} cy=${geometry.center}\n ?hidden=${!showDot}\n style=${styleMap(thumbStyle('dot', progressAngle, geometry))}>\n </circle>\n <g class=\"needle\"\n ?hidden=${thumb !== 'needle'}\n style=${styleMap(thumbStyle('needle', progressAngle, geometry))}>\n <line class=\"needle-line\" x1=${geometry.center} y1=${geometry.center} x2=${geometry.center + 40} y2=${geometry.center}></line>\n <circle class=\"needle-hub\" cx=${geometry.center} cy=${geometry.center}></circle>\n </g>\n </svg>\n <slot></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'progressbar';\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n // settle the value, otherwise reattaching paints the frame where the animation stopped\n if (this.#progressAnimation) {\n this.#stopProgressAnimation();\n this.#paintedProgress = this.#targetProgress();\n this.requestUpdate();\n }\n }\n\n willUpdate(props: PropertyValues<this>) {\n super.willUpdate(props);\n\n if (props.has('value') || props.has('max')) {\n this.#animateProgress();\n }\n }\n\n updated(props: PropertyValues<this>) {\n super.updated(props);\n const { value, max } = this.#normalizedValues();\n this._internals.ariaValueNow = `${value}`;\n this._internals.ariaValueMax = `${max}`;\n const { status } = this;\n const statusLabel =\n status !== undefined && status !== 'neutral' && status !== 'accent' ? this.i18n[status] : undefined;\n this._internals.ariaLabel = statusLabel ?? this.i18n.information ?? null;\n }\n\n #targetProgress() {\n const { value, max } = this.#normalizedValues();\n return (value / max) * 100;\n }\n\n /**\n * Eases the painted progress toward the value with the duration and easing declared in css, so\n * that `prefers-reduced-motion` and a `--_animation-duration` override both settle immediately.\n */\n #animateProgress() {\n const target = this.#targetProgress();\n const timing = this.hasUpdated ? this.#animationTiming() : undefined;\n\n this.#stopProgressAnimation();\n\n if (!timing || target === this.#paintedProgress) {\n this.#paintedProgress = target;\n return;\n }\n\n const from = this.#paintedProgress;\n // keyframeless animations only keep time, leaving every painted frame to `render`\n const animation = this.animate(null, timing);\n const paint = (progress: number) => {\n this.#paintedProgress = from + (target - from) * progress;\n this.requestUpdate();\n };\n const paintFrame = () => {\n paint(animation.effect?.getComputedTiming().progress ?? 0);\n\n if (animation.playState === 'running') {\n this.#progressFrame = requestAnimationFrame(paintFrame);\n }\n };\n\n animation.finished.then(\n () => {\n // a value that changes on the frame this settles already started the next animation\n if (this.#progressAnimation === animation) {\n this.#stopProgressAnimation();\n paint(1);\n }\n },\n () => undefined\n );\n\n this.#progressAnimation = animation;\n this.#progressFrame = requestAnimationFrame(paintFrame);\n }\n\n #stopProgressAnimation() {\n // only a browser render starts an animation, so server rendering never reaches these apis\n if (this.#progressAnimation) {\n cancelAnimationFrame(this.#progressFrame);\n this.#progressAnimation.cancel();\n this.#progressAnimation = undefined;\n }\n }\n\n #animationTiming() {\n const gaugeStyles = getComputedStyle(this);\n const duration = gaugeStyles.getPropertyValue('--_animation-duration').trim();\n const milliseconds = parseFloat(duration) * (duration.endsWith('ms') ? 1 : 1000);\n const easing = gaugeStyles.getPropertyValue('--nve-ref-animation-easing-100').trim();\n\n return milliseconds > 0 ? { duration: milliseconds, easing: easing || 'linear' } : undefined;\n }\n\n #angleAtProgress(geometry: GaugeGeometry, progress: number) {\n return geometry.startAngle + geometry.sweepAngle * (progress / 100);\n }\n\n #pathAtProgress(geometry: GaugeGeometry, progress: number) {\n const start = this.#pointAtAngle(geometry, geometry.startAngle);\n const sweepAngle = geometry.sweepAngle * (progress / 100);\n const end = this.#pointAtAngle(geometry, geometry.startAngle + sweepAngle);\n const largeArcFlag = sweepAngle > 180 ? 1 : 0;\n return `M ${start.x} ${start.y} A ${geometry.radius} ${geometry.radius} 0 ${largeArcFlag} 1 ${end.x} ${end.y}`;\n }\n\n #pointAtAngle(geometry: GaugeGeometry, angle: number) {\n const radians = (angle * Math.PI) / 180;\n return {\n x: geometry.center + geometry.radius * Math.cos(radians),\n y: geometry.center + geometry.radius * Math.sin(radians)\n };\n }\n\n #geometry() {\n return this.shape === 'half' ? GAUGE_GEOMETRY.half : GAUGE_GEOMETRY.default;\n }\n\n #normalizedThumb() {\n return this.thumb === 'dot' || this.thumb === 'needle' ? this.thumb : 'fill';\n }\n}\n"],"mappings":";;;;;;;;;AAWA,IAAM,IAAiB;CACrB,SAAS;EACP,QAAQ;EACR,MAAM;EACN,QAAQ;EACR,YAAY;EACZ,YAAY;EACZ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["// 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, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport type { Size, SupportStatus } from '@nvidia-elements/core/internal';\nimport { attachInternals, useStyles } from '@nvidia-elements/core/internal';\nimport { I18nController, type I18nDefaults } from '@nvidia-elements/foundations/internal/i18n';\nimport styles from './gauge.css?inline';\n\nconst GAUGE_GEOMETRY = {\n default: {\n center: 64,\n path: 'M 27.23 100.77 A 52 52 0 1 1 100.77 100.77',\n radius: 52,\n startAngle: 135,\n sweepAngle: 270,\n surfaceHeight: 128,\n viewBox: '8.53 8.53 110.93 95.7'\n },\n half: {\n center: 64,\n path: 'M 12 64 A 52 52 0 0 1 116 64',\n radius: 52,\n startAngle: 180,\n sweepAngle: 180,\n surfaceHeight: 64,\n viewBox: '8.53 8.53 110.93 58.93'\n }\n} as const;\n\ntype GaugeGeometry = (typeof GAUGE_GEOMETRY)[keyof typeof GAUGE_GEOMETRY];\n\nconst thumbStyle = (thumb: 'dot' | 'needle', progressAngle: number, geometry: GaugeGeometry) => ({\n [`--_${thumb}-angle`]: `${progressAngle}deg`,\n [`--_${thumb}-origin`]: `${geometry.center}px ${geometry.center}px`,\n [`--_${thumb}-start-angle`]: `${geometry.startAngle}deg`\n});\n\nconst i18nDefaults = {\n danger: 'danger',\n information: 'information',\n success: 'success',\n warning: 'warning'\n} satisfies I18nDefaults;\n\n/**\n * @element nve-gauge\n * @description Use a gauge to show system resource usage.\n * @documentation https://nvidia.github.io/elements/docs/elements/gauge/\n * @since 2.0.4\n * @entrypoint \\@nvidia-elements/core/gauge\n * @slot - Content to display in the gauge center.\n * @cssprop --track-width\n * @cssprop --accent-color\n * @cssprop --background\n * @cssprop --needle-background\n * @cssprop --track-background\n * @cssprop --thumb-background\n * @cssprop --color\n * @cssprop --width\n * @cssprop --height\n * @cssprop --font-size\n * @cssprop --gap\n * @aria https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/progressbar_role\n * @stable false\n */\nexport class Gauge extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-gauge',\n version: '0.0.0'\n };\n\n /** @private */\n declare _internals: ElementInternals;\n\n /** The current `value` of the gauge. */\n @property({ type: Number }) value = 0;\n\n /** The `max` value of the gauge that the `value` is proportionally scaled to. */\n @property({ type: Number }) max? = 100;\n\n /** Four visual treatments represent the `status` of tasks. */\n @property({ type: String, reflect: true }) status?: SupportStatus | 'neutral' = 'neutral';\n\n /** Determines the gauge shape. Set `half` for a compact semi-circular arc. */\n @property({ type: String, reflect: true }) shape?: 'half';\n\n /** Controls the value indicator. Set `dot` for only the end dot or `needle` for a pointer. */\n @property({ type: String, reflect: true }) thumb: 'fill' | 'dot' | 'needle' = 'fill';\n\n /** T-shirt `size` of the gauge. */\n @property({ type: String, reflect: true }) size?: Size;\n\n #i18nController: I18nController<this> = new I18nController<this>(this, i18nDefaults);\n\n /** Enables updating internal string values for internationalization. */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n /** Progress the gauge paints, which eases toward the value instead of jumping to it. */\n #paintedProgress = 0;\n\n #progressAnimation?: Animation;\n\n #progressFrame = 0;\n\n #normalizedValues() {\n const sourceMax = this.max;\n const max = sourceMax !== undefined && Number.isFinite(sourceMax) && sourceMax > 0 ? sourceMax : 100;\n const value = Number.isFinite(this.value) ? Math.min(Math.max(this.value, 0), max) : 0;\n return { value, max };\n }\n\n render() {\n const geometry = this.#geometry();\n const progress = this.#paintedProgress;\n const thumb = this.#normalizedThumb();\n const progressAngle = this.#angleAtProgress(geometry, progress);\n const fillPath = this.#pathAtProgress(geometry, progress);\n const showFill = thumb === 'fill';\n const showDot = progress > 0 && (thumb === 'fill' || thumb === 'dot');\n\n return html`\n <div internal-host>\n <svg viewBox=${geometry.viewBox} role=\"presentation\" aria-hidden=\"true\">\n <defs>\n <mask id=\"background-mask\" maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\" width=\"128\" height=${geometry.surfaceHeight}>\n <path d=${geometry.path} class=\"background\"></path>\n </mask>\n <mask id=\"fill-mask\" maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\" width=\"128\" height=${geometry.surfaceHeight}>\n <path d=${fillPath} class=\"gauge\" ?empty=${progress <= 0}></path>\n </mask>\n </defs>\n <foreignObject width=\"128\" height=${geometry.surfaceHeight} mask=\"url(#background-mask)\">\n <div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"background-surface\"></div>\n </foreignObject>\n <foreignObject class=\"fill-layer\" width=\"128\" height=${geometry.surfaceHeight} mask=\"url(#fill-mask)\"\n ?hidden=${!showFill || progress <= 0}>\n <div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"fill-surface\"></div>\n </foreignObject>\n <circle class=\"fill-dot-end\" cx=${geometry.center + geometry.radius} cy=${geometry.center}\n ?hidden=${!showDot}\n style=${styleMap(thumbStyle('dot', progressAngle, geometry))}>\n </circle>\n <g class=\"needle\"\n ?hidden=${thumb !== 'needle'}\n style=${styleMap(thumbStyle('needle', progressAngle, geometry))}>\n <line class=\"needle-line\" x1=${geometry.center} y1=${geometry.center} x2=${geometry.center + 40} y2=${geometry.center}></line>\n <circle class=\"needle-hub\" cx=${geometry.center} cy=${geometry.center}></circle>\n </g>\n </svg>\n <slot></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'progressbar';\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n // settle the value, otherwise reattaching paints the frame where the animation stopped\n if (this.#progressAnimation) {\n this.#stopProgressAnimation();\n this.#paintedProgress = this.#targetProgress();\n this.requestUpdate();\n }\n }\n\n willUpdate(props: PropertyValues<this>) {\n super.willUpdate(props);\n\n if (props.has('value') || props.has('max')) {\n this.#animateProgress();\n }\n }\n\n updated(props: PropertyValues<this>) {\n super.updated(props);\n const { value, max } = this.#normalizedValues();\n this._internals.ariaValueNow = `${value}`;\n this._internals.ariaValueMax = `${max}`;\n const { status } = this;\n const statusLabel =\n status !== undefined && status !== 'neutral' && status !== 'accent' ? this.i18n[status] : undefined;\n this._internals.ariaLabel = statusLabel ?? this.i18n.information ?? null;\n }\n\n #targetProgress() {\n const { value, max } = this.#normalizedValues();\n return (value / max) * 100;\n }\n\n /**\n * Eases the painted progress toward the value with the duration and easing declared in css, so\n * that `prefers-reduced-motion` and a `--_animation-duration` override both settle immediately.\n */\n #animateProgress() {\n const target = this.#targetProgress();\n const timing = this.hasUpdated ? this.#animationTiming() : undefined;\n\n this.#stopProgressAnimation();\n\n if (!timing || target === this.#paintedProgress) {\n this.#paintedProgress = target;\n return;\n }\n\n const from = this.#paintedProgress;\n // keyframeless animations only keep time, leaving every painted frame to `render`\n const animation = this.animate(null, timing);\n const paint = (progress: number) => {\n this.#paintedProgress = from + (target - from) * progress;\n this.requestUpdate();\n };\n const paintFrame = () => {\n paint(animation.effect?.getComputedTiming().progress ?? 0);\n\n if (animation.playState === 'running') {\n this.#progressFrame = requestAnimationFrame(paintFrame);\n }\n };\n\n animation.finished.then(\n () => {\n // a value that changes on the frame this settles already started the next animation\n if (this.#progressAnimation === animation) {\n this.#stopProgressAnimation();\n paint(1);\n }\n },\n () => undefined\n );\n\n this.#progressAnimation = animation;\n this.#progressFrame = requestAnimationFrame(paintFrame);\n }\n\n #stopProgressAnimation() {\n // only a browser render starts an animation, so server rendering never reaches these apis\n if (this.#progressAnimation) {\n cancelAnimationFrame(this.#progressFrame);\n this.#progressAnimation.cancel();\n this.#progressAnimation = undefined;\n }\n }\n\n #animationTiming() {\n const gaugeStyles = getComputedStyle(this);\n const duration = gaugeStyles.getPropertyValue('--_animation-duration').trim();\n const milliseconds = parseFloat(duration) * (duration.endsWith('ms') ? 1 : 1000);\n const easing = gaugeStyles.getPropertyValue('--nve-ref-animation-easing-100').trim();\n\n return milliseconds > 0 ? { duration: milliseconds, easing: easing || 'linear' } : undefined;\n }\n\n #angleAtProgress(geometry: GaugeGeometry, progress: number) {\n return geometry.startAngle + geometry.sweepAngle * (progress / 100);\n }\n\n #pathAtProgress(geometry: GaugeGeometry, progress: number) {\n const start = this.#pointAtAngle(geometry, geometry.startAngle);\n const sweepAngle = geometry.sweepAngle * (progress / 100);\n const end = this.#pointAtAngle(geometry, geometry.startAngle + sweepAngle);\n const largeArcFlag = sweepAngle > 180 ? 1 : 0;\n return `M ${start.x} ${start.y} A ${geometry.radius} ${geometry.radius} 0 ${largeArcFlag} 1 ${end.x} ${end.y}`;\n }\n\n #pointAtAngle(geometry: GaugeGeometry, angle: number) {\n const radians = (angle * Math.PI) / 180;\n return {\n x: geometry.center + geometry.radius * Math.cos(radians),\n y: geometry.center + geometry.radius * Math.sin(radians)\n };\n }\n\n #geometry() {\n return this.shape === 'half' ? GAUGE_GEOMETRY.half : GAUGE_GEOMETRY.default;\n }\n\n #normalizedThumb() {\n return this.thumb === 'dot' || this.thumb === 'needle' ? this.thumb : 'fill';\n }\n}\n"],"mappings":";;;;;;;;;AAYA,IAAM,IAAiB;CACrB,SAAS;EACP,QAAQ;EACR,MAAM;EACN,QAAQ;EACR,YAAY;EACZ,YAAY;EACZ,eAAe;EACf,SAAS;CACX;CACA,MAAM;EACJ,QAAQ;EACR,MAAM;EACN,QAAQ;EACR,YAAY;EACZ,YAAY;EACZ,eAAe;EACf,SAAS;CACX;AACF,GAIM,KAAc,GAAyB,GAAuB,OAA6B;EAC9F,MAAM,EAAM,UAAU,GAAG,EAAc;EACvC,MAAM,EAAM,WAAW,GAAG,EAAS,OAAO,KAAK,EAAS,OAAO;EAC/D,MAAM,EAAM,gBAAgB,GAAG,EAAS,WAAW;AACtD,IAEM,IAAe;CACnB,QAAQ;CACR,aAAa;CACb,SAAS;CACT,SAAS;AACX,GAuBa,IAAb,cAA2B,EAAW;;EAuCnB,aA3BmB,KAAA,QAAA,GAGD,KAAA,MAAA,KA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CACtE;CAEA,KAAmB;EACjB,OAAO,KAAK,UAAU,SAAS,KAAK,UAAU,WAAW,KAAK,QAAQ;CACxE;AACF;AAlNG,EAAA,CAAA,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,EAAA,WAAA,SAAA,KAAA,CAAA,GAGzB,EAAA,CAAA,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,EAAA,WAAA,OAAA,KAAA,CAAA,GAGzB,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,UAAA,KAAA,CAAA,GAGxC,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,SAAA,KAAA,CAAA,GAGxC,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,SAAA,KAAA,CAAA,GAGxC,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA,GAKxC,EAAA,CAAA,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA"}
@@ -10,7 +10,7 @@ var a = class extends r {
10
10
  static {
11
11
  this.metadata = {
12
12
  tag: "nve-grid-cell",
13
- version: "2.19.0"
13
+ version: "2.20.0"
14
14
  };
15
15
  }
16
16
  render() {
@@ -13,7 +13,7 @@ var c = class r extends a {
13
13
  static {
14
14
  this.metadata = {
15
15
  tag: "nve-grid-column",
16
- version: "2.19.0"
16
+ version: "2.20.0"
17
17
  };
18
18
  }
19
19
  get #e() {
@@ -15,7 +15,7 @@ var s = class extends a {
15
15
  static {
16
16
  this.metadata = {
17
17
  tag: "nve-grid-footer",
18
- version: "2.19.0"
18
+ version: "2.20.0"
19
19
  };
20
20
  }
21
21
  static {
@@ -23,7 +23,7 @@ var y = class extends g {
23
23
  static {
24
24
  this.metadata = {
25
25
  tag: "nve-grid",
26
- version: "2.19.0",
26
+ version: "2.20.0",
27
27
  children: [
28
28
  d.metadata.tag,
29
29
  f.metadata.tag,
@@ -19,7 +19,7 @@ var m = class extends d {
19
19
  static {
20
20
  this.metadata = {
21
21
  tag: "nve-grid-header",
22
- version: "2.19.0",
22
+ version: "2.20.0",
23
23
  children: [s.metadata.tag]
24
24
  };
25
25
  }
@@ -10,7 +10,7 @@ var a = class extends r {
10
10
  static {
11
11
  this.metadata = {
12
12
  tag: "nve-grid-placeholder",
13
- version: "2.19.0"
13
+ version: "2.20.0"
14
14
  };
15
15
  }
16
16
  render() {
@@ -15,7 +15,7 @@ var u = class extends s {
15
15
  static {
16
16
  this.metadata = {
17
17
  tag: "nve-grid-row",
18
- version: "2.19.0",
18
+ version: "2.20.0",
19
19
  children: [a.metadata.tag]
20
20
  };
21
21
  }
@@ -16,7 +16,7 @@ var f = class n extends o {
16
16
  static {
17
17
  this.metadata = {
18
18
  tag: "nve-icon",
19
- version: "2.19.0"
19
+ version: "2.20.0"
20
20
  };
21
21
  }
22
22
  static {
@@ -103,7 +103,7 @@ a([l({
103
103
  })], f.prototype, "name", void 0), a([d()], f.prototype, "svg", void 0);
104
104
  function p(e) {
105
105
  if (typeof globalThis.customElements?.get == "function") {
106
- let t = n(e.metadata.version), i = n("2.19.0");
106
+ let t = n(e.metadata.version), i = n("2.20.0");
107
107
  t.minor <= i.minor && t.major <= i.major && (e._icons = {
108
108
  ...e._icons,
109
109
  ...r
@@ -15,7 +15,7 @@ var l = class extends a {
15
15
  static {
16
16
  this.metadata = {
17
17
  tag: "nve-icon-button",
18
- version: "2.19.0"
18
+ version: "2.20.0"
19
19
  };
20
20
  }
21
21
  static {
@@ -61,7 +61,7 @@ var a = (e) => `
61
61
  static {
62
62
  this.metadata = {
63
63
  tag: "nve-iframe",
64
- version: "2.19.0"
64
+ version: "2.20.0"
65
65
  };
66
66
  }
67
67
  static get observedAttributes() {
package/dist/index.js CHANGED
@@ -1,9 +1,8 @@
1
- import { I18nService as e } from "./internal/services/i18n.service.js";
2
- import { getThemeTokens as t } from "./internal/utils/dom.js";
3
- import { statusIcons as n } from "./internal/types/index.js";
1
+ import { getThemeTokens as e } from "./internal/utils/dom.js";
2
+ import { statusIcons as t } from "./internal/types/index.js";
3
+ import { internal_exports as n } from "./internal/index.js";
4
4
  //#region src/index.ts
5
- var r = "2.19.0", i = "@nvidia-elements";
6
- //#endregion
7
- export { e as I18nService, i as SCOPE, r as VERSION, t as getThemeTokens, n as statusIcons };
5
+ var r = "2.20.0", i = "@nvidia-elements", a = n.I18nService;
6
+ export { a as I18nService, i as SCOPE, r as VERSION, e as getThemeTokens, t as statusIcons };
8
7
 
9
8
  //# sourceMappingURL=index.js.map
@@ -11,7 +11,7 @@ var a = class extends n {
11
11
  static {
12
12
  this.metadata = {
13
13
  tag: "nve-input-group",
14
- version: "2.19.0"
14
+ version: "2.20.0"
15
15
  };
16
16
  }
17
17
  async connectedCallback() {
@@ -14,7 +14,7 @@ var a = r, o = class extends n {
14
14
  static {
15
15
  this.metadata = {
16
16
  tag: "nve-input",
17
- version: "2.19.0"
17
+ version: "2.20.0"
18
18
  };
19
19
  }
20
20
  };
@@ -3,7 +3,6 @@
3
3
  */
4
4
  export * from './controllers/audit.controller.js';
5
5
  export * from './controllers/gesture.controller.js';
6
- export * from './controllers/i18n.controller.js';
7
6
  export * from './controllers/key-state.controller.js';
8
7
  export * from './controllers/keynav-grid.controller.js';
9
8
  export * from './controllers/keynav-list.controller.js';
@@ -22,7 +21,7 @@ export * from './decorators/host-attr.js';
22
21
  export * from './decorators/scoped-registry.js';
23
22
  export * from './styles/index.js';
24
23
  export * from './styles/popover.js';
25
- export * from './services/i18n.service.js';
24
+ export * from '@nvidia-elements/foundations/internal/i18n';
26
25
  export * from './services/log.service.js';
27
26
  export * from './services/transition.service.js';
28
27
  export * from './types/index.js';