nve-designsystem 2.14.2 → 2.15.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.
@@ -1,7 +1,8 @@
1
1
  import { LitElement } from 'lit';
2
2
  /**
3
3
  * Et ikon.
4
- * Vi bruker ikoner fra Material Symbols, men det er også mulig å bruke ikoner fra egen repo. Det anbefales sterkt å bruke Material-ikonene.
4
+ * Vi bruker ikoner fra Material Symbols, men det er også mulig å bruke ikoner fra eget repo.
5
+ * Vi anbefaler å bruke Material-ikonene.
5
6
  * Strektykkelsen skal være 400, uavhengig av ikonets størrelse, og kun stilene Sharp og Outlined skal brukes.
6
7
  * Fill-stilen bør unngås, da den fyller hele ikonet med farge i stedet for å bruke kun konturer
7
8
  * @see https://fonts.google.com/icons
@@ -14,7 +15,9 @@ export default class NveIcon extends LitElement {
14
15
  library: 'Outlined' | 'Sharp';
15
16
  /** Navnet på ikonet i Material Symbols-biblioteket */
16
17
  name: string;
18
+ /** Filnavn til ikonet om du velger å bruke et lokalt ikon */
17
19
  src: string;
20
+ /** En beskrivelse av ikonet */
18
21
  alt: string | undefined;
19
22
  /** Boolean som angir om ikonet har hatt tid til å laste. */
20
23
  private iconLoaded;
