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,40 +1,147 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import {
|
|
3
|
-
import "../../chunks/
|
|
4
|
-
import "../../chunks/
|
|
5
|
-
import "../../chunks/
|
|
6
|
-
import "
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
import { n as e, t } from "../../chunks/lit.js";
|
|
2
|
+
import { a as n, o as r, r as i, s as a, t as o } from "../../chunks/decorate.js";
|
|
3
|
+
import { t as s } from "../../chunks/class-map.js";
|
|
4
|
+
import { t as c } from "../../chunks/if-defined.js";
|
|
5
|
+
import { r as l, t as u } from "../../chunks/static-html.js";
|
|
6
|
+
import d from "./nve-button.styles.js";
|
|
7
|
+
//#region src/components/nve-button/nve-button.component.ts
|
|
8
|
+
var f = class extends t {
|
|
9
|
+
static {
|
|
10
|
+
this.styles = [d];
|
|
11
|
+
}
|
|
12
|
+
getForm() {
|
|
13
|
+
if (this.form) {
|
|
14
|
+
let e = this.getRootNode().getElementById(this.form);
|
|
15
|
+
if (e instanceof HTMLFormElement) return e;
|
|
16
|
+
}
|
|
17
|
+
return this.closest("form");
|
|
18
|
+
}
|
|
19
|
+
constructLightDOMButton() {
|
|
20
|
+
let e = document.createElement("button");
|
|
21
|
+
return e.type = this.type, this.name && (e.name = this.name), e.value = this.value ?? "", (this.disabled || this.loading) && (e.disabled = !0), this.form && e.setAttribute("form", this.form), this.formAction && (e.formAction = this.formAction), this.formEnctype && (e.formEnctype = this.formEnctype), this.formMethod && (e.formMethod = this.formMethod), this.formNoValidate && (e.formNoValidate = !0), this.formTarget && (e.formTarget = this.formTarget), e.style.position = "absolute", e.style.width = "0", e.style.height = "0", e.style.clipPath = "inset(50%)", e.style.overflow = "hidden", e.style.whiteSpace = "nowrap", e;
|
|
22
|
+
}
|
|
23
|
+
handleClick(e) {
|
|
24
|
+
if (this.disabled || this.loading) {
|
|
25
|
+
e.preventDefault(), e.stopImmediatePropagation();
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (this.type === "submit" || this.type === "reset") {
|
|
29
|
+
let e = this.getForm();
|
|
30
|
+
if (!e) return;
|
|
31
|
+
let t = this.constructLightDOMButton();
|
|
32
|
+
e.appendChild(t), t.click(), t.remove();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
handleDefaultSlotChange(e) {
|
|
36
|
+
let t = e.target.assignedNodes({ flatten: !0 });
|
|
37
|
+
if (t.some((e) => e.nodeType === Node.TEXT_NODE && e.textContent?.trim())) return;
|
|
38
|
+
let n = t.filter((e) => e.nodeType === Node.ELEMENT_NODE);
|
|
39
|
+
n.length === 1 && (this.hasIconOrImgOnly = n.some((e) => {
|
|
40
|
+
let t = e.tagName.toLowerCase();
|
|
41
|
+
return t === "img" || t === "nve-icon";
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
click() {
|
|
45
|
+
this.button.click();
|
|
46
|
+
}
|
|
47
|
+
focus(e) {
|
|
48
|
+
this.button.focus(e);
|
|
49
|
+
}
|
|
50
|
+
blur() {
|
|
51
|
+
this.button.blur();
|
|
52
|
+
}
|
|
53
|
+
isLink() {
|
|
54
|
+
return !!this.href;
|
|
55
|
+
}
|
|
56
|
+
forwardAriaAttributes(e) {
|
|
57
|
+
for (let t of this.getAttributeNames()) if (t.startsWith("aria-")) {
|
|
58
|
+
let n = this.getAttribute(t);
|
|
59
|
+
n !== null && (e.setAttribute(t, n), this.removeAttribute(t));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
constructor() {
|
|
63
|
+
super(), this.testId = void 0, this.circle = !1, this.loading = !1, this.size = "medium", this.variant = "secondary", this.formNoValidate = !1, this.autofocus = !1, this.disabled = !1, this.type = "button", this.ariaExpanded = null, this.ariaHaspopup = null, this.ariaLabel = null, this.ariaPressed = null, this.hasIconOrImgOnly = !1;
|
|
64
|
+
}
|
|
65
|
+
updated() {
|
|
66
|
+
this.button && this.forwardAriaAttributes(this.button);
|
|
67
|
+
}
|
|
68
|
+
firstUpdated(e) {
|
|
69
|
+
this.autofocus && this.focus();
|
|
70
|
+
}
|
|
71
|
+
render() {
|
|
72
|
+
let t = this.isLink(), n = t ? u`a` : u`button`;
|
|
73
|
+
return l`
|
|
74
|
+
<${n}
|
|
75
|
+
part="base"
|
|
76
|
+
@click=${this.handleClick}
|
|
77
|
+
class=${s({
|
|
78
|
+
button: !0,
|
|
79
|
+
"button--small": this.size === "small",
|
|
80
|
+
"button--medium": this.size === "medium",
|
|
81
|
+
"button--large": this.size === "large",
|
|
82
|
+
"button--primary": this.variant === "primary",
|
|
83
|
+
"button--secondary": this.variant === "secondary",
|
|
84
|
+
"button--tertiary": this.variant === "tertiary",
|
|
85
|
+
"button--ghost": this.variant === "ghost",
|
|
86
|
+
"button--danger": this.variant === "danger",
|
|
87
|
+
"button--loading": this.loading,
|
|
88
|
+
"button--icon-only": this.hasIconOrImgOnly,
|
|
89
|
+
"button--circle": this.circle && this.hasIconOrImgOnly,
|
|
90
|
+
"button--disabled": this.disabled
|
|
91
|
+
})}
|
|
92
|
+
?disabled=${c(t ? void 0 : this.disabled)}
|
|
93
|
+
type=${c(t ? void 0 : this.type)}
|
|
94
|
+
name=${c(t ? void 0 : this.name)}
|
|
95
|
+
value=${c(t ? void 0 : this.value)}
|
|
96
|
+
href=${c(t ? this.href : void 0)}
|
|
97
|
+
target=${c(t ? this.target : void 0)}
|
|
98
|
+
download=${c(t ? this.download : void 0)}
|
|
99
|
+
testid=${c(this.testId)}
|
|
100
|
+
form=${c(t ? void 0 : this.form)}
|
|
101
|
+
formaction=${c(t ? void 0 : this.formAction)}
|
|
102
|
+
formenctype=${c(t ? void 0 : this.formEnctype)}
|
|
103
|
+
formtarget=${c(t ? void 0 : this.formTarget)}
|
|
104
|
+
rel=${c(t && this.rel ? this.rel : void 0)}
|
|
105
|
+
aria-disabled=${c(t && this.disabled ? "true" : void 0)}
|
|
106
|
+
tabindex=${c(t && this.disabled ? "-1" : void 0)}
|
|
107
|
+
>
|
|
108
|
+
<slot part="start" name="start"></slot>
|
|
109
|
+
|
|
110
|
+
${this.loading && this.hasIconOrImgOnly ? e : l`<slot part="label" @slotchange=${this.handleDefaultSlotChange}> </slot>`}
|
|
111
|
+
${this.loading ? l`<div part="spinner" class="button__spinner"></div>` : e}
|
|
112
|
+
${this.loading ? e : l`<slot part="end" name="end"></slot>`}
|
|
113
|
+
</${n}>
|
|
114
|
+
`;
|
|
115
|
+
}
|
|
40
116
|
};
|
|
117
|
+
o([r({ type: String })], f.prototype, "testId", void 0), o([r({ type: Boolean })], f.prototype, "circle", void 0), o([r({
|
|
118
|
+
type: Boolean,
|
|
119
|
+
reflect: !0
|
|
120
|
+
})], f.prototype, "loading", void 0), o([r({ type: String })], f.prototype, "size", void 0), o([r({
|
|
121
|
+
type: String,
|
|
122
|
+
reflect: !0
|
|
123
|
+
})], f.prototype, "variant", void 0), o([r({ type: String })], f.prototype, "download", void 0), o([r({ type: String })], f.prototype, "href", void 0), o([r({ type: String })], f.prototype, "hreflang", void 0), o([r({ type: String })], f.prototype, "referrerpolicy", void 0), o([r({ type: String })], f.prototype, "rel", void 0), o([r({ type: String })], f.prototype, "target", void 0), o([r({ type: String })], f.prototype, "form", void 0), o([r({ type: String })], f.prototype, "formAction", void 0), o([r({ type: String })], f.prototype, "formEnctype", void 0), o([r({ type: String })], f.prototype, "formMethod", void 0), o([r({ type: Boolean })], f.prototype, "formNoValidate", void 0), o([r({ type: String })], f.prototype, "formTarget", void 0), o([r({ type: String })], f.prototype, "name", void 0), o([r({
|
|
124
|
+
type: Boolean,
|
|
125
|
+
reflect: !0
|
|
126
|
+
})], f.prototype, "autofocus", void 0), o([r({
|
|
127
|
+
type: Boolean,
|
|
128
|
+
reflect: !0
|
|
129
|
+
})], f.prototype, "disabled", void 0), o([r({ type: String })], f.prototype, "type", void 0), o([r({ type: String })], f.prototype, "value", void 0), o([r({
|
|
130
|
+
type: String,
|
|
131
|
+
attribute: "aria-controls"
|
|
132
|
+
})], f.prototype, "ariaControls", void 0), o([r({
|
|
133
|
+
type: String,
|
|
134
|
+
attribute: "aria-expanded"
|
|
135
|
+
})], f.prototype, "ariaExpanded", void 0), o([r({
|
|
136
|
+
type: String,
|
|
137
|
+
attribute: "aria-haspopup"
|
|
138
|
+
})], f.prototype, "ariaHaspopup", void 0), o([r({
|
|
139
|
+
type: String,
|
|
140
|
+
attribute: "aria-label"
|
|
141
|
+
})], f.prototype, "ariaLabel", void 0), o([r({
|
|
142
|
+
type: String,
|
|
143
|
+
attribute: "aria-pressed"
|
|
144
|
+
})], f.prototype, "ariaPressed", void 0), o([n()], f.prototype, "hasIconOrImgOnly", void 0), o([i(".button")], f.prototype, "button", void 0), f = o([a("nve-button")], f);
|
|
145
|
+
var p = f;
|
|
146
|
+
//#endregion
|
|
147
|
+
export { p as default };
|
|
@@ -1,223 +1,280 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/* derfor setter margin på ::part(label) og substraherer margin verdi i horizontal padding i selve .button klassen */
|
|
1
|
+
import { u as e } from "../../chunks/lit.js";
|
|
2
|
+
//#region src/components/nve-button/nve-button.styles.ts
|
|
3
|
+
var t = e`
|
|
5
4
|
:host {
|
|
5
|
+
display: inline-block;
|
|
6
|
+
position: relative;
|
|
7
|
+
width: fit-content;
|
|
8
|
+
--_img-small-size: var(--font-size-medium);
|
|
9
|
+
--_img-large-size: var(--font-size-large);
|
|
10
|
+
--_transition-time: 0.3s;
|
|
11
|
+
--nve-icon-color-hover: inherit;
|
|
12
|
+
--nve-icon-color-pressed: inherit;
|
|
6
13
|
--nve-icon-color: inherit;
|
|
7
14
|
}
|
|
8
15
|
|
|
9
16
|
.button {
|
|
10
|
-
|
|
17
|
+
padding-inline: unset;
|
|
18
|
+
margin: unset;
|
|
19
|
+
padding-block: unset;
|
|
20
|
+
display: flex;
|
|
21
|
+
background: var(--_button-background, transparent);
|
|
22
|
+
color: var(--_button-color, inherit);
|
|
23
|
+
border-radius: var(--border-radius-small);
|
|
24
|
+
border: var(--border-width-default) solid transparent;
|
|
25
|
+
border-color: var(--_button-border-color, transparent);
|
|
26
|
+
box-shadow: var(--_button-box-shadow, unset);
|
|
27
|
+
min-height: var(--sizing-fixed-sizing-medium);
|
|
28
|
+
min-width: var(--sizing-fixed-sizing-medium);
|
|
29
|
+
justify-content: center;
|
|
30
|
+
padding: var(--_button-padding, unset);
|
|
31
|
+
height: var(--_button-height, unset);
|
|
32
|
+
font: var(--_button-font, unset);
|
|
11
33
|
align-items: center;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
34
|
+
gap: var(--spacing-x-small);
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
text-align: center;
|
|
37
|
+
text-decoration: none;
|
|
16
38
|
transition:
|
|
17
|
-
background-
|
|
18
|
-
|
|
39
|
+
background var(--_transition-time) ease,
|
|
40
|
+
color var(--_transition-time) ease,
|
|
41
|
+
border-color var(--_transition-time) ease,
|
|
42
|
+
box-shadow var(--_transition-time) ease;
|
|
19
43
|
}
|
|
20
44
|
|
|
21
|
-
:
|
|
22
|
-
|
|
45
|
+
.button:not(.button--loading):not(.button--disabled):hover {
|
|
46
|
+
background: var(--_button-background-hover, transparent);
|
|
47
|
+
color: var(--_button-color-hover, inherit);
|
|
48
|
+
border-color: var(--_button-border-color-hover, transparent);
|
|
49
|
+
box-shadow: var(--_button-box-shadow-hover, unset);
|
|
23
50
|
}
|
|
24
51
|
|
|
25
|
-
:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
52
|
+
.button:not(.button--loading):not(.button--disabled):active {
|
|
53
|
+
background: var(--_button-background-pressed, transparent);
|
|
54
|
+
color: var(--_button-color-pressed, inherit);
|
|
55
|
+
box-shadow: var(--_button-box-shadow-pressed, unset);
|
|
29
56
|
}
|
|
30
57
|
|
|
31
|
-
:
|
|
32
|
-
|
|
33
|
-
padding: var(--spacing-x-small);
|
|
34
|
-
min-width: unset;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
:host([has-icon-only][circle])::part(base) {
|
|
38
|
-
width: unset;
|
|
58
|
+
.button:focus-visible {
|
|
59
|
+
outline: var(--border-width-strong) solid var(--color-interactive-border-accessibility-focus);
|
|
39
60
|
}
|
|
40
61
|
|
|
41
|
-
|
|
42
|
-
|
|
62
|
+
/* Varianter */
|
|
63
|
+
.button--primary {
|
|
64
|
+
--_button-background: var(--color-interactive-background-primary-enabled);
|
|
65
|
+
--_button-color: var(--color-interactive-foreground-primary-enabled);
|
|
66
|
+
&:hover {
|
|
67
|
+
--_button-background-hover: var(--color-interactive-background-primary-hover);
|
|
68
|
+
--_button-color-hover: var(--color-interactive-foreground-primary-hover);
|
|
69
|
+
}
|
|
70
|
+
&:active {
|
|
71
|
+
--_button-background-pressed: var(--color-interactive-background-primary-pressed);
|
|
72
|
+
--_button-color-pressed: var(--color-interactive-foreground-primary-hover);
|
|
73
|
+
}
|
|
43
74
|
}
|
|
44
75
|
|
|
45
|
-
.button
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
76
|
+
.button--secondary {
|
|
77
|
+
--_button-background: var(--color-interactive-background-secondary-enabled);
|
|
78
|
+
--_button-color: var(--color-interactive-foreground-secondary-enabled);
|
|
79
|
+
&:hover {
|
|
80
|
+
--_button-background-hover: var(--color-interactive-background-secondary-hover);
|
|
81
|
+
--_button-color-hover: var(--color-interactive-foreground-secondary-hover);
|
|
82
|
+
}
|
|
83
|
+
&:active {
|
|
84
|
+
--_button-background-pressed: var(--color-interactive-background-secondary-pressed);
|
|
85
|
+
--_button-color-pressed: var(--color-interactive-foreground-secondary-hover);
|
|
86
|
+
}
|
|
51
87
|
}
|
|
52
88
|
|
|
53
|
-
|
|
54
|
-
--
|
|
55
|
-
--
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
89
|
+
.button--tertiary {
|
|
90
|
+
--_button-background: transparent;
|
|
91
|
+
--_button-border-color: var(--color-interactive-border-secondary-enabled);
|
|
92
|
+
--_button-color: var(--color-interactive-foreground-secondary-enabled);
|
|
93
|
+
&:hover {
|
|
94
|
+
--_button-border-color-hover: var(--color-interactive-border-secondary-hover);
|
|
95
|
+
--_button-color-hover: var(--color-interactive-foreground-secondary-hover);
|
|
96
|
+
}
|
|
97
|
+
&:active {
|
|
98
|
+
--_button-box-shadow-pressed: inset 0 0 0 var(--border-width-default, 1px)
|
|
99
|
+
var(--color-interactive-border-secondary-hover);
|
|
100
|
+
--_button-color-pressed: var(--color-interactive-foreground-secondary-hover);
|
|
101
|
+
}
|
|
61
102
|
}
|
|
62
103
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
color: var(--
|
|
104
|
+
.button--ghost {
|
|
105
|
+
--_button-background: transparent;
|
|
106
|
+
--_button-color: var(--color-interactive-foreground-secondary-enabled);
|
|
107
|
+
&:hover {
|
|
108
|
+
--_button-background-hover: var(--color-interactive-background-tertiary-hover);
|
|
109
|
+
--_button-color-hover: var(--color-interactive-foreground-secondary-hover);
|
|
110
|
+
}
|
|
111
|
+
&:active {
|
|
112
|
+
--_button-background-pressed: var(--color-interactive-background-tertiary-pressed);
|
|
113
|
+
--_button-color-pressed: var(--color-interactive-foreground-secondary-hover);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
.button--danger {
|
|
117
|
+
--_button-background: var(--color-feedback-background-emphasized-error);
|
|
118
|
+
--_button-color: var(--color-interactive-foreground-danger-enabled);
|
|
119
|
+
&:hover {
|
|
120
|
+
--_button-background-hover: var(--color-interactive-background-danger-hover);
|
|
121
|
+
--_button-color-hover: var(--color-interactive-foreground-danger-enabled);
|
|
122
|
+
}
|
|
123
|
+
&:active {
|
|
124
|
+
--_button-background-pressed: var(--color-interactive-background-danger-pressed);
|
|
125
|
+
--_button-color-pressed: var(--color-interactive-foreground-danger-enabled);
|
|
126
|
+
}
|
|
66
127
|
}
|
|
67
128
|
|
|
68
|
-
|
|
69
|
-
|
|
129
|
+
/* Størrelser */
|
|
130
|
+
.button--small {
|
|
131
|
+
padding: 0 var(--spacing-x-small);
|
|
132
|
+
height: calc(var(--spacing-2x-small) * 2 + var(--_img-small-size));
|
|
133
|
+
font: var(--typography-label-x-small);
|
|
134
|
+
line-height: 1em;
|
|
135
|
+
::slotted(nve-icon) {
|
|
136
|
+
--icon-size: var(--_img-small-size);
|
|
137
|
+
}
|
|
138
|
+
::slotted(img) {
|
|
139
|
+
width: var(--_img-small-size);
|
|
140
|
+
height: var(--_img-small-size);
|
|
141
|
+
}
|
|
70
142
|
}
|
|
71
143
|
|
|
72
|
-
|
|
73
|
-
|
|
144
|
+
.button--medium {
|
|
145
|
+
padding: 0 var(--spacing-medium);
|
|
146
|
+
height: calc(var(--spacing-x-small) * 2 + var(--_img-large-size));
|
|
147
|
+
font: var(--typography-label-small);
|
|
148
|
+
line-height: 1em;
|
|
149
|
+
::slotted(nve-icon) {
|
|
150
|
+
--icon-size: var(--_img-large-size);
|
|
151
|
+
}
|
|
152
|
+
::slotted(img) {
|
|
153
|
+
width: var(--_img-large-size);
|
|
154
|
+
height: var(--_img-large-size);
|
|
155
|
+
}
|
|
74
156
|
}
|
|
75
157
|
|
|
76
|
-
|
|
158
|
+
.button--large {
|
|
159
|
+
padding: var(--spacing-none) var(--spacing-large);
|
|
160
|
+
height: calc(var(--spacing-small) * 2 + var(--_img-large-size));
|
|
77
161
|
font: var(--typography-label-medium);
|
|
162
|
+
::slotted(nve-icon) {
|
|
163
|
+
--icon-size: var(--_img-large-size);
|
|
164
|
+
}
|
|
165
|
+
::slotted(img) {
|
|
166
|
+
width: var(--_img-large-size);
|
|
167
|
+
height: var(--_img-large-size);
|
|
168
|
+
}
|
|
78
169
|
}
|
|
79
170
|
|
|
80
|
-
|
|
81
|
-
|
|
171
|
+
/* Ikon kun modifikatorer */
|
|
172
|
+
.button.button--small.button--icon-only,
|
|
173
|
+
.button.button--medium.button--icon-only,
|
|
174
|
+
.button.button--large.button--icon-only {
|
|
175
|
+
padding: 0;
|
|
176
|
+
color: var(--nve-icon-color, var(--_button-color));
|
|
177
|
+
&:hover {
|
|
178
|
+
color: var(--nve-icon-color-hover, var(--_button-color-hover));
|
|
179
|
+
}
|
|
180
|
+
&:active {
|
|
181
|
+
color: var(--nve-icon-color-pressed, var(--_button-color-pressed));
|
|
182
|
+
}
|
|
82
183
|
}
|
|
83
184
|
|
|
84
|
-
|
|
85
|
-
|
|
185
|
+
.button--small.button--icon-only {
|
|
186
|
+
width: calc(var(--spacing-2x-small) * 2 + var(--_img-small-size));
|
|
86
187
|
}
|
|
87
188
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
:host([loading]) .button--has-suffix.button--medium,
|
|
91
|
-
:host([loading]) .button--has-suffix.button--large {
|
|
92
|
-
padding-inline-end: var(--spacing-x-small);
|
|
189
|
+
.button--medium.button--icon-only {
|
|
190
|
+
width: calc(var(--spacing-x-small) * 2 + var(--_img-large-size));
|
|
93
191
|
}
|
|
94
192
|
|
|
95
|
-
|
|
96
|
-
|
|
193
|
+
.button--large.button--icon-only {
|
|
194
|
+
width: calc(var(--spacing-small) * 2 + var(--_img-large-size));
|
|
97
195
|
}
|
|
98
196
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
.button--
|
|
103
|
-
|
|
197
|
+
/* Sirkulære knapper */
|
|
198
|
+
.button--medium.button--circle,
|
|
199
|
+
.button--large.button--circle,
|
|
200
|
+
.button--small.button--circle {
|
|
201
|
+
border-radius: var(--border-radius-circle);
|
|
104
202
|
}
|
|
105
203
|
|
|
106
|
-
|
|
107
|
-
|
|
204
|
+
.button--medium.button--circle {
|
|
205
|
+
padding: var(--spacing-x-small);
|
|
108
206
|
}
|
|
109
207
|
|
|
110
|
-
.button--
|
|
111
|
-
padding
|
|
208
|
+
.button--large.button--circle {
|
|
209
|
+
padding: var(--spacing-small);
|
|
112
210
|
}
|
|
113
211
|
|
|
114
|
-
.button--
|
|
115
|
-
|
|
116
|
-
padding-inline-start: var(--spacing-medium, 1rem);
|
|
212
|
+
.button--small.button--circle {
|
|
213
|
+
padding: var(--spacing-2x-small);
|
|
117
214
|
}
|
|
118
215
|
|
|
119
|
-
|
|
120
|
-
.button--
|
|
121
|
-
|
|
122
|
-
padding: unset;
|
|
123
|
-
}
|
|
124
|
-
.button:not(.button--has-label) .button__label {
|
|
125
|
-
display: none;
|
|
216
|
+
/* Deaktivert */
|
|
217
|
+
.button--disabled {
|
|
218
|
+
cursor: not-allowed;
|
|
126
219
|
}
|
|
127
220
|
|
|
128
|
-
.button--
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
padding: 0px;
|
|
132
|
-
}
|
|
133
|
-
.button--large {
|
|
134
|
-
height: var(--sizing-fixed-sizing-x-large);
|
|
135
|
-
min-height: unset;
|
|
136
|
-
padding: var(--spacing-medium, 1rem) calc(var(--spacing-medium, 1rem) - var(--spacing-x-small));
|
|
137
|
-
}
|
|
138
|
-
/* fjern gap forskjell på venstre og høyre */
|
|
139
|
-
.button--medium {
|
|
140
|
-
height: var(--sizing-fixed-sizing-large);
|
|
141
|
-
min-height: unset;
|
|
142
|
-
padding: var(--spacing-medium, 1rem) calc(var(--spacing-medium, 1rem) - var(--spacing-x-small));
|
|
221
|
+
.button--primary.button--disabled {
|
|
222
|
+
--_button-background: var(--color-interactive-background-primary-disabled);
|
|
223
|
+
--_button-color: var(--color-interactive-foreground-primary-disabled);
|
|
143
224
|
}
|
|
144
225
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
color: var(--color-interactive-primary-foreground-default);
|
|
149
|
-
border: none;
|
|
150
|
-
}
|
|
151
|
-
:host([variant='primary']) .button--standard.button:hover:not(.button--disabled),
|
|
152
|
-
:host([variant='primary']) .button--standard.button:active:not(.button--disabled) {
|
|
153
|
-
background: var(--color-interactive-primary-background-hover);
|
|
154
|
-
color: var(--color-interactive-primary-foreground-default);
|
|
226
|
+
.button--secondary.button--disabled {
|
|
227
|
+
--_button-background: var(--color-interactive-background-secondary-disabled);
|
|
228
|
+
--_button-color: var(--color-interactive-foreground-secondary-disabled);
|
|
155
229
|
}
|
|
156
230
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
background: var(--color-interactive-secondary-background-default);
|
|
161
|
-
color: var(--color-interactive-secondary-foreground-default);
|
|
162
|
-
border: none;
|
|
163
|
-
}
|
|
164
|
-
:host([variant='secondary']) .button--standard.button:hover:not(.button--disabled),
|
|
165
|
-
:host([variant='default']) .button--standard.button:hover:not(.button--disabled) {
|
|
166
|
-
background: var(--color-interactive-secondary-background-hover);
|
|
167
|
-
color: var(--color-interactive-secondary-foreground-hover);
|
|
231
|
+
.button--tertiary.button--disabled {
|
|
232
|
+
--_button-border-color: var(--color-interactive-border-secondary-disabled);
|
|
233
|
+
--_button-color: var(--color-interactive-foreground-secondary-disabled);
|
|
168
234
|
}
|
|
169
235
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
:host([variant='ghost']) .button.button--standard {
|
|
173
|
-
color: var(--color-interactive-ghost-foreground-default);
|
|
174
|
-
background-color: transparent;
|
|
175
|
-
border-radius: var(--border-radius-small, 4px);
|
|
176
|
-
border: none;
|
|
236
|
+
.button--ghost.button--disabled {
|
|
237
|
+
--_button-color: var(--color-interactive-foreground-secondary-disabled);
|
|
177
238
|
}
|
|
178
239
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
240
|
+
.button--danger.button--disabled {
|
|
241
|
+
--_button-background: var(--color-interactive-background-danger-disabled);
|
|
242
|
+
--_button-color: var(--color-interactive-foreground-danger-disabled);
|
|
182
243
|
}
|
|
183
244
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
color: var(--color-interactive-ghost-foreground-hover);
|
|
245
|
+
/* Lastende */
|
|
246
|
+
.button--loading {
|
|
247
|
+
cursor: wait;
|
|
188
248
|
}
|
|
189
249
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
color: var(--color-interactive-
|
|
195
|
-
border-
|
|
196
|
-
|
|
197
|
-
border-style: solid;
|
|
198
|
-
background-color: transparent;
|
|
199
|
-
}
|
|
200
|
-
:host([variant='neutral']) .button.button--standard:hover:not(.button--disabled),
|
|
201
|
-
:host([variant='outline']) .button.button--standard:hover:not(.button--disabled),
|
|
202
|
-
:host([outline]) .button.button:hover:not(.button--disabled) {
|
|
203
|
-
border-color: var(--color-interactive-outlined-border-hover);
|
|
204
|
-
color: var(--color-interactive-outlined-foreground-hover);
|
|
205
|
-
border-width: var(--border-width-default);
|
|
206
|
-
border-style: solid;
|
|
207
|
-
background-color: transparent;
|
|
250
|
+
.button__spinner {
|
|
251
|
+
width: 20px;
|
|
252
|
+
height: 20px;
|
|
253
|
+
border: 2px solid var(--color-interactive-foreground-secondary-enabled);
|
|
254
|
+
border-color: var(--color-interactive-foreground-secondary-enabled) transparent transparent transparent;
|
|
255
|
+
border-radius: 50%;
|
|
256
|
+
animation: spin 0.8s linear infinite;
|
|
208
257
|
}
|
|
209
258
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
259
|
+
@keyframes spin {
|
|
260
|
+
from {
|
|
261
|
+
transform: rotate(0deg);
|
|
262
|
+
}
|
|
263
|
+
to {
|
|
264
|
+
transform: rotate(360deg);
|
|
265
|
+
}
|
|
215
266
|
}
|
|
216
267
|
|
|
217
|
-
|
|
218
|
-
|
|
268
|
+
/*
|
|
269
|
+
* Badge
|
|
270
|
+
*/
|
|
271
|
+
.button ::slotted(nve-badge) {
|
|
272
|
+
position: absolute;
|
|
273
|
+
top: 0;
|
|
274
|
+
right: 0;
|
|
275
|
+
translate: 50% -50%;
|
|
276
|
+
pointer-events: none;
|
|
219
277
|
}
|
|
220
278
|
`;
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
};
|
|
279
|
+
//#endregion
|
|
280
|
+
export { t as default };
|