@nvidia-elements/core 0.0.11 → 0.0.12

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 (114) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/accordion/accordion2.js +4 -4
  3. package/dist/alert/alert-group2.js +1 -1
  4. package/dist/alert/alert2.js +1 -1
  5. package/dist/avatar/avatar-group2.js +1 -1
  6. package/dist/avatar/avatar2.js +1 -1
  7. package/dist/badge/badge2.js +1 -1
  8. package/dist/breadcrumb/breadcrumb2.js +1 -1
  9. package/dist/bundles/index.js +4 -4
  10. package/dist/button/button2.js +1 -1
  11. package/dist/button-group/button-group.d.ts +1 -1
  12. package/dist/button-group/button-group2.js +1 -1
  13. package/dist/button-group/button-group2.js.map +1 -1
  14. package/dist/card/card2.js +4 -4
  15. package/dist/chat-message/chat-message2.js +1 -1
  16. package/dist/checkbox/checkbox-group2.js +1 -1
  17. package/dist/checkbox/checkbox2.js +1 -1
  18. package/dist/color/color2.js +1 -1
  19. package/dist/combobox/combobox2.js +1 -1
  20. package/dist/copy-button/copy-button2.js +1 -1
  21. package/dist/custom-elements-jsx.d.ts +1 -1
  22. package/dist/custom-elements-vue.d.ts +1 -1
  23. package/dist/custom-elements.json +2 -2
  24. package/dist/data.html.json +2 -2
  25. package/dist/date/date2.js +1 -1
  26. package/dist/datetime/datetime2.js +1 -1
  27. package/dist/dialog/dialog-footer2.js +1 -1
  28. package/dist/dialog/dialog-header2.js +1 -1
  29. package/dist/dialog/dialog2.js +1 -1
  30. package/dist/divider/divider2.js +1 -1
  31. package/dist/dot/dot2.js +1 -1
  32. package/dist/drawer/drawer-content2.js +1 -1
  33. package/dist/drawer/drawer-footer2.js +1 -1
  34. package/dist/drawer/drawer-header2.js +1 -1
  35. package/dist/drawer/drawer2.js +1 -1
  36. package/dist/dropdown/dropdown-footer2.js +1 -1
  37. package/dist/dropdown/dropdown-header2.js +1 -1
  38. package/dist/dropdown/dropdown2.js +1 -1
  39. package/dist/dropdown-group/dropdown-group.js +1 -1
  40. package/dist/dropzone/dropzone2.js +1 -1
  41. package/dist/file/file2.js +1 -1
  42. package/dist/format-datetime/format-datetime2.js +1 -1
  43. package/dist/format-relative-time/format-relative-time2.js +73 -53
  44. package/dist/format-relative-time/format-relative-time2.js.map +1 -1
  45. package/dist/forms/control/control2.js +1 -1
  46. package/dist/forms/control-group/control-group2.js +1 -1
  47. package/dist/forms/control-message/control-message2.js +1 -1
  48. package/dist/forms/validation.examples.js.map +1 -1
  49. package/dist/grid/cell/cell2.js +1 -1
  50. package/dist/grid/column/column2.js +1 -1
  51. package/dist/grid/footer/footer2.js +1 -1
  52. package/dist/grid/grid2.js +1 -1
  53. package/dist/grid/header/header2.js +1 -1
  54. package/dist/grid/placeholder/placeholder2.js +1 -1
  55. package/dist/grid/row/row2.js +1 -1
  56. package/dist/icon/icon2.js +2 -2
  57. package/dist/icon-button/icon-button2.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/input/input-group2.js +1 -1
  60. package/dist/input/input2.js +1 -1
  61. package/dist/internal/services/global.service.js +1 -1
  62. package/dist/internal/utils/objects.js +17 -9
  63. package/dist/internal/utils/objects.js.map +1 -1
  64. package/dist/logo/logo2.js +1 -1
  65. package/dist/menu/menu-item2.js +1 -1
  66. package/dist/menu/menu2.js +1 -1
  67. package/dist/month/month2.js +1 -1
  68. package/dist/notification/notification-group2.js +1 -1
  69. package/dist/notification/notification2.js +1 -1
  70. package/dist/page/page-panel/page-panel-content2.js +1 -1
  71. package/dist/page/page-panel/page-panel-footer2.js +1 -1
  72. package/dist/page/page-panel/page-panel-header2.js +1 -1
  73. package/dist/page/page-panel/page-panel2.js +1 -1
  74. package/dist/page/page.examples.js.map +1 -1
  75. package/dist/page/page.examples.json +1 -1
  76. package/dist/page/page2.js +1 -1
  77. package/dist/page-header/page-header2.js +1 -1
  78. package/dist/page-loader/page-loader2.js +1 -1
  79. package/dist/pagination/pagination2.js +1 -1
  80. package/dist/panel/panel2.js +4 -4
  81. package/dist/password/password2.js +1 -1
  82. package/dist/preferences-input/preferences-input2.js +1 -1
  83. package/dist/progress-bar/progress-bar2.js +1 -1
  84. package/dist/progress-ring/progress-ring2.js +1 -1
  85. package/dist/progressive-filter-chip/progressive-filter-chip2.js +1 -1
  86. package/dist/pulse/pulse2.js +1 -1
  87. package/dist/radio/radio-group2.js +1 -1
  88. package/dist/radio/radio2.js +1 -1
  89. package/dist/range/range2.js +1 -1
  90. package/dist/resize-handle/resize-handle2.js +1 -1
  91. package/dist/search/search2.js +1 -1
  92. package/dist/select/select2.js +1 -1
  93. package/dist/skeleton/skeleton2.js +1 -1
  94. package/dist/sort-button/sort-button2.js +1 -1
  95. package/dist/sparkline/sparkline2.js +1 -1
  96. package/dist/star-rating/star-rating2.js +1 -1
  97. package/dist/steps/steps2.js +2 -2
  98. package/dist/switch/switch-group2.js +1 -1
  99. package/dist/switch/switch2.js +1 -1
  100. package/dist/tabs/tabs-group2.js +1 -1
  101. package/dist/tabs/tabs2.js +2 -2
  102. package/dist/tag/tag2.js +1 -1
  103. package/dist/textarea/textarea2.js +1 -1
  104. package/dist/time/time2.js +1 -1
  105. package/dist/toast/toast2.js +1 -1
  106. package/dist/toggletip/toggletip-footer2.js +1 -1
  107. package/dist/toggletip/toggletip-header2.js +1 -1
  108. package/dist/toggletip/toggletip2.js +1 -1
  109. package/dist/toolbar/toolbar2.js +1 -1
  110. package/dist/tooltip/tooltip2.js +1 -1
  111. package/dist/tree/tree-node2.js +1 -1
  112. package/dist/tree/tree2.js +1 -1
  113. package/dist/week/week2.js +1 -1
  114. package/package.json +5 -5