@@ -1,162 +1,167 @@
1
- import { a as U, x as N } from "../../chunks/lit-element.js";
2
- import { n as j, t as H } from "../../chunks/property.js";
3
- import { r as J } from "../../chunks/state.js";
4
- import K from "./nve-icon.styles.js";
5
- import { e as Q } from "../../chunks/class-map.js";
6
- import { o as V } from "../../chunks/if-defined.js";
7
- function X(s) {
8
- return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
1
+ import { a as H, x as W } from "../../chunks/lit-element.js";
2
+ import { n as $, t as J } from "../../chunks/property.js";
3
+ import { r as K } from "../../chunks/state.js";
4
+ import Q from "./nve-icon.styles.js";
5
+ import { e as V } from "../../chunks/class-map.js";
6
+ import { o as X } from "../../chunks/if-defined.js";
7
+ import { offlineIcons as q } from "./offline-icons.js";
8
+ import { o as Y } from "../../chunks/unsafe-html.js";
9
+ function Z(i) {
10
+ return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
9
11
  }
10
- var S = { exports: {} }, q;
11
- function Y() {
12
- return q || (q = 1, function(s) {
12
+ var N = { exports: {} }, B;
13
+ function ee() {
14
+ return B || (B = 1, function(i) {
13
15
  (function() {
14
- function r(e, n) {
16
+ function u(e, n) {
15
17
  document.addEventListener ? e.addEventListener("scroll", n, !1) : e.attachEvent("scroll", n);
16
18
  }
17
- function T(e) {
19
+ function l(e) {
18
20
  document.body ? e() : document.addEventListener ? document.addEventListener("DOMContentLoaded", function n() {
19
21
  document.removeEventListener("DOMContentLoaded", n), e();
20
22
  }) : document.attachEvent("onreadystatechange", function n() {
21
23
  (document.readyState == "interactive" || document.readyState == "complete") && (document.detachEvent("onreadystatechange", n), e());
22
24
  });
23
25
  }
24
- function u(e) {
26
+ function p(e) {
25
27
  this.g = document.createElement("div"), this.g.setAttribute("aria-hidden", "true"), this.g.appendChild(document.createTextNode(e)), this.h = document.createElement("span"), this.i = document.createElement("span"), this.m = document.createElement("span"), this.j = document.createElement("span"), this.l = -1, this.h.style.cssText = "max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;", this.i.style.cssText = "max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;", this.j.style.cssText = "max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;", this.m.style.cssText = "display:inline-block;width:200%;height:200%;font-size:16px;max-width:none;", this.h.appendChild(this.m), this.i.appendChild(this.j), this.g.appendChild(this.h), this.g.appendChild(this.i);
26
28
  }
27
- function i(e, n) {
29
+ function r(e, n) {
28
30
  e.g.style.cssText = "max-width:none;min-width:20px;min-height:20px;display:inline-block;overflow:hidden;position:absolute;width:auto;margin:0;padding:0;top:-999px;white-space:nowrap;font-synthesis:none;font:" + n + ";";
29
31
  }
30
- function E(e) {
32
+ function C(e) {
31
33
  var n = e.g.offsetWidth, t = n + 100;
32
34
  return e.j.style.width = t + "px", e.i.scrollLeft = t, e.h.scrollLeft = e.h.scrollWidth + 100, e.l !== n ? (e.l = n, !0) : !1;
33
35
  }
34
- function y(e, n) {
36
+ function g(e, n) {
35
37
  function t() {
36
- var a = p;
37
- E(a) && a.g.parentNode !== null && n(a.l);
38
+ var s = m;
39
+ C(s) && s.g.parentNode !== null && n(s.l);
38
40
  }
39
- var p = e;
40
- r(e.h, t), r(e.i, t), E(e);
41
+ var m = e;
42
+ u(e.h, t), u(e.i, t), C(e);
41
43
  }
42
- function $(e, n, t) {
44
+ function S(e, n, t) {
43
45
  n = n || {}, t = t || window, this.family = e, this.style = n.style || "normal", this.weight = n.weight || "normal", this.stretch = n.stretch || "normal", this.context = t;
44
46
  }
45
- var P = null, _ = null, A = null, I = null;
46
- function B(e) {
47
- return _ === null && (F(e) && /Apple/.test(window.navigator.vendor) ? (e = /AppleWebKit\/([0-9]+)(?:\.([0-9]+))(?:\.([0-9]+))/.exec(window.navigator.userAgent), _ = !!e && 603 > parseInt(e[1], 10)) : _ = !1), _;
47
+ var j = null, I = null, P = null, A = null;
48
+ function G(e) {
49
+ return I === null && (F(e) && /Apple/.test(window.navigator.vendor) ? (e = /AppleWebKit\/([0-9]+)(?:\.([0-9]+))(?:\.([0-9]+))/.exec(window.navigator.userAgent), I = !!e && 603 > parseInt(e[1], 10)) : I = !1), I;
48
50
  }
49
51
  function F(e) {
50
- return I === null && (I = !!e.document.fonts), I;
52
+ return A === null && (A = !!e.document.fonts), A;
51
53
  }
52
- function g(e, n) {
53
- var t = e.style, p = e.weight;
54
- if (A === null) {
55
- var a = document.createElement("div");
54
+ function w(e, n) {
55
+ var t = e.style, m = e.weight;
56
+ if (P === null) {
57
+ var s = document.createElement("div");
56
58
  try {
57
- a.style.font = "condensed 100px sans-serif";
59
+ s.style.font = "condensed 100px sans-serif";
58
60
  } catch {
59
61
  }
60
- A = a.style.font !== "";
62
+ P = s.style.font !== "";
61
63
  }
62
- return [t, p, A ? e.stretch : "", "100px", n].join(" ");
64
+ return [t, m, P ? e.stretch : "", "100px", n].join(" ");
63
65
  }
64
- $.prototype.load = function(e, n) {
65
- var t = this, p = e || "BESbswy", a = 0, w = n || 3e3, z = (/* @__PURE__ */ new Date()).getTime();
66
+ S.prototype.load = function(e, n) {
67
+ var t = this, m = e || "BESbswy", s = 0, b = n || 3e3, z = (/* @__PURE__ */ new Date()).getTime();
66
68
  return new Promise(function(M, k) {
67
- if (F(t.context) && !B(t.context)) {
68
- var G = new Promise(function(b, x) {
69
- function d() {
70
- (/* @__PURE__ */ new Date()).getTime() - z >= w ? x(Error("" + w + "ms timeout exceeded")) : t.context.document.fonts.load(g(t, '"' + t.family + '"'), p).then(function(m) {
71
- 1 <= m.length ? b() : setTimeout(d, 25);
72
- }, x);
69
+ if (F(t.context) && !G(t.context)) {
70
+ var R = new Promise(function(x, E) {
71
+ function c() {
72
+ (/* @__PURE__ */ new Date()).getTime() - z >= b ? E(Error("" + b + "ms timeout exceeded")) : t.context.document.fonts.load(w(t, '"' + t.family + '"'), m).then(function(v) {
73
+ 1 <= v.length ? x() : setTimeout(c, 25);
74
+ }, E);
73
75
  }
74
- d();
75
- }), R = new Promise(function(b, x) {
76
- a = setTimeout(function() {
77
- x(Error("" + w + "ms timeout exceeded"));
78
- }, w);
76
+ c();
77
+ }), U = new Promise(function(x, E) {
78
+ s = setTimeout(function() {
79
+ E(Error("" + b + "ms timeout exceeded"));
80
+ }, b);
79
81
  });
80
- Promise.race([R, G]).then(function() {
81
- clearTimeout(a), M(t);
82
+ Promise.race([U, R]).then(function() {
83
+ clearTimeout(s), M(t);
82
84
  }, k);
83
- } else T(function() {
84
- function b() {
85
+ } else l(function() {
86
+ function x() {
85
87
  var o;
86
- (o = c != -1 && h != -1 || c != -1 && f != -1 || h != -1 && f != -1) && ((o = c != h && c != f && h != f) || (P === null && (o = /AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent), P = !!o && (536 > parseInt(o[1], 10) || parseInt(o[1], 10) === 536 && 11 >= parseInt(o[2], 10))), o = P && (c == D && h == D && f == D || c == O && h == O && f == O || c == W && h == W && f == W)), o = !o), o && (l.parentNode !== null && l.parentNode.removeChild(l), clearTimeout(a), M(t));
88
+ (o = d != -1 && h != -1 || d != -1 && f != -1 || h != -1 && f != -1) && ((o = d != h && d != f && h != f) || (j === null && (o = /AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent), j = !!o && (536 > parseInt(o[1], 10) || parseInt(o[1], 10) === 536 && 11 >= parseInt(o[2], 10))), o = j && (d == _ && h == _ && f == _ || d == D && h == D && f == D || d == O && h == O && f == O)), o = !o), o && (a.parentNode !== null && a.parentNode.removeChild(a), clearTimeout(s), M(t));
87
89
  }
88
- function x() {
89
- if ((/* @__PURE__ */ new Date()).getTime() - z >= w) l.parentNode !== null && l.parentNode.removeChild(l), k(Error("" + w + "ms timeout exceeded"));
90
+ function E() {
91
+ if ((/* @__PURE__ */ new Date()).getTime() - z >= b) a.parentNode !== null && a.parentNode.removeChild(a), k(Error("" + b + "ms timeout exceeded"));
90
92
  else {
91
93
  var o = t.context.document.hidden;
92
- (o === !0 || o === void 0) && (c = d.g.offsetWidth, h = m.g.offsetWidth, f = C.g.offsetWidth, b()), a = setTimeout(x, 50);
94
+ (o === !0 || o === void 0) && (d = c.g.offsetWidth, h = v.g.offsetWidth, f = L.g.offsetWidth, x()), s = setTimeout(E, 50);
93
95
  }
94
96
  }
95
- var d = new u(p), m = new u(p), C = new u(p), c = -1, h = -1, f = -1, D = -1, O = -1, W = -1, l = document.createElement("div");
96
- l.dir = "ltr", i(d, g(t, "sans-serif")), i(m, g(t, "serif")), i(C, g(t, "monospace")), l.appendChild(d.g), l.appendChild(m.g), l.appendChild(C.g), t.context.document.body.appendChild(l), D = d.g.offsetWidth, O = m.g.offsetWidth, W = C.g.offsetWidth, x(), y(d, function(o) {
97
- c = o, b();
98
- }), i(d, g(t, '"' + t.family + '",sans-serif')), y(m, function(o) {
99
- h = o, b();
100
- }), i(m, g(t, '"' + t.family + '",serif')), y(C, function(o) {
101
- f = o, b();
102
- }), i(C, g(t, '"' + t.family + '",monospace'));
97
+ var c = new p(m), v = new p(m), L = new p(m), d = -1, h = -1, f = -1, _ = -1, D = -1, O = -1, a = document.createElement("div");
98
+ a.dir = "ltr", r(c, w(t, "sans-serif")), r(v, w(t, "serif")), r(L, w(t, "monospace")), a.appendChild(c.g), a.appendChild(v.g), a.appendChild(L.g), t.context.document.body.appendChild(a), _ = c.g.offsetWidth, D = v.g.offsetWidth, O = L.g.offsetWidth, E(), g(c, function(o) {
99
+ d = o, x();
100
+ }), r(c, w(t, '"' + t.family + '",sans-serif')), g(v, function(o) {
101
+ h = o, x();
102
+ }), r(v, w(t, '"' + t.family + '",serif')), g(L, function(o) {
103
+ f = o, x();
104
+ }), r(L, w(t, '"' + t.family + '",monospace'));
103
105
  });
104
106
  });
105
- }, s.exports = $;
107
+ }, i.exports = S;
106
108
  })();
107
- }(S)), S.exports;
109
+ }(N)), N.exports;
108
110
  }
109
- var Z = Y();
110
- const ee = /* @__PURE__ */ X(Z);
111
- var te = Object.defineProperty, ne = Object.getOwnPropertyDescriptor, L = (s, r, T, u) => {
112
- for (var i = u > 1 ? void 0 : u ? ne(r, T) : r, E = s.length - 1, y; E >= 0; E--)
113
- (y = s[E]) && (i = (u ? y(r, T, i) : y(i)) || i);
114
- return u && i && te(r, T, i), i;
111
+ var te = ee();
112
+ const ne = /* @__PURE__ */ Z(te);
113
+ var oe = Object.defineProperty, ie = Object.getOwnPropertyDescriptor, T = (i, u, l, p) => {
114
+ for (var r = p > 1 ? void 0 : p ? ie(u, l) : u, C = i.length - 1, g; C >= 0; C--)
115
+ (g = i[C]) && (r = (p ? g(u, l, r) : g(r)) || r);
116
+ return p && r && oe(u, l, r), r;
115
117
  };
116
- let v = class extends U {
118
+ let y = class extends H {
117
119
  constructor() {
118
120
  super(...arguments), this.library = "Sharp", this.name = "", this.src = "", this.alt = void 0, this.iconLoaded = !1;
119
121
  }
120
122
  firstUpdated() {
121
- if (this.src) return;
123
+ if (this.src || q[this.name]) return;
122
124
  if (!document.getElementById(`material-icons-${this.library.toLowerCase()}`)) {
123
- const r = document.createElement("link");
124
- r.id = `material-icons-${this.library.toLowerCase()}`, r.rel = "stylesheet", r.href = `https://fonts.googleapis.com/css2?family=Material+Symbols+${this.library}:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200`, document.head.appendChild(r);
125
+ const l = document.createElement("link");
126
+ l.id = `material-icons-${this.library.toLowerCase()}`, l.rel = "stylesheet", l.href = `https://fonts.googleapis.com/css2?family=Material+Symbols+${this.library}:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200`, document.head.appendChild(l);
125
127
  }
126
- new ee(`Material Symbols ${this.library}`).load().then(() => {
128
+ new ne(`Material Symbols ${this.library}`).load().then(() => {
127
129
  this.iconLoaded = !0, this.requestUpdate();
128
130
  }).catch();
129
131
  }
130
132
  render() {
131
- return this.src ? N`<img src=${this.src} alt=${V(this.alt)} />` : !this.src && this.iconLoaded ? N`<span
133
+ if (this.src)
134
+ return W`<img src=${this.src} alt=${X(this.alt)} />`;
135
+ const i = q[this.name];
136
+ return i ? W`${Y(i)}` : !this.src && this.iconLoaded ? W`<span
132
137
  part="icon"
133
- class=${Q({
138
+ class=${V({
134
139
  "material-outlined": this.library === "Outlined",
135
140
  "material-sharp": this.library === "Sharp"
136
141
  })}
137
142
  >${this.name}</span
138
- >` : N`<nve-skeleton class="placeholder" effect="sheen"></nve-skeleton>`;
143
+ >` : W`<nve-skeleton class="placeholder" effect="sheen"></nve-skeleton>`;
139
144
  }
140
145
  };
141
- v.styles = [K];
142
- L([
143
- j()
144
- ], v.prototype, "library", 2);
145
- L([
146
- j({ type: String, reflect: !0 })
147
- ], v.prototype, "name", 2);
148
- L([
149
- j()
150
- ], v.prototype, "src", 2);
151
- L([
152
- j()
153
- ], v.prototype, "alt", 2);
154
- L([
155
- J()
156
- ], v.prototype, "iconLoaded", 2);
157
- v = L([
158
- H("nve-icon")
159
- ], v);
146
+ y.styles = [Q];
147
+ T([
148
+ $()
149
+ ], y.prototype, "library", 2);
150
+ T([
151
+ $({ type: String, reflect: !0 })
152
+ ], y.prototype, "name", 2);
153
+ T([
154
+ $()
155
+ ], y.prototype, "src", 2);
156
+ T([
157
+ $()
158
+ ], y.prototype, "alt", 2);
159
+ T([
160
+ K()
161
+ ], y.prototype, "iconLoaded", 2);
162
+ y = T([
163
+ J("nve-icon")
164
+ ], y);
160
165
  export {
161
- v as default
166
+ y as default
162
167
  };
@@ -1,5 +1,5 @@
1
1
  import { i as e } from "../../chunks/lit-element.js";
2
- const n = e`
2
+ const r = e`
3
3
  /* Brukes i dropdown. Eneste måten å override shadow dom for å rotere expand_more ikonet når menyen åpner */
4
4
  :host([name='expand_more']) {
5
5
  transform: var(--icon-rotation, none);
@@ -43,7 +43,11 @@ const n = e`
43
43
  .material-sharp {
44
44
  font-family: 'Material Symbols Sharp';
45
45
  }
46
+
47
+ svg {
48
+ fill: currentColor;
49
+ }
46
50
  `;
47
51
  export {
48
- n as default
52
+ r as default
49
53
  };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Disse ikonene er kopiert fra Material Symbols og brukes av NVE-komponenter internt
3
+ * NB! Det er kun sharp-variantene av ikonene som er lagret her
4
+ * Du bruker dem ved å sette name-attributtet på nve-icon til navnet på ikonet, f.eks. <nve-icon name="close"></nve-icon>
5
+ * Så vil <nve-icon> sjekke om ikonet finnes offline før den prøver å laste det fra Material Symbols
6
+ * For å legge til nye ikoner her, gå til https://fonts.google.com/icons?icon.style=Sharp,
7
+ * velg aktuelt ikon, velg 24px størrelse og svart farge og "copy icon to clipboard"
8
+ */
9
+ export declare const offlineIcons: {
10
+ [key: string]: string;
11
+ };
@@ -0,0 +1,14 @@
1
+ const h = {
2
+ check_circle: '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#000000"><path d="m424-296 282-282-56-56-226 226-114-114-56 56 170 170Zm56 216q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z"/></svg>',
3
+ chevron_backward: '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#000000"><path d="M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"/></svg>',
4
+ chevron_forward: '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#000000"><path d="M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"/></svg>',
5
+ close: '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#000000"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg>',
6
+ error: '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#000000"><path d="M480-280q17 0 28.5-11.5T520-320q0-17-11.5-28.5T480-360q-17 0-28.5 11.5T440-320q0 17 11.5 28.5T480-280Zm-40-160h80v-240h-80v240Zm40 360q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z"/></svg>',
7
+ info: '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#000000"><path d="M440-280h80v-240h-80v240Zm40-320q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm0 520q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z"/></svg>',
8
+ lock: '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#000000"><path d="M240-80q-33 0-56.5-23.5T160-160v-400q0-33 23.5-56.5T240-640h40v-80q0-83 58.5-141.5T480-920q83 0 141.5 58.5T680-720v80h40q33 0 56.5 23.5T800-560v400q0 33-23.5 56.5T720-80H240Zm0-80h480v-400H240v400Zm240-120q33 0 56.5-23.5T560-360q0-33-23.5-56.5T480-440q-33 0-56.5 23.5T400-360q0 33 23.5 56.5T480-280ZM360-640h240v-80q0-50-35-85t-85-35q-50 0-85 35t-35 85v80ZM240-160v-400 400Z"/></svg>',
9
+ open_in_new: '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#000000"><path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h280v80H200v560h560v-280h80v280q0 33-23.5 56.5T760-120H200Zm188-212-56-56 372-372H560v-80h280v280h-80v-144L388-332Z"/></svg>',
10
+ warning: '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#000000"><path d="m40-120 440-760 440 760H40Zm138-80h604L480-720 178-200Zm302-40q17 0 28.5-11.5T520-280q0-17-11.5-28.5T480-320q-17 0-28.5 11.5T440-280q0 17 11.5 28.5T480-240Zm-40-120h80v-200h-80v200Zm40-100Z"/></svg>'
11
+ };
12
+ export {
13
+ h as offlineIcons
14
+ };
@@ -51,7 +51,7 @@ let t = class extends h {
51
51
  aria-label="${this["close-aria-label"]}"
52
52
  @click=${this.closeButtonClick}
53
53
  >
54
- <nve-icon name="close" library="Sharp"></nve-icon>
54
+ <nve-icon name="close"></nve-icon>
55
55
  </button>` : u}
56
56
  </span>
57
57
  `;
package/css/global.css CHANGED
@@ -1,5 +1,41 @@
1
1
  @import '../nve-designsystem.css';
2
- @import url('https://fonts.cdnfonts.com/css/source-sans-pro');
2
+
3
+ /* Skrifttyper som brukes internt i komponentene har vi lastet ned på forhånd for offline-støtte.
4
+ Filene er lastet ned fra https://fontsource.org/fonts/source-sans-3
5
+ Source Sans 3 skal være kompatibel med Source Sans Pro
6
+ For at fontene skal funke i brukerveiledninga også, må alle font-filer kopieres manuelt til /doc-site/fonts */
7
+ @font-face {
8
+ font-family: 'Source Sans Pro';
9
+ src:
10
+ local('Source Sans Pro'),
11
+ url('/fonts/source-sans-3-latin-400-normal.woff2') format('woff2');
12
+ font-weight: 400;
13
+ font-style: normal;
14
+ }
15
+ @font-face {
16
+ font-family: 'Source Sans Pro';
17
+ src:
18
+ local('Source Sans Pro'),
19
+ url('/fonts/source-sans-3-latin-400-italic.woff2') format('woff2');
20
+ font-weight: 400;
21
+ font-style: italic;
22
+ }
23
+ @font-face {
24
+ font-family: 'Source Sans Pro';
25
+ src:
26
+ local('Source Sans Pro'),
27
+ url('/fonts/source-sans-3-latin-600-normal.woff2') format('woff2');
28
+ font-weight: 600;
29
+ font-style: normal;
30
+ }
31
+ @font-face {
32
+ font-family: 'Source Sans Pro';
33
+ src:
34
+ local('Source Sans Pro'),
35
+ url('/fonts/source-sans-3-latin-600-italic.woff2') format('woff2');
36
+ font-weight: 600;
37
+ font-style: italic;
38
+ }
3
39
 
4
40
  :root {
5
41
  --transition-time: 0.3s;
@@ -5802,7 +5802,7 @@
5802
5802
  "declarations": [
5803
5803
  {
5804
5804
  "kind": "class",
5805
- "description": "Et ikon.\nVi bruker ikoner fra Material Symbols, men det er også mulig å bruke ikoner fra egen repo. Det anbefales sterkt å bruke Material-ikonene.\nStrektykkelsen skal være 400, uavhengig av ikonets størrelse, og kun stilene Sharp og Outlined skal brukes.\nFill-stilen bør unngås, da den fyller hele ikonet med farge i stedet for å bruke kun konturer",
5805
+ "description": "Et ikon.\nVi bruker ikoner fra Material Symbols, men det er også mulig å bruke ikoner fra eget repo. \nVi anbefaler å bruke Material-ikonene.\nStrektykkelsen skal være 400, uavhengig av ikonets størrelse, og kun stilene Sharp og Outlined skal brukes.\nFill-stilen bør unngås, da den fyller hele ikonet med farge i stedet for å bruke kun konturer",
5806
5806
  "name": "NveIcon",
5807
5807
  "cssProperties": [
5808
5808
  {
@@ -5850,7 +5850,8 @@
5850
5850
  "type": {
5851
5851
  "text": "string"
5852
5852
  },
5853
- "default": "''"
5853
+ "default": "''",
5854
+ "description": "Filnavn til ikonet om du velger å bruke et lokalt ikon"
5854
5855
  },
5855
5856
  {
5856
5857
  "kind": "field",
@@ -5858,7 +5859,8 @@
5858
5859
  "type": {
5859
5860
  "text": "string | undefined"
5860
5861
  },
5861
- "default": "undefined"
5862
+ "default": "undefined",
5863
+ "description": "En beskrivelse av ikonet"
5862
5864
  },
5863
5865
  {
5864
5866
  "kind": "method",
@@ -5885,14 +5887,14 @@
5885
5887
  "type": {
5886
5888
  "text": "string"
5887
5889
  },
5888
- "description": ""
5890
+ "description": "Filnavn til ikonet om du velger å bruke et lokalt ikon"
5889
5891
  },
5890
5892
  {
5891
5893
  "name": "alt",
5892
5894
  "type": {
5893
5895
  "text": "string | undefined"
5894
5896
  },
5895
- "description": ""
5897
+ "description": "En beskrivelse av ikonet"
5896
5898
  }
5897
5899
  ],
5898
5900
  "superclass": {
@@ -5902,7 +5904,7 @@
5902
5904
  "tagNameWithoutPrefix": "icon",
5903
5905
  "tagName": "nve-icon",
5904
5906
  "customElement": true,
5905
- "jsDoc": "/**\n * Et ikon.\n * Vi bruker ikoner fra Material Symbols, men det er også mulig å bruke ikoner fra egen repo. Det anbefales sterkt å bruke Material-ikonene.\n * Strektykkelsen skal være 400, uavhengig av ikonets størrelse, og kun stilene Sharp og Outlined skal brukes.\n * Fill-stilen bør unngås, da den fyller hele ikonet med farge i stedet for å bruke kun konturer\n * @see https://fonts.google.com/icons\n * @csspart icon - Selve ikon span-element.\n * @cssproperty --icon-size - Størrelse på ikonet. 16px er standard.\n */"
5907
+ "jsDoc": "/**\n * Et ikon.\n * Vi bruker ikoner fra Material Symbols, men det er også mulig å bruke ikoner fra eget repo. \n * Vi anbefaler å bruke Material-ikonene.\n * Strektykkelsen skal være 400, uavhengig av ikonets størrelse, og kun stilene Sharp og Outlined skal brukes.\n * Fill-stilen bør unngås, da den fyller hele ikonet med farge i stedet for å bruke kun konturer\n * @see https://fonts.google.com/icons\n * @csspart icon - Selve ikon span-element.\n * @cssproperty --icon-size - Størrelse på ikonet. 16px er standard.\n */"
5906
5908
  }
5907
5909
  ],
5908
5910
  "exports": [
@@ -14712,7 +14714,7 @@
14712
14714
  "package": {
14713
14715
  "name": "nve-designsystem",
14714
14716
  "description": "Designsystem for NVE",
14715
- "version": "2.14.1",
14717
+ "version": "2.14.2",
14716
14718
  "author": {
14717
14719
  "name": "NVE",
14718
14720
  "email": "nve@nve.no"
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "license": "MIT",
9
9
  "homepage": "https://github.com/NVE/Designsystem/",
10
- "version": "2.14.2",
10
+ "version": "2.15.0",
11
11
  "customElements": "custom-elements.json",
12
12
  "exports": {
13
13
  ".": {
@@ -19,7 +19,8 @@
19
19
  "./dist/vscode.css-custom-data.json": "./vscode.css-custom-data.json",
20
20
  "./components/*": "./components/*",
21
21
  "./registerIcons/*": "./registerIcons/*",
22
- "./css/*": "./css/*"
22
+ "./css/*": "./css/*",
23
+ "./fonts/*": "./fonts/*"
23
24
  },
24
25
  "type": "module",
25
26
  "types": "nve-designsystem.d.ts",
@@ -797,7 +797,7 @@
797
797
  },
798
798
  {
799
799
  "name": "nve-icon",
800
- "description": "Et ikon.\nVi bruker ikoner fra Material Symbols, men det er også mulig å bruke ikoner fra egen repo. Det anbefales sterkt å bruke Material-ikonene.\nStrektykkelsen skal være 400, uavhengig av ikonets størrelse, og kun stilene Sharp og Outlined skal brukes.\nFill-stilen bør unngås, da den fyller hele ikonet med farge i stedet for å bruke kun konturer\n---\n\n\n### **CSS-variabler:**\n - **--icon-size** - Størrelse på ikonet. 16px er standard. _(default: undefined)_\n\n### **Deler:**\n - **icon** - Selve ikon span-element.",
800
+ "description": "Et ikon.\nVi bruker ikoner fra Material Symbols, men det er også mulig å bruke ikoner fra eget repo. \nVi anbefaler å bruke Material-ikonene.\nStrektykkelsen skal være 400, uavhengig av ikonets størrelse, og kun stilene Sharp og Outlined skal brukes.\nFill-stilen bør unngås, da den fyller hele ikonet med farge i stedet for å bruke kun konturer\n---\n\n\n### **CSS-variabler:**\n - **--icon-size** - Størrelse på ikonet. 16px er standard. _(default: undefined)_\n\n### **Deler:**\n - **icon** - Selve ikon span-element.",
801
801
  "attributes": [
802
802
  {
803
803
  "name": "library",
@@ -809,8 +809,16 @@
809
809
  "description": "Navnet på ikonet i Material Symbols-biblioteket",
810
810
  "values": []
811
811
  },
812
- { "name": "src", "description": "", "values": [] },
813
- { "name": "alt", "description": "", "values": [] }
812
+ {
813
+ "name": "src",
814
+ "description": "Filnavn til ikonet om du velger å bruke et lokalt ikon",
815
+ "values": []
816
+ },
817
+ {
818
+ "name": "alt",
819
+ "description": "En beskrivelse av ikonet",
820
+ "values": []
821
+ }
814
822
  ],
815
823
  "references": [
816
824
  {