@oslokommune/punkt-elements 16.7.1 → 16.7.3

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 (193) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/accordionitem-_9AiCIvd.cjs +34 -0
  3. package/dist/{accordionitem-ZlaXvjt5.js → accordionitem-dCfSrxh5.js} +57 -55
  4. package/dist/alert-BtOk8yRH.cjs +33 -0
  5. package/dist/{alert-BuAXrnKl.js → alert-DlY2_grU.js} +48 -46
  6. package/dist/backlink-Ce5Vldop.js +49 -0
  7. package/dist/backlink-y3dwjKPC.cjs +13 -0
  8. package/dist/button-B_TXwNzt.cjs +27 -0
  9. package/dist/{button-DEyvt1LI.js → button-BiY-wlKF.js} +79 -77
  10. package/dist/calendar-B2pji2zn.cjs +90 -0
  11. package/dist/{calendar-S63oreVW.js → calendar-DhjQDC4C.js} +689 -687
  12. package/dist/card-BwMNB5Bb.cjs +87 -0
  13. package/dist/{card-DDiLfuO4.js → card-CGlmcMSR.js} +99 -97
  14. package/dist/checkbox-BsJZYA26.js +147 -0
  15. package/dist/checkbox-CTY8f_qn.cjs +31 -0
  16. package/dist/{combobox-BmxSecfE.js → combobox-DSB5WOxg.js} +223 -226
  17. package/dist/{combobox-Hb2V-fPX.cjs → combobox-DbICIgKG.cjs} +4 -4
  18. package/dist/consent-DkOQpbsg.cjs +11 -0
  19. package/dist/{consent-iXyx5v6J.js → consent-SNWV_mMU.js} +48 -46
  20. package/dist/datepicker-BEWl9iz3.cjs +273 -0
  21. package/dist/{datepicker-CZl7b8Na.js → datepicker-euHyzXnb.js} +341 -329
  22. package/dist/{heading-CKt7cVn7.js → heading-D2tVS6lS.js} +30 -28
  23. package/dist/heading-DrzbgDb6.cjs +1 -0
  24. package/dist/helptext-BKtU4mas.js +82 -0
  25. package/dist/helptext-DcRC7wW2.cjs +24 -0
  26. package/dist/icon-CxQcIa5F.js +105 -0
  27. package/dist/icon-q81vqPK_.cjs +9 -0
  28. package/dist/input-wrapper-Bs4CRNst.js +181 -0
  29. package/dist/input-wrapper-Bv9aqqVq.cjs +54 -0
  30. package/dist/link-C0rl-86s.cjs +7 -0
  31. package/dist/link-Cdqgl60z.js +55 -0
  32. package/dist/linkcard-Dimu7Rlx.cjs +13 -0
  33. package/dist/linkcard-Lbq_UhjZ.js +56 -0
  34. package/dist/{listbox-BQKDZvZn.js → listbox-Bia4_tvN.js} +131 -129
  35. package/dist/listbox-La2GZQei.cjs +106 -0
  36. package/dist/loader-D1ugDXGV.cjs +16 -0
  37. package/dist/{loader-Ci3CHU8k.js → loader-DyN6RGC5.js} +51 -49
  38. package/dist/messagebox-BGMVm2t9.js +71 -0
  39. package/dist/messagebox-M0yIgCz9.cjs +13 -0
  40. package/dist/modal-CMO1RtIi.cjs +36 -0
  41. package/dist/{modal-DzGe1g8Z.js → modal-DjPQDE-Z.js} +53 -51
  42. package/dist/pkt-accordion.cjs +1 -1
  43. package/dist/pkt-accordion.js +2 -2
  44. package/dist/pkt-alert.cjs +1 -1
  45. package/dist/pkt-alert.js +3 -4
  46. package/dist/pkt-backlink.cjs +1 -1
  47. package/dist/pkt-backlink.js +2 -3
  48. package/dist/pkt-breadcrumbs.cjs +11 -11
  49. package/dist/pkt-breadcrumbs.js +30 -28
  50. package/dist/pkt-button.cjs +1 -1
  51. package/dist/pkt-button.js +3 -4
  52. package/dist/pkt-calendar.cjs +1 -1
  53. package/dist/pkt-calendar.js +2 -3
  54. package/dist/pkt-card.cjs +1 -1
  55. package/dist/pkt-card.js +2 -3
  56. package/dist/pkt-checkbox.cjs +1 -1
  57. package/dist/pkt-checkbox.js +3 -4
  58. package/dist/pkt-combobox.cjs +1 -1
  59. package/dist/pkt-combobox.js +3 -4
  60. package/dist/pkt-consent.cjs +1 -1
  61. package/dist/pkt-consent.js +2 -3
  62. package/dist/pkt-datepicker.cjs +1 -1
  63. package/dist/pkt-datepicker.js +7 -8
  64. package/dist/pkt-header.cjs +35 -35
  65. package/dist/pkt-header.js +224 -218
  66. package/dist/pkt-heading.cjs +1 -1
  67. package/dist/pkt-heading.js +3 -4
  68. package/dist/pkt-helptext.cjs +1 -1
  69. package/dist/pkt-helptext.js +3 -4
  70. package/dist/pkt-icon.cjs +1 -1
  71. package/dist/pkt-icon.js +3 -4
  72. package/dist/pkt-index.cjs +1 -1
  73. package/dist/pkt-index.js +26 -26
  74. package/dist/pkt-input-wrapper.cjs +1 -1
  75. package/dist/pkt-input-wrapper.js +2 -3
  76. package/dist/pkt-link.cjs +1 -1
  77. package/dist/pkt-link.js +2 -3
  78. package/dist/pkt-linkcard.cjs +1 -1
  79. package/dist/pkt-linkcard.js +3 -4
  80. package/dist/pkt-listbox.cjs +1 -1
  81. package/dist/pkt-listbox.js +3 -4
  82. package/dist/pkt-loader.cjs +1 -1
  83. package/dist/pkt-loader.js +3 -4
  84. package/dist/pkt-messagebox.cjs +1 -1
  85. package/dist/pkt-messagebox.js +3 -4
  86. package/dist/pkt-modal.cjs +1 -1
  87. package/dist/pkt-modal.js +3 -4
  88. package/dist/pkt-progressbar.cjs +1 -1
  89. package/dist/pkt-progressbar.js +2 -3
  90. package/dist/pkt-radiobutton.cjs +1 -1
  91. package/dist/pkt-radiobutton.js +3 -4
  92. package/dist/pkt-select.cjs +1 -1
  93. package/dist/pkt-select.js +3 -4
  94. package/dist/pkt-tabs.cjs +1 -1
  95. package/dist/pkt-tabs.js +2 -2
  96. package/dist/pkt-tag.cjs +1 -1
  97. package/dist/pkt-tag.js +3 -4
  98. package/dist/pkt-textarea.cjs +1 -1
  99. package/dist/pkt-textarea.js +3 -4
  100. package/dist/pkt-textinput.cjs +1 -1
  101. package/dist/pkt-textinput.js +3 -4
  102. package/dist/pkt-timepicker.cjs +16 -16
  103. package/dist/pkt-timepicker.js +91 -89
  104. package/dist/progressbar-BqlMzkM_.cjs +21 -0
  105. package/dist/{progressbar-By7e0lEI.js → progressbar-sbHDFC12.js} +88 -88
  106. package/dist/radiobutton-5ZqVVtTT.cjs +31 -0
  107. package/dist/{radiobutton-6frNG9J_.js → radiobutton-D8Ai8ETa.js} +44 -42
  108. package/dist/select-De-n8on9.js +230 -0
  109. package/dist/select-dTWibR6_.cjs +49 -0
  110. package/dist/tabitem-B9-jeV97.js +334 -0
  111. package/dist/tabitem-BnhzqfW3.cjs +65 -0
  112. package/dist/tag-CbwO8yvD.cjs +27 -0
  113. package/dist/{tag-BuCpqaks.js → tag-D4FI5t3y.js} +42 -40
  114. package/dist/textarea-BmLaKzsc.cjs +50 -0
  115. package/dist/{textarea-Bzuymclz.js → textarea-CMiSJaYL.js} +62 -60
  116. package/dist/textinput-em9y4yrL.cjs +70 -0
  117. package/dist/{textinput-9lHjs4ce.js → textinput-r8udK0IX.js} +57 -55
  118. package/package.json +2 -2
  119. package/src/components/accordion/accordion.ts +6 -1
  120. package/src/components/accordion/accordionitem.ts +6 -1
  121. package/src/components/alert/alert.ts +6 -1
  122. package/src/components/backlink/backlink.ts +6 -1
  123. package/src/components/breadcrumbs/breadcrumbs.ts +6 -1
  124. package/src/components/button/button.ts +6 -1
  125. package/src/components/calendar/calendar.ts +6 -1
  126. package/src/components/card/card.ts +6 -1
  127. package/src/components/checkbox/checkbox.ts +6 -1
  128. package/src/components/combobox/combobox.ts +6 -1
  129. package/src/components/consent/consent.ts +6 -1
  130. package/src/components/datepicker/date-tags.ts +6 -1
  131. package/src/components/datepicker/datepicker-multiple.ts +6 -1
  132. package/src/components/datepicker/datepicker-popup.ts +6 -1
  133. package/src/components/datepicker/datepicker-range.ts +6 -1
  134. package/src/components/datepicker/datepicker-single.ts +6 -1
  135. package/src/components/datepicker/datepicker.ts +6 -1
  136. package/src/components/header/header-service.ts +6 -1
  137. package/src/components/header/header-user-menu.ts +6 -1
  138. package/src/components/header/header.ts +6 -1
  139. package/src/components/heading/heading.ts +6 -1
  140. package/src/components/helptext/helptext.ts +6 -1
  141. package/src/components/icon/icon.ts +6 -1
  142. package/src/components/input-wrapper/input-wrapper.ts +6 -1
  143. package/src/components/link/link.ts +6 -1
  144. package/src/components/linkcard/linkcard.ts +6 -1
  145. package/src/components/listbox/listbox.ts +6 -1
  146. package/src/components/loader/loader.ts +6 -1
  147. package/src/components/messagebox/messagebox.ts +6 -1
  148. package/src/components/modal/modal.ts +6 -1
  149. package/src/components/progressbar/progressbar.ts +6 -1
  150. package/src/components/radiobutton/radiobutton.ts +6 -1
  151. package/src/components/select/select.ts +6 -1
  152. package/src/components/tabs/tabitem.ts +6 -1
  153. package/src/components/tabs/tabs.ts +6 -1
  154. package/src/components/tag/tag.ts +6 -1
  155. package/src/components/textarea/textarea.ts +6 -1
  156. package/src/components/textinput/textinput.ts +6 -1
  157. package/src/components/timepicker/timepicker.ts +6 -1
  158. package/dist/accordionitem-D1Agl1bB.cjs +0 -34
  159. package/dist/alert-DFkFNTxh.cjs +0 -33
  160. package/dist/backlink-EiAXUUZP.cjs +0 -13
  161. package/dist/backlink-V4DAt17e.js +0 -47
  162. package/dist/button-DYv5Dg4M.cjs +0 -27
  163. package/dist/calendar-HIE9nxcc.cjs +0 -90
  164. package/dist/card-CyeH6l1c.cjs +0 -87
  165. package/dist/checkbox-BLlwTABj.cjs +0 -31
  166. package/dist/checkbox-ejBUa5qQ.js +0 -145
  167. package/dist/consent-ruWAEVXW.cjs +0 -11
  168. package/dist/datepicker-D2H7U6MS.cjs +0 -273
  169. package/dist/heading-Cvz8m1xL.cjs +0 -1
  170. package/dist/helptext-5Mzp65-F.cjs +0 -24
  171. package/dist/helptext-jIoWRcCF.js +0 -80
  172. package/dist/icon-BlKA8YuW.js +0 -103
  173. package/dist/icon-Bqj9oBbl.cjs +0 -9
  174. package/dist/input-wrapper-B0MkQ0IZ.cjs +0 -54
  175. package/dist/input-wrapper-B2JpK016.js +0 -179
  176. package/dist/link-R_lNhViF.cjs +0 -7
  177. package/dist/link-Z_GizclR.js +0 -53
  178. package/dist/linkcard-BlQvdB1a.js +0 -54
  179. package/dist/linkcard-C7HbSLlX.cjs +0 -13
  180. package/dist/listbox-CGgV9MAe.cjs +0 -106
  181. package/dist/loader-e2gs_1xz.cjs +0 -16
  182. package/dist/messagebox-Bf-XMlvW.js +0 -69
  183. package/dist/messagebox-D67w71VX.cjs +0 -13
  184. package/dist/modal-CyvEkbfQ.cjs +0 -36
  185. package/dist/progressbar-DsJ2B9Vm.cjs +0 -21
  186. package/dist/radiobutton-Bv-BZ1Hw.cjs +0 -31
  187. package/dist/select-CXZt1nHS.js +0 -228
  188. package/dist/select-WFhS4Vfp.cjs +0 -49
  189. package/dist/tabitem-CB8wkKmv.js +0 -332
  190. package/dist/tabitem-DZpspU4Q.cjs +0 -65
  191. package/dist/tag-X6xdjR0N.cjs +0 -27
  192. package/dist/textarea-DoeHJ7HR.cjs +0 -50
  193. package/dist/textinput-BNsLd26i.cjs +0 -70