@@ -12,7 +12,7 @@ var o = class extends t {
12
12
  static {
13
13
  this.metadata = {
14
14
  tag: "nve-button",
15
- version: "0.0.11"
15
+ version: "0.0.12"
16
16
  };
17
17
  }
18
18
  render() {
@@ -2,7 +2,7 @@ import { PropertyValues, LitElement } from 'lit';
2
2
  import { KeynavListConfig, Interaction, Size } from '../internal';
3
3
  /**
4
4
  * @element nve-button-group
5
- * @description A button group is a control that enables users to choose between two or more distinct mutually exclusive options.
5
+ * @description A button group organizes related buttons and can support either mutually exclusive single or multi selection. Prefer usage within toolbars.
6
6
  * @since 0.16.0
7
7
  * @entrypoint \@nvidia-elements/core/button-group
8
8
  * @slot - default slot for `nve-button` or `nve-icon-button`
@@ -26,7 +26,7 @@ var f = class extends c {
26
26
  static {
27
27
  this.metadata = {
28
28
  tag: "nve-button-group",
29
- version: "0.0.11",
29
+ version: "0.0.12",
30
30
  children: [
31
31
  "nve-button",
32
32
  "nve-icon-button",
@@ -1 +1 @@
1
- {"version":3,"file":"button-group2.js","names":["#buttons","#syncStyleStates","#onClick","#selectButton"],"sources":["../../src/button-group/button-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 { queryAssignedElements } from 'lit/decorators/query-assigned-elements.js';\nimport type { KeynavListConfig, Interaction, Size } from '@nvidia-elements/core/internal';\nimport {\n attachInternals,\n keyNavigationList,\n useStyles,\n audit,\n appendRootNodeStyle\n} from '@nvidia-elements/core/internal';\nimport type { IconButton } from '@nvidia-elements/core/icon-button';\nimport type { Button } from '@nvidia-elements/core/button';\nimport type { Divider } from '@nvidia-elements/core/divider';\nimport styles from './button-group.css?inline';\nimport globalStyles from './button-group.global.css?inline';\n\n/**\n * @element nve-button-group\n * @description A button group is a control that enables users to choose between two or more distinct mutually exclusive options.\n * @since 0.16.0\n * @entrypoint \\@nvidia-elements/core/button-group\n * @slot - default slot for `nve-button` or `nve-icon-button`\n * @cssprop --background\n * @cssprop --border-radius\n * @cssprop --padding\n * @cssprop --gap\n * @cssprop --width\n * @cssprop --height\n * @cssprop --color\n * @aria https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/group_role\n */\n@audit()\n@keyNavigationList<ButtonGroup>()\nexport class ButtonGroup extends LitElement {\n /** @private */\n get keynavListConfig(): KeynavListConfig {\n return {\n items: this.#buttons,\n layout: this.orientation\n };\n }\n\n /** By default the button group is stateless. Add the `behavior-select` attribute and set to `single` or `multi` to enable stateful selction handling. */\n @property({ type: String, attribute: 'behavior-select' }) behaviorSelect: 'single' | 'multi';\n\n /** Set the style of the button group using the `container` property. Options are the default display when omitting the attribute, `flat` or `rounded`. */\n @property({ type: String, reflect: true }) container?: 'flat' | 'rounded';\n\n /** Determines the orientation direction of the group. Vertical groups support icon buttons only. */\n @property({ type: String, reflect: true }) orientation?: 'horizontal' | 'vertical' = 'horizontal';\n\n /** Use the `interaction` property on `button-group` in combination with `divider` for color-coded split buttons */\n @property({ type: String, reflect: true }) interaction: Interaction;\n\n /** Determines size of button */\n @property({ type: String, reflect: true }) size?: Size;\n\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-button-group',\n version: '0.0.0',\n children: ['nve-button', 'nve-icon-button', 'nve-divider']\n };\n\n /** @private */\n declare _internals: ElementInternals;\n\n @queryAssignedElements({ selector: 'nve-divider' }) private dividers!: Divider[];\n\n @queryAssignedElements({ selector: 'nve-icon-button' }) private iconButtons!: IconButton[];\n\n @queryAssignedElements({ selector: 'nve-button' }) private buttons!: Button[];\n\n get #buttons() {\n return [...this.iconButtons, ...this.buttons];\n }\n\n render() {\n return html`\n <div internal-host>\n <slot @slotchange=${this.#syncStyleStates}></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n appendRootNodeStyle(this, globalStyles);\n this._internals.role = 'group';\n this.addEventListener('click', this.#onClick);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('click', this.#onClick);\n }\n\n #onClick = (e: Event) => this.#selectButton(e.target as HTMLElement & { pressed?: boolean });\n\n updated(props: PropertyValues<this>) {\n super.updated(props);\n this.#syncStyleStates();\n }\n\n #syncStyleStates() {\n if (this.container === 'flat') {\n this.#buttons.forEach(btn => (btn.container = 'flat'));\n }\n\n if (this.interaction) {\n this.#buttons.forEach(btn => (btn.interaction = this.interaction));\n }\n\n this.dividers.length ? this._internals.states.add('split') : this._internals.states.delete('split');\n }\n\n #selectButton(button: HTMLElement & { pressed?: boolean }) {\n if (!button.matches?.('nve-button, nve-icon-button')) {\n return;\n }\n\n if (this.behaviorSelect === 'single') {\n this.#buttons.forEach(i => (i.pressed = false));\n button.pressed = true;\n } else if (this.behaviorSelect === 'multi') {\n button.pressed = !button.pressed;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;AAsCO,IAAA,IAAA,cAA0B,EAAW;;kCAgB2C;;CAdrF,IAAI,mBAAqC;AACvC,SAAO;GACL,OAAO,MAAA;GACP,QAAQ,KAAK;GACd;;;gBAkBa,EAAU,CAAC,EAAO,CAAC;;;kBAER;GACzB,KAAK;GACL,SAAS;GACT,UAAU;IAAC;IAAc;IAAmB;;GAC7C;;CAWD,KAAA,IAAe;AACb,SAAO,CAAC,GAAG,KAAK,aAAa,GAAG,KAAK,QAAQ;;CAG/C,SAAS;AACP,SAAO,CAAI,yCAEa,MAAA,EAAsB;;CAKhD,oBAAoB;AAKlB,EAJA,MAAM,mBAAmB,EACzB,EAAgB,KAAK,EACrB,EAAoB,MAAM,EAAa,EACvC,KAAK,WAAW,OAAO,SACvB,KAAK,iBAAiB,SAAS,MAAA,EAAc;;CAG/C,uBAAuB;AAErB,EADA,MAAM,sBAAsB,EAC5B,KAAK,oBAAoB,SAAS,MAAA,EAAc;;CAGlD,MAAY,MAAa,MAAA,EAAmB,EAAE,OAA8C;CAE5F,QAAQ,GAA6B;AAEnC,EADA,MAAM,QAAQ,EAAM,EACpB,MAAA,GAAuB;;CAGzB,KAAmB;AASjB,EARI,KAAK,cAAc,UACrB,MAAA,EAAc,SAAQ,MAAQ,EAAI,YAAY,OAAQ,EAGpD,KAAK,eACP,MAAA,EAAc,SAAQ,MAAQ,EAAI,cAAc,KAAK,YAAa,EAGpE,KAAK,SAAS,SAAS,KAAK,WAAW,OAAO,IAAI,QAAQ,GAAG,KAAK,WAAW,OAAO,OAAO,QAAQ;;CAGrG,GAAc,GAA6C;AACpD,IAAO,UAAU,8BAA8B,KAIhD,KAAK,mBAAmB,YAC1B,MAAA,EAAc,SAAQ,MAAM,EAAE,UAAU,GAAO,EAC/C,EAAO,UAAU,MACR,KAAK,mBAAmB,YACjC,EAAO,UAAU,CAAC,EAAO;;;GApF5B,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAmB,CAAC,CAAA,EAAA,EAAA,WAAA,kBAAA,KAAA,EAAA,KAGxD,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,aAAA,KAAA,EAAA,KAGzC,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA,KAGzC,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA,KAGzC,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,QAAA,KAAA,EAAA,KAazC,EAAsB,EAAE,UAAU,eAAe,CAAC,CAAA,EAAA,EAAA,WAAA,YAAA,KAAA,EAAA,KAElD,EAAsB,EAAE,UAAU,mBAAmB,CAAC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA,KAEtD,EAAsB,EAAE,UAAU,cAAc,CAAC,CAAA,EAAA,EAAA,WAAA,WAAA,KAAA,EAAA,SAzCnD,GAAO,EACP,GAAgC,CAAA,EAAA,EAAA"}
1
+ {"version":3,"file":"button-group2.js","names":["#buttons","#syncStyleStates","#onClick","#selectButton"],"sources":["../../src/button-group/button-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 { queryAssignedElements } from 'lit/decorators/query-assigned-elements.js';\nimport type { KeynavListConfig, Interaction, Size } from '@nvidia-elements/core/internal';\nimport {\n attachInternals,\n keyNavigationList,\n useStyles,\n audit,\n appendRootNodeStyle\n} from '@nvidia-elements/core/internal';\nimport type { IconButton } from '@nvidia-elements/core/icon-button';\nimport type { Button } from '@nvidia-elements/core/button';\nimport type { Divider } from '@nvidia-elements/core/divider';\nimport styles from './button-group.css?inline';\nimport globalStyles from './button-group.global.css?inline';\n\n/**\n * @element nve-button-group\n * @description A button group organizes related buttons and can support either mutually exclusive single or multi selection. Prefer usage within toolbars.\n * @since 0.16.0\n * @entrypoint \\@nvidia-elements/core/button-group\n * @slot - default slot for `nve-button` or `nve-icon-button`\n * @cssprop --background\n * @cssprop --border-radius\n * @cssprop --padding\n * @cssprop --gap\n * @cssprop --width\n * @cssprop --height\n * @cssprop --color\n * @aria https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/group_role\n */\n@audit()\n@keyNavigationList<ButtonGroup>()\nexport class ButtonGroup extends LitElement {\n /** @private */\n get keynavListConfig(): KeynavListConfig {\n return {\n items: this.#buttons,\n layout: this.orientation\n };\n }\n\n /** By default the button group is stateless. Add the `behavior-select` attribute and set to `single` or `multi` to enable stateful selction handling. */\n @property({ type: String, attribute: 'behavior-select' }) behaviorSelect: 'single' | 'multi';\n\n /** Set the style of the button group using the `container` property. Options are the default display when omitting the attribute, `flat` or `rounded`. */\n @property({ type: String, reflect: true }) container?: 'flat' | 'rounded';\n\n /** Determines the orientation direction of the group. Vertical groups support icon buttons only. */\n @property({ type: String, reflect: true }) orientation?: 'horizontal' | 'vertical' = 'horizontal';\n\n /** Use the `interaction` property on `button-group` in combination with `divider` for color-coded split buttons */\n @property({ type: String, reflect: true }) interaction: Interaction;\n\n /** Determines size of button */\n @property({ type: String, reflect: true }) size?: Size;\n\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-button-group',\n version: '0.0.0',\n children: ['nve-button', 'nve-icon-button', 'nve-divider']\n };\n\n /** @private */\n declare _internals: ElementInternals;\n\n @queryAssignedElements({ selector: 'nve-divider' }) private dividers!: Divider[];\n\n @queryAssignedElements({ selector: 'nve-icon-button' }) private iconButtons!: IconButton[];\n\n @queryAssignedElements({ selector: 'nve-button' }) private buttons!: Button[];\n\n get #buttons() {\n return [...this.iconButtons, ...this.buttons];\n }\n\n render() {\n return html`\n <div internal-host>\n <slot @slotchange=${this.#syncStyleStates}></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n appendRootNodeStyle(this, globalStyles);\n this._internals.role = 'group';\n this.addEventListener('click', this.#onClick);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('click', this.#onClick);\n }\n\n #onClick = (e: Event) => this.#selectButton(e.target as HTMLElement & { pressed?: boolean });\n\n updated(props: PropertyValues<this>) {\n super.updated(props);\n this.#syncStyleStates();\n }\n\n #syncStyleStates() {\n if (this.container === 'flat') {\n this.#buttons.forEach(btn => (btn.container = 'flat'));\n }\n\n if (this.interaction) {\n this.#buttons.forEach(btn => (btn.interaction = this.interaction));\n }\n\n this.dividers.length ? this._internals.states.add('split') : this._internals.states.delete('split');\n }\n\n #selectButton(button: HTMLElement & { pressed?: boolean }) {\n if (!button.matches?.('nve-button, nve-icon-button')) {\n return;\n }\n\n if (this.behaviorSelect === 'single') {\n this.#buttons.forEach(i => (i.pressed = false));\n button.pressed = true;\n } else if (this.behaviorSelect === 'multi') {\n button.pressed = !button.pressed;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;AAsCO,IAAA,IAAA,cAA0B,EAAW;;kCAgB2C;;CAdrF,IAAI,mBAAqC;AACvC,SAAO;GACL,OAAO,MAAA;GACP,QAAQ,KAAK;GACd;;;gBAkBa,EAAU,CAAC,EAAO,CAAC;;;kBAER;GACzB,KAAK;GACL,SAAS;GACT,UAAU;IAAC;IAAc;IAAmB;;GAC7C;;CAWD,KAAA,IAAe;AACb,SAAO,CAAC,GAAG,KAAK,aAAa,GAAG,KAAK,QAAQ;;CAG/C,SAAS;AACP,SAAO,CAAI,yCAEa,MAAA,EAAsB;;CAKhD,oBAAoB;AAKlB,EAJA,MAAM,mBAAmB,EACzB,EAAgB,KAAK,EACrB,EAAoB,MAAM,EAAa,EACvC,KAAK,WAAW,OAAO,SACvB,KAAK,iBAAiB,SAAS,MAAA,EAAc;;CAG/C,uBAAuB;AAErB,EADA,MAAM,sBAAsB,EAC5B,KAAK,oBAAoB,SAAS,MAAA,EAAc;;CAGlD,MAAY,MAAa,MAAA,EAAmB,EAAE,OAA8C;CAE5F,QAAQ,GAA6B;AAEnC,EADA,MAAM,QAAQ,EAAM,EACpB,MAAA,GAAuB;;CAGzB,KAAmB;AASjB,EARI,KAAK,cAAc,UACrB,MAAA,EAAc,SAAQ,MAAQ,EAAI,YAAY,OAAQ,EAGpD,KAAK,eACP,MAAA,EAAc,SAAQ,MAAQ,EAAI,cAAc,KAAK,YAAa,EAGpE,KAAK,SAAS,SAAS,KAAK,WAAW,OAAO,IAAI,QAAQ,GAAG,KAAK,WAAW,OAAO,OAAO,QAAQ;;CAGrG,GAAc,GAA6C;AACpD,IAAO,UAAU,8BAA8B,KAIhD,KAAK,mBAAmB,YAC1B,MAAA,EAAc,SAAQ,MAAM,EAAE,UAAU,GAAO,EAC/C,EAAO,UAAU,MACR,KAAK,mBAAmB,YACjC,EAAO,UAAU,CAAC,EAAO;;;GApF5B,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAmB,CAAC,CAAA,EAAA,EAAA,WAAA,kBAAA,KAAA,EAAA,KAGxD,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,aAAA,KAAA,EAAA,KAGzC,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA,KAGzC,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA,KAGzC,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,QAAA,KAAA,EAAA,KAazC,EAAsB,EAAE,UAAU,eAAe,CAAC,CAAA,EAAA,EAAA,WAAA,YAAA,KAAA,EAAA,KAElD,EAAsB,EAAE,UAAU,mBAAmB,CAAC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA,KAEtD,EAAsB,EAAE,UAAU,cAAc,CAAC,CAAA,EAAA,EAAA,WAAA,WAAA,KAAA,EAAA,SAzCnD,GAAO,EACP,GAAgC,CAAA,EAAA,EAAA"}
@@ -16,7 +16,7 @@ var d = class extends c {
16
16
  static {
17
17
  this.metadata = {
18
18
  tag: "nve-card",
19
- version: "0.0.11"
19
+ version: "0.0.12"
20
20
  };
21
21
  }
22
22
  render() {
@@ -37,7 +37,7 @@ var f = class extends c {
37
37
  static {
38
38
  this.metadata = {
39
39
  tag: "nve-card-header",
40
- version: "0.0.11",
40
+ version: "0.0.12",
41
41
  parents: ["nve-card"]
42
42
  };
43
43
  }
@@ -53,7 +53,7 @@ var p = class extends c {
53
53
  static {
54
54
  this.metadata = {
55
55
  tag: "nve-card-content",
56
- version: "0.0.11",
56
+ version: "0.0.12",
57
57
  parents: ["nve-card"]
58
58
  };
59
59
  }
@@ -72,7 +72,7 @@ var m = class extends c {
72
72
  static {
73
73
  this.metadata = {
74
74
  tag: "nve-card-footer",
75
- version: "0.0.11",
75
+ version: "0.0.12",
76
76
  parents: ["nve-card"]
77
77
  };
78
78
  }
@@ -13,7 +13,7 @@ var l = class extends o {
13
13
  static {
14
14
  this.metadata = {
15
15
  tag: "nve-chat-message",
16
- version: "0.0.11"
16
+ version: "0.0.12"
17
17
  };
18
18
  }
19
19
  render() {
@@ -12,7 +12,7 @@ var o = class extends i {
12
12
  static {
13
13
  this.metadata = {
14
14
  tag: "nve-checkbox-group",
15
- version: "0.0.11",
15
+ version: "0.0.12",
16
16
  children: [
17
17
  "label",
18
18
  "nve-control-message",
@@ -15,7 +15,7 @@ var o = class extends i {
15
15
  static {
16
16
  this.metadata = {
17
17
  tag: "nve-checkbox",
18
- version: "0.0.11",
18
+ version: "0.0.12",
19
19
  children: [
20
20
  "label",
21
21
  "input",
@@ -21,7 +21,7 @@ var f = class extends a {
21
21
  static {
22
22
  this.metadata = {
23
23
  tag: "nve-color",
24
- version: "0.0.11"
24
+ version: "0.0.12"
25
25
  };
26
26
  }
27
27
  static {
@@ -31,7 +31,7 @@ var S = class extends l {
31
31
  static {
32
32
  this.metadata = {
33
33
  tag: "nve-combobox",
34
- version: "0.0.11"
34
+ version: "0.0.12"
35
35
  };
36
36
  }
37
37
  static {
@@ -22,7 +22,7 @@ var p = class extends a {
22
22
  static {
23
23
  this.metadata = {
24
24
  tag: "nve-copy-button",
25
- version: "0.0.11"
25
+ version: "0.0.12"
26
26
  };
27
27
  }
28
28
  static {
@@ -4053,7 +4053,7 @@ export type CustomElements = {
4053
4053
  "nve-breadcrumb": Partial<BreadcrumbProps & BaseProps & BaseEvents>;
4054
4054
 
4055
4055
  /**
4056
- * A button group is a control that enables users to choose between two or more distinct mutually exclusive options.
4056
+ * A button group organizes related buttons and can support either mutually exclusive single or multi selection. Prefer usage within toolbars.
4057
4057
  * ---
4058
4058
  *
4059
4059
  *
@@ -3980,7 +3980,7 @@ export type CustomElements = {
3980
3980
  "nve-breadcrumb": DefineComponent<BreadcrumbProps>;
3981
3981
 
3982
3982
  /**
3983
- * A button group is a control that enables users to choose between two or more distinct mutually exclusive options.
3983
+ * A button group organizes related buttons and can support either mutually exclusive single or multi selection. Prefer usage within toolbars.
3984
3984
  * ---
3985
3985
  *
3986
3986
  *
@@ -3790,7 +3790,7 @@
3790
3790
  "declarations": [
3791
3791
  {
3792
3792
  "kind": "class",
3793
- "description": "A button group is a control that enables users to choose between two or more distinct mutually exclusive options.",
3793
+ "description": "A button group organizes related buttons and can support either mutually exclusive single or multi selection. Prefer usage within toolbars.",
3794
3794
  "name": "ButtonGroup",
3795
3795
  "cssProperties": [
3796
3796
  {
@@ -4158,7 +4158,7 @@
4158
4158
  "since": "0.16.0",
4159
4159
  "status": "stable",
4160
4160
  "behavior": "container",
4161
- "markdown": "## nve-button-group\n\nA button group is a control that enables users to choose between two or more distinct mutually exclusive options.\n\n### Example\n\n```html\n<nve-button-group>\n <nve-icon-button selected icon-name=\"copy\"></nve-icon-button>\n <nve-icon-button icon-name=\"add-comment\"></nve-icon-button>\n <nve-icon-button icon-name=\"download\"></nve-icon-button>\n</nve-button-group>\n```\n\n### Import\n\n```javascript\nimport '@nvidia-elements/core/button-group/define.js';\n```\n\n### Slots\n\n| name | value | description |\n| ---- | ----- | ----------- |\n| (default) | `string` | default slot for `nve-button` or `nve-icon-button` |\n\n### Properties / Attributes\n\n| property (attribute) | value | description |\n| -------------------- | ----- | ----------- |\n| behaviorSelect (behavior-select) | `'single' \\| 'multi'` | By default the button group is stateless. Add the `behavior-select` attribute and set to `single` or `multi` to enable stateful selction handling. |\n| container | `'flat' \\| 'rounded' \\| \"default\"` | Demonstrates different container styles to accommodate visual weight and context. - `flat` Element has white space bounds but reduced visual container. |\n| orientation | `'horizontal' \\| 'vertical' \\| \"default\"` | Controls the directional flow of the element's layout and interaction pattern. - `horizontal` Element orients horizontally with left-to-right flow. - `vertical` Element orients vertically with top-to-bottom flow. |\n| interaction | `'emphasis' \\| 'destructive'` | The Interaction type provides a way to show the intent of an interactive element. This can help users quickly understand what each interaction does and reduce the potential for confusion or errors. - `emphasis` Shows the interaction targets emphasis or highlighting primary actions. - `destructive` Shows the interaction targets destructive actions such as deleting or removing. |\n| size | `'sm' \\| 'md' \\| 'lg' \\| \"default\"` | Controls the visual scale of an element to match its importance and available space. - `sm` Compact size for dense layouts or secondary elements with less visual prominence. - `md` Standard size that works well in most contexts and provides balanced visibility. - `lg` Larger size for emphasizing important elements or improving touch targets in spacious layouts. |\n\n### CSS Properties\n\n| name | value | description |\n| ---- | ----- | ----------- |\n| --background | `string` | [MDN](https://mdn.dev/CSS/background) |\n| --border-radius | `string` | [MDN](https://mdn.dev/CSS/border-radius) |\n| --padding | `string` | [MDN](https://mdn.dev/CSS/padding) |\n| --gap | `string` | [MDN](https://mdn.dev/CSS/gap) |\n| --width | `string` | [MDN](https://mdn.dev/CSS/width) |\n| --height | `string` | [MDN](https://mdn.dev/CSS/height) |\n| --color | `string` | [MDN](https://mdn.dev/CSS/color) |"
4161
+ "markdown": "## nve-button-group\n\nA button group organizes related buttons and can support either mutually exclusive single or multi selection. Prefer usage within toolbars.\n\n### Example\n\n```html\n<nve-button-group>\n <nve-icon-button selected icon-name=\"copy\"></nve-icon-button>\n <nve-icon-button icon-name=\"add-comment\"></nve-icon-button>\n <nve-icon-button icon-name=\"download\"></nve-icon-button>\n</nve-button-group>\n```\n\n### Import\n\n```javascript\nimport '@nvidia-elements/core/button-group/define.js';\n```\n\n### Slots\n\n| name | value | description |\n| ---- | ----- | ----------- |\n| (default) | `string` | default slot for `nve-button` or `nve-icon-button` |\n\n### Properties / Attributes\n\n| property (attribute) | value | description |\n| -------------------- | ----- | ----------- |\n| behaviorSelect (behavior-select) | `'single' \\| 'multi'` | By default the button group is stateless. Add the `behavior-select` attribute and set to `single` or `multi` to enable stateful selction handling. |\n| container | `'flat' \\| 'rounded' \\| \"default\"` | Demonstrates different container styles to accommodate visual weight and context. - `flat` Element has white space bounds but reduced visual container. |\n| orientation | `'horizontal' \\| 'vertical' \\| \"default\"` | Controls the directional flow of the element's layout and interaction pattern. - `horizontal` Element orients horizontally with left-to-right flow. - `vertical` Element orients vertically with top-to-bottom flow. |\n| interaction | `'emphasis' \\| 'destructive'` | The Interaction type provides a way to show the intent of an interactive element. This can help users quickly understand what each interaction does and reduce the potential for confusion or errors. - `emphasis` Shows the interaction targets emphasis or highlighting primary actions. - `destructive` Shows the interaction targets destructive actions such as deleting or removing. |\n| size | `'sm' \\| 'md' \\| 'lg' \\| \"default\"` | Controls the visual scale of an element to match its importance and available space. - `sm` Compact size for dense layouts or secondary elements with less visual prominence. - `md` Standard size that works well in most contexts and provides balanced visibility. - `lg` Larger size for emphasizing important elements or improving touch targets in spacious layouts. |\n\n### CSS Properties\n\n| name | value | description |\n| ---- | ----- | ----------- |\n| --background | `string` | [MDN](https://mdn.dev/CSS/background) |\n| --border-radius | `string` | [MDN](https://mdn.dev/CSS/border-radius) |\n| --padding | `string` | [MDN](https://mdn.dev/CSS/padding) |\n| --gap | `string` | [MDN](https://mdn.dev/CSS/gap) |\n| --width | `string` | [MDN](https://mdn.dev/CSS/width) |\n| --height | `string` | [MDN](https://mdn.dev/CSS/height) |\n| --color | `string` | [MDN](https://mdn.dev/CSS/color) |"
4162
4162
  }
4163
4163
  }
4164
4164
  ],
@@ -389,7 +389,7 @@
389
389
  },
390
390
  {
391
391
  "name": "nve-button-group",
392
- "description": "A button group is a control that enables users to choose between two or more distinct mutually exclusive options.\n---\n\n\n### **Slots:**\n - _default_ - default slot for `nve-button` or `nve-icon-button`\n\n### **CSS Properties:**\n - **--background** - [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/background) _(default: undefined)_\n- **--border-radius** - [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius) _(default: undefined)_\n- **--padding** - [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/padding) _(default: undefined)_\n- **--gap** - [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/gap) _(default: undefined)_\n- **--width** - [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/width) _(default: undefined)_\n- **--height** - [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/height) _(default: undefined)_\n- **--color** - [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/color) _(default: undefined)_",
392
+ "description": "A button group organizes related buttons and can support either mutually exclusive single or multi selection. Prefer usage within toolbars.\n---\n\n\n### **Slots:**\n - _default_ - default slot for `nve-button` or `nve-icon-button`\n\n### **CSS Properties:**\n - **--background** - [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/background) _(default: undefined)_\n- **--border-radius** - [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius) _(default: undefined)_\n- **--padding** - [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/padding) _(default: undefined)_\n- **--gap** - [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/gap) _(default: undefined)_\n- **--width** - [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/width) _(default: undefined)_\n- **--height** - [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/height) _(default: undefined)_\n- **--color** - [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/color) _(default: undefined)_",
393
393
  "attributes": [
394
394
  {
395
395
  "name": "behavior-select",
@@ -437,7 +437,7 @@
437
437
  },
438
438
  {
439
439
  "name": "markdown",
440
- "url": "## nve-button-group\n\nA button group is a control that enables users to choose between two or more distinct mutually exclusive options.\n\n### Example\n\n```html\n<nve-button-group>\n <nve-icon-button selected icon-name=\"copy\"></nve-icon-button>\n <nve-icon-button icon-name=\"add-comment\"></nve-icon-button>\n <nve-icon-button icon-name=\"download\"></nve-icon-button>\n</nve-button-group>\n```\n\n### Import\n\n```javascript\nimport '@nvidia-elements/core/button-group/define.js';\n```\n\n### Slots\n\n| name | value | description |\n| ---- | ----- | ----------- |\n| (default) | `string` | default slot for `nve-button` or `nve-icon-button` |\n\n### Properties / Attributes\n\n| property (attribute) | value | description |\n| -------------------- | ----- | ----------- |\n| behaviorSelect (behavior-select) | `'single' \\| 'multi'` | By default the button group is stateless. Add the `behavior-select` attribute and set to `single` or `multi` to enable stateful selction handling. |\n| container | `'flat' \\| 'rounded' \\| \"default\"` | Demonstrates different container styles to accommodate visual weight and context. - `flat` Element has white space bounds but reduced visual container. |\n| orientation | `'horizontal' \\| 'vertical' \\| \"default\"` | Controls the directional flow of the element's layout and interaction pattern. - `horizontal` Element orients horizontally with left-to-right flow. - `vertical` Element orients vertically with top-to-bottom flow. |\n| interaction | `'emphasis' \\| 'destructive'` | The Interaction type provides a way to show the intent of an interactive element. This can help users quickly understand what each interaction does and reduce the potential for confusion or errors. - `emphasis` Shows the interaction targets emphasis or highlighting primary actions. - `destructive` Shows the interaction targets destructive actions such as deleting or removing. |\n| size | `'sm' \\| 'md' \\| 'lg' \\| \"default\"` | Controls the visual scale of an element to match its importance and available space. - `sm` Compact size for dense layouts or secondary elements with less visual prominence. - `md` Standard size that works well in most contexts and provides balanced visibility. - `lg` Larger size for emphasizing important elements or improving touch targets in spacious layouts. |\n\n### CSS Properties\n\n| name | value | description |\n| ---- | ----- | ----------- |\n| --background | `string` | [MDN](https://mdn.dev/CSS/background) |\n| --border-radius | `string` | [MDN](https://mdn.dev/CSS/border-radius) |\n| --padding | `string` | [MDN](https://mdn.dev/CSS/padding) |\n| --gap | `string` | [MDN](https://mdn.dev/CSS/gap) |\n| --width | `string` | [MDN](https://mdn.dev/CSS/width) |\n| --height | `string` | [MDN](https://mdn.dev/CSS/height) |\n| --color | `string` | [MDN](https://mdn.dev/CSS/color) |"
440
+ "url": "## nve-button-group\n\nA button group organizes related buttons and can support either mutually exclusive single or multi selection. Prefer usage within toolbars.\n\n### Example\n\n```html\n<nve-button-group>\n <nve-icon-button selected icon-name=\"copy\"></nve-icon-button>\n <nve-icon-button icon-name=\"add-comment\"></nve-icon-button>\n <nve-icon-button icon-name=\"download\"></nve-icon-button>\n</nve-button-group>\n```\n\n### Import\n\n```javascript\nimport '@nvidia-elements/core/button-group/define.js';\n```\n\n### Slots\n\n| name | value | description |\n| ---- | ----- | ----------- |\n| (default) | `string` | default slot for `nve-button` or `nve-icon-button` |\n\n### Properties / Attributes\n\n| property (attribute) | value | description |\n| -------------------- | ----- | ----------- |\n| behaviorSelect (behavior-select) | `'single' \\| 'multi'` | By default the button group is stateless. Add the `behavior-select` attribute and set to `single` or `multi` to enable stateful selction handling. |\n| container | `'flat' \\| 'rounded' \\| \"default\"` | Demonstrates different container styles to accommodate visual weight and context. - `flat` Element has white space bounds but reduced visual container. |\n| orientation | `'horizontal' \\| 'vertical' \\| \"default\"` | Controls the directional flow of the element's layout and interaction pattern. - `horizontal` Element orients horizontally with left-to-right flow. - `vertical` Element orients vertically with top-to-bottom flow. |\n| interaction | `'emphasis' \\| 'destructive'` | The Interaction type provides a way to show the intent of an interactive element. This can help users quickly understand what each interaction does and reduce the potential for confusion or errors. - `emphasis` Shows the interaction targets emphasis or highlighting primary actions. - `destructive` Shows the interaction targets destructive actions such as deleting or removing. |\n| size | `'sm' \\| 'md' \\| 'lg' \\| \"default\"` | Controls the visual scale of an element to match its importance and available space. - `sm` Compact size for dense layouts or secondary elements with less visual prominence. - `md` Standard size that works well in most contexts and provides balanced visibility. - `lg` Larger size for emphasizing important elements or improving touch targets in spacious layouts. |\n\n### CSS Properties\n\n| name | value | description |\n| ---- | ----- | ----------- |\n| --background | `string` | [MDN](https://mdn.dev/CSS/background) |\n| --border-radius | `string` | [MDN](https://mdn.dev/CSS/border-radius) |\n| --padding | `string` | [MDN](https://mdn.dev/CSS/padding) |\n| --gap | `string` | [MDN](https://mdn.dev/CSS/gap) |\n| --width | `string` | [MDN](https://mdn.dev/CSS/width) |\n| --height | `string` | [MDN](https://mdn.dev/CSS/height) |\n| --color | `string` | [MDN](https://mdn.dev/CSS/color) |"
441
441
  }
442
442
  ]
443
443
  },
@@ -19,7 +19,7 @@ var l = class extends r {
19
19
  static {
20
20
  this.metadata = {
21
21
  tag: "nve-date",
22
- version: "0.0.11"
22
+ version: "0.0.12"
23
23
  };
24
24
  }
25
25
  static {
@@ -19,7 +19,7 @@ var l = class extends r {
19
19
  static {
20
20
  this.metadata = {
21
21
  tag: "nve-datetime",
22
- version: "0.0.11"
22
+ version: "0.0.12"
23
23
  };
24
24
  }
25
25
  static {
@@ -11,7 +11,7 @@ var o = class extends i {
11
11
  static {
12
12
  this.metadata = {
13
13
  tag: "nve-dialog-footer",
14
- version: "0.0.11",
14
+ version: "0.0.12",
15
15
  parents: ["nve-dialog"]
16
16
  };
17
17
  }
@@ -11,7 +11,7 @@ var o = class extends i {
11
11
  static {
12
12
  this.metadata = {
13
13
  tag: "nve-dialog-header",
14
- version: "0.0.11",
14
+ version: "0.0.12",
15
15
  parents: ["nve-dialog"]
16
16
  };
17
17
  }
@@ -30,7 +30,7 @@ var h = class extends f {
30
30
  static {
31
31
  this.metadata = {
32
32
  tag: "nve-dialog",
33
- version: "0.0.11"
33
+ version: "0.0.12"
34
34
  };
35
35
  }
36
36
  static {
@@ -15,7 +15,7 @@ var s = class extends i {
15
15
  static {
16
16
  this.metadata = {
17
17
  tag: "nve-divider",
18
- version: "0.0.11"
18
+ version: "0.0.12"
19
19
  };
20
20
  }
21
21
  render() {
package/dist/dot/dot2.js CHANGED
@@ -16,7 +16,7 @@ var l = class extends o {
16
16
  static {
17
17
  this.metadata = {
18
18
  tag: "nve-dot",
19
- version: "0.0.11"
19
+ version: "0.0.12"
20
20
  };
21
21
  }
22
22
  render() {
@@ -11,7 +11,7 @@ var o = class extends i {
11
11
  static {
12
12
  this.metadata = {
13
13
  tag: "nve-drawer-content",
14
- version: "0.0.11",
14
+ version: "0.0.12",
15
15
  parents: ["nve-drawer"]
16
16
  };
17
17
  }
@@ -11,7 +11,7 @@ var o = class extends i {
11
11
  static {
12
12
  this.metadata = {
13
13
  tag: "nve-drawer-footer",
14
- version: "0.0.11",
14
+ version: "0.0.12",
15
15
  parents: ["nve-drawer"]
16
16
  };
17
17
  }
@@ -11,7 +11,7 @@ var o = class extends i {
11
11
  static {
12
12
  this.metadata = {
13
13
  tag: "nve-drawer-header",
14
- version: "0.0.11",
14
+ version: "0.0.12",
15
15
  parents: ["nve-drawer"]
16
16
  };
17
17
  }
@@ -28,7 +28,7 @@ var p = class extends u {
28
28
  static {
29
29
  this.metadata = {
30
30
  tag: "nve-drawer",
31
- version: "0.0.11"
31
+ version: "0.0.12"
32
32
  };
33
33
  }
34
34
  static {
@@ -11,7 +11,7 @@ var o = class extends i {
11
11
  static {
12
12
  this.metadata = {
13
13
  tag: "nve-dropdown-footer",
14
- version: "0.0.11",
14
+ version: "0.0.12",
15
15
  parents: ["nve-dropdown"]
16
16
  };
17
17
  }
@@ -11,7 +11,7 @@ var o = class extends i {
11
11
  static {
12
12
  this.metadata = {
13
13
  tag: "nve-dropdown-header",
14
- version: "0.0.11",
14
+ version: "0.0.12",
15
15
  parents: ["nve-dropdown"]
16
16
  };
17
17
  }
@@ -21,7 +21,7 @@ var p = class extends l {
21
21
  static {
22
22
  this.metadata = {
23
23
  tag: "nve-dropdown",
24
- version: "0.0.11"
24
+ version: "0.0.12"
25
25
  };
26
26
  }
27
27
  static {
@@ -14,7 +14,7 @@ var d = class extends c {
14
14
  static {
15
15
  this.metadata = {
16
16
  tag: "nve-dropdown-group",
17
- version: "0.0.11",
17
+ version: "0.0.12",
18
18
  children: ["nve-dropdown"]
19
19
  };
20
20
  }
@@ -20,7 +20,7 @@ var g = class extends h(d) {
20
20
  static {
21
21
  this.metadata = {
22
22
  tag: "nve-dropzone",
23
- version: "0.0.11",
23
+ version: "0.0.12",
24
24
  validators: [l, c],
25
25
  valueSchema: {
26
26
  type: "array",
@@ -11,7 +11,7 @@ var a = class extends n {
11
11
  static {
12
12
  this.metadata = {
13
13
  tag: "nve-file",
14
- version: "0.0.11"
14
+ version: "0.0.12"
15
15
  };
16
16
  }
17
17
  connectedCallback() {
@@ -13,7 +13,7 @@ var c = class extends a {
13
13
  static {
14
14
  this.metadata = {
15
15
  tag: "nve-format-datetime",
16
- version: "0.0.11"
16
+ version: "0.0.12"
17
17
  };
18
18
  }
19
19
  get #e() {
@@ -6,7 +6,44 @@ 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";
8
8
  //#region src/format-relative-time/format-relative-time.ts
9
- var c = class extends a {
9
+ var c = {
10
+ second: 1e3,
11
+ minute: 6e4,
12
+ hour: 36e5,
13
+ day: 864e5,
14
+ week: 6048e5,
15
+ month: 2592e6,
16
+ year: 31536e6
17
+ }, l = [
18
+ {
19
+ unit: "second",
20
+ max: 60
21
+ },
22
+ {
23
+ unit: "minute",
24
+ max: 60
25
+ },
26
+ {
27
+ unit: "hour",
28
+ max: 24
29
+ },
30
+ {
31
+ unit: "day",
32
+ max: 7
33
+ },
34
+ {
35
+ unit: "week",
36
+ max: 4
37
+ },
38
+ {
39
+ unit: "month",
40
+ max: 12
41
+ },
42
+ {
43
+ unit: "year",
44
+ max: Infinity
45
+ }
46
+ ], u = class extends a {
10
47
  constructor(...e) {
11
48
  super(...e), this.numeric = "always", this.formatStyle = "long", this.unit = "auto", this.sync = !1;
12
49
  }
@@ -16,7 +53,7 @@ var c = class extends a {
16
53
  static {
17
54
  this.metadata = {
18
55
  tag: "nve-format-relative-time",
19
- version: "0.0.11"
56
+ version: "0.0.12"
20
57
  };
21
58
  }
22
59
  #e;
@@ -27,92 +64,75 @@ var c = class extends a {
27
64
  return this.locale ?? (globalThis.document?.documentElement?.lang || void 0);
28
65
  }
29
66
  #r(e) {
30
- let t = Math.abs(e), n = e < 0 ? -1 : 1, r = Math.round(t / 1e3), i = Math.round(t / 6e4), a = Math.round(t / 36e5), o = Math.round(t / 864e5), s = Math.round(t / 6048e5), c = Math.round(t / 2592e6), l = Math.round(t / 31536e6);
31
- return r < 60 ? {
32
- value: n * r,
33
- unit: "second"
34
- } : i < 60 ? {
35
- value: n * i,
36
- unit: "minute"
37
- } : a < 24 ? {
38
- value: n * a,
39
- unit: "hour"
40
- } : o < 7 ? {
41
- value: n * o,
42
- unit: "day"
43
- } : s < 4 ? {
44
- value: n * s,
45
- unit: "week"
46
- } : c < 12 ? {
47
- value: n * c,
48
- unit: "month"
49
- } : {
50
- value: n * l,
51
- unit: "year"
52
- };
67
+ let t = Math.abs(e), n = e < 0 ? -1 : 1;
68
+ for (let { unit: e, max: r } of l) {
69
+ let i = Math.round(t / c[e]);
70
+ if (i < r) return {
71
+ value: n * i,
72
+ unit: e
73
+ };
74
+ }
75
+ throw Error("format-relative-time: no relative time threshold matched");
53
76
  }
54
77
  #i(e, t) {
55
- return Math.round(e / ({
56
- second: 1e3,
57
- minute: 6e4,
58
- hour: 36e5,
59
- day: 864e5,
60
- week: 6048e5,
61
- month: 2592e6,
62
- year: 31536e6
63
- }[t] ?? 1));
64
- }
65
- get #a() {
78
+ return Math.round(e / c[t]);
79
+ }
80
+ #a(e) {
81
+ return this.unit === "auto" ? this.#r(e) : {
82
+ unit: this.unit,
83
+ value: this.#i(e, this.unit)
84
+ };
85
+ }
86
+ get #o() {
66
87
  let t = this.#t;
67
88
  if (!t) return "";
68
89
  let n = new Date(t);
69
90
  if (isNaN(n.getTime())) return e.warn(`format-relative-time: invalid date value "${t}"`), t;
70
- let r = n.getTime() - Date.now(), i, a;
71
- this.unit === "auto" ? {value: i, unit: a} = this.#r(r) : (a = this.unit, i = this.#i(r, a));
91
+ let { value: r, unit: i } = this.#a(n.getTime() - Date.now());
72
92
  try {
73
93
  return new Intl.RelativeTimeFormat(this.#n, {
74
94
  numeric: this.numeric,
75
95
  style: this.formatStyle
76
- }).format(i, a);
96
+ }).format(r, i);
77
97
  } catch (n) {
78
98
  return e.warn(`format-relative-time: ${n.message}`), t;
79
99
  }
80
100
  }
81
- #o() {
101
+ #s() {
82
102
  let e = this.#t;
83
103
  if (!e) return 6e4;
84
104
  let t = Math.abs(new Date(e).getTime() - Date.now());
85
105
  return t < 6e4 ? 1e4 : t < 36e5 ? 3e4 : t < 864e5 ? 3e5 : 36e5;
86
106
  }
87
- #s() {
88
- this.#c(), this.sync && (this.#e = setTimeout(() => {
89
- this.requestUpdate(), this.#s();
90
- }, this.#o()));
91
- }
92
107
  #c() {
108
+ this.#l(), this.sync && (this.#e = setTimeout(() => {
109
+ this.requestUpdate(), this.#c();
110
+ }, this.#s()));
111
+ }
112
+ #l() {
93
113
  this.#e !== void 0 && (clearTimeout(this.#e), this.#e = void 0);
94
114
  }
95
115
  connectedCallback() {
96
- super.connectedCallback(), this.sync && this.#s();
116
+ super.connectedCallback(), this.sync && this.#c();
97
117
  }
98
118
  disconnectedCallback() {
99
- this.#c(), super.disconnectedCallback();
119
+ this.#l(), super.disconnectedCallback();
100
120
  }
101
121
  updated(e) {
102
- e.has("sync") && (this.sync ? this.#s() : this.#c());
122
+ e.has("sync") && (this.sync ? this.#c() : this.#l());
103
123
  }
104
124
  render() {
105
- return o`<time internal-host datetime="${this.#t}">${this.#a}<slot @slotchange="${this.#l}" hidden></slot></time>`;
125
+ return o`<time internal-host datetime="${this.#t}">${this.#o}<slot @slotchange="${this.#u}" hidden></slot></time>`;
106
126
  }
107
- #l() {
127
+ #u() {
108
128
  this.requestUpdate();
109
129
  }
110
130
  };
111
- t([s({ type: String })], c.prototype, "date", void 0), t([s({ type: String })], c.prototype, "locale", void 0), t([s({ type: String })], c.prototype, "numeric", void 0), t([s({
131
+ t([s({ type: String })], u.prototype, "date", void 0), t([s({ type: String })], u.prototype, "locale", void 0), t([s({ type: String })], u.prototype, "numeric", void 0), t([s({
112
132
  type: String,
113
133
  attribute: "format-style"
114
- })], c.prototype, "formatStyle", void 0), t([s({ type: String })], c.prototype, "unit", void 0), t([s({ type: Boolean })], c.prototype, "sync", void 0), c = t([n()], c);
134
+ })], u.prototype, "formatStyle", void 0), t([s({ type: String })], u.prototype, "unit", void 0), t([s({ type: Boolean })], u.prototype, "sync", void 0), u = t([n()], u);
115
135
  //#endregion
116
- export { c as FormatRelativeTime };
136
+ export { u as FormatRelativeTime };
117
137
 
118
138
  //# sourceMappingURL=format-relative-time2.js.map