nve-designsystem 3.1.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 +6 -6
- 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,87 +1,86 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return p`
|
|
1
|
+
import { a as e, n as t, t as n } from "../../chunks/lit.js";
|
|
2
|
+
import { o as r, s as i, t as a } from "../../chunks/decorate.js";
|
|
3
|
+
import { t as o } from "../../chunks/class-map.js";
|
|
4
|
+
import s from "./nve-tag.styles.js";
|
|
5
|
+
//#region src/components/nve-tag/nve-tag.component.ts
|
|
6
|
+
var c = class extends n {
|
|
7
|
+
constructor(...e) {
|
|
8
|
+
super(...e), this.variant = "neutral", this.saturation = "default", this.size = "medium", this.extraText = "", this.dot = !1, this.closeable = !1, this.closeAriaLabel = "Lukk";
|
|
9
|
+
}
|
|
10
|
+
static {
|
|
11
|
+
this.styles = [s];
|
|
12
|
+
}
|
|
13
|
+
closeButtonClick() {
|
|
14
|
+
let e = new CustomEvent("nve-close", {
|
|
15
|
+
bubbles: !0,
|
|
16
|
+
cancelable: !1,
|
|
17
|
+
composed: !0,
|
|
18
|
+
detail: {}
|
|
19
|
+
});
|
|
20
|
+
this.dispatchEvent(e);
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
return e`
|
|
25
24
|
<span
|
|
26
25
|
part="base"
|
|
27
|
-
class=${
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
26
|
+
class=${o({
|
|
27
|
+
tag: !0,
|
|
28
|
+
"tag--neutral": this.variant === "neutral",
|
|
29
|
+
"tag--info": this.variant === "info",
|
|
30
|
+
"tag--success": this.variant === "success",
|
|
31
|
+
"tag--warning": this.variant === "warning",
|
|
32
|
+
"tag--error": this.variant === "error",
|
|
33
|
+
"tag--small": this.size === "small",
|
|
34
|
+
"tag--medium": this.size === "medium",
|
|
35
|
+
"tag--saturation-emphasized": this.saturation === "emphasized",
|
|
36
|
+
"tag--saturation-subtle": this.saturation === "subtle",
|
|
37
|
+
"tag--saturation-default": this.saturation === "default"
|
|
38
|
+
})}
|
|
40
39
|
>
|
|
41
40
|
<slot name="prefix"
|
|
42
|
-
>${this.dot ?
|
|
41
|
+
>${this.dot ? e`<svg width="11" height="10" viewBox="0 0 11 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
43
42
|
<circle cx="5.5" cy="5" r="5" fill="currentcolor" />
|
|
44
|
-
</svg> ` :
|
|
43
|
+
</svg> ` : t}</slot
|
|
45
44
|
>
|
|
46
45
|
<slot part="text"></slot>
|
|
47
|
-
<slot name="extra" part="extra">${this
|
|
48
|
-
${this.closeable ?
|
|
46
|
+
<slot name="extra" part="extra">${this.extraText}</slot>
|
|
47
|
+
${this.closeable ? e`<button
|
|
49
48
|
part="close"
|
|
50
49
|
class="tag-close"
|
|
51
|
-
aria-label="${this
|
|
50
|
+
aria-label="${this.closeAriaLabel}"
|
|
52
51
|
@click=${this.closeButtonClick}
|
|
53
52
|
>
|
|
54
53
|
<nve-icon name="close"></nve-icon>
|
|
55
|
-
</button>` :
|
|
54
|
+
</button>` : t}
|
|
56
55
|
</span>
|
|
57
56
|
`;
|
|
58
|
-
|
|
59
|
-
};
|
|
60
|
-
t.styles = [m];
|
|
61
|
-
e([
|
|
62
|
-
s({ type: String, reflect: !0 })
|
|
63
|
-
], t.prototype, "variant", 2);
|
|
64
|
-
e([
|
|
65
|
-
s({ type: String, reflect: !0 })
|
|
66
|
-
], t.prototype, "saturation", 2);
|
|
67
|
-
e([
|
|
68
|
-
s({ type: String, reflect: !0 })
|
|
69
|
-
], t.prototype, "size", 2);
|
|
70
|
-
e([
|
|
71
|
-
s({ type: String, reflect: !1, attribute: !0 })
|
|
72
|
-
], t.prototype, "extra-text", 2);
|
|
73
|
-
e([
|
|
74
|
-
s({ type: Boolean, reflect: !1 })
|
|
75
|
-
], t.prototype, "dot", 2);
|
|
76
|
-
e([
|
|
77
|
-
s({ type: Boolean, reflect: !1 })
|
|
78
|
-
], t.prototype, "closeable", 2);
|
|
79
|
-
e([
|
|
80
|
-
s({ type: String, reflect: !1 })
|
|
81
|
-
], t.prototype, "close-aria-label", 2);
|
|
82
|
-
t = e([
|
|
83
|
-
f("nve-tag")
|
|
84
|
-
], t);
|
|
85
|
-
export {
|
|
86
|
-
t as default
|
|
57
|
+
}
|
|
87
58
|
};
|
|
59
|
+
a([r({
|
|
60
|
+
type: String,
|
|
61
|
+
reflect: !0
|
|
62
|
+
})], c.prototype, "variant", void 0), a([r({
|
|
63
|
+
type: String,
|
|
64
|
+
reflect: !0
|
|
65
|
+
})], c.prototype, "saturation", void 0), a([r({
|
|
66
|
+
type: String,
|
|
67
|
+
reflect: !0
|
|
68
|
+
})], c.prototype, "size", void 0), a([r({
|
|
69
|
+
type: String,
|
|
70
|
+
reflect: !1,
|
|
71
|
+
attribute: "extra-text"
|
|
72
|
+
})], c.prototype, "extraText", void 0), a([r({
|
|
73
|
+
type: Boolean,
|
|
74
|
+
reflect: !1
|
|
75
|
+
})], c.prototype, "dot", void 0), a([r({
|
|
76
|
+
type: Boolean,
|
|
77
|
+
reflect: !1,
|
|
78
|
+
attribute: "closeable"
|
|
79
|
+
})], c.prototype, "closeable", void 0), a([r({
|
|
80
|
+
type: String,
|
|
81
|
+
reflect: !1,
|
|
82
|
+
attribute: "close-aria-label"
|
|
83
|
+
})], c.prototype, "closeAriaLabel", void 0), c = a([i("nve-tag")], c);
|
|
84
|
+
var l = c;
|
|
85
|
+
//#endregion
|
|
86
|
+
export { l as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { u as e } from "../../chunks/lit.js";
|
|
2
|
+
//#region src/components/nve-tag/nve-tag.styles.ts
|
|
3
|
+
var t = e`
|
|
3
4
|
.tag {
|
|
4
5
|
display: flex;
|
|
5
6
|
gap: var(--spacing-2x-small);
|
|
@@ -15,104 +16,105 @@ const e = o`
|
|
|
15
16
|
|
|
16
17
|
:host([variant='neutral'][saturation='emphasized']) {
|
|
17
18
|
--_bg-color: var(--color-feedback-background-emphasized-neutral);
|
|
18
|
-
--_text-color: var(--color-feedback-foreground-emphasized-neutral);
|
|
19
|
+
--_text-color: var(--color-feedback-foreground-on-bg-emphasized-neutral,);
|
|
19
20
|
--_hover-bg-color: var(--color-feedback-background-default-neutral);
|
|
20
21
|
--_hover-text-color: var(--color-feedback-foreground-default-neutral);
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
:host([variant='neutral'][saturation='default']) {
|
|
24
25
|
--_bg-color: var(--color-feedback-background-default-neutral);
|
|
25
|
-
--_text-color: var(--color-feedback-foreground-
|
|
26
|
+
--_text-color: var(--color-feedback-foreground-on-bg-subtle-neutral);
|
|
26
27
|
--_hover-bg-color: var(--color-feedback-background-subtle-neutral);
|
|
27
28
|
--_hover-text-color: var(--color-feedback-foreground-subtle-neutral);
|
|
28
29
|
}
|
|
29
|
-
|
|
30
|
+
|
|
31
|
+
:host([variant='neutral'][saturation='subtle']) {
|
|
30
32
|
--_bg-color: var(--color-feedback-background-subtle-neutral);
|
|
31
|
-
--_text-color: var(--color-feedback-foreground-subtle-neutral);
|
|
33
|
+
--_text-color: var(--color-feedback-foreground-on-bg-subtle-neutral);
|
|
32
34
|
--_hover-bg-color: var(--color-feedback-background-default-neutral);
|
|
33
35
|
--_hover-text-color: var(--color-feedback-foreground-default-neutral);
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
:host([variant='success'][saturation='emphasized']) {
|
|
37
39
|
--_bg-color: var(--color-feedback-background-emphasized-success);
|
|
38
|
-
--_text-color: var(--color-feedback-foreground-emphasized-success);
|
|
40
|
+
--_text-color: var(--color-feedback-foreground-on-bg-emphasized-success);
|
|
39
41
|
--_hover-bg-color: var(--color-feedback-background-default-success);
|
|
40
42
|
--_hover-text-color: var(--color-feedback-foreground-default-success);
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
:host([variant='success'][saturation='default']) {
|
|
44
46
|
--_bg-color: var(--color-feedback-background-default-success);
|
|
45
|
-
--_text-color: var(--color-feedback-foreground-
|
|
47
|
+
--_text-color: var(--color-feedback-foreground-on-bg-subtle-success);
|
|
46
48
|
--_hover-bg-color: var(--color-feedback-background-subtle-success);
|
|
47
49
|
--_hover-text-color: var(--color-feedback-foreground-subtle-success);
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
:host([variant='success'][saturation='subtle']) {
|
|
51
53
|
--_bg-color: var(--color-feedback-background-subtle-success);
|
|
52
|
-
--_text-color: var(--color-feedback-foreground-subtle-success);
|
|
54
|
+
--_text-color: var(--color-feedback-foreground-on-bg-subtle-success);
|
|
53
55
|
--_hover-bg-color: var(--color-feedback-background-default-success);
|
|
54
56
|
--_hover-text-color: var(--color-feedback-foreground-default-success);
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
:host([variant='info'][saturation='emphasized']) {
|
|
58
60
|
--_bg-color: var(--color-feedback-background-emphasized-info);
|
|
59
|
-
--_text-color: var(--color-feedback-foreground-emphasized-info);
|
|
61
|
+
--_text-color: var(--color-feedback-foreground-on-bg-emphasized-info);
|
|
60
62
|
--_hover-bg-color: var(--color-feedback-background-default-info);
|
|
61
63
|
--_hover-text-color: var(--color-feedback-foreground-default-info);
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
:host([variant='info'][saturation='default']) {
|
|
65
67
|
--_bg-color: var(--color-feedback-background-default-info);
|
|
66
|
-
--_text-color: var(--color-feedback-foreground-
|
|
68
|
+
--_text-color: var(--color-feedback-foreground-on-bg-subtle-info);
|
|
67
69
|
--_hover-bg-color: var(--color-feedback-background-subtle-info);
|
|
68
70
|
--_hover-text-color: var(--color-feedback-foreground-subtle-info);
|
|
69
71
|
}
|
|
70
72
|
|
|
71
73
|
:host([variant='info'][saturation='subtle']) {
|
|
72
74
|
--_bg-color: var(--color-feedback-background-subtle-info);
|
|
73
|
-
--_text-color: var(--color-feedback-foreground-subtle-info);
|
|
75
|
+
--_text-color: var(--color-feedback-foreground-on-bg-subtle-info);
|
|
74
76
|
--_hover-bg-color: var(--color-feedback-background-default-info);
|
|
75
77
|
--_hover-text-color: var(--color-feedback-foreground-default-info);
|
|
76
78
|
}
|
|
77
79
|
|
|
78
80
|
:host([variant='warning'][saturation='emphasized']) {
|
|
79
81
|
--_bg-color: var(--color-feedback-background-emphasized-warning);
|
|
80
|
-
--_text-color: var(--color-feedback-foreground-emphasized-warning);
|
|
82
|
+
--_text-color: var(--color-feedback-foreground-on-bg-emphasized-warning);
|
|
81
83
|
--_hover-bg-color: var(--color-feedback-background-default-warning);
|
|
82
84
|
--_hover-text-color: var(--color-feedback-foreground-default-warning);
|
|
83
85
|
}
|
|
84
86
|
|
|
85
87
|
:host([variant='warning'][saturation='default']) {
|
|
86
88
|
--_bg-color: var(--color-feedback-background-default-warning);
|
|
87
|
-
--_text-color: var(--color-feedback-foreground-
|
|
89
|
+
--_text-color: var(--color-feedback-foreground-on-bg-subtle-warning);
|
|
88
90
|
--_hover-bg-color: var(--color-feedback-background-subtle-warning);
|
|
89
91
|
--_hover-text-color: var(--color-feedback-foreground-subtle-warning);
|
|
90
92
|
}
|
|
91
93
|
|
|
92
94
|
:host([variant='warning'][saturation='subtle']) {
|
|
93
95
|
--_bg-color: var(--color-feedback-background-subtle-warning);
|
|
94
|
-
--_text-color: var(--color-feedback-foreground-subtle-warning);
|
|
96
|
+
--_text-color: var(--color-feedback-foreground-on-bg-subtle-warning);
|
|
95
97
|
--_hover-bg-color: var(--color-feedback-background-default-warning);
|
|
96
98
|
--_hover-text-color: var(--color-feedback-foreground-default-warning);
|
|
97
99
|
}
|
|
98
100
|
|
|
99
101
|
:host([variant='error'][saturation='emphasized']) {
|
|
100
102
|
--_bg-color: var(--color-feedback-background-emphasized-error);
|
|
101
|
-
--_text-color: var(--color-feedback-foreground-emphasized-error);
|
|
103
|
+
--_text-color: var(--color-feedback-foreground-on-bg-emphasized-error);
|
|
102
104
|
--_hover-bg-color: var(--color-feedback-background-default-error);
|
|
103
105
|
--_hover-text-color: var(--color-feedback-foreground-default-error);
|
|
104
106
|
}
|
|
105
107
|
|
|
106
108
|
:host([variant='error'][saturation='default']) {
|
|
107
109
|
--_bg-color: var(--color-feedback-background-default-error);
|
|
108
|
-
--_text-color: var(--color-feedback-foreground-
|
|
110
|
+
--_text-color: var(--color-feedback-foreground-on-bg-subtle-error);
|
|
109
111
|
--_hover-bg-color: var(--color-feedback-background-subtle-error);
|
|
110
112
|
--_hover-text-color: var(--color-feedback-foreground-subtle-error);
|
|
111
113
|
}
|
|
112
114
|
|
|
113
115
|
:host([variant='error'][saturation='subtle']) {
|
|
114
116
|
--_bg-color: var(--color-feedback-background-subtle-error);
|
|
115
|
-
--_text-color: var(--color-feedback-foreground-subtle-error);
|
|
117
|
+
--_text-color: var(--color-feedback-foreground-on-bg-subtle-error);
|
|
116
118
|
--_hover-bg-color: var(--color-feedback-background-default-error);
|
|
117
119
|
--_hover-text-color: var(--color-feedback-foreground-default-error);
|
|
118
120
|
}
|
|
@@ -170,9 +172,8 @@ const e = o`
|
|
|
170
172
|
}
|
|
171
173
|
|
|
172
174
|
.tag.tag--saturation-emphasized.tag--neutral:has(.tag-close:focus-visible) {
|
|
173
|
-
outline-color: var(--color-interactive-
|
|
175
|
+
outline-color: var(--color-interactive-border-accessibility-focus);
|
|
174
176
|
}
|
|
175
177
|
`;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
};
|
|
178
|
+
//#endregion
|
|
179
|
+
export { t as default };
|
|
@@ -40,6 +40,8 @@ export default class NveTextarea extends LitElement implements INveComponent {
|
|
|
40
40
|
label: string;
|
|
41
41
|
/** Hjelpetekst under textarea */
|
|
42
42
|
helpText: string;
|
|
43
|
+
/** Hint - tekst under inndatafelt */
|
|
44
|
+
hint: string;
|
|
43
45
|
/** Om textarea er deaktivert */
|
|
44
46
|
disabled: boolean;
|
|
45
47
|
/** Om textarea er skrivebeskyttet */
|
|
@@ -57,7 +59,7 @@ export default class NveTextarea extends LitElement implements INveComponent {
|
|
|
57
59
|
/** Kontrollerer om og hvordan tekstinnput automatisk blir gjort stor som det blir skrevet inn av brukeren. */
|
|
58
60
|
autocapitalize: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters';
|
|
59
61
|
/** Indikerer om nettleserens autokorrekturfunksjon er på eller av. */
|
|
60
|
-
autocorrect
|
|
62
|
+
autocorrect: 'on' | 'off';
|
|
61
63
|
/** Indikerer om nettleserens autokorrekturfunksjon er på eller av. */
|
|
62
64
|
tooltip?: string;
|
|
63
65
|
/**
|
|
@@ -1,103 +1,101 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { o as r } from "../../chunks/if-defined.js";
|
|
7
|
-
import { l as y } from "../../chunks/live.js";
|
|
8
|
-
import { e as g } from "../../chunks/class-map.js";
|
|
1
|
+
import { a as e, n as t, t as n } from "../../chunks/lit.js";
|
|
2
|
+
import { a as r, o as i, r as a, s as o, t as s } from "../../chunks/decorate.js";
|
|
3
|
+
import { t as c } from "../../chunks/class-map.js";
|
|
4
|
+
import { t as l } from "../../chunks/if-defined.js";
|
|
5
|
+
import { t as u } from "../../chunks/live.js";
|
|
9
6
|
import "../nve-icon/nve-icon.component.js";
|
|
10
|
-
import "
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return o`
|
|
75
|
-
<div part="form-control" class=${g({ "form-control": !0, "form-control--has-label": this.label })}>
|
|
76
|
-
${i ? o`<slot name="label"></slot>` : this.label ? o`<nve-label
|
|
7
|
+
import "../../chunks/nve-label.component.js";
|
|
8
|
+
import d from "./nve-textarea.styles.js";
|
|
9
|
+
//#region src/components/nve-textarea/nve-textarea.component.ts
|
|
10
|
+
var f = class extends n {
|
|
11
|
+
static {
|
|
12
|
+
this.styles = [d];
|
|
13
|
+
}
|
|
14
|
+
constructor() {
|
|
15
|
+
super(), this.name = "", this.value = "", this.title = "", this.filled = !1, this.label = "", this.helpText = "", this.hint = "", this.disabled = !1, this.readonly = !1, this.placeholder = "", this.required = !1, this.requiredLabel = "*Obligatorisk", this.autocapitalize = "off", this.autocorrect = "off", this.testId = "", this.showErrorMessage = !1, this.touched = !1, this.resizeObserver = null;
|
|
16
|
+
}
|
|
17
|
+
firstUpdated() {
|
|
18
|
+
if (this.requiredLabel && this.style.setProperty("--textarea-required-content", `"${this.requiredLabel}"`), this.required) {
|
|
19
|
+
let e = this.input.checkValidity();
|
|
20
|
+
this.toggleAttribute("data-valid", e), this.toggleAttribute("data-invalid", !e);
|
|
21
|
+
}
|
|
22
|
+
let e = this.shadowRoot?.querySelector(".textarea__control"), t = this.shadowRoot?.querySelector(".textarea__label");
|
|
23
|
+
e && t && (this.resizeObserver = new ResizeObserver((e) => {
|
|
24
|
+
for (let n of e) t.style.width = `${n.contentRect.width + 32}px`;
|
|
25
|
+
}), this.resizeObserver.observe(e));
|
|
26
|
+
}
|
|
27
|
+
connectedCallback() {
|
|
28
|
+
super.connectedCallback(), this.closest("form")?.addEventListener("submit", this.handleSubmit.bind(this));
|
|
29
|
+
}
|
|
30
|
+
disconnectedCallback() {
|
|
31
|
+
super.disconnectedCallback(), this.closest("form")?.removeEventListener("submit", this.handleSubmit.bind(this)), this.resizeObserver?.disconnect();
|
|
32
|
+
}
|
|
33
|
+
emit(e) {
|
|
34
|
+
this.dispatchEvent(new CustomEvent(e));
|
|
35
|
+
}
|
|
36
|
+
handleSubmit(e) {
|
|
37
|
+
e.preventDefault(), this.checkValidity();
|
|
38
|
+
}
|
|
39
|
+
handleBlur() {
|
|
40
|
+
this.touched && this.checkValidity(), this.emit("sl-blur");
|
|
41
|
+
}
|
|
42
|
+
handleChange() {
|
|
43
|
+
this.value = this.input.value, this.emit("sl-change");
|
|
44
|
+
}
|
|
45
|
+
handleInput() {
|
|
46
|
+
this.touched = !0, this.value = this.input.value, this.emit("sl-input");
|
|
47
|
+
}
|
|
48
|
+
checkValidity() {
|
|
49
|
+
this.input.checkValidity() ? this.resetValidation() : this.makeInvalid();
|
|
50
|
+
}
|
|
51
|
+
setCustomValidity(e = "") {
|
|
52
|
+
this.input.setCustomValidity(e), this.checkValidity();
|
|
53
|
+
}
|
|
54
|
+
makeInvalid() {
|
|
55
|
+
this.errorMessage = this.errorMessage || this.input.validationMessage, this.showErrorMessage = !0, this.emit("sl-invalid"), this.toggleValidationAttributes(!1);
|
|
56
|
+
}
|
|
57
|
+
resetValidation() {
|
|
58
|
+
this.showErrorMessage = !1, this.toggleValidationAttributes(!0);
|
|
59
|
+
}
|
|
60
|
+
toggleValidationAttributes(e) {
|
|
61
|
+
this.toggleAttribute("data-valid", e), this.toggleAttribute("data-user-valid", e), this.toggleAttribute("data-invalid", !e), this.toggleAttribute("data-user-invalid", !e);
|
|
62
|
+
}
|
|
63
|
+
render() {
|
|
64
|
+
let n = !!this.querySelector("[slot=\"label\"]");
|
|
65
|
+
return e`
|
|
66
|
+
<div part="form-control" class=${c({
|
|
67
|
+
"form-control": !0,
|
|
68
|
+
"form-control--has-label": this.label
|
|
69
|
+
})}>
|
|
70
|
+
${n ? e`<slot name="label"></slot>` : this.label ? e`<nve-label
|
|
77
71
|
id="label"
|
|
78
72
|
value=${this.label}
|
|
79
73
|
size="small"
|
|
80
|
-
tooltip=${
|
|
81
|
-
></nve-label>` :
|
|
74
|
+
tooltip=${l(this.tooltip)}
|
|
75
|
+
></nve-label>` : t}
|
|
76
|
+
${this.helpText ? e` <div part="help-text-container" class="textarea__help-text__container">
|
|
77
|
+
<span class="textarea__help-text" aria-hidden=${this.helpText ? "false" : "true"}>${this.helpText}</span>
|
|
78
|
+
</div>` : t}
|
|
79
|
+
|
|
82
80
|
<div part="base" class="textarea__base">
|
|
83
81
|
<textarea
|
|
84
82
|
part="textarea"
|
|
85
83
|
class="textarea__control"
|
|
86
84
|
title=${this.title}
|
|
87
|
-
name=${
|
|
88
|
-
.value=${
|
|
85
|
+
name=${l(this.name)}
|
|
86
|
+
.value=${u(this.value)}
|
|
89
87
|
?disabled=${this.disabled}
|
|
90
88
|
?readonly=${this.readonly}
|
|
91
89
|
?required=${this.required}
|
|
92
|
-
placeholder=${
|
|
93
|
-
minlength=${
|
|
94
|
-
maxlength=${
|
|
95
|
-
autocapitalize=${
|
|
96
|
-
autocorrect=${
|
|
90
|
+
placeholder=${l(this.placeholder)}
|
|
91
|
+
minlength=${l(this.minlength)}
|
|
92
|
+
maxlength=${l(this.maxlength)}
|
|
93
|
+
autocapitalize=${l(this.autocapitalize)}
|
|
94
|
+
autocorrect=${l(this.autocorrect)}
|
|
97
95
|
?autofocus=${this.autofocus}
|
|
98
|
-
inputmode=${
|
|
96
|
+
inputmode=${l(this.inputmode)}
|
|
99
97
|
aria-describedby="help-text"
|
|
100
|
-
rows=${
|
|
98
|
+
rows=${l(this.rows && this.rows >= 3 ? this.rows : 3)}
|
|
101
99
|
@change=${this.handleChange}
|
|
102
100
|
@input=${this.handleInput}
|
|
103
101
|
@blur=${this.handleBlur}
|
|
@@ -107,95 +105,36 @@ let e = class extends m {
|
|
|
107
105
|
Må gjøres sånn fordi vi vil ikke begrense textarea__base brede til fit-content (da textarea kan aldri ta så mye plass som er
|
|
108
106
|
tilgjengelig i nettleseren og man må alltid sette brede på den manuelt. Nei takk.) -->
|
|
109
107
|
<!-- Foreløpig kan man ha enten 'lock' eller 'error' ikone -->
|
|
110
|
-
${this.disabled || this.showErrorMessage ?
|
|
111
|
-
${this.disabled ?
|
|
112
|
-
${this.showErrorMessage ?
|
|
113
|
-
</div>` :
|
|
108
|
+
${this.disabled || this.showErrorMessage ? e`<div class="textarea__icon__container">
|
|
109
|
+
${this.disabled ? e`<nve-icon name="lock"></nve-icon>` : null}
|
|
110
|
+
${this.showErrorMessage ? e`<nve-icon class="textarea__icon--error" name="error"></nve-icon>` : null}
|
|
111
|
+
</div>` : t}
|
|
114
112
|
</div>
|
|
115
|
-
<div part="
|
|
116
|
-
<!-- Ikke vis
|
|
117
|
-
${!this.showErrorMessage && this.
|
|
118
|
-
|
|
119
|
-
>` : p}
|
|
120
|
-
${this.showErrorMessage ? o`<span class="textarea__help-text textarea__help-text--error">${this.errorMessage}</span>` : p}
|
|
113
|
+
<div part="hint-text-container" class="textarea__hint-text__container">
|
|
114
|
+
<!-- Ikke vis hint dersom feil -->
|
|
115
|
+
${!this.showErrorMessage && this.hint ? e`<span class="textarea__hint" aria-hidden=${this.hint ? "false" : "true"}>${this.hint}</span>` : t}
|
|
116
|
+
${this.showErrorMessage ? e`<span class="textarea__help-text textarea__help-text--error">${this.errorMessage}</span>` : t}
|
|
121
117
|
</div>
|
|
122
118
|
</div>
|
|
123
119
|
`;
|
|
124
|
-
|
|
125
|
-
};
|
|
126
|
-
e.styles = [f];
|
|
127
|
-
t([
|
|
128
|
-
s()
|
|
129
|
-
], e.prototype, "name", 2);
|
|
130
|
-
t([
|
|
131
|
-
s()
|
|
132
|
-
], e.prototype, "value", 2);
|
|
133
|
-
t([
|
|
134
|
-
s()
|
|
135
|
-
], e.prototype, "errorMessage", 2);
|
|
136
|
-
t([
|
|
137
|
-
s()
|
|
138
|
-
], e.prototype, "title", 2);
|
|
139
|
-
t([
|
|
140
|
-
s({ type: Boolean, reflect: !0 })
|
|
141
|
-
], e.prototype, "filled", 2);
|
|
142
|
-
t([
|
|
143
|
-
s()
|
|
144
|
-
], e.prototype, "label", 2);
|
|
145
|
-
t([
|
|
146
|
-
s()
|
|
147
|
-
], e.prototype, "helpText", 2);
|
|
148
|
-
t([
|
|
149
|
-
s({ type: Boolean, reflect: !0 })
|
|
150
|
-
], e.prototype, "disabled", 2);
|
|
151
|
-
t([
|
|
152
|
-
s({ type: Boolean, reflect: !0 })
|
|
153
|
-
], e.prototype, "readonly", 2);
|
|
154
|
-
t([
|
|
155
|
-
s()
|
|
156
|
-
], e.prototype, "placeholder", 2);
|
|
157
|
-
t([
|
|
158
|
-
s({ type: Boolean, reflect: !0 })
|
|
159
|
-
], e.prototype, "required", 2);
|
|
160
|
-
t([
|
|
161
|
-
s()
|
|
162
|
-
], e.prototype, "requiredLabel", 2);
|
|
163
|
-
t([
|
|
164
|
-
s({ type: Number })
|
|
165
|
-
], e.prototype, "minlength", 2);
|
|
166
|
-
t([
|
|
167
|
-
s({ type: Number })
|
|
168
|
-
], e.prototype, "maxlength", 2);
|
|
169
|
-
t([
|
|
170
|
-
s()
|
|
171
|
-
], e.prototype, "autocapitalize", 2);
|
|
172
|
-
t([
|
|
173
|
-
s()
|
|
174
|
-
], e.prototype, "autocorrect", 2);
|
|
175
|
-
t([
|
|
176
|
-
s()
|
|
177
|
-
], e.prototype, "tooltip", 2);
|
|
178
|
-
t([
|
|
179
|
-
s({ reflect: !0, type: String })
|
|
180
|
-
], e.prototype, "testId", 2);
|
|
181
|
-
t([
|
|
182
|
-
s()
|
|
183
|
-
], e.prototype, "inputmode", 2);
|
|
184
|
-
t([
|
|
185
|
-
s()
|
|
186
|
-
], e.prototype, "rows", 2);
|
|
187
|
-
t([
|
|
188
|
-
u()
|
|
189
|
-
], e.prototype, "showErrorMessage", 2);
|
|
190
|
-
t([
|
|
191
|
-
u()
|
|
192
|
-
], e.prototype, "touched", 2);
|
|
193
|
-
t([
|
|
194
|
-
v(".textarea__control")
|
|
195
|
-
], e.prototype, "input", 2);
|
|
196
|
-
e = t([
|
|
197
|
-
b("nve-textarea")
|
|
198
|
-
], e);
|
|
199
|
-
export {
|
|
200
|
-
e as default
|
|
120
|
+
}
|
|
201
121
|
};
|
|
122
|
+
s([i()], f.prototype, "name", void 0), s([i()], f.prototype, "value", void 0), s([i()], f.prototype, "errorMessage", void 0), s([i()], f.prototype, "title", void 0), s([i({
|
|
123
|
+
type: Boolean,
|
|
124
|
+
reflect: !0
|
|
125
|
+
})], f.prototype, "filled", void 0), s([i()], f.prototype, "label", void 0), s([i()], f.prototype, "helpText", void 0), s([i()], f.prototype, "hint", void 0), s([i({
|
|
126
|
+
type: Boolean,
|
|
127
|
+
reflect: !0
|
|
128
|
+
})], f.prototype, "disabled", void 0), s([i({
|
|
129
|
+
type: Boolean,
|
|
130
|
+
reflect: !0
|
|
131
|
+
})], f.prototype, "readonly", void 0), s([i()], f.prototype, "placeholder", void 0), s([i({
|
|
132
|
+
type: Boolean,
|
|
133
|
+
reflect: !0
|
|
134
|
+
})], f.prototype, "required", void 0), s([i()], f.prototype, "requiredLabel", void 0), s([i({ type: Number })], f.prototype, "minlength", void 0), s([i({ type: Number })], f.prototype, "maxlength", void 0), s([i()], f.prototype, "autocapitalize", void 0), s([i()], f.prototype, "autocorrect", void 0), s([i()], f.prototype, "tooltip", void 0), s([i({
|
|
135
|
+
reflect: !0,
|
|
136
|
+
type: String
|
|
137
|
+
})], f.prototype, "testId", void 0), s([i()], f.prototype, "inputmode", void 0), s([i()], f.prototype, "rows", void 0), s([r()], f.prototype, "showErrorMessage", void 0), s([r()], f.prototype, "touched", void 0), s([a(".textarea__control")], f.prototype, "input", void 0), f = s([o("nve-textarea")], f);
|
|
138
|
+
var p = f;
|
|
139
|
+
//#endregion
|
|
140
|
+
export { p as default };
|