@oslokommune/punkt-elements 12.18.0 → 12.18.2

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.
Files changed (126) hide show
  1. package/dist/alert-BbVWu2lm.cjs +27 -0
  2. package/dist/alert-Dh6A96vo.js +159 -0
  3. package/dist/{index-D2jSRMrn.js → calendar-BUqcNvfI.js} +41 -29
  4. package/dist/calendar-QSulz7im.cjs +108 -0
  5. package/dist/card-B0GPdG5M.cjs +23 -0
  6. package/dist/card-kWt0BA2a.js +170 -0
  7. package/dist/{class-map-a5HUzP83.cjs → class-map-Boa7BqCc.cjs} +2 -2
  8. package/dist/{class-map-CBvUV2N3.js → class-map-hz16xq5a.js} +9 -10
  9. package/dist/datepicker-BhavwiBZ.js +659 -0
  10. package/dist/datepicker-vX74tb3R.cjs +154 -0
  11. package/dist/helptext--4FLdAWi.js +194 -0
  12. package/dist/helptext-iZEgxz2U.cjs +23 -0
  13. package/dist/icon-CdMQ6zBT.cjs +250 -0
  14. package/dist/{index-CFDwiDTU.js → icon-wUXeHiBk.js} +7371 -7559
  15. package/dist/if-defined-DEDlGbAc.cjs +5 -0
  16. package/dist/if-defined-ZFE4ti2t.js +10 -0
  17. package/dist/index.d.ts +49 -51
  18. package/dist/input-element-BQTCZtNQ.js +185 -0
  19. package/dist/input-element-DNklGY_O.cjs +1 -0
  20. package/dist/{input-wrapper-DVXNuxVu.js → input-wrapper-BTQk3W8T.js} +10 -11
  21. package/dist/input-wrapper-D-PNRJB_.cjs +46 -0
  22. package/dist/link-BpqavGSD.cjs +8 -0
  23. package/dist/link-Bx9nVgZi.js +108 -0
  24. package/dist/linkcard-CUrbzjLK.js +53 -0
  25. package/dist/linkcard-DSu3A4Yx.cjs +13 -0
  26. package/dist/messagebox-C1aWoQbu.cjs +12 -0
  27. package/dist/messagebox-LpiVQIoM.js +107 -0
  28. package/dist/modal-Avai5eVz.cjs +30 -0
  29. package/dist/{modal-lQfiTbGh.js → modal-Co1YFmHi.js} +7 -8
  30. package/dist/pkt-alert.cjs +1 -27
  31. package/dist/pkt-alert.js +4 -158
  32. package/dist/pkt-calendar.cjs +1 -1
  33. package/dist/pkt-calendar.js +4 -7
  34. package/dist/pkt-card.cjs +1 -23
  35. package/dist/pkt-card.js +4 -169
  36. package/dist/pkt-datepicker.cjs +1 -154
  37. package/dist/pkt-datepicker.js +4 -657
  38. package/dist/pkt-helptext.cjs +1 -1
  39. package/dist/pkt-helptext.js +1 -1
  40. package/dist/pkt-icon.cjs +1 -1
  41. package/dist/pkt-icon.js +4 -4
  42. package/dist/pkt-index.cjs +29 -1
  43. package/dist/pkt-index.js +127 -32
  44. package/dist/pkt-input-wrapper.cjs +1 -1
  45. package/dist/pkt-input-wrapper.js +1 -1
  46. package/dist/pkt-link.cjs +1 -8
  47. package/dist/pkt-link.js +4 -108
  48. package/dist/pkt-linkcard.cjs +1 -1
  49. package/dist/pkt-linkcard.js +1 -1
  50. package/dist/pkt-messagebox.cjs +1 -12
  51. package/dist/pkt-messagebox.js +4 -106
  52. package/dist/pkt-modal.cjs +1 -1
  53. package/dist/pkt-modal.js +1 -1
  54. package/dist/pkt-progressbar.cjs +1 -1
  55. package/dist/pkt-progressbar.js +2 -2
  56. package/dist/pkt-tag.cjs +1 -17
  57. package/dist/pkt-tag.js +4 -149
  58. package/dist/pkt-textarea.cjs +1 -1
  59. package/dist/pkt-textarea.js +1 -1
  60. package/dist/pkt-textinput.cjs +1 -1
  61. package/dist/pkt-textinput.js +1 -1
  62. package/dist/{progressbar-1PEs_SMc.js → progressbar-BS_oawSB.js} +42 -47
  63. package/dist/{progressbar-BlzTFI9U.cjs → progressbar-CuXkbAhJ.cjs} +7 -11
  64. package/dist/ref-DCOsLZQg.cjs +13 -0
  65. package/dist/{ref-Dzme4zb6.js → ref-DuFGTLVX.js} +26 -27
  66. package/dist/state-BfyXV7EL.js +12 -0
  67. package/dist/state-SKYD8kRO.cjs +5 -0
  68. package/dist/stringutils-CkVRq4jP.cjs +1 -0
  69. package/dist/stringutils-DJjRa8dG.js +7 -0
  70. package/dist/tag-CGy2mSLE.cjs +17 -0
  71. package/dist/tag-DGFgUF3l.js +150 -0
  72. package/dist/textarea-BFWHQHLs.cjs +48 -0
  73. package/dist/{textarea-BXzQA_ub.js → textarea-BYtGXst8.js} +29 -29
  74. package/dist/{textinput-52G3CfwA.cjs → textinput-33wZwZ4O.cjs} +2 -2
  75. package/dist/{textinput-CTNWiIaP.js → textinput-IgHewJDJ.js} +23 -23
  76. package/package.json +2 -2
  77. package/src/components/alert/alert.ts +115 -0
  78. package/src/components/alert/index.ts +4 -113
  79. package/src/components/calendar/calendar.ts +711 -0
  80. package/src/components/calendar/index.ts +3 -711
  81. package/src/components/card/card.ts +78 -0
  82. package/src/components/card/index.ts +4 -77
  83. package/src/components/datepicker/datepicker.ts +619 -0
  84. package/src/components/datepicker/index.ts +3 -618
  85. package/src/components/helptext/helptext.ts +2 -2
  86. package/src/components/icon/icon.ts +99 -0
  87. package/src/components/icon/index.ts +3 -98
  88. package/src/components/index.ts +21 -17
  89. package/src/components/input-wrapper/input-wrapper.ts +2 -2
  90. package/src/components/link/index.ts +3 -56
  91. package/src/components/link/link.ts +57 -0
  92. package/src/components/linkcard/index.ts +1 -1
  93. package/src/components/linkcard/linkcard.ts +5 -6
  94. package/src/components/messagebox/index.ts +4 -69
  95. package/src/components/messagebox/messagebox.ts +69 -0
  96. package/src/components/modal/index.ts +0 -1
  97. package/src/components/modal/modal.ts +5 -7
  98. package/src/components/progressbar/progressbar.ts +2 -2
  99. package/src/components/tag/index.ts +4 -109
  100. package/src/components/tag/tag.ts +118 -0
  101. package/src/components/textarea/textarea.ts +5 -4
  102. package/src/components/textinput/textinput.ts +3 -3
  103. package/dist/component-template.d.ts +0 -8
  104. package/dist/converters-DNCwIFwr.js +0 -17
  105. package/dist/converters-DhM11VlY.cjs +0 -1
  106. package/dist/custom-element-B-TlBwRu.cjs +0 -9
  107. package/dist/custom-element-CWfU4dcr.js +0 -38
  108. package/dist/element.d.ts +0 -8
  109. package/dist/helptext-DBolvFI4.js +0 -72
  110. package/dist/helptext-_fMLOOCL.cjs +0 -23
  111. package/dist/index-CR7t1zY9.cjs +0 -238
  112. package/dist/index-CmTjXoAb.cjs +0 -9
  113. package/dist/index-RwtTBIhT.js +0 -88
  114. package/dist/index-tvpcg-ad.cjs +0 -108
  115. package/dist/input-wrapper-tJE-X4Ac.cjs +0 -46
  116. package/dist/linkcard-BHokvuVN.js +0 -55
  117. package/dist/linkcard-CUXMP6BH.cjs +0 -13
  118. package/dist/modal-CjsQgmmH.cjs +0 -30
  119. package/dist/pkt-component-template.cjs +0 -29
  120. package/dist/pkt-component-template.js +0 -100
  121. package/dist/pkt-element.cjs +0 -1
  122. package/dist/pkt-element.js +0 -5
  123. package/dist/ref-CA2-0S_W.cjs +0 -13
  124. package/dist/textarea-D_ud1Mpa.cjs +0 -48
  125. package/src/components/component-template/index.ts +0 -129
  126. package/src/components/element/index.ts +0 -353