@@ -1,95 +1,95 @@
1
- import { e as n } from "./class-map-CEnykyO_.js";
2
- import { E as g, P as _, A as c, b, n as u, t as $ } from "./element-CPpT3rFQ.js";
1
+ import { e as p } from "./class-map-CEnykyO_.js";
2
+ import { E as _, t as $, P as A, A as c, b as d, n as u } from "./element-CPpT3rFQ.js";
3
3
  import { r as h } from "./state-C_1EOo3D.js";
4
- import { e as y, n as A } from "./ref-Bg_Swj5w.js";
5
- import { e as x, i as T, t as k } from "./directive-oAbCiebi.js";
6
- import { u as d } from "./utils-DznhwRXm.js";
7
- import "./icon-BlKA8YuW.js";
4
+ import { e as y, n as k } from "./ref-Bg_Swj5w.js";
5
+ import { e as x, i as T, t as C } from "./directive-oAbCiebi.js";
6
+ import { u as b } from "./utils-DznhwRXm.js";
7
+ import "./icon-CxQcIa5F.js";
8
8
  /**
9
9
  * @license
10
10
  * Copyright 2018 Google LLC
11
11
  * SPDX-License-Identifier: BSD-3-Clause
12
12
  */
13
- const v = "important", C = " !" + v, M = x(class extends T {
14
- constructor(t) {
15
- var e;
16
- if (super(t), t.type !== k.ATTRIBUTE || t.name !== "style" || ((e = t.strings) == null ? void 0 : e.length) > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
13
+ const f = "important", M = " !" + f, L = x(class extends T {
14
+ constructor(l) {
15
+ var t;
16
+ if (super(l), l.type !== C.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.");
17
17
  }
18
- render(t) {
19
- return Object.keys(t).reduce((e, a) => {
20
- const s = t[a];
21
- return s == null ? e : e + `${a = a.includes("-") ? a : a.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${s};`;
18
+ render(l) {
19
+ return Object.keys(l).reduce((t, e) => {
20
+ const i = l[e];
21
+ return i == null ? t : t + `${e = e.includes("-") ? e : e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${i};`;
22
22
  }, "");
23
23
  }
24
- update(t, [e]) {
25
- const { style: a } = t.element;
26
- if (this.ft === void 0) return this.ft = new Set(Object.keys(e)), this.render(e);
27
- for (const s of this.ft) e[s] == null && (this.ft.delete(s), s.includes("-") ? a.removeProperty(s) : a[s] = null);
28
- for (const s in e) {
29
- const l = e[s];
30
- if (l != null) {
31
- this.ft.add(s);
32
- const o = typeof l == "string" && l.endsWith(C);
33
- s.includes("-") || o ? a.setProperty(s, o ? l.slice(0, -11) : l, o ? v : "") : a[s] = l;
24
+ update(l, [t]) {
25
+ const { style: e } = l.element;
26
+ if (this.ft === void 0) return this.ft = new Set(Object.keys(t)), this.render(t);
27
+ for (const i of this.ft) t[i] == null && (this.ft.delete(i), i.includes("-") ? e.removeProperty(i) : e[i] = null);
28
+ for (const i in t) {
29
+ const a = t[i];
30
+ if (a != null) {
31
+ this.ft.add(i);
32
+ const o = typeof a == "string" && a.endsWith(M);
33
+ i.includes("-") || o ? e.setProperty(i, o ? a.slice(0, -11) : a, o ? f : "") : e[i] = a;
34
34
  }
35
35
  }
36
- return g;
36
+ return _;
37
37
  }
38
38
  });
39
- var L = Object.defineProperty, S = Object.getOwnPropertyDescriptor, i = (t, e, a, s) => {
40
- for (var l = s > 1 ? void 0 : s ? S(e, a) : e, o = t.length - 1, p; o >= 0; o--)
41
- (p = t[o]) && (l = (s ? p(e, a, l) : p(l)) || l);
42
- return s && l && L(e, a, l), l;
39
+ var S = Object.defineProperty, r = (l, t, e, i) => {
40
+ for (var a = void 0, o = l.length - 1, n; o >= 0; o--)
41
+ (n = l[o]) && (a = n(t, e, a) || a);
42
+ return a && S(t, e, a), a;
43
43
  };
44
- let r = class extends _ {
44
+ class s extends A {
45
45
  constructor() {
46
- super(), this.ariaLabel = null, this.ariaLabelledby = null, this.ariaValueText = null, this.ariaLive = "polite", this.id = d(), this.role = "progressbar", this.skin = "dark-blue", this.statusPlacement = "following", this.statusType = "none", this.title = "", this.titlePosition = "left", this.valueCurrent = 0, this.valueMax = 100, this.valueMin = 0, this.labelWidth = 0, this.progressbarId = this.id, this.computedAriaLabelledby = null, this.computedAriaValueText = "", this.labelRef = y(), this.progressBarRef = y();
46
+ super(), this.ariaLabel = null, this.ariaLabelledby = null, this.ariaValueText = null, this.ariaLive = "polite", this.id = b(), this.role = "progressbar", this.skin = "dark-blue", this.statusPlacement = "following", this.statusType = "none", this.title = "", this.titlePosition = "left", this.valueCurrent = 0, this.valueMax = 100, this.valueMin = 0, this.labelWidth = 0, this.progressbarId = this.id, this.computedAriaLabelledby = null, this.computedAriaValueText = "", this.labelRef = y(), this.progressBarRef = y();
47
47
  }
48
48
  firstUpdated(t) {
49
49
  super.firstUpdated(t), this.setComputedValues(), this.syncAttributes();
50
50
  }
51
51
  updated(t) {
52
- 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), (t.has("statusType") || t.has("id") || t.has("ariaLabelledby")) && (this.progressbarId = this.id || d(), this.computedAriaLabelledby = this.ariaLabelledby || `${this.progressbarId}-title`), (t.has("ariaValueText") || t.has("valueCurrent") || t.has("valueMax")) && (this.computedAriaValueText = this.statusType === "fraction" && !this.ariaValueText ? `${this.valueCurrent} av ${this.valueMax - this.valueMin}` : this.ariaValueText || ""), this.syncAttributes();
52
+ 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), (t.has("statusType") || t.has("id") || t.has("ariaLabelledby")) && (this.progressbarId = this.id || b(), this.computedAriaLabelledby = this.ariaLabelledby || `${this.progressbarId}-title`), (t.has("ariaValueText") || t.has("valueCurrent") || t.has("valueMax")) && (this.computedAriaValueText = this.statusType === "fraction" && !this.ariaValueText ? `${this.valueCurrent} av ${this.valueMax - this.valueMin}` : this.ariaValueText || ""), this.syncAttributes();
53
53
  }
54
54
  render() {
55
- const t = this.statusType !== "none", e = this.valueMax - this.valueMin, a = this.valueCurrent / e * 100, s = this.statusType === "fraction" ? Math.round(a) : Math.round((this.valueCurrent - this.valueMin) / (this.valueMax - this.valueMin) * 100), l = `${this.valueCurrent} av ${e}`, o = n({
55
+ const t = this.statusType !== "none", e = this.valueMax - this.valueMin, i = this.valueCurrent / e * 100, a = this.statusType === "fraction" ? Math.round(i) : Math.round((this.valueCurrent - this.valueMin) / (this.valueMax - this.valueMin) * 100), o = `${this.valueCurrent} av ${e}`, n = p({
56
56
  "pkt-progressbar__bar": !0,
57
57
  [`pkt-progressbar__bar--${this.skin}`]: !!this.skin
58
- }), p = n({
58
+ }), v = p({
59
59
  "pkt-progressbar__title": !0,
60
60
  "pkt-progressbar__title-center": this.titlePosition === "center"
61
- }), f = n({
61
+ }), m = p({
62
62
  "pkt-progressbar__status": !0,
63
63
  "pkt-progressbar__status--center": this.statusPlacement === "center"
64
- }), m = n({
64
+ }), g = p({
65
65
  "pkt-progressbar__status-placement--following": this.statusPlacement === "following",
66
66
  "pkt-progressbar__status-placement--center": this.statusPlacement === "center",
67
67
  "pkt-progressbar__status-placement--left": this.statusPlacement === "left"
68
68
  });
69
- return b` <div
69
+ return d` <div
70
70
  class="pkt-progressbar__container"
71
71
  .ref=${this.progressBarRef}
72
- style=${M({
72
+ style=${L({
73
73
  "--pkt-progress-label-width": `${this.labelWidth}px`,
74
- "--pkt-progress-width": `${s}%`
74
+ "--pkt-progress-width": `${a}%`
75
75
  })}
76
76
  >
77
- ${this.title ? b`<p id=${`${this.progressBarId}-title`} class=${p}>${this.title}</p>` : c}
77
+ ${this.title ? d`<p id=${`${this.progressBarId}-title`} class=${v}>${this.title}</p>` : c}
78
78
 
79
79
  <div class="pkt-progressbar__bar-wrapper">
80
- <div class=${o}></div>
80
+ <div class=${n}></div>
81
81
  </div>
82
82
 
83
- ${t ? b`<div class=${f}>
84
- <span class=${m} ${A(this.labelRef)}>
85
- ${this.statusType === "percentage" ? `${s}%` : l}
83
+ ${t ? d`<div class=${m}>
84
+ <span class=${g} ${k(this.labelRef)}>
85
+ ${this.statusType === "percentage" ? `${a}%` : o}
86
86
  </span>
87
87
  </div>` : c}
88
88
  </div>`;
89
89
  }
90
90
  // methods
91
91
  setComputedValues() {
92
- this.progressbarId = this.id || d(), this.computedAriaLabelledby = this.ariaLabelledby || `${this.progressbarId}-title`, this.computedAriaValueText = this.statusType === "fraction" && !this.ariaValueText ? `${this.valueCurrent} av ${this.valueMax - this.valueMin}` : this.ariaValueText || "";
92
+ this.progressbarId = this.id || b(), this.computedAriaLabelledby = this.ariaLabelledby || `${this.progressbarId}-title`, this.computedAriaValueText = this.statusType === "fraction" && !this.ariaValueText ? `${this.valueCurrent} av ${this.valueMax - this.valueMin}` : this.ariaValueText || "";
93
93
  }
94
94
  syncAttributes() {
95
95
  this._handleAttribute("aria-live", this.ariaLive), this._handleAttribute("aria-valuenow", this.valueCurrent), this._handleAttribute("aria-valuemin", this.valueMin), this._handleAttribute("aria-valuemax", this.valueMax), this._handleAttribute("aria-valuetext", this.computedAriaValueText), this._handleAttribute("aria-label", this.ariaLabel), this._handleAttribute("role", this.role), this._handleAttribute("aria-atomic", "true"), this._handleAttribute("id", this.progressbarId), this.ariaLabel || this._handleAttribute("aria-labelledby", this.computedAriaLabelledby);
@@ -97,66 +97,66 @@ let r = class extends _ {
97
97
  _handleAttribute(t, e) {
98
98
  e == null || e === "" ? this.removeAttribute(t) : this.setAttribute(t, String(e));
99
99
  }
100
- };
101
- i([
100
+ }
101
+ r([
102
102
  u({ type: String })
103
- ], r.prototype, "ariaLabel", 2);
104
- i([
103
+ ], s.prototype, "ariaLabel");
104
+ r([
105
105
  u({ type: String, reflect: !0 })
106
- ], r.prototype, "ariaLabelledby", 2);
107
- i([
106
+ ], s.prototype, "ariaLabelledby");
107
+ r([
108
108
  u({ type: String, reflect: !0 })
109
- ], r.prototype, "ariaValueText", 2);
110
- i([
109
+ ], s.prototype, "ariaValueText");
110
+ r([
111
111
  u({ type: String })
112
- ], r.prototype, "ariaLive", 2);
113
- i([
112
+ ], s.prototype, "ariaLive");
113
+ r([
114
114
  u({ type: String, reflect: !0 })
115
- ], r.prototype, "id", 2);
116
- i([
115
+ ], s.prototype, "id");
116
+ r([
117
117
  u({ type: String })
118
- ], r.prototype, "role", 2);
119
- i([
118
+ ], s.prototype, "role");
119
+ r([
120
120
  u({ type: String })
121
- ], r.prototype, "skin", 2);
122
- i([
121
+ ], s.prototype, "skin");
122
+ r([
123
123
  u({ type: String })
124
- ], r.prototype, "statusPlacement", 2);
125
- i([
124
+ ], s.prototype, "statusPlacement");
125
+ r([
126
126
  u({ type: String })
127
- ], r.prototype, "statusType", 2);
128
- i([
127
+ ], s.prototype, "statusType");
128
+ r([
129
129
  u({ type: String, reflect: !0 })
130
- ], r.prototype, "title", 2);
131
- i([
130
+ ], s.prototype, "title");
131
+ r([
132
132
  u({ type: String })
133
- ], r.prototype, "titlePosition", 2);
134
- i([
133
+ ], s.prototype, "titlePosition");
134
+ r([
135
135
  u({ type: Number, reflect: !0 })
136
- ], r.prototype, "valueCurrent", 2);
137
- i([
136
+ ], s.prototype, "valueCurrent");
137
+ r([
138
138
  u({ type: Number })
139
- ], r.prototype, "valueMax", 2);
140
- i([
139
+ ], s.prototype, "valueMax");
140
+ r([
141
141
  u({ type: Number })
142
- ], r.prototype, "valueMin", 2);
143
- i([
142
+ ], s.prototype, "valueMin");
143
+ r([
144
144
  h()
145
- ], r.prototype, "labelWidth", 2);
146
- i([
145
+ ], s.prototype, "labelWidth");
146
+ r([
147
147
  h()
148
- ], r.prototype, "progressbarId", 2);
149
- i([
148
+ ], s.prototype, "progressbarId");
149
+ r([
150
150
  h()
151
- ], r.prototype, "computedAriaLabelledby", 2);
152
- i([
151
+ ], s.prototype, "computedAriaLabelledby");
152
+ r([
153
153
  h()
154
- ], r.prototype, "computedAriaValueText", 2);
155
- r = i([
156
- $("pkt-progressbar")
157
- ], r);
158
- const W = r;
154
+ ], s.prototype, "computedAriaValueText");
155
+ try {
156
+ $("pkt-progressbar")(s);
157
+ } catch {
158
+ console.warn("Forsøker å definere <pkt-progressbar>, men den er allerede definert");
159
+ }
159
160
  export {
160
- r as P,
161
- W as a
161
+ s as P
162
162
  };
@@ -0,0 +1,31 @@
1
+ "use strict";const t=require("./element-gR_VtSiD.cjs"),u=require("./state-Dg-53wQ8.cjs"),d=require("./input-element-DdVhUvva.cjs"),o=require("./ref-CL-Xk9Xm.cjs"),h=require("./class-map-CsENJXf1.cjs");var k=Object.defineProperty,s=(c,i,a,p)=>{for(var n=void 0,l=c.length-1,r;l>=0;l--)(r=c[l])&&(n=r(i,a,n)||n);return n&&k(i,a,n),n};class e extends d.PktInputElement{constructor(){super(...arguments),this.inputRef=o.e(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.checked=null,this.type="radio",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut",this._checked=!1}connectedCallback(){super.connectedCallback()}attributeChangedCallback(i,a,p){i==="defaultChecked"&&(this._checked=this.defaultChecked),i==="checked"&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(i,a,p)}render(){const i=h.e({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),a=h.e({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),p=h.e({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-sr-only":this.hideLabel}),n="pkt-tag pkt-tag--small pkt-tag--thin-text",l=()=>t.b`
2
+ ${this.tagText?t.b`<span class=${n+" pkt-tag--gray"}>${this.tagText}</span>`:t.A}
3
+ ${this.optionalTag?t.b`<span class=${n+" pkt-tag--blue-light"}>${this.optionalText}</span>`:t.A}
4
+ ${this.requiredTag?t.b`<span class=${n+" pkt-tag--beige"}>${this.requiredText}</span>`:t.A}
5
+ `,r=()=>t.b`
6
+ <label class=${p} for=${this.id+"-internal"}>
7
+ ${this.label} ${l()}
8
+ ${this.checkHelptext?t.b`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:t.A}
9
+ </label>
10
+ `;return t.b`
11
+ <div class="pkt-input-check">
12
+ <div class=${i}>
13
+ <input
14
+ id=${this.id+"-internal"}
15
+ class=${a}
16
+ type="radio"
17
+ role="radio"
18
+ ?disabled=${this.disabled}
19
+ form=""
20
+ name=${this.name+"-internal"}
21
+ ${o.n(this.inputRef)}
22
+ @change=${this.toggleChecked}
23
+ @input=${this.onInput}
24
+ @blur=${this.onBlur}
25
+ @focus=${this.onFocus}
26
+ ?checked=${this.checked}
27
+ />
28
+ ${r()}
29
+ </div>
30
+ </div>
31
+ `}toggleChecked(i=null){i&&i.preventDefault(),i&&i.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this._checked=this.inputRef.value.matches(":checked"),this.valueChecked(this._checked))}}s([t.n({type:String,reflect:!0})],e.prototype,"value");s([t.n({type:String})],e.prototype,"checkHelptext");s([t.n({type:Boolean})],e.prototype,"defaultChecked");s([t.n({type:Boolean})],e.prototype,"hasTile");s([t.n({type:Boolean,reflect:!0})],e.prototype,"checked");s([t.n({type:String,reflect:!0})],e.prototype,"type");s([t.n({type:String})],e.prototype,"tagText");s([t.n({type:Boolean})],e.prototype,"optionalTag");s([t.n({type:String})],e.prototype,"optionalText");s([t.n({type:Boolean})],e.prototype,"requiredTag");s([t.n({type:String})],e.prototype,"requiredText");s([u.r()],e.prototype,"_checked");try{t.t("pkt-radiobutton")(e)}catch{console.warn("Forsøker å definere <pkt-radiobutton>, men den er allerede definert")}exports.PktRadioButton=e;
@@ -1,111 +1,113 @@
1
- import { b as h, A as n, n as s, t as d } from "./element-CPpT3rFQ.js";
1
+ import { t as d, b as l, A as o, n as s } from "./element-CPpT3rFQ.js";
2
2
  import { r as k } from "./state-C_1EOo3D.js";
3
3
  import { P as f } from "./input-element-8nLwuQS4.js";
4
- import { e as g, n as b } from "./ref-Bg_Swj5w.js";
4
+ import { e as g, n as y } from "./ref-Bg_Swj5w.js";
5
5
  import { e as u } from "./class-map-CEnykyO_.js";
6
- var y = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, i = (e, a, c, l) => {
7
- for (var p = l > 1 ? void 0 : l ? $(a, c) : a, r = e.length - 1, o; r >= 0; r--)
8
- (o = e[r]) && (p = (l ? o(a, c, p) : o(p)) || p);
9
- return l && p && y(a, c, p), p;
6
+ var b = Object.defineProperty, i = (n, t, p, c) => {
7
+ for (var a = void 0, r = n.length - 1, h; r >= 0; r--)
8
+ (h = n[r]) && (a = h(t, p, a) || a);
9
+ return a && b(t, p, a), a;
10
10
  };
11
- let t = class extends f {
11
+ class e extends f {
12
12
  constructor() {
13
13
  super(...arguments), this.inputRef = g(), this.value = "", this.checkHelptext = null, this.defaultChecked = !1, this.hasTile = !1, this.checked = null, this.type = "radio", this.tagText = null, this.optionalTag = !1, this.optionalText = "Valgfritt", this.requiredTag = !1, this.requiredText = "Må fylles ut", this._checked = !1;
14
14
  }
15
15
  connectedCallback() {
16
16
  super.connectedCallback();
17
17
  }
18
- attributeChangedCallback(e, a, c) {
19
- e === "defaultChecked" && (this._checked = this.defaultChecked), e === "checked" && (this._checked = this.checked === "" || this.checked === "true" || this.checked === !0), super.attributeChangedCallback(e, a, c);
18
+ attributeChangedCallback(t, p, c) {
19
+ t === "defaultChecked" && (this._checked = this.defaultChecked), t === "checked" && (this._checked = this.checked === "" || this.checked === "true" || this.checked === !0), super.attributeChangedCallback(t, p, c);
20
20
  }
21
21
  render() {
22
- const e = u({
22
+ const t = u({
23
23
  "pkt-input-check__input": !0,
24
24
  "pkt-input-check__input--tile": this.hasTile,
25
25
  "pkt-input-check__input--tile-disabled": this.disabled && this.hasTile
26
- }), a = u({
26
+ }), p = u({
27
27
  "pkt-input-check__input-checkbox": !0,
28
28
  "pkt-input-check__input-checkbox--error": this.hasError
29
29
  }), c = u({
30
30
  "pkt-input-check__input-label": !0,
31
31
  "pkt-input-check__input-label--disabled": this.disabled,
32
32
  "pkt-sr-only": this.hideLabel
33
- }), l = "pkt-tag pkt-tag--small pkt-tag--thin-text", p = () => h`
34
- ${this.tagText ? h`<span class=${l + " pkt-tag--gray"}>${this.tagText}</span>` : n}
35
- ${this.optionalTag ? h`<span class=${l + " pkt-tag--blue-light"}>${this.optionalText}</span>` : n}
36
- ${this.requiredTag ? h`<span class=${l + " pkt-tag--beige"}>${this.requiredText}</span>` : n}
37
- `, r = () => h`
33
+ }), a = "pkt-tag pkt-tag--small pkt-tag--thin-text", r = () => l`
34
+ ${this.tagText ? l`<span class=${a + " pkt-tag--gray"}>${this.tagText}</span>` : o}
35
+ ${this.optionalTag ? l`<span class=${a + " pkt-tag--blue-light"}>${this.optionalText}</span>` : o}
36
+ ${this.requiredTag ? l`<span class=${a + " pkt-tag--beige"}>${this.requiredText}</span>` : o}
37
+ `, h = () => l`
38
38
  <label class=${c} for=${this.id + "-internal"}>
39
- ${this.label} ${p()}
40
- ${this.checkHelptext ? h`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>` : n}
39
+ ${this.label} ${r()}
40
+ ${this.checkHelptext ? l`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>` : o}
41
41
  </label>
42
42
  `;
43
- return h`
43
+ return l`
44
44
  <div class="pkt-input-check">
45
- <div class=${e}>
45
+ <div class=${t}>
46
46
  <input
47
47
  id=${this.id + "-internal"}
48
- class=${a}
48
+ class=${p}
49
49
  type="radio"
50
50
  role="radio"
51
51
  ?disabled=${this.disabled}
52
52
  form=""
53
53
  name=${this.name + "-internal"}
54
- ${b(this.inputRef)}
54
+ ${y(this.inputRef)}
55
55
  @change=${this.toggleChecked}
56
56
  @input=${this.onInput}
57
57
  @blur=${this.onBlur}
58
58
  @focus=${this.onFocus}
59
59
  ?checked=${this.checked}
60
60
  />
61
- ${r()}
61
+ ${h()}
62
62
  </div>
63
63
  </div>
64
64
  `;
65
65
  }
66
- toggleChecked(e = null) {
67
- e && e.preventDefault(), e && e.stopImmediatePropagation(), this.touched = !0, this.inputRef.value && (this._checked = this.inputRef.value.matches(":checked"), this.valueChecked(this._checked));
66
+ toggleChecked(t = null) {
67
+ t && t.preventDefault(), t && t.stopImmediatePropagation(), this.touched = !0, this.inputRef.value && (this._checked = this.inputRef.value.matches(":checked"), this.valueChecked(this._checked));
68
68
  }
69
- };
69
+ }
70
70
  i([
71
71
  s({ type: String, reflect: !0 })
72
- ], t.prototype, "value", 2);
72
+ ], e.prototype, "value");
73
73
  i([
74
74
  s({ type: String })
75
- ], t.prototype, "checkHelptext", 2);
75
+ ], e.prototype, "checkHelptext");
76
76
  i([
77
77
  s({ type: Boolean })
78
- ], t.prototype, "defaultChecked", 2);
78
+ ], e.prototype, "defaultChecked");
79
79
  i([
80
80
  s({ type: Boolean })
81
- ], t.prototype, "hasTile", 2);
81
+ ], e.prototype, "hasTile");
82
82
  i([
83
83
  s({ type: Boolean, reflect: !0 })
84
- ], t.prototype, "checked", 2);
84
+ ], e.prototype, "checked");
85
85
  i([
86
86
  s({ type: String, reflect: !0 })
87
- ], t.prototype, "type", 2);
87
+ ], e.prototype, "type");
88
88
  i([
89
89
  s({ type: String })
90
- ], t.prototype, "tagText", 2);
90
+ ], e.prototype, "tagText");
91
91
  i([
92
92
  s({ type: Boolean })
93
- ], t.prototype, "optionalTag", 2);
93
+ ], e.prototype, "optionalTag");
94
94
  i([
95
95
  s({ type: String })
96
- ], t.prototype, "optionalText", 2);
96
+ ], e.prototype, "optionalText");
97
97
  i([
98
98
  s({ type: Boolean })
99
- ], t.prototype, "requiredTag", 2);
99
+ ], e.prototype, "requiredTag");
100
100
  i([
101
101
  s({ type: String })
102
- ], t.prototype, "requiredText", 2);
102
+ ], e.prototype, "requiredText");
103
103
  i([
104
104
  k()
105
- ], t.prototype, "_checked", 2);
106
- t = i([
107
- d("pkt-radiobutton")
108
- ], t);
105
+ ], e.prototype, "_checked");
106
+ try {
107
+ d("pkt-radiobutton")(e);
108
+ } catch {
109
+ console.warn("Forsøker å definere <pkt-radiobutton>, men den er allerede definert");
110
+ }
109
111
  export {
110
- t as P
112
+ e as P
111
113
  };