@nvidia-elements/core 2.7.3 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +8 -0
  3. package/dist/_virtual/{_@oxc-project_runtime@0.139.0 → _@oxc-project_runtime@0.147.0}/helpers/esm/decorate.js +1 -1
  4. package/dist/accordion/accordion2.js +5 -5
  5. package/dist/accordion/accordion2.js.map +1 -1
  6. package/dist/alert/alert-group2.js +2 -2
  7. package/dist/alert/alert-group2.js.map +1 -1
  8. package/dist/alert/alert2.js +2 -2
  9. package/dist/alert/alert2.js.map +1 -1
  10. package/dist/avatar/avatar-group2.js +1 -1
  11. package/dist/avatar/avatar-group2.js.map +1 -1
  12. package/dist/avatar/avatar2.js +2 -2
  13. package/dist/avatar/avatar2.js.map +1 -1
  14. package/dist/badge/badge2.js +2 -2
  15. package/dist/badge/badge2.js.map +1 -1
  16. package/dist/breadcrumb/breadcrumb2.js +2 -2
  17. package/dist/breadcrumb/breadcrumb2.js.map +1 -1
  18. package/dist/bundles/index.d.ts +2 -0
  19. package/dist/bundles/index.js +6 -6
  20. package/dist/button/button2.js +2 -2
  21. package/dist/button/button2.js.map +1 -1
  22. package/dist/button-group/button-group2.js +2 -2
  23. package/dist/button-group/button-group2.js.map +1 -1
  24. package/dist/card/card2.js +5 -5
  25. package/dist/card/card2.js.map +1 -1
  26. package/dist/chat-message/chat-message2.js +2 -2
  27. package/dist/chat-message/chat-message2.js.map +1 -1
  28. package/dist/checkbox/checkbox-group2.js +2 -2
  29. package/dist/checkbox/checkbox-group2.js.map +1 -1
  30. package/dist/checkbox/checkbox2.js +2 -2
  31. package/dist/checkbox/checkbox2.js.map +1 -1
  32. package/dist/color/color2.js +2 -2
  33. package/dist/color/color2.js.map +1 -1
  34. package/dist/combobox/combobox.examples.js.map +1 -1
  35. package/dist/combobox/combobox2.js +7 -5
  36. package/dist/combobox/combobox2.js.map +1 -1
  37. package/dist/copy-button/copy-button2.js +2 -2
  38. package/dist/copy-button/copy-button2.js.map +1 -1
  39. package/dist/custom-elements-jsx.d.ts +2 -0
  40. package/dist/custom-elements-vue.d.ts +2 -0
  41. package/dist/custom-elements.json +9 -1
  42. package/dist/data.html.json +1 -1
  43. package/dist/date/date2.js +2 -2
  44. package/dist/date/date2.js.map +1 -1
  45. package/dist/datetime/datetime2.js +2 -2
  46. package/dist/datetime/datetime2.js.map +1 -1
  47. package/dist/dialog/dialog-footer2.js +2 -2
  48. package/dist/dialog/dialog-footer2.js.map +1 -1
  49. package/dist/dialog/dialog-header2.js +2 -2
  50. package/dist/dialog/dialog-header2.js.map +1 -1
  51. package/dist/dialog/dialog2.js +2 -2
  52. package/dist/dialog/dialog2.js.map +1 -1
  53. package/dist/divider/divider2.js +2 -2
  54. package/dist/divider/divider2.js.map +1 -1
  55. package/dist/dot/dot2.js +2 -2
  56. package/dist/dot/dot2.js.map +1 -1
  57. package/dist/drawer/drawer-content2.js +2 -2
  58. package/dist/drawer/drawer-content2.js.map +1 -1
  59. package/dist/drawer/drawer-footer2.js +2 -2
  60. package/dist/drawer/drawer-footer2.js.map +1 -1
  61. package/dist/drawer/drawer-header2.js +2 -2
  62. package/dist/drawer/drawer-header2.js.map +1 -1
  63. package/dist/drawer/drawer2.js +2 -2
  64. package/dist/drawer/drawer2.js.map +1 -1
  65. package/dist/dropdown/dropdown-footer2.js +2 -2
  66. package/dist/dropdown/dropdown-footer2.js.map +1 -1
  67. package/dist/dropdown/dropdown-header2.js +2 -2
  68. package/dist/dropdown/dropdown-header2.js.map +1 -1
  69. package/dist/dropdown/dropdown2.js +2 -2
  70. package/dist/dropdown/dropdown2.js.map +1 -1
  71. package/dist/dropdown-group/dropdown-group.js +2 -2
  72. package/dist/dropdown-group/dropdown-group.js.map +1 -1
  73. package/dist/dropzone/dropzone2.js +2 -2
  74. package/dist/dropzone/dropzone2.js.map +1 -1
  75. package/dist/file/file2.js +1 -1
  76. package/dist/file/file2.js.map +1 -1
  77. package/dist/format-bytes/format-bytes2.js +2 -2
  78. package/dist/format-bytes/format-bytes2.js.map +1 -1
  79. package/dist/format-datetime/format-datetime2.js +2 -2
  80. package/dist/format-datetime/format-datetime2.js.map +1 -1
  81. package/dist/format-number/format-number2.js +2 -2
  82. package/dist/format-number/format-number2.js.map +1 -1
  83. package/dist/format-relative-time/format-relative-time2.js +2 -2
  84. package/dist/format-relative-time/format-relative-time2.js.map +1 -1
  85. package/dist/format-truncate/format-truncate2.js +2 -2
  86. package/dist/format-truncate/format-truncate2.js.map +1 -1
  87. package/dist/forms/control/control2.js +2 -2
  88. package/dist/forms/control/control2.js.map +1 -1
  89. package/dist/forms/control-group/control-group2.js +2 -2
  90. package/dist/forms/control-group/control-group2.js.map +1 -1
  91. package/dist/forms/control-message/control-message2.js +2 -2
  92. package/dist/forms/control-message/control-message2.js.map +1 -1
  93. package/dist/forms/validation.examples.js.map +1 -1
  94. package/dist/gauge/gauge2.js +2 -2
  95. package/dist/gauge/gauge2.js.map +1 -1
  96. package/dist/grid/cell/cell2.js +1 -1
  97. package/dist/grid/cell/cell2.js.map +1 -1
  98. package/dist/grid/column/column2.js +2 -2
  99. package/dist/grid/column/column2.js.map +1 -1
  100. package/dist/grid/footer/footer2.js +2 -2
  101. package/dist/grid/footer/footer2.js.map +1 -1
  102. package/dist/grid/grid.examples.js.map +1 -1
  103. package/dist/grid/grid2.js +2 -2
  104. package/dist/grid/grid2.js.map +1 -1
  105. package/dist/grid/header/header2.js +2 -2
  106. package/dist/grid/header/header2.js.map +1 -1
  107. package/dist/grid/placeholder/placeholder2.js +1 -1
  108. package/dist/grid/placeholder/placeholder2.js.map +1 -1
  109. package/dist/grid/row/row2.js +2 -2
  110. package/dist/grid/row/row2.js.map +1 -1
  111. package/dist/icon/icon2.js +3 -3
  112. package/dist/icon/icon2.js.map +1 -1
  113. package/dist/icon-button/icon-button2.js +2 -2
  114. package/dist/icon-button/icon-button2.js.map +1 -1
  115. package/dist/index.js +1 -1
  116. package/dist/input/input-group2.js +1 -1
  117. package/dist/input/input-group2.js.map +1 -1
  118. package/dist/input/input2.js +2 -2
  119. package/dist/input/input2.js.map +1 -1
  120. package/dist/internal/controllers/audit.controller.js +9 -7
  121. package/dist/internal/controllers/audit.controller.js.map +1 -1
  122. package/dist/internal/controllers/gesture.controller.examples.js.map +1 -1
  123. package/dist/internal/controllers/gesture.controller.js +1 -3
  124. package/dist/internal/controllers/gesture.controller.js.map +1 -1
  125. package/dist/internal/controllers/i18n.controller.examples.js.map +1 -1
  126. package/dist/internal/controllers/i18n.controller.js.map +1 -1
  127. package/dist/internal/controllers/keynav-grid.controller.js.map +1 -1
  128. package/dist/internal/controllers/keynav-list.controller.js +1 -4
  129. package/dist/internal/controllers/keynav-list.controller.js.map +1 -1
  130. package/dist/internal/controllers/keynav-spatial.controller.js.map +1 -1
  131. package/dist/internal/controllers/state-scroll.controller.js.map +1 -1
  132. package/dist/internal/controllers/type-anchor.controller.js.map +1 -1
  133. package/dist/internal/controllers/type-closable.controller.js.map +1 -1
  134. package/dist/internal/controllers/type-expandable.controller.js.map +1 -1
  135. package/dist/internal/controllers/type-native-popover.controller.js.map +1 -1
  136. package/dist/internal/controllers/type-native-popover.utils.js +2 -2
  137. package/dist/internal/controllers/type-native-popover.utils.js.map +1 -1
  138. package/dist/internal/controllers/type-selectable.controller.js.map +1 -1
  139. package/dist/internal/controllers/type-ssr.controller.js.map +1 -1
  140. package/dist/internal/services/global.service.js +1 -1
  141. package/dist/internal/services/global.utils.js.map +1 -1
  142. package/dist/internal/services/log.service.js.map +1 -1
  143. package/dist/internal/services/transition.service.js.map +1 -1
  144. package/dist/internal/utils/dom.js +2 -1
  145. package/dist/internal/utils/dom.js.map +1 -1
  146. package/dist/internal/utils/strings.js +1 -1
  147. package/dist/internal/utils/strings.js.map +1 -1
  148. package/dist/logo/logo2.js +2 -2
  149. package/dist/logo/logo2.js.map +1 -1
  150. package/dist/menu/menu-item2.js +2 -2
  151. package/dist/menu/menu-item2.js.map +1 -1
  152. package/dist/menu/menu2.js +2 -2
  153. package/dist/menu/menu2.js.map +1 -1
  154. package/dist/month/month2.js +2 -2
  155. package/dist/month/month2.js.map +1 -1
  156. package/dist/notification/notification-group2.js +2 -2
  157. package/dist/notification/notification-group2.js.map +1 -1
  158. package/dist/notification/notification2.js +2 -2
  159. package/dist/notification/notification2.js.map +1 -1
  160. package/dist/page/page-panel/page-panel-content2.js +1 -1
  161. package/dist/page/page-panel/page-panel-content2.js.map +1 -1
  162. package/dist/page/page-panel/page-panel-footer2.js +2 -2
  163. package/dist/page/page-panel/page-panel-footer2.js.map +1 -1
  164. package/dist/page/page-panel/page-panel-header2.js +2 -2
  165. package/dist/page/page-panel/page-panel-header2.js.map +1 -1
  166. package/dist/page/page-panel/page-panel2.js +2 -2
  167. package/dist/page/page-panel/page-panel2.js.map +1 -1
  168. package/dist/page/page2.js +2 -2
  169. package/dist/page/page2.js.map +1 -1
  170. package/dist/page-header/page-header2.js +1 -1
  171. package/dist/page-header/page-header2.js.map +1 -1
  172. package/dist/page-loader/page-loader2.js +2 -2
  173. package/dist/page-loader/page-loader2.js.map +1 -1
  174. package/dist/pagination/pagination2.js +2 -2
  175. package/dist/pagination/pagination2.js.map +1 -1
  176. package/dist/panel/panel2.js +5 -5
  177. package/dist/panel/panel2.js.map +1 -1
  178. package/dist/password/password2.js +2 -2
  179. package/dist/password/password2.js.map +1 -1
  180. package/dist/polyfills/index.js +1 -1
  181. package/dist/polyfills/index.js.map +1 -1
  182. package/dist/preferences-input/preferences-input2.js +2 -2
  183. package/dist/preferences-input/preferences-input2.js.map +1 -1
  184. package/dist/progress-bar/progress-bar2.js +2 -2
  185. package/dist/progress-bar/progress-bar2.js.map +1 -1
  186. package/dist/progress-ring/progress-ring2.js +2 -2
  187. package/dist/progress-ring/progress-ring2.js.map +1 -1
  188. package/dist/progressive-filter-chip/progressive-filter-chip2.js +2 -2
  189. package/dist/progressive-filter-chip/progressive-filter-chip2.js.map +1 -1
  190. package/dist/pulse/pulse2.js +2 -2
  191. package/dist/pulse/pulse2.js.map +1 -1
  192. package/dist/radio/radio-group2.js +2 -2
  193. package/dist/radio/radio-group2.js.map +1 -1
  194. package/dist/radio/radio2.js +2 -2
  195. package/dist/radio/radio2.js.map +1 -1
  196. package/dist/range/range2.js +4 -4
  197. package/dist/range/range2.js.map +1 -1
  198. package/dist/resize-handle/resize-handle2.js +2 -2
  199. package/dist/resize-handle/resize-handle2.js.map +1 -1
  200. package/dist/search/search2.js +2 -2
  201. package/dist/search/search2.js.map +1 -1
  202. package/dist/select/select2.js +2 -2
  203. package/dist/select/select2.js.map +1 -1
  204. package/dist/skeleton/skeleton2.js +2 -2
  205. package/dist/skeleton/skeleton2.js.map +1 -1
  206. package/dist/sort-button/sort-button2.js +2 -2
  207. package/dist/sort-button/sort-button2.js.map +1 -1
  208. package/dist/sparkline/sparkline.utils.js +1 -3
  209. package/dist/sparkline/sparkline.utils.js.map +1 -1
  210. package/dist/sparkline/sparkline2.js +8 -6
  211. package/dist/sparkline/sparkline2.js.map +1 -1
  212. package/dist/star-rating/star-rating2.js +2 -2
  213. package/dist/star-rating/star-rating2.js.map +1 -1
  214. package/dist/steps/steps2.js +3 -3
  215. package/dist/steps/steps2.js.map +1 -1
  216. package/dist/switch/switch-group2.js +2 -2
  217. package/dist/switch/switch-group2.js.map +1 -1
  218. package/dist/switch/switch2.js +2 -2
  219. package/dist/switch/switch2.js.map +1 -1
  220. package/dist/tabs/tabs-group2.js +2 -2
  221. package/dist/tabs/tabs-group2.js.map +1 -1
  222. package/dist/tabs/tabs2.js +3 -3
  223. package/dist/tabs/tabs2.js.map +1 -1
  224. package/dist/tag/tag.d.ts +2 -0
  225. package/dist/tag/tag.examples.js.map +1 -1
  226. package/dist/tag/tag.examples.json +20 -3
  227. package/dist/tag/tag.js +1 -1
  228. package/dist/tag/tag.js.map +1 -1
  229. package/dist/tag/tag2.js +3 -3
  230. package/dist/tag/tag2.js.map +1 -1
  231. package/dist/textarea/textarea2.js +1 -1
  232. package/dist/textarea/textarea2.js.map +1 -1
  233. package/dist/time/time2.js +2 -2
  234. package/dist/time/time2.js.map +1 -1
  235. package/dist/toast/toast2.js +2 -2
  236. package/dist/toast/toast2.js.map +1 -1
  237. package/dist/toggletip/toggletip-footer2.js +2 -2
  238. package/dist/toggletip/toggletip-footer2.js.map +1 -1
  239. package/dist/toggletip/toggletip-header2.js +2 -2
  240. package/dist/toggletip/toggletip-header2.js.map +1 -1
  241. package/dist/toggletip/toggletip2.js +2 -2
  242. package/dist/toggletip/toggletip2.js.map +1 -1
  243. package/dist/toolbar/toolbar2.js +2 -2
  244. package/dist/toolbar/toolbar2.js.map +1 -1
  245. package/dist/tooltip/tooltip.examples.js.map +1 -1
  246. package/dist/tooltip/tooltip2.js +2 -2
  247. package/dist/tooltip/tooltip2.js.map +1 -1
  248. package/dist/tree/tree-node2.js +2 -2
  249. package/dist/tree/tree-node2.js.map +1 -1
  250. package/dist/tree/tree.examples.js.map +1 -1
  251. package/dist/tree/tree2.js +2 -2
  252. package/dist/tree/tree2.js.map +1 -1
  253. package/dist/week/week2.js +2 -2
  254. package/dist/week/week2.js.map +1 -1
  255. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"file":"format-number2.js","names":["#rawValue","#resolvedLocale","#parsedNumber","#formatOptions","#formattedNumber","#onSlotChange"],"sources":["../../src/format-number/format-number.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 { useStyles, typeSSR, LogService } from '@nvidia-elements/core/internal';\nimport styles from './format-number.css?inline';\n\nexport type FormatNumberStyle = 'decimal' | 'currency' | 'percent' | 'unit';\nexport type CurrencyDisplayOption = 'symbol' | 'code' | 'name' | 'narrowSymbol';\nexport type CurrencySignOption = 'standard' | 'accounting';\nexport type NotationOption = 'standard' | 'scientific' | 'engineering' | 'compact';\nexport type CompactDisplayOption = 'short' | 'long';\nexport type UnitDisplayOption = 'short' | 'long' | 'narrow';\nexport type SignDisplayOption = 'auto' | 'never' | 'always' | 'exceptZero';\n\nconst STRING_KEYS: [keyof FormatNumber, string][] = [\n ['currency', 'currency'],\n ['currencyDisplay', 'currencyDisplay'],\n ['currencySign', 'currencySign'],\n ['notation', 'notation'],\n ['compactDisplay', 'compactDisplay'],\n ['unit', 'unit'],\n ['unitDisplay', 'unitDisplay'],\n ['signDisplay', 'signDisplay']\n];\n\nconst NUMBER_KEYS: [keyof FormatNumber, string][] = [\n ['minimumFractionDigits', 'minimumFractionDigits'],\n ['maximumFractionDigits', 'maximumFractionDigits'],\n ['minimumIntegerDigits', 'minimumIntegerDigits']\n];\n\n/**\n * @element nve-format-number\n * @description A localized number formatter for currencies, percentages, units, and compact notation, backed by Intl.NumberFormat.\n * Provide a `currency` attribute when `formatStyle` is `currency`, and a `unit` attribute when `formatStyle` is `unit`.\n * @documentation https://nvidia.github.io/elements/docs/elements/format-number/\n * @since 0.0.0\n * @entrypoint \\@nvidia-elements/core/format-number\n * @slot - Numeric string to format (such as 1234567 or 1234.56). Serves as fallback before hydration.\n * @aria https://developer.mozilla.org/en-US/docs/Web/HTML/Element/data\n */\n@typeSSR()\nexport class FormatNumber extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-format-number',\n version: '0.0.0'\n };\n\n /**\n * Optional numeric string for values supplied by JavaScript or bound data.\n * By default, the component formats the element's text content, which also serves as the SSR fallback.\n * When both are present, this property takes precedence.\n */\n @property({ type: String }) number?: string;\n\n /**\n * Language tag (such as en-US, de-DE). Defaults to document.documentElement.lang or browser default.\n */\n @property({ type: String }) locale?: string;\n\n /**\n * Formatting style: 'decimal' | 'currency' | 'percent' | 'unit'.\n */\n @property({ type: String, attribute: 'format-style' }) formatStyle: FormatNumberStyle = 'decimal';\n\n /**\n * ISO 4217 currency code (such as USD or EUR). Required when formatStyle is currency.\n */\n @property({ type: String }) currency?: string;\n\n /**\n * Currency sign style: 'standard' | 'accounting'.\n */\n @property({ type: String, attribute: 'currency-sign' }) currencySign?: CurrencySignOption;\n\n /**\n * Currency display style: 'symbol' | 'code' | 'name' | 'narrowSymbol'.\n */\n @property({ type: String, attribute: 'currency-display' }) currencyDisplay?: CurrencyDisplayOption;\n\n /**\n * Unit identifier (such as kilometer or byte). Required when formatStyle is unit.\n */\n @property({ type: String }) unit?: string;\n\n /**\n * Unit display style: 'short' | 'long' | 'narrow'.\n */\n @property({ type: String, attribute: 'unit-display' }) unitDisplay?: UnitDisplayOption;\n\n /**\n * Number notation: 'standard' | 'scientific' | 'engineering' | 'compact'.\n */\n @property({ type: String }) notation?: NotationOption;\n\n /**\n * Compact notation display: 'short' | 'long'. Only applies when notation is compact.\n */\n @property({ type: String, attribute: 'compact-display' }) compactDisplay?: CompactDisplayOption;\n\n /**\n * Sign display: 'auto' | 'never' | 'always' | 'exceptZero'.\n */\n @property({ type: String, attribute: 'sign-display' }) signDisplay?: SignDisplayOption;\n\n /**\n * Grouping separators: 'auto' | 'always' | 'min2' | 'true' | 'false'.\n */\n @property({ type: String, attribute: 'use-grouping' })\n useGrouping?: 'auto' | 'always' | 'min2' | 'true' | 'false' | boolean;\n\n /**\n * Pad fraction output to at least this many digits (0-20).\n */\n @property({ type: Number, attribute: 'minimum-fraction-digits' }) minimumFractionDigits?: number;\n\n /**\n * Round fraction output to at most this many digits (0-20).\n */\n @property({ type: Number, attribute: 'maximum-fraction-digits' }) maximumFractionDigits?: number;\n\n /**\n * Pad integer output to at least this many digits (1-21).\n */\n @property({ type: Number, attribute: 'minimum-integer-digits' }) minimumIntegerDigits?: number;\n\n get #rawValue(): string {\n return this.number ?? this.textContent?.trim() ?? '';\n }\n\n get #resolvedLocale(): string | undefined {\n return this.locale ?? (globalThis.document?.documentElement?.lang || undefined);\n }\n\n get #parsedNumber(): number | null {\n const raw = this.#rawValue;\n if (!raw) return null;\n\n const numericValue = Number(raw);\n if (Number.isFinite(numericValue)) return numericValue;\n\n LogService.warn(`format-number: invalid numeric value \"${raw}\"`);\n return null;\n }\n\n get #formatOptions(): Intl.NumberFormatOptions {\n const options: Intl.NumberFormatOptions = { style: this.formatStyle };\n\n for (const [prop, key] of STRING_KEYS) {\n const value = this[prop] as string | undefined;\n if (value !== undefined) (options as Record<string, unknown>)[key] = value;\n }\n\n for (const [prop, key] of NUMBER_KEYS) {\n const value = this[prop] as number | undefined;\n if (value !== undefined) (options as Record<string, unknown>)[key] = value;\n }\n\n if (this.useGrouping !== undefined) {\n const grouping = this.useGrouping === 'false' ? false : this.useGrouping === 'true' ? true : this.useGrouping;\n (options as Record<string, unknown>).useGrouping = grouping;\n }\n\n return options;\n }\n\n get #formattedNumber(): string {\n const raw = this.#rawValue;\n if (!raw) return '';\n\n const numericValue = this.#parsedNumber;\n if (numericValue === null) return raw;\n\n try {\n return new Intl.NumberFormat(this.#resolvedLocale, this.#formatOptions).format(numericValue);\n } catch (e) {\n LogService.warn(`format-number: ${(e as Error).message}`);\n return raw;\n }\n }\n\n render() {\n return html`<data internal-host value=${this.#rawValue}>${this.#formattedNumber}<slot @slotchange=${this.#onSlotChange} hidden></slot></data>`;\n }\n\n #onSlotChange() {\n this.requestUpdate();\n }\n}\n"],"mappings":";;;;;;;;AAgBA,IAAM,IAA8C;CAClD,CAAC,YAAY,UAAU;CACvB,CAAC,mBAAmB,iBAAiB;CACrC,CAAC,gBAAgB,cAAc;CAC/B,CAAC,YAAY,UAAU;CACvB,CAAC,kBAAkB,gBAAgB;CACnC,CAAC,QAAQ,MAAM;CACf,CAAC,eAAe,aAAa;CAC7B,CAAC,eAAe,aAAa;AAC/B,GAEM,IAA8C;CAClD,CAAC,yBAAyB,uBAAuB;CACjD,CAAC,yBAAyB,uBAAuB;CACjD,CAAC,wBAAwB,sBAAsB;AACjD,GAaO,IAAA,cAA2B,EAAW;;kCAuB6C;;;gBAtBxE,EAAU,CAAC,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0B,CAAC,CAAA,GAAA,EAAA,WAAA,yBAAA,KAAA,CAAA,MAK/D,EAAS;CAAE,MAAM;CAAQ,WAAW;AAAyB,CAAC,CAAA,GAAA,EAAA,WAAA,wBAAA,KAAA,CAAA,UArFhE,EAAQ,CAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"format-number2.js","names":[],"sources":["../../src/format-number/format-number.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 { useStyles, typeSSR, LogService } from '@nvidia-elements/core/internal';\nimport styles from './format-number.css?inline';\n\nexport type FormatNumberStyle = 'decimal' | 'currency' | 'percent' | 'unit';\nexport type CurrencyDisplayOption = 'symbol' | 'code' | 'name' | 'narrowSymbol';\nexport type CurrencySignOption = 'standard' | 'accounting';\nexport type NotationOption = 'standard' | 'scientific' | 'engineering' | 'compact';\nexport type CompactDisplayOption = 'short' | 'long';\nexport type UnitDisplayOption = 'short' | 'long' | 'narrow';\nexport type SignDisplayOption = 'auto' | 'never' | 'always' | 'exceptZero';\n\nconst STRING_KEYS: [keyof FormatNumber, string][] = [\n ['currency', 'currency'],\n ['currencyDisplay', 'currencyDisplay'],\n ['currencySign', 'currencySign'],\n ['notation', 'notation'],\n ['compactDisplay', 'compactDisplay'],\n ['unit', 'unit'],\n ['unitDisplay', 'unitDisplay'],\n ['signDisplay', 'signDisplay']\n];\n\nconst NUMBER_KEYS: [keyof FormatNumber, string][] = [\n ['minimumFractionDigits', 'minimumFractionDigits'],\n ['maximumFractionDigits', 'maximumFractionDigits'],\n ['minimumIntegerDigits', 'minimumIntegerDigits']\n];\n\n/**\n * @element nve-format-number\n * @description A localized number formatter for currencies, percentages, units, and compact notation, backed by Intl.NumberFormat.\n * Provide a `currency` attribute when `formatStyle` is `currency`, and a `unit` attribute when `formatStyle` is `unit`.\n * @documentation https://nvidia.github.io/elements/docs/elements/format-number/\n * @since 0.0.0\n * @entrypoint \\@nvidia-elements/core/format-number\n * @slot - Numeric string to format (such as 1234567 or 1234.56). Serves as fallback before hydration.\n * @aria https://developer.mozilla.org/en-US/docs/Web/HTML/Element/data\n */\n@typeSSR()\nexport class FormatNumber extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-format-number',\n version: '0.0.0'\n };\n\n /**\n * Optional numeric string for values supplied by JavaScript or bound data.\n * By default, the component formats the element's text content, which also serves as the SSR fallback.\n * When both are present, this property takes precedence.\n */\n @property({ type: String }) number?: string;\n\n /**\n * Language tag (such as en-US, de-DE). Defaults to document.documentElement.lang or browser default.\n */\n @property({ type: String }) locale?: string;\n\n /**\n * Formatting style: 'decimal' | 'currency' | 'percent' | 'unit'.\n */\n @property({ type: String, attribute: 'format-style' }) formatStyle: FormatNumberStyle = 'decimal';\n\n /**\n * ISO 4217 currency code (such as USD or EUR). Required when formatStyle is currency.\n */\n @property({ type: String }) currency?: string;\n\n /**\n * Currency sign style: 'standard' | 'accounting'.\n */\n @property({ type: String, attribute: 'currency-sign' }) currencySign?: CurrencySignOption;\n\n /**\n * Currency display style: 'symbol' | 'code' | 'name' | 'narrowSymbol'.\n */\n @property({ type: String, attribute: 'currency-display' }) currencyDisplay?: CurrencyDisplayOption;\n\n /**\n * Unit identifier (such as kilometer or byte). Required when formatStyle is unit.\n */\n @property({ type: String }) unit?: string;\n\n /**\n * Unit display style: 'short' | 'long' | 'narrow'.\n */\n @property({ type: String, attribute: 'unit-display' }) unitDisplay?: UnitDisplayOption;\n\n /**\n * Number notation: 'standard' | 'scientific' | 'engineering' | 'compact'.\n */\n @property({ type: String }) notation?: NotationOption;\n\n /**\n * Compact notation display: 'short' | 'long'. Only applies when notation is compact.\n */\n @property({ type: String, attribute: 'compact-display' }) compactDisplay?: CompactDisplayOption;\n\n /**\n * Sign display: 'auto' | 'never' | 'always' | 'exceptZero'.\n */\n @property({ type: String, attribute: 'sign-display' }) signDisplay?: SignDisplayOption;\n\n /**\n * Grouping separators: 'auto' | 'always' | 'min2' | 'true' | 'false'.\n */\n @property({ type: String, attribute: 'use-grouping' })\n useGrouping?: 'auto' | 'always' | 'min2' | 'true' | 'false' | boolean;\n\n /**\n * Pad fraction output to at least this many digits (0-20).\n */\n @property({ type: Number, attribute: 'minimum-fraction-digits' }) minimumFractionDigits?: number;\n\n /**\n * Round fraction output to at most this many digits (0-20).\n */\n @property({ type: Number, attribute: 'maximum-fraction-digits' }) maximumFractionDigits?: number;\n\n /**\n * Pad integer output to at least this many digits (1-21).\n */\n @property({ type: Number, attribute: 'minimum-integer-digits' }) minimumIntegerDigits?: number;\n\n get #rawValue(): string {\n return this.number ?? this.textContent?.trim() ?? '';\n }\n\n get #resolvedLocale(): string | undefined {\n return this.locale ?? (globalThis.document?.documentElement?.lang || undefined);\n }\n\n get #parsedNumber(): number | null {\n const raw = this.#rawValue;\n if (!raw) return null;\n\n const numericValue = Number(raw);\n if (Number.isFinite(numericValue)) return numericValue;\n\n LogService.warn(`format-number: invalid numeric value \"${raw}\"`);\n return null;\n }\n\n get #formatOptions(): Intl.NumberFormatOptions {\n const options: Intl.NumberFormatOptions = { style: this.formatStyle };\n\n for (const [prop, key] of STRING_KEYS) {\n const value = this[prop] as string | undefined;\n if (value !== undefined) (options as Record<string, unknown>)[key] = value;\n }\n\n for (const [prop, key] of NUMBER_KEYS) {\n const value = this[prop] as number | undefined;\n if (value !== undefined) (options as Record<string, unknown>)[key] = value;\n }\n\n if (this.useGrouping !== undefined) {\n const grouping = this.useGrouping === 'false' ? false : this.useGrouping === 'true' ? true : this.useGrouping;\n (options as Record<string, unknown>).useGrouping = grouping;\n }\n\n return options;\n }\n\n get #formattedNumber(): string {\n const raw = this.#rawValue;\n if (!raw) return '';\n\n const numericValue = this.#parsedNumber;\n if (numericValue === null) return raw;\n\n try {\n return new Intl.NumberFormat(this.#resolvedLocale, this.#formatOptions).format(numericValue);\n } catch (e) {\n LogService.warn(`format-number: ${(e as Error).message}`);\n return raw;\n }\n }\n\n render() {\n return html`<data internal-host value=${this.#rawValue}>${this.#formattedNumber}<slot @slotchange=${this.#onSlotChange} hidden></slot></data>`;\n }\n\n #onSlotChange() {\n this.requestUpdate();\n }\n}\n"],"mappings":";;;;;;;;AAgBA,IAAM,IAA8C;CAClD,CAAC,YAAY,UAAU;CACvB,CAAC,mBAAmB,iBAAiB;CACrC,CAAC,gBAAgB,cAAc;CAC/B,CAAC,YAAY,UAAU;CACvB,CAAC,kBAAkB,gBAAgB;CACnC,CAAC,QAAQ,MAAM;CACf,CAAC,eAAe,aAAa;CAC7B,CAAC,eAAe,aAAa;AAC/B,GAEM,IAA8C;CAClD,CAAC,yBAAyB,uBAAuB;CACjD,CAAC,yBAAyB,uBAAuB;CACjD,CAAC,wBAAwB,sBAAsB;AACjD,GAaa,IAAN,cAA2B,EAAW;;EAuB6C,aAAA,KAAA,cAAA;;;EAtBxE,KAAA,SAAA,EAAU,CAAC,CAAM,CAAC;;;EAEP,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;CAgFA,IAAI,KAAoB;EACtB,OAAO,KAAK,UAAU,KAAK,aAAa,KAAK,KAAK;CACpD;CAEA,IAAI,KAAsC;EACxC,OAAO,KAAK,WAAW,WAAW,UAAU,iBAAiB,QAAQ,KAAA;CACvE;CAEA,IAAI,KAA+B;EACjC,IAAM,IAAM,KAAK;EACjB,IAAI,CAAC,GAAK,OAAO;EAEjB,IAAM,IAAe,OAAO,CAAG;EAI/B,OAHI,OAAO,SAAS,CAAY,IAAU,KAE1C,EAAW,KAAK,yCAAyC,EAAI,EAAE,GACxD;CACT;CAEA,IAAI,KAA2C;EAC7C,IAAM,IAAoC,EAAE,OAAO,KAAK,YAAY;EAEpE,KAAK,IAAM,CAAC,GAAM,MAAQ,GAAa;GACrC,IAAM,IAAQ,KAAK;GACnB,AAAI,MAAU,KAAA,MAAW,EAAqC,KAAO;EACvE;EAEA,KAAK,IAA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mBAAA,KAAA,CAAA,GAKxD,EAAA,CAAA,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA,GAKzB,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,WAAW;AAAe,CAAC,CAAA,GAAA,EAAA,WAAA,eAAA,KAAA,CAAA,GAKpD,EAAA,CAAA,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,EAAA,WAAA,YAAA,KAAA,CAAA,GAKzB,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,WAAW;AAAkB,CAAC,CAAA,GAAA,EAAA,WAAA,kBAAA,KAAA,CAAA,GAKvD,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,WAAW;AAAe,CAAC,CAAA,GAAA,EAAA,WAAA,eAAA,KAAA,CAAA,GAKpD,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,WAAW;AAAe,CAAC,CAAA,GAAA,EAAA,WAAA,eAAA,KAAA,CAAA,GAMpD,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,WAAW;AAA0B,CAAC,CAAA,GAAA,EAAA,WAAA,yBAAA,KAAA,CAAA,GAK/D,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,WAAW;AAA0B,CAAC,CAAA,GAAA,EAAA,WAAA,yBAAA,KAAA,CAAA,GAK/D,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,WAAW;AAAyB,CAAC,CAAA,GAAA,EAAA,WAAA,wBAAA,KAAA,CAAA,GArFhE,IAAA,EAAA,CAAA,EAAQ,CAAA,GAAA,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import { LogService as e } from "../internal/services/log.service.js";
