@nvidia-elements/core 2.19.0 → 2.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/_virtual/_rolldown/runtime.js +17 -0
- package/dist/accordion/accordion2.js +60 -57
- package/dist/accordion/accordion2.js.map +1 -1
- package/dist/alert/alert-group2.js +1 -1
- package/dist/alert/alert2.js +37 -31
- package/dist/alert/alert2.js.map +1 -1
- package/dist/avatar/avatar-group2.js +1 -1
- package/dist/avatar/avatar2.js +1 -1
- package/dist/badge/badge.d.ts +0 -6
- package/dist/badge/badge2.js +31 -36
- package/dist/badge/badge2.js.map +1 -1
- package/dist/breadcrumb/breadcrumb2.js +1 -1
- package/dist/bundle.d.ts +2 -0
- package/dist/bundles/index.d.ts +153 -27
- package/dist/bundles/index.js +9 -9
- package/dist/button/button2.js +1 -1
- package/dist/button-group/button-group2.js +1 -1
- package/dist/card/card2.js +4 -4
- package/dist/chat-message/chat-message2.js +1 -1
- package/dist/checkbox/checkbox-group2.js +1 -1
- package/dist/checkbox/checkbox2.js +1 -1
- package/dist/color/color.d.ts +2 -0
- package/dist/color/color2.js +7 -4
- package/dist/color/color2.js.map +1 -1
- package/dist/combobox/combobox.d.ts +2 -0
- package/dist/combobox/combobox2.js +14 -6
- package/dist/combobox/combobox2.js.map +1 -1
- package/dist/copy-button/copy-button2.js +26 -23
- package/dist/copy-button/copy-button2.js.map +1 -1
- package/dist/custom-elements-jsx.d.ts +166 -4
- package/dist/custom-elements-vue.d.ts +160 -4
- package/dist/custom-elements.json +1239 -220
- package/dist/data.html.json +117 -10
- package/dist/date/date.d.ts +2 -0
- package/dist/date/date2.js +7 -4
- package/dist/date/date2.js.map +1 -1
- package/dist/datetime/datetime.d.ts +2 -0
- package/dist/datetime/datetime2.js +7 -4
- package/dist/datetime/datetime2.js.map +1 -1
- package/dist/dialog/dialog-footer2.js +1 -1
- package/dist/dialog/dialog-header2.js +1 -1
- package/dist/dialog/dialog2.js +27 -27
- package/dist/dialog/dialog2.js.map +1 -1
- package/dist/divider/divider2.js +1 -1
- package/dist/dot/dot2.js +1 -1
- package/dist/drag-handle/drag-handle2.js +1 -1
- package/dist/drawer/drawer-content2.js +1 -1
- package/dist/drawer/drawer-footer2.js +1 -1
- package/dist/drawer/drawer-header2.js +1 -1
- package/dist/drawer/drawer2.js +27 -27
- package/dist/drawer/drawer2.js.map +1 -1
- package/dist/dropdown/dropdown-footer2.js +1 -1
- package/dist/dropdown/dropdown-header2.js +1 -1
- package/dist/dropdown/dropdown2.js +23 -23
- package/dist/dropdown/dropdown2.js.map +1 -1
- package/dist/dropdown-group/dropdown-group.js +1 -1
- package/dist/dropzone/dropzone2.js +28 -22
- package/dist/dropzone/dropzone2.js.map +1 -1
- package/dist/file/file2.js +1 -1
- package/dist/format-bytes/format-bytes2.js +1 -1
- package/dist/format-datetime/format-datetime2.js +1 -1
- package/dist/format-number/format-number2.js +1 -1
- package/dist/format-relative-time/format-relative-time2.js +1 -1
- package/dist/format-truncate/format-truncate2.js +1 -1
- package/dist/forms/control/control.d.ts +3 -0
- package/dist/forms/control/control2.js +34 -31
- package/dist/forms/control/control2.js.map +1 -1
- package/dist/forms/control-group/control-group2.js +1 -1
- package/dist/forms/control-message/control-message2.js +1 -1
- package/dist/gauge/gauge2.js +26 -21
- package/dist/gauge/gauge2.js.map +1 -1
- package/dist/grid/cell/cell2.js +1 -1
- package/dist/grid/column/column2.js +1 -1
- package/dist/grid/footer/footer2.js +1 -1
- package/dist/grid/grid2.js +1 -1
- package/dist/grid/header/header2.js +1 -1
- package/dist/grid/placeholder/placeholder2.js +1 -1
- package/dist/grid/row/row2.js +1 -1
- package/dist/icon/icon2.js +2 -2
- package/dist/icon-button/icon-button2.js +1 -1
- package/dist/iframe/iframe2.js +1 -1
- package/dist/index.js +5 -6
- package/dist/input/input-group2.js +1 -1
- package/dist/input/input2.js +1 -1
- package/dist/internal/index.d.ts +1 -2
- package/dist/internal/index.js +150 -33
- package/dist/internal/index.js.map +1 -0
- package/dist/internal/types/index.d.ts +1 -1
- package/dist/internal/types/index.js.map +1 -1
- package/dist/joystick/define.d.ts +6 -0
- package/dist/joystick/define.js +7 -0
- package/dist/joystick/define.js.map +1 -0
- package/dist/joystick/index.d.ts +1 -0
- package/dist/joystick/index.js +2 -0
- package/dist/joystick/joystick.d.ts +126 -0
- package/dist/joystick/joystick.examples.js +6 -0
- package/dist/joystick/joystick.examples.js.map +1 -0
- package/dist/joystick/joystick.examples.json +107 -0
- package/dist/joystick/joystick.js +6 -0
- package/dist/joystick/joystick.js.map +1 -0
- package/dist/joystick/joystick2.js +347 -0
- package/dist/joystick/joystick2.js.map +1 -0
- package/dist/logo/logo2.js +1 -1
- package/dist/menu/menu-group2.js +1 -1
- package/dist/menu/menu-item2.js +1 -1
- package/dist/menu/menu2.js +1 -1
- package/dist/month/month.d.ts +2 -0
- package/dist/month/month2.js +7 -4
- package/dist/month/month2.js.map +1 -1
- package/dist/notification/notification-group2.js +1 -1
- package/dist/notification/notification2.js +38 -32
- package/dist/notification/notification2.js.map +1 -1
- package/dist/page/page-panel/page-panel-content2.js +1 -1
- package/dist/page/page-panel/page-panel-footer2.js +1 -1
- package/dist/page/page-panel/page-panel-header2.js +1 -1
- package/dist/page/page-panel/page-panel.d.ts +0 -7
- package/dist/page/page-panel/page-panel2.js +18 -20
- package/dist/page/page-panel/page-panel2.js.map +1 -1
- package/dist/page/page2.js +1 -1
- package/dist/page-header/page-header2.js +1 -1
- package/dist/page-loader/page-loader2.js +1 -1
- package/dist/pagination/pagination2.js +45 -38
- package/dist/pagination/pagination2.js.map +1 -1
- package/dist/panel/panel2.js +43 -38
- package/dist/panel/panel2.js.map +1 -1
- package/dist/password/password.d.ts +2 -0
- package/dist/password/password2.js +10 -4
- package/dist/password/password2.js.map +1 -1
- package/dist/preferences-input/preferences-input2.js +32 -27
- package/dist/preferences-input/preferences-input2.js.map +1 -1
- package/dist/progress-bar/progress-bar2.js +1 -1
- package/dist/progress-dot/progress-dot2.js +17 -17
- package/dist/progress-dot/progress-dot2.js.map +1 -1
- package/dist/progress-ring/progress-ring2.js +27 -22
- package/dist/progress-ring/progress-ring2.js.map +1 -1
- package/dist/progressive-filter-chip/progressive-filter-chip2.js +30 -30
- package/dist/progressive-filter-chip/progressive-filter-chip2.js.map +1 -1
- package/dist/pulse/pulse2.js +1 -1
- package/dist/radio/radio-group2.js +1 -1
- package/dist/radio/radio2.js +1 -1
- package/dist/range/range2.js +1 -1
- package/dist/resize-handle/resize-handle2.js +17 -17
- package/dist/resize-handle/resize-handle2.js.map +1 -1
- package/dist/search/search2.js +1 -1
- package/dist/select/select2.js +44 -41
- package/dist/select/select2.js.map +1 -1
- package/dist/skeleton/skeleton2.js +1 -1
- package/dist/sort-button/sort-button2.js +20 -20
- package/dist/sort-button/sort-button2.js.map +1 -1
- package/dist/sparkline/sparkline2.js +1 -1
- package/dist/star-rating/star-rating2.js +1 -1
- package/dist/steps/steps2.js +2 -2
- package/dist/switch/switch-group2.js +1 -1
- package/dist/switch/switch2.js +1 -1
- package/dist/tabs/tabs-group2.js +1 -1
- package/dist/tabs/tabs-item-group2.js +1 -1
- package/dist/tabs/tabs2.js +2 -2
- package/dist/tag/tag2.js +19 -19
- package/dist/tag/tag2.js.map +1 -1
- package/dist/textarea/textarea2.js +1 -1
- package/dist/time/time.d.ts +2 -0
- package/dist/time/time2.js +7 -4
- package/dist/time/time2.js.map +1 -1
- package/dist/toast/toast2.js +35 -29
- package/dist/toast/toast2.js.map +1 -1
- package/dist/toggletip/toggletip-footer2.js +1 -1
- package/dist/toggletip/toggletip-header2.js +1 -1
- package/dist/toggletip/toggletip2.js +25 -25
- package/dist/toggletip/toggletip2.js.map +1 -1
- package/dist/toolbar/toolbar2.js +1 -1
- package/dist/tooltip/tooltip2.js +1 -1
- package/dist/tree/tree-node2.js +45 -45
- package/dist/tree/tree-node2.js.map +1 -1
- package/dist/tree/tree2.js +1 -1
- package/dist/week/week.d.ts +2 -0
- package/dist/week/week2.js +7 -4
- package/dist/week/week2.js.map +1 -1
- package/package.json +14 -2
- package/dist/internal/controllers/i18n.controller.d.ts +0 -19
- package/dist/internal/controllers/i18n.controller.examples.js +0 -6
- package/dist/internal/controllers/i18n.controller.examples.js.map +0 -1
- package/dist/internal/controllers/i18n.controller.examples.json +0 -16
- package/dist/internal/controllers/i18n.controller.js +0 -38
- package/dist/internal/controllers/i18n.controller.js.map +0 -1
- package/dist/internal/services/i18n.service.d.ts +0 -64
- package/dist/internal/services/i18n.service.js +0 -73
- package/dist/internal/services/i18n.service.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## [2.20.0](https://github.com/NVIDIA/elements/compare/@nvidia-elements/core-v2.19.1...@nvidia-elements/core-v2.20.0) (2026-10-29)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* **core:** joystick ([a4461e1](https://github.com/NVIDIA/elements/commit/a4461e10930ec198bc43b846f7b090f5db70c371))
|
|
6
|
+
|
|
7
|
+
## [2.19.1](https://github.com/NVIDIA/elements/compare/@nvidia-elements/core-v2.19.0...@nvidia-elements/core-v2.19.1) (2026-10-29)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **foundations:** add i18n support ([074f46c](https://github.com/NVIDIA/elements/commit/074f46ce0e148d00f40e6e320abec01e6fee5704))
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **core:** i18n refactor ([4b6e10c](https://github.com/NVIDIA/elements/commit/4b6e10cd1ac30622b030be926e2d39e7e8039f95))
|
|
16
|
+
* **media:** i18n refactor ([a730282](https://github.com/NVIDIA/elements/commit/a73028216d642440d5fe583584703793e38d39d9))
|
|
17
|
+
* **viewport:** i18n refactor ([2a6825b](https://github.com/NVIDIA/elements/commit/2a6825b24be4ed4304c2b57c91bbaf3435a5a480))
|
|
18
|
+
|
|
1
19
|
## [2.19.0](https://github.com/NVIDIA/elements/compare/@nvidia-elements/core-v2.18.4...@nvidia-elements/core-v2.19.0) (2026-10-28)
|
|
2
20
|
|
|
3
21
|
### Features
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var e = Object.defineProperty, t = Object.getOwnPropertyDescriptor, n = Object.getOwnPropertyNames, r = Object.prototype.hasOwnProperty, i = (t, n) => {
|
|
3
|
+
let r = {};
|
|
4
|
+
for (var i in t) e(r, i, {
|
|
5
|
+
get: t[i],
|
|
6
|
+
enumerable: !0
|
|
7
|
+
});
|
|
8
|
+
return n || e(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
9
|
+
}, a = (i, a, o, s) => {
|
|
10
|
+
if (a && typeof a == "object" || typeof a == "function") for (var c = n(a), l = 0, u = c.length, d; l < u; l++) d = c[l], !r.call(i, d) && d !== o && e(i, d, {
|
|
11
|
+
get: ((e) => a[e]).bind(null, d),
|
|
12
|
+
enumerable: !(s = t(a, d)) || s.enumerable
|
|
13
|
+
});
|
|
14
|
+
return i;
|
|
15
|
+
}, o = (e, t, n) => (a(e, t, "default"), n && a(n, t, "default"));
|
|
16
|
+
//#endregion
|
|
17
|
+
export { i as __exportAll, o as __reExport };
|
|
@@ -1,77 +1,80 @@
|
|
|
1
1
|
import { audit as e } from "../internal/controllers/audit.controller.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import u from "../
|
|
12
|
-
import
|
|
13
|
-
import f from "./accordion.js";
|
|
14
|
-
import p from "./accordion-
|
|
15
|
-
import m from "./accordion-
|
|
16
|
-
import h from "
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
2
|
+
import { isFocusable as t } from "../internal/utils/focus.js";
|
|
3
|
+
import { generateId as n } from "../internal/utils/dom.js";
|
|
4
|
+
import { attachInternals as r } from "../internal/utils/a11y.js";
|
|
5
|
+
import { stateExpanded as i } from "../internal/controllers/state-expanded.controller.js";
|
|
6
|
+
import { TypeExpandableController as a } from "../internal/controllers/type-expandable.controller.js";
|
|
7
|
+
import { hostAttr as o } from "../internal/decorators/host-attr.js";
|
|
8
|
+
import { scopedRegistry as s } from "../internal/decorators/scoped-registry.js";
|
|
9
|
+
import { useStyles as c } from "../internal/styles/index.js";
|
|
10
|
+
import l from "../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorate.js";
|
|
11
|
+
import { IconButton as u } from "../icon-button/icon-button2.js";
|
|
12
|
+
import d from "./accordion.js";
|
|
13
|
+
import f from "./accordion-header.js";
|
|
14
|
+
import p from "./accordion-content.js";
|
|
15
|
+
import m from "./accordion-group.js";
|
|
16
|
+
import { LitElement as h, html as g } from "lit";
|
|
17
|
+
import { property as _ } from "lit/decorators/property.js";
|
|
18
|
+
import { I18nController as v } from "@nvidia-elements/foundations/internal/i18n";
|
|
19
19
|
import { queryAssignedElements as y } from "lit/decorators/query-assigned-elements.js";
|
|
20
20
|
//#region src/accordion/accordion.ts
|
|
21
|
-
var b =
|
|
21
|
+
var b = {
|
|
22
|
+
close: "close",
|
|
23
|
+
expand: "expand"
|
|
24
|
+
}, x = class extends h {
|
|
22
25
|
constructor(...e) {
|
|
23
26
|
super(...e), this.slot = "header";
|
|
24
27
|
}
|
|
25
28
|
static {
|
|
26
|
-
this.styles =
|
|
29
|
+
this.styles = c([f]);
|
|
27
30
|
}
|
|
28
31
|
static {
|
|
29
32
|
this.metadata = {
|
|
30
33
|
tag: "nve-accordion-header",
|
|
31
|
-
version: "2.
|
|
34
|
+
version: "2.20.0"
|
|
32
35
|
};
|
|
33
36
|
}
|
|
34
37
|
render() {
|
|
35
|
-
return
|
|
38
|
+
return g`<div internal-host><slot name="prefix"></slot><slot></slot><slot name="suffix"></slot></div>`;
|
|
36
39
|
}
|
|
37
40
|
connectedCallback() {
|
|
38
|
-
super.connectedCallback(),
|
|
41
|
+
super.connectedCallback(), r(this), this._internals.role = "heading", this._internals.ariaLevel = "2";
|
|
39
42
|
}
|
|
40
43
|
};
|
|
41
|
-
|
|
42
|
-
var
|
|
44
|
+
l([o()], x.prototype, "slot", void 0);
|
|
45
|
+
var S = class extends h {
|
|
43
46
|
static {
|
|
44
|
-
this.styles =
|
|
47
|
+
this.styles = c([p]);
|
|
45
48
|
}
|
|
46
49
|
static {
|
|
47
50
|
this.metadata = {
|
|
48
51
|
tag: "nve-accordion-content",
|
|
49
|
-
version: "2.
|
|
52
|
+
version: "2.20.0"
|
|
50
53
|
};
|
|
51
54
|
}
|
|
52
55
|
render() {
|
|
53
|
-
return
|
|
56
|
+
return g`<slot></slot>`;
|
|
54
57
|
}
|
|
55
|
-
},
|
|
58
|
+
}, C = class extends h {
|
|
56
59
|
constructor(...e) {
|
|
57
|
-
super(...e), this.#e = new
|
|
60
|
+
super(...e), this.#e = new v(this, b), this.#t = new a(this), this.i18n = this.#e.i18n, this.expanded = !1, this.disabled = !1, this.behaviorExpand = !1;
|
|
58
61
|
}
|
|
59
62
|
static {
|
|
60
|
-
this.styles =
|
|
63
|
+
this.styles = c([d]);
|
|
61
64
|
}
|
|
62
65
|
static {
|
|
63
66
|
this.metadata = {
|
|
64
67
|
tag: "nve-accordion",
|
|
65
|
-
version: "2.
|
|
68
|
+
version: "2.20.0",
|
|
66
69
|
children: [
|
|
67
|
-
b.metadata.tag,
|
|
68
70
|
x.metadata.tag,
|
|
69
|
-
|
|
71
|
+
S.metadata.tag,
|
|
72
|
+
u.metadata.tag
|
|
70
73
|
]
|
|
71
74
|
};
|
|
72
75
|
}
|
|
73
76
|
static {
|
|
74
|
-
this.elementDefinitions = { [
|
|
77
|
+
this.elementDefinitions = { [u.metadata.tag]: u };
|
|
75
78
|
}
|
|
76
79
|
#e;
|
|
77
80
|
#t;
|
|
@@ -79,56 +82,56 @@ var x = class extends g {
|
|
|
79
82
|
return this.shadowRoot?.querySelector("slot[name=header]")?.assignedElements()[0];
|
|
80
83
|
}
|
|
81
84
|
#r(e) {
|
|
82
|
-
!this.disabled && (!
|
|
85
|
+
!this.disabled && (!t(e) || e.id === "internal-trigger") && this.#t.toggle();
|
|
83
86
|
}
|
|
84
87
|
render() {
|
|
85
|
-
return
|
|
88
|
+
return g`<div internal-host><div id="header" @click="${(e) => this.#r(e.target)}" .ariaLabel="${this.expanded ? this.i18n.close : this.i18n.expand}" .ariaControls="${"content"}"><slot name="header"></slot><slot name="icon-button"><nve-icon-button part="icon-button" exportparts="icon:icon-button-icon" id="internal-trigger" container="inline" icon-name="caret" direction="${this.expanded ? "up" : "down"}" ?disabled="${this.disabled}" ?pressed="${this.expanded}" .expanded="${this.expanded}" .ariaLabel="${this.expanded ? this.i18n.close : this.i18n.expand}"></nve-icon-button></slot></div><div id="content" .ariaHidden="${!this.expanded}"><slot></slot></div></div>`;
|
|
86
89
|
}
|
|
87
90
|
connectedCallback() {
|
|
88
|
-
super.connectedCallback(),
|
|
91
|
+
super.connectedCallback(), r(this), this._internals.role = "region";
|
|
89
92
|
}
|
|
90
93
|
async firstUpdated(e) {
|
|
91
|
-
super.firstUpdated(e), this.#n && (this.#n.id ||=
|
|
94
|
+
super.firstUpdated(e), this.#n && (this.#n.id ||= n(), this.setAttribute("aria-labelledby", this.#n.id));
|
|
92
95
|
}
|
|
93
96
|
};
|
|
94
|
-
|
|
97
|
+
l([_({ type: Object })], C.prototype, "i18n", void 0), l([_({
|
|
95
98
|
type: String,
|
|
96
99
|
reflect: !0
|
|
97
|
-
})],
|
|
100
|
+
})], C.prototype, "container", void 0), l([_({
|
|
98
101
|
type: Boolean,
|
|
99
102
|
reflect: !0
|
|
100
|
-
})],
|
|
103
|
+
})], C.prototype, "expanded", void 0), l([_({
|
|
101
104
|
type: Boolean,
|
|
102
105
|
reflect: !0
|
|
103
|
-
})],
|
|
106
|
+
})], C.prototype, "disabled", void 0), l([_({
|
|
104
107
|
type: Boolean,
|
|
105
108
|
attribute: "behavior-expand"
|
|
106
|
-
})],
|
|
109
|
+
})], C.prototype, "behaviorExpand", void 0), C = l([
|
|
107
110
|
e(),
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
],
|
|
111
|
-
var
|
|
111
|
+
s(),
|
|
112
|
+
i()
|
|
113
|
+
], C);
|
|
114
|
+
var w = class extends h {
|
|
112
115
|
constructor(...e) {
|
|
113
116
|
super(...e), this.behaviorExpand = !1, this.behaviorExpandSingle = !1, this.#e = (e) => {
|
|
114
117
|
this.behaviorExpandSingle && this.accordions.find((t) => t === e.target) && this.accordions.filter((t) => t !== e.target).forEach((e) => e.expanded = !1);
|
|
115
118
|
};
|
|
116
119
|
}
|
|
117
120
|
static {
|
|
118
|
-
this.styles =
|
|
121
|
+
this.styles = c([m]);
|
|
119
122
|
}
|
|
120
123
|
static {
|
|
121
124
|
this.metadata = {
|
|
122
125
|
tag: "nve-accordion-group",
|
|
123
|
-
version: "2.
|
|
124
|
-
children: [
|
|
126
|
+
version: "2.20.0",
|
|
127
|
+
children: [C.metadata.tag]
|
|
125
128
|
};
|
|
126
129
|
}
|
|
127
130
|
render() {
|
|
128
|
-
return
|
|
131
|
+
return g`<div internal-host><slot @slotchange="${() => this.#t()}"></slot></div>`;
|
|
129
132
|
}
|
|
130
133
|
connectedCallback() {
|
|
131
|
-
super.connectedCallback(),
|
|
134
|
+
super.connectedCallback(), r(this), this._internals.role = "group", this.addEventListener("open", this.#e);
|
|
132
135
|
}
|
|
133
136
|
disconnectedCallback() {
|
|
134
137
|
super.disconnectedCallback(), this.removeEventListener("open", this.#e);
|
|
@@ -141,17 +144,17 @@ var C = class extends g {
|
|
|
141
144
|
this.accordions.forEach((e) => e.container = this.container), this.accordions.forEach((e) => e.behaviorExpand = this.behaviorExpand || this.behaviorExpandSingle);
|
|
142
145
|
}
|
|
143
146
|
};
|
|
144
|
-
|
|
147
|
+
l([_({
|
|
145
148
|
type: Boolean,
|
|
146
149
|
attribute: "behavior-expand"
|
|
147
|
-
})],
|
|
150
|
+
})], w.prototype, "behaviorExpand", void 0), l([_({
|
|
148
151
|
type: Boolean,
|
|
149
152
|
attribute: "behavior-expand-single"
|
|
150
|
-
})],
|
|
153
|
+
})], w.prototype, "behaviorExpandSingle", void 0), l([_({
|
|
151
154
|
type: String,
|
|
152
155
|
reflect: !0
|
|
153
|
-
})],
|
|
156
|
+
})], w.prototype, "container", void 0), l([y()], w.prototype, "accordions", void 0), w = l([e()], w);
|
|
154
157
|
//#endregion
|
|
155
|
-
export {
|
|
158
|
+
export { C as Accordion, S as AccordionContent, w as AccordionGroup, x as AccordionHeader };
|
|
156
159
|
|
|
157
160
|
//# sourceMappingURL=accordion2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion2.js","names":[],"sources":["../../src/accordion/accordion.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 { ContainerElement, Container } from '@nvidia-elements/core/internal';\nimport {\n stateExpanded,\n I18nController,\n TypeExpandableController,\n useStyles,\n attachInternals,\n generateId,\n isFocusable,\n hostAttr,\n audit,\n scopedRegistry\n} from '@nvidia-elements/core/internal';\nimport { IconButton } from '@nvidia-elements/core/icon-button';\nimport accordionStyleSheet from './accordion.css?inline';\nimport accordionHeaderStyleSheet from './accordion-header.css?inline';\nimport accordionContentStyleSheet from './accordion-content.css?inline';\nimport accordionGroupStyleSheet from './accordion-group.css?inline';\n\n/**\n * @element nve-accordion-header\n * @description Provides the clickable heading region of an accordion that toggles the visibility of associated content.\n * @documentation https://nvidia.github.io/elements/docs/elements/accordion/\n * @since 0.12.0\n * @entrypoint \\@nvidia-elements/core/accordion\n * @slot - Heading text and supporting content that labels the accordion section.\n * @slot prefix - slot for prefix content\n * @slot suffix - slot for suffix content\n * @cssprop --cursor\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/\n */\nexport class AccordionHeader extends LitElement {\n static styles = useStyles([accordionHeaderStyleSheet]);\n\n static readonly metadata = {\n tag: 'nve-accordion-header',\n version: '0.0.0'\n };\n\n /** @private */\n declare _internals: ElementInternals;\n\n render() {\n return html`\n <div internal-host>\n <slot name=\"prefix\"></slot>\n <slot></slot>\n <slot name=\"suffix\"></slot>\n </div>\n `;\n }\n\n /** @private */\n @hostAttr() slot = 'header';\n\n connectedCallback() {\n super.connectedCallback(); // Do not override connectedCallback w/out supering\n attachInternals(this);\n this._internals.role = 'heading';\n this._internals.ariaLevel = '2';\n }\n}\n\n/**\n * @element nve-accordion-content\n * @description Contains the collapsible body content that reveals or hides when the parent accordion expands or collapses.\n * @documentation https://nvidia.github.io/elements/docs/elements/accordion/\n * @since 0.12.0\n * @entrypoint \\@nvidia-elements/core/accordion\n * @slot - This is a default/unnamed slot for accordion content\n * @cssprop --padding\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/\n */\nexport class AccordionContent extends LitElement {\n static styles = useStyles([accordionContentStyleSheet]);\n\n static readonly metadata = {\n tag: 'nve-accordion-content',\n version: '0.0.0'\n };\n\n render() {\n return html`\n <slot></slot>\n `;\n }\n}\n\n/**\n * @element nve-accordion\n * @description An accordion is a vertical stack of interactive headings used to toggle the display of further information.\n * @documentation https://nvidia.github.io/elements/docs/elements/accordion/\n * @since 0.12.0\n * @entrypoint \\@nvidia-elements/core/accordion\n * @command --open - use to open the accordion\n * @command --close - use to close the accordion\n * @command --toggle - use to toggle the accordion\n * @slot - Content displayed in the collapsible region, typically an `nve-accordion-content` element.\n * @slot icon-button - icon elements to display for expand/collapse\n * @slot header - header element (Use `accordion-header` or custom content)\n * @cssprop --background\n * @cssprop --color\n * @cssprop --border-radius\n * @cssprop --header-padding - Padding around the header content.\n * @cssprop --cursor\n * @cssprop --transition\n * @csspart icon-button - The toggle icon button element\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/\n */\n@audit()\n@scopedRegistry()\n@stateExpanded<Accordion>()\nexport class Accordion extends LitElement implements ContainerElement {\n static styles = useStyles([accordionStyleSheet]);\n\n static readonly metadata = {\n tag: 'nve-accordion',\n version: '0.0.0',\n children: [AccordionHeader.metadata.tag, AccordionContent.metadata.tag, IconButton.metadata.tag]\n };\n\n static elementDefinitions = {\n [IconButton.metadata.tag]: IconButton\n };\n\n /** @private */\n declare _internals: ElementInternals;\n\n #i18nController: I18nController<this> = new I18nController<this>(this);\n #typeExpandableController = new TypeExpandableController(this);\n\n /**\n * Enables updating internal string values for internationalization.\n */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n /**\n * Determines the container styles of component. Flat suits nesting accordions within other containers. Inset suits more complex accordions where content needs distinct separation.\n */\n @property({ type: String, reflect: true }) container?: Extract<Container, 'flat' | 'inset'>;\n\n /**\n * Determines whether the accordion expands to display its contents.\n */\n @property({ type: Boolean, reflect: true }) expanded = false;\n\n /**\n * Determines whether the accordion is expandable\n */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /**\n * Determines whether the accordion should opt-in to stateful expansion behavior (defaults to stateless)\n */\n @property({ type: Boolean, attribute: 'behavior-expand' }) behaviorExpand = false;\n\n get #header() {\n return this.shadowRoot?.querySelector<HTMLSlotElement>('slot[name=header]')?.assignedElements()[0];\n }\n\n #toggle(element: HTMLElement) {\n if (!this.disabled && (!isFocusable(element) || element.id === 'internal-trigger')) {\n this.#typeExpandableController.toggle();\n }\n }\n\n render() {\n return html`\n <div internal-host>\n <div id=\"header\"\n @click=${(e: Event) => this.#toggle(e.target as HTMLElement)}\n .ariaLabel=${this.expanded ? this.i18n.close : this.i18n.expand}\n .ariaControls=${'content'}\n >\n <slot name=\"header\"></slot>\n\n <slot name=\"icon-button\">\n <nve-icon-button part=\"icon-button\"\n exportparts=\"icon:icon-button-icon\"\n id=\"internal-trigger\"\n container=\"inline\"\n icon-name=\"caret\"\n direction=${this.expanded ? 'up' : 'down'}\n ?disabled=${this.disabled}\n ?pressed=${this.expanded}\n .expanded=${this.expanded}\n .ariaLabel=${this.expanded ? this.i18n.close : this.i18n.expand}\n ></nve-icon-button>\n </slot>\n </div>\n\n <div id=\"content\" .ariaHidden=${!this.expanded}>\n <slot></slot>\n </div>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'region';\n }\n\n async firstUpdated(props: PropertyValues<this>) {\n super.firstUpdated(props);\n\n if (this.#header) {\n this.#header.id ||= generateId();\n this.setAttribute('aria-labelledby', this.#header.id);\n }\n }\n}\n\n/**\n * @element nve-accordion-group\n * @description Organizes many accordions into a cohesive group, enabling coordinated expand/collapse behavior such as single-item expansion.\n * @documentation https://nvidia.github.io/elements/docs/elements/accordion/\n * @since 0.12.0\n * @entrypoint \\@nvidia-elements/core/accordion\n * @cssprop --padding\n * @slot - This is a default slot for accordions within the group\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/\n */\n@audit()\nexport class AccordionGroup extends LitElement {\n declare _internals: ElementInternals;\n static styles = useStyles([accordionGroupStyleSheet]);\n\n /**\n * Determines whether the accordion should opt-in to stateful expansion behavior (defaults to stateless)\n */\n @property({ type: Boolean, attribute: 'behavior-expand' }) behaviorExpand = false;\n\n /**\n * Determines whether the accordion should opt-in to stateful expansion of a single accordion at a time\n */\n @property({ type: Boolean, attribute: 'behavior-expand-single' }) behaviorExpandSingle = false;\n\n /**\n * Controls the container style applied to child accordions. `flat` removes the visual container, `inset` adds rounded containment, and omission uses the default divided presentation.\n */\n @property({ type: String, reflect: true }) container?: Extract<Container, 'flat' | 'inset'>;\n\n static readonly metadata = {\n tag: 'nve-accordion-group',\n version: '0.0.0',\n children: [Accordion.metadata.tag]\n };\n\n @queryAssignedElements() private accordions!: Accordion[];\n\n render() {\n return html`\n <div internal-host>\n <slot @slotchange=${() => this.#updateChildAttributes()}></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'group';\n this.addEventListener('open', this.#onOpen);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('open', this.#onOpen);\n }\n\n #onOpen = (e: Event) => {\n if (this.behaviorExpandSingle && this.accordions.find(accordion => accordion === e.target)) {\n this.accordions.filter(accordion => accordion !== e.target).forEach(accordion => (accordion.expanded = false));\n }\n };\n\n updated(props: PropertyValues<this>) {\n super.updated(props);\n this.#updateChildAttributes();\n }\n\n #updateChildAttributes() {\n this.accordions.forEach(accordion => (accordion.container = this.container));\n this.accordions.forEach(accordion => (accordion.behaviorExpand = this.behaviorExpand || this.behaviorExpandSingle));\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsCA,IAAa,IAAb,cAAqC,EAAW;;EAsB3B,aAAA,KAAA,OAAA;;;EArBH,KAAA,SAAA,EAAU,CAAC,CAAyB,CAAC;;;EAE1B,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;CAKA,SAAS;EACP,OAAO,CAAI;CAOb;CAKA,oBAAoB;EAIlB,AAHA,MAAM,kBAAkB,GACxB,EAAgB,IAAI,GACpB,KAAK,WAAW,OAAO,WACvB,KAAK,WAAW,YAAY;CAC9B;AACF;AARG,EAAA,CAAA,EAAS,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA;AAoBZ,IAAa,IAAb,cAAsC,EAAW;;EAC/B,KAAA,SAAA,EAAU,CAAC,CAA0B,CAAC;;;EAE3B,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;CAEA,SAAS;EACP,OAAO,CAAI;CAGb;AACF,GA0Ba,IAAN,cAAwB,EAAuC;;EA0CQ,aA1BpC,KAAA,KAAA,IAAI,EAAqB,IAAI,GACzC,KAAA,KAAA,IAAI,EAAyB,IAAI,GAK1B,KAAA,OAAA,KAAK,GAAgB,MAUD,KAAA,WAAA,IAKA,KAAA,WAAA,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WAAW,SAAQ,MAAc,EAAU,iBAAiB,KAAK,kBAAkB,KAAK,oBAAqB;CACpH;AACF;AAvDG,EAAA,CAAA,EAAS;CAAE,MAAM;CAAS,WAAW;AAAkB,CAAC,CAAA,GAAA,EAAA,WAAA,kBAAA,KAAA,CAAA,GAKxD,EAAA,CAAA,EAAS;CAAE,MAAM;CAAS,WAAW;AAAyB,CAAC,CAAA,GAAA,EAAA,WAAA,wBAAA,KAAA,CAAA,GAK/D,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,aAAA,KAAA,CAAA,GAQxC,EAAA,CAAA,EAAsB,CAAA,GAAA,EAAA,WAAA,cAAA,KAAA,CAAA,GA1BxB,IAAA,EAAA,CAAA,EAAM,CAAA,GAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"accordion2.js","names":[],"sources":["../../src/accordion/accordion.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 { ContainerElement, Container } from '@nvidia-elements/core/internal';\nimport {\n stateExpanded,\n TypeExpandableController,\n useStyles,\n attachInternals,\n generateId,\n isFocusable,\n hostAttr,\n audit,\n scopedRegistry\n} from '@nvidia-elements/core/internal';\nimport { I18nController, type I18nDefaults } from '@nvidia-elements/foundations/internal/i18n';\nimport { IconButton } from '@nvidia-elements/core/icon-button';\nimport accordionStyleSheet from './accordion.css?inline';\nimport accordionHeaderStyleSheet from './accordion-header.css?inline';\nimport accordionContentStyleSheet from './accordion-content.css?inline';\nimport accordionGroupStyleSheet from './accordion-group.css?inline';\n\nconst i18nDefaults = {\n close: 'close',\n expand: 'expand'\n} satisfies I18nDefaults;\n\n/**\n * @element nve-accordion-header\n * @description Provides the clickable heading region of an accordion that toggles the visibility of associated content.\n * @documentation https://nvidia.github.io/elements/docs/elements/accordion/\n * @since 0.12.0\n * @entrypoint \\@nvidia-elements/core/accordion\n * @slot - Heading text and supporting content that labels the accordion section.\n * @slot prefix - slot for prefix content\n * @slot suffix - slot for suffix content\n * @cssprop --cursor\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/\n */\nexport class AccordionHeader extends LitElement {\n static styles = useStyles([accordionHeaderStyleSheet]);\n\n static readonly metadata = {\n tag: 'nve-accordion-header',\n version: '0.0.0'\n };\n\n /** @private */\n declare _internals: ElementInternals;\n\n render() {\n return html`\n <div internal-host>\n <slot name=\"prefix\"></slot>\n <slot></slot>\n <slot name=\"suffix\"></slot>\n </div>\n `;\n }\n\n /** @private */\n @hostAttr() slot = 'header';\n\n connectedCallback() {\n super.connectedCallback(); // Do not override connectedCallback w/out supering\n attachInternals(this);\n this._internals.role = 'heading';\n this._internals.ariaLevel = '2';\n }\n}\n\n/**\n * @element nve-accordion-content\n * @description Contains the collapsible body content that reveals or hides when the parent accordion expands or collapses.\n * @documentation https://nvidia.github.io/elements/docs/elements/accordion/\n * @since 0.12.0\n * @entrypoint \\@nvidia-elements/core/accordion\n * @slot - This is a default/unnamed slot for accordion content\n * @cssprop --padding\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/\n */\nexport class AccordionContent extends LitElement {\n static styles = useStyles([accordionContentStyleSheet]);\n\n static readonly metadata = {\n tag: 'nve-accordion-content',\n version: '0.0.0'\n };\n\n render() {\n return html`\n <slot></slot>\n `;\n }\n}\n\n/**\n * @element nve-accordion\n * @description An accordion is a vertical stack of interactive headings used to toggle the display of further information.\n * @documentation https://nvidia.github.io/elements/docs/elements/accordion/\n * @since 0.12.0\n * @entrypoint \\@nvidia-elements/core/accordion\n * @command --open - use to open the accordion\n * @command --close - use to close the accordion\n * @command --toggle - use to toggle the accordion\n * @slot - Content displayed in the collapsible region, typically an `nve-accordion-content` element.\n * @slot icon-button - icon elements to display for expand/collapse\n * @slot header - header element (Use `accordion-header` or custom content)\n * @cssprop --background\n * @cssprop --color\n * @cssprop --border-radius\n * @cssprop --header-padding - Padding around the header content.\n * @cssprop --cursor\n * @cssprop --transition\n * @csspart icon-button - The toggle icon button element\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/\n */\n@audit()\n@scopedRegistry()\n@stateExpanded<Accordion>()\nexport class Accordion extends LitElement implements ContainerElement {\n static styles = useStyles([accordionStyleSheet]);\n\n static readonly metadata = {\n tag: 'nve-accordion',\n version: '0.0.0',\n children: [AccordionHeader.metadata.tag, AccordionContent.metadata.tag, IconButton.metadata.tag]\n };\n\n static elementDefinitions = {\n [IconButton.metadata.tag]: IconButton\n };\n\n /** @private */\n declare _internals: ElementInternals;\n\n #i18nController: I18nController<this> = new I18nController<this>(this, i18nDefaults);\n #typeExpandableController = new TypeExpandableController(this);\n\n /**\n * Enables updating internal string values for internationalization.\n */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n /**\n * Determines the container styles of component. Flat suits nesting accordions within other containers. Inset suits more complex accordions where content needs distinct separation.\n */\n @property({ type: String, reflect: true }) container?: Extract<Container, 'flat' | 'inset'>;\n\n /**\n * Determines whether the accordion expands to display its contents.\n */\n @property({ type: Boolean, reflect: true }) expanded = false;\n\n /**\n * Determines whether the accordion is expandable\n */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /**\n * Determines whether the accordion should opt-in to stateful expansion behavior (defaults to stateless)\n */\n @property({ type: Boolean, attribute: 'behavior-expand' }) behaviorExpand = false;\n\n get #header() {\n return this.shadowRoot?.querySelector<HTMLSlotElement>('slot[name=header]')?.assignedElements()[0];\n }\n\n #toggle(element: HTMLElement) {\n if (!this.disabled && (!isFocusable(element) || element.id === 'internal-trigger')) {\n this.#typeExpandableController.toggle();\n }\n }\n\n render() {\n return html`\n <div internal-host>\n <div id=\"header\"\n @click=${(e: Event) => this.#toggle(e.target as HTMLElement)}\n .ariaLabel=${this.expanded ? this.i18n.close : this.i18n.expand}\n .ariaControls=${'content'}\n >\n <slot name=\"header\"></slot>\n\n <slot name=\"icon-button\">\n <nve-icon-button part=\"icon-button\"\n exportparts=\"icon:icon-button-icon\"\n id=\"internal-trigger\"\n container=\"inline\"\n icon-name=\"caret\"\n direction=${this.expanded ? 'up' : 'down'}\n ?disabled=${this.disabled}\n ?pressed=${this.expanded}\n .expanded=${this.expanded}\n .ariaLabel=${this.expanded ? this.i18n.close : this.i18n.expand}\n ></nve-icon-button>\n </slot>\n </div>\n\n <div id=\"content\" .ariaHidden=${!this.expanded}>\n <slot></slot>\n </div>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'region';\n }\n\n async firstUpdated(props: PropertyValues<this>) {\n super.firstUpdated(props);\n\n if (this.#header) {\n this.#header.id ||= generateId();\n this.setAttribute('aria-labelledby', this.#header.id);\n }\n }\n}\n\n/**\n * @element nve-accordion-group\n * @description Organizes many accordions into a cohesive group, enabling coordinated expand/collapse behavior such as single-item expansion.\n * @documentation https://nvidia.github.io/elements/docs/elements/accordion/\n * @since 0.12.0\n * @entrypoint \\@nvidia-elements/core/accordion\n * @cssprop --padding\n * @slot - This is a default slot for accordions within the group\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/\n */\n@audit()\nexport class AccordionGroup extends LitElement {\n declare _internals: ElementInternals;\n static styles = useStyles([accordionGroupStyleSheet]);\n\n /**\n * Determines whether the accordion should opt-in to stateful expansion behavior (defaults to stateless)\n */\n @property({ type: Boolean, attribute: 'behavior-expand' }) behaviorExpand = false;\n\n /**\n * Determines whether the accordion should opt-in to stateful expansion of a single accordion at a time\n */\n @property({ type: Boolean, attribute: 'behavior-expand-single' }) behaviorExpandSingle = false;\n\n /**\n * Controls the container style applied to child accordions. `flat` removes the visual container, `inset` adds rounded containment, and omission uses the default divided presentation.\n */\n @property({ type: String, reflect: true }) container?: Extract<Container, 'flat' | 'inset'>;\n\n static readonly metadata = {\n tag: 'nve-accordion-group',\n version: '0.0.0',\n children: [Accordion.metadata.tag]\n };\n\n @queryAssignedElements() private accordions!: Accordion[];\n\n render() {\n return html`\n <div internal-host>\n <slot @slotchange=${() => this.#updateChildAttributes()}></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'group';\n this.addEventListener('open', this.#onOpen);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('open', this.#onOpen);\n }\n\n #onOpen = (e: Event) => {\n if (this.behaviorExpandSingle && this.accordions.find(accordion => accordion === e.target)) {\n this.accordions.filter(accordion => accordion !== e.target).forEach(accordion => (accordion.expanded = false));\n }\n };\n\n updated(props: PropertyValues<this>) {\n super.updated(props);\n this.#updateChildAttributes();\n }\n\n #updateChildAttributes() {\n this.accordions.forEach(accordion => (accordion.container = this.container));\n this.accordions.forEach(accordion => (accordion.behaviorExpand = this.behaviorExpand || this.behaviorExpandSingle));\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA0BA,IAAM,IAAe;CACnB,OAAO;CACP,QAAQ;AACV,GAca,IAAb,cAAqC,EAAW;;EAsB3B,aAAA,KAAA,OAAA;;;EArBH,KAAA,SAAA,EAAU,CAAC,CAAyB,CAAC;;;EAE1B,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;CAKA,SAAS;EACP,OAAO,CAAI;CAOb;CAKA,oBAAoB;EAIlB,AAHA,MAAM,kBAAkB,GACxB,EAAgB,IAAI,GACpB,KAAK,WAAW,OAAO,WACvB,KAAK,WAAW,YAAY;CAC9B;AACF;AARG,EAAA,CAAA,EAAS,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA;AAoBZ,IAAa,IAAb,cAAsC,EAAW;;EAC/B,KAAA,SAAA,EAAU,CAAC,CAA0B,CAAC;;;EAE3B,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;CAEA,SAAS;E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3B,KAAK,oBAAoB,QAAQ,KAAK,EAAO;CAC/C;CAEA;CAMA,QAAQ,GAA6B;EAEnC,AADA,MAAM,QAAQ,CAAK,GACnB,KAAK,GAAuB;CAC9B;CAEA,KAAyB;EAEvB,AADA,KAAK,WAAW,SAAQ,MAAc,EAAU,YAAY,KAAK,SAAU,GAC3E,KAAK,WAAW,SAAQ,MAAc,EAAU,iBAAiB,KAAK,kBAAkB,KAAK,oBAAqB;CACpH;AACF;AAvDG,EAAA,CAAA,EAAS;CAAE,MAAM;CAAS,WAAW;AAAkB,CAAC,CAAA,GAAA,EAAA,WAAA,kBAAA,KAAA,CAAA,GAKxD,EAAA,CAAA,EAAS;CAAE,MAAM;CAAS,WAAW;AAAyB,CAAC,CAAA,GAAA,EAAA,WAAA,wBAAA,KAAA,CAAA,GAK/D,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,aAAA,KAAA,CAAA,GAQxC,EAAA,CAAA,EAAsB,CAAA,GAAA,EAAA,WAAA,cAAA,KAAA,CAAA,GA1BxB,IAAA,EAAA,CAAA,EAAM,CAAA,GAAA,CAAA"}
|
package/dist/alert/alert2.js
CHANGED
|
@@ -1,62 +1,68 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import l from "../
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import f from "./alert.
|
|
12
|
-
import p from "
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
1
|
+
import { appendRootNodeStyle as e } from "../internal/utils/dom.js";
|
|
2
|
+
import { attachInternals as t } from "../internal/utils/a11y.js";
|
|
3
|
+
import { TypeClosableController as n } from "../internal/controllers/type-closable.controller.js";
|
|
4
|
+
import { scopedRegistry as r } from "../internal/decorators/scoped-registry.js";
|
|
5
|
+
import { statusStateStyles as i, supportStateStyles as a, useStyles as o } from "../internal/styles/index.js";
|
|
6
|
+
import { statusIcons as s } from "../internal/types/index.js";
|
|
7
|
+
import c from "../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorate.js";
|
|
8
|
+
import { Icon as l } from "../icon/icon2.js";
|
|
9
|
+
import { IconButton as u } from "../icon-button/icon-button2.js";
|
|
10
|
+
import d from "./alert.global.js";
|
|
11
|
+
import f from "./alert.js";
|
|
12
|
+
import { LitElement as p, html as m } from "lit";
|
|
13
|
+
import { property as h } from "lit/decorators/property.js";
|
|
14
|
+
import { I18nController as g } from "@nvidia-elements/foundations/internal/i18n";
|
|
15
15
|
import { queryAssignedElements as _ } from "lit/decorators/query-assigned-elements.js";
|
|
16
16
|
//#region src/alert/alert.ts
|
|
17
|
-
var v =
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
var v = {
|
|
18
|
+
close: "close",
|
|
19
|
+
danger: "danger",
|
|
20
|
+
information: "information",
|
|
21
|
+
success: "success",
|
|
22
|
+
warning: "warning"
|
|
23
|
+
}, y = class extends p {
|
|
24
|
+
constructor(...e) {
|
|
25
|
+
super(...e), this.closable = !1, this.#e = new n(this), this.#t = new g(this, v), this.i18n = this.#t.i18n;
|
|
20
26
|
}
|
|
21
27
|
static {
|
|
22
|
-
this.styles =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
this.styles = o([
|
|
29
|
+
f,
|
|
30
|
+
i,
|
|
31
|
+
a
|
|
26
32
|
]);
|
|
27
33
|
}
|
|
28
34
|
static {
|
|
29
35
|
this.metadata = {
|
|
30
36
|
tag: "nve-alert",
|
|
31
|
-
version: "2.
|
|
37
|
+
version: "2.20.0"
|
|
32
38
|
};
|
|
33
39
|
}
|
|
34
40
|
static {
|
|
35
41
|
this.elementDefinitions = {
|
|
36
|
-
[
|
|
37
|
-
[
|
|
42
|
+
[l.metadata.tag]: l,
|
|
43
|
+
[u.metadata.tag]: u
|
|
38
44
|
};
|
|
39
45
|
}
|
|
40
46
|
#e;
|
|
41
47
|
#t;
|
|
42
48
|
render() {
|
|
43
|
-
return
|
|
49
|
+
return m`<div internal-host @slotchange="${() => this.requestUpdate()}"><slot name="icon"><nve-icon part="icon" role="img" .name="${s[this.status] ?? s[""]}" aria-label="${(this.status ? this.i18n[this.status] : void 0) ?? this.i18n.information ?? "information"}"></nve-icon></slot><slot name="prefix" ?hidden="${!this.prefixItems.length}"></slot><slot></slot><slot name="actions" ?hidden="${!this.actionItems.length}"></slot>${this.closable ? m`<nve-icon-button part="icon-button" exportparts="icon:icon-button-icon" @click="${() => this.#e.close()}" container="flat" icon-name="cancel" size="sm" .ariaLabel="${this.i18n.close}"></nve-icon-button>` : ""}</div><slot name="content" part="_content"></slot>`;
|
|
44
50
|
}
|
|
45
51
|
connectedCallback() {
|
|
46
|
-
super.connectedCallback(),
|
|
52
|
+
super.connectedCallback(), t(this), e(this, d), this._internals.role = "alert";
|
|
47
53
|
}
|
|
48
54
|
};
|
|
49
|
-
|
|
55
|
+
c([h({
|
|
50
56
|
type: String,
|
|
51
57
|
reflect: !0
|
|
52
|
-
})],
|
|
58
|
+
})], y.prototype, "status", void 0), c([h({ type: Boolean })], y.prototype, "closable", void 0), c([h({ type: Object })], y.prototype, "i18n", void 0), c([_({
|
|
53
59
|
slot: "prefix",
|
|
54
60
|
flatten: !0
|
|
55
|
-
})],
|
|
61
|
+
})], y.prototype, "prefixItems", void 0), c([_({
|
|
56
62
|
slot: "actions",
|
|
57
63
|
flatten: !0
|
|
58
|
-
})],
|
|
64
|
+
})], y.prototype, "actionItems", void 0), y = c([r()], y);
|
|
59
65
|
//#endregion
|
|
60
|
-
export {
|
|
66
|
+
export { y as Alert };
|
|
61
67
|
|
|
62
68
|
//# sourceMappingURL=alert2.js.map
|
package/dist/alert/alert2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert2.js","names":[],"sources":["../../src/alert/alert.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 { queryAssignedElements } from 'lit/decorators/query-assigned-elements.js';\nimport { Icon } from '@nvidia-elements/core/icon';\nimport { IconButton } from '@nvidia-elements/core/icon-button';\nimport type { SupportStatus, TaskStatus } from '@nvidia-elements/core/internal';\nimport {\n attachInternals,\n
|
|
1
|
+
{"version":3,"file":"alert2.js","names":[],"sources":["../../src/alert/alert.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 { queryAssignedElements } from 'lit/decorators/query-assigned-elements.js';\nimport { Icon } from '@nvidia-elements/core/icon';\nimport { IconButton } from '@nvidia-elements/core/icon-button';\nimport type { SupportStatus, TaskStatus } from '@nvidia-elements/core/internal';\nimport {\n attachInternals,\n statusIcons,\n TypeClosableController,\n useStyles,\n statusStateStyles,\n supportStateStyles,\n appendRootNodeStyle,\n scopedRegistry\n} from '@nvidia-elements/core/internal';\nimport { I18nController, type I18nDefaults } from '@nvidia-elements/foundations/internal/i18n';\nimport globalStyles from './alert.global.css?inline';\nimport styles from './alert.css?inline';\n\nconst i18nDefaults = {\n close: 'close',\n danger: 'danger',\n information: 'information',\n success: 'success',\n warning: 'warning'\n} satisfies I18nDefaults;\n\n/**\n * @element nve-alert\n * @description Alert is an element that displays a brief, important message in a way that attracts the user's attention without interrupting the user's task.\n * @documentation https://nvidia.github.io/elements/docs/elements/alert/\n * @since 0.3.0\n * @entrypoint \\@nvidia-elements/core/alert\n * @event close - Dispatched when the alert closes within an alert group.\n * @command --close - Use to set the alert closed/hidden state.\n * @slot icon - Icon slot renders on the left side of the alert. Icons typically represent the alert's status.\n * @slot prefix - Prefix slot renders between the icon and the content. Prefixes typically represent the alert's status.\n * @slot actions - Actions render on the right side of the alert. Actions are typically buttons, but can also be links. Use actions for steps the user can take to resolve the alert.\n * @slot content - Content for large overflow text.\n * @slot - Default content placed inside of the alert.\n * @cssprop --gap\n * @cssprop --font-size\n * @cssprop --color\n * @cssprop --icon-color\n * @cssprop --icon-size\n * @cssprop --font-weight\n * @cssprop --justify-content\n * @cssprop --align-items\n * @cssprop --min-height\n * @cssprop --text-transform\n * @cssprop --height\n * @cssprop --width\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/alert/\n */\n@scopedRegistry()\nexport class Alert extends LitElement {\n static styles = useStyles([styles, statusStateStyles, supportStateStyles]);\n\n static readonly metadata = {\n tag: 'nve-alert',\n version: '0.0.0'\n };\n\n static elementDefinitions = {\n [Icon.metadata.tag]: Icon,\n [IconButton.metadata.tag]: IconButton\n };\n\n /** Defines visual treatment to represent a ongoing task or support status. */\n @property({ type: String, reflect: true }) status?: SupportStatus | TaskStatus | 'muted';\n\n /** When used in an `alert-group` the `closable` property enables dismissing alerts within the same group. */\n @property({ type: Boolean }) closable = false;\n\n #typeClosableController = new TypeClosableController(this);\n\n #i18nController: I18nController<this> = new I18nController<this>(this, i18nDefaults);\n\n /** Enables updating internal string values for internationalization. */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n @queryAssignedElements({ slot: 'prefix', flatten: true }) private prefixItems!: HTMLElement[];\n\n @queryAssignedElements({ slot: 'actions', flatten: true }) private actionItems!: HTMLElement[];\n\n /** @private */\n declare _internals: ElementInternals;\n\n render() {\n return html`\n <div internal-host @slotchange=${() => this.requestUpdate()}>\n <slot name=\"icon\"><nve-icon part=\"icon\" role=\"img\" .name=${statusIcons[this.status as string] ?? statusIcons['']} aria-label=${(this.status ? (this.i18n as Record<string, string>)[this.status] : undefined) ?? this.i18n.information ?? 'information'}></nve-icon></slot>\n <slot name=\"prefix\" ?hidden=${!this.prefixItems.length}></slot>\n <slot></slot>\n <slot name=\"actions\" ?hidden=${!this.actionItems.length}></slot>\n ${this.closable ? html`<nve-icon-button part=\"icon-button\" exportparts=\"icon:icon-button-icon\" @click=${() => this.#typeClosableController.close()} container=\"flat\" icon-name=\"cancel\" size=\"sm\" .ariaLabel=${this.i18n.close}></nve-icon-button>` : ''}\n </div>\n <slot name=\"content\" part=\"_content\"></slot>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n appendRootNodeStyle(this, globalStyles);\n this._internals.role = 'alert';\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAuBA,IAAM,IAAe;CACnB,OAAO;CACP,QAAQ;CACR,aAAa;CACb,SAAS;CACT,SAAS;AACX,GA8Ba,IAAN,cAAoB,EAAW;;EAwBD,aAPK,KAAA,WAAA,IAEd,KAAA,KAAA,IAAI,EAAuB,IAAI,GAEjB,KAAA,KAAA,IAAI,EAAqB,MAAM,CAAY,GAGhD,KAAA,OAAA,KAAK,GAAgB;;;EAvBxC,KAAA,SAAA,EAAU;GAAC;GAAQ;GAAmB;EAAkB,CAAC;;;EAE9C,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;;EAE4B,KAAA,qBAAA;IACzB,EAAK,SAAS,MAAM;IACpB,EAAW,SAAS,MAAM;EAC7B;;CAQA;CAEA;CAYA,SAAS;EACP,OAAO,CAAI,yCAC8B,KAAK,cAAc,EAAE,8DACC,EAAY,KAAK,WAAqB,EAAY,IAAI,iBAAe,KAAK,SAAU,KAAK,KAAgC,KAAK,UAAU,KAAA,MAAc,KAAK,KAAK,eAAe,cAAc,mDAC1N,CAAC,KAAK,YAAY,OAAO,sDAExB,CAAC,KAAK,YAAY,OAAO,WACtD,KAAK,WAAW,CAAI,yFAAwF,KAAK,GAAwB,MAAM,EAAE,8DAA4D,KAAK,KAAK,MAAM,wBAAuB,GAAG;CAI/P;CAEA,oBAAoB;EAIlB,AAHA,MAAM,kBAAkB,GACxB,EAAgB,IAAI,GACpB,EAAoB,MAAM,CAAY,GACtC,KAAK,WAAW,OAAO;CACzB;AACF;AAtCG,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,UAAA,KAAA,CAAA,GAGxC,EAAA,CAAA,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,GAAA,EAAA,WAAA,YAAA,KAAA,CAAA,GAO1B,EAAA,CAAA,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA,GAEzB,EAAA,CAAA,EAAsB;CAAE,MAAM;CAAU,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,eAAA,KAAA,CAAA,GAEvD,EAAA,CAAA,EAAsB;CAAE,MAAM;CAAW,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,eAAA,KAAA,CAAA,GA7B1D,IAAA,EAAA,CAAA,EAAe,CAAA,GAAA,CAAA"}
|
package/dist/avatar/avatar2.js
CHANGED
package/dist/badge/badge.d.ts
CHANGED
|
@@ -51,12 +51,6 @@ export declare class Badge extends LitElement {
|
|
|
51
51
|
};
|
|
52
52
|
/** @private */
|
|
53
53
|
_internals: ElementInternals;
|
|
54
|
-
/**
|
|
55
|
-
* Enables updating internal string values for internationalization.
|
|
56
|
-
*/
|
|
57
|
-
i18n: Partial<import("@nvidia-elements/core/internal").I18nStrings & {
|
|
58
|
-
__set: boolean;
|
|
59
|
-
}>;
|
|
60
54
|
render(): import("lit-html").TemplateResult<1>;
|
|
61
55
|
connectedCallback(): void;
|
|
62
56
|
updated(props: PropertyValues<this>): void;
|
package/dist/badge/badge2.js
CHANGED
|
@@ -1,74 +1,69 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import l from "../
|
|
8
|
-
import
|
|
9
|
-
import d from "
|
|
10
|
-
import {
|
|
11
|
-
import { property as h } from "lit/decorators/property.js";
|
|
1
|
+
import { attachInternals as e } from "../internal/utils/a11y.js";
|
|
2
|
+
import { typeSSR as t } from "../internal/controllers/type-ssr.controller.js";
|
|
3
|
+
import { scopedRegistry as n } from "../internal/decorators/scoped-registry.js";
|
|
4
|
+
import { colorStateStyles as r, statusStateStyles as i, supportStateStyles as a, useStyles as o } from "../internal/styles/index.js";
|
|
5
|
+
import { statusIcons as s } from "../internal/types/index.js";
|
|
6
|
+
import c from "../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorate.js";
|
|
7
|
+
import { Icon as l } from "../icon/icon2.js";
|
|
8
|
+
import u from "./badge.js";
|
|
9
|
+
import { LitElement as d, html as f, nothing as p } from "lit";
|
|
10
|
+
import { property as m } from "lit/decorators/property.js";
|
|
12
11
|
//#region src/badge/badge.ts
|
|
13
|
-
var
|
|
14
|
-
constructor(...t) {
|
|
15
|
-
super(...t), this.#t = new e(this), this.i18n = this.#t.i18n;
|
|
16
|
-
}
|
|
12
|
+
var h = class extends d {
|
|
17
13
|
static {
|
|
18
|
-
this.styles =
|
|
19
|
-
|
|
14
|
+
this.styles = o([
|
|
15
|
+
u,
|
|
16
|
+
i,
|
|
20
17
|
a,
|
|
21
|
-
|
|
22
|
-
i
|
|
18
|
+
r
|
|
23
19
|
]);
|
|
24
20
|
}
|
|
25
21
|
static {
|
|
26
22
|
this.metadata = {
|
|
27
23
|
tag: "nve-badge",
|
|
28
|
-
version: "2.
|
|
24
|
+
version: "2.20.0"
|
|
29
25
|
};
|
|
30
26
|
}
|
|
31
27
|
static {
|
|
32
|
-
this.elementDefinitions = { [
|
|
28
|
+
this.elementDefinitions = { [l.metadata.tag]: l };
|
|
33
29
|
}
|
|
34
30
|
get #e() {
|
|
35
|
-
return this.status &&
|
|
31
|
+
return this.status && s[this.status] === "dot" ? "sm" : "md";
|
|
36
32
|
}
|
|
37
|
-
#t;
|
|
38
33
|
render() {
|
|
39
|
-
return
|
|
34
|
+
return f`<div internal-host><slot name="prefix-icon">${this.status ? f`<nve-icon part="_icon" .name="${s[this.status] ?? ""}" .size="${this.#e}" aria-hidden="true"></nve-icon>` : p}</slot><slot @slotchange="${this.#t}"></slot><slot name="suffix-icon"></slot></div>`;
|
|
40
35
|
}
|
|
41
36
|
connectedCallback() {
|
|
42
|
-
super.connectedCallback(),
|
|
37
|
+
super.connectedCallback(), e(this), this._internals.role = "status";
|
|
43
38
|
}
|
|
44
39
|
updated(e) {
|
|
45
|
-
super.updated(e), this.#
|
|
40
|
+
super.updated(e), this.#n();
|
|
46
41
|
}
|
|
47
|
-
#
|
|
48
|
-
this.#
|
|
42
|
+
#t() {
|
|
43
|
+
this.#n(), this.#r();
|
|
49
44
|
}
|
|
50
|
-
#
|
|
45
|
+
#n() {
|
|
51
46
|
this._internals.ariaLabel = this.textContent;
|
|
52
47
|
}
|
|
53
|
-
#
|
|
48
|
+
#r() {
|
|
54
49
|
let e = this.shadowRoot.querySelector("slot:not([name])").assignedElements().find((e) => e.matches("nve-icon") && !e.slot);
|
|
55
50
|
e && (e.slot = "prefix-icon");
|
|
56
51
|
}
|
|
57
52
|
};
|
|
58
|
-
|
|
53
|
+
c([m({
|
|
59
54
|
type: String,
|
|
60
55
|
reflect: !0
|
|
61
|
-
})],
|
|
56
|
+
})], h.prototype, "status", void 0), c([m({
|
|
62
57
|
type: String,
|
|
63
58
|
reflect: !0
|
|
64
|
-
})],
|
|
59
|
+
})], h.prototype, "color", void 0), c([m({
|
|
65
60
|
type: String,
|
|
66
61
|
reflect: !0
|
|
67
|
-
})],
|
|
62
|
+
})], h.prototype, "container", void 0), c([m({
|
|
68
63
|
type: String,
|
|
69
64
|
reflect: !0
|
|
70
|
-
})],
|
|
65
|
+
})], h.prototype, "prominence", void 0), h = c([t(), n()], h);
|
|
71
66
|
//#endregion
|
|
72
|
-
export {
|
|
67
|
+
export { h as Badge };
|
|
73
68
|
|
|
74
69
|
//# sourceMappingURL=badge2.js.map
|