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
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { u as e } from "../../chunks/lit.js";
|
|
2
|
+
//#region src/components/nve-combobox/nve-combobox.styles.ts
|
|
3
|
+
var t = e`
|
|
3
4
|
:host {
|
|
4
5
|
/* Brukt for å gjøre feltet like høyt som nve-select */
|
|
5
6
|
--input-size-offset: 4px;
|
|
6
|
-
--input-part-base-border: 1px solid var(--color-interactive-
|
|
7
|
+
--input-part-base-border: 1px solid var(--color-interactive-foreground-link-enabled);
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
:host([disabled]) {
|
|
@@ -144,6 +145,5 @@ const t = e`
|
|
|
144
145
|
font: var(--typography-detailtext-caption);
|
|
145
146
|
}
|
|
146
147
|
`;
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
};
|
|
148
|
+
//#endregion
|
|
149
|
+
export { t as default };
|
|
@@ -1,42 +1,36 @@
|
|
|
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
|
-
t === null ? window.matchMedia("(prefers-color-scheme: dark)").matches && (e = !0) : e = t === "true", e ? (this.darkmode = !0, document.documentElement.classList.add(this.darkmodeclass)) : (this.darkmode = !1, document.documentElement.classList.remove(this.darkmodeclass));
|
|
20
|
-
}
|
|
21
|
-
render() {
|
|
22
|
-
return n`<nve-switch @change=${this.toggleDarkmode} ?checked=${this.darkmode}>
|
|
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-darkmode-switch/nve-darkmode-switch.component.ts
|
|
4
|
+
var a = class extends t {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(), this.testId = "", this.darkmode = !1, this.darkmodeclass = "darkmode", this.localStorageVariable = "preferdarkmode";
|
|
7
|
+
}
|
|
8
|
+
toggleDarkmode(e) {
|
|
9
|
+
let t = e.target;
|
|
10
|
+
this.darkmode = !!t?.checked, localStorage.setItem(this.localStorageVariable, this.darkmode.toString()), this.darkmode ? document.documentElement.classList.add(this.darkmodeclass) : document.documentElement.classList.remove(this.darkmodeclass);
|
|
11
|
+
}
|
|
12
|
+
connectedCallback() {
|
|
13
|
+
super.connectedCallback();
|
|
14
|
+
let e = localStorage.getItem(this.localStorageVariable), t = !1;
|
|
15
|
+
e === null ? window.matchMedia("(prefers-color-scheme: dark)").matches && (t = !0) : t = e === "true", t ? (this.darkmode = !0, document.documentElement.classList.add(this.darkmodeclass)) : (this.darkmode = !1, document.documentElement.classList.remove(this.darkmodeclass));
|
|
16
|
+
}
|
|
17
|
+
render() {
|
|
18
|
+
return e`<nve-switch @change=${this.toggleDarkmode} ?checked=${this.darkmode}>
|
|
23
19
|
<nve-icon slot="onicon" name="dark_mode"></nve-icon>
|
|
24
20
|
<nve-icon slot="officon" name="light_mode"></nve-icon>
|
|
25
21
|
</nve-switch>`;
|
|
26
|
-
|
|
27
|
-
};
|
|
28
|
-
s([
|
|
29
|
-
i({ reflect: !0, type: String })
|
|
30
|
-
], r.prototype, "testId", 2);
|
|
31
|
-
s([
|
|
32
|
-
i({ attribute: !1, type: Boolean })
|
|
33
|
-
], r.prototype, "darkmode", 2);
|
|
34
|
-
s([
|
|
35
|
-
i({ attribute: !0, type: String })
|
|
36
|
-
], r.prototype, "darkmodeclass", 2);
|
|
37
|
-
r = s([
|
|
38
|
-
h("nve-darkmode-switch")
|
|
39
|
-
], r);
|
|
40
|
-
export {
|
|
41
|
-
r as default
|
|
22
|
+
}
|
|
42
23
|
};
|
|
24
|
+
i([n({
|
|
25
|
+
reflect: !0,
|
|
26
|
+
type: String
|
|
27
|
+
})], a.prototype, "testId", void 0), i([n({
|
|
28
|
+
attribute: !1,
|
|
29
|
+
type: Boolean
|
|
30
|
+
})], a.prototype, "darkmode", void 0), i([n({
|
|
31
|
+
attribute: !0,
|
|
32
|
+
type: String
|
|
33
|
+
})], a.prototype, "darkmodeclass", void 0), a = i([r("nve-darkmode-switch")], a);
|
|
34
|
+
var o = a;
|
|
35
|
+
//#endregion
|
|
36
|
+
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-dialog/nve-dialog-styles.ts
|
|
3
|
+
var t = e`
|
|
3
4
|
:host {
|
|
4
5
|
--header-spacing: var(--spacing-x-large, 2rem);
|
|
5
6
|
--body-spacing: var(--spacing-x-large, 2rem);
|
|
@@ -35,7 +36,7 @@ const r = o`
|
|
|
35
36
|
.dialog__header-actions sl-icon-button,
|
|
36
37
|
.dialog__header-actions ::slotted(sl-icon-button) {
|
|
37
38
|
color: var(--color-neutrals-foreground-primary, #00131c);
|
|
38
|
-
font-family: Source Sans
|
|
39
|
+
font-family: Source Sans 3;
|
|
39
40
|
font-size: 1.3rem;
|
|
40
41
|
font-style: normal;
|
|
41
42
|
font-weight: bold;
|
|
@@ -70,6 +71,5 @@ const r = o`
|
|
|
70
71
|
fill: var(--color-neutrals-foreground-primary);
|
|
71
72
|
}
|
|
72
73
|
`;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
};
|
|
74
|
+
//#endregion
|
|
75
|
+
export { t as default };
|
|
@@ -1,54 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import "../../chunks/chunk.6CTB5ZDJ.js";
|
|
4
|
-
import "../../chunks/chunk.YHLNUJ7P.js";
|
|
5
|
-
import "../../chunks/chunk.4TUIT776.js";
|
|
6
|
-
import { n as c, t as d } from "../../chunks/property.js";
|
|
7
|
-
import u from "./nve-dialog-styles.js";
|
|
8
|
-
var f = Object.defineProperty, h = Object.getOwnPropertyDescriptor, n = (e, o, l, r) => {
|
|
9
|
-
for (var t = r > 1 ? void 0 : r ? h(o, l) : o, i = e.length - 1, a; i >= 0; i--)
|
|
10
|
-
(a = e[i]) && (t = (r ? a(o, l, t) : a(t)) || t);
|
|
11
|
-
return r && t && f(o, l, t), t;
|
|
12
|
-
};
|
|
13
|
-
let s = class extends p {
|
|
14
|
-
constructor() {
|
|
15
|
-
super(), this.icon = "", this.disableBackground = !1;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Stjålet fra shoelace eksempel. Hindrer at man lukker dialogen ved å trykke utenfor
|
|
19
|
-
*/
|
|
20
|
-
handleRequestClose(e) {
|
|
21
|
-
this.disableBackground && e.detail.source === "overlay" && e.preventDefault();
|
|
22
|
-
}
|
|
23
|
-
updated(e) {
|
|
24
|
-
super.updated(e), e.has("disableBackground") && this.addEventListener("sl-request-close", this.handleRequestClose), this.updateIcon();
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Oppdaterer ikonet som vises i dialogens tittel.
|
|
28
|
-
* Metoden søker først etter tittel-elementet i komponentens skygge-DOM.
|
|
29
|
-
* Hvis tittel-elementet finnes og `icon`-egenskapen er satt, oppdateres
|
|
30
|
-
* tittel-elementets stil for å inkludere det angitte ikonet.
|
|
31
|
-
* Hvis `icon`-egenskapen ikke er satt, settes ikoninnholdet til null
|
|
32
|
-
* for å unngå å skape unødvendig mellomrom i layouten.
|
|
33
|
-
*/
|
|
34
|
-
updateIcon() {
|
|
35
|
-
const e = this.shadowRoot?.querySelector(".dialog__title");
|
|
36
|
-
if (e instanceof HTMLElement) {
|
|
37
|
-
const o = this.icon ? `"${this.icon}"` : null;
|
|
38
|
-
e.style.setProperty("--title-icon", o);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
s.styles = [p.styles, u];
|
|
43
|
-
n([
|
|
44
|
-
c({ type: String, reflect: !0 })
|
|
45
|
-
], s.prototype, "icon", 2);
|
|
46
|
-
n([
|
|
47
|
-
c({ type: Boolean, reflect: !0 })
|
|
48
|
-
], s.prototype, "disableBackground", 2);
|
|
49
|
-
s = n([
|
|
50
|
-
d("nve-dialog")
|
|
51
|
-
], s);
|
|
52
|
-
export {
|
|
53
|
-
s as default
|
|
54
|
-
};
|
|
1
|
+
import { t as e } from "../../chunks/nve-dialog.component.js";
|
|
2
|
+
export { e as default };
|
|
@@ -1,30 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { i as v } from "../../chunks/lit-element.js";
|
|
4
|
-
import { t as p } from "../../chunks/property.js";
|
|
5
|
-
var c = Object.getOwnPropertyDescriptor, m = (s, o, d, a) => {
|
|
6
|
-
for (var r = a > 1 ? void 0 : a ? c(o, d) : o, e = s.length - 1, l; e >= 0; e--)
|
|
7
|
-
(l = s[e]) && (r = l(r) || r);
|
|
8
|
-
return r;
|
|
9
|
-
};
|
|
10
|
-
let t = class extends i {
|
|
11
|
-
constructor() {
|
|
12
|
-
super();
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
t.styles = [
|
|
16
|
-
i.styles,
|
|
17
|
-
v`
|
|
18
|
-
:host {
|
|
19
|
-
--color: var(--color-neutrals-border-subtle);
|
|
20
|
-
--width: var(--border-width-default, 1px);
|
|
21
|
-
--spacing: var(--spacing-2x-small, 0.25rem);
|
|
22
|
-
}
|
|
23
|
-
`
|
|
24
|
-
];
|
|
25
|
-
t = m([
|
|
26
|
-
p("nve-divider")
|
|
27
|
-
], t);
|
|
28
|
-
export {
|
|
29
|
-
t as default
|
|
30
|
-
};
|
|
1
|
+
import { t as e } from "../../chunks/nve-divider.component.js";
|
|
2
|
+
export { e as default };
|
|
@@ -1,44 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { d as a } from "../../chunks/chunk.SAPQLUO4.js";
|
|
4
|
-
import "../../chunks/chunk.RWUUFNUL.js";
|
|
5
|
-
import "../../chunks/chunk.6CTB5ZDJ.js";
|
|
6
|
-
import "../../chunks/chunk.YHLNUJ7P.js";
|
|
7
|
-
import "../../chunks/chunk.4TUIT776.js";
|
|
8
|
-
var d = Object.defineProperty, f = Object.getOwnPropertyDescriptor, c = (n, t, r, e) => {
|
|
9
|
-
for (var o = e > 1 ? void 0 : e ? f(t, r) : t, l = n.length - 1, p; l >= 0; l--)
|
|
10
|
-
(p = n[l]) && (o = (e ? p(t, r, o) : p(o)) || o);
|
|
11
|
-
return e && o && d(t, r, o), o;
|
|
12
|
-
};
|
|
13
|
-
let s = class extends a {
|
|
14
|
-
constructor() {
|
|
15
|
-
super(), this.testId = void 0;
|
|
16
|
-
}
|
|
17
|
-
firstUpdated() {
|
|
18
|
-
super.firstUpdated(), this.updateCloseIcon();
|
|
19
|
-
}
|
|
20
|
-
updateCloseIcon() {
|
|
21
|
-
requestAnimationFrame(() => {
|
|
22
|
-
const t = this?.shadowRoot?.querySelector('[part="close-button"]')?.shadowRoot?.querySelector("button");
|
|
23
|
-
if (!t) return;
|
|
24
|
-
t.setAttribute("title", "Lukk"), t.style.color = "inherit";
|
|
25
|
-
const r = {
|
|
26
|
-
start: "left_panel_close",
|
|
27
|
-
end: "right_panel_close",
|
|
28
|
-
top: "top_panel_close",
|
|
29
|
-
bottom: "bottom_panel_close"
|
|
30
|
-
}, e = document.createElement("nve-icon");
|
|
31
|
-
e.setAttribute("name", r[this.placement]), t.replaceChildren(e);
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
s.styles = [a.styles, m];
|
|
36
|
-
c([
|
|
37
|
-
i({ reflect: !0, type: String })
|
|
38
|
-
], s.prototype, "testId", 2);
|
|
39
|
-
s = c([
|
|
40
|
-
u("nve-drawer")
|
|
41
|
-
], s);
|
|
42
|
-
export {
|
|
43
|
-
s as default
|
|
44
|
-
};
|
|
1
|
+
import { t as e } from "../../chunks/nve-drawer.component.js";
|
|
2
|
+
export { e as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { u as e } from "../../chunks/lit.js";
|
|
2
|
+
//#region src/components/nve-drawer/nve-drawer.styles.ts
|
|
3
|
+
var t = e`
|
|
3
4
|
:host {
|
|
4
5
|
--drawer-padding-block: var(--spacing-large);
|
|
5
6
|
--drawer-padding-inline: var(--spacing-medium);
|
|
@@ -43,11 +44,10 @@ const o = r`
|
|
|
43
44
|
color: var(--color-neutrals-foreground-primary);
|
|
44
45
|
}
|
|
45
46
|
:host::part(close-button):hover {
|
|
46
|
-
background-color: var(--color-interactive-
|
|
47
|
+
background-color: var(--color-interactive-background-tertiary-hover);
|
|
47
48
|
border-radius: var(--border-radius-small, 4px);
|
|
48
49
|
transition: background-color 0.3s ease;
|
|
49
50
|
}
|
|
50
51
|
`;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
};
|
|
52
|
+
//#endregion
|
|
53
|
+
export { t as default };
|
|
@@ -1,79 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import "../../chunks/chunk.6CTB5ZDJ.js";
|
|
4
|
-
import "../../chunks/chunk.4TUIT776.js";
|
|
5
|
-
import { n as d, t as b } from "../../chunks/property.js";
|
|
6
|
-
import c from "./nve-dropdown.styles.js";
|
|
7
|
-
function l(t) {
|
|
8
|
-
return !!(t.offsetParent || t.offsetWidth || t.offsetHeight || t.getClientRects().length);
|
|
9
|
-
}
|
|
10
|
-
function g(t) {
|
|
11
|
-
const e = t.tagName.toLowerCase();
|
|
12
|
-
return t.getAttribute("tabindex") === "-1" || t.hasAttribute("disabled") || e === "input" && t.getAttribute("type") === "radio" && !t.hasAttribute("checked") || !l(t) || window.getComputedStyle(t).visibility === "hidden" ? !1 : (e === "audio" || e === "video") && t.hasAttribute("controls") || t.hasAttribute("tabindex") || t.hasAttribute("contenteditable") && t.getAttribute("contenteditable") !== "false" ? !0 : ["button", "input", "select", "textarea", "a", "audio", "video", "summary"].includes(e);
|
|
13
|
-
}
|
|
14
|
-
function p(t) {
|
|
15
|
-
const e = h(t), r = e[0] ?? null, n = e[e.length - 1] ?? null;
|
|
16
|
-
return { start: r, end: n };
|
|
17
|
-
}
|
|
18
|
-
function h(t) {
|
|
19
|
-
const e = [];
|
|
20
|
-
function r(n) {
|
|
21
|
-
if (n instanceof Element) {
|
|
22
|
-
if (n.hasAttribute("inert"))
|
|
23
|
-
return;
|
|
24
|
-
!e.includes(n) && g(n) && e.push(n);
|
|
25
|
-
const s = (i) => i.getRootNode({ composed: !0 })?.host !== t;
|
|
26
|
-
n instanceof HTMLSlotElement && s(n) && n.assignedElements({ flatten: !0 }).forEach((i) => {
|
|
27
|
-
i instanceof HTMLElement && r(i);
|
|
28
|
-
}), n.shadowRoot !== null && n.shadowRoot.mode === "open" && r(n.shadowRoot);
|
|
29
|
-
}
|
|
30
|
-
[...n.children].forEach((s) => {
|
|
31
|
-
s instanceof HTMLElement && r(s);
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
return r(t), e.sort((n, s) => {
|
|
35
|
-
const i = Number(n.getAttribute("tabindex")) || 0;
|
|
36
|
-
return (Number(s.getAttribute("tabindex")) || 0) - i;
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
var m = Object.defineProperty, w = Object.getOwnPropertyDescriptor, f = (t, e, r, n) => {
|
|
40
|
-
for (var s = n > 1 ? void 0 : n ? w(e, r) : e, i = t.length - 1, a; i >= 0; i--)
|
|
41
|
-
(a = t[i]) && (s = (n ? a(e, r, s) : a(s)) || s);
|
|
42
|
-
return n && s && m(e, r, s), s;
|
|
43
|
-
};
|
|
44
|
-
let o = class extends u {
|
|
45
|
-
constructor() {
|
|
46
|
-
super(), this.testId = "", this.handlePanelSelect = (t) => {
|
|
47
|
-
const e = t.target;
|
|
48
|
-
!this.stayOpenOnSelect && e.tagName.toLowerCase() === "nve-menu" && this.focusOnTrigger();
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
getMenu() {
|
|
52
|
-
return this.panel.assignedElements({ flatten: !0 }).find((t) => t.tagName.toLowerCase() === "nve-menu");
|
|
53
|
-
}
|
|
54
|
-
updateAccessibleTrigger() {
|
|
55
|
-
const e = this.trigger.assignedElements({ flatten: !0 }).find((n) => p(n).start);
|
|
56
|
-
let r;
|
|
57
|
-
if (e) {
|
|
58
|
-
switch (e.tagName.toLowerCase()) {
|
|
59
|
-
// Shoelace buttons have to update the internal button so it's announced correctly by screen readers
|
|
60
|
-
case "nve-button":
|
|
61
|
-
r = e.button;
|
|
62
|
-
break;
|
|
63
|
-
default:
|
|
64
|
-
r = e;
|
|
65
|
-
}
|
|
66
|
-
r.setAttribute("aria-haspopup", "true"), r.setAttribute("aria-expanded", this.open ? "true" : "false");
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
o.styles = [u.styles, c];
|
|
71
|
-
f([
|
|
72
|
-
d({ reflect: !0, type: String })
|
|
73
|
-
], o.prototype, "testId", 2);
|
|
74
|
-
o = f([
|
|
75
|
-
b("nve-dropdown")
|
|
76
|
-
], o);
|
|
77
|
-
export {
|
|
78
|
-
o as default
|
|
79
|
-
};
|
|
1
|
+
import { t as e } from "../../chunks/nve-dropdown.component.js";
|
|
2
|
+
export { e as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { u as e } from "../../chunks/lit.js";
|
|
2
|
+
//#region src/components/nve-dropdown/nve-dropdown.styles.ts
|
|
3
|
+
var t = e`
|
|
3
4
|
:host([open]) {
|
|
4
5
|
--icon-rotation: rotate(180deg);
|
|
5
6
|
}
|
|
6
7
|
`;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { t as default };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { INveComponent } from '../../interfaces/NveComponent.interface';
|
|
3
|
+
/**
|
|
4
|
+
* nve-heading gir semantisk og tilgjengelig overskrift med riktig typografi fra designsystemet.
|
|
5
|
+
* Brukes for å sikre korrekt heading-hierarki (h1–h6) og typografi, og kan overstyres med variant for heading eller subheading.
|
|
6
|
+
*
|
|
7
|
+
* @slot - tekst - Selve overskriften (innholdet).
|
|
8
|
+
*
|
|
9
|
+
* @csspart nve-heading Hele heading-elementet
|
|
10
|
+
*
|
|
11
|
+
* Se designsystemet for alle varianter og tokens.
|
|
12
|
+
*/
|
|
13
|
+
export default class NveHeading extends LitElement implements INveComponent {
|
|
14
|
+
testId: string | undefined;
|
|
15
|
+
/** Heading level - Hvilket nivå overskriften skal ha (h1-h6) */
|
|
16
|
+
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
17
|
+
/** Typografitype - Kan overstyre det som er standard typografi basert på nivå */
|
|
18
|
+
size?: 'headingXlarge' | 'headingLarge' | 'headingMedium' | 'headingSmall' | 'headingXsmall' | 'subheadingLarge' | 'subheadingMedium' | 'subheadingSmall';
|
|
19
|
+
static styles: import('lit').CSSResult[];
|
|
20
|
+
constructor();
|
|
21
|
+
protected getTagName(): string;
|
|
22
|
+
protected getDefaultTypographyType(): "headingXlarge" | "headingLarge" | "headingMedium" | "headingSmall" | "headingXsmall";
|
|
23
|
+
render(): import('lit-html').TemplateResult;
|
|
24
|
+
}
|
|
25
|
+
declare global {
|
|
26
|
+
interface HTMLElementTagNameMap {
|
|
27
|
+
'nve-heading': NveHeading;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { t as e } from "../../chunks/lit.js";
|
|
2
|
+
import { o as t, s as n, t as r } from "../../chunks/decorate.js";
|
|
3
|
+
import { n as i, r as a } from "../../chunks/static-html.js";
|
|
4
|
+
import o from "./nve-heading.styles.js";
|
|
5
|
+
//#region src/components/nve-heading/nve-heading.component.ts
|
|
6
|
+
var s = class extends e {
|
|
7
|
+
static {
|
|
8
|
+
this.styles = [o];
|
|
9
|
+
}
|
|
10
|
+
constructor() {
|
|
11
|
+
super(), this.testId = void 0, this.level = 1;
|
|
12
|
+
}
|
|
13
|
+
getTagName() {
|
|
14
|
+
return !this.level || this.level < 1 || this.level > 6 || isNaN(this.level) ? "h1" : `h${this.level}`;
|
|
15
|
+
}
|
|
16
|
+
getDefaultTypographyType() {
|
|
17
|
+
switch (this.level) {
|
|
18
|
+
case 1: return "headingXlarge";
|
|
19
|
+
case 2: return "headingLarge";
|
|
20
|
+
case 3: return "headingMedium";
|
|
21
|
+
case 4: return "headingSmall";
|
|
22
|
+
case 5: return "headingXsmall";
|
|
23
|
+
case 6: return "headingXsmall";
|
|
24
|
+
default: return "headingMedium";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
let e = this.getTagName();
|
|
29
|
+
return a`
|
|
30
|
+
<${i(e)} part="nve-heading" data-testid=${this.testId} class="heading ${this.size ? this.size : this.getDefaultTypographyType()}">
|
|
31
|
+
<slot></slot>
|
|
32
|
+
</${i(e)}>
|
|
33
|
+
`;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
r([t({ type: String })], s.prototype, "testId", void 0), r([t({
|
|
37
|
+
type: Number,
|
|
38
|
+
reflect: !0
|
|
39
|
+
})], s.prototype, "level", void 0), r([t({
|
|
40
|
+
type: String,
|
|
41
|
+
reflect: !0
|
|
42
|
+
})], s.prototype, "size", void 0), s = r([n("nve-heading")], s);
|
|
43
|
+
var c = s;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { c as default };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { u as e } from "../../chunks/lit.js";
|
|
2
|
+
//#region src/components/nve-heading/nve-heading.styles.ts
|
|
3
|
+
var t = e`
|
|
4
|
+
.heading {
|
|
5
|
+
margin: 0;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.headingXlarge {
|
|
9
|
+
font: var(--typography-heading-x-large);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.headingLarge {
|
|
13
|
+
font: var(--typography-heading-large);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.headingMedium {
|
|
17
|
+
font: var(--typography-heading-medium);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.headingSmall {
|
|
21
|
+
font: var(--typography-heading-small);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.headingXsmall {
|
|
25
|
+
font: var(--typography-heading-x-small);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.subheadingLarge {
|
|
29
|
+
font: var(--typography-subheading-large);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.subheadingMedium {
|
|
33
|
+
font: var(--typography-subheading-medium);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.subheadingSmall {
|
|
37
|
+
font: var(--typography-subheading-small);
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { t as default };
|