2
2
  import { typeSSR as t } from "../internal/controllers/type-ssr.controller.js";
3
3
  import { useStyles as n } from "../internal/styles/index.js";
4
- import r from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
4
+ import r from "../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorate.js";
5
5
  import i from "./format-relative-time.js";
6
6
  import { LitElement as a, html as o } from "lit";
7
7
  import { property as s } from "lit/decorators/property.js";
@@ -53,7 +53,7 @@ var c = {
53
53
  static {
54
54
  this.metadata = {
55
55
  tag: "nve-format-relative-time",
56
- version: "2.7.3"
56
+ version: "2.8.0"
57
57
  };
58
58
  }
59
59
  #e;
@@ -1 +1 @@
1
- {"version":3,"file":"format-relative-time2.js","names":["#dateValue","#resolvedLocale","#computeUnit","#computeExplicitUnit","#formattedRelativeTime","#resolveValueAndUnit","#stopSync","#timer","#startSync","#getSyncInterval","#onSlotChange"],"sources":["../../src/format-relative-time/format-relative-time.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 { useStyles, typeSSR, LogService } from '@nvidia-elements/core/internal';\nimport styles from './format-relative-time.css?inline';\n\ntype TimeUnitOption = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';\n\nconst UNIT_DIVISORS: Record<TimeUnitOption, number> = {\n second: 1000,\n minute: 60000,\n hour: 3600000,\n day: 86400000,\n week: 604800000,\n month: 2592000000,\n year: 31536000000\n};\n\nconst THRESHOLDS: { unit: TimeUnitOption; max: number }[] = [\n { unit: 'second', max: 60 },\n { unit: 'minute', max: 60 },\n { unit: 'hour', max: 24 },\n { unit: 'day', max: 7 },\n { unit: 'week', max: 4 },\n { unit: 'month', max: 12 },\n { unit: 'year', max: Number.POSITIVE_INFINITY }\n];\n\n/**\n * @element nve-format-relative-time\n * @description Formats a date/time value as localized relative text using the Intl.RelativeTimeFormat API. Renders inside a semantic time element.\n * Options mirror the Intl.RelativeTimeFormat API. When unit is 'auto', the component selects the best unit based on the time difference.\n * @documentation https://nvidia.github.io/elements/docs/elements/format-relative-time/\n * @since 0.0.0\n * @entrypoint \\@nvidia-elements/core/format-relative-time\n * @slot - Date string to format (such as 2023-07-28T04:20:17.434Z). Serves as fallback before hydration.\n * @aria https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time\n */\n@typeSSR()\nexport class FormatRelativeTime extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-format-relative-time',\n version: '0.0.0'\n };\n\n /**\n * Optional date string for values supplied by JavaScript or bound data.\n * By default, the component formats the element's text content, which also serves as the SSR fallback.\n * When both are present, this property takes precedence.\n */\n @property({ type: String }) date?: string;\n\n /**\n * Language tag (such as en-US, de-DE). Defaults to document.documentElement.lang or browser default.\n */\n @property({ type: String }) locale?: string;\n\n /**\n * Numeric formatting: 'always' | 'auto'. When 'auto', enables natural language forms such as 'yesterday' instead of '1 day ago'.\n */\n @property({ type: String }) numeric: 'always' | 'auto' = 'always';\n\n /**\n * Formatting length: 'long' | 'short' | 'narrow'. Controls verbosity (such as '3 days ago' vs '3d ago'). Maps to Intl.RelativeTimeFormat style option.\n */\n @property({ type: String, attribute: 'format-style' }) formatStyle: 'long' | 'short' | 'narrow' = 'long';\n\n /**\n * Time unit: 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year' | 'auto'. Use 'auto' to let the component select the most appropriate unit based on the time difference.\n */\n @property({ type: String }) unit: 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year' | 'auto' = 'auto';\n\n /**\n * When present, auto-updates the displayed relative time at appropriate intervals.\n */\n @property({ type: Boolean }) sync = false;\n\n #timer?: ReturnType<typeof setTimeout>;\n\n get #dateValue(): string {\n return this.date ?? this.textContent?.trim() ?? '';\n }\n\n get #resolvedLocale(): string | undefined {\n return this.locale ?? (globalThis.document?.documentElement?.lang || undefined);\n }\n\n #computeUnit(diffMs: number): { value: number; unit: Intl.RelativeTimeFormatUnit } {\n const absDiff = Math.abs(diffMs);\n const sign = diffMs < 0 ? -1 : 1;\n\n for (const { unit, max } of THRESHOLDS) {\n const value = Math.round(absDiff / UNIT_DIVISORS[unit]);\n if (value < max) return { value: sign * value, unit };\n }\n return { value: sign * Math.round(absDiff / UNIT_DIVISORS.year), unit: 'year' };\n }\n\n #computeExplicitUnit(diffMs: number, unit: TimeUnitOption): number {\n return Math.round(diffMs / UNIT_DIVISORS[unit]);\n }\n\n #resolveValueAndUnit(diffMs: number): { value: number; unit: Intl.RelativeTimeFormatUnit } {\n if (this.unit === 'auto') {\n return this.#computeUnit(diffMs);\n }\n return { unit: this.unit, value: this.#computeExplicitUnit(diffMs, this.unit) };\n }\n\n get #formattedRelativeTime(): string {\n const iso = this.#dateValue;\n if (!iso) return '';\n\n const target = new Date(iso);\n if (isNaN(target.getTime())) {\n LogService.warn(`format-relative-time: invalid date value \"${iso}\"`);\n return iso;\n }\n\n const { value, unit: resolvedUnit } = this.#resolveValueAndUnit(target.getTime() - Date.now());\n\n try {\n return new Intl.RelativeTimeFormat(this.#resolvedLocale, {\n numeric: this.numeric,\n style: this.formatStyle\n }).format(value, resolvedUnit);\n } catch (e) {\n LogService.warn(`format-relative-time: ${(e as Error).message}`);\n return iso;\n }\n }\n\n #getSyncInterval(): number {\n const iso = this.#dateValue;\n if (!iso) return 60000;\n\n const absDiff = Math.abs(new Date(iso).getTime() - Date.now());\n if (absDiff < 60000) return 10000;\n if (absDiff < 3600000) return 30000;\n if (absDiff < 86400000) return 300000;\n return 3600000;\n }\n\n #startSync() {\n this.#stopSync();\n if (!this.sync) return;\n\n this.#timer = setTimeout(() => {\n this.requestUpdate();\n this.#startSync();\n }, this.#getSyncInterval());\n }\n\n #stopSync() {\n if (this.#timer !== undefined) {\n clearTimeout(this.#timer);\n this.#timer = undefined;\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (this.sync) this.#startSync();\n }\n\n disconnectedCallback() {\n this.#stopSync();\n super.disconnectedCallback();\n }\n\n updated(changed: Map<string, unknown>) {\n if (changed.has('sync')) {\n if (this.sync) {\n this.#startSync();\n } else {\n this.#stopSync();\n }\n }\n }\n\n render() {\n return html`<time internal-host datetime=${this.#dateValue}>${this.#formattedRelativeTime}<slot @slotchange=${this.#onSlotChange} hidden></slot></time>`;\n }\n\n #onSlotChange() {\n this.requestUpdate();\n }\n}\n"],"mappings":";;;;;;;;AAUA,IAAM,IAAgD;CACpD,QAAQ;CACR,QAAQ;CACR,MAAM;CACN,KAAK;CACL,MAAM;CACN,OAAO;CACP,MAAM;AACR,GAEM,IAAsD;CAC1D;EAAE,MAAM;EAAU,KAAK;CAAG;CAC1B;EAAE,MAAM;EAAU,KAAK;CAAG;CAC1B;EAAE,MAAM;EAAQ,KAAK;CAAG;CACxB;EAAE,MAAM;EAAO,KAAK;CAAE;CACtB;EAAE,MAAM;EAAQ,KAAK;CAAE;CACvB;EAAE,MAAM;EAAS,KAAK;CAAG;CACzB;EAAE,MAAM;EAAQ,KAAK;CAAyB;AAChD,GAaO,IAAA,cAAiC,EAAW;;8BAuBQ,6BAKyC,oBAKY,oBAK1E;;;gBArCpB,EAAU,CAAC,CAAM,CAAC;;;kBAEP;GACzB,KAAK;GACL,SAAS;EACX;;CAkCA;CAEA,IAAIA,KAAqB;EACvB,OAAO,KAAK,QAAQ,KAAK,aAAa,KAAK,KAAK;CAClD;CAEA,IAAIC,KAAsC;EACxC,OAAO,KAAK,WAAW,WAAW,UAAU,iBAAiB,QAAQ,KAAA;CACvE;CAEA,GAAa,GAAsE;EACjF,IAAM,IAAU,KAAK,IAAI,CAAM,GACzB,IAAO,IAAS,IAAI,KAAK;EAE/B,KAAK,IAAM,EAAE,SAAM,YAAS,GAAY;GACtC,IAAM,IAAQ,KAAK,MAAM,IAAU,EAAc,EAAK;GACtD,IAAI,IAAQ,GAAK,OAAO;IAAE,OAAO,IAAO;IAAO;GAAK;EACtD;EACA,OAAO;GAAE,OAAO,IAAO,KAAK,MAAM,IAAU,EAAc,IAAI;GAAG,MAAM;EAAO;CAChF;CAEA,GAAqB,GAAgB,GAA8B;EACjE,OAAO,KAAK,MAAM,IAAS,EAAc,EAAK;CAChD;CAEA,GAAq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,AADA,KAAKF,GAAU,GACf,MAAM,qBAAqB;CAC7B;CAEA,QAAQ,GAA+B;EACrC,AAAI,EAAQ,IAAI,MAAM,MAChB,KAAK,OACP,KAAKE,GAAW,IAEhB,KAAKF,GAAU;CAGrB;CAEA,SAAS;EACP,OAAO,CAAI,iCAAgC,KAAKN,GAAW,IAAG,KAAKI,GAAuB,qBAAoB,KAAKM,GAAc;CACnI;CAEA,KAAgB;EACd,KAAK,cAAc;CACrB;AACF;GAzIG,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA,MAKzB,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,EAAA,WAAA,UAAA,KAAA,CAAA,MAKzB,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,EAAA,WAAA,WAAA,KAAA,CAAA,MAKzB,EAAS;CAAE,MAAM;CAAQ,WAAW;AAAe,CAAC,CAAA,GAAA,EAAA,WAAA,eAAA,KAAA,CAAA,MAKpD,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA,MAKzB,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA,UAvC5B,EAAQ,CAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"format-relative-time2.js","names":[],"sources":["../../src/format-relative-time/format-relative-time.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 { useStyles, typeSSR, LogService } from '@nvidia-elements/core/internal';\nimport styles from './format-relative-time.css?inline';\n\ntype TimeUnitOption = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';\n\nconst UNIT_DIVISORS: Record<TimeUnitOption, number> = {\n second: 1000,\n minute: 60000,\n hour: 3600000,\n day: 86400000,\n week: 604800000,\n month: 2592000000,\n year: 31536000000\n};\n\nconst THRESHOLDS: { unit: TimeUnitOption; max: number }[] = [\n { unit: 'second', max: 60 },\n { unit: 'minute', max: 60 },\n { unit: 'hour', max: 24 },\n { unit: 'day', max: 7 },\n { unit: 'week', max: 4 },\n { unit: 'month', max: 12 },\n { unit: 'year', max: Number.POSITIVE_INFINITY }\n];\n\n/**\n * @element nve-format-relative-time\n * @description Formats a date/time value as localized relative text using the Intl.RelativeTimeFormat API. Renders inside a semantic time element.\n * Options mirror the Intl.RelativeTimeFormat API. When unit is 'auto', the component selects the best unit based on the time difference.\n * @documentation https://nvidia.github.io/elements/docs/elements/format-relative-time/\n * @since 0.0.0\n * @entrypoint \\@nvidia-elements/core/format-relative-time\n * @slot - Date string to format (such as 2023-07-28T04:20:17.434Z). Serves as fallback before hydration.\n * @aria https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time\n */\n@typeSSR()\nexport class FormatRelativeTime extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-format-relative-time',\n version: '0.0.0'\n };\n\n /**\n * Optional date string for values supplied by JavaScript or bound data.\n * By default, the component formats the element's text content, which also serves as the SSR fallback.\n * When both are present, this property takes precedence.\n */\n @property({ type: String }) date?: string;\n\n /**\n * Language tag (such as en-US, de-DE). Defaults to document.documentElement.lang or browser default.\n */\n @property({ type: String }) locale?: string;\n\n /**\n * Numeric formatting: 'always' | 'auto'. When 'auto', enables natural language forms such as 'yesterday' instead of '1 day ago'.\n */\n @property({ type: String }) numeric: 'always' | 'auto' = 'always';\n\n /**\n * Formatting length: 'long' | 'short' | 'narrow'. Controls verbosity (such as '3 days ago' vs '3d ago'). Maps to Intl.RelativeTimeFormat style option.\n */\n @property({ type: String, attribute: 'format-style' }) formatStyle: 'long' | 'short' | 'narrow' = 'long';\n\n /**\n * Time unit: 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year' | 'auto'. Use 'auto' to let the component select the most appropriate unit based on the time difference.\n */\n @property({ type: String }) unit: 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year' | 'auto' = 'auto';\n\n /**\n * When present, auto-updates the displayed relative time at appropriate intervals.\n */\n @property({ type: Boolean }) sync = false;\n\n #timer?: ReturnType<typeof setTimeout>;\n\n get #dateValue(): string {\n return this.date ?? this.textContent?.trim() ?? '';\n }\n\n get #resolvedLocale(): string | undefined {\n return this.locale ?? (globalThis.document?.documentElement?.lang || undefined);\n }\n\n #computeUnit(diffMs: number): { value: number; unit: Intl.RelativeTimeFormatUnit } {\n const absDiff = Math.abs(diffMs);\n const sign = diffMs < 0 ? -1 : 1;\n\n for (const { unit, max } of THRESHOLDS) {\n const value = Math.round(absDiff / UNIT_DIVISORS[unit]);\n if (value < max) return { value: sign * value, unit };\n }\n return { value: sign * Math.round(absDiff / UNIT_DIVISORS.year), unit: 'year' };\n }\n\n #computeExplicitUnit(diffMs: number, unit: TimeUnitOption): number {\n return Math.round(diffMs / UNIT_DIVISORS[unit]);\n }\n\n #resolveValueAndUnit(diffMs: number): { value: number; unit: Intl.RelativeTimeFormatUnit } {\n if (this.unit === 'auto') {\n return this.#computeUnit(diffMs);\n }\n return { unit: this.unit, value: this.#computeExplicitUnit(diffMs, this.unit) };\n }\n\n get #formattedRelativeTime(): string {\n const iso = this.#dateValue;\n if (!iso) return '';\n\n const target = new Date(iso);\n if (isNaN(target.getTime())) {\n LogService.warn(`format-relative-time: invalid date value \"${iso}\"`);\n return iso;\n }\n\n const { value, unit: resolvedUnit } = this.#resolveValueAndUnit(target.getTime() - Date.now());\n\n try {\n return new Intl.RelativeTimeFormat(this.#resolvedLocale, {\n numeric: this.numeric,\n style: this.formatStyle\n }).format(value, resolvedUnit);\n } catch (e) {\n LogService.warn(`format-relative-time: ${(e as Error).message}`);\n return iso;\n }\n }\n\n #getSyncInterval(): number {\n const iso = this.#dateValue;\n if (!iso) return 60000;\n\n const absDiff = Math.abs(new Date(iso).getTime() - Date.now());\n if (absDiff < 60000) return 10000;\n if (absDiff < 3600000) return 30000;\n if (absDiff < 86400000) return 300000;\n return 3600000;\n }\n\n #startSync() {\n this.#stopSync();\n if (!this.sync) return;\n\n this.#timer = setTimeout(() => {\n this.requestUpdate();\n this.#startSync();\n }, this.#getSyncInterval());\n }\n\n #stopSync() {\n if (this.#timer !== undefined) {\n clearTimeout(this.#timer);\n this.#timer = undefined;\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (this.sync) this.#startSync();\n }\n\n disconnectedCallback() {\n this.#stopSync();\n super.disconnectedCallback();\n }\n\n updated(changed: Map<string, unknown>) {\n if (changed.has('sync')) {\n if (this.sync) {\n this.#startSync();\n } else {\n this.#stopSync();\n }\n }\n }\n\n render() {\n return html`<time internal-host datetime=${this.#dateValue}>${this.#formattedRelativeTime}<slot @slotchange=${this.#onSlotChange} hidden></slot></time>`;\n }\n\n #onSlotChange() {\n this.requestUpdate();\n }\n}\n"],"mappings":";;;;;;;;AAUA,IAAM,IAAgD;CACpD,QAAQ;CACR,QAAQ;CACR,MAAM;CACN,KAAK;CACL,MAAM;CACN,OAAO;CACP,MAAM;AACR,GAEM,IAAsD;CAC1D;EAAE,MAAM;EAAU,KAAK;CAAG;CAC1B;EAAE,MAAM;EAAU,KAAK;CAAG;CAC1B;EAAE,MAAM;EAAQ,KAAK;CAAG;CACxB;EAAE,MAAM;EAAO,KAAK;CAAE;CACtB;EAAE,MAAM;EAAQ,KAAK;CAAE;CACvB;EAAE,MAAM;EAAS,KAAK;CAAG;CACzB;EAAE,MAAM;EAAQ,KAAK;CAAyB;AAChD,GAaa,IAAN,cAAiC,EAAW;;EAsCb,aAfqB,KAAA,UAAA,UAKyC,KAAA,cAAA,QAKY,KAAA,OAAA,QAK1E,KAAA,OAAA;;;EArCpB,KAAA,SAAA,EAAU,CAAC,CAAM,CAAC;;;EAEP,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;CAkCA;CAEA,IAAI,KAAqB;EACvB,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AAO,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA,GAKzB,EAAA,CAAA,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA,GAvC5B,IAAA,EAAA,CAAA,EAAQ,CAAA,GAAA,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import { attachInternals as e } from "../internal/utils/a11y.js";
2
2
  import { typeSSR as t } from "../internal/controllers/type-ssr.controller.js";
3
3
  import { useStyles as n } from "../internal/styles/index.js";
4
- import r from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
4
+ import r from "../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorate.js";
5
5
  import { normalizeTruncateString as i, normalizeTruncateText as a, truncateText as o } from "./utils.js";
6
6
  import s from "./format-truncate.js";
7
7
  import { LitElement as c, html as l } from "lit";
@@ -19,7 +19,7 @@ var d = class extends c {
19
19
  static {
20
20
  this.metadata = {
21
21
  tag: "nve-format-truncate",
22
- version: "2.7.3"
22
+ version: "2.8.0"
23
23
  };
24
24
  }
25
25
  #e;
@@ -1 +1 @@
1
- {"version":3,"file":"format-truncate2.js","names":["#observeAvailableWidth","#resizeObserver","#slottedText","#renderText","#onSlotChange","#createTextMeasurer","#availableWidth","#textMeasurementContext","#measureText","#measurementContext"],"sources":["../../src/format-truncate/format-truncate.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 { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { attachInternals, useStyles, typeSSR } from '@nvidia-elements/core/internal';\nimport { normalizeTruncateString, normalizeTruncateText, truncateText } from './utils.js';\nimport styles from './format-truncate.css?inline';\n\n/**\n * @element nve-format-truncate\n * @description Truncates text at its start, center, or end while preserving the full text for assistive technology.\n * @documentation https://nvidia.github.io/elements/docs/elements/format-truncate/\n * @since 0.0.0\n * @entrypoint \\@nvidia-elements/core/format-truncate\n * @slot - Text to truncate. The component flattens, trims, and normalizes mixed text and element nodes.\n * @beta\n */\n@typeSSR()\nexport class FormatTruncate extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-format-truncate',\n version: '0.0.0'\n };\n\n /**\n * Location of the ellipsis. Use start or end to preserve one edge, or center to preserve both edges.\n */\n @property({ type: String, reflect: true }) position: 'start' | 'center' | 'end' = 'start';\n\n /**\n * Text unit used for center truncation. Character preserves graphemes, word preserves words, and path preserves path segments.\n */\n @property({ type: String, reflect: true }) strategy: 'character' | 'word' | 'path' = 'character';\n\n /**\n * Edge favored by center truncation. The favored edge keeps at least the configured number of units.\n */\n @property({ type: String, reflect: true }) bias: 'start' | 'end' = 'end';\n\n /**\n * Number of strategy units retained at the biased edge during center truncation.\n */\n @property({ type: Number, reflect: true }) preserve = 6;\n\n /** @private */\n declare _internals: ElementInternals;\n\n #measurementContext?: CanvasRenderingContext2D | null;\n #resizeObserver?: ResizeObserver;\n\n override connectedCallback(): void {\n super.connectedCallback();\n attachInternals(this);\n this.#observeAvailableWidth();\n this.requestUpdate();\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.#resizeObserver?.disconnect();\n }\n\n connectedMoveCallback(): void {\n this.#observeAvailableWidth();\n this.requestUpdate();\n }\n\n override render(): TemplateResult {\n const text = this.#slottedText;\n const truncatedText = this.#renderText(text);\n\n if (truncatedText !== text) this.title = text;\n else this.removeAttribute('title');\n\n return html`<span internal-host aria-hidden=\"true\">${truncatedText}</span><span sizing-host aria-hidden=\"true\">${text}</span><slot @slotchange=${this.#onSlotChange}></slot>`;\n }\n\n get #slottedText(): string {\n const slot = this.shadowRoot?.querySelector<HTMLSlotElement>('slot:not([name])');\n if (slot) return normalizeTruncateText(slot.assignedNodes({ flatten: true }));\n\n const nodes = Array.from(this.childNodes ?? []).filter(isDefaultSlotNode);\n return nodes.length ? normalizeTruncateText(nodes) : normalizeTruncateString(this.textContent ?? '');\n }\n\n #renderText(text: string): string {\n const measureText = this.#createTextMeasurer();\n\n return truncateText(text, {\n position: this.position,\n strategy: this.strategy,\n bias: this.bias,\n preserve: this.preserve,\n availableWidth: this.#availableWidth,\n measureText\n });\n }\n\n get #availableWidth(): number {\n const view = this.ownerDocument?.defaultView;\n if (!view || !this.shadowRoot?.querySelector('[internal-host]')) return Number.POSITIVE_INFINITY;\n\n return getContentWidth(this, view);\n }\n\n #createTextMeasurer(): (text: string) => number {\n const view = this.ownerDocument?.defaultView;\n const context = this.#textMeasurementContext;\n if (!view || !context) return () => 0;\n\n const computedStyles = view.getComputedStyle(this);\n context.font = computedStyles.font;\n\n const letterSpacing = cssPixelValue(computedStyles.letterSpacing);\n const wordSpacing = cssPixelValue(computedStyles.wordSpacing);\n const graphemeSegmenter = new Intl.Segmenter(undefined, { granularity: 'grapheme' });\n\n return text => this.#measureText(text, { context, letterSpacing, wordSpacing, graphemeSegmenter });\n }\n\n #measureText(\n text: string,\n {\n context,\n letterSpacing,\n wordSpacing,\n graphemeSegmenter\n }: {\n context: CanvasRenderingContext2D;\n letterSpacing: number;\n wordSpacing: number;\n graphemeSegmenter: Intl.Segmenter;\n }\n ): number {\n const graphemeSegments = graphemeSegmenter.segment(text);\n const whitespaceCount = Array.from(text.matchAll(/\\s/gu)).length;\n\n return (\n context.measureText(text).width +\n Math.max(0, Array.from(graphemeSegments).length - 1) * letterSpacing +\n whitespaceCount * wordSpacing\n );\n }\n\n get #textMeasurementContext(): CanvasRenderingContext2D | null {\n if (this.#measurementContext === undefined) {\n this.#measurementContext = this.ownerDocument?.createElement('canvas').getContext('2d') ?? null;\n }\n\n return this.#measurementContext;\n }\n\n #observeAvailableWidth(): void {\n if (typeof ResizeObserver === 'undefined') return;\n\n this.#resizeObserver ??= new ResizeObserver(() => {\n if (this.isConnected) this.requestUpdate();\n });\n this.#resizeObserver.disconnect();\n this.#resizeObserver.observe(this);\n }\n\n #onSlotChange = (): void => {\n this.requestUpdate();\n };\n}\n\nfunction getContentWidth(element: HTMLElement, view: Window): number {\n const computedStyles = view.getComputedStyle(element);\n return Math.max(\n 0,\n element.getBoundingClientRect().width -\n cssPixelValue(computedStyles.borderInlineStartWidth) -\n cssPixelValue(computedStyles.borderInlineEndWidth) -\n cssPixelValue(computedStyles.paddingInlineStart) -\n cssPixelValue(computedStyles.paddingInlineEnd)\n );\n}\n\nfunction cssPixelValue(value: string): number {\n const parsed = Number.parseFloat(value);\n return Number.isFinite(parsed) ? parsed : 0;\n}\n\nfunction isDefaultSlotNode(node: Node): boolean {\n return !isElementNode(node) || !node.getAttribute('slot');\n}\n\nfunction isElementNode(node: Node): node is Element {\n return node.nodeType === 1;\n}\n"],"mappings":";;;;;;;;;AAoBO,IAAA,IAAA,cAA6B,EAAW;;+BAWqC,yBAKG,yBAKlB,uBAKb,mBAwH1B;GAC1B,KAAK,cAAc;EACrB;;;gBAnJgB,EAAU,CAAC,CAAM,CAAC;;;kBAEP;GACzB,KAAK;GACL,SAAS;EACX;;CAyBA;CACA;CAEA,oBAAmC;EAIjC,AAHA,MAAM,kBAAkB,GACxB,EAAgB,IAAI,GACpB,KAAKA,GAAuB,GAC5B,KAAK,cAAc;CACrB;CAEA,uBAAsC;EAEpC,AADA,MAAM,qBAAqB,GAC3B,KAAKC,IAAiB,WAAW;CACnC;CAEA,wBAA8B;EAE5B,AADA,KAAKD,GAAuB,GAC5B,KAAK,cAAc;CACrB;CAEA,SAAkC;EAChC,IAAM,IAAO,KAAKE,IACZ,IAAgB,KAAKC,GAAY,CAAI;EAK3C,OAHI,MAAkB,IACjB,KAAK,gBAAgB,OAAO,IADL,KAAK,QAAQ,GAGlC,CAAI,0CAA0C,EAAc,8CAA8C,EAAK,4BAA2B,KAAKC,GAAc;CACtK;CAEA,IAAIF,KAAuB;EACzB,IAAM,IAAO,KAAK,YAAY,cAA+B,kBAAkB;EAC/E,IAAI,GAAM,OAAO,EAAsB,EAAK,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C3B"}
1
+ {"version":3,"file":"format-truncate2.js","names":[],"sources":["../../src/format-truncate/format-truncate.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 { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { attachInternals, useStyles, typeSSR } from '@nvidia-elements/core/internal';\nimport { normalizeTruncateString, normalizeTruncateText, truncateText } from './utils.js';\nimport styles from './format-truncate.css?inline';\n\n/**\n * @element nve-format-truncate\n * @description Truncates text at its start, center, or end while preserving the full text for assistive technology.\n * @documentation https://nvidia.github.io/elements/docs/elements/format-truncate/\n * @since 0.0.0\n * @entrypoint \\@nvidia-elements/core/format-truncate\n * @slot - Text to truncate. The component flattens, trims, and normalizes mixed text and element nodes.\n * @beta\n */\n@typeSSR()\nexport class FormatTruncate extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-format-truncate',\n version: '0.0.0'\n };\n\n /**\n * Location of the ellipsis. Use start or end to preserve one edge, or center to preserve both edges.\n */\n @property({ type: String, reflect: true }) position: 'start' | 'center' | 'end' = 'start';\n\n /**\n * Text unit used for center truncation. Character preserves graphemes, word preserves words, and path preserves path segments.\n */\n @property({ type: String, reflect: true }) strategy: 'character' | 'word' | 'path' = 'character';\n\n /**\n * Edge favored by center truncation. The favored edge keeps at least the configured number of units.\n */\n @property({ type: String, reflect: true }) bias: 'start' | 'end' = 'end';\n\n /**\n * Number of strategy units retained at the biased edge during center truncation.\n */\n @property({ type: Number, reflect: true }) preserve = 6;\n\n /** @private */\n declare _internals: ElementInternals;\n\n #measurementContext?: CanvasRenderingContext2D | null;\n #resizeObserver?: ResizeObserver;\n\n override connectedCallback(): void {\n super.connectedCallback();\n attachInternals(this);\n this.#observeAvailableWidth();\n this.requestUpdate();\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.#resizeObserver?.disconnect();\n }\n\n connectedMoveCallback(): void {\n this.#observeAvailableWidth();\n this.requestUpdate();\n }\n\n override render(): TemplateResult {\n const text = this.#slottedText;\n const truncatedText = this.#renderText(text);\n\n if (truncatedText !== text) this.title = text;\n else this.removeAttribute('title');\n\n return html`<span internal-host aria-hidden=\"true\">${truncatedText}</span><span sizing-host aria-hidden=\"true\">${text}</span><slot @slotchange=${this.#onSlotChange}></slot>`;\n }\n\n get #slottedText(): string {\n const slot = this.shadowRoot?.querySelector<HTMLSlotElement>('slot:not([name])');\n if (slot) return normalizeTruncateText(slot.assignedNodes({ flatten: true }));\n\n const nodes = Array.from(this.childNodes ?? []).filter(isDefaultSlotNode);\n return nodes.length ? normalizeTruncateText(nodes) : normalizeTruncateString(this.textContent ?? '');\n }\n\n #renderText(text: string): string {\n const measureText = this.#createTextMeasurer();\n\n return truncateText(text, {\n position: this.position,\n strategy: this.strategy,\n bias: this.bias,\n preserve: this.preserve,\n availableWidth: this.#availableWidth,\n measureText\n });\n }\n\n get #availableWidth(): number {\n const view = this.ownerDocument?.defaultView;\n if (!view || !this.shadowRoot?.querySelector('[internal-host]')) return Number.POSITIVE_INFINITY;\n\n return getContentWidth(this, view);\n }\n\n #createTextMeasurer(): (text: string) => number {\n const view = this.ownerDocument?.defaultView;\n const context = this.#textMeasurementContext;\n if (!view || !context) return () => 0;\n\n const computedStyles = view.getComputedStyle(this);\n context.font = computedStyles.font;\n\n const letterSpacing = cssPixelValue(computedStyles.letterSpacing);\n const wordSpacing = cssPixelValue(computedStyles.wordSpacing);\n const graphemeSegmenter = new Intl.Segmenter(undefined, { granularity: 'grapheme' });\n\n return text => this.#measureText(text, { context, letterSpacing, wordSpacing, graphemeSegmenter });\n }\n\n #measureText(\n text: string,\n {\n context,\n letterSpacing,\n wordSpacing,\n graphemeSegmenter\n }: {\n context: CanvasRenderingContext2D;\n letterSpacing: number;\n wordSpacing: number;\n graphemeSegmenter: Intl.Segmenter;\n }\n ): number {\n const graphemeSegments = graphemeSegmenter.segment(text);\n const whitespaceCount = Array.from(text.matchAll(/\\s/gu)).length;\n\n return (\n context.measureText(text).width +\n Math.max(0, Array.from(graphemeSegments).length - 1) * letterSpacing +\n whitespaceCount * wordSpacing\n );\n }\n\n get #textMeasurementContext(): CanvasRenderingContext2D | null {\n if (this.#measurementContext === undefined) {\n this.#measurementContext = this.ownerDocument?.createElement('canvas').getContext('2d') ?? null;\n }\n\n return this.#measurementContext;\n }\n\n #observeAvailableWidth(): void {\n if (typeof ResizeObserver === 'undefined') return;\n\n this.#resizeObserver ??= new ResizeObserver(() => {\n if (this.isConnected) this.requestUpdate();\n });\n this.#resizeObserver.disconnect();\n this.#resizeObserver.observe(this);\n }\n\n #onSlotChange = (): void => {\n this.requestUpdate();\n };\n}\n\nfunction getContentWidth(element: HTMLElement, view: Window): number {\n const computedStyles = view.getComputedStyle(element);\n return Math.max(\n 0,\n element.getBoundingClientRect().width -\n cssPixelValue(computedStyles.borderInlineStartWidth) -\n cssPixelValue(computedStyles.borderInlineEndWidth) -\n cssPixelValue(computedStyles.paddingInlineStart) -\n cssPixelValue(computedStyles.paddingInlineEnd)\n );\n}\n\nfunction cssPixelValue(value: string): number {\n const parsed = Number.parseFloat(value);\n return Number.isFinite(parsed) ? parsed : 0;\n}\n\nfunction isDefaultSlotNode(node: Node): boolean {\n return !isElementNode(node) || !node.getAttribute('slot');\n}\n\nfunction isElementNode(node: Node): node is Element {\n return node.nodeType === 1;\n}\n"],"mappings":";;;;;;;;;AAoBO,IAAM,IAAN,cAA6B,EAAW;;EAkJjB,aAvIsD,KAAA,WAAA,SAKG,KAAA,WAAA,aAKlB,KAAA,OAAA,OAKb,KAAA,WAAA,GAwH1B,KAAA,WAAA;GAC1B,KAAK,cAAc;EACrB;;;EAnJgB,KAAA,SAAA,EAAU,CAAC,CAAM,CAAC;;;EAEP,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;CAyBA;CACA;CAEA,oBAAmC;EAIjC,AAHA,MA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,KAAA,CAAA,GA3B1C,IAAA,EAAA,CAAA,EAAQ,CAAA,GAAA,CAAA;AAwJT,SAAS,EAAgB,GAAsB,GAAsB;CACnE,IAAM,IAAiB,EAAK,iBAAiB,CAAO;CACpD,OAAO,KAAK,IACV,GACA,EAAQ,sBAAsB,CAAC,CAAC,QAC9B,EAAc,EAAe,sBAAsB,IACnD,EAAc,EAAe,oBAAoB,IACjD,EAAc,EAAe,kBAAkB,IAC/C,EAAc,EAAe,gBAAgB,CACjD;AACF;AAEA,SAAS,EAAc,GAAuB;CAC5C,IAAM,IAAS,OAAO,WAAW,CAAK;CACtC,OAAO,OAAO,SAAS,CAAM,IAAI,IAAS;AAC5C;AAEA,SAAS,EAAkB,GAAqB;CAC9C,OAAO,CAAC,EAAc,CAAI,KAAK,CAAC,EAAK,aAAa,MAAM;AAC1D;AAEA,SAAS,EAAc,GAA6B;CAClD,OAAO,EAAK,aAAa;AAC3B"}
@@ -4,7 +4,7 @@ import { associateAriaDescribedBy as r, associateDataList as i, associateLabel a
4
4
  import { typeSSR as s } from "../../internal/controllers/type-ssr.controller.js";
5
5
  import { hostAttr as c } from "../../internal/decorators/host-attr.js";
6
6
  import { useStyles as l } from "../../internal/styles/index.js";
7
- import u from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
7
+ import u from "../../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorate.js";
8
8
  import { inputQuery as d, setupControlStates as f, setupControlStatusStates as p, setupControlValidationStates as m } from "../utils/states.js";
9
9
  import { setupControlLayoutStates as h } from "../utils/layout.js";
10
10
  import g from "./control.global.js";
@@ -48,7 +48,7 @@ var C = class extends v {
48
48
  static {
49
49
  this.metadata = {
50
50
  tag: "nve-control",
51
- version: "2.7.3"
51
+ version: "2.8.0"
52
52
  };
53
53
  }
54
54
  render() {
@@ -1 +1 @@
1
- {"version":3,"file":"control2.js","names":["#i18nController","#updateStyleStates","#observers","#setupInput","#updateAssociations","#label","#messages","#input","#onRootSlotchange","#onInputSlotchange","#resetInputValue","#resetSelectValue","#isCheckedInput","#polyfillShowPicker","#assignLabel"],"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 as ControlInput);\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,IAAA,IAAA,cAAsB,EAAW;;8BAYuC,sBAGM,cAE3C,IAAI,EAAqB,IAAI,eAGlC,KAAKA,GAAgB,wBA6CO,cAKW,CAAC,6BAE5C,oBA8CL;GAGxB,AAFA,KAAKC,GAAmB,GAEpB,KAAK,SAAS,KAAKC,GAAW,WAAW,KAC3C,KAAKC,GAAY;EAErB,mBAmD2B;GAEzB,AADA,KAAKF,GAAmB,GACxB,KAAKG,GAAoB;EAC3B;;CAjKA;CAQA,IAAIC,KAAS;EACX,OAAO,KAAK,YACR,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AA,CAAA,UAlEvC,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 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 as ControlInput);\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,W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B,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,6 +1,6 @@
1
1
  import { associateAriaDescribedBy as e, associateAriaLabel as t, associateControlGroup as n, attachInternals as r } from "../../internal/utils/a11y.js";
2
2
  import { useStyles as i } from "../../internal/styles/index.js";
3
- import a from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
3
+ import a from "../../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorate.js";
4
4
  import { inputQuery as o, setupControlGroupStates as s, setupControlStatusStates as c } from "../utils/states.js";
5
5
  import { setupControlLayoutStates as l } from "../utils/layout.js";
6
6
  import u from "./control-group.js";
@@ -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.7.3"
27
+ version: "2.8.0"
28
28
  };
29
29
  }
30
30
  render() {
@@ -1 +1 @@
1
- {"version":3,"file":"control-group2.js","names":["#messages","#observers","#updateAssociations","#assignLabel"],"sources":["../../../src/forms/control-group/control-group.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 {\n attachInternals,\n useStyles,\n associateAriaLabel,\n associateAriaDescribedBy,\n associateControlGroup\n} from '@nvidia-elements/core/internal';\nimport type { ControlMessage } from '../control-message/control-message.js';\nimport {\n setupControlStatusStates,\n setupControlGroupStates,\n inputQuery,\n type ControlStateCleanup\n} from '../utils/states.js';\nimport { setupControlLayoutStates } from '../utils/layout.js';\nimport styles from './control-group.css?inline';\n\n/**\n * @element nve-control-group\n * @description Groups many related form controls under a shared label and validation context for semantically linked inputs.\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 elements\n * @cssprop --color\n * @cssprop --label-color\n * @cssprop --label-text-transform\n * @cssprop --label-font-weight\n * @cssprop --label-font-size\n * @aria https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals\n * @package true\n */\nexport class ControlGroup extends LitElement {\n /** Set each slotted control + label + control message layout */\n @property({ type: String, reflect: true }) layout:\n | 'vertical'\n | 'vertical-inline'\n | 'horizontal'\n | 'horizontal-inline';\n\n /** Set the visual prominence of the control group */\n @property({ type: String, reflect: true }) prominence: 'muted';\n\n get label() {\n return this.querySelector?.<HTMLLabelElement>('label');\n }\n\n get inputs() {\n return this.querySelectorAll ? Array.from(this.querySelectorAll<HTMLInputElement>(inputQuery)) : [];\n }\n\n get #messages() {\n return this.querySelectorAll ? Array.from(this.querySelectorAll<ControlMessage>('nve-control-message')) : [];\n }\n\n #observers: (MutationObserver | ResizeObserver | ControlStateCleanup)[] = [];\n\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-control-group',\n version: '0.0.0'\n };\n\n /** @private */\n declare _internals: ElementInternals;\n\n render() {\n return html`\n <div internal-host class=\"${this.#messages.length ? '' : 'no-messages'} ${this.label ? '' : 'no-label'}\">\n <slot name=\"label\"></slot>\n <slot class=\"input-slot\"></slot>\n <slot name=\"messages\"></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'group';\n }\n\n firstUpdated(props: PropertyValues<this>) {\n super.firstUpdated(props);\n this.#observers = [\n setupControlGroupStates(this),\n setupControlLayoutStates(this),\n ...setupControlStatusStates(this, this.#messages)\n ];\n this.#updateAssociations();\n this.shadowRoot!.addEventListener('slotchange', () => this.#updateAssociations());\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.#observers.forEach(observer => observer.disconnect());\n }\n\n #updateAssociations() {\n this.#assignLabel();\n associateAriaLabel(this.label as HTMLElement, this);\n associateAriaDescribedBy(Array.from(this.querySelectorAll<ControlMessage>('nve-control-message')), this);\n associateControlGroup(Array.from(this.inputs));\n }\n\n #assignLabel() {\n if (this.label) {\n this.label.slot = 'label';\n }\n }\n}\n"],"mappings":";;;;;;;;;AAsCA,IAAa,IAAb,cAAkC,EAAW;CAW3C,IAAI,QAAQ;EACV,OAAO,KAAK,gBAAkC,OAAO;CACvD;CAEA,IAAI,SAAS;EACX,OAAO,KAAK,mBAAmB,MAAM,KAAK,KAAK,iBAAmC,CAAU,CAAC,IAAI,CAAC;CACpG;CAEA,IAAIA,KAAY;EACd,OAAO,KAAK,mBAAmB,MAAM,KAAK,KAAK,iBAAiC,qBAAqB,CAAC,IAAI,CAAC;CAC7G;CAEA,KAA0E,CAAC;;gBAE3D,EAAU,CAAC,CAAM,CAAC;;;kBAEP;GACzB,KAAK;GACL,SAAS;EACX;;CAKA,SAAS;EACP,OAAO,CAAI,6BACmB,KAAKA,GAAU,SAAS,KAAK,cAAc,GAAG,KAAK,QAAQ,KAAK,WAAW;CAM3G;CAEA,oBAAoB;EAGlB,AAFA,MAAM,kBAAkB,GACxB,EAAgB,IAAI,GACpB,KAAK,WAAW,OAAO;CACzB;CAEA,aAAa,GAA6B;EAQxC,AAPA,MAAM,aAAa,CAAK,GACxB,KAAKC,KAAa;GAChB,EAAwB,IAAI;GAC5B,EAAyB,IAAI;GAC7B,GAAG,EAAyB,MAAM,KAAKD,EAAS;EAClD,GACA,KAAKE,GAAoB,GACzB,KAAK,WAAY,iBAAiB,oBAAoB,KAAKA,GAAoB,CAAC;CAClF;CAEA,uBAAuB;EAErB,AADA,MAAM,qBAAqB,GAC3B,KAAKD,GAAW,SAAQ,MAAY,EAAS,WAAW,CAAC;CAC3D;CAEA,KAAsB;EAIpB,AAHA,KAAKE,GAAa,GAClB,EAAmB,KAAK,OAAsB,IAAI,GAClD,EAAyB,MAAM,KAAK,KAAK,iBAAiC,qBAAqB,CAAC,GAAG,IAAI,GACvG,EAAsB,MAAM,KAAK,KAAK,MAAM,CAAC;CAC/C;CAEA,KAAe;EACb,AAAI,KAAK,UACP,KAAK,MAAM,OAAO;CAEtB;AACF;GA7EG,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,UAAA,KAAA,CAAA,MAOxC,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,cAAA,KAAA,CAAA"}
1
+ {"version":3,"file":"control-group2.js","names":[],"sources":["../../../src/forms/control-group/control-group.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 {\n attachInternals,\n useStyles,\n associateAriaLabel,\n associateAriaDescribedBy,\n associateControlGroup\n} from '@nvidia-elements/core/internal';\nimport type { ControlMessage } from '../control-message/control-message.js';\nimport {\n setupControlStatusStates,\n setupControlGroupStates,\n inputQuery,\n type ControlStateCleanup\n} from '../utils/states.js';\nimport { setupControlLayoutStates } from '../utils/layout.js';\nimport styles from './control-group.css?inline';\n\n/**\n * @element nve-control-group\n * @description Groups many related form controls under a shared label and validation context for semantically linked inputs.\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 elements\n * @cssprop --color\n * @cssprop --label-color\n * @cssprop --label-text-transform\n * @cssprop --label-font-weight\n * @cssprop --label-font-size\n * @aria https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals\n * @package true\n */\nexport class ControlGroup extends LitElement {\n /** Set each slotted control + label + control message layout */\n @property({ type: String, reflect: true }) layout:\n | 'vertical'\n | 'vertical-inline'\n | 'horizontal'\n | 'horizontal-inline';\n\n /** Set the visual prominence of the control group */\n @property({ type: String, reflect: true }) prominence: 'muted';\n\n get label() {\n return this.querySelector?.<HTMLLabelElement>('label');\n }\n\n get inputs() {\n return this.querySelectorAll ? Array.from(this.querySelectorAll<HTMLInputElement>(inputQuery)) : [];\n }\n\n get #messages() {\n return this.querySelectorAll ? Array.from(this.querySelectorAll<ControlMessage>('nve-control-message')) : [];\n }\n\n #observers: (MutationObserver | ResizeObserver | ControlStateCleanup)[] = [];\n\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-control-group',\n version: '0.0.0'\n };\n\n /** @private */\n declare _internals: ElementInternals;\n\n render() {\n return html`\n <div internal-host class=\"${this.#messages.length ? '' : 'no-messages'} ${this.label ? '' : 'no-label'}\">\n <slot name=\"label\"></slot>\n <slot class=\"input-slot\"></slot>\n <slot name=\"messages\"></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'group';\n }\n\n firstUpdated(props: PropertyValues<this>) {\n super.firstUpdated(props);\n this.#observers = [\n setupControlGroupStates(this),\n setupControlLayoutStates(this),\n ...setupControlStatusStates(this, this.#messages)\n ];\n this.#updateAssociations();\n this.shadowRoot!.addEventListener('slotchange', () => this.#updateAssociations());\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.#observers.forEach(observer => observer.disconnect());\n }\n\n #updateAssociations() {\n this.#assignLabel();\n associateAriaLabel(this.label as HTMLElement, this);\n associateAriaDescribedBy(Array.from(this.querySelectorAll<ControlMessage>('nve-control-message')), this);\n associateControlGroup(Array.from(this.inputs));\n }\n\n #assignLabel() {\n if (this.label) {\n this.label.slot = 'label';\n }\n }\n}\n"],"mappings":";;;;;;;;;AAsCA,IAAa,IAAb,cAAkC,EAAW;CAW3C,IAAI,QAAQ;EACV,OAAO,KAAK,gBAAkC,OAAO;CACvD;CAEA,IAAI,SAAS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AAK,CAAC,CAAA,GAAA,EAAA,WAAA,cAAA,KAAA,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import { hostAttr as e } from "../../internal/decorators/host-attr.js";
2
2
  import { scopedRegistry as t } from "../../internal/decorators/scoped-registry.js";
3
3
  import { useStyles as n } from "../../internal/styles/index.js";
4
- import r from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
4
+ import r from "../../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorate.js";
5
5
  import { Icon as i } from "../../icon/icon2.js";
6
6
  import a from "./control-message.js";
7
7
  import { LitElement as o, html as s } from "lit";
@@ -23,7 +23,7 @@ var l = {
23
23
  static {
24
24
  this.metadata = {
25
25
  tag: "nve-control-message",
26
- version: "2.7.3"
26
+ version: "2.8.0"
27
27
  };
28
28
  }
29
29
  static {
@@ -1 +1 @@
1
- {"version":3,"file":"control-message2.js","names":[],"sources":["../../../src/forms/control-message/control-message.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { hostAttr, scopedRegistry, useStyles } from '@nvidia-elements/core/internal';\nimport { Icon } from '@nvidia-elements/core/icon';\nimport { type ValidityStateError } from '../utils/types.js';\nimport styles from './control-message.css?inline';\n\nconst statusIcons = {\n undefined: 'information-circle',\n disabled: 'information-circle',\n warning: 'exclamation-triangle',\n success: 'checkmark-circle',\n error: 'exclamation-circle'\n} as const;\n\n/**\n * @element nve-control-message\n * @description Defining a Validity State on a control-message allows messages to show conditionally based on the current HTML5 validity state.\n * @documentation https://nvidia.github.io/elements/docs/elements/control/\n * @since 0.3.0\n * @entrypoint \\@nvidia-elements/core/forms\n * @slot - Validation or supporting message text for the associated control.\n * @slot icon - override the icon with a custom icon\n * @cssprop --color\n * @cssprop --font-weight\n * @cssprop --font-size\n * @csspart icon - The icon element\n * @aria https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals\n * @package true\n */\n@scopedRegistry()\nexport class ControlMessage extends LitElement {\n /**\n * Visual treatment for current form control validation status\n */\n @property({ type: String, reflect: true }) status?: 'warning' | 'error' | 'success' | 'disabled';\n\n /**\n * Validation error code for current form control\n * https://developer.mozilla.org/en-US/docs/Web/API/ValidityState\n */\n @property({ type: String, reflect: true }) error: ValidityStateError | null = null;\n\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-control-message',\n version: '0.0.0'\n };\n\n static elementDefinitions = {\n [Icon.metadata.tag]: Icon\n };\n\n /** @private */\n @hostAttr() slot = 'messages';\n\n render() {\n return html`\n <div internal-host>\n <slot name=\"icon\"><nve-icon part=\"icon\" name=${this.error ? statusIcons.error : statusIcons[this.status!]}></nve-icon></slot>\n <slot></slot>\n </div>\n `;\n }\n}\n"],"mappings":";;;;;;;;;AAUA,IAAM,IAAc;CAClB,WAAW;CACX,UAAU;CACV,SAAS;CACT,SAAS;CACT,OAAO;AACT,GAkBO,IAAA,cAA6B,EAAW;;4BAUiC,kBAc3D;;;gBAZH,EAAU,CAAC,CAAM,CAAC;;;kBAEP;GACzB,KAAK;GACL,SAAS;EACX;;;4BAE4B,GACzB,EAAK,SAAS,MAAM,EACvB;;CAKA,SAAS;EACP,OAAO,CAAI,oEAEwC,KAAK,QAAQ,EAAY,QAAQ,EAAY,KAAK,QAAS;CAIhH;AACF;GA9BG,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,UAAA,KAAA,CAAA,MAMxC,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,SAAA,KAAA,CAAA,MAcxC,EAAS,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA,UAzBX,EAAe,CAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"control-message2.js","names":[],"sources":["../../../src/forms/control-message/control-message.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { hostAttr, scopedRegistry, useStyles } from '@nvidia-elements/core/internal';\nimport { Icon } from '@nvidia-elements/core/icon';\nimport { type ValidityStateError } from '../utils/types.js';\nimport styles from './control-message.css?inline';\n\nconst statusIcons = {\n undefined: 'information-circle',\n disabled: 'information-circle',\n warning: 'exclamation-triangle',\n success: 'checkmark-circle',\n error: 'exclamation-circle'\n} as const;\n\n/**\n * @element nve-control-message\n * @description Defining a Validity State on a control-message allows messages to show conditionally based on the current HTML5 validity state.\n * @documentation https://nvidia.github.io/elements/docs/elements/control/\n * @since 0.3.0\n * @entrypoint \\@nvidia-elements/core/forms\n * @slot - Validation or supporting message text for the associated control.\n * @slot icon - override the icon with a custom icon\n * @cssprop --color\n * @cssprop --font-weight\n * @cssprop --font-size\n * @csspart icon - The icon element\n * @aria https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals\n * @package true\n */\n@scopedRegistry()\nexport class ControlMessage extends LitElement {\n /**\n * Visual treatment for current form control validation status\n */\n @property({ type: String, reflect: true }) status?: 'warning' | 'error' | 'success' | 'disabled';\n\n /**\n * Validation error code for current form control\n * https://developer.mozilla.org/en-US/docs/Web/API/ValidityState\n */\n @property({ type: String, reflect: true }) error: ValidityStateError | null = null;\n\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-control-message',\n version: '0.0.0'\n };\n\n static elementDefinitions = {\n [Icon.metadata.tag]: Icon\n };\n\n /** @private */\n @hostAttr() slot = 'messages';\n\n render() {\n return html`\n <div internal-host>\n <slot name=\"icon\"><nve-icon part=\"icon\" name=${this.error ? statusIcons.error : statusIcons[this.status!]}></nve-icon></slot>\n <slot></slot>\n </div>\n `;\n }\n}\n"],"mappings":";;;;;;;;;AAUA,IAAM,IAAc;CAClB,WAAW;CACX,UAAU;CACV,SAAS;CACT,SAAS;CACT,OAAO;AACT,GAkBa,IAAN,cAA6B,EAAW;;EAwB1B,aAd2D,KAAA,QAAA,MAc3D,KAAA,OAAA;;;EAZH,KAAA,SAAA,EAAU,CAAC,CAAM,CAAC;;;EAEP,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;;EAE4B,KAAA,qBAAA,GACzB,EAAK,SAAS,MAAM,EACvB;;CAKA,SAAS;EACP,OAAO,CAAI,oEAEwC,KAAK,QAAQ,EAAY,QAAQ,EAAY,KAAK,QAAS;CAIhH;AACF;AA9BG,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,UAAA,KAAA,CAAA,GAMxC,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,SAAA,KAAA,CAAA,GAcxC,EAAA,CAAA,EAAS,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA,GAzBX,IAAA,EAAA,CAAA,EAAe,CAAA,GAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"validation.examples.js","names":["#submit","#input"],"sources":["../../src/forms/validation.examples.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, unsafeCSS, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators/custom-element.js';\nimport { state } from 'lit/decorators/state.js';\nimport { query } from 'lit/decorators/query.js';\nimport layout from '@nvidia-elements/styles/layout.css?inline';\nimport '@nvidia-elements/core/forms/define.js';\nimport '@nvidia-elements/core/button/define.js';\nimport '@nvidia-elements/core/alert/define.js';\nimport '@nvidia-elements/core/input/define.js';\nimport '@nvidia-elements/core/password/define.js';\n\nexport default {\n title: 'Elements/Forms',\n component: 'forms'\n};\n\n/**\n * @summary Use real-time validation with contextual error messages to disable submit until form is valid.\n * @tags pattern\n */\nexport const LoginForm = {\n render() {\n return html`\n<form id=\"validation\" nve-layout=\"column gap:md\" style=\"max-width: 350px;\">\n <nve-input>\n <label>email</label>\n <input type=\"email\" name=\"email\" required pattern=\".+@nvidia\\.com\" autocomplete=\"off\" />\n <nve-control-message error=\"valueMissing\">required</nve-control-message>\n <nve-control-message error=\"patternMismatch\">invalid NVIDIA email</nve-control-message>\n </nve-input>\n\n <nve-password>\n <label>password</label>\n <input type=\"password\" name=\"password\" required minlength=\"6\" autocomplete=\"off\" />\n <nve-control-message error=\"valueMissing\">required</nve-control-message>\n <nve-control-message error=\"tooShort\">minimum length is 6 characters</nve-control-message>\n </nve-password>\n\n <nve-button disabled>login to account</nve-button>\n\n <nve-alert-group hidden status=\"success\">\n <nve-alert></nve-alert>\n </nve-alert-group>\n</form>\n<script type=\"module\">\n const form = document.querySelector('form#validation');\n const alertGroup = document.querySelector('#validation nve-alert-group');\n const alert = document.querySelector('#validation nve-alert');\n\n form.addEventListener('submit', e => {\n e.preventDefault();\n const { email, password } = Object.fromEntries(new FormData(form));\n alert.innerText = email + ' / ' + password;\n alertGroup.hidden = false;\n });\n\n form.addEventListener('input', e => {\n form.querySelector('nve-button').disabled = form.matches(':invalid');\n });\n</script>\n `\n }\n}\n\n/**\n * @summary Login form with grouped error display showing all validation issues together after submission attempt.\n */\nexport const ErrorGroup = {\n render: () => html`\n<form nve-layout=\"column gap:md\" style=\"max-width: 350px;\" novalidate>\n <nve-input>\n <label>email</label>\n <input type=\"email\" name=\"email\" required pattern=\".+@nvidia\\.com\" autocomplete=\"off\" />\n <nve-control-message status=\"error\">invalid email</nve-control-message>\n </nve-input>\n\n <nve-password>\n <label>password</label>\n <input type=\"password\" name=\"password\" required minlength=\"6\" autocomplete=\"off\" />\n <nve-control-message status=\"error\">minimum length is 6 characters</nve-control-message>\n </nve-password>\n\n <nve-button>login to account</nve-button>\n\n <nve-alert-group status=\"danger\">\n <nve-alert>invalid email</nve-alert>\n <nve-alert>password required</nve-alert>\n </nve-alert-group>\n</form>\n `\n}\n\n/**\n * @summary Login form example of success feedback with positive confirmation messages for valid input and successful form submission.\n */\nexport const SuccessGroup = {\n render: () => {\n return html`\n<form nve-layout=\"column gap:md\" style=\"max-width: 350px;\" novalidate>\n <nve-input>\n <label>username</label>\n <input type=\"email\" name=\"email\" required pattern=\".+@nvidia\\.com\" autocomplete=\"off\" />\n <nve-control-message status=\"success\">username available</nve-control-message>\n </nve-input>\n\n <nve-password>\n <label>password</label>\n <input type=\"password\" name=\"password\" required minlength=\"6\" autocomplete=\"off\" />\n </nve-password>\n\n <nve-button>login to account</nve-button>\n\n <nve-alert-group status=\"success\">\n <nve-alert closable>account created</nve-alert>\n </nve-alert-group>\n</form>\n`\n }\n}\n\n/**\n * @summary Form reset functionality allowing users to clear individual fields or reset the entire form.\n */\nexport const ResetForm = {\n render: () => {\n return html`\n<form nve-layout=\"column gap:md\" style=\"max-width: 350px;\">\n <nve-input>\n <label>email</label>\n <input type=\"email\" name=\"email\" required pattern=\".+@nvidia\\.com\" autocomplete=\"off\" value=\"test@nvidia.com\" />\n <nve-icon-button aria-label=\"reset\" icon-name=\"cancel\" container=\"flat\" type=\"button\"></nve-icon-button>\n <nve-control-message error=\"valueMissing\">required</nve-control-message>\n <nve-control-message error=\"patternMismatch\">invalid NVIDIA email</nve-control-message>\n </nve-input>\n\n <nve-password>\n <label>password</label>\n <input type=\"password\" name=\"password\" required minlength=\"6\" autocomplete=\"off\" />\n <nve-control-message error=\"valueMissing\">required</nve-control-message>\n </nve-password>\n\n <nve-button type=\"button\">reset form</nve-button>\n</form>\n<script type=\"module\">\n const form = document.querySelector('form');\n const input = form.querySelector('nve-input');\n const resetInput = form.querySelector('nve-icon-button[icon-name=\"cancel\"]');\n const resetForm = form.querySelector('nve-button');\n\n resetInput.addEventListener('click', e => input.reset());\n resetForm.addEventListener('click', e => form.reset());\n form.addEventListener('reset', e => console.log(e));\n</script>\n`\n }\n}\n\n@customElement('app-login')\nexport class AppLogin extends LitElement {\n static styles = [unsafeCSS(layout)];\n\n @query('form') form: HTMLFormElement;\n\n @state() formValues = { email: '', password: '', remember: false };\n\n @state() showNotification = false;\n\n render() {\n return html`\n <form @submit=${e => this.#submit(e)} @input=${this.#input} nve-layout=\"column gap:lg align:stretch\" style=\"max-width: 400px\">\n <nve-input>\n <label>Email</label>\n <input .value=${this.formValues.email} type=\"email\" name=\"email\" autocomplete=\"off\" pattern=\".+@nvidia.com\" required />\n <nve-control-message error=\"valueMissing\">required</nve-control-message>\n <nve-control-message error=\"patternMismatch\">invalid NVIDIA email</nve-control-message>\n </nve-input>\n\n <nve-password>\n <label>Password</label>\n <input .value=${this.formValues.password} type=\"password\" name=\"password\" minlength=\"6\" required />\n <nve-control-message error=\"valueMissing\">required</nve-control-message>\n <nve-control-message error=\"tooShort\">minimum length is 6 characters</nve-control-message>\n </nve-password>\n\n <nve-checkbox>\n <label>Remember me</label>\n <input ?checked=${this.formValues.remember} type=\"checkbox\" name=\"remember\" />\n </nve-checkbox>\n\n <nve-button interaction=\"emphasis\">Login</nve-button>\n </form>\n <pre>${JSON.stringify(this.formValues, null, 2)}</pre>\n <nve-notification ?hidden=${!this.showNotification} @close=${() => this.showNotification = false} close-timeout=\"2000\" status=\"success\" position=\"top\">Submited: ${JSON.stringify(this.formValues)}</nve-notification>\n `;\n }\n\n #input() {\n this.formValues = Object.fromEntries(new FormData(this.form)) as unknown as { email: string, password: string, remember: boolean };\n }\n\n #submit(e) {\n e.preventDefault();\n if (this.form.reportValidity()) {\n this.showNotification = true\n }\n }\n}\n\n/**\n * @summary Forms work with LitElement\n * @tags test-case\n */\nexport const LitForms = {\n render: () => html`<app-login></app-login>`\n}\n"],"mappings":";AAGA,IAAA,IAAe"}
1
+ {"version":3,"file":"validation.examples.js","names":[],"sources":["../../src/forms/validation.examples.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, unsafeCSS, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators/custom-element.js';\nimport { state } from 'lit/decorators/state.js';\nimport { query } from 'lit/decorators/query.js';\nimport layout from '@nvidia-elements/styles/layout.css?inline';\nimport '@nvidia-elements/core/forms/define.js';\nimport '@nvidia-elements/core/button/define.js';\nimport '@nvidia-elements/core/alert/define.js';\nimport '@nvidia-elements/core/input/define.js';\nimport '@nvidia-elements/core/password/define.js';\n\nexport default {\n title: 'Elements/Forms',\n component: 'forms'\n};\n\n/**\n * @summary Use real-time validation with contextual error messages to disable submit until form is valid.\n * @tags pattern\n */\nexport const LoginForm = {\n render() {\n return html`\n<form id=\"validation\" nve-layout=\"column gap:md\" style=\"max-width: 350px;\">\n <nve-input>\n <label>email</label>\n <input type=\"email\" name=\"email\" required pattern=\".+@nvidia\\.com\" autocomplete=\"off\" />\n <nve-control-message error=\"valueMissing\">required</nve-control-message>\n <nve-control-message error=\"patternMismatch\">invalid NVIDIA email</nve-control-message>\n </nve-input>\n\n <nve-password>\n <label>password</label>\n <input type=\"password\" name=\"password\" required minlength=\"6\" autocomplete=\"off\" />\n <nve-control-message error=\"valueMissing\">required</nve-control-message>\n <nve-control-message error=\"tooShort\">minimum length is 6 characters</nve-control-message>\n </nve-password>\n\n <nve-button disabled>login to account</nve-button>\n\n <nve-alert-group hidden status=\"success\">\n <nve-alert></nve-alert>\n </nve-alert-group>\n</form>\n<script type=\"module\">\n const form = document.querySelector('form#validation');\n const alertGroup = document.querySelector('#validation nve-alert-group');\n const alert = document.querySelector('#validation nve-alert');\n\n form.addEventListener('submit', e => {\n e.preventDefault();\n const { email, password } = Object.fromEntries(new FormData(form));\n alert.innerText = email + ' / ' + password;\n alertGroup.hidden = false;\n });\n\n form.addEventListener('input', e => {\n form.querySelector('nve-button').disabled = form.matches(':invalid');\n });\n</script>\n `\n }\n}\n\n/**\n * @summary Login form with grouped error display showing all validation issues together after submission attempt.\n */\nexport const ErrorGroup = {\n render: () => html`\n<form nve-layout=\"column gap:md\" style=\"max-width: 350px;\" novalidate>\n <nve-input>\n <label>email</label>\n <input type=\"email\" name=\"email\" required pattern=\".+@nvidia\\.com\" autocomplete=\"off\" />\n <nve-control-message status=\"error\">invalid email</nve-control-message>\n </nve-input>\n\n <nve-password>\n <label>password</label>\n <input type=\"password\" name=\"password\" required minlength=\"6\" autocomplete=\"off\" />\n <nve-control-message status=\"error\">minimum length is 6 characters</nve-control-message>\n </nve-password>\n\n <nve-button>login to account</nve-button>\n\n <nve-alert-group status=\"danger\">\n <nve-alert>invalid email</nve-alert>\n <nve-alert>password required</nve-alert>\n </nve-alert-group>\n</form>\n `\n}\n\n/**\n * @summary Login form example of success feedback with positive confirmation messages for valid input and successful form submission.\n */\nexport const SuccessGroup = {\n render: () => {\n return html`\n<form nve-layout=\"column gap:md\" style=\"max-width: 350px;\" novalidate>\n <nve-input>\n <label>username</label>\n <input type=\"email\" name=\"email\" required pattern=\".+@nvidia\\.com\" autocomplete=\"off\" />\n <nve-control-message status=\"success\">username available</nve-control-message>\n </nve-input>\n\n <nve-password>\n <label>password</label>\n <input type=\"password\" name=\"password\" required minlength=\"6\" autocomplete=\"off\" />\n </nve-password>\n\n <nve-button>login to account</nve-button>\n\n <nve-alert-group status=\"success\">\n <nve-alert closable>account created</nve-alert>\n </nve-alert-group>\n</form>\n`\n }\n}\n\n/**\n * @summary Form reset functionality allowing users to clear individual fields or reset the entire form.\n */\nexport const ResetForm = {\n render: () => {\n return html`\n<form nve-layout=\"column gap:md\" style=\"max-width: 350px;\">\n <nve-input>\n <label>email</label>\n <input type=\"email\" name=\"email\" required pattern=\".+@nvidia\\.com\" autocomplete=\"off\" value=\"test@nvidia.com\" />\n <nve-icon-button aria-label=\"reset\" icon-name=\"cancel\" container=\"flat\" type=\"button\"></nve-icon-button>\n <nve-control-message error=\"valueMissing\">required</nve-control-message>\n <nve-control-message error=\"patternMismatch\">invalid NVIDIA email</nve-control-message>\n </nve-input>\n\n <nve-password>\n <label>password</label>\n <input type=\"password\" name=\"password\" required minlength=\"6\" autocomplete=\"off\" />\n <nve-control-message error=\"valueMissing\">required</nve-control-message>\n </nve-password>\n\n <nve-button type=\"button\">reset form</nve-button>\n</form>\n<script type=\"module\">\n const form = document.querySelector('form');\n const input = form.querySelector('nve-input');\n const resetInput = form.querySelector('nve-icon-button[icon-name=\"cancel\"]');\n const resetForm = form.querySelector('nve-button');\n\n resetInput.addEventListener('click', e => input.reset());\n resetForm.addEventListener('click', e => form.reset());\n form.addEventListener('reset', e => console.log(e));\n</script>\n`\n }\n}\n\n@customElement('app-login')\nexport class AppLogin extends LitElement {\n static styles = [unsafeCSS(layout)];\n\n @query('form') form: HTMLFormElement;\n\n @state() formValues = { email: '', password: '', remember: false };\n\n @state() showNotification = false;\n\n render() {\n return html`\n <form @submit=${e => this.#submit(e)} @input=${this.#input} nve-layout=\"column gap:lg align:stretch\" style=\"max-width: 400px\">\n <nve-input>\n <label>Email</label>\n <input .value=${this.formValues.email} type=\"email\" name=\"email\" autocomplete=\"off\" pattern=\".+@nvidia.com\" required />\n <nve-control-message error=\"valueMissing\">required</nve-control-message>\n <nve-control-message error=\"patternMismatch\">invalid NVIDIA email</nve-control-message>\n </nve-input>\n\n <nve-password>\n <label>Password</label>\n <input .value=${this.formValues.password} type=\"password\" name=\"password\" minlength=\"6\" required />\n <nve-control-message error=\"valueMissing\">required</nve-control-message>\n <nve-control-message error=\"tooShort\">minimum length is 6 characters</nve-control-message>\n </nve-password>\n\n <nve-checkbox>\n <label>Remember me</label>\n <input ?checked=${this.formValues.remember} type=\"checkbox\" name=\"remember\" />\n </nve-checkbox>\n\n <nve-button interaction=\"emphasis\">Login</nve-button>\n </form>\n <pre>${JSON.stringify(this.formValues, null, 2)}</pre>\n <nve-notification ?hidden=${!this.showNotification} @close=${() => this.showNotification = false} close-timeout=\"2000\" status=\"success\" position=\"top\">Submited: ${JSON.stringify(this.formValues)}</nve-notification>\n `;\n }\n\n #input() {\n this.formValues = Object.fromEntries(new FormData(this.form)) as unknown as { email: string, password: string, remember: boolean };\n }\n\n #submit(e) {\n e.preventDefault();\n if (this.form.reportValidity()) {\n this.showNotification = true\n }\n }\n}\n\n/**\n * @summary Forms work with LitElement\n * @tags test-case\n */\nexport const LitForms = {\n render: () => html`<app-login></app-login>`\n}\n"],"mappings":";AAGA,IAAA,IAAe"}
@@ -1,7 +1,7 @@
1
1
  import { I18nController as e } from "../internal/controllers/i18n.controller.js";
2
2
  import { attachInternals as t } from "../internal/utils/a11y.js";
3
3
  import { useStyles as n } from "../internal/styles/index.js";
4
- import r from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
4
+ import r from "../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorate.js";
5
5
  import i from "./gauge.js";
6
6
  import { LitElement as a, html as o } from "lit";
7
7
  import { property as s } from "lit/decorators/property.js";
@@ -40,7 +40,7 @@ var l = {
40
40
  static {
41
41
  this.metadata = {
42
42
  tag: "nve-gauge",
43
- version: "2.7.3"
43
+ version: "2.8.0"
44
44
  };
45
45
  }
46
46
  #e;
@@ -1 +1 @@
1
- {"version":3,"file":"gauge2.js","names":["#i18nController","#geometry","#paintedProgress","#normalizedThumb","#angleAtProgress","#pathAtProgress","#progressAnimation","#stopProgressAnimation","#targetProgress","#animateProgress","#normalizedValues","#animationTiming","#progressFrame","#pointAtAngle"],"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,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,IAuBa,IAAb,cAA2B,EAAW;;4BAYA,cAGD,mBAG6C,wBAMF,kBAKtC,IAAI,EAAqB,IAAI,eAGlC,KAAKA,GAAgB,gBAGrC,aAIF;;;gBAtCD,EAAU,CAAC,CAAM,CAAC;;;kBAEP;GACzB,KAAK;GACL,SAAS;EACX;;CAuBA;CAMA;CAEA;CAEA;CAEA,KAAoB;EAClB,IAAM,IAAY,KAAK,KACjB,IAAM,MAAc,KAAA,KAAa,OAAO,SAAS,CAAS,KAAK,IAAY,IAAI,IAAY;EAEjG,OAAO;GAAE,OADK,OAAO,SAAS,KAAK,KAAK,IAAI,KAAK,IAAI,KAAK,IAAI,KAAK,OAAO,CAAC,GAAG,CAAG,IAAI;GACrE;EAAI;CACtB;CAEA,SAAS;EACP,IAAM,IAAW,KAAKC,GAAU,GAC1B,IAAW,KAAKC,IAChB,IAAQ,KAAKC,GAAiB,GAC9B,IAAgB,KAAKC,GAAiB,GAAU,CAAQ,GACxD,IAA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AA,MAKxC,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA"}
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,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,IAuBa,IAAb,cAA2B,EAAW;;EAuCnB,aA3BmB,KAAA,QAAA,GAGD,KAAA,MAAA,KAG6C,KAAA,SAAA,WAMF,KAAA,QAAA,QAKtC,KA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AAK,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.7.3"
13
+ version: "2.8.0"
14
14
  };
15
15
  }
16
16
  render() {
@@ -1 +1 @@
1
- {"version":3,"file":"cell2.js","names":[],"sources":["../../../src/grid/cell/cell.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 { useStyles, attachInternals } from '@nvidia-elements/core/internal';\nimport styles from './cell.css?inline';\n\n/**\n * @element nve-grid-cell\n * @description Represents an individual data cell within a grid row, displaying content aligned to its parent column.\n * @documentation https://nvidia.github.io/elements/docs/elements/data-grid/\n * @since 0.11.0\n * @entrypoint \\@nvidia-elements/core/grid\n * @slot - Data or interactive controls displayed within the cell.\n * @cssprop --background\n * @cssprop --color\n * @cssprop --padding\n * @cssprop --min-height\n * @cssprop --min-width\n * @cssprop --font-weight\n * @cssprop --font-size\n * @cssprop --height\n * @cssprop --border-left\n * @cssprop --border-right\n * @cssprop --justify-content\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/grid/\n */\nexport class GridCell extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-grid-cell',\n version: '0.0.0'\n };\n\n /** @private */\n declare _internals: ElementInternals;\n\n render() {\n return html`\n <div internal-host focusable=\"active\">\n <slot></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'gridcell';\n }\n}\n"],"mappings":";;;;;AA2BA,IAAa,IAAb,cAA8B,EAAW;;gBACvB,EAAU,CAAC,CAAM,CAAC;;;kBAEP;GACzB,KAAK;GACL,SAAS;EACX;;CAKA,SAAS;EACP,OAAO,CAAI;CAKb;CAEA,oBAAoB;EAGlB,AAFA,MAAM,kBAAkB,GACxB,EAAgB,IAAI,GACpB,KAAK,WAAW,OAAO;CACzB;AACF"}
1
+ {"version":3,"file":"cell2.js","names":[],"sources":["../../../src/grid/cell/cell.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 { useStyles, attachInternals } from '@nvidia-elements/core/internal';\nimport styles from './cell.css?inline';\n\n/**\n * @element nve-grid-cell\n * @description Represents an individual data cell within a grid row, displaying content aligned to its parent column.\n * @documentation https://nvidia.github.io/elements/docs/elements/data-grid/\n * @since 0.11.0\n * @entrypoint \\@nvidia-elements/core/grid\n * @slot - Data or interactive controls displayed within the cell.\n * @cssprop --background\n * @cssprop --color\n * @cssprop --padding\n * @cssprop --min-height\n * @cssprop --min-width\n * @cssprop --font-weight\n * @cssprop --font-size\n * @cssprop --height\n * @cssprop --border-left\n * @cssprop --border-right\n * @cssprop --justify-content\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/grid/\n */\nexport class GridCell extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-grid-cell',\n version: '0.0.0'\n };\n\n /** @private */\n declare _internals: ElementInternals;\n\n render() {\n return html`\n <div internal-host focusable=\"active\">\n <slot></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'gridcell';\n }\n}\n"],"mappings":";;;;;AA2BA,IAAa,IAAb,cAA8B,EAAW;;EACvB,KAAA,SAAA,EAAU,CAAC,CAAM,CAAC;;;EAEP,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;CAKA,SAAS;EACP,OAAO,CAAI;CAKb;CAEA,oBAAoB;EAGlB,AAFA,MAAM,kBAAkB,GACxB,EAAgB,IAAI,GACpB,KAAK,WAAW,OAAO;CACzB;AACF"}
@@ -1,7 +1,7 @@
1
1
  import { appendRootNodeStyle as e } from "../../internal/utils/dom.js";
2
2
  import { attachInternals as t } from "../../internal/utils/a11y.js";
3
3
  import { useStyles as n } from "../../internal/styles/index.js";
4
- import r from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
4
+ import r from "../../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorate.js";
5
5
  import i from "./column.js";
6
6
  import { LitElement as a, html as o } from "lit";
7
7
  import { property as s } from "lit/decorators/property.js";
@@ -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.7.3"
16
+ version: "2.8.0"
17
17
  };
18
18
  }
19
19
  get #e() {