nve-designsystem 3.2.0 → 3.3.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/chunks/chunk.2PCBEMQZ.js +163 -226
- package/chunks/chunk.36O46B5H.js +15 -15
- package/chunks/chunk.4TUIT776.js +78 -96
- package/chunks/chunk.5JY5FUCG.js +965 -1245
- package/chunks/chunk.5P45LHIX.js +668 -96
- package/chunks/chunk.6CTB5ZDJ.js +107 -100
- package/chunks/chunk.B4BZKR24.js +29 -39
- package/chunks/chunk.D5YQDJ7X.js +122 -166
- package/chunks/chunk.EA437WHD.js +5 -5
- package/chunks/chunk.GI7VDIWX.js +14 -15
- package/chunks/chunk.GMYPQTFK.js +18 -20
- package/chunks/chunk.HVTXQL7M.js +191 -215
- package/chunks/chunk.IKV4VH3T.js +18 -16
- package/chunks/chunk.IVVHNXMC.js +26 -27
- package/chunks/chunk.JHOXTQXA.js +65 -74
- package/chunks/chunk.JXOKFADN.js +63 -90
- package/chunks/chunk.K7JGTRV7.js +24 -23
- package/chunks/chunk.KPLQLAWP.js +132 -147
- package/chunks/chunk.LD4M4QGE.js +61 -74
- package/chunks/chunk.MSKEYBDI.js +53 -71
- package/chunks/chunk.NYIIDP5N.js +39 -45
- package/chunks/chunk.RWUUFNUL.js +91 -114
- package/chunks/chunk.SAPQLUO4.js +249 -228
- package/chunks/chunk.SI4ACBFK.js +139 -5
- package/chunks/chunk.TP2GB2HO.js +361 -460
- package/chunks/chunk.UDWRA64J.js +185 -223
- package/chunks/chunk.URTPIBTY.js +119 -151
- package/chunks/chunk.VESXC477.js +63 -66
- package/chunks/chunk.XA43ZQPC.js +198 -313
- package/chunks/chunk.XQ2OKYYA.js +25 -26
- package/chunks/chunk.XZNBUGX7.js +6 -6
- package/chunks/chunk.YHLNUJ7P.js +93 -116
- package/chunks/chunk.ZH2AND3P.js +340 -399
- package/chunks/chunk.ZL53POKZ.js +61 -156
- package/chunks/chunk.js +20 -0
- package/chunks/class-map.js +49 -45
- package/chunks/decorate.js +105 -0
- package/chunks/directive-helpers.js +5 -7
- package/chunks/if-defined.js +5 -5
- package/chunks/lit.js +525 -0
- package/chunks/live.js +24 -24
- package/chunks/nve-alert.component.js +163 -0
- package/chunks/nve-carousel-item.component.js +36 -0
- package/chunks/nve-carousel.component.js +41 -0
- package/chunks/nve-checkbox-group.component.js +114 -0
- package/chunks/nve-checkbox.component.js +28 -0
- package/chunks/nve-dialog.component.js +39 -0
- package/chunks/nve-divider.component.js +23 -0
- package/chunks/nve-drawer.component.js +40 -0
- package/chunks/nve-dropdown.component.js +83 -0
- package/chunks/nve-input.component.js +80 -0
- package/chunks/nve-label.component.js +89 -0
- package/chunks/nve-menu-item.component.js +35 -0
- package/chunks/nve-menu.component.js +17 -0
- package/chunks/nve-option.component.js +27 -0
- package/chunks/nve-popup.component.js +15 -0
- package/chunks/nve-radio-button.component.js +20 -0
- package/chunks/nve-radio-group.component.js +78 -0
- package/chunks/nve-radio.component.js +18 -0
- package/chunks/nve-select.component.js +58 -0
- package/chunks/nve-skeleton.component.js +20 -0
- package/chunks/nve-spinner.component.js +23 -0
- package/chunks/nve-tooltip.component.js +20 -0
- package/chunks/nve-warning-level.component.js +57 -0
- package/chunks/ref.js +75 -84
- package/chunks/shoelace.js +10006 -0
- package/chunks/static-html.js +27 -0
- package/chunks/unsafe-html.js +24 -20
- package/chunks/updateInvalidProperty.js +7 -7
- package/chunks/watch.js +20 -20
- package/components/nve-accordion/nve-accordion.component.js +24 -30
- package/components/nve-accordion-item/nve-accordion-item.component.js +30 -64
- package/components/nve-accordion-item/nve-accordion-item.styles.js +5 -5
- package/components/nve-alert/nve-alert.component.js +2 -227
- package/components/nve-alert/nve-alert.styles.js +45 -27
- package/components/nve-badge/nve-badge.component.js +41 -45
- package/components/nve-badge/nve-badge.styles.js +33 -31
- package/components/nve-button/nve-button.component.d.ts +110 -10
- package/components/nve-button/nve-button.component.js +146 -39
- package/components/nve-button/nve-button.styles.js +214 -157
- package/components/nve-carousel/nve-carousel.component.js +2 -47
- package/components/nve-carousel/nve-carousel.styles.js +6 -6
- package/components/nve-carousel-item/nve-carousel-item.component.js +2 -40
- package/components/nve-carousel-item/nve-carousel-item.styles.js +5 -5
- package/components/nve-carousel-thumbnail/nve-carousel-thumbnail.component.js +44 -54
- package/components/nve-carousel-thumbnail/nve-carousel-thumbnail.styles.js +5 -5
- package/components/nve-checkbox/nve-checkbox.component.js +2 -34
- package/components/nve-checkbox/nve-checkbox.styles.js +7 -7
- package/components/nve-checkbox-group/nve-checkbox-group.component.js +2 -152
- package/components/nve-checkbox-group/nve-checkbox-group.styles.js +5 -5
- package/components/nve-combobox/nve-combobox.component.js +222 -440
- package/components/nve-combobox/nve-combobox.styles.js +6 -6
- package/components/nve-darkmode-switch/nve-darkmode-switch.component.js +32 -38
- package/components/nve-dialog/nve-dialog-styles.js +6 -6
- package/components/nve-dialog/nve-dialog.component.js +2 -54
- package/components/nve-divider/nve-divider.component.js +2 -30
- package/components/nve-drawer/nve-drawer.component.js +2 -44
- package/components/nve-drawer/nve-drawer.styles.js +6 -6
- package/components/nve-dropdown/nve-dropdown.component.js +2 -79
- package/components/nve-dropdown/nve-dropdown.styles.js +5 -5
- package/components/nve-heading/nve-heading.component.d.ts +29 -0
- package/components/nve-heading/nve-heading.component.js +45 -0
- package/components/nve-heading/nve-heading.styles.d.ts +2 -0
- package/components/nve-heading/nve-heading.styles.js +41 -0
- package/components/nve-icon/nve-icon.component.js +145 -164
- package/components/nve-icon/nve-icon.styles.js +11 -6
- package/components/nve-icon/offline-icons.js +16 -13
- package/components/nve-input/nve-input.component.js +2 -100
- package/components/nve-input/nve-input.styles.js +5 -5
- package/components/nve-label/nve-label.component.js +2 -115
- package/components/nve-label/nve-label.styles.js +5 -5
- package/components/nve-link-card/nve-link-card.component.d.ts +5 -2
- package/components/nve-link-card/nve-link-card.component.js +44 -80
- package/components/nve-link-card/nve-link-card.styles.js +71 -66
- package/components/nve-menu/nve-menu.component.js +2 -22
- package/components/nve-menu/nve-menu.styles.js +5 -5
- package/components/nve-menu-item/nve-menu-item.component.js +2 -43
- package/components/nve-menu-item/nve-menu-item.styles.js +7 -7
- package/components/nve-message-card/nve-message-card.component.js +61 -91
- package/components/nve-message-card/nve-message-card.styles.js +24 -27
- package/components/nve-navigation-card/nve-navigation-card.component.d.ts +52 -0
- package/components/nve-navigation-card/nve-navigation-card.component.js +60 -0
- package/components/nve-navigation-card/nve-navigation-card.styles.d.ts +2 -0
- package/components/nve-navigation-card/nve-navigation-card.styles.js +112 -0
- package/components/nve-option/nve-option.component.js +2 -41
- package/components/nve-option/nve-option.styles.js +5 -5
- package/components/nve-paragraph/nve-paragraph.component.d.ts +26 -0
- package/components/nve-paragraph/nve-paragraph.component.js +26 -0
- package/components/nve-paragraph/nve-paragraph.styles.d.ts +2 -0
- package/components/nve-paragraph/nve-paragraph.styles.js +105 -0
- package/components/nve-popup/nve-popup.component.js +2 -22
- package/components/nve-radio/nve-radio.component.js +2 -23
- package/components/nve-radio/nve-radio.styles.js +5 -5
- package/components/nve-radio-button/nve-radio-button.component.js +2 -25
- package/components/nve-radio-button/nve-radio-button.styles.js +5 -5
- package/components/nve-radio-group/nve-radio-group.component.js +2 -119
- package/components/nve-radio-group/nve-radio-group.styles.js +5 -5
- package/components/nve-relative-time/nve-relative-time.component.js +21 -56
- package/components/nve-relative-time/nve-relative-time.styles.js +5 -5
- package/components/nve-select/nve-select.component.js +2 -80
- package/components/nve-select/nve-select.styles.js +5 -5
- package/components/nve-skeleton/nve-skeleton.component.js +2 -27
- package/components/nve-skeleton/nve-skeleton.styles.js +5 -5
- package/components/nve-spinner/nve-spinner.component.js +2 -31
- package/components/nve-stepper/nve-step/nve-step.component.js +113 -173
- package/components/nve-stepper/nve-step/nve-step.styles.js +12 -12
- package/components/nve-stepper/nve-stepper-mobile.component.js +37 -49
- package/components/nve-stepper/nve-stepper-mobile.styles.js +7 -7
- package/components/nve-stepper/nve-stepper.component.js +94 -139
- package/components/nve-stepper/nve-stepper.styles.js +5 -5
- package/components/nve-switch/nve-switch.component.js +75 -107
- package/components/nve-switch/nve-switch.styles.js +7 -7
- package/components/nve-tab/nve-tab.component.js +30 -42
- package/components/nve-tab/nve-tab.styles.js +7 -7
- package/components/nve-tab-group/nve-tab-group.component.js +180 -260
- package/components/nve-tab-group/nve-tab-group.styles.js +5 -5
- package/components/nve-tab-panel/nve-tab-panel.component.js +21 -31
- package/components/nve-tab-panel/nve-tab-panel.styles.js +5 -5
- package/components/nve-tag/nve-tag.component.d.ts +3 -3
- package/components/nve-tag/nve-tag.component.js +71 -72
- package/components/nve-tag/nve-tag.styles.js +23 -22
- package/components/nve-textarea/nve-textarea.component.d.ts +3 -1
- package/components/nve-textarea/nve-textarea.component.js +112 -173
- package/components/nve-textarea/nve-textarea.styles.js +10 -5
- package/components/nve-tooltip/nve-tooltip.component.js +2 -30
- package/components/nve-tooltip/nve-tooltip.styles.js +5 -5
- package/components/nve-warning-level/nve-warning-level.component.js +2 -78
- package/components/nve-warning-level/nve-warning-level.styles.js +7 -7
- package/css/global.css +13 -55
- package/css/nve.css +1048 -393
- package/css/nve_dark.css +406 -305
- package/css/rme.css +1050 -395
- package/css/rme_dark.css +408 -307
- package/css/shoelace-styles.css +539 -0
- package/css/varsom.css +1046 -391
- package/css/varsom_dark.css +404 -303
- package/custom-elements.json +2905 -12389
- package/fonts/LICENSE.txt +37 -0
- package/fonts/SourceSans3-VariableFont_wght.woff2 +0 -0
- package/interfaces/NveComponent.interface.js +0 -1
- package/nve-designsystem.d.ts +5 -0
- package/nve-designsystem.js +46 -86
- package/package.json +26 -8
- package/registerIcons/systemLibraryCustomization.js +23 -91
- package/vite-env.d.js +0 -1
- package/chunks/chunk.3RPBFEDE.js +0 -162
- package/chunks/chunk.JCXLDPQF.js +0 -225
- package/chunks/chunk.JQBT7BOV.js +0 -8446
- package/chunks/chunk.MAQXLKQ7.js +0 -598
- package/chunks/lit-element.js +0 -508
- package/chunks/property.js +0 -37
- package/chunks/query.js +0 -13
- package/chunks/state.js +0 -7
- package/chunks/static.js +0 -26
- package/nve-designsystem.css +0 -1
- package/vscode.css-custom-data.json +0 -621
- package/vscode.html-custom-data.json +0 -2354
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { a as e } from "./lit.js";
|
|
2
|
+
//#region .pnpm/lit-html@3.3.3/node_modules/lit-html/static.js
|
|
3
|
+
var t = Symbol.for(""), n = (e) => {
|
|
4
|
+
if (e?.r === t) return e?._$litStatic$;
|
|
5
|
+
}, r = (e) => ({
|
|
6
|
+
_$litStatic$: e,
|
|
7
|
+
r: t
|
|
8
|
+
}), i = (e, ...n) => ({
|
|
9
|
+
_$litStatic$: n.reduce((t, n, r) => t + ((e) => {
|
|
10
|
+
if (e._$litStatic$ !== void 0) return e._$litStatic$;
|
|
11
|
+
throw Error(`Value passed to 'literal' function must be a 'literal' result: ${e}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`);
|
|
12
|
+
})(n) + e[r + 1], e[0]),
|
|
13
|
+
r: t
|
|
14
|
+
}), a = /* @__PURE__ */ new Map(), o = ((e) => (t, ...r) => {
|
|
15
|
+
let i = r.length, o, s, c = [], l = [], u, d = 0, f = !1;
|
|
16
|
+
for (; d < i;) {
|
|
17
|
+
for (u = t[d]; d < i && (s = r[d], o = n(s)) !== void 0;) u += o + t[++d], f = !0;
|
|
18
|
+
d !== i && l.push(s), c.push(u), d++;
|
|
19
|
+
}
|
|
20
|
+
if (d === i && c.push(t[i]), f) {
|
|
21
|
+
let e = c.join("$$lit$$");
|
|
22
|
+
(t = a.get(e)) === void 0 && (c.raw = c, a.set(e, t = c)), r = l;
|
|
23
|
+
}
|
|
24
|
+
return e(t, ...r);
|
|
25
|
+
})(e);
|
|
26
|
+
//#endregion
|
|
27
|
+
export { r as n, o as r, i as t };
|
package/chunks/unsafe-html.js
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as n,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { n as e, r as t } from "./lit.js";
|
|
2
|
+
import { i as n, n as r, r as i } from "./class-map.js";
|
|
3
|
+
//#region .pnpm/lit-html@3.3.3/node_modules/lit-html/directives/unsafe-html.js
|
|
4
|
+
var a = class extends i {
|
|
5
|
+
constructor(t) {
|
|
6
|
+
if (super(t), this.it = e, t.type !== n.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
7
|
+
}
|
|
8
|
+
render(n) {
|
|
9
|
+
if (n === e || n == null) return this._t = void 0, this.it = n;
|
|
10
|
+
if (n === t) return n;
|
|
11
|
+
if (typeof n != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
12
|
+
if (n === this.it) return this._t;
|
|
13
|
+
this.it = n;
|
|
14
|
+
let r = [n];
|
|
15
|
+
return r.raw = r, this._t = {
|
|
16
|
+
_$litType$: this.constructor.resultType,
|
|
17
|
+
strings: r,
|
|
18
|
+
values: []
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
21
|
};
|
|
22
|
+
a.directiveName = "unsafeHTML", a.resultType = 1;
|
|
23
|
+
var o = r(a);
|
|
24
|
+
//#endregion
|
|
25
|
+
export { o as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
//#region src/utils/updateInvalidProperty.ts
|
|
2
|
+
function e(e, t, n) {
|
|
3
|
+
e.forEach((e) => {
|
|
4
|
+
e.toggleAttribute(n, t);
|
|
5
|
+
});
|
|
5
6
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
7
|
+
//#endregion
|
|
8
|
+
export { e as t };
|
package/chunks/watch.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
//#region src/utils/watch.ts
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
let n = {
|
|
4
|
+
waitUntilFirstUpdate: !1,
|
|
5
|
+
...t
|
|
6
|
+
};
|
|
7
|
+
return (t, r) => {
|
|
8
|
+
let { update: i } = t, a = Array.isArray(e) ? e : [e];
|
|
9
|
+
t.update = function(e) {
|
|
10
|
+
a.forEach((t) => {
|
|
11
|
+
let i = t;
|
|
12
|
+
if (e.has(i)) {
|
|
13
|
+
let t = e.get(i), a = this[i];
|
|
14
|
+
t !== a && (!n.waitUntilFirstUpdate || this.hasUpdated) && this[r](t, a);
|
|
15
|
+
}
|
|
16
|
+
}), i.call(this, e);
|
|
17
|
+
};
|
|
18
|
+
};
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { e as t };
|
|
@@ -1,31 +1,25 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { n as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
render() {
|
|
20
|
-
return p`<slot></slot>`;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
c([
|
|
24
|
-
d({ reflect: !0, type: String })
|
|
25
|
-
], n.prototype, "testId", 2);
|
|
26
|
-
n = c([
|
|
27
|
-
f("nve-accordion")
|
|
28
|
-
], n);
|
|
29
|
-
export {
|
|
30
|
-
n as default
|
|
1
|
+
import { a as e, t } from "../../chunks/lit.js";
|
|
2
|
+
import { o as n, s as r, t as i } from "../../chunks/decorate.js";
|
|
3
|
+
//#region src/components/nve-accordion/nve-accordion.component.ts
|
|
4
|
+
var a = class extends t {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(), this.testId = void 0, this.handleShow = (e) => {
|
|
7
|
+
e.target?.localName === "nve-accordion-item" && [...this.querySelectorAll("nve-accordion-item")].map((t) => {
|
|
8
|
+
t.open = e.target === t;
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
async firstUpdated() {
|
|
13
|
+
await new Promise((e) => setTimeout(e, 0)), this.addEventListener("sl-show", (e) => this.handleShow(e));
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
return e`<slot></slot>`;
|
|
17
|
+
}
|
|
31
18
|
};
|
|
19
|
+
i([n({
|
|
20
|
+
reflect: !0,
|
|
21
|
+
type: String
|
|
22
|
+
})], a.prototype, "testId", void 0), a = i([r("nve-accordion")], a);
|
|
23
|
+
var o = a;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { o as default };
|
|
@@ -1,65 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import "../../chunks/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import "../../chunks/chunk.JXOKFADN.js";
|
|
13
|
-
import "../../chunks/chunk.XZNBUGX7.js";
|
|
14
|
-
import "../../chunks/chunk.XA43ZQPC.js";
|
|
15
|
-
import "../../chunks/chunk.JHOXTQXA.js";
|
|
16
|
-
import "../../chunks/chunk.HVTXQL7M.js";
|
|
17
|
-
import "../../chunks/lit-element.js";
|
|
18
|
-
import "../../chunks/chunk.IVVHNXMC.js";
|
|
19
|
-
import "../../chunks/chunk.SAPQLUO4.js";
|
|
20
|
-
import "../../chunks/chunk.UDWRA64J.js";
|
|
21
|
-
import "../../chunks/chunk.KPLQLAWP.js";
|
|
22
|
-
import "../../chunks/chunk.D5YQDJ7X.js";
|
|
23
|
-
import "../../chunks/chunk.SI4ACBFK.js";
|
|
24
|
-
import "../../chunks/chunk.5JY5FUCG.js";
|
|
25
|
-
import "../../chunks/chunk.ZH2AND3P.js";
|
|
26
|
-
import "../../chunks/chunk.IKV4VH3T.js";
|
|
27
|
-
import "../../chunks/chunk.JCXLDPQF.js";
|
|
28
|
-
import "../../chunks/chunk.36O46B5H.js";
|
|
29
|
-
import "../../chunks/chunk.MAQXLKQ7.js";
|
|
30
|
-
import "../../chunks/chunk.RWUUFNUL.js";
|
|
31
|
-
import "../../chunks/chunk.6CTB5ZDJ.js";
|
|
32
|
-
import "../../chunks/chunk.YHLNUJ7P.js";
|
|
33
|
-
import "../../chunks/chunk.4TUIT776.js";
|
|
34
|
-
var y = Object.defineProperty, u = Object.getOwnPropertyDescriptor, o = (a, p, m, i) => {
|
|
35
|
-
for (var r = i > 1 ? void 0 : i ? u(p, m) : p, s = a.length - 1, l; s >= 0; s--)
|
|
36
|
-
(l = a[s]) && (r = (i ? l(p, m, r) : l(r)) || r);
|
|
37
|
-
return i && r && y(p, m, r), r;
|
|
38
|
-
};
|
|
39
|
-
let t = class extends f {
|
|
40
|
-
constructor() {
|
|
41
|
-
super(), this.testId = void 0, this.leftStroke = !1, this.variant = "none", this.border = !1, this.compact = !1;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
t.styles = [f.styles, n];
|
|
45
|
-
o([
|
|
46
|
-
e({ reflect: !0, type: String })
|
|
47
|
-
], t.prototype, "testId", 2);
|
|
48
|
-
o([
|
|
49
|
-
e({ type: Boolean, reflect: !0 })
|
|
50
|
-
], t.prototype, "leftStroke", 2);
|
|
51
|
-
o([
|
|
52
|
-
e({ type: String, reflect: !0 })
|
|
53
|
-
], t.prototype, "variant", 2);
|
|
54
|
-
o([
|
|
55
|
-
e({ type: Boolean, reflect: !0 })
|
|
56
|
-
], t.prototype, "border", 2);
|
|
57
|
-
o([
|
|
58
|
-
e({ type: Boolean, reflect: !0 })
|
|
59
|
-
], t.prototype, "compact", 2);
|
|
60
|
-
t = o([
|
|
61
|
-
c("nve-accordion-item")
|
|
62
|
-
], t);
|
|
63
|
-
export {
|
|
64
|
-
t as default
|
|
1
|
+
import { o as e, s as t, t as n } from "../../chunks/decorate.js";
|
|
2
|
+
import r from "./nve-accordion-item.styles.js";
|
|
3
|
+
import { t as i } from "../../chunks/shoelace.js";
|
|
4
|
+
//#region src/components/nve-accordion-item/nve-accordion-item.component.ts
|
|
5
|
+
var a = class extends i {
|
|
6
|
+
static {
|
|
7
|
+
this.styles = [i.styles, r];
|
|
8
|
+
}
|
|
9
|
+
constructor() {
|
|
10
|
+
super(), this.testId = void 0, this.leftStroke = !1, this.variant = "none", this.border = !1, this.compact = !1;
|
|
11
|
+
}
|
|
65
12
|
};
|
|
13
|
+
n([e({
|
|
14
|
+
reflect: !0,
|
|
15
|
+
type: String
|
|
16
|
+
})], a.prototype, "testId", void 0), n([e({
|
|
17
|
+
type: Boolean,
|
|
18
|
+
reflect: !0
|
|
19
|
+
})], a.prototype, "leftStroke", void 0), n([e({
|
|
20
|
+
type: String,
|
|
21
|
+
reflect: !0
|
|
22
|
+
})], a.prototype, "variant", void 0), n([e({
|
|
23
|
+
type: Boolean,
|
|
24
|
+
reflect: !0
|
|
25
|
+
})], a.prototype, "border", void 0), n([e({
|
|
26
|
+
type: Boolean,
|
|
27
|
+
reflect: !0
|
|
28
|
+
})], a.prototype, "compact", void 0), a = n([t("nve-accordion-item")], a);
|
|
29
|
+
var o = a;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { o as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { u as e } from "../../chunks/lit.js";
|
|
2
|
+
//#region src/components/nve-accordion-item/nve-accordion-item.styles.ts
|
|
3
|
+
var t = e`
|
|
3
4
|
.details {
|
|
4
5
|
border: none;
|
|
5
6
|
background-color: var(--_bg-color);
|
|
@@ -120,6 +121,5 @@ const e = r`
|
|
|
120
121
|
border-bottom: 1px solid var(--_border-color, var(--_text-color));
|
|
121
122
|
}
|
|
122
123
|
`;
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
};
|
|
124
|
+
//#endregion
|
|
125
|
+
export { t as default };
|
|
@@ -1,227 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { e as f } from "../../chunks/query.js";
|
|
4
|
-
import b from "./nve-alert.styles.js";
|
|
5
|
-
import { e as v } from "../../chunks/class-map.js";
|
|
6
|
-
import "../nve-icon/nve-icon.component.js";
|
|
7
|
-
function d(i, l, o) {
|
|
8
|
-
return new Promise((n) => {
|
|
9
|
-
if (o?.duration === 1 / 0)
|
|
10
|
-
throw new Error("Promise-based animations must be finite.");
|
|
11
|
-
const s = i.animate(l, {
|
|
12
|
-
...o,
|
|
13
|
-
duration: y() ? 0 : o?.duration ?? 300
|
|
14
|
-
//0.3 ms som standard
|
|
15
|
-
});
|
|
16
|
-
s.addEventListener("cancel", n, { once: !0 }), s.addEventListener("finish", n, { once: !0 });
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
function y() {
|
|
20
|
-
return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
21
|
-
}
|
|
22
|
-
var w = Object.defineProperty, g = Object.getOwnPropertyDescriptor, e = (i, l, o, n) => {
|
|
23
|
-
for (var s = n > 1 ? void 0 : n ? g(l, o) : l, c = i.length - 1, u; c >= 0; c--)
|
|
24
|
-
(u = i[c]) && (s = (n ? u(l, o, s) : u(s)) || s);
|
|
25
|
-
return n && s && w(l, o, s), s;
|
|
26
|
-
};
|
|
27
|
-
let t = class extends p {
|
|
28
|
-
constructor() {
|
|
29
|
-
super(...arguments), this.testId = void 0, this.leftStroke = !1, this.variant = "primary", this.closable = !1, this.open = !1, this.duration = 1 / 0, this.buttonLabel = "Lukk", this.showIcon = "true";
|
|
30
|
-
}
|
|
31
|
-
//for å sørge at vi har en stack for toast alerts.
|
|
32
|
-
/** Oppretter toast-stack hvis den ikke finnes. Returnerer toast-stack */
|
|
33
|
-
static get toastStack() {
|
|
34
|
-
return this.currentToastStack || (this.currentToastStack = Object.assign(document.createElement("div"), {
|
|
35
|
-
className: "toast-stack"
|
|
36
|
-
})), this.currentToastStack;
|
|
37
|
-
}
|
|
38
|
-
connectedCallback() {
|
|
39
|
-
super.connectedCallback();
|
|
40
|
-
}
|
|
41
|
-
disconnectedCallback() {
|
|
42
|
-
super.disconnectedCallback(), this.clearAutoHideTimer();
|
|
43
|
-
}
|
|
44
|
-
firstUpdated() {
|
|
45
|
-
this.base && (this.base.hidden = !this.open);
|
|
46
|
-
}
|
|
47
|
-
async updated(i) {
|
|
48
|
-
super.updated(i), i.has("open") && (this.open ? this.dispatchEvent(new CustomEvent("sl-show", { bubbles: !0, composed: !0 })) : this.dispatchEvent(new CustomEvent("sl-hide", { bubbles: !0, composed: !0 }))), i.has("duration") && this.open && this.startAutoHideTimer();
|
|
49
|
-
}
|
|
50
|
-
// Hvis duration er gitt, starter vi en timer for å lukke alerten automatisk.
|
|
51
|
-
startAutoHideTimer() {
|
|
52
|
-
this.clearAutoHideTimer(), this.duration !== 1 / 0 && this.duration > 0 && (this._autoHideTimeout = setTimeout(() => {
|
|
53
|
-
this.hide();
|
|
54
|
-
}, this.duration));
|
|
55
|
-
}
|
|
56
|
-
clearAutoHideTimer() {
|
|
57
|
-
this._autoHideTimeout && (clearTimeout(this._autoHideTimeout), this._autoHideTimeout = void 0);
|
|
58
|
-
}
|
|
59
|
-
async handleCloseClick() {
|
|
60
|
-
await this.hide();
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Viser alerten med animasjon.
|
|
64
|
-
* Setter `open` til true, kjører visningsanimasjonen, og starter eventuell auto-hide timer.
|
|
65
|
-
* Sender ut eventen `sl-after-show` når animasjonen er ferdig.
|
|
66
|
-
*
|
|
67
|
-
* @returns Promise som løses når animasjonen og oppdateringen er ferdig.
|
|
68
|
-
*/
|
|
69
|
-
async show() {
|
|
70
|
-
this.open || (this.open = !0, await d(this.base, this.getKeyframes().show, { easing: "ease" }), await this.updateComplete, this.dispatchEvent(new CustomEvent("sl-after-show", { bubbles: !0, composed: !0 })), this.startAutoHideTimer());
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Skjuler alerten med animasjon.
|
|
74
|
-
* Kjører skjuleanimasjonen før `open` settes til false.
|
|
75
|
-
* Sender ut eventen `sl-after-hide` når animasjonen og oppdateringen er ferdig.
|
|
76
|
-
* Stopper eventuell auto-hide timer.
|
|
77
|
-
*
|
|
78
|
-
* @returns Promise som løses når animasjonen og oppdateringen er ferdig.
|
|
79
|
-
*/
|
|
80
|
-
async hide() {
|
|
81
|
-
this.open && (await d(this.base, this.getKeyframes().hide, { easing: "ease" }), this.open = !1, await this.updateComplete, this.dispatchEvent(new CustomEvent("sl-after-hide", { bubbles: !0, composed: !0 })), this.clearAutoHideTimer());
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Viser alerten som en toast-melding.
|
|
85
|
-
* Legger alerten i toast-stacken, venter til den er rendret, og viser den med animasjon.
|
|
86
|
-
* Fjerner alerten fra toast-stacken når den skjules, og fjerner stacken hvis det ikke er flere alerts igjen.
|
|
87
|
-
*
|
|
88
|
-
* @returns Promise som løses når alerten er skjult og fjernet fra DOM.
|
|
89
|
-
*/
|
|
90
|
-
async toast() {
|
|
91
|
-
return new Promise((i) => {
|
|
92
|
-
t.toastStack.parentElement === null && document.body.append(t.toastStack), t.toastStack.appendChild(this), requestAnimationFrame(() => {
|
|
93
|
-
this.show();
|
|
94
|
-
}), this.addEventListener(
|
|
95
|
-
"sl-after-hide",
|
|
96
|
-
() => {
|
|
97
|
-
t.toastStack.removeChild(this), i(), t.toastStack.querySelector("nve-alert") === null && t.toastStack.remove();
|
|
98
|
-
},
|
|
99
|
-
{ once: !0 }
|
|
100
|
-
);
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
getVariantIconName() {
|
|
104
|
-
if (this.showIcon === "false") return "";
|
|
105
|
-
if (this.iconName)
|
|
106
|
-
return this.iconName;
|
|
107
|
-
switch (this.variant) {
|
|
108
|
-
case "primary":
|
|
109
|
-
return "info";
|
|
110
|
-
case "success":
|
|
111
|
-
return "check_circle";
|
|
112
|
-
case "neutral":
|
|
113
|
-
return "info";
|
|
114
|
-
case "warning":
|
|
115
|
-
return "warning";
|
|
116
|
-
case "danger":
|
|
117
|
-
return "error";
|
|
118
|
-
default:
|
|
119
|
-
return "";
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Returnerer keyframes for visnings- og skjuleanimasjoner.
|
|
124
|
-
* Kan utvides med flere animasjoner hvis det trengs.
|
|
125
|
-
*
|
|
126
|
-
* @returns {object} Et objekt med keyframes for 'show' og 'hide'-animasjoner.
|
|
127
|
-
*/
|
|
128
|
-
getKeyframes() {
|
|
129
|
-
return {
|
|
130
|
-
show: [
|
|
131
|
-
{ opacity: 0, transform: "scale(0.8)" },
|
|
132
|
-
{ opacity: 1, transform: "scale(1)" }
|
|
133
|
-
],
|
|
134
|
-
hide: [
|
|
135
|
-
{ opacity: 1, transform: "scale(1)" },
|
|
136
|
-
{ opacity: 0, transform: "scale(0.8)" }
|
|
137
|
-
]
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
render() {
|
|
141
|
-
return r`
|
|
142
|
-
<div
|
|
143
|
-
role="alert"
|
|
144
|
-
part="base"
|
|
145
|
-
class=${v({
|
|
146
|
-
alert: !0,
|
|
147
|
-
"alert--hidden": !this.open,
|
|
148
|
-
"alert--primary": this.variant === "primary",
|
|
149
|
-
"alert--success": this.variant === "success",
|
|
150
|
-
"alert--neutral": this.variant === "neutral",
|
|
151
|
-
"alert--warning": this.variant === "warning",
|
|
152
|
-
"alert--danger": this.variant === "danger",
|
|
153
|
-
"alert--left-stroke": this.leftStroke,
|
|
154
|
-
"alert--emphasized": this.saturation === "emphasized"
|
|
155
|
-
})}
|
|
156
|
-
>
|
|
157
|
-
<div part="icon" class="alert__icon">
|
|
158
|
-
${this.showIcon === "true" ? r`
|
|
159
|
-
<div part="icon" class="alert__icon">
|
|
160
|
-
${this.getVariantIconName() ? r`<nve-icon name="${this.getVariantIconName()}"></nve-icon>` : r`<slot name="icon"></slot>`}
|
|
161
|
-
</div>
|
|
162
|
-
` : h}
|
|
163
|
-
</div>
|
|
164
|
-
<div part="label">
|
|
165
|
-
${this.label ? r` <label part="label">${this.label}</label>` : r`<slot name="label"></slot>`}
|
|
166
|
-
</div>
|
|
167
|
-
<div part="message" class="alert__message">${this.text ? this.text : r`<slot></slot>`}</div>
|
|
168
|
-
${this.closable ? r`
|
|
169
|
-
<button
|
|
170
|
-
@click=${this.handleCloseClick}
|
|
171
|
-
class="alert__button"
|
|
172
|
-
title=${this.buttonLabel}
|
|
173
|
-
aria-label=${this.buttonLabel}
|
|
174
|
-
>
|
|
175
|
-
<nve-icon name="close"></nve-icon>
|
|
176
|
-
</button>
|
|
177
|
-
` : h}
|
|
178
|
-
</div>
|
|
179
|
-
`;
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
t.styles = [b];
|
|
183
|
-
e([
|
|
184
|
-
a({ type: String })
|
|
185
|
-
], t.prototype, "testId", 2);
|
|
186
|
-
e([
|
|
187
|
-
a()
|
|
188
|
-
], t.prototype, "label", 2);
|
|
189
|
-
e([
|
|
190
|
-
a()
|
|
191
|
-
], t.prototype, "text", 2);
|
|
192
|
-
e([
|
|
193
|
-
a()
|
|
194
|
-
], t.prototype, "saturation", 2);
|
|
195
|
-
e([
|
|
196
|
-
a({ type: Boolean })
|
|
197
|
-
], t.prototype, "leftStroke", 2);
|
|
198
|
-
e([
|
|
199
|
-
a()
|
|
200
|
-
], t.prototype, "variant", 2);
|
|
201
|
-
e([
|
|
202
|
-
a({ type: Boolean })
|
|
203
|
-
], t.prototype, "closable", 2);
|
|
204
|
-
e([
|
|
205
|
-
a({ type: Boolean, reflect: !0 })
|
|
206
|
-
], t.prototype, "open", 2);
|
|
207
|
-
e([
|
|
208
|
-
a({ type: Number })
|
|
209
|
-
], t.prototype, "duration", 2);
|
|
210
|
-
e([
|
|
211
|
-
a({ type: String })
|
|
212
|
-
], t.prototype, "buttonLabel", 2);
|
|
213
|
-
e([
|
|
214
|
-
a({ type: String })
|
|
215
|
-
], t.prototype, "iconName", 2);
|
|
216
|
-
e([
|
|
217
|
-
a({ type: String })
|
|
218
|
-
], t.prototype, "showIcon", 2);
|
|
219
|
-
e([
|
|
220
|
-
f('[part~="base"]')
|
|
221
|
-
], t.prototype, "base", 2);
|
|
222
|
-
t = e([
|
|
223
|
-
m("nve-alert")
|
|
224
|
-
], t);
|
|
225
|
-
export {
|
|
226
|
-
t as default
|
|
227
|
-
};
|
|
1
|
+
import { t as e } from "../../chunks/nve-alert.component.js";
|
|
2
|
+
export { e as default };
|