@oslokommune/punkt-elements 20.0.3 → 20.1.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.
Files changed (193) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{accordion-5N_ptxrN.cjs → accordion-CSSp30G1.cjs} +1 -1
  3. package/dist/{accordion-C5cu1xXT.js → accordion-DIjltHSH.js} +11 -14
  4. package/dist/{alert-DkyTTo7S.cjs → alert-0a5lX0pL.cjs} +12 -12
  5. package/dist/{alert-CA1fDbyc.js → alert-ZrB-P881.js} +36 -38
  6. package/dist/{async-directive-DCLIOGR8.cjs → async-directive-Bn7zgxUy.cjs} +1 -1
  7. package/dist/{async-directive-BcS8rfeC.js → async-directive-Ct3Mrb1M.js} +10 -11
  8. package/dist/{backlink-CXOxMeyt.cjs → backlink-BAvqdPlG.cjs} +1 -1
  9. package/dist/{backlink-CDBRcaAu.js → backlink-MBTAhQuD.js} +5 -7
  10. package/dist/{booleanish-OQJTYSrw.js → booleanish-CBa3Cr2h.js} +1 -2
  11. package/dist/{breadcrumbs-5oUaCef3.js → breadcrumbs-DtEt1-wn.js} +3 -4
  12. package/dist/{button-Bswo1C0M.js → button-CJzu0l5A.js} +45 -35
  13. package/dist/button-DHVRpzpS.cjs +32 -0
  14. package/dist/{calendar-BOd-9PDd.js → calendar-CkAAgviq.js} +66 -76
  15. package/dist/calendar-xYEsKilS.cjs +85 -0
  16. package/dist/{card-CKStAH0Q.js → card-CsEfBJcP.js} +10 -12
  17. package/dist/{card-BbV4OBqb.cjs → card-XznwedEG.cjs} +1 -1
  18. package/dist/{checkbox-iMOdzpJ_.cjs → checkbox-Cg7wnn8U.cjs} +1 -1
  19. package/dist/{checkbox-DIJbuqWm.js → checkbox-XvlUQmg5.js} +8 -10
  20. package/dist/{checkbox-group-Kua6HuRE.cjs → checkbox-group-BF29zyLd.cjs} +1 -1
  21. package/dist/{checkbox-group-DLLbWgQb.js → checkbox-group-CRIV5CX0.js} +8 -10
  22. package/dist/{class-map-BDwVSgLb.js → class-map-C9n5CNC8.js} +2 -3
  23. package/dist/{classutils-DcYnSgfc.js → classutils-C4jETHHk.js} +1 -2
  24. package/dist/{combobox-Pxa80TeZ.js → combobox-CDJcIkNJ.js} +63 -66
  25. package/dist/combobox-DuXavWEY.cjs +139 -0
  26. package/dist/{consent-UkinU27V.cjs → consent-BOSXNt4Y.cjs} +1 -1
  27. package/dist/{consent-p-0n2b9x.js → consent-DwppvYBR.js} +5 -7
  28. package/dist/{consume-Bp12si68.js → consume-C6aWEFx-.js} +4 -8
  29. package/dist/{converters-CW6SN0TT.cjs → converters-Dp64-kF1.cjs} +1 -1
  30. package/dist/{converters-CYgQrWVm.js → converters-v_GK06o3.js} +36 -72
  31. package/dist/{datepicker-Cpiu_Nrf.cjs → datepicker-Cnrbqm62.cjs} +53 -53
  32. package/dist/{datepicker-BpxUWiIC.js → datepicker-DHdFA8Dx.js} +82 -88
  33. package/dist/define-component-spec-wHP10r2x.js +5 -0
  34. package/dist/{dialog-polyfill.esm-D39dWbRt.js → dialog-polyfill.esm-BGBREnq_.js} +2 -3
  35. package/dist/dialog-polyfill.esm-BPk0-8XP.cjs +1 -0
  36. package/dist/{directive-helpers-BoDzpPID.js → directive-helpers-KMRvtO9j.js} +2 -3
  37. package/dist/{element-DLgZkx5L.js → element-Bwc-likm.js} +9 -18
  38. package/dist/{element-with-slot-mG-h7Sjw.js → element-with-slot-47quDZRt.js} +4 -6
  39. package/dist/{element-with-slot-CeKuRE3_.cjs → element-with-slot-D_8fAzCW.cjs} +1 -1
  40. package/dist/{fetch-header-footer-data-Pc32etrk.js → fetch-header-footer-data-CPVt_P8s.js} +3 -6
  41. package/dist/{fileupload-vPDmtXiM.js → fileupload-BQw5nlzQ.js} +25 -36
  42. package/dist/{fileupload-DXJtAagE.cjs → fileupload-Cjde62AR.cjs} +1 -1
  43. package/dist/{focus-modality-controller-Dc2S-KqR.js → focus-modality-controller-DVsT6GeR.js} +1 -2
  44. package/dist/focus-trap-C-PcFOw6.js +42 -0
  45. package/dist/focus-trap-C9tsr-xL.cjs +1 -0
  46. package/dist/{footer-CpE05IW2.cjs → footer-NQaQc2DH.cjs} +9 -9
  47. package/dist/{footer-D8t0PCPC.js → footer-SbOYv50e.js} +20 -24
  48. package/dist/{format-BTeSVkED.js → format-DwjTfa9h.js} +1 -2
  49. package/dist/{header-ChT1hHNA.js → header-CZnKVVt4.js} +22 -26
  50. package/dist/{header-CiwHNHKD.cjs → header-YbbGgmsD.cjs} +2 -2
  51. package/dist/{header-menu-Dq9lwNr1.cjs → header-menu-BJMMwrCR.cjs} +1 -1
  52. package/dist/{header-menu-BrjsNjBH.js → header-menu-k2ACrfOv.js} +9 -11
  53. package/dist/{heading-DAkjw2Am.cjs → heading-BNlor2MU.cjs} +1 -1
  54. package/dist/{heading-CMZmPEL9.js → heading-SYKHysr8.js} +19 -21
  55. package/dist/{helptext-Bse1LpRd.cjs → helptext-CQaNvbiv.cjs} +9 -9
  56. package/dist/{helptext-BFQzrOw4.js → helptext-kKmVQkwo.js} +20 -22
  57. package/dist/{icon-C1oCGwEe.js → icon-CZDw42U7.js} +5 -8
  58. package/dist/if-defined-B3pYog2C.js +4 -0
  59. package/dist/{input-element-2LHxo0em.cjs → input-element-CfZIyfon.cjs} +1 -1
  60. package/dist/{input-element-De40zUox.js → input-element-DE0FzjgP.js} +19 -25
  61. package/dist/{input-wrapper-C_Rzwxx7.cjs → input-wrapper-CbYMk21W.cjs} +1 -1
  62. package/dist/{input-wrapper-DkpJS1hR.js → input-wrapper-DYg1VHPv.js} +13 -15
  63. package/dist/{link-DLPpwjq4.js → link-Bc4zf-Dj.js} +19 -22
  64. package/dist/link-lPrxhYq0.cjs +7 -0
  65. package/dist/{linkcard-DIG6VYpl.cjs → linkcard-Bih7HS2t.cjs} +1 -1
  66. package/dist/{linkcard-Dr-r8jBO.js → linkcard-LCFAdVsG.js} +7 -9
  67. package/dist/{listbox-HrH4JonS.cjs → listbox-Du8llYth.cjs} +10 -10
  68. package/dist/{listbox-DAvIBH4P.js → listbox-df8gHweY.js} +17 -19
  69. package/dist/{loader-CFidlqSG.js → loader-C-2b3bGK.js} +9 -12
  70. package/dist/{loader-DTIrOtTo.cjs → loader-DiQSwWpb.cjs} +1 -1
  71. package/dist/{messagebox-BLYx3AL7.cjs → messagebox-BiG-fJX9.cjs} +1 -1
  72. package/dist/{messagebox-B_07P0QA.js → messagebox-CH3bKoJO.js} +9 -11
  73. package/dist/modal-B3rnE83a.cjs +37 -0
  74. package/dist/{modal-CA_M2Ix6.js → modal-SBJ8aGvM.js} +33 -35
  75. package/dist/{option-group-element-DzM8YznZ.js → option-group-element-DtSw52Dr.js} +7 -8
  76. package/dist/{option-group-element-CVNaBIlP.cjs → option-group-element-dN0ntPZk.cjs} +1 -1
  77. package/dist/pkt-accordion.cjs +1 -1
  78. package/dist/pkt-accordion.js +1 -1
  79. package/dist/pkt-alert.cjs +1 -1
  80. package/dist/pkt-alert.js +1 -1
  81. package/dist/pkt-backlink.cjs +1 -1
  82. package/dist/pkt-backlink.js +1 -1
  83. package/dist/pkt-breadcrumbs.js +1 -1
  84. package/dist/pkt-button.cjs +1 -1
  85. package/dist/pkt-button.js +1 -1
  86. package/dist/pkt-calendar.cjs +1 -1
  87. package/dist/pkt-calendar.js +1 -1
  88. package/dist/pkt-card.cjs +1 -1
  89. package/dist/pkt-card.js +1 -1
  90. package/dist/pkt-checkbox-group.cjs +1 -1
  91. package/dist/pkt-checkbox-group.js +1 -1
  92. package/dist/pkt-checkbox.cjs +1 -1
  93. package/dist/pkt-checkbox.js +1 -1
  94. package/dist/pkt-combobox.cjs +1 -1
  95. package/dist/pkt-combobox.js +1 -1
  96. package/dist/pkt-consent.cjs +1 -1
  97. package/dist/pkt-consent.js +1 -1
  98. package/dist/pkt-datepicker.cjs +1 -1
  99. package/dist/pkt-datepicker.js +2 -3
  100. package/dist/pkt-fileupload.cjs +1 -1
  101. package/dist/pkt-fileupload.js +1 -1
  102. package/dist/pkt-footer.cjs +1 -1
  103. package/dist/pkt-footer.js +1 -1
  104. package/dist/pkt-header-menu.cjs +1 -1
  105. package/dist/pkt-header-menu.js +1 -1
  106. package/dist/pkt-header.cjs +1 -1
  107. package/dist/pkt-header.js +1 -1
  108. package/dist/pkt-heading.cjs +1 -1
  109. package/dist/pkt-heading.js +1 -1
  110. package/dist/pkt-helptext.cjs +1 -1
  111. package/dist/pkt-helptext.js +1 -1
  112. package/dist/pkt-icon.js +1 -1
  113. package/dist/pkt-index.cjs +1 -1
  114. package/dist/pkt-index.js +37 -37
  115. package/dist/pkt-input-wrapper.cjs +1 -1
  116. package/dist/pkt-input-wrapper.js +1 -1
  117. package/dist/pkt-link.cjs +1 -1
  118. package/dist/pkt-link.js +1 -1
  119. package/dist/pkt-linkcard.cjs +1 -1
  120. package/dist/pkt-linkcard.js +1 -1
  121. package/dist/pkt-listbox.cjs +1 -1
  122. package/dist/pkt-listbox.js +1 -1
  123. package/dist/pkt-loader.cjs +1 -1
  124. package/dist/pkt-loader.js +1 -1
  125. package/dist/pkt-messagebox.cjs +1 -1
  126. package/dist/pkt-messagebox.js +1 -1
  127. package/dist/pkt-modal.cjs +1 -1
  128. package/dist/pkt-modal.js +1 -1
  129. package/dist/{pkt-options-controller-CzvBlEPD.js → pkt-options-controller-Dz7DP0wC.js} +2 -3
  130. package/dist/{pkt-options-controller-9zoH1OBW.cjs → pkt-options-controller-WsHVdPJA.cjs} +1 -1
  131. package/dist/pkt-progressbar.cjs +1 -1
  132. package/dist/pkt-progressbar.js +1 -1
  133. package/dist/pkt-radio-group.cjs +1 -1
  134. package/dist/pkt-radio-group.js +1 -1
  135. package/dist/pkt-radiobutton.cjs +1 -1
  136. package/dist/pkt-radiobutton.js +1 -1
  137. package/dist/pkt-searchinput.cjs +1 -1
  138. package/dist/pkt-searchinput.js +1 -1
  139. package/dist/pkt-select.cjs +1 -1
  140. package/dist/pkt-select.js +1 -1
  141. package/dist/pkt-tabs.cjs +1 -1
  142. package/dist/pkt-tabs.js +1 -1
  143. package/dist/pkt-tag.cjs +1 -1
  144. package/dist/pkt-tag.js +1 -1
  145. package/dist/pkt-textarea.cjs +1 -1
  146. package/dist/pkt-textarea.js +1 -1
  147. package/dist/pkt-textinput.cjs +1 -1
  148. package/dist/pkt-textinput.js +1 -1
  149. package/dist/pkt-timepicker.cjs +1 -1
  150. package/dist/pkt-timepicker.js +1 -1
  151. package/dist/{progressbar-CfCc2zhp.js → progressbar-DlbkKRgP.js} +9 -11
  152. package/dist/{progressbar-BdqIhC1Z.cjs → progressbar-Wyq_Q1Ur.cjs} +1 -1
  153. package/dist/{provide-_MnlMGnw.js → provide-DFu2tSv_.js} +3 -5
  154. package/dist/{radio-group-BRY_74od.js → radio-group-bRF8fnPW.js} +8 -10
  155. package/dist/{radio-group-CsUgnEv0.cjs → radio-group-u1IH7g-4.cjs} +1 -1
  156. package/dist/{radiobutton-CQhuG2lj.cjs → radiobutton-86ZvvDmJ.cjs} +1 -1
  157. package/dist/{radiobutton-lHnq8wX_.js → radiobutton-Bf6aFfYt.js} +8 -10
  158. package/dist/{ref-B6p6mQkO.cjs → ref-C6VUWwmF.cjs} +1 -1
  159. package/dist/{ref-BAegS9BR.js → ref-qE1RBrI7.js} +3 -4
  160. package/dist/{repeat-Cy1M16Di.js → repeat-c2P6osbb.js} +3 -4
  161. package/dist/{scroll-lock-CR-g54ai.js → scroll-lock-C9jzbJ4E.js} +1 -2
  162. package/dist/{searchinput-TAqMUJ0B.cjs → searchinput-D5l64Mkb.cjs} +7 -7
  163. package/dist/{searchinput-BLGaXkP6.js → searchinput-DN8kDZQ1.js} +18 -20
  164. package/dist/{select-Dle67Uwv.cjs → select-C7kAlSxs.cjs} +15 -15
  165. package/dist/{select-BvtUxW0Q.js → select-CXIEM2qY.js} +15 -18
  166. package/dist/shared-types/button.d.ts +13 -0
  167. package/dist/shared-types/index.d.ts +1 -1
  168. package/dist/shared-types-BvRk9kiK.js +0 -0
  169. package/dist/{tabs-BmmTUKuC.js → tabs-Cg16Sl3u.js} +57 -60
  170. package/dist/tabs-n7hQWwyI.cjs +40 -0
  171. package/dist/{tag-BZdC0voc.cjs → tag-BAikRN2Y.cjs} +1 -1
  172. package/dist/{tag-Cam7ISOF.js → tag-HXcXopyA.js} +9 -11
  173. package/dist/{textarea-Djp5L2Zd.js → textarea-12le8b4I.js} +12 -14
  174. package/dist/{textarea-DSX3jMlI.cjs → textarea-CRcSfWgX.cjs} +1 -1
  175. package/dist/{textinput-CBrOZcvL.js → textinput-CC0zxUBT.js} +11 -13
  176. package/dist/{textinput-CN2F3Q3H.cjs → textinput-Dooq2n8W.cjs} +1 -1
  177. package/dist/{timepicker-CkaJkIGn.cjs → timepicker-BM4I5w-i.cjs} +20 -20
  178. package/dist/{timepicker-CT4wfrgQ.js → timepicker-Cz81VQu3.js} +27 -28
  179. package/dist/{utils-BwF4QSrq.js → utils-Dn5ykFtS.js} +1 -2
  180. package/package.json +10 -10
  181. package/src/components/button/button.ts +14 -14
  182. package/dist/button-bVWAX98x.cjs +0 -32
  183. package/dist/calendar-CDTCgTJn.cjs +0 -85
  184. package/dist/combobox-CWL8T3UK.cjs +0 -139
  185. package/dist/define-component-spec-BYOSeplU.js +0 -6
  186. package/dist/dialog-polyfill.esm-CW51hN2p.cjs +0 -1
  187. package/dist/focus-trap-DG3pEuyJ.js +0 -60
  188. package/dist/focus-trap-DSv4Ifqm.cjs +0 -1
  189. package/dist/if-defined-DiYi2v_Q.js +0 -5
  190. package/dist/link-pkFJ11Zd.cjs +0 -7
  191. package/dist/modal-BvTfLfFq.cjs +0 -37
  192. package/dist/shared-types-A6iGIX-f.js +0 -1
  193. package/dist/tabs-B96Orh6O.cjs +0 -40
@@ -1,10 +1,10 @@
1
- import { l as e, n as t, u as n } from "./element-DLgZkx5L.js";
2
- import { t as r } from "./format-BTeSVkED.js";
3
- import { t as i } from "./element-with-slot-mG-h7Sjw.js";
4
- import { n as a, t as o } from "./booleanish-OQJTYSrw.js";
5
- import "./shared-types-A6iGIX-f.js";
6
- import { n as s } from "./utils-BwF4QSrq.js";
7
- //#region ../../node_modules/element-internals-polyfill/dist/maps.js
1
+ import { l as e, n as t, u as n } from "./element-Bwc-likm.js";
2
+ import { n as r } from "./utils-Dn5ykFtS.js";
3
+ import "./shared-types-BvRk9kiK.js";
4
+ import { n as i, t as a } from "./booleanish-CBa3Cr2h.js";
5
+ import { t as o } from "./format-DwjTfa9h.js";
6
+ import { t as s } from "./element-with-slot-47quDZRt.js";
7
+ // ../../node_modules/element-internals-polyfill/dist/maps.js
8
8
  var c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), d = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakMap(), ee = /* @__PURE__ */ new WeakMap(), p = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), _ = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), S = (e, t, n) => {
9
9
  e.getAttribute(t) !== n && e.setAttribute(t, n);
10
10
  }, C = (e, t) => {
@@ -86,8 +86,7 @@ var c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), u = /*
86
86
  function N() {
87
87
  return typeof MutationObserver < "u";
88
88
  }
89
- //#endregion
90
- //#region ../../node_modules/element-internals-polyfill/dist/aom.js
89
+ // ../../node_modules/element-internals-polyfill/dist/aom.js
91
90
  var P = {
92
91
  ariaAtomic: "aria-atomic",
93
92
  ariaAutoComplete: "aria-autocomplete",
@@ -282,8 +281,7 @@ var U = class extends Set {
282
281
  return this[e] == null ? null : this[e];
283
282
  }
284
283
  };
285
- //#endregion
286
- //#region ../../node_modules/element-internals-polyfill/dist/patch-form-prototype.js
284
+ // ../../node_modules/element-internals-polyfill/dist/patch-form-prototype.js
287
285
  function he() {
288
286
  let e = HTMLFormElement.prototype.checkValidity;
289
287
  HTMLFormElement.prototype.checkValidity = n;
@@ -303,8 +301,7 @@ function he() {
303
301
  return n.length === 0 ? t : new me(Array.from(t).concat(n).sort((e, t) => e.compareDocumentPosition ? e.compareDocumentPosition(t) & 2 ? 1 : -1 : 0));
304
302
  } });
305
303
  }
306
- //#endregion
307
- //#region ../../node_modules/element-internals-polyfill/dist/element-internals.js
304
+ // ../../node_modules/element-internals-polyfill/dist/element-internals.js
308
305
  var K = class {
309
306
  static get isPolyfilled() {
310
307
  return !0;
@@ -458,15 +455,13 @@ function _e(e = !0) {
458
455
  N() && typeof document < "u" && new MutationObserver(z).observe(document.documentElement, B), typeof HTMLFormElement < "u" && he(), (e || typeof window < "u" && !window.CustomStateSet) && Y();
459
456
  }
460
457
  }
461
- //#endregion
462
- //#region ../../node_modules/element-internals-polyfill/dist/index.js
458
+ // ../../node_modules/element-internals-polyfill/dist/index.js
463
459
  customElements.polyfillWrapFlushCallback || (ge() ? typeof window < "u" && !window.CustomStateSet && Y(HTMLElement.prototype.attachInternals) : _e(!1));
464
- //#endregion
465
- //#region src/base-elements/input-element.ts
460
+ // src/base-elements/input-element.ts
466
461
  var X = "on", ve = "--checked", Z = ",", Q = (e) => e === !0 || e === "" || e === "true", ye = /* @__PURE__ */ new WeakMap(), be = 0, xe = (e) => {
467
462
  let t = ye.get(e);
468
463
  return t || (t = e.id || `form${++be}`, ye.set(e, t)), t;
469
- }, Se = () => !!globalThis.ElementInternals?.isPolyfilled, $ = class e extends i {
464
+ }, Se = () => !!globalThis.ElementInternals?.isPolyfilled, $ = class e extends s {
470
465
  static get formAssociated() {
471
466
  return !0;
472
467
  }
@@ -510,7 +505,7 @@ var X = "on", ve = "--checked", Z = ",", Q = (e) => e === !0 || e === "" || e ==
510
505
  return this.hasFieldset ?? e;
511
506
  }
512
507
  constructor() {
513
- super(), this.defaultValue = null, this.disabled = !1, this.readonly = !1, this.required = !1, this.max = null, this.maxlength = null, this.min = null, this.minlength = null, this.step = null, this.ariaDescribedby = null, this.ariaLabelledby = null, this.name = "", this.pattern = null, this.placeholder = null, this.id = s(), this.counter = null, this.hasError = !1, this.inline = !1, this.hasFieldset = null, this.optionalTag = !1, this.requiredTag = !1, this.skipForwardTestid = !1, this.useWrapper = !0, this.fullwidth = !1, this.counterMaxLength = 0, this.errorMessage = "", this.helptext = "", this.helptextDropdown = "", this.helptextDropdownButton = null, this.label = null, this.tagText = null, this.inputSize = "medium", this.dataTestid = "", this.formDisabled = !1, this.derivedName = null, this.groupValidityMessage = "", this.touched = !1, this._initialized = !1, this.polyfillFormValue = null, this._didInitDerivedState = !1, this._defaultCheckedState = !1, this.internals = this.attachInternals();
508
+ super(), this.defaultValue = null, this.disabled = !1, this.readonly = !1, this.required = !1, this.max = null, this.maxlength = null, this.min = null, this.minlength = null, this.step = null, this.ariaDescribedby = null, this.ariaLabelledby = null, this.name = "", this.pattern = null, this.placeholder = null, this.id = r(), this.counter = null, this.hasError = !1, this.inline = !1, this.hasFieldset = null, this.optionalTag = !1, this.requiredTag = !1, this.skipForwardTestid = !1, this.useWrapper = !0, this.fullwidth = !1, this.counterMaxLength = 0, this.errorMessage = "", this.helptext = "", this.helptextDropdown = "", this.helptextDropdownButton = null, this.label = null, this.tagText = null, this.inputSize = "medium", this.dataTestid = "", this.formDisabled = !1, this.derivedName = null, this.groupValidityMessage = "", this.touched = !1, this._initialized = !1, this.polyfillFormValue = null, this._didInitDerivedState = !1, this._defaultCheckedState = !1, this.internals = this.attachInternals();
514
509
  }
515
510
  connectedCallback() {
516
511
  super.connectedCallback(), Se() && queueMicrotask(() => {
@@ -536,7 +531,7 @@ var X = "on", ve = "--checked", Z = ",", Q = (e) => e === !0 || e === "" || e ==
536
531
  (this.isCheckable ? this.checkableValueMissing(t ?? this.checkableGroup()) : this.required && !this.value) ? this.internals.setValidity(this.groupValidityMessage ? {
537
532
  valueMissing: !0,
538
533
  customError: !0
539
- } : { valueMissing: !0 }, this.groupValidityMessage || n.valueMissing, e) : e.validity?.typeMismatch || e.validity?.badInput ? this.internals.setValidity({ typeMismatch: !0 }, n.typeMismatch, e) : e.validity?.patternMismatch ? this.internals.setValidity({ patternMismatch: !0 }, n.patternMismatch, e) : e.validity?.tooShort || this.minlength && this.minlength > 0 && this.valueLength < this.minlength ? this.internals.setValidity({ tooShort: !0 }, n.tooShort, e) : e.validity?.tooLong || this.maxlength && this.maxlength > 0 && this.valueLength > this.maxlength ? this.internals.setValidity({ tooLong: !0 }, n.tooLong, e) : e.validity?.rangeUnderflow ? this.internals.setValidity({ rangeUnderflow: !0 }, this.min ? r(n.rangeUnderflowMin, { min: this.min.toString() }) : n.rangeUnderflow, e) : e.validity?.stepMismatch ? this.internals.setValidity({ stepMismatch: !0 }, n.typeMismatch, e) : e.validity?.rangeOverflow ? this.internals.setValidity({ rangeOverflow: !0 }, this.max ? r(n.rangeOverflowMax, { max: this.max.toString() }) : n.rangeOverflow, e) : e.validity?.customError ? this.internals.setValidity({ customError: !0 }, e.validationMessage, e) : this.groupValidityMessage ? this.internals.setValidity({ customError: !0 }, this.groupValidityMessage, e) : this.internals.setValidity({});
534
+ } : { valueMissing: !0 }, this.groupValidityMessage || n.valueMissing, e) : e.validity?.typeMismatch || e.validity?.badInput ? this.internals.setValidity({ typeMismatch: !0 }, n.typeMismatch, e) : e.validity?.patternMismatch ? this.internals.setValidity({ patternMismatch: !0 }, n.patternMismatch, e) : e.validity?.tooShort || this.minlength && this.minlength > 0 && this.valueLength < this.minlength ? this.internals.setValidity({ tooShort: !0 }, n.tooShort, e) : e.validity?.tooLong || this.maxlength && this.maxlength > 0 && this.valueLength > this.maxlength ? this.internals.setValidity({ tooLong: !0 }, n.tooLong, e) : e.validity?.rangeUnderflow ? this.internals.setValidity({ rangeUnderflow: !0 }, this.min ? o(n.rangeUnderflowMin, { min: this.min.toString() }) : n.rangeUnderflow, e) : e.validity?.stepMismatch ? this.internals.setValidity({ stepMismatch: !0 }, n.typeMismatch, e) : e.validity?.rangeOverflow ? this.internals.setValidity({ rangeOverflow: !0 }, this.max ? o(n.rangeOverflowMax, { max: this.max.toString() }) : n.rangeOverflow, e) : e.validity?.customError ? this.internals.setValidity({ customError: !0 }, e.validationMessage, e) : this.groupValidityMessage ? this.internals.setValidity({ customError: !0 }, this.groupValidityMessage, e) : this.internals.setValidity({});
540
535
  }
541
536
  setFormValue(e) {
542
537
  if (this.internals) {
@@ -665,7 +660,7 @@ var X = "on", ve = "--checked", Z = ",", Q = (e) => e === !0 || e === "" || e ==
665
660
  ].some((t) => e.has(t)) && (this.syncCheckedState(), this.validateCheckable())), e.has("dataTestid") && this.dataTestid && this.inputRef.value && (this.skipForwardTestid ? this.hasAttribute("data-testid") || this.setAttribute("data-testid", this.dataTestid) : (this.inputRef.value.dataset.testid = this.dataTestid, this.removeAttribute("data-testid")));
666
661
  }
667
662
  willUpdate(e) {
668
- super.willUpdate(e), e.has("disabled") && this.toggleAttribute("disabled", this.disabled), this.syncGroupName(), !this._didInitDerivedState && (this._didInitDerivedState = !0, this.defaultChecked && (this.checked = !0), this.id && !this.name && (this.name = this.id, this.derivedName = this.id), this.value && this.defaultValue === null && (this.defaultValue = this.value), this.defaultValue !== null && !this.value && this.valueChanged(this.defaultValue, null));
663
+ super.willUpdate(e), e.has("disabled") && this.toggleAttribute("disabled", this.disabled), this.syncGroupName(), this._didInitDerivedState || (this._didInitDerivedState = !0, this.defaultChecked && (this.checked = !0), this.id && !this.name && (this.name = this.id, this.derivedName = this.id), this.value && this.defaultValue === null && (this.defaultValue = this.value), this.defaultValue !== null && !this.value && this.valueChanged(this.defaultValue, null));
669
664
  }
670
665
  firstUpdated(e) {
671
666
  if (super.firstUpdated(e), this.defaultChecked && (this.internals.ariaChecked = "true"), this.isRequired && (this.internals.ariaRequired = "true"), this.disabled && (this.internals.ariaDisabled = "true"), this.checked !== void 0) {
@@ -735,14 +730,14 @@ t([n({
735
730
  reflect: !0
736
731
  })], $.prototype, "id", void 0), t([n({
737
732
  type: Boolean,
738
- converter: a
733
+ converter: i
739
734
  })], $.prototype, "counter", void 0), t([n({ type: Boolean })], $.prototype, "hasError", void 0), t([n({ type: Boolean })], $.prototype, "inline", void 0), t([n({
740
735
  type: Boolean,
741
- converter: a
736
+ converter: i
742
737
  })], $.prototype, "hasFieldset", void 0), t([n({ type: Boolean })], $.prototype, "optionalTag", void 0), t([n({ type: Boolean })], $.prototype, "requiredTag", void 0), t([n({ type: Boolean })], $.prototype, "skipForwardTestid", void 0), t([n({
743
738
  type: Boolean,
744
739
  reflect: !0,
745
- converter: o
740
+ converter: a
746
741
  })], $.prototype, "useWrapper", void 0), t([n({
747
742
  type: Boolean,
748
743
  reflect: !0
@@ -766,5 +761,4 @@ t([n({
766
761
  attribute: "data-testid",
767
762
  hasChanged: (e, t) => !!e && e !== t
768
763
  })], $.prototype, "dataTestid", void 0), t([e()], $.prototype, "formDisabled", void 0);
769
- //#endregion
770
764
  export { $ as t };
@@ -1,4 +1,4 @@
1
- const e=require("./element-CEarCnHH.cjs"),t=require("./format-B8meU8Tm.cjs"),n=require("./element-with-slot-CeKuRE3_.cjs"),r=require("./booleanish-BF8l4scU.cjs");require("./shared-types-BvRk9kiK.cjs"),require("./alert-DkyTTo7S.cjs");const i=require("./icon-5A378_yh.cjs"),a=require("./if-defined-Ci4ZQsgL.cjs"),o=require("./utils-63cRpWut.cjs");require("./helptext-Bse1LpRd.cjs");const s=require("./focus-modality-controller-C1ocyv2J.cjs");var c={counter:!1,counterCurrent:0,counterPosition:`bottom`,optionalTag:!1,requiredTag:!1,hasError:!1,disabled:!1,inline:!1,hasFieldset:!1,layout:`vertical`,useWrapper:!0,size:`medium`},l=e=>{let t=[];return e.hasHelptext&&t.push(`${e.id}-helptext`),e.hasCounter&&t.push(`${e.id}-counter-status`),e.ariaDescribedby&&t.push(e.ariaDescribedby),t.length?t.join(` `):void 0},u=e=>`${e}-counter-status`,d=(e,t)=>!!t&&t>0&&(e??0)>t,f=class extends n.t{constructor(...e){super(...e),this.forId=o.n(),this.label=``,this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=c.counter,this.counterCurrent=c.counterCurrent,this.counterMaxLength=0,this.counterError=null,this.counterPosition=c.counterPosition,this.optionalTag=c.optionalTag,this.requiredTag=c.requiredTag,this.tagText=null,this.hasError=c.hasError,this.errorMessage=``,this.disabled=c.disabled,this.inline=c.inline,this.ariaDescribedby=void 0,this.hasFieldset=c.hasFieldset,this.layout=c.layout,this.role=null,this.useWrapper=c.useWrapper,this.size=c.size,this.focusModality=new s.t(this)}updated(e){super.updated(e),this.classList.add(`pkt-inputwrapper`),this.classList.toggle(`pkt-inputwrapper--error`,this.hasError),this.classList.toggle(`pkt-inputwrapper--disabled`,this.disabled),this.classList.toggle(`pkt-inputwrapper--inline`,this.inline),this.classList.toggle(`pkt-inputwrapper--medium`,this.size===`medium`),this.classList.toggle(`pkt-inputwrapper--small`,this.size===`small`),this.classList.toggle(`pkt-inputwrapper--xsmall`,this.size===`xsmall`),this.role?this.setAttribute(`aria-labelledby`,`${this.forId}-label`):this.removeAttribute(`aria-labelledby`)}render(){let r=`pkt-tag pkt-tag--small pkt-tag--thin-text`,o=!!this.helptext||this.hasSlotContent(`helptext`),s=new Set([this.ariaDescribedby||(o?`${this.forId}-helptext`:``),this.hasError&&this.errorMessage?`${this.forId}-error`:``].join(` `).split(` `).filter(Boolean)),c=s.size?[...s].join(` `):e.h,l=this.pktStrings.get(`forms`),f=()=>e._`
1
+ const e=require("./element-CEarCnHH.cjs"),t=require("./format-B8meU8Tm.cjs"),n=require("./element-with-slot-D_8fAzCW.cjs"),r=require("./booleanish-BF8l4scU.cjs");require("./shared-types-BvRk9kiK.cjs"),require("./alert-0a5lX0pL.cjs");const i=require("./icon-5A378_yh.cjs"),a=require("./if-defined-Ci4ZQsgL.cjs"),o=require("./utils-63cRpWut.cjs");require("./helptext-CQaNvbiv.cjs");const s=require("./focus-modality-controller-C1ocyv2J.cjs");var c={counter:!1,counterCurrent:0,counterPosition:`bottom`,optionalTag:!1,requiredTag:!1,hasError:!1,disabled:!1,inline:!1,hasFieldset:!1,layout:`vertical`,useWrapper:!0,size:`medium`},l=e=>{let t=[];return e.hasHelptext&&t.push(`${e.id}-helptext`),e.hasCounter&&t.push(`${e.id}-counter-status`),e.ariaDescribedby&&t.push(e.ariaDescribedby),t.length?t.join(` `):void 0},u=e=>`${e}-counter-status`,d=(e,t)=>!!t&&t>0&&(e??0)>t,f=class extends n.t{constructor(...e){super(...e),this.forId=o.n(),this.label=``,this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=c.counter,this.counterCurrent=c.counterCurrent,this.counterMaxLength=0,this.counterError=null,this.counterPosition=c.counterPosition,this.optionalTag=c.optionalTag,this.requiredTag=c.requiredTag,this.tagText=null,this.hasError=c.hasError,this.errorMessage=``,this.disabled=c.disabled,this.inline=c.inline,this.ariaDescribedby=void 0,this.hasFieldset=c.hasFieldset,this.layout=c.layout,this.role=null,this.useWrapper=c.useWrapper,this.size=c.size,this.focusModality=new s.t(this)}updated(e){super.updated(e),this.classList.add(`pkt-inputwrapper`),this.classList.toggle(`pkt-inputwrapper--error`,this.hasError),this.classList.toggle(`pkt-inputwrapper--disabled`,this.disabled),this.classList.toggle(`pkt-inputwrapper--inline`,this.inline),this.classList.toggle(`pkt-inputwrapper--medium`,this.size===`medium`),this.classList.toggle(`pkt-inputwrapper--small`,this.size===`small`),this.classList.toggle(`pkt-inputwrapper--xsmall`,this.size===`xsmall`),this.role?this.setAttribute(`aria-labelledby`,`${this.forId}-label`):this.removeAttribute(`aria-labelledby`)}render(){let r=`pkt-tag pkt-tag--small pkt-tag--thin-text`,o=!!this.helptext||this.hasSlotContent(`helptext`),s=new Set([this.ariaDescribedby||(o?`${this.forId}-helptext`:``),this.hasError&&this.errorMessage?`${this.forId}-error`:``].join(` `).split(` `).filter(Boolean)),c=s.size?[...s].join(` `):e.h,l=this.pktStrings.get(`forms`),f=()=>e._`
2
2
  ${this.tagText?e._`<span class=${r+` pkt-tag--gray`}>${this.tagText}</span>`:e.h}
3
3
  ${this.optionalTag?e._`<span class=${r+` pkt-tag--blue-pale`}
4
4
  >${this.optionalText??l.optional}</span
@@ -1,15 +1,15 @@
1
- import { _ as e, d as t, h as n, n as r, u as i } from "./element-DLgZkx5L.js";
2
- import { t as a } from "./format-BTeSVkED.js";
3
- import { i as o, n as s, t as c } from "./element-with-slot-mG-h7Sjw.js";
4
- import { t as l } from "./booleanish-OQJTYSrw.js";
5
- import "./shared-types-A6iGIX-f.js";
6
- import "./alert-CA1fDbyc.js";
7
- import { r as u } from "./icon-C1oCGwEe.js";
8
- import { t as d } from "./if-defined-DiYi2v_Q.js";
9
- import { n as f } from "./utils-BwF4QSrq.js";
10
- import "./helptext-BFQzrOw4.js";
11
- import { t as p } from "./focus-modality-controller-Dc2S-KqR.js";
12
- //#region ../../shared-types/input-wrapper.ts
1
+ import { _ as e, d as t, h as n, n as r, u as i } from "./element-Bwc-likm.js";
2
+ import { t as a } from "./format-DwjTfa9h.js";
3
+ import { i as o, n as s, t as c } from "./element-with-slot-47quDZRt.js";
4
+ import { t as l } from "./booleanish-CBa3Cr2h.js";
5
+ import "./shared-types-BvRk9kiK.js";
6
+ import "./alert-ZrB-P881.js";
7
+ import { r as u } from "./icon-CZDw42U7.js";
8
+ import { t as d } from "./if-defined-B3pYog2C.js";
9
+ import { n as f } from "./utils-Dn5ykFtS.js";
10
+ import "./helptext-kKmVQkwo.js";
11
+ import { t as p } from "./focus-modality-controller-DVsT6GeR.js";
12
+ // ../../shared-types/input-wrapper.ts
13
13
  var m = {
14
14
  counter: !1,
15
15
  counterCurrent: 0,
@@ -149,8 +149,6 @@ try {
149
149
  } catch {
150
150
  console.warn("Forsøker å definere <pkt-input-wrapper>, men den er allerede definert");
151
151
  }
152
- //#endregion
153
- //#region src/components/input-wrapper/index.ts
152
+ // src/components/input-wrapper/index.ts
154
153
  var y = v;
155
- //#endregion
156
154
  export { v as n, h as r, y as t };
@@ -1,10 +1,9 @@
1
- import { _ as e, d as t, h as n, n as r, u as i } from "./element-DLgZkx5L.js";
2
- import { t as a } from "./class-map-BDwVSgLb.js";
3
- import { i as o, t as s } from "./element-with-slot-mG-h7Sjw.js";
4
- import "./icon-C1oCGwEe.js";
5
- import { t as c } from "./define-component-spec-BYOSeplU.js";
6
- //#endregion
7
- //#region src/components/link/link.ts
1
+ import { i as e, t } from "./element-with-slot-47quDZRt.js";
2
+ import { _ as n, d as r, h as i, n as a, u as o } from "./element-Bwc-likm.js";
3
+ import { t as s } from "./class-map-C9n5CNC8.js";
4
+ import { t as c } from "./define-component-spec-wHP10r2x.js";
5
+ import "./icon-CZDw42U7.js";
6
+ // src/components/link/link.ts
8
7
  var l = c({
9
8
  name: "pkt-link",
10
9
  react: "PktLink",
@@ -90,7 +89,7 @@ var l = c({
90
89
  }
91
90
  } },
92
91
  slots: { default: { description: "Innholdet i lenken" } }
93
- }).props, u = class extends s {
92
+ }).props, u = class extends t {
94
93
  constructor(...e) {
95
94
  super(...e), this.href = l.href.default, this.iconName = void 0, this.iconPosition = void 0, this.rel = null, this.target = l.target.default;
96
95
  }
@@ -99,39 +98,37 @@ var l = c({
99
98
  "pkt-link": !0,
100
99
  "pkt-link--icon-left": !!this.iconName && this.iconPosition === "left" || !(!this.iconName || this.iconPosition),
101
100
  "pkt-link--icon-right": !!this.iconName && this.iconPosition === "right"
102
- }, r = this.target && this.target !== "_self" ? this.target : n;
103
- return e`<a
104
- class=${a(t)}
101
+ }, r = this.target && this.target !== "_self" ? this.target : i;
102
+ return n`<a
103
+ class=${s(t)}
105
104
  href=${this.href}
106
105
  target=${r}
107
- rel=${this.rel || n}
108
- >${this.iconName ? e`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>` : ""}${o(this)}</a
106
+ rel=${this.rel || i}
107
+ >${this.iconName ? n`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>` : ""}${e(this)}</a
109
108
  >`;
110
109
  }
111
110
  };
112
- r([i({
111
+ a([o({
113
112
  type: String,
114
113
  reflect: !0
115
- })], u.prototype, "href", void 0), r([i({
114
+ })], u.prototype, "href", void 0), a([o({
116
115
  type: String,
117
116
  reflect: !0
118
- })], u.prototype, "iconName", void 0), r([i({
117
+ })], u.prototype, "iconName", void 0), a([o({
119
118
  type: String,
120
119
  reflect: !0
121
- })], u.prototype, "iconPosition", void 0), r([i({
120
+ })], u.prototype, "iconPosition", void 0), a([o({
122
121
  type: String,
123
122
  reflect: !0
124
- })], u.prototype, "rel", void 0), r([i({
123
+ })], u.prototype, "rel", void 0), a([o({
125
124
  type: String,
126
125
  reflect: !0
127
126
  })], u.prototype, "target", void 0);
128
127
  try {
129
- t("pkt-link")(u);
128
+ r("pkt-link")(u);
130
129
  } catch {
131
130
  console.warn("Forsøker å definere <pkt-link>, men den er allerede definert");
132
131
  }
133
- //#endregion
134
- //#region src/components/link/index.ts
132
+ // src/components/link/index.ts
135
133
  var d = u;
136
- //#endregion
137
134
  export { u as n, d as t };
@@ -0,0 +1,7 @@
1
+ const e=require("./element-with-slot-D_8fAzCW.cjs"),t=require("./element-CEarCnHH.cjs"),n=require("./class-map-C82GtM1w.cjs"),r=require("./define-component-spec-DBNd2FJY.cjs");require("./icon-5A378_yh.cjs");var i={href:{type:`string`,description:`Mål-URL for lenken.`,required:!0,reactOnly:!0},className:{type:`string`,description:`CSS-klasser Punkt har satt på lenken.`,required:!0,reactOnly:!0},children:{type:`ReactNode`,description:`Innhold/label som skal rendres inni lenken.`,required:!0,reactOnly:!0},props:{type:`AnchorHTMLAttributes<HTMLAnchorElement>`,description:`Resten av anchor-attributter (f.eks. <code>onClick</code>, <code>aria-*</code>) som skal spreades på lenken.`,required:!0,reactOnly:!0}},a={name:`Egendefinert lenkekomponent`,description:`React: Funksjon for å rendre en egendefinert lenkekomponent (f.eks. Next.js Link eller React Router Link). Mottar et <code>IRenderLink</code>-objekt med href, className, children og props. Standard er et vanlig <code>&lt;a&gt;</code>-element.`,type:`(args: IRenderLink) => ReactNode`,relatedTypes:[`IRenderLink`],category:`tech`,reactOnly:!0},o={IRenderLink:{title:`IRenderLink`,description:`Objektet som sendes til <code>renderLink</code> i Link, BackLink og Breadcrumbs. Kun React — brukes til å bytte ut standard <code>&lt;a&gt;</code> med f.eks. Next.js Link eller React Router Link.`,properties:i}},s=r.t({name:`pkt-link`,react:`PktLink`,"css-class":`pkt-link`,"dark-mode":!0,isElement:!0,props:{href:{name:`URL`,description:`URL til lenken`,type:`string`,default:`#`,displayDefault:!0,category:`contents`},target:{name:`Mål`,description:`Mål for lenken`,type:[`_blank`,`_self`,`_parent`,`_top`],default:`_self`,category:`tech`},rel:{name:`Relasjon`,description:`Forholdet mellom siden og målet for lenken, som i <code>rel</code> på en vanlig lenke. For eksempel <code>noopener noreferrer</code>.`,type:`string`,category:`tech`},iconName:{name:`Ikon`,description:`Ikon som skal vises ved siden av lenketeksten`,type:`icon`,category:`ui`},iconPosition:{name:`Ikonposisjon`,description:`Posisjonen til ikonet i forhold til lenketeksten`,type:[`left`,`right`],category:`ui`},renderLink:a},types:{...o},slots:{default:{description:`Innholdet i lenken`}}}).props,c=class extends e.t{constructor(...e){super(...e),this.href=s.href.default,this.iconName=void 0,this.iconPosition=void 0,this.rel=null,this.target=s.target.default}render(){let r={"pkt-link":!0,"pkt-link--icon-left":!!this.iconName&&this.iconPosition===`left`||!(!this.iconName||this.iconPosition),"pkt-link--icon-right":!!this.iconName&&this.iconPosition===`right`},i=this.target&&this.target!==`_self`?this.target:t.h;return t._`<a
2
+ class=${n.t(r)}
3
+ href=${this.href}
4
+ target=${i}
5
+ rel=${this.rel||t.h}
6
+ >${this.iconName?t._`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:``}${e.i(this)}</a
7
+ >`}};t.n([t.u({type:String,reflect:!0})],c.prototype,`href`,void 0),t.n([t.u({type:String,reflect:!0})],c.prototype,`iconName`,void 0),t.n([t.u({type:String,reflect:!0})],c.prototype,`iconPosition`,void 0),t.n([t.u({type:String,reflect:!0})],c.prototype,`rel`,void 0),t.n([t.u({type:String,reflect:!0})],c.prototype,`target`,void 0);try{t.d(`pkt-link`)(c)}catch{console.warn(`Forsøker å definere <pkt-link>, men den er allerede definert`)}var l=c;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
@@ -1,4 +1,4 @@
1
- const e=require("./element-CEarCnHH.cjs"),t=require("./element-with-slot-CeKuRE3_.cjs");require("./shared-types-BvRk9kiK.cjs"),require("./icon-5A378_yh.cjs");const n=require("./if-defined-Ci4ZQsgL.cjs");var r=[`white`,`blue`,`green`,`beige`],i=class extends t.t{constructor(...e){super(...e),this.title=``,this.href=`#`,this.iconName=``,this.openInNewTab=!1,this.skin=void 0}render(){let i=[`pkt-linkcard`,this.skin&&`pkt-linkcard--${this.skin}`].filter(Boolean).join(` `),a=this.pktStrings.get(`linkcard`),o=this.openInNewTab?a.openInNewTab:``;return e._`
1
+ const e=require("./element-CEarCnHH.cjs"),t=require("./element-with-slot-D_8fAzCW.cjs");require("./shared-types-BvRk9kiK.cjs"),require("./icon-5A378_yh.cjs");const n=require("./if-defined-Ci4ZQsgL.cjs");var r=[`white`,`blue`,`green`,`beige`],i=class extends t.t{constructor(...e){super(...e),this.title=``,this.href=`#`,this.iconName=``,this.openInNewTab=!1,this.skin=void 0}render(){let i=[`pkt-linkcard`,this.skin&&`pkt-linkcard--${this.skin}`].filter(Boolean).join(` `),a=this.pktStrings.get(`linkcard`),o=this.openInNewTab?a.openInNewTab:``;return e._`
2
2
  <a
3
3
  href=${this.href}
4
4
  class=${i}
@@ -1,9 +1,9 @@
1
- import { _ as e, d as t, n, u as r } from "./element-DLgZkx5L.js";
2
- import { i, t as a } from "./element-with-slot-mG-h7Sjw.js";
3
- import "./shared-types-A6iGIX-f.js";
4
- import "./icon-C1oCGwEe.js";
5
- import { t as o } from "./if-defined-DiYi2v_Q.js";
6
- //#region ../../shared-types/linkcard.ts
1
+ import { _ as e, d as t, n, u as r } from "./element-Bwc-likm.js";
2
+ import { i, t as a } from "./element-with-slot-47quDZRt.js";
3
+ import "./shared-types-BvRk9kiK.js";
4
+ import "./icon-CZDw42U7.js";
5
+ import { t as o } from "./if-defined-B3pYog2C.js";
6
+ // ../../shared-types/linkcard.ts
7
7
  var s = [
8
8
  "white",
9
9
  "blue",
@@ -53,8 +53,6 @@ try {
53
53
  } catch {
54
54
  console.warn("Forsøker å definere <pkt-linkcard>, men den er allerede definert");
55
55
  }
56
- //#endregion
57
- //#region src/components/linkcard/index.ts
56
+ // src/components/linkcard/index.ts
58
57
  var l = c;
59
- //#endregion
60
58
  export { c as n, l as t };
@@ -1,10 +1,10 @@
1
- const e=require("./element-CEarCnHH.cjs"),t=require("./class-map-C82GtM1w.cjs"),n=require("./format-B8meU8Tm.cjs"),r=require("./if-defined-Ci4ZQsgL.cjs"),i=require("./repeat-CjvNrcUr.cjs"),a=require("./utils-63cRpWut.cjs");var o=(e,t)=>t&&(e.find(e=>e.value===t)||e.find(e=>e.label===t))||null,s=(e,t)=>{if(!t)return-1;let n=e.findIndex(e=>e.value===t);return n>=0?n:e.findIndex(e=>e.label===t)},c=e=>e.value+(e.label||``)+(e.prefix||``),l=(e,t)=>(e.fulltext||c(e)).toLowerCase().includes(t),u=(e,t)=>{if(!t)return[...e];let n=t.toLowerCase();return e.filter(e=>l(e,n))},d=(e,t)=>t!==null&&e>=t,f=(e,t)=>{if(!e)return``;switch(t){case`prefixAndValue`:return`${e.prefix||``} ${e.value}`.trim();case`value`:return e.value;default:return e.label||e.value}},p=(e,t)=>{if(!t)return{filtered:[...e],suggestion:null};let n=t.toLowerCase(),r=e.filter(e=>l(e,n));return{filtered:r,suggestion:r.find(e=>!e.selected&&e.label?.toLowerCase().startsWith(n))||null}},m=(e,t,n,r)=>{if(!e.trim())return{addValueText:null,userInfoMessage:``};let i=e.trim().toLowerCase(),a=t.find(e=>e.toLowerCase()===i),o=n.filter(e=>e.label?.toLowerCase().includes(i)||e.value.toLowerCase().includes(i)),s=o.find(e=>e.label?.toLowerCase()===i||e.value.toLowerCase()===i);return(o.length===0||!s)&&r?{addValueText:e,userInfoMessage:``}:o.length===0&&!r?{addValueText:null,userInfoMessage:`noResults`}:a?{addValueText:null,userInfoMessage:`alreadySelected`}:{addValueText:null,userInfoMessage:``}},h=e=>/^[\p{L} ]$/u.test(e),g=(e=500)=>{let t=``,n;return{append:r=>(t+=r.toLowerCase(),n!==void 0&&clearTimeout(n),n=setTimeout(()=>{t=``},e),t),reset:()=>{t=``,n!==void 0&&(clearTimeout(n),n=void 0)},getBuffer:()=>t}},_=(e,t)=>{let n=t.toLowerCase();return e.findIndex(e=>e.textContent?.trim().toLowerCase().startsWith(n))},v=e=>{e.scrollIntoView({block:`nearest`}),window.setTimeout(()=>e.focus(),0)},y=e=>Array.from(e.querySelectorAll(`[role="option"]:not([data-disabled])`)||[]),b=e=>{let t=e.nextElementSibling;t&&v(t)},x=(e,t,n)=>{let r=e.previousElementSibling;if(e.dataset.index===`0`&&n){let e=t.querySelector(`[role="searchbox"]`);e&&v(e)}else r&&v(r)},S=e=>{let t=y(e);t[0]&&v(t[0])},C=e=>{let t=y(e),n=t[t.length-1];n&&v(n)},w=(e,t)=>{if(t.disabled)return;let n=y(e);if(t.allowUserInput&&t.customUserInput){let t=e.querySelector(`[data-type="new-option"]`);if(t){v(t);return}}let r=n.find(e=>e.dataset.selected===`true`);if(r)v(r);else{if(t.includeSearch&&!(document.activeElement instanceof HTMLInputElement)){let t=e.querySelector(`[role="searchbox"]`);if(t){window.setTimeout(()=>t.focus(),0);return}}n[0]&&v(n[0])}},T=class extends e.t{constructor(...e){super(...e),this.id=a.n(),this._listboxId=a.n(),this.label=null,this.options=[],this.isOpen=!1,this.disabled=!1,this.includeSearch=!1,this.isMultiSelect=!1,this.allowUserInput=!1,this.maxIsReached=!1,this.customUserInput=null,this.searchPlaceholder=null,this.searchValue=null,this.maxLength=0,this.userMessage=null,this._selectedOptions=0,this.typeahead=g(),this._filteredOptions=[]}connectedCallback(){super.connectedCallback();let e=this.getAttribute(`id`);e?this.adoptHostId(e):this.id&&(this._listboxId=this.id),this.includeSearch&&!this.searchValue&&(this.searchValue=``),this.options.length>0&&this.filterOptions(),this.setAttribute(`tabindex`,`-1`),this.addEventListener(`focus`,this.focusFirstOrSelectedOption)}disconnectedCallback(){super.disconnectedCallback(),this.typeahead.reset()}attributeChangedCallback(e,t,n){(e===`options`||e===`search-value`)&&this.filterOptions(),super.attributeChangedCallback(e,t,n),e===`id`&&n&&this.adoptHostId(n)}get _hasOptions(){return this._filteredOptions.length>0||this.options.length>0}adoptHostId(e){this._listboxId=e,this.removeAttribute(`id`)}willUpdate(e){super.willUpdate(e),(e.has(`options`)||e.has(`searchValue`))&&this.filterOptions()}render(){return e._`
1
+ const e=require("./element-CEarCnHH.cjs"),t=require("./if-defined-Ci4ZQsgL.cjs"),n=require("./repeat-CjvNrcUr.cjs"),r=require("./class-map-C82GtM1w.cjs"),i=require("./format-B8meU8Tm.cjs"),a=require("./utils-63cRpWut.cjs");var o=(e,t)=>t&&(e.find(e=>e.value===t)||e.find(e=>e.label===t))||null,s=(e,t)=>{if(!t)return-1;let n=e.findIndex(e=>e.value===t);return n>=0?n:e.findIndex(e=>e.label===t)},c=e=>e.value+(e.label||``)+(e.prefix||``),l=(e,t)=>(e.fulltext||c(e)).toLowerCase().includes(t),u=(e,t)=>{if(!t)return[...e];let n=t.toLowerCase();return e.filter(e=>l(e,n))},d=(e,t)=>t!==null&&e>=t,f=(e,t)=>{if(!e)return``;switch(t){case`prefixAndValue`:return`${e.prefix||``} ${e.value}`.trim();case`value`:return e.value;default:return e.label||e.value}},p=(e,t)=>{if(!t)return{filtered:[...e],suggestion:null};let n=t.toLowerCase(),r=e.filter(e=>l(e,n));return{filtered:r,suggestion:r.find(e=>!e.selected&&e.label?.toLowerCase().startsWith(n))||null}},m=(e,t,n,r)=>{if(!e.trim())return{addValueText:null,userInfoMessage:``};let i=e.trim().toLowerCase(),a=t.find(e=>e.toLowerCase()===i),o=n.filter(e=>e.label?.toLowerCase().includes(i)||e.value.toLowerCase().includes(i)),s=o.find(e=>e.label?.toLowerCase()===i||e.value.toLowerCase()===i);return(o.length===0||!s)&&r?{addValueText:e,userInfoMessage:``}:o.length===0&&!r?{addValueText:null,userInfoMessage:`noResults`}:a?{addValueText:null,userInfoMessage:`alreadySelected`}:{addValueText:null,userInfoMessage:``}},h=e=>/^[\p{L} ]$/u.test(e),g=(e=500)=>{let t=``,n;return{append:r=>(t+=r.toLowerCase(),n!==void 0&&clearTimeout(n),n=setTimeout(()=>{t=``},e),t),reset:()=>{t=``,n!==void 0&&(clearTimeout(n),n=void 0)},getBuffer:()=>t}},_=(e,t)=>{let n=t.toLowerCase();return e.findIndex(e=>e.textContent?.trim().toLowerCase().startsWith(n))},v=e=>{e.scrollIntoView({block:`nearest`}),window.setTimeout(()=>e.focus(),0)},y=e=>Array.from(e.querySelectorAll(`[role="option"]:not([data-disabled])`)||[]),b=e=>{let t=e.nextElementSibling;t&&v(t)},x=(e,t,n)=>{let r=e.previousElementSibling;if(e.dataset.index===`0`&&n){let e=t.querySelector(`[role="searchbox"]`);e&&v(e)}else r&&v(r)},S=e=>{let t=y(e);t[0]&&v(t[0])},C=e=>{let t=y(e),n=t[t.length-1];n&&v(n)},w=(e,t)=>{if(t.disabled)return;let n=y(e);if(t.allowUserInput&&t.customUserInput){let t=e.querySelector(`[data-type="new-option"]`);if(t){v(t);return}}let r=n.find(e=>e.dataset.selected===`true`);if(r)v(r);else{if(t.includeSearch&&!(document.activeElement instanceof HTMLInputElement)){let t=e.querySelector(`[role="searchbox"]`);if(t){window.setTimeout(()=>t.focus(),0);return}}n[0]&&v(n[0])}},T=class extends e.t{constructor(...e){super(...e),this.id=a.n(),this._listboxId=a.n(),this.label=null,this.options=[],this.isOpen=!1,this.disabled=!1,this.includeSearch=!1,this.isMultiSelect=!1,this.allowUserInput=!1,this.maxIsReached=!1,this.customUserInput=null,this.searchPlaceholder=null,this.searchValue=null,this.maxLength=0,this.userMessage=null,this._selectedOptions=0,this.typeahead=g(),this._filteredOptions=[]}connectedCallback(){super.connectedCallback();let e=this.getAttribute(`id`);e?this.adoptHostId(e):this.id&&(this._listboxId=this.id),this.includeSearch&&!this.searchValue&&(this.searchValue=``),this.options.length>0&&this.filterOptions(),this.setAttribute(`tabindex`,`-1`),this.addEventListener(`focus`,this.focusFirstOrSelectedOption)}disconnectedCallback(){super.disconnectedCallback(),this.typeahead.reset()}attributeChangedCallback(e,t,n){(e===`options`||e===`search-value`)&&this.filterOptions(),super.attributeChangedCallback(e,t,n),e===`id`&&n&&this.adoptHostId(n)}get _hasOptions(){return this._filteredOptions.length>0||this.options.length>0}adoptHostId(e){this._listboxId=e,this.removeAttribute(`id`)}willUpdate(e){super.willUpdate(e),(e.has(`options`)||e.has(`searchValue`))&&this.filterOptions()}render(){return e._`
2
2
  <div
3
3
  id=${this._listboxId}
4
- class=${t.t({"pkt-listbox":!0,"pkt-listbox__open":this.isOpen,"pkt-txt-16-light":!0})}
5
- role=${r.t(this._hasOptions?`listbox`:void 0)}
6
- aria-multiselectable=${r.t(this._hasOptions&&this.isMultiSelect?`true`:void 0)}
7
- aria-label=${r.t(this._hasOptions?this.label??void 0:void 0)}
4
+ class=${r.t({"pkt-listbox":!0,"pkt-listbox__open":this.isOpen,"pkt-txt-16-light":!0})}
5
+ role=${t.t(this._hasOptions?`listbox`:void 0)}
6
+ aria-multiselectable=${t.t(this._hasOptions&&this.isMultiSelect?`true`:void 0)}
7
+ aria-label=${t.t(this._hasOptions?this.label??void 0:void 0)}
8
8
  >
9
9
  <div class="pkt-listbox__banners">
10
10
  ${this.renderSearch()} ${this.renderMaximumReachedBanner()} ${this.renderUserMessage()}
@@ -36,17 +36,17 @@ const e=require("./element-CEarCnHH.cjs"),t=require("./class-map-C82GtM1w.cjs"),
36
36
  ></pkt-icon>
37
37
  ${this.pktStrings.get(`listbox`).empty}
38
38
  </div>`}renderList(){return e._`
39
- ${i.t(this._filteredOptions,e=>e.value,(n,i)=>e._`
39
+ ${n.t(this._filteredOptions,e=>e.value,(n,i)=>e._`
40
40
  <li
41
41
  @click=${()=>{this.toggleOption(n)}}
42
42
  aria-selected=${n.selected?`true`:`false`}
43
43
  @keydown=${this.handleOptionKeydown}
44
- class=${t.t({"pkt-listbox__option":!0,"pkt-listbox__option--selected":!(this.isMultiSelect||!n.selected),"pkt-listbox__option--checkBox":this.isMultiSelect})}
44
+ class=${r.t({"pkt-listbox__option":!0,"pkt-listbox__option--selected":!(this.isMultiSelect||!n.selected),"pkt-listbox__option--checkBox":this.isMultiSelect})}
45
45
  tabindex="${this.disabled||n.disabled?`-1`:`0`}"
46
46
  data-index=${i}
47
47
  data-value=${n.value}
48
48
  data-selected=${n.selected?`true`:`false`}
49
- data-disabled=${r.t(this.disabled||n.disabled||this.maxIsReached&&!n.selected?`true`:void 0)}
49
+ data-disabled=${t.t(this.disabled||n.disabled||this.maxIsReached&&!n.selected?`true`:void 0)}
50
50
  aria-disabled=${this.disabled||n.disabled||this.maxIsReached&&!n.selected?`true`:`false`}
51
51
  role="option"
52
52
  id=${`${this._listboxId}-${i}`}
@@ -75,11 +75,11 @@ const e=require("./element-CEarCnHH.cjs"),t=require("./class-map-C82GtM1w.cjs"),
75
75
  @keydown=${this.handleOptionKeydown}
76
76
  >
77
77
  <pkt-icon class="pkt-listbox__banner-icon" name="plus-sign" size="large"></pkt-icon>
78
- ${n.t(this.pktStrings.get(`listbox`).addValue,{value:this.customUserInput??``})}
78
+ ${i.t(this.pktStrings.get(`listbox`).addValue,{value:this.customUserInput??``})}
79
79
  </div>
80
80
  `:e.h}renderMaximumReachedBanner(){return this._selectedOptions=this.options.filter(e=>e.selected).length,this.isMultiSelect&&this._selectedOptions>0&&this.maxLength>0?e._`
81
81
  <div class="pkt-listbox__banner pkt-listbox__banner--maximum-reached">
82
- ${n.t(this.pktStrings.get(`listbox`).maxReached,{selected:this._selectedOptions,max:this.maxLength})}
82
+ ${i.t(this.pktStrings.get(`listbox`).maxReached,{selected:this._selectedOptions,max:this.maxLength})}
83
83
  </div>
84
84
  `:e.h}renderUserMessage(){return this.userMessage?e._`<div class="pkt-listbox__banner pkt-listbox__banner--user-message">
85
85
  <pkt-icon
@@ -1,10 +1,10 @@
1
- import { _ as e, d as t, h as n, l as r, n as i, t as a, u as o } from "./element-DLgZkx5L.js";
2
- import { t as s } from "./class-map-BDwVSgLb.js";
3
- import { t as c } from "./format-BTeSVkED.js";
4
- import { t as l } from "./if-defined-DiYi2v_Q.js";
5
- import { t as u } from "./repeat-Cy1M16Di.js";
6
- import { n as d } from "./utils-BwF4QSrq.js";
7
- //#region ../../shared-utils/combobox/option-utils.ts
1
+ import { _ as e, d as t, h as n, l as r, n as i, t as a, u as o } from "./element-Bwc-likm.js";
2
+ import { t as s } from "./if-defined-B3pYog2C.js";
3
+ import { t as c } from "./repeat-c2P6osbb.js";
4
+ import { t as l } from "./class-map-C9n5CNC8.js";
5
+ import { t as u } from "./format-DwjTfa9h.js";
6
+ import { n as d } from "./utils-Dn5ykFtS.js";
7
+ // ../../shared-utils/combobox/option-utils.ts
8
8
  var f = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label === t)) || null, p = (e, t) => {
9
9
  if (!t) return -1;
10
10
  let n = e.findIndex((e) => e.value === t);
@@ -130,14 +130,14 @@ var f = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label ==
130
130
  return e`
131
131
  <div
132
132
  id=${this._listboxId}
133
- class=${s({
133
+ class=${l({
134
134
  "pkt-listbox": !0,
135
135
  "pkt-listbox__open": this.isOpen,
136
136
  "pkt-txt-16-light": !0
137
137
  })}
138
- role=${l(this._hasOptions ? "listbox" : void 0)}
139
- aria-multiselectable=${l(this._hasOptions && this.isMultiSelect ? "true" : void 0)}
140
- aria-label=${l(this._hasOptions ? this.label ?? void 0 : void 0)}
138
+ role=${s(this._hasOptions ? "listbox" : void 0)}
139
+ aria-multiselectable=${s(this._hasOptions && this.isMultiSelect ? "true" : void 0)}
140
+ aria-label=${s(this._hasOptions ? this.label ?? void 0 : void 0)}
141
141
  >
142
142
  <div class="pkt-listbox__banners">
143
143
  ${this.renderSearch()} ${this.renderMaximumReachedBanner()} ${this.renderUserMessage()}
@@ -180,14 +180,14 @@ var f = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label ==
180
180
  }
181
181
  renderList() {
182
182
  return e`
183
- ${u(this._filteredOptions, (e) => e.value, (t, r) => e`
183
+ ${c(this._filteredOptions, (e) => e.value, (t, r) => e`
184
184
  <li
185
185
  @click=${() => {
186
186
  this.toggleOption(t);
187
187
  }}
188
188
  aria-selected=${t.selected ? "true" : "false"}
189
189
  @keydown=${this.handleOptionKeydown}
190
- class=${s({
190
+ class=${l({
191
191
  "pkt-listbox__option": !0,
192
192
  "pkt-listbox__option--selected": !(this.isMultiSelect || !t.selected),
193
193
  "pkt-listbox__option--checkBox": this.isMultiSelect
@@ -196,7 +196,7 @@ var f = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label ==
196
196
  data-index=${r}
197
197
  data-value=${t.value}
198
198
  data-selected=${t.selected ? "true" : "false"}
199
- data-disabled=${l(this.disabled || t.disabled || this.maxIsReached && !t.selected ? "true" : void 0)}
199
+ data-disabled=${s(this.disabled || t.disabled || this.maxIsReached && !t.selected ? "true" : void 0)}
200
200
  aria-disabled=${this.disabled || t.disabled || this.maxIsReached && !t.selected ? "true" : "false"}
201
201
  role="option"
202
202
  id=${`${this._listboxId}-${r}`}
@@ -228,14 +228,14 @@ var f = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label ==
228
228
  @keydown=${this.handleOptionKeydown}
229
229
  >
230
230
  <pkt-icon class="pkt-listbox__banner-icon" name="plus-sign" size="large"></pkt-icon>
231
- ${c(this.pktStrings.get("listbox").addValue, { value: this.customUserInput ?? "" })}
231
+ ${u(this.pktStrings.get("listbox").addValue, { value: this.customUserInput ?? "" })}
232
232
  </div>
233
233
  ` : n;
234
234
  }
235
235
  renderMaximumReachedBanner() {
236
236
  return this._selectedOptions = this.options.filter((e) => e.selected).length, this.isMultiSelect && this._selectedOptions > 0 && this.maxLength > 0 ? e`
237
237
  <div class="pkt-listbox__banner pkt-listbox__banner--maximum-reached">
238
- ${c(this.pktStrings.get("listbox").maxReached, {
238
+ ${u(this.pktStrings.get("listbox").maxReached, {
239
239
  selected: this._selectedOptions,
240
240
  max: this.maxLength
241
241
  })}
@@ -407,8 +407,6 @@ try {
407
407
  } catch {
408
408
  console.warn("Forsøker å definere <pkt-listbox>, men den er allerede definert");
409
409
  }
410
- //#endregion
411
- //#region src/components/listbox/index.ts
410
+ // src/components/listbox/index.ts
412
411
  var M = j;
413
- //#endregion
414
412
  export { p as a, b as c, f as i, _ as l, j as n, y as o, m as r, v as s, M as t };
@@ -1,10 +1,10 @@
1
- import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-DLgZkx5L.js";
2
- import { t as o } from "./class-map-BDwVSgLb.js";
3
- import { i as s, t as c } from "./element-with-slot-mG-h7Sjw.js";
4
- import { t as l } from "./booleanish-OQJTYSrw.js";
5
- import "./shared-types-A6iGIX-f.js";
6
- import { i as u } from "./icon-C1oCGwEe.js";
7
- //#region ../../shared-types/loader.ts
1
+ import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-Bwc-likm.js";
2
+ import { t as o } from "./class-map-C9n5CNC8.js";
3
+ import { i as s, t as c } from "./element-with-slot-47quDZRt.js";
4
+ import { t as l } from "./booleanish-CBa3Cr2h.js";
5
+ import "./shared-types-BvRk9kiK.js";
6
+ import { i as u } from "./icon-CZDw42U7.js";
7
+ // ../../shared-types/loader.ts
8
8
  var d = {
9
9
  delay: 0,
10
10
  inline: !1,
@@ -13,8 +13,7 @@ var d = {
13
13
  size: "medium",
14
14
  variant: "rainbow"
15
15
  };
16
- //#endregion
17
- //#region src/components/loader/loader.ts
16
+ // src/components/loader/loader.ts
18
17
  typeof window < "u" && (window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/latest/animations/");
19
18
  var f = "isloading", p = "loadinganimationpath", m = class extends c {
20
19
  constructor(...e) {
@@ -88,8 +87,6 @@ try {
88
87
  } catch {
89
88
  console.warn("Forsøker å definere <pkt-loader>, men den er allerede definert");
90
89
  }
91
- //#endregion
92
- //#region src/components/loader/index.ts
90
+ // src/components/loader/index.ts
93
91
  var h = m;
94
- //#endregion
95
92
  export { m as n, h as t };
@@ -1,4 +1,4 @@
1
- const e=require("./element-CEarCnHH.cjs"),t=require("./class-map-C82GtM1w.cjs"),n=require("./element-with-slot-CeKuRE3_.cjs"),r=require("./booleanish-BF8l4scU.cjs");require("./shared-types-BvRk9kiK.cjs");const i=require("./icon-5A378_yh.cjs");var a={delay:0,inline:!1,isLoading:!0,message:null,size:`medium`,variant:`rainbow`};typeof window<`u`&&(window.pktAnimationPath=window.pktAnimationPath||`https://punkt-cdn.oslo.kommune.no/latest/animations/`);var o=`isloading`,s=`loadinganimationpath`,c=class extends n.t{constructor(...e){super(...e),this.delay=a.delay,this.inline=a.inline,this.isLoading=a.isLoading,this.message=a.message,this.size=a.size,this.variant=a.variant,this.loadingAnimationPath=typeof window<`u`?window.pktAnimationPath:i.i,this._shouldDisplayLoader=!1}static get observedAttributes(){return[...super.observedAttributes,o,s]}attributeChangedCallback(e,t,n){e===o?this.isLoading=r.t.fromAttribute(n):e===s?this.loadingAnimationPath=n??void 0:super.attributeChangedCallback(e,t,n)}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(e){e.has(`delay`)&&this.setupLoader()}render(){let r=t.t({"pkt-loader":!0,[`pkt-loader--${this.inline?`inline`:`box`}`]:!0,[`pkt-loader--${this.size}`]:!0}),i=t.t({"pkt-contents":!0,"pkt-hide":this.isLoading});return e._`<div
1
+ const e=require("./element-CEarCnHH.cjs"),t=require("./class-map-C82GtM1w.cjs"),n=require("./element-with-slot-D_8fAzCW.cjs"),r=require("./booleanish-BF8l4scU.cjs");require("./shared-types-BvRk9kiK.cjs");const i=require("./icon-5A378_yh.cjs");var a={delay:0,inline:!1,isLoading:!0,message:null,size:`medium`,variant:`rainbow`};typeof window<`u`&&(window.pktAnimationPath=window.pktAnimationPath||`https://punkt-cdn.oslo.kommune.no/latest/animations/`);var o=`isloading`,s=`loadinganimationpath`,c=class extends n.t{constructor(...e){super(...e),this.delay=a.delay,this.inline=a.inline,this.isLoading=a.isLoading,this.message=a.message,this.size=a.size,this.variant=a.variant,this.loadingAnimationPath=typeof window<`u`?window.pktAnimationPath:i.i,this._shouldDisplayLoader=!1}static get observedAttributes(){return[...super.observedAttributes,o,s]}attributeChangedCallback(e,t,n){e===o?this.isLoading=r.t.fromAttribute(n):e===s?this.loadingAnimationPath=n??void 0:super.attributeChangedCallback(e,t,n)}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(e){e.has(`delay`)&&this.setupLoader()}render(){let r=t.t({"pkt-loader":!0,[`pkt-loader--${this.inline?`inline`:`box`}`]:!0,[`pkt-loader--${this.size}`]:!0}),i=t.t({"pkt-contents":!0,"pkt-hide":this.isLoading});return e._`<div
2
2
  role="status"
3
3
  aria-live="polite"
4
4
  aria-busy=${this.isLoading?`true`:`false`}
@@ -1,4 +1,4 @@
1
- const e=require("./element-CEarCnHH.cjs"),t=require("./class-map-C82GtM1w.cjs"),n=require("./element-with-slot-CeKuRE3_.cjs");require("./shared-types-BvRk9kiK.cjs"),require("./icon-5A378_yh.cjs");const r=require("./classutils-CbklAJDe.cjs"),i=require("./if-defined-Ci4ZQsgL.cjs");var a=[`beige`,`blue`,`red`,`green`],o={skin:`gray`,compact:!1,closable:!1},s=class extends n.t{constructor(){super(),this.closable=o.closable,this.compact=o.compact,this.title=``,this.skin=o.skin,this._isClosed=!1,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent(`close`,{detail:{origin:e},bubbles:!0})),this.dispatchEvent(new CustomEvent(`on-close`,{detail:{origin:e},bubbles:!0}))},this._isClosed=!1}updated(e){super.updated(e),e.has(`_isClosed`)&&r.t(this,`pkt-hide`,this._isClosed)}render(){let r={"pkt-messagebox":!0,"pkt-messagebox--compact":this.compact,[`pkt-messagebox--${this.skin}`]:!!this.skin,"pkt-messagebox--closable":this.closable,"pkt-hide":this._isClosed};return e._`<div
1
+ const e=require("./element-CEarCnHH.cjs"),t=require("./class-map-C82GtM1w.cjs"),n=require("./element-with-slot-D_8fAzCW.cjs");require("./shared-types-BvRk9kiK.cjs"),require("./icon-5A378_yh.cjs");const r=require("./classutils-CbklAJDe.cjs"),i=require("./if-defined-Ci4ZQsgL.cjs");var a=[`beige`,`blue`,`red`,`green`],o={skin:`gray`,compact:!1,closable:!1},s=class extends n.t{constructor(){super(),this.closable=o.closable,this.compact=o.compact,this.title=``,this.skin=o.skin,this._isClosed=!1,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent(`close`,{detail:{origin:e},bubbles:!0})),this.dispatchEvent(new CustomEvent(`on-close`,{detail:{origin:e},bubbles:!0}))},this._isClosed=!1}updated(e){super.updated(e),e.has(`_isClosed`)&&r.t(this,`pkt-hide`,this._isClosed)}render(){let r={"pkt-messagebox":!0,"pkt-messagebox--compact":this.compact,[`pkt-messagebox--${this.skin}`]:!!this.skin,"pkt-messagebox--closable":this.closable,"pkt-hide":this._isClosed};return e._`<div
2
2
  class=${t.t(r)}
3
3
  data-mode=${i.t(this.skin&&a.includes(this.skin)?`light`:void 0)}
4
4
  >
@@ -1,11 +1,11 @@
1
- import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-DLgZkx5L.js";
2
- import { t as o } from "./class-map-BDwVSgLb.js";
3
- import { i as s, t as c } from "./element-with-slot-mG-h7Sjw.js";
4
- import "./shared-types-A6iGIX-f.js";
5
- import "./icon-C1oCGwEe.js";
6
- import { t as l } from "./classutils-DcYnSgfc.js";
7
- import { t as u } from "./if-defined-DiYi2v_Q.js";
8
- //#region ../../shared-types/messagebox.ts
1
+ import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-Bwc-likm.js";
2
+ import { t as o } from "./class-map-C9n5CNC8.js";
3
+ import { i as s, t as c } from "./element-with-slot-47quDZRt.js";
4
+ import "./shared-types-BvRk9kiK.js";
5
+ import "./icon-CZDw42U7.js";
6
+ import { t as l } from "./classutils-C4jETHHk.js";
7
+ import { t as u } from "./if-defined-B3pYog2C.js";
8
+ // ../../shared-types/messagebox.ts
9
9
  var d = [
10
10
  "beige",
11
11
  "blue",
@@ -74,8 +74,6 @@ try {
74
74
  } catch {
75
75
  console.warn("Forsøker å definere <pkt-messagebox>, men den er allerede definert");
76
76
  }
77
- //#endregion
78
- //#region src/components/messagebox/index.ts
77
+ // src/components/messagebox/index.ts
79
78
  var m = p;
80
- //#endregion
81
79
  export { p as n, m as t };
@@ -0,0 +1,37 @@
1
+ const e=require("./class-map-C82GtM1w.cjs"),t=require("./if-defined-Ci4ZQsgL.cjs"),n=require("./element-CEarCnHH.cjs"),r=require("./element-with-slot-D_8fAzCW.cjs"),i=require("./ref-C6VUWwmF.cjs"),a=require("./scroll-lock-x0VxhKWZ.cjs"),o=require("./utils-63cRpWut.cjs");require("./icon-5A378_yh.cjs");var s={name:`pkt-modal`,react:`PktModal`,"css-class":`pkt-modal`,isElement:!0,isPureReact:!0,"dark-mode":!0,events:{"background-click":{description:`Event som trigges når bakgrunnen trykkes på`},close:{description:`Event som trigges når meldingsboksen lukkes`}},props:{open:{name:`Åpen`,description:`Deklarativ styring av modalens åpen/lukket-tilstand. Kan brukes i stedet for showModal()/close()-metodene.`,type:`boolean`,category:`tech`,default:!1},headingText:{name:`Heading text`,description:`Heading tekst på modalen`,type:`string`,category:`contents`},headingIconName:{name:`Ikon i overskriften`,description:`Navn på ikonet som vises foran overskriften. Vises bare når headingText er satt.`,type:`icon`,category:`ui`},headingIconPath:{name:`Ikon-sti for overskriften`,description:`Overstyr stien til ikonet i overskriften. Kan også settes globalt med window.pktIconPath.`,type:`string`,category:`tech`},hideCloseButton:{name:`Gjem 'Lukk'-knapp`,description:`Gjemmer lukkeknappen. Dersom denne er satt til true, vil ikke lukkeknappen vises, og dermed er det viktig at man tilbyr en annen måte som f.eks. en knapp for å lukke modalen på.`,type:`boolean`,category:`ui`,default:!1},closeOnBackdropClick:{name:`Lukk modalen når bakgrunnen trykkes på`,description:`Lukk modalen når bakgrunnen trykkes på`,type:`boolean`,category:`tech`,default:!1},closeButtonSkin:{name:`Stil på lukkeknappen`,description:`Stil på lukkeknappen`,type:[`blue`,`yellow-filled`],category:`ui`,default:`blue`},size:{name:`Størrelse`,description:`Størrelsen på modalen`,type:[`small`,`medium`,`large`,`fit-content`],category:`ui`,default:`medium`},variant:{name:`Variant`,description:`Standard dialog eller skuff`,type:[`dialog`,`drawer`],category:`ui`,default:`dialog`},drawerPosition:{name:`Skuffposisjon`,description:`Posisjonen til skuffen`,type:[`left`,`right`],category:`ui`,default:`right`},transparentBackdrop:{name:`Gjennomsiktig bakgrunn`,description:`Bakgrunnen er gjennomsiktig`,type:`boolean`,category:`ui`,default:!1},removePadding:{name:`Fjern padding`,description:`Fjerner paddingen rundt innholdet i modalen`,type:`boolean`,category:`ui`,default:!1}},slots:{default:{description:`Innholdet i meldingen. Her tilbyr vi støtteklasser for å style 1-3 knapper i modalen.`}}},c=class extends r.t{constructor(){super(),this.open=!1,this.headingText=``,this.removePadding=!1,this.hideCloseButton=s.props.hideCloseButton.default,this.closeOnBackdropClick=s.props.closeOnBackdropClick.default,this.closeButtonSkin=`blue`,this.size=s.props.size.default,this.variant=`dialog`,this.drawerPosition=`right`,this.transparentBackdrop=!1,this.dialogRef=i.t(),this._scrollLockToken=a.t(),this._idSuffix=o.n(),this._headingId=`pkt-modal__headingText-${this._idSuffix}`,this._contentId=`pkt-modal__content-${this._idSuffix}`,this._isOpen=!1,this.close=(e,t=!1)=>{if(!this._isOpen)return;this._isOpen=!1,this.open=!1,a.n(this._scrollLockToken,!1);let n=document.activeElement;n&&!this.isElementInViewport(n)&&n.scrollIntoView({behavior:`smooth`,block:`nearest`}),this.dispatchEvent(new CustomEvent(`close`,{detail:{origin:e},bubbles:!0,composed:!0})),t||this.dialogRef.value?.close()},this.showModal=(e=null)=>{this._isOpen=!0,this.open=!0,this.dialogRef.value?.showModal(),a.n(this._scrollLockToken,!0),this.dispatchEvent(new CustomEvent(`showModal`,{detail:{origin:e},bubbles:!0,composed:!0}))},this._isOpen=!1}async connectedCallback(){super.connectedCallback(),document.addEventListener(`keydown`,this.handleKeyDown.bind(this)),document.addEventListener(`click`,this.handleBackdropClick.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`click`,this.handleBackdropClick),a.n(this._scrollLockToken,!1)}updated(e){super.updated(e),e.has(`open`)&&(this.open&&!this._isOpen?this.showModal():!this.open&&this._isOpen&&this.close(new Event(`close`),!1))}async firstUpdated(e){super.firstUpdated(e),this.dialogRef.value&&!window.HTMLDialogElement&&!this.dialogRef.value.showModal&&(`document`in window&&`createElement`in document&&(await Promise.resolve().then(()=>require("./dialog-polyfill.esm-BPk0-8XP.cjs")).then(e=>e.default)).registerDialog(this.dialogRef.value),this.dialogRef.value.addEventListener(`close`,()=>{this.close(new Event(`close`),!0)}))}handleKeyDown(e){e.key===`Escape`&&this.close(e)}handleBackdropClick(e){this.closeOnBackdropClick&&e.target===this.dialogRef?.value&&this.close(e)}isElementInViewport(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){let a={"pkt-modal":!0,"pkt-modal--removePadding":this.removePadding??!1,"pkt-modal--noHeadingText":this.headingText===``||this.headingText===void 0,"pkt-modal--noShadow":this.closeButtonSkin===`yellow-filled`,"pkt-modal--transparentBackdrop":this.transparentBackdrop??!1,[`pkt-modal--${this.size}`]:this.size!==void 0,[`pkt-modal__${this.variant}`]:this.variant!==void 0,[`pkt-modal__drawer--${this.drawerPosition}`]:this.variant===`drawer`},o={"pkt-modal__headingText":!0,"pkt-txt-24":!0,"pkt-modal__headingText--hasIcon":!!this.headingIconName},s=this.headingIconName?n._`<pkt-icon
2
+ class="pkt-modal__headingIcon"
3
+ name=${this.headingIconName}
4
+ path=${t.t(this.headingIconPath)}
5
+ ></pkt-icon>`:n.h,c={"pkt-modal__content":!0,"pkt-txt-18-light":!0},l=this.closeButtonSkin===`blue`,u={"pkt-modal__closeButton":!0,[`pkt-modal__closeButton--${this.closeButtonSkin}`]:!0};return n._`
6
+ <dialog
7
+ class=${e.t(a)}
8
+ ${i.n(this.dialogRef)}
9
+ aria-labelledby=${this.headingText?this._headingId:n.h}
10
+ aria-describedby=${this._contentId}
11
+ @close=${e=>this.close(e,!0)}
12
+ >
13
+ <div class="pkt-modal__wrapper">
14
+ ${this.headingText||!this.hideCloseButton?n._`<div class="pkt-modal__header">
15
+ <div class="pkt-modal__header-background"></div>
16
+ ${this.headingText?n._`<h1 id=${this._headingId} class=${e.t(o)}>
17
+ ${s}${this.headingText}
18
+ </h1>`:n._`<div class="pkt-modal__headingText"></div>`}
19
+ ${this.hideCloseButton?n._`<div class="pkt-modal__noCloseButton"></div>`:n._`<div class="${e.t(u)}">
20
+ <pkt-button
21
+ @click=${e=>this.close(e)}
22
+ aria-label=${this.pktStrings.get(`generic`).close}
23
+ iconname="close"
24
+ variant="icon-only"
25
+ size="medium"
26
+ skin=${l?`tertiary`:`primary`}
27
+ >
28
+ ${this.pktStrings.get(`generic`).close}
29
+ </pkt-button>
30
+ </div>`}
31
+ </div>`:n.h}
32
+ <div class="pkt-modal__container">
33
+ <div id=${this._contentId} class=${e.t(c)}>${r.i(this)}</div>
34
+ </div>
35
+ </div>
36
+ </dialog>
37
+ `}};n.n([n.u({type:Boolean,reflect:!0})],c.prototype,`open`,void 0),n.n([n.u({type:String})],c.prototype,`headingText`,void 0),n.n([n.u({type:String})],c.prototype,`headingIconName`,void 0),n.n([n.u({type:String})],c.prototype,`headingIconPath`,void 0),n.n([n.u({type:Boolean})],c.prototype,`removePadding`,void 0),n.n([n.u({type:Boolean})],c.prototype,`hideCloseButton`,void 0),n.n([n.u({type:Boolean})],c.prototype,`closeOnBackdropClick`,void 0),n.n([n.u({type:String})],c.prototype,`closeButtonSkin`,void 0),n.n([n.u({type:String})],c.prototype,`size`,void 0),n.n([n.u({type:String})],c.prototype,`variant`,void 0),n.n([n.u({type:String})],c.prototype,`drawerPosition`,void 0),n.n([n.u({type:Boolean})],c.prototype,`transparentBackdrop`,void 0);try{n.d(`pkt-modal`)(c)}catch{console.warn(`Forsøker å definere <pkt-modal>, men den er allerede definert`)}var l=c;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});