package/dist/pkt-tag.js CHANGED
@@ -1,151 +1,6 @@
1
- import { e as h } from "./class-map-CBvUV2N3.js";
2
- import { t as d } from "./custom-element-CWfU4dcr.js";
3
- import { r as m, P as y, x as p, n as o } from "./index-CFDwiDTU.js";
4
- import { P as g } from "./pkt-slot-controller-RJvOnbF4.js";
5
- import { e as k, n as f } from "./ref-Dzme4zb6.js";
6
- import "./index-RwtTBIhT.js";
7
- const b = "pkt-tag", S = !0, $ = {
8
- closeTag: {
9
- type: "boolean",
10
- required: !1,
11
- default: !1
12
- },
13
- size: {
14
- required: !1,
15
- default: "medium",
16
- type: [
17
- "small",
18
- "medium",
19
- "large"
20
- ]
21
- },
22
- iconName: {
23
- type: "icon",
24
- required: !1
25
- },
26
- skin: {
27
- required: !1,
28
- default: "blue",
29
- type: [
30
- "blue",
31
- "green",
32
- "red",
33
- "beige",
34
- "yellow",
35
- "gray",
36
- "blue-light"
37
- ]
38
- },
39
- textStyle: {
40
- required: !1,
41
- default: "normal-text",
42
- type: [
43
- "thin-text",
44
- "normal-text"
45
- ]
46
- },
47
- type: {
48
- required: !1,
49
- default: "button",
50
- type: [
51
- "button",
52
- "submit",
53
- "reset"
54
- ]
55
- },
56
- ariaLabel: {
57
- type: "string",
58
- required: !1,
59
- default: "Lukk"
60
- }
61
- }, _ = {
62
- default: {
63
- description: "Teksten til tag"
64
- }
65
- }, r = {
66
- name: b,
67
- "css-class": "pkt-tag",
68
- isElement: S,
69
- props: $,
70
- slots: _
71
- };
72
- var x = Object.defineProperty, C = Object.getOwnPropertyDescriptor, e = (s, l, n, a) => {
73
- for (var i = a > 1 ? void 0 : a ? C(l, n) : l, c = s.length - 1, u; c >= 0; c--)
74
- (u = s[c]) && (i = (a ? u(l, n, i) : u(i)) || i);
75
- return a && i && x(l, n, i), i;
76
- };
77
- let t = class extends y {
78
- constructor() {
79
- super(), this.defaultSlot = k(), this.closeTag = r.props.closeTag.default, this.size = r.props.size.default, this.skin = r.props.skin.default, this.textStyle = r.props.textStyle.default, this.iconName = void 0, this.type = r.props.type.default, this.ariaLabel = r.props.ariaLabel.default, this._isClosed = !1, this.close = (s) => {
80
- this._isClosed = !0, this.dispatchEvent(
81
- new CustomEvent("close", { detail: { origin: s }, bubbles: !0, composed: !0 })
82
- ), this.dispatchEvent(
83
- new CustomEvent("on-close", { detail: { origin: s }, bubbles: !0, composed: !0 })
84
- );
85
- }, this.slotController = new g(this, this.defaultSlot), this._isClosed = !1;
86
- }
87
- render() {
88
- const s = {
89
- "pkt-tag": !0,
90
- [`pkt-tag--${this.size}`]: !!this.size,
91
- [`pkt-tag--${this.skin}`]: !!this.skin,
92
- [`pkt-tag--${this.textStyle}`]: !!this.textStyle
93
- }, l = {
94
- "pkt-tag": !0,
95
- "pkt-btn": !0,
96
- "pkt-btn--tertiary": !0,
97
- [`pkt-tag--${this.size}`]: !!this.size,
98
- [`pkt-tag--${this.skin}`]: !!this.skin,
99
- [`pkt-tag--${this.textStyle}`]: !!this.textStyle,
100
- "pkt-btn--icons-right-and-left": this.closeTag && !!this.iconName,
101
- "pkt-hide": this._isClosed
102
- };
103
- return this.closeTag ? p`
104
- <button
105
- class=${h(l)}
106
- type=${this.type}
107
- aria-label=${this.ariaLabel}
108
- @click=${this.close}
109
- >
110
- ${this.iconName && p`<pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon>`}
111
- <span ${f(this.defaultSlot)}></span>
112
- <pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
113
- </button>
114
- ` : p`
115
- <span class=${h(s)}>
116
- ${this.iconName && p` <pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon> `}
117
- <span ${f(this.defaultSlot)}></span>
118
- </span>
119
- `;
120
- }
121
- };
122
- e([
123
- o({ type: Boolean, reflect: !0 })
124
- ], t.prototype, "closeTag", 2);
125
- e([
126
- o({ type: String, reflect: !0 })
127
- ], t.prototype, "size", 2);
128
- e([
129
- o({ type: String, reflect: !0 })
130
- ], t.prototype, "skin", 2);
131
- e([
132
- o({ type: String, reflect: !0 })
133
- ], t.prototype, "textStyle", 2);
134
- e([
135
- o({ type: String, reflect: !0 })
136
- ], t.prototype, "iconName", 2);
137
- e([
138
- o({ type: String, reflect: !0 })
139
- ], t.prototype, "type", 2);
140
- e([
141
- o({ type: String, reflect: !0 })
142
- ], t.prototype, "ariaLabel", 2);
143
- e([
144
- m()
145
- ], t.prototype, "_isClosed", 2);
146
- t = e([
147
- d("pkt-tag")
148
- ], t);
1
+ import { P as a } from "./tag-DGFgUF3l.js";
2
+ const o = a;
149
3
  export {
150
- t as PktTag
4
+ a as PktTag,
5
+ o as default
151
6
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./textarea-D_ud1Mpa.cjs"),t=e.PktTextarea;Object.defineProperty(exports,"PktTextarea",{enumerable:!0,get:()=>e.PktTextarea});exports.default=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./textarea-BFWHQHLs.cjs"),t=e.PktTextarea;Object.defineProperty(exports,"PktTextarea",{enumerable:!0,get:()=>e.PktTextarea});exports.default=t;
@@ -1,4 +1,4 @@
1
- import { P as a } from "./textarea-BXzQA_ub.js";
1
+ import { P as a } from "./textarea-BYtGXst8.js";
2
2
  const e = a;
3
3
  export {
4
4
  a as PktTextarea,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./textinput-52G3CfwA.cjs"),t=e.PktTextinput;Object.defineProperty(exports,"PktTextinput",{enumerable:!0,get:()=>e.PktTextinput});exports.default=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./textinput-33wZwZ4O.cjs"),t=e.PktTextinput;Object.defineProperty(exports,"PktTextinput",{enumerable:!0,get:()=>e.PktTextinput});exports.default=t;
@@ -1,4 +1,4 @@
1
- import { P as t } from "./textinput-CTNWiIaP.js";
1
+ import { P as t } from "./textinput-IgHewJDJ.js";
2
2
  const p = t;
3
3
  export {
4
4
  t as PktTextinput,
@@ -1,62 +1,57 @@
1
- import { E as $, T as m, r as b, P as _, u as P, x as h, n as o } from "./index-CFDwiDTU.js";
2
- import { e as u } from "./class-map-CBvUV2N3.js";
3
- import { e as k, i as x, a as w, t as B } from "./custom-element-CWfU4dcr.js";
4
- import { e as d, n as C } from "./ref-Dzme4zb6.js";
5
- import "./index-RwtTBIhT.js";
1
+ import { o as h } from "./if-defined-ZFE4ti2t.js";
2
+ import { e as u } from "./class-map-hz16xq5a.js";
3
+ import { e as m, i as $, b as _, T as P, P as k, x as c, n as o, t as x } from "./icon-wUXeHiBk.js";
4
+ import { r as b } from "./state-BfyXV7EL.js";
5
+ import { e as d, n as w } from "./ref-DuFGTLVX.js";
6
+ import { u as B } from "./stringutils-DJjRa8dG.js";
6
7
  /**
7
8
  * @license
8
9
  * Copyright 2018 Google LLC
9
10
  * SPDX-License-Identifier: BSD-3-Clause
10
11
  */
11
- const c = (t) => t ?? $;
12
- /**
13
- * @license
14
- * Copyright 2018 Google LLC
15
- * SPDX-License-Identifier: BSD-3-Clause
16
- */
17
- const f = "important", T = " !" + f, M = k(class extends x {
18
- constructor(t) {
12
+ const f = "important", C = " !" + f, T = m(class extends $ {
13
+ constructor(e) {
19
14
  var s;
20
- if (super(t), t.type !== w.ATTRIBUTE || t.name !== "style" || ((s = t.strings) == null ? void 0 : s.length) > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
15
+ if (super(e), e.type !== _.ATTRIBUTE || e.name !== "style" || ((s = e.strings) == null ? void 0 : s.length) > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
21
16
  }
22
- render(t) {
23
- return Object.keys(t).reduce((s, r) => {
24
- const e = t[r];
25
- return e == null ? s : s + `${r = r.includes("-") ? r : r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${e};`;
17
+ render(e) {
18
+ return Object.keys(e).reduce((s, r) => {
19
+ const t = e[r];
20
+ return t == null ? s : s + `${r = r.includes("-") ? r : r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${t};`;
26
21
  }, "");
27
22
  }
28
- update(t, [s]) {
29
- const { style: r } = t.element;
23
+ update(e, [s]) {
24
+ const { style: r } = e.element;
30
25
  if (this.ft === void 0) return this.ft = new Set(Object.keys(s)), this.render(s);
31
- for (const e of this.ft) s[e] == null && (this.ft.delete(e), e.includes("-") ? r.removeProperty(e) : r[e] = null);
32
- for (const e in s) {
33
- const i = s[e];
26
+ for (const t of this.ft) s[t] == null && (this.ft.delete(t), t.includes("-") ? r.removeProperty(t) : r[t] = null);
27
+ for (const t in s) {
28
+ const i = s[t];
34
29
  if (i != null) {
35
- this.ft.add(e);
36
- const p = typeof i == "string" && i.endsWith(T);
37
- e.includes("-") || p ? r.setProperty(e, p ? i.slice(0, -11) : i, p ? f : "") : r[e] = i;
30
+ this.ft.add(t);
31
+ const p = typeof i == "string" && i.endsWith(C);
32
+ t.includes("-") || p ? r.setProperty(t, p ? i.slice(0, -11) : i, p ? f : "") : r[t] = i;
38
33
  }
39
34
  }
40
- return m;
35
+ return P;
41
36
  }
42
37
  });
43
- var S = Object.defineProperty, I = Object.getOwnPropertyDescriptor, l = (t, s, r, e) => {
44
- for (var i = e > 1 ? void 0 : e ? I(s, r) : s, p = t.length - 1, n; p >= 0; p--)
45
- (n = t[p]) && (i = (e ? n(s, r, i) : n(i)) || i);
46
- return e && i && S(s, r, i), i;
38
+ var M = Object.defineProperty, S = Object.getOwnPropertyDescriptor, l = (e, s, r, t) => {
39
+ for (var i = t > 1 ? void 0 : t ? S(s, r) : s, p = e.length - 1, n; p >= 0; p--)
40
+ (n = e[p]) && (i = (t ? n(s, r, i) : n(i)) || i);
41
+ return t && i && M(s, r, i), i;
47
42
  };
48
- let a = class extends _ {
43
+ let a = class extends k {
49
44
  constructor() {
50
45
  super(...arguments), this.valueCurrent = 0, this.valueMax = 100, this.valueMin = 0, this.skin = "dark-blue", this.title = "", this.titlePosition = "left", this.statusType = "none", this.statusPlacement = "following", this.ariaLabel = "", this.ariaLabelledby = "", this.ariaValueText = "", this.role = "progressbar", this.labelWidth = 0, this.progressBarId = this.id, this.labelRef = d(), this.progressBarRef = d();
51
46
  }
52
- firstUpdated(t) {
53
- super.firstUpdated(t), this.id ? this.progressBarId = this.id : this.progressBarId = P();
47
+ firstUpdated(e) {
48
+ super.firstUpdated(e), this.id ? this.progressBarId = this.id : this.progressBarId = B();
54
49
  }
55
- updated(t) {
56
- super.updated(t), t.has("valueCurrent") && this.labelRef.value && (this.labelWidth = this.labelRef.value.getBoundingClientRect().width || 0), t.has("id") && this.id && (this.progressBarId = this.id);
50
+ updated(e) {
51
+ super.updated(e), e.has("valueCurrent") && this.labelRef.value && (this.labelWidth = this.labelRef.value.getBoundingClientRect().width || 0), e.has("id") && this.id && (this.progressBarId = this.id);
57
52
  }
58
53
  render() {
59
- const t = this.valueMax - this.valueMin, s = this.valueCurrent / t * 100, r = this.valueMax !== 100 || this.valueMin !== 0 ? Math.round(s) : this.valueCurrent, e = `${this.valueCurrent} av ${this.valueMax}`, i = this.statusType !== "none", p = this.ariaLabelledby || this.progressBarId && `${this.progressBarId}-title`, n = u({
54
+ const e = this.valueMax - this.valueMin, s = this.valueCurrent / e * 100, r = this.valueMax !== 100 || this.valueMin !== 0 ? Math.round(s) : this.valueCurrent, t = `${this.valueCurrent} av ${this.valueMax}`, i = this.statusType !== "none", p = this.ariaLabelledby || this.progressBarId && `${this.progressBarId}-title`, n = u({
60
55
  "pkt-progressbar__bar": !0,
61
56
  [`pkt-progressbar__bar--${this.skin}`]: !!this.skin
62
57
  }), g = u({
@@ -70,16 +65,16 @@ let a = class extends _ {
70
65
  "pkt-progressbar__status-placement--center": this.statusPlacement === "center",
71
66
  "pkt-progressbar__status-placement--left": this.statusPlacement === "left"
72
67
  });
73
- return h` <div
68
+ return c` <div
74
69
  id=${this.progressBarId}
75
70
  class="pkt-progressbar__container"
76
71
  .ref=${this.progressBarRef}
77
- style=${M({
72
+ style=${T({
78
73
  "--pkt-progress-label-width": `${this.labelWidth}px`,
79
74
  "--pkt-progress-width": `${r}%`
80
75
  })}
81
76
  >
82
- ${this.title && h`<p id=${`${this.progressBarId}-title`} class=${g}>${this.title}</p>`}
77
+ ${this.title && c`<p id=${`${this.progressBarId}-title`} class=${g}>${this.title}</p>`}
83
78
 
84
79
  <div
85
80
  .id=${this.progressBarId}
@@ -88,16 +83,16 @@ let a = class extends _ {
88
83
  aria-valuemin=${this.valueMin}
89
84
  aria-valuemax=${this.valueMax}
90
85
  aria-valuenow=${this.valueCurrent}
91
- aria-labelledby=${c(p)}
92
- aria-label=${c(this.ariaLabel)}
93
- aria-valuetext=${c(this.ariaValueText)}
86
+ aria-labelledby=${h(p)}
87
+ aria-label=${h(this.ariaLabel)}
88
+ aria-valuetext=${h(this.ariaValueText)}
94
89
  >
95
90
  <div class=${n}></div>
96
91
  </div>
97
92
 
98
- ${i && h`<div class=${y}>
99
- <span class=${v} ${C(this.labelRef)}>
100
- ${this.statusType === "percentage" ? `${r}%` : e}
93
+ ${i && c`<div class=${y}>
94
+ <span class=${v} ${w(this.labelRef)}>
95
+ ${this.statusType === "percentage" ? `${r}%` : t}
101
96
  </span>
102
97
  </div>`}
103
98
  </div>`;
@@ -146,7 +141,7 @@ l([
146
141
  b()
147
142
  ], a.prototype, "progressBarId", 2);
148
143
  a = l([
149
- B("pkt-progressbar")
144
+ x("pkt-progressbar")
150
145
  ], a);
151
146
  const E = a;
152
147
  export {
@@ -1,16 +1,12 @@
1
- "use strict";const r=require("./index-CR7t1zY9.cjs"),p=require("./class-map-a5HUzP83.cjs"),u=require("./custom-element-B-TlBwRu.cjs"),h=require("./ref-CA2-0S_W.cjs");require("./index-CmTjXoAb.cjs");/**
1
+ "use strict";const u=require("./if-defined-DEDlGbAc.cjs"),p=require("./class-map-Boa7BqCc.cjs"),r=require("./icon-CdMQ6zBT.cjs"),c=require("./state-SKYD8kRO.cjs"),h=require("./ref-DCOsLZQg.cjs"),y=require("./stringutils-CkVRq4jP.cjs");/**
2
2
  * @license
3
3
  * Copyright 2018 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */const c=i=>i??r.E;/**
6
- * @license
7
- * Copyright 2018 Google LLC
8
- * SPDX-License-Identifier: BSD-3-Clause
9
- */const b="important",y=" !"+b,v=u.e(class extends u.i{constructor(i){var t;if(super(i),i.type!==u.t$1.ATTRIBUTE||i.name!=="style"||((t=i.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(i){return Object.keys(i).reduce((t,s)=>{const e=i[s];return e==null?t:t+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${e};`},"")}update(i,[t]){const{style:s}=i.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)t[e]==null&&(this.ft.delete(e),e.includes("-")?s.removeProperty(e):s[e]=null);for(const e in t){const a=t[e];if(a!=null){this.ft.add(e);const o=typeof a=="string"&&a.endsWith(y);e.includes("-")||o?s.setProperty(e,o?a.slice(0,-11):a,o?b:""):s[e]=a}}return r.T}});var k=Object.defineProperty,$=Object.getOwnPropertyDescriptor,l=(i,t,s,e)=>{for(var a=e>1?void 0:e?$(t,s):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(a=(e?n(t,s,a):n(a))||a);return e&&a&&k(t,s,a),a};exports.PktProgressbar=class extends r.PktElement{constructor(){super(...arguments),this.valueCurrent=0,this.valueMax=100,this.valueMin=0,this.skin="dark-blue",this.title="",this.titlePosition="left",this.statusType="none",this.statusPlacement="following",this.ariaLabel="",this.ariaLabelledby="",this.ariaValueText="",this.role="progressbar",this.labelWidth=0,this.progressBarId=this.id,this.labelRef=h.e(),this.progressBarRef=h.e()}firstUpdated(t){super.firstUpdated(t),this.id?this.progressBarId=this.id:this.progressBarId=r.uuidish()}updated(t){super.updated(t),t.has("valueCurrent")&&this.labelRef.value&&(this.labelWidth=this.labelRef.value.getBoundingClientRect().width||0),t.has("id")&&this.id&&(this.progressBarId=this.id)}render(){const t=this.valueMax-this.valueMin,s=this.valueCurrent/t*100,e=this.valueMax!==100||this.valueMin!==0?Math.round(s):this.valueCurrent,a=`${this.valueCurrent} av ${this.valueMax}`,o=this.statusType!=="none",n=this.ariaLabelledby||this.progressBarId&&`${this.progressBarId}-title`,g=p.e({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),d=p.e({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition==="center"}),P=p.e({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement==="center"}),f=p.e({"pkt-progressbar__status-placement--following":this.statusPlacement==="following","pkt-progressbar__status-placement--center":this.statusPlacement==="center","pkt-progressbar__status-placement--left":this.statusPlacement==="left"});return r.x` <div
5
+ */const b="important",v=" !"+b,k=r.e(class extends r.i{constructor(l){var t;if(super(l),l.type!==r.t$1.ATTRIBUTE||l.name!=="style"||((t=l.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(l){return Object.keys(l).reduce((t,s)=>{const e=l[s];return e==null?t:t+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${e};`},"")}update(l,[t]){const{style:s}=l.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)t[e]==null&&(this.ft.delete(e),e.includes("-")?s.removeProperty(e):s[e]=null);for(const e in t){const a=t[e];if(a!=null){this.ft.add(e);const o=typeof a=="string"&&a.endsWith(v);e.includes("-")||o?s.setProperty(e,o?a.slice(0,-11):a,o?b:""):s[e]=a}}return r.T}});var $=Object.defineProperty,_=Object.getOwnPropertyDescriptor,i=(l,t,s,e)=>{for(var a=e>1?void 0:e?_(t,s):t,o=l.length-1,n;o>=0;o--)(n=l[o])&&(a=(e?n(t,s,a):n(a))||a);return e&&a&&$(t,s,a),a};exports.PktProgressbar=class extends r.PktElement{constructor(){super(...arguments),this.valueCurrent=0,this.valueMax=100,this.valueMin=0,this.skin="dark-blue",this.title="",this.titlePosition="left",this.statusType="none",this.statusPlacement="following",this.ariaLabel="",this.ariaLabelledby="",this.ariaValueText="",this.role="progressbar",this.labelWidth=0,this.progressBarId=this.id,this.labelRef=h.e(),this.progressBarRef=h.e()}firstUpdated(t){super.firstUpdated(t),this.id?this.progressBarId=this.id:this.progressBarId=y.uuidish()}updated(t){super.updated(t),t.has("valueCurrent")&&this.labelRef.value&&(this.labelWidth=this.labelRef.value.getBoundingClientRect().width||0),t.has("id")&&this.id&&(this.progressBarId=this.id)}render(){const t=this.valueMax-this.valueMin,s=this.valueCurrent/t*100,e=this.valueMax!==100||this.valueMin!==0?Math.round(s):this.valueCurrent,a=`${this.valueCurrent} av ${this.valueMax}`,o=this.statusType!=="none",n=this.ariaLabelledby||this.progressBarId&&`${this.progressBarId}-title`,g=p.e({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),d=p.e({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition==="center"}),P=p.e({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement==="center"}),f=p.e({"pkt-progressbar__status-placement--following":this.statusPlacement==="following","pkt-progressbar__status-placement--center":this.statusPlacement==="center","pkt-progressbar__status-placement--left":this.statusPlacement==="left"});return r.x` <div
10
6
  id=${this.progressBarId}
11
7
  class="pkt-progressbar__container"
12
8
  .ref=${this.progressBarRef}
13
- style=${v({"--pkt-progress-label-width":`${this.labelWidth}px`,"--pkt-progress-width":`${e}%`})}
9
+ style=${k({"--pkt-progress-label-width":`${this.labelWidth}px`,"--pkt-progress-width":`${e}%`})}
14
10
  >
15
11
  ${this.title&&r.x`<p id=${`${this.progressBarId}-title`} class=${d}>${this.title}</p>`}
16
12
 
@@ -21,9 +17,9 @@
21
17
  aria-valuemin=${this.valueMin}
22
18
  aria-valuemax=${this.valueMax}
23
19
  aria-valuenow=${this.valueCurrent}
24
- aria-labelledby=${c(n)}
25
- aria-label=${c(this.ariaLabel)}
26
- aria-valuetext=${c(this.ariaValueText)}
20
+ aria-labelledby=${u.o(n)}
21
+ aria-label=${u.o(this.ariaLabel)}
22
+ aria-valuetext=${u.o(this.ariaValueText)}
27
23
  >
28
24
  <div class=${g}></div>
29
25
  </div>
@@ -33,4 +29,4 @@
33
29
  ${this.statusType==="percentage"?`${e}%`:a}
34
30
  </span>
35
31
  </div>`}
36
- </div>`}};l([r.n({type:Number,reflect:!0})],exports.PktProgressbar.prototype,"valueCurrent",2);l([r.n({type:Number,reflect:!0})],exports.PktProgressbar.prototype,"valueMax",2);l([r.n({type:Number,reflect:!0})],exports.PktProgressbar.prototype,"valueMin",2);l([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"skin",2);l([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"title",2);l([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"titlePosition",2);l([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"statusType",2);l([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"statusPlacement",2);l([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"ariaLabel",2);l([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"ariaLabelledby",2);l([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"ariaValueText",2);l([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"role",2);l([r.r()],exports.PktProgressbar.prototype,"labelWidth",2);l([r.r()],exports.PktProgressbar.prototype,"progressBarId",2);exports.PktProgressbar=l([u.t("pkt-progressbar")],exports.PktProgressbar);const m=exports.PktProgressbar;exports.PktProgressbar$1=m;
32
+ </div>`}};i([r.n({type:Number,reflect:!0})],exports.PktProgressbar.prototype,"valueCurrent",2);i([r.n({type:Number,reflect:!0})],exports.PktProgressbar.prototype,"valueMax",2);i([r.n({type:Number,reflect:!0})],exports.PktProgressbar.prototype,"valueMin",2);i([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"skin",2);i([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"title",2);i([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"titlePosition",2);i([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"statusType",2);i([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"statusPlacement",2);i([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"ariaLabel",2);i([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"ariaLabelledby",2);i([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"ariaValueText",2);i([r.n({type:String,reflect:!0})],exports.PktProgressbar.prototype,"role",2);i([c.r()],exports.PktProgressbar.prototype,"labelWidth",2);i([c.r()],exports.PktProgressbar.prototype,"progressBarId",2);exports.PktProgressbar=i([r.t("pkt-progressbar")],exports.PktProgressbar);const m=exports.PktProgressbar;exports.PktProgressbar$1=m;
@@ -0,0 +1,13 @@
1
+ "use strict";const c=require("./icon-CdMQ6zBT.cjs");/**
2
+ * @license
3
+ * Copyright 2020 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */const{I:g}=c.Z,a=t=>t.strings===void 0,f=()=>document.createComment(""),p=(t,s,e)=>{var h;const i=t._$AA.parentNode,n=s===void 0?t._$AB:s._$AA;if(e===void 0){const $=i.insertBefore(f(),n),A=i.insertBefore(f(),n);e=new g($,A,t,t.options)}else{const $=e._$AB.nextSibling,A=e._$AM,d=A!==t;if(d){let o;(h=e._$AQ)==null||h.call(e,t),e._$AM=t,e._$AP!==void 0&&(o=t._$AU)!==A._$AU&&e._$AP(o)}if($!==n||d){let o=e._$AA;for(;o!==$;){const v=o.nextSibling;i.insertBefore(o,n),o=v}}}return e},Y=(t,s,e=t)=>(t._$AI(s,e),t),C={},M=(t,s=C)=>t._$AH=s,b=t=>t._$AH,m=t=>{var i;(i=t._$AP)==null||i.call(t,!1,!0);let s=t._$AA;const e=t._$AB.nextSibling;for(;s!==e;){const n=s.nextSibling;s.remove(),s=n}};/**
6
+ * @license
7
+ * Copyright 2017 Google LLC
8
+ * SPDX-License-Identifier: BSD-3-Clause
9
+ */const r=(t,s)=>{var i;const e=t._$AN;if(e===void 0)return!1;for(const n of e)(i=n._$AO)==null||i.call(n,s,!1),r(n,s);return!0},_=t=>{let s,e;do{if((s=t._$AM)===void 0)break;e=s._$AN,e.delete(t),t=s}while((e==null?void 0:e.size)===0)},u=t=>{for(let s;s=t._$AM;t=s){let e=s._$AN;if(e===void 0)s._$AN=e=new Set;else if(e.has(t))break;e.add(t),x(s)}};function N(t){this._$AN!==void 0?(_(this),this._$AM=t,u(this)):this._$AM=t}function w(t,s=!1,e=0){const i=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(s)if(Array.isArray(i))for(let h=e;h<i.length;h++)r(i[h],!1),_(i[h]);else i!=null&&(r(i,!1),_(i));else r(this,t)}const x=t=>{t.type==c.t$1.CHILD&&(t._$AP??(t._$AP=w),t._$AQ??(t._$AQ=N))};class B extends c.i{constructor(){super(...arguments),this._$AN=void 0}_$AT(s,e,i){super._$AT(s,e,i),u(this),this.isConnected=s._$AU}_$AO(s,e=!0){var i,n;s!==this.isConnected&&(this.isConnected=s,s?(i=this.reconnected)==null||i.call(this):(n=this.disconnected)==null||n.call(this)),e&&(r(this,s),_(this))}setValue(s){if(a(this._$Ct))this._$Ct._$AI(s,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=s,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}/**
10
+ * @license
11
+ * Copyright 2020 Google LLC
12
+ * SPDX-License-Identifier: BSD-3-Clause
13
+ */const y=()=>new H;class H{}const l=new WeakMap,I=c.e(class extends B{render(t){return c.E}update(t,[s]){var i;const e=s!==this.Y;return e&&this.Y!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.Y=s,this.ht=(i=t.options)==null?void 0:i.host,this.rt(this.ct=t.element)),c.E}rt(t){if(this.isConnected||(t=void 0),typeof this.Y=="function"){const s=this.ht??globalThis;let e=l.get(s);e===void 0&&(e=new WeakMap,l.set(s,e)),e.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),e.set(this.Y,t),t!==void 0&&this.Y.call(this.ht,t)}else this.Y.value=t}get lt(){var t,s;return typeof this.Y=="function"?(t=l.get(this.ht??globalThis))==null?void 0:t.get(this.Y):(s=this.Y)==null?void 0:s.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});exports.M=m;exports.e=y;exports.f=a;exports.m=M;exports.n=I;exports.p=b;exports.r=p;exports.v=Y;
@@ -1,32 +1,31 @@
1
- import { Z as u, E as d } from "./index-CFDwiDTU.js";
2
- import { i as p, a as g, e as Y } from "./custom-element-CWfU4dcr.js";
1
+ import { Z as u, i as g, b as p, e as Y, E as d } from "./icon-wUXeHiBk.js";
3
2
  /**
4
3
  * @license
5
4
  * Copyright 2020 Google LLC
6
5
  * SPDX-License-Identifier: BSD-3-Clause
7
6
  */
8
- const { I: m } = u, C = (t) => t.strings === void 0, f = () => document.createComment(""), I = (t, s, e) => {
9
- var o;
7
+ const { I: C } = u, b = (t) => t.strings === void 0, f = () => document.createComment(""), H = (t, s, e) => {
8
+ var h;
10
9
  const i = t._$AA.parentNode, n = s === void 0 ? t._$AB : s._$AA;
11
10
  if (e === void 0) {
12
11
  const c = i.insertBefore(f(), n), $ = i.insertBefore(f(), n);
13
- e = new m(c, $, t, t.options);
12
+ e = new C(c, $, t, t.options);
14
13
  } else {
15
14
  const c = e._$AB.nextSibling, $ = e._$AM, l = $ !== t;
16
15
  if (l) {
17
- let h;
18
- (o = e._$AQ) == null || o.call(e, t), e._$AM = t, e._$AP !== void 0 && (h = t._$AU) !== $._$AU && e._$AP(h);
16
+ let o;
17
+ (h = e._$AQ) == null || h.call(e, t), e._$AM = t, e._$AP !== void 0 && (o = t._$AU) !== $._$AU && e._$AP(o);
19
18
  }
20
19
  if (c !== n || l) {
21
- let h = e._$AA;
22
- for (; h !== c; ) {
23
- const v = h.nextSibling;
24
- i.insertBefore(h, n), h = v;
20
+ let o = e._$AA;
21
+ for (; o !== c; ) {
22
+ const v = o.nextSibling;
23
+ i.insertBefore(o, n), o = v;
25
24
  }
26
25
  }
27
26
  }
28
27
  return e;
29
- }, S = (t, s, e = t) => (t._$AI(s, e), t), M = {}, k = (t, s = M) => t._$AH = s, P = (t) => t._$AH, T = (t) => {
28
+ }, I = (t, s, e = t) => (t._$AI(s, e), t), m = {}, S = (t, s = m) => t._$AH = s, k = (t) => t._$AH, P = (t) => {
30
29
  var i;
31
30
  (i = t._$AP) == null || i.call(t, !1, !0);
32
31
  let s = t._$AA;
@@ -61,19 +60,19 @@ const r = (t, s) => {
61
60
  e.add(t), x(s);
62
61
  }
63
62
  };
64
- function b(t) {
63
+ function M(t) {
65
64
  this._$AN !== void 0 ? (A(this), this._$AM = t, a(this)) : this._$AM = t;
66
65
  }
67
66
  function N(t, s = !1, e = 0) {
68
67
  const i = this._$AH, n = this._$AN;
69
- if (n !== void 0 && n.size !== 0) if (s) if (Array.isArray(i)) for (let o = e; o < i.length; o++) r(i[o], !1), A(i[o]);
68
+ if (n !== void 0 && n.size !== 0) if (s) if (Array.isArray(i)) for (let h = e; h < i.length; h++) r(i[h], !1), A(i[h]);
70
69
  else i != null && (r(i, !1), A(i));
71
70
  else r(this, t);
72
71
  }
73
72
  const x = (t) => {
74
- t.type == g.CHILD && (t._$AP ?? (t._$AP = N), t._$AQ ?? (t._$AQ = b));
73
+ t.type == p.CHILD && (t._$AP ?? (t._$AP = N), t._$AQ ?? (t._$AQ = M));
75
74
  };
76
- class w extends p {
75
+ class w extends g {
77
76
  constructor() {
78
77
  super(...arguments), this._$AN = void 0;
79
78
  }
@@ -85,7 +84,7 @@ class w extends p {
85
84
  s !== this.isConnected && (this.isConnected = s, s ? (i = this.reconnected) == null || i.call(this) : (n = this.disconnected) == null || n.call(this)), e && (r(this, s), A(this));
86
85
  }
87
86
  setValue(s) {
88
- if (C(this._$Ct)) this._$Ct._$AI(s, this);
87
+ if (b(this._$Ct)) this._$Ct._$AI(s, this);
89
88
  else {
90
89
  const e = [...this._$Ct._$AH];
91
90
  e[this._$Ci] = s, this._$Ct._$AI(e, this, 0);
@@ -101,10 +100,10 @@ class w extends p {
101
100
  * Copyright 2020 Google LLC
102
101
  * SPDX-License-Identifier: BSD-3-Clause
103
102
  */
104
- const U = () => new B();
103
+ const T = () => new B();
105
104
  class B {
106
105
  }
107
- const _ = /* @__PURE__ */ new WeakMap(), z = Y(class extends w {
106
+ const _ = /* @__PURE__ */ new WeakMap(), U = Y(class extends w {
108
107
  render(t) {
109
108
  return d;
110
109
  }
@@ -132,12 +131,12 @@ const _ = /* @__PURE__ */ new WeakMap(), z = Y(class extends w {
132
131
  }
133
132
  });
134
133
  export {
135
- T as M,
136
- U as e,
137
- C as f,
138
- k as m,
139
- z as n,
140
- P as p,
141
- I as r,
142
- S as v
134
+ P as M,
135
+ T as e,
136
+ b as f,
137
+ S as m,
138
+ U as n,
139
+ k as p,
140
+ H as r,
141
+ I as v
143
142
  };
@@ -0,0 +1,12 @@
1
+ import { n as r } from "./icon-wUXeHiBk.js";
2
+ /**
3
+ * @license
4
+ * Copyright 2017 Google LLC
5
+ * SPDX-License-Identifier: BSD-3-Clause
6
+ */
7
+ function n(t) {
8
+ return r({ ...t, state: !0, attribute: !1 });
9
+ }
10
+ export {
11
+ n as r
12
+ };
@@ -0,0 +1,5 @@
1
+ "use strict";const r=require("./icon-CdMQ6zBT.cjs");/**
2
+ * @license
3
+ * Copyright 2017 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */function e(t){return r.n({...t,state:!0,attribute:!1})}exports.r=e;
@@ -0,0 +1 @@
1
+ "use strict";const i=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),c=()=>{const s=i(),e=i();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+e.slice(1,4)+"-"+e.slice(4)};exports.uuidish=c;
@@ -0,0 +1,7 @@
1
+ const c = () => ("00000000000000000" + (Math.random() * 18446744073709552e3).toString(16)).slice(-16), t = () => {
2
+ const e = c(), s = c();
3
+ return e.slice(0, 8) + "-" + e.slice(8, 12) + "-4" + e.slice(13) + "-a" + s.slice(1, 4) + "-" + s.slice(4);
4
+ };
5
+ export {
6
+ t as u
7
+ };
@@ -0,0 +1,17 @@
1
+ "use strict";const u=require("./class-map-Boa7BqCc.cjs"),t=require("./icon-CdMQ6zBT.cjs"),h=require("./state-SKYD8kRO.cjs"),g=require("./pkt-slot-controller-Ckk_yV0j.cjs"),c=require("./ref-DCOsLZQg.cjs"),k="pkt-tag",d=!0,f={closeTag:{type:"boolean",required:!1,default:!1},size:{required:!1,default:"medium",type:["small","medium","large"]},iconName:{type:"icon",required:!1},skin:{required:!1,default:"blue",type:["blue","green","red","beige","yellow","gray","blue-light"]},textStyle:{required:!1,default:"normal-text",type:["thin-text","normal-text"]},type:{required:!1,default:"button",type:["button","submit","reset"]},ariaLabel:{type:"string",required:!1,default:"Lukk"}},y={default:{description:"Teksten til tag"}},a={name:k,"css-class":"pkt-tag",isElement:d,props:f,slots:y};var b=Object.defineProperty,m=Object.getOwnPropertyDescriptor,s=(o,e,l,r)=>{for(var i=r>1?void 0:r?m(e,l):e,n=o.length-1,p;n>=0;n--)(p=o[n])&&(i=(r?p(e,l,i):p(i))||i);return r&&i&&b(e,l,i),i};exports.PktTag=class extends t.PktElement{constructor(){super(),this.defaultSlot=c.e(),this.closeTag=a.props.closeTag.default,this.size=a.props.size.default,this.skin=a.props.skin.default,this.textStyle=a.props.textStyle.default,this.iconName=void 0,this.type=a.props.type.default,this.ariaLabel=a.props.ariaLabel.default,this._isClosed=!1,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:e},bubbles:!0,composed:!0}))},this.slotController=new g.PktSlotController(this,this.defaultSlot),this._isClosed=!1}render(){const e={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},l={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle,"pkt-btn--icons-right-and-left":this.closeTag&&!!this.iconName,"pkt-hide":this._isClosed};return this.closeTag?t.x`
2
+ <button
3
+ class=${u.e(l)}
4
+ type=${this.type}
5
+ aria-label=${this.ariaLabel}
6
+ @click=${this.close}
7
+ >
8
+ ${this.iconName&&t.x`<pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon>`}
9
+ <span ${c.n(this.defaultSlot)}></span>
10
+ <pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
11
+ </button>
12
+ `:t.x`
13
+ <span class=${u.e(e)}>
14
+ ${this.iconName&&t.x` <pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon> `}
15
+ <span ${c.n(this.defaultSlot)}></span>
16
+ </span>
17
+ `}};s([t.n({type:Boolean,reflect:!0})],exports.PktTag.prototype,"closeTag",2);s([t.n({type:String,reflect:!0})],exports.PktTag.prototype,"size",2);s([t.n({type:String,reflect:!0})],exports.PktTag.prototype,"skin",2);s([t.n({type:String,reflect:!0})],exports.PktTag.prototype,"textStyle",2);s([t.n({type:String,reflect:!0})],exports.PktTag.prototype,"iconName",2);s([t.n({type:String,reflect:!0})],exports.PktTag.prototype,"type",2);s([t.n({type:String,reflect:!0})],exports.PktTag.prototype,"ariaLabel",2);s([h.r()],exports.PktTag.prototype,"_isClosed",2);exports.PktTag=s([t.t("pkt-tag")],exports.PktTag);