@oslokommune/punkt-elements 19.5.0 → 19.5.1

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 (153) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/{accordion-CZ0O4c0_.cjs → accordion-5lSFQToJ.cjs} +6 -6
  3. package/dist/{accordion-DFcdonl-.js → accordion-BJh6X1Ek.js} +6 -6
  4. package/dist/{alert-CUOWdvit.js → alert-C0PiYnot.js} +28 -35
  5. package/dist/alert-IaZzEgyI.cjs +39 -0
  6. package/dist/{backlink-vLhK1hsj.cjs → backlink-BRqhwUr2.cjs} +1 -1
  7. package/dist/{button-B0uSFQVn.js → button-B78im4wB.js} +15 -15
  8. package/dist/button-BNVTj7nB.cjs +32 -0
  9. package/dist/{card-CfFW7_-K.js → card-CYKhPUNI.js} +11 -11
  10. package/dist/{card-C15acwk4.cjs → card-CaLEuumN.cjs} +10 -10
  11. package/dist/{checkbox-C0zLtnCI.cjs → checkbox-DIyi1Cya.cjs} +1 -1
  12. package/dist/{checkbox-B2O0fkh9.js → checkbox-DKeErDb5.js} +1 -1
  13. package/dist/{combobox-Bhfh04Su.js → combobox-BKnHg_-E.js} +29 -29
  14. package/dist/{combobox-DvsnfA0c.cjs → combobox-C7FUvv5T.cjs} +22 -22
  15. package/dist/components/alert/alert.d.ts +0 -2
  16. package/dist/{consent-_DBvIRT2.js → consent-CleJMbVH.js} +1 -1
  17. package/dist/{consent-BfLkJbOk.cjs → consent-Dl-R0iC3.cjs} +1 -1
  18. package/dist/{datepicker-BY2IKrPk.js → datepicker-COFEJpB4.js} +9 -9
  19. package/dist/{datepicker-Cg-iueRC.cjs → datepicker-CeUpoQuG.cjs} +27 -27
  20. package/dist/directives/slot-content.d.ts +36 -1
  21. package/dist/element-with-slot-D7sTqOr3.cjs +1 -0
  22. package/dist/{element-with-slot-FD826ooP.js → element-with-slot-DQv0cbbD.js} +80 -21
  23. package/dist/{fileupload-iuXrgrog.js → fileupload-CUPl41uN.js} +31 -31
  24. package/dist/{fileupload-Djp6VJYY.cjs → fileupload-CaZGBvZr.cjs} +21 -21
  25. package/dist/{footer-BCdb0wlF.js → footer-DdLls3F-.js} +13 -13
  26. package/dist/{footer-bTpLxigB.cjs → footer-vy9NqT65.cjs} +9 -9
  27. package/dist/{header-DbSSOX-h.cjs → header-CgP3-6-b.cjs} +50 -50
  28. package/dist/{header-2fF-Zu5T.js → header-Cq6INZmI.js} +55 -55
  29. package/dist/{header-menu-DVYLZyez.js → header-menu-ANj5nL2M.js} +1 -1
  30. package/dist/{header-menu-ChDMnWhW.cjs → header-menu-BfkCp8jw.cjs} +1 -1
  31. package/dist/{heading-BRHCV_5J.js → heading-CUrZvkrM.js} +1 -1
  32. package/dist/{heading-u9Arof4p.cjs → heading-zoz-QZJ9.cjs} +1 -1
  33. package/dist/{helptext-CmsuAXSE.cjs → helptext-BCkwSz1m.cjs} +2 -2
  34. package/dist/{helptext-4TAHKV5_.js → helptext-DCT_9dw1.js} +1 -1
  35. package/dist/{input-element-B1BntJeJ.js → input-element-5hsxasU3.js} +1 -1
  36. package/dist/{input-element-W6Gklt2E.cjs → input-element-Ctkz5fQk.cjs} +1 -1
  37. package/dist/{input-wrapper-B5rqKWSB.cjs → input-wrapper-Cf__-4E-.cjs} +28 -28
  38. package/dist/{input-wrapper-CaMP5-Vm.js → input-wrapper-DACDx6Ie.js} +44 -44
  39. package/dist/{link-CCFAmhL5.js → link-CmZwAw5u.js} +1 -1
  40. package/dist/{link-Bo2o0Akv.cjs → link-LO_5_La8.cjs} +2 -2
  41. package/dist/{linkcard-9L6QF7US.js → linkcard-CQluSyJJ.js} +7 -7
  42. package/dist/{linkcard-D7NbrluR.cjs → linkcard-UKsxADrP.cjs} +3 -3
  43. package/dist/{listbox-DEzd-dxF.js → listbox-Ct9jIV_5.js} +8 -8
  44. package/dist/{listbox-BoBwzL4p.cjs → listbox-g-vHHLkD.cjs} +20 -20
  45. package/dist/{loader-CQaGvyF9.cjs → loader-C_PH05aw.cjs} +2 -2
  46. package/dist/{loader-RQQ_o2aR.js → loader-DzctJ9jW.js} +1 -1
  47. package/dist/{messagebox-C-BQREWz.js → messagebox-DPFBuisE.js} +1 -1
  48. package/dist/{messagebox-BRqI3DW2.cjs → messagebox-JWKMJEFc.cjs} +2 -2
  49. package/dist/{modal-BGTTVHeW.cjs → modal-BymjMIJi.cjs} +2 -2
  50. package/dist/{modal-DCwqqNQc.js → modal-CELmA0-8.js} +1 -1
  51. package/dist/pkt-accordion.cjs +1 -1
  52. package/dist/pkt-accordion.js +1 -1
  53. package/dist/pkt-alert.cjs +1 -1
  54. package/dist/pkt-alert.js +1 -1
  55. package/dist/pkt-backlink.cjs +1 -1
  56. package/dist/pkt-backlink.js +1 -1
  57. package/dist/pkt-button.cjs +1 -1
  58. package/dist/pkt-button.js +1 -1
  59. package/dist/pkt-card.cjs +1 -1
  60. package/dist/pkt-card.js +1 -1
  61. package/dist/pkt-checkbox.cjs +1 -1
  62. package/dist/pkt-checkbox.js +1 -1
  63. package/dist/pkt-combobox.cjs +1 -1
  64. package/dist/pkt-combobox.js +1 -1
  65. package/dist/pkt-consent.cjs +1 -1
  66. package/dist/pkt-consent.js +1 -1
  67. package/dist/pkt-datepicker.cjs +1 -1
  68. package/dist/pkt-datepicker.js +1 -1
  69. package/dist/pkt-fileupload.cjs +1 -1
  70. package/dist/pkt-fileupload.js +1 -1
  71. package/dist/pkt-footer.cjs +1 -1
  72. package/dist/pkt-footer.js +1 -1
  73. package/dist/pkt-header-menu.cjs +1 -1
  74. package/dist/pkt-header-menu.js +1 -1
  75. package/dist/pkt-header.cjs +1 -1
  76. package/dist/pkt-header.js +1 -1
  77. package/dist/pkt-heading.cjs +1 -1
  78. package/dist/pkt-heading.js +1 -1
  79. package/dist/pkt-helptext.cjs +1 -1
  80. package/dist/pkt-helptext.js +1 -1
  81. package/dist/pkt-index.cjs +1 -1
  82. package/dist/pkt-index.js +30 -30
  83. package/dist/pkt-input-wrapper.cjs +1 -1
  84. package/dist/pkt-input-wrapper.js +1 -1
  85. package/dist/pkt-link.cjs +1 -1
  86. package/dist/pkt-link.js +1 -1
  87. package/dist/pkt-linkcard.cjs +1 -1
  88. package/dist/pkt-linkcard.js +1 -1
  89. package/dist/pkt-listbox.cjs +1 -1
  90. package/dist/pkt-listbox.js +1 -1
  91. package/dist/pkt-loader.cjs +1 -1
  92. package/dist/pkt-loader.js +1 -1
  93. package/dist/pkt-messagebox.cjs +1 -1
  94. package/dist/pkt-messagebox.js +1 -1
  95. package/dist/pkt-modal.cjs +1 -1
  96. package/dist/pkt-modal.js +1 -1
  97. package/dist/{pkt-options-controller-Dz-rYCG1.cjs → pkt-options-controller-CpEZcomb.cjs} +1 -1
  98. package/dist/{pkt-options-controller-sUzxHa5A.js → pkt-options-controller-D7l18Iw0.js} +1 -1
  99. package/dist/pkt-progressbar.cjs +1 -1
  100. package/dist/pkt-progressbar.js +1 -1
  101. package/dist/pkt-radiobutton.cjs +1 -1
  102. package/dist/pkt-radiobutton.js +1 -1
  103. package/dist/pkt-searchinput.cjs +1 -1
  104. package/dist/pkt-searchinput.js +1 -1
  105. package/dist/pkt-select.cjs +1 -1
  106. package/dist/pkt-select.js +1 -1
  107. package/dist/pkt-tabs.cjs +1 -1
  108. package/dist/pkt-tabs.js +1 -1
  109. package/dist/pkt-tag.cjs +1 -1
  110. package/dist/pkt-tag.js +1 -1
  111. package/dist/pkt-textarea.cjs +1 -1
  112. package/dist/pkt-textarea.js +1 -1
  113. package/dist/pkt-textinput.cjs +1 -1
  114. package/dist/pkt-textinput.js +1 -1
  115. package/dist/pkt-timepicker.cjs +1 -1
  116. package/dist/pkt-timepicker.js +1 -1
  117. package/dist/{progressbar-CAEQkFpP.cjs → progressbar-CIXNSwTy.cjs} +2 -3
  118. package/dist/{progressbar-DzX0p2vn.js → progressbar-DH5lIBpx.js} +6 -4
  119. package/dist/{radiobutton-B0V-jSEX.js → radiobutton-DP791tUe.js} +1 -1
  120. package/dist/{radiobutton-Cv1BlwLV.cjs → radiobutton-oEYrBiT6.cjs} +1 -1
  121. package/dist/{searchinput-D6vtMUHw.cjs → searchinput-CbClDE-d.cjs} +1 -1
  122. package/dist/{select-C0GafKtu.js → select-B97S4g1v.js} +18 -18
  123. package/dist/{select-Bd6Gg4Ar.cjs → select-QobXCtIL.cjs} +13 -13
  124. package/dist/{tabs-B134M9k2.js → tabs-B8blHQrL.js} +18 -18
  125. package/dist/{tabs-Dw9E06fL.cjs → tabs-CjX-GWvM.cjs} +15 -15
  126. package/dist/tag-B5dUg7AD.cjs +27 -0
  127. package/dist/{tag-CvFakm1k.js → tag-Bns7Xj1O.js} +10 -10
  128. package/dist/{textarea-BZ2ufamc.js → textarea-DgW0hRV5.js} +16 -16
  129. package/dist/{textarea-CeqScqQa.cjs → textarea-ZMbtZNp3.cjs} +10 -10
  130. package/dist/{textinput-L218fT2-.cjs → textinput-DfT_1aGb.cjs} +10 -10
  131. package/dist/{textinput-DI8Tgmep.js → textinput-s-qz2xSC.js} +14 -14
  132. package/dist/{timepicker-ZSHZt0aW.cjs → timepicker-BAa_VEnf.cjs} +10 -10
  133. package/dist/{timepicker-CgXpmG3h.js → timepicker-Crj4isb9.js} +15 -15
  134. package/package.json +2 -2
  135. package/src/components/alert/alert.test.ts +15 -0
  136. package/src/components/alert/alert.ts +0 -12
  137. package/src/components/combobox/combobox.ts +3 -3
  138. package/src/components/datepicker/datepicker.ts +5 -5
  139. package/src/components/helptext/helptext-association.test.ts +79 -0
  140. package/src/components/input-wrapper/input-wrapper.test.ts +49 -0
  141. package/src/components/input-wrapper/input-wrapper.ts +6 -4
  142. package/src/components/progressbar/progressbar.test.ts +19 -0
  143. package/src/components/progressbar/progressbar.ts +2 -6
  144. package/src/components/select/select.ts +3 -3
  145. package/src/components/textarea/textarea.ts +3 -3
  146. package/src/components/textinput/textinput.ts +3 -3
  147. package/src/components/timepicker/timepicker.ts +3 -3
  148. package/dist/alert-DcyO0WfW.cjs +0 -40
  149. package/dist/button-PcKtiNGS.cjs +0 -32
  150. package/dist/element-with-slot-2PHu2w7O.cjs +0 -1
  151. package/dist/tag--kFPXNaj.cjs +0 -27
  152. package/dist/{backlink-DdyQq62f.js → backlink-BslFewn-.js} +1 -1
  153. package/dist/{searchinput-DyjUl08X.js → searchinput-Co8tcq-l.js} +1 -1
@@ -1 +1 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./progressbar-CAEQkFpP.cjs");exports.PktProgressbar=e.n,exports.default=e.t;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./progressbar-CIXNSwTy.cjs");exports.PktProgressbar=e.n,exports.default=e.t;
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./progressbar-DzX0p2vn.js";
1
+ import { n as e, t } from "./progressbar-DH5lIBpx.js";
2
2
  export { e as PktProgressbar, t as default };
@@ -1 +1 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./radiobutton-Cv1BlwLV.cjs");exports.PktRadioButton=e.n,exports.default=e.t;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./radiobutton-oEYrBiT6.cjs");exports.PktRadioButton=e.n,exports.default=e.t;
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./radiobutton-B0V-jSEX.js";
1
+ import { n as e, t } from "./radiobutton-DP791tUe.js";
2
2
  export { e as PktRadioButton, t as default };
@@ -1 +1 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./searchinput-D6vtMUHw.cjs");exports.PktSearchInput=e.n,exports.default=e.t;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./searchinput-CbClDE-d.cjs");exports.PktSearchInput=e.n,exports.default=e.t;
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./searchinput-DyjUl08X.js";
1
+ import { n as e, t } from "./searchinput-Co8tcq-l.js";
2
2
  export { e as PktSearchInput, t as default };
@@ -1 +1 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./select-Bd6Gg4Ar.cjs");exports.PktSelect=e.n,exports.default=e.t;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./select-QobXCtIL.cjs");exports.PktSelect=e.n,exports.default=e.t;
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./select-C0GafKtu.js";
1
+ import { n as e, t } from "./select-B97S4g1v.js";
2
2
  export { e as PktSelect, t as default };
package/dist/pkt-tabs.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./tabs-Dw9E06fL.cjs");exports.PktTabItem=e.n,exports.PktTabs=e.r,exports.default=e.t;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./tabs-CjX-GWvM.cjs");exports.PktTabItem=e.n,exports.PktTabs=e.r,exports.default=e.t;
package/dist/pkt-tabs.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as e, r as t, t as n } from "./tabs-B134M9k2.js";
1
+ import { n as e, r as t, t as n } from "./tabs-B8blHQrL.js";
2
2
  export { e as PktTabItem, t as PktTabs, n as default };
package/dist/pkt-tag.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./tag--kFPXNaj.cjs");exports.PktTag=e.n,exports.default=e.t;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./tag-B5dUg7AD.cjs");exports.PktTag=e.n,exports.default=e.t;
package/dist/pkt-tag.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./tag-CvFakm1k.js";
1
+ import { n as e, t } from "./tag-Bns7Xj1O.js";
2
2
  export { e as PktTag, t as default };
@@ -1 +1 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./textarea-CeqScqQa.cjs");exports.PktTextarea=e.n,exports.default=e.t;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./textarea-ZMbtZNp3.cjs");exports.PktTextarea=e.n,exports.default=e.t;
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./textarea-BZ2ufamc.js";
1
+ import { n as e, t } from "./textarea-DgW0hRV5.js";
2
2
  export { e as PktTextarea, t as default };
@@ -1 +1 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./textinput-L218fT2-.cjs");exports.PktTextinput=e.n,exports.default=e.t;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./textinput-DfT_1aGb.cjs");exports.PktTextinput=e.n,exports.default=e.t;
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./textinput-DI8Tgmep.js";
1
+ import { n as e, t } from "./textinput-s-qz2xSC.js";
2
2
  export { e as PktTextinput, t as default };
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./timepicker-ZSHZt0aW.cjs");exports.PktTimepicker=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./timepicker-BAa_VEnf.cjs");exports.PktTimepicker=e.t;
@@ -1,2 +1,2 @@
1
- import { t as e } from "./timepicker-CgXpmG3h.js";
1
+ import { t as e } from "./timepicker-Crj4isb9.js";
2
2
  export { e as PktTimepicker };
@@ -1,6 +1,5 @@
1
- const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),n=require("./if-defined-2mkIDgOm.cjs");require("./icon-Dnv6LtPC.cjs");const r=require("./ref-Emu5PNxk.cjs"),i=require("./utils-63cRpWut.cjs");var a=`important`,o=` !`+a,s=e.f(class extends e.p{constructor(t){if(super(t),t.type!==e.m.ATTRIBUTE||t.name!==`style`||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce((t,n)=>{let r=e[n];return r==null?t:t+`${n=n.includes(`-`)?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,`-$&`).toLowerCase()}:${r};`},``)}update(t,[n]){let{style:r}=t.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(n)),this.render(n);for(let e of this.ft)n[e]??(this.ft.delete(e),e.includes(`-`)?r.removeProperty(e):r[e]=null);for(let e in n){let t=n[e];if(t!=null){this.ft.add(e);let n=typeof t==`string`&&t.endsWith(o);e.includes(`-`)||n?r.setProperty(e,n?t.slice(0,-11):t,n?a:``):r[e]=t}}return e.g}}),c=class extends e.t{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive=`polite`,this.id=i.n(),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.resolvedRole=`progressbar`,this.labelRef=r.t(),this.progressBarRef=r.t()}willUpdate(e){super.willUpdate(e),this.hasAttribute(`id`)?(this.progressbarId=this.getAttribute(`id`)||this.progressbarId,this.removeAttribute(`id`)):this.id&&(this.progressbarId=this.id);let t=this.getAttribute(`role`);t?(this.resolvedRole=t,this.removeAttribute(`role`)):this.role&&(this.resolvedRole=this.role)}updated(e){super.updated(e),e.has(`valueCurrent`)&&this.labelRef.value&&(this.labelWidth=this.labelRef.value.getBoundingClientRect().width||0)}render(){let i=this.statusType!==`none`,a=this.valueMax-this.valueMin,o=this.valueCurrent/a*100,c=this.statusType===`fraction`?Math.round(o):Math.round((this.valueCurrent-this.valueMin)/(this.valueMax-this.valueMin)*100),l=`${this.valueCurrent} av ${a}`,u=this.statusType===`fraction`&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||``,d=this.ariaLabel?void 0:this.ariaLabelledby||`${this.progressbarId}-title`,f=t.t({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),p=t.t({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition===`center`}),m=t.t({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement===`center`}),h=t.t({"pkt-progressbar__status-placement--following":this.statusPlacement===`following`,"pkt-progressbar__status-placement--center":this.statusPlacement===`center`,"pkt-progressbar__status-placement--left":this.statusPlacement===`left`});return e._`<div
1
+ const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs");require("./icon-Dnv6LtPC.cjs");const n=require("./if-defined-2mkIDgOm.cjs"),r=require("./ref-Emu5PNxk.cjs"),i=require("./utils-63cRpWut.cjs");var a=`important`,o=` !`+a,s=e.f(class extends e.p{constructor(t){if(super(t),t.type!==e.m.ATTRIBUTE||t.name!==`style`||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce((t,n)=>{let r=e[n];return r==null?t:t+`${n=n.includes(`-`)?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,`-$&`).toLowerCase()}:${r};`},``)}update(t,[n]){let{style:r}=t.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(n)),this.render(n);for(let e of this.ft)n[e]??(this.ft.delete(e),e.includes(`-`)?r.removeProperty(e):r[e]=null);for(let e in n){let t=n[e];if(t!=null){this.ft.add(e);let n=typeof t==`string`&&t.endsWith(o);e.includes(`-`)||n?r.setProperty(e,n?t.slice(0,-11):t,n?a:``):r[e]=t}}return e.g}}),c=class extends e.t{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive=`polite`,this.id=i.n(),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.resolvedRole=`progressbar`,this.labelRef=r.t(),this.progressBarRef=r.t()}willUpdate(e){super.willUpdate(e),this.id&&(this.progressbarId=this.id);let t=this.getAttribute(`role`);t?(this.resolvedRole=t,this.removeAttribute(`role`)):this.role&&(this.resolvedRole=this.role)}updated(e){super.updated(e),e.has(`valueCurrent`)&&this.labelRef.value&&(this.labelWidth=this.labelRef.value.getBoundingClientRect().width||0)}render(){let i=this.statusType!==`none`,a=this.valueMax-this.valueMin,o=this.valueCurrent/a*100,c=this.statusType===`fraction`?Math.round(o):Math.round((this.valueCurrent-this.valueMin)/(this.valueMax-this.valueMin)*100),l=`${this.valueCurrent} av ${a}`,u=this.statusType===`fraction`&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||``,d=this.ariaLabel?void 0:this.ariaLabelledby||`${this.progressbarId}-title`,f=t.t({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),p=t.t({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition===`center`}),m=t.t({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement===`center`}),h=t.t({"pkt-progressbar__status-placement--following":this.statusPlacement===`following`,"pkt-progressbar__status-placement--center":this.statusPlacement===`center`,"pkt-progressbar__status-placement--left":this.statusPlacement===`left`});return e._`<div
2
2
  ${r.n(this.progressBarRef)}
3
- id=${this.progressbarId}
4
3
  role=${this.resolvedRole}
5
4
  aria-live=${n.t(this.ariaLive||void 0)}
6
5
  aria-atomic="true"
@@ -28,4 +27,4 @@ const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),
28
27
  </span>
29
28
  </div>`:e.h}
30
29
  </div>
31
- </div>`}};e.n([e.u({type:String})],c.prototype,`ariaLabel`,void 0),e.n([e.u({type:String,reflect:!0})],c.prototype,`ariaLabelledby`,void 0),e.n([e.u({type:String,reflect:!0})],c.prototype,`ariaValueText`,void 0),e.n([e.u({type:String})],c.prototype,`ariaLive`,void 0),e.n([e.u({type:String})],c.prototype,`id`,void 0),e.n([e.u({type:String})],c.prototype,`role`,void 0),e.n([e.u({type:String})],c.prototype,`skin`,void 0),e.n([e.u({type:String})],c.prototype,`statusPlacement`,void 0),e.n([e.u({type:String})],c.prototype,`statusType`,void 0),e.n([e.u({type:String,reflect:!0})],c.prototype,`title`,void 0),e.n([e.u({type:String})],c.prototype,`titlePosition`,void 0),e.n([e.u({type:Number,reflect:!0})],c.prototype,`valueCurrent`,void 0),e.n([e.u({type:Number})],c.prototype,`valueMax`,void 0),e.n([e.u({type:Number})],c.prototype,`valueMin`,void 0),e.n([e.l()],c.prototype,`labelWidth`,void 0),e.n([e.l()],c.prototype,`progressbarId`,void 0),e.n([e.l()],c.prototype,`resolvedRole`,void 0);try{e.d(`pkt-progressbar`)(c)}catch{console.warn(`Forsøker å definere <pkt-progressbar>, 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}});
30
+ </div>`}};e.n([e.u({type:String})],c.prototype,`ariaLabel`,void 0),e.n([e.u({type:String,reflect:!0})],c.prototype,`ariaLabelledby`,void 0),e.n([e.u({type:String,reflect:!0})],c.prototype,`ariaValueText`,void 0),e.n([e.u({type:String})],c.prototype,`ariaLive`,void 0),e.n([e.u({type:String,reflect:!0})],c.prototype,`id`,void 0),e.n([e.u({type:String})],c.prototype,`role`,void 0),e.n([e.u({type:String})],c.prototype,`skin`,void 0),e.n([e.u({type:String})],c.prototype,`statusPlacement`,void 0),e.n([e.u({type:String})],c.prototype,`statusType`,void 0),e.n([e.u({type:String,reflect:!0})],c.prototype,`title`,void 0),e.n([e.u({type:String})],c.prototype,`titlePosition`,void 0),e.n([e.u({type:Number,reflect:!0})],c.prototype,`valueCurrent`,void 0),e.n([e.u({type:Number})],c.prototype,`valueMax`,void 0),e.n([e.u({type:Number})],c.prototype,`valueMin`,void 0),e.n([e.l()],c.prototype,`labelWidth`,void 0),e.n([e.l()],c.prototype,`progressbarId`,void 0),e.n([e.l()],c.prototype,`resolvedRole`,void 0);try{e.d(`pkt-progressbar`)(c)}catch{console.warn(`Forsøker å definere <pkt-progressbar>, 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,7 +1,7 @@
1
1
  import { _ as e, d as t, f as n, g as r, h as i, l as a, m as o, n as s, p as c, t as l, u } from "./element-mwwC2Rra.js";
2
2
  import { t as d } from "./class-map-C4hdfSfY.js";
3
- import { t as f } from "./if-defined-Bebu3LXY.js";
4
3
  import "./icon-JigbxxF7.js";
4
+ import { t as f } from "./if-defined-Bebu3LXY.js";
5
5
  import { n as p, t as m } from "./ref-CCSGk4MP.js";
6
6
  import { n as h } from "./utils-BwF4QSrq.js";
7
7
  //#region ../../node_modules/lit-html/directives/style-map.js
@@ -34,7 +34,7 @@ var g = "important", _ = " !" + g, v = n(class extends c {
34
34
  super(), this.ariaLabel = null, this.ariaLabelledby = null, this.ariaValueText = null, this.ariaLive = "polite", this.id = h(), 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.resolvedRole = "progressbar", this.labelRef = m(), this.progressBarRef = m();
35
35
  }
36
36
  willUpdate(e) {
37
- super.willUpdate(e), this.hasAttribute("id") ? (this.progressbarId = this.getAttribute("id") || this.progressbarId, this.removeAttribute("id")) : this.id && (this.progressbarId = this.id);
37
+ super.willUpdate(e), this.id && (this.progressbarId = this.id);
38
38
  let t = this.getAttribute("role");
39
39
  t ? (this.resolvedRole = t, this.removeAttribute("role")) : this.role && (this.resolvedRole = this.role);
40
40
  }
@@ -58,7 +58,6 @@ var g = "important", _ = " !" + g, v = n(class extends c {
58
58
  });
59
59
  return e`<div
60
60
  ${p(this.progressBarRef)}
61
- id=${this.progressbarId}
62
61
  role=${this.resolvedRole}
63
62
  aria-live=${f(this.ariaLive || void 0)}
64
63
  aria-atomic="true"
@@ -98,7 +97,10 @@ s([u({ type: String })], y.prototype, "ariaLabel", void 0), s([u({
98
97
  })], y.prototype, "ariaLabelledby", void 0), s([u({
99
98
  type: String,
100
99
  reflect: !0
101
- })], y.prototype, "ariaValueText", void 0), s([u({ type: String })], y.prototype, "ariaLive", void 0), s([u({ type: String })], y.prototype, "id", void 0), s([u({ type: String })], y.prototype, "role", void 0), s([u({ type: String })], y.prototype, "skin", void 0), s([u({ type: String })], y.prototype, "statusPlacement", void 0), s([u({ type: String })], y.prototype, "statusType", void 0), s([u({
100
+ })], y.prototype, "ariaValueText", void 0), s([u({ type: String })], y.prototype, "ariaLive", void 0), s([u({
101
+ type: String,
102
+ reflect: !0
103
+ })], y.prototype, "id", void 0), s([u({ type: String })], y.prototype, "role", void 0), s([u({ type: String })], y.prototype, "skin", void 0), s([u({ type: String })], y.prototype, "statusPlacement", void 0), s([u({ type: String })], y.prototype, "statusType", void 0), s([u({
102
104
  type: String,
103
105
  reflect: !0
104
106
  })], y.prototype, "title", void 0), s([u({ type: String })], y.prototype, "titlePosition", void 0), s([u({
@@ -1,7 +1,7 @@
1
1
  import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-mwwC2Rra.js";
2
2
  import { t as o } from "./class-map-C4hdfSfY.js";
3
3
  import { n as s, t as c } from "./ref-CCSGk4MP.js";
4
- import { t as l } from "./input-element-B1BntJeJ.js";
4
+ import { t as l } from "./input-element-5hsxasU3.js";
5
5
  //#region src/components/radiobutton/radiobutton.ts
6
6
  var u = class extends l {
7
7
  constructor(...e) {
@@ -1,4 +1,4 @@
1
- const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),n=require("./ref-Emu5PNxk.cjs"),r=require("./input-element-W6Gklt2E.cjs");var i=class extends r.t{constructor(...e){super(...e),this.inputRef=n.t(),this.value=``,this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.checked=null,this.type=`radio`,this.tagText=null,this.optionalTag=!1,this.requiredTag=!1,this._checked=!1}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,t,n){e===`defaultChecked`&&(this._checked=this.defaultChecked),e===`checked`&&(this._checked=this.checked===``||this.checked===`true`||this.checked===!0),super.attributeChangedCallback(e,t,n)}render(){let r=t.t({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),i=t.t({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),a=t.t({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-sr-only":this.hideLabel}),o=`pkt-tag pkt-tag--small pkt-tag--thin-text`,s=this.pktStrings.get(`forms`),c=()=>e._`
1
+ const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),n=require("./ref-Emu5PNxk.cjs"),r=require("./input-element-Ctkz5fQk.cjs");var i=class extends r.t{constructor(...e){super(...e),this.inputRef=n.t(),this.value=``,this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.checked=null,this.type=`radio`,this.tagText=null,this.optionalTag=!1,this.requiredTag=!1,this._checked=!1}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,t,n){e===`defaultChecked`&&(this._checked=this.defaultChecked),e===`checked`&&(this._checked=this.checked===``||this.checked===`true`||this.checked===!0),super.attributeChangedCallback(e,t,n)}render(){let r=t.t({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),i=t.t({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),a=t.t({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-sr-only":this.hideLabel}),o=`pkt-tag pkt-tag--small pkt-tag--thin-text`,s=this.pktStrings.get(`forms`),c=()=>e._`
2
2
  ${this.tagText?e._`<span class=${o+` pkt-tag--gray`}>${this.tagText}</span>`:e.h}
3
3
  ${this.optionalTag?e._`<span class=${o+` pkt-tag--blue-light`}
4
4
  >${this.optionalText??s.optional}</span
@@ -1,4 +1,4 @@
1
- const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),n=require("./if-defined-2mkIDgOm.cjs");require("./icon-Dnv6LtPC.cjs");const r=require("./utils-63cRpWut.cjs"),i=require("./focus-modality-controller-C1ocyv2J.cjs");var a=class extends e.t{constructor(...e){super(...e),this.appearance=`local`,this.inputSize=`medium`,this.disabled=!1,this.fullwidth=!1,this.id=r.n(),this.value=``,this.focusModality=new i.t(this,`.pkt-searchinput`)}willUpdate(e){super.willUpdate(e);let t=this.getAttribute(`aria-label`);t&&(this.inputAriaLabel=t,this.removeAttribute(`aria-label`))}get suggestionsId(){return`${this.id}-suggestions`}dispatchSearch(){this.dispatchEvent(new CustomEvent(`pkt-search`,{detail:{value:this.value},bubbles:!0,composed:!0}))}onInput(e){let t=e.target;this.value=t.value}onInputKeydown(e){e.key===`Enter`&&(this.action||e.preventDefault(),this.dispatchSearch())}onSearchClick(e){this.action||e.preventDefault(),this.dispatchSearch()}onSuggestionClick(e,t,n){let r=new CustomEvent(`pkt-suggestion-click`,{detail:{index:n,suggestion:t},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(r)||e.preventDefault()}renderSuggestion(t,n){let r=e._`
1
+ const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs");require("./icon-Dnv6LtPC.cjs");const n=require("./if-defined-2mkIDgOm.cjs"),r=require("./utils-63cRpWut.cjs"),i=require("./focus-modality-controller-C1ocyv2J.cjs");var a=class extends e.t{constructor(...e){super(...e),this.appearance=`local`,this.inputSize=`medium`,this.disabled=!1,this.fullwidth=!1,this.id=r.n(),this.value=``,this.focusModality=new i.t(this,`.pkt-searchinput`)}willUpdate(e){super.willUpdate(e);let t=this.getAttribute(`aria-label`);t&&(this.inputAriaLabel=t,this.removeAttribute(`aria-label`))}get suggestionsId(){return`${this.id}-suggestions`}dispatchSearch(){this.dispatchEvent(new CustomEvent(`pkt-search`,{detail:{value:this.value},bubbles:!0,composed:!0}))}onInput(e){let t=e.target;this.value=t.value}onInputKeydown(e){e.key===`Enter`&&(this.action||e.preventDefault(),this.dispatchSearch())}onSearchClick(e){this.action||e.preventDefault(),this.dispatchSearch()}onSuggestionClick(e,t,n){let r=new CustomEvent(`pkt-suggestion-click`,{detail:{index:n,suggestion:t},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(r)||e.preventDefault()}renderSuggestion(t,n){let r=e._`
2
2
  ${t.title?e._`<h3 class="pkt-searchinput__suggestion-title">${t.title}</h3>`:e.h}
3
3
  ${t.text?e._`<p class="pkt-searchinput__suggestion-text">${t.text}</p>`:e.h}
4
4
  `;return t.href?e._`<a
@@ -1,10 +1,10 @@
1
1
  import { _ as e, d as t, l as n, n as r, u as i } from "./element-mwwC2Rra.js";
2
- import { t as a } from "./if-defined-Bebu3LXY.js";
3
- import { r as o } from "./element-with-slot-FD826ooP.js";
2
+ import { n as a } from "./element-with-slot-DQv0cbbD.js";
3
+ import { t as o } from "./if-defined-Bebu3LXY.js";
4
4
  import { n as s, t as c } from "./ref-CCSGk4MP.js";
5
- import { t as l } from "./input-element-B1BntJeJ.js";
6
- import { t as u } from "./pkt-options-controller-sUzxHa5A.js";
7
- import { r as d } from "./input-wrapper-CaMP5-Vm.js";
5
+ import { t as l } from "./input-element-5hsxasU3.js";
6
+ import { t as u } from "./pkt-options-controller-D7l18Iw0.js";
7
+ import { r as d } from "./input-wrapper-DACDx6Ie.js";
8
8
  //#region src/base-elements/options-input-element.ts
9
9
  var f = class extends l {
10
10
  constructor(...e) {
@@ -91,6 +91,7 @@ var p = class extends f {
91
91
  let t = `pkt-input pkt-input--${this.inputSize} ${this.fullwidth ? "pkt-input--fullwidth" : ""}`;
92
92
  return e`
93
93
  <pkt-input-wrapper
94
+ ${a(this, ["helptext"])}
94
95
  .strings=${this.strings}
95
96
  .size=${this.inputSize}
96
97
  ?disabled=${this.disabled}
@@ -101,27 +102,27 @@ var p = class extends f {
101
102
  ?requiredTag=${this.requiredTag}
102
103
  useWrapper=${this.useWrapper}
103
104
  .ariaDescribedby=${this.ariaDescribedby}
104
- errorMessage=${a(this.errorMessage)}
105
+ errorMessage=${o(this.errorMessage)}
105
106
  forId=${this.id + "-input"}
106
- helptext=${a(this.helptext)}
107
- helptextDropdown=${a(this.helptextDropdown)}
108
- helptextDropdownButton=${a(this.helptextDropdownButton)}
109
- label=${a(this.label)}
110
- optionalText=${a(this.optionalText)}
111
- requiredText=${a(this.requiredText)}
112
- tagText=${a(this.tagText)}
107
+ helptext=${o(this.helptext)}
108
+ helptextDropdown=${o(this.helptextDropdown)}
109
+ helptextDropdownButton=${o(this.helptextDropdownButton)}
110
+ label=${o(this.label)}
111
+ optionalText=${o(this.optionalText)}
112
+ requiredText=${o(this.requiredText)}
113
+ tagText=${o(this.tagText)}
113
114
  >
114
115
  <select
115
116
  class=${t}
116
117
  aria-invalid=${this.hasError}
117
- aria-errormessage=${a(this.hasError ? `${this.id}-input-error` : void 0)}
118
- aria-describedby=${a(d({
118
+ aria-errormessage=${o(this.hasError ? `${this.id}-input-error` : void 0)}
119
+ aria-describedby=${o(d({
119
120
  id: this.id + "-input",
120
- hasHelptext: !!this.helptext,
121
+ hasHelptext: !!this.helptext || this.hasSlotContent("helptext"),
121
122
  hasCounter: !1,
122
123
  ariaDescribedby: this.ariaDescribedby
123
124
  }))}
124
- aria-labelledby=${a(this.ariaLabelledby)}
125
+ aria-labelledby=${o(this.ariaLabelledby)}
125
126
  ?disabled=${this.disabled}
126
127
  id=${this.id + "-input"}
127
128
  name=${(this.name || this.id) + "-input"}
@@ -148,7 +149,6 @@ var p = class extends f {
148
149
  ${t.label}
149
150
  </option>`) : ""}
150
151
  </select>
151
- <div class="pkt-contents" slot="helptext">${o(this, "helptext")}</div>
152
152
  </pkt-input-wrapper>
153
153
  `;
154
154
  }
@@ -1,5 +1,6 @@
1
- const e=require("./element-BOmr9YLv.cjs"),t=require("./if-defined-2mkIDgOm.cjs"),n=require("./element-with-slot-2PHu2w7O.cjs"),r=require("./ref-Emu5PNxk.cjs"),i=require("./input-element-W6Gklt2E.cjs"),a=require("./pkt-options-controller-Dz-rYCG1.cjs"),o=require("./input-wrapper-B5rqKWSB.cjs");var s=class extends i.t{constructor(...e){super(...e),this._optionsProp=[],this._options=[]}get options(){return this._options.map(e=>({...e,selected:this.isOptionSelected(e)}))}set options(e){this._optionsProp=e,this.requestUpdate(`_optionsProp`,this._options)}isOptionSelected(e){return Array.isArray(this.value)?this.value.includes(e.value):e.value===this.value}findOptionByValue(e){return this._options.find(t=>t.value===e)}getSelectedOptions(){return this._options.filter(e=>this.isOptionSelected(e))}parseOptions(){let e=this._optionsProp.length>0,t=this.optionsController?.nodes?.length&&this.optionsController.nodes.length>0;e?this._options=this._optionsProp:t&&(this._options=this.optionsController.options)}willUpdate(e){super.willUpdate(e),this.parseOptions()}};e.n([e.u({type:Array,attribute:`options`})],s.prototype,`_optionsProp`,void 0),e.n([e.l()],s.prototype,`_options`,void 0);var c=class extends s{constructor(){super(),this.inputRef=r.t(),this.value=``,this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new a.t(this)}connectedCallback(){super.connectedCallback(),this.parseOptions(),this._options.forEach(e=>{e.selected&&!this.value&&(this.value=e.value)})}add(e,t){let n={value:e.value||e.text,label:e.text||e.value,selected:e.selected,disabled:e.disabled};if(t===void 0)this._options.push(n);else if(typeof t==`number`)this._options.splice(t,0,n);else{let e=t.value||t.text,r=this._options.findIndex(t=>t.value===e);r>=0?this._options.splice(r,0,n):this._options.push(n)}e.selected&&(this.value=e.value||e.text,this.selectedIndex=this._options.findIndex(e=>e.value===this.value)),this.requestUpdate()}remove(e){typeof e==`number`&&(this.selectedIndex===e&&(this.value=this._options[0]?.value||``),this._options.splice(e,1),this.requestUpdate())}item(e){return this.inputRef.value?.item(e)}namedItem(e){return this.inputRef.value?.namedItem(e)}showPicker(){this.inputRef.value&&`showPicker`in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(e,t,n){e===`options`&&(this._options=n?JSON.parse(n):[]),e===`value`&&this.value!==t&&(this.selectedIndex=this.touched?this.returnNumberOrNull(this.inputRef.value?.selectedIndex):this._options.findIndex(e=>e.value===n),this.selectedOptions=this.inputRef.value?.selectedOptions,this.valueChanged(n,t)),super.attributeChangedCallback(e,t,n)}update(e){super.update(e),e.has(`_optionsProp`)&&this._optionsProp.length>0&&(this._options=this._optionsProp,this.requestUpdate(`_options`),!this.value&&this._options.length>0&&(this.value=this._options[0].value,this.selectedIndex=0)),e.has(`value`)&&this.value!==e.get(`value`)&&(this.selectedIndex=this.touched?this.returnNumberOrNull(this.inputRef.value?.selectedIndex):this._options.findIndex(e=>e.value===this.value),this.selectedOptions=this.inputRef.value?.selectedOptions,this.valueChanged(this.value,e.get(`value`))),e.has(`id`)&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(e){super.firstUpdated(e),this.classList.add(`pkt-select`),this._optionsProp.length&&(this._options=this._optionsProp),!this.value&&this._options.length>0?(this.value=this._options[0].value,this.selectedIndex=0):this.selectedIndex=this._options.findIndex(e=>e.value===this.value),this.selectedOptions=this.inputRef.value?.selectedOptions}render(){let i=`pkt-input pkt-input--${this.inputSize} ${this.fullwidth?`pkt-input--fullwidth`:``}`;return e._`
1
+ const e=require("./element-BOmr9YLv.cjs"),t=require("./element-with-slot-D7sTqOr3.cjs"),n=require("./if-defined-2mkIDgOm.cjs"),r=require("./ref-Emu5PNxk.cjs"),i=require("./input-element-Ctkz5fQk.cjs"),a=require("./pkt-options-controller-CpEZcomb.cjs"),o=require("./input-wrapper-Cf__-4E-.cjs");var s=class extends i.t{constructor(...e){super(...e),this._optionsProp=[],this._options=[]}get options(){return this._options.map(e=>({...e,selected:this.isOptionSelected(e)}))}set options(e){this._optionsProp=e,this.requestUpdate(`_optionsProp`,this._options)}isOptionSelected(e){return Array.isArray(this.value)?this.value.includes(e.value):e.value===this.value}findOptionByValue(e){return this._options.find(t=>t.value===e)}getSelectedOptions(){return this._options.filter(e=>this.isOptionSelected(e))}parseOptions(){let e=this._optionsProp.length>0,t=this.optionsController?.nodes?.length&&this.optionsController.nodes.length>0;e?this._options=this._optionsProp:t&&(this._options=this.optionsController.options)}willUpdate(e){super.willUpdate(e),this.parseOptions()}};e.n([e.u({type:Array,attribute:`options`})],s.prototype,`_optionsProp`,void 0),e.n([e.l()],s.prototype,`_options`,void 0);var c=class extends s{constructor(){super(),this.inputRef=r.t(),this.value=``,this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new a.t(this)}connectedCallback(){super.connectedCallback(),this.parseOptions(),this._options.forEach(e=>{e.selected&&!this.value&&(this.value=e.value)})}add(e,t){let n={value:e.value||e.text,label:e.text||e.value,selected:e.selected,disabled:e.disabled};if(t===void 0)this._options.push(n);else if(typeof t==`number`)this._options.splice(t,0,n);else{let e=t.value||t.text,r=this._options.findIndex(t=>t.value===e);r>=0?this._options.splice(r,0,n):this._options.push(n)}e.selected&&(this.value=e.value||e.text,this.selectedIndex=this._options.findIndex(e=>e.value===this.value)),this.requestUpdate()}remove(e){typeof e==`number`&&(this.selectedIndex===e&&(this.value=this._options[0]?.value||``),this._options.splice(e,1),this.requestUpdate())}item(e){return this.inputRef.value?.item(e)}namedItem(e){return this.inputRef.value?.namedItem(e)}showPicker(){this.inputRef.value&&`showPicker`in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(e,t,n){e===`options`&&(this._options=n?JSON.parse(n):[]),e===`value`&&this.value!==t&&(this.selectedIndex=this.touched?this.returnNumberOrNull(this.inputRef.value?.selectedIndex):this._options.findIndex(e=>e.value===n),this.selectedOptions=this.inputRef.value?.selectedOptions,this.valueChanged(n,t)),super.attributeChangedCallback(e,t,n)}update(e){super.update(e),e.has(`_optionsProp`)&&this._optionsProp.length>0&&(this._options=this._optionsProp,this.requestUpdate(`_options`),!this.value&&this._options.length>0&&(this.value=this._options[0].value,this.selectedIndex=0)),e.has(`value`)&&this.value!==e.get(`value`)&&(this.selectedIndex=this.touched?this.returnNumberOrNull(this.inputRef.value?.selectedIndex):this._options.findIndex(e=>e.value===this.value),this.selectedOptions=this.inputRef.value?.selectedOptions,this.valueChanged(this.value,e.get(`value`))),e.has(`id`)&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(e){super.firstUpdated(e),this.classList.add(`pkt-select`),this._optionsProp.length&&(this._options=this._optionsProp),!this.value&&this._options.length>0?(this.value=this._options[0].value,this.selectedIndex=0):this.selectedIndex=this._options.findIndex(e=>e.value===this.value),this.selectedOptions=this.inputRef.value?.selectedOptions}render(){let i=`pkt-input pkt-input--${this.inputSize} ${this.fullwidth?`pkt-input--fullwidth`:``}`;return e._`
2
2
  <pkt-input-wrapper
3
+ ${t.n(this,[`helptext`])}
3
4
  .strings=${this.strings}
4
5
  .size=${this.inputSize}
5
6
  ?disabled=${this.disabled}
@@ -10,22 +11,22 @@ const e=require("./element-BOmr9YLv.cjs"),t=require("./if-defined-2mkIDgOm.cjs")
10
11
  ?requiredTag=${this.requiredTag}
11
12
  useWrapper=${this.useWrapper}
12
13
  .ariaDescribedby=${this.ariaDescribedby}
13
- errorMessage=${t.t(this.errorMessage)}
14
+ errorMessage=${n.t(this.errorMessage)}
14
15
  forId=${this.id+`-input`}
15
- helptext=${t.t(this.helptext)}
16
- helptextDropdown=${t.t(this.helptextDropdown)}
17
- helptextDropdownButton=${t.t(this.helptextDropdownButton)}
18
- label=${t.t(this.label)}
19
- optionalText=${t.t(this.optionalText)}
20
- requiredText=${t.t(this.requiredText)}
21
- tagText=${t.t(this.tagText)}
16
+ helptext=${n.t(this.helptext)}
17
+ helptextDropdown=${n.t(this.helptextDropdown)}
18
+ helptextDropdownButton=${n.t(this.helptextDropdownButton)}
19
+ label=${n.t(this.label)}
20
+ optionalText=${n.t(this.optionalText)}
21
+ requiredText=${n.t(this.requiredText)}
22
+ tagText=${n.t(this.tagText)}
22
23
  >
23
24
  <select
24
25
  class=${i}
25
26
  aria-invalid=${this.hasError}
26
- aria-errormessage=${t.t(this.hasError?`${this.id}-input-error`:void 0)}
27
- aria-describedby=${t.t(o.r({id:this.id+`-input`,hasHelptext:!!this.helptext,hasCounter:!1,ariaDescribedby:this.ariaDescribedby}))}
28
- aria-labelledby=${t.t(this.ariaLabelledby)}
27
+ aria-errormessage=${n.t(this.hasError?`${this.id}-input-error`:void 0)}
28
+ aria-describedby=${n.t(o.r({id:this.id+`-input`,hasHelptext:!!this.helptext||this.hasSlotContent(`helptext`),hasCounter:!1,ariaDescribedby:this.ariaDescribedby}))}
29
+ aria-labelledby=${n.t(this.ariaLabelledby)}
29
30
  ?disabled=${this.disabled}
30
31
  id=${this.id+`-input`}
31
32
  name=${(this.name||this.id)+`-input`}
@@ -44,6 +45,5 @@ const e=require("./element-BOmr9YLv.cjs"),t=require("./if-defined-2mkIDgOm.cjs")
44
45
  ${t.label}
45
46
  </option>`):``}
46
47
  </select>
47
- <div class="pkt-contents" slot="helptext">${n.r(this,`helptext`)}</div>
48
48
  </pkt-input-wrapper>
49
49
  `}returnNumberOrNull(e){return e==null||isNaN(e)?null:e}};e.n([e.u({type:String})],c.prototype,`value`,void 0);try{e.d(`pkt-select`)(c)}catch{console.warn(`Forsøker å definere <pkt-select>, 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,10 +1,10 @@
1
1
  import { _ as e, d as t, l as n, n as r, u as i } from "./element-mwwC2Rra.js";
2
- import { t as a } from "./if-defined-Bebu3LXY.js";
3
- import { r as o, t as s } from "./element-with-slot-FD826ooP.js";
2
+ import { i as a, t as o } from "./element-with-slot-DQv0cbbD.js";
3
+ import { t as s } from "./if-defined-Bebu3LXY.js";
4
4
  import { n as c, r as l, t as u } from "./consume-BDnMAp2g.js";
5
5
  import { n as d, t as f } from "./ref-CCSGk4MP.js";
6
6
  //#region src/components/tabs/tabs-context.ts
7
- var p = l(Symbol("pkt-tabs-context")), m = class extends s {
7
+ var p = l(Symbol("pkt-tabs-context")), m = class extends o {
8
8
  constructor(...e) {
9
9
  super(...e), this.arrowNav = !0, this.disableArrowNav = !1, this.separatorIconName = "", this.separatorIconPath = "", this.tabRefs = [], this.disabledMap = {}, this.tabCount = 0, this.context = {
10
10
  useArrowNav: this.useArrowNav,
@@ -81,7 +81,7 @@ var p = l(Symbol("pkt-tabs-context")), m = class extends s {
81
81
  let t = this.useArrowNav ? "tablist" : "navigation", n = this.separatorIconName || this.separatorIconPath ? "pkt-tabs pkt-tabs--with-separator" : "pkt-tabs";
82
82
  return e`
83
83
  <div class=${n}>
84
- <div class="pkt-tabs__list" role=${t}>${o(this)}</div>
84
+ <div class="pkt-tabs__list" role=${t}>${a(this)}</div>
85
85
  </div>
86
86
  `;
87
87
  }
@@ -110,7 +110,7 @@ try {
110
110
  }
111
111
  //#endregion
112
112
  //#region src/components/tabs/tabitem.ts
113
- var h = class extends s {
113
+ var h = class extends o {
114
114
  constructor() {
115
115
  super(), this.active = !1, this.disabled = !1, this.href = "", this.icon = "", this.controls = "", this.tag = "", this.tagSkin = "blue", this.index = 0, this.elementRef = f();
116
116
  }
@@ -137,21 +137,21 @@ var h = class extends s {
137
137
  this.context && this.context.handleKeyUp(e, this.index);
138
138
  }
139
139
  render() {
140
- let t = this.context?.useArrowNav ?? !0, n = this.active && !this.disabled, r = [n ? "active" : "", this.disabled ? "pkt-tabs__item--disabled" : ""].filter(Boolean).join(" "), i = t ? "tab" : void 0, s = t ? n : void 0, c = this.disabled ? -1 : n || !t ? void 0 : -1, l = `pkt-icon--small ${this.icon === "check" ? "pkt-tabs__status-icon" : ""}`, u = e`
140
+ let t = this.context?.useArrowNav ?? !0, n = this.active && !this.disabled, r = [n ? "active" : "", this.disabled ? "pkt-tabs__item--disabled" : ""].filter(Boolean).join(" "), i = t ? "tab" : void 0, o = t ? n : void 0, c = this.disabled ? -1 : n || !t ? void 0 : -1, l = `pkt-icon--small ${this.icon === "check" ? "pkt-tabs__status-icon" : ""}`, u = e`
141
141
  ${this.icon ? e`<pkt-icon name=${this.icon} class=${l}></pkt-icon>` : ""}
142
- <span>${o(this)}</span>
142
+ <span>${a(this)}</span>
143
143
  ${this.tag ? e`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>` : ""}
144
144
  `;
145
145
  return this.href ? e`
146
146
  <a
147
147
  ${d(this.elementRef)}
148
- href=${a(this.disabled ? void 0 : this.href)}
148
+ href=${s(this.disabled ? void 0 : this.href)}
149
149
  class="pkt-tabs__link ${r}"
150
- role=${a(i)}
151
- aria-selected=${a(s)}
152
- aria-disabled=${a(this.disabled ? "true" : void 0)}
153
- aria-controls=${a(this.controls || void 0)}
154
- tabindex=${a(c)}
150
+ role=${s(i)}
151
+ aria-selected=${s(o)}
152
+ aria-disabled=${s(this.disabled ? "true" : void 0)}
153
+ aria-controls=${s(this.controls || void 0)}
154
+ tabindex=${s(c)}
155
155
  @click=${this.handleClick}
156
156
  @keydown=${this.handleKeyDown}
157
157
  >
@@ -163,11 +163,11 @@ var h = class extends s {
163
163
  type="button"
164
164
  class="pkt-tabs__button pkt-link-button ${r}"
165
165
  ?disabled=${this.disabled}
166
- aria-disabled=${a(this.disabled ? "true" : void 0)}
167
- role=${a(i)}
168
- aria-selected=${a(s)}
169
- aria-controls=${a(this.controls || void 0)}
170
- tabindex=${a(c)}
166
+ aria-disabled=${s(this.disabled ? "true" : void 0)}
167
+ role=${s(i)}
168
+ aria-selected=${s(o)}
169
+ aria-controls=${s(this.controls || void 0)}
170
+ tabindex=${s(c)}
171
171
  @click=${this.handleClick}
172
172
  @keydown=${this.handleKeyDown}
173
173
  >
@@ -1,21 +1,21 @@
1
- const e=require("./element-BOmr9YLv.cjs"),t=require("./if-defined-2mkIDgOm.cjs"),n=require("./element-with-slot-2PHu2w7O.cjs"),r=require("./consume-Le4HztPo.cjs"),i=require("./ref-Emu5PNxk.cjs");var a=r.r(Symbol(`pkt-tabs-context`)),o=class extends n.t{constructor(...e){super(...e),this.arrowNav=!0,this.disableArrowNav=!1,this.separatorIconName=``,this.separatorIconPath=``,this.tabRefs=[],this.disabledMap={},this.tabCount=0,this.context={useArrowNav:this.useArrowNav,registerTab:this.registerTab.bind(this),handleClick:this.handleClick.bind(this),handleKeyUp:this.handleKeyUp.bind(this)}}get useArrowNav(){return this.arrowNav&&!this.disableArrowNav}willUpdate(e){(e.has(`arrowNav`)||e.has(`disableArrowNav`))&&(this.context={...this.context,useArrowNav:this.useArrowNav})}updated(){this.updateComplete.then(()=>this.syncSeparators())}syncSeparators(){let e=this.querySelector(`.pkt-tabs__list`);if(!e||(e.querySelectorAll(`.pkt-tabs__separator`).forEach(e=>e.remove()),!(this.separatorIconName||this.separatorIconPath)))return;let t=Array.from(e.children).filter(e=>!e.classList.contains(`pkt-tabs__separator`));for(let e=0;e<t.length-1;e++){let n=document.createElement(`span`);if(n.className=`pkt-tabs__separator`,n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`role`,`presentation`),this.separatorIconPath){let e=document.createElement(`img`);e.setAttribute(`src`,this.separatorIconPath),e.setAttribute(`alt`,``),e.setAttribute(`aria-hidden`,`true`),n.appendChild(e)}else if(this.separatorIconName){let e=document.createElement(`pkt-icon`);e.setAttribute(`name`,this.separatorIconName),e.classList.add(`pkt-tabs__separator-icon`),n.appendChild(e)}t[e].after(n)}}registerTab(e,t,n=!1){this.tabRefs[t]=e,this.disabledMap[t]=n,this.tabCount=Math.max(this.tabCount,t+1)}isTabDisabled(e){return!!this.disabledMap[e]}findEnabledIndex(e,t){let n=e+t;for(;n>=0&&n<this.tabCount;){if(!this.isTabDisabled(n))return n;n+=t}return null}handleClick(e){this.isTabDisabled(e)||this.dispatchEvent(new CustomEvent(`tab-selected`,{detail:{index:e},bubbles:!0,composed:!0}))}handleKeyUp(e,t){if(this.useArrowNav){if(e.key===`ArrowLeft`){e.preventDefault();let n=this.findEnabledIndex(t,-1);n!==null&&this.tabRefs[n]?.focus()}if(e.key===`ArrowRight`){e.preventDefault();let n=this.findEnabledIndex(t,1);n!==null&&this.tabRefs[n]?.focus()}(e.key===`Enter`||e.key===` `||e.key===`Spacebar`||e.key===`ArrowDown`)&&(e.preventDefault(),this.handleClick(t))}}render(){let t=this.useArrowNav?`tablist`:`navigation`,r=this.separatorIconName||this.separatorIconPath?`pkt-tabs pkt-tabs--with-separator`:`pkt-tabs`;return e._`
1
+ const e=require("./element-BOmr9YLv.cjs"),t=require("./element-with-slot-D7sTqOr3.cjs"),n=require("./if-defined-2mkIDgOm.cjs"),r=require("./consume-Le4HztPo.cjs"),i=require("./ref-Emu5PNxk.cjs");var a=r.r(Symbol(`pkt-tabs-context`)),o=class extends t.t{constructor(...e){super(...e),this.arrowNav=!0,this.disableArrowNav=!1,this.separatorIconName=``,this.separatorIconPath=``,this.tabRefs=[],this.disabledMap={},this.tabCount=0,this.context={useArrowNav:this.useArrowNav,registerTab:this.registerTab.bind(this),handleClick:this.handleClick.bind(this),handleKeyUp:this.handleKeyUp.bind(this)}}get useArrowNav(){return this.arrowNav&&!this.disableArrowNav}willUpdate(e){(e.has(`arrowNav`)||e.has(`disableArrowNav`))&&(this.context={...this.context,useArrowNav:this.useArrowNav})}updated(){this.updateComplete.then(()=>this.syncSeparators())}syncSeparators(){let e=this.querySelector(`.pkt-tabs__list`);if(!e||(e.querySelectorAll(`.pkt-tabs__separator`).forEach(e=>e.remove()),!(this.separatorIconName||this.separatorIconPath)))return;let t=Array.from(e.children).filter(e=>!e.classList.contains(`pkt-tabs__separator`));for(let e=0;e<t.length-1;e++){let n=document.createElement(`span`);if(n.className=`pkt-tabs__separator`,n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`role`,`presentation`),this.separatorIconPath){let e=document.createElement(`img`);e.setAttribute(`src`,this.separatorIconPath),e.setAttribute(`alt`,``),e.setAttribute(`aria-hidden`,`true`),n.appendChild(e)}else if(this.separatorIconName){let e=document.createElement(`pkt-icon`);e.setAttribute(`name`,this.separatorIconName),e.classList.add(`pkt-tabs__separator-icon`),n.appendChild(e)}t[e].after(n)}}registerTab(e,t,n=!1){this.tabRefs[t]=e,this.disabledMap[t]=n,this.tabCount=Math.max(this.tabCount,t+1)}isTabDisabled(e){return!!this.disabledMap[e]}findEnabledIndex(e,t){let n=e+t;for(;n>=0&&n<this.tabCount;){if(!this.isTabDisabled(n))return n;n+=t}return null}handleClick(e){this.isTabDisabled(e)||this.dispatchEvent(new CustomEvent(`tab-selected`,{detail:{index:e},bubbles:!0,composed:!0}))}handleKeyUp(e,t){if(this.useArrowNav){if(e.key===`ArrowLeft`){e.preventDefault();let n=this.findEnabledIndex(t,-1);n!==null&&this.tabRefs[n]?.focus()}if(e.key===`ArrowRight`){e.preventDefault();let n=this.findEnabledIndex(t,1);n!==null&&this.tabRefs[n]?.focus()}(e.key===`Enter`||e.key===` `||e.key===`Spacebar`||e.key===`ArrowDown`)&&(e.preventDefault(),this.handleClick(t))}}render(){let n=this.useArrowNav?`tablist`:`navigation`,r=this.separatorIconName||this.separatorIconPath?`pkt-tabs pkt-tabs--with-separator`:`pkt-tabs`;return e._`
2
2
  <div class=${r}>
3
- <div class="pkt-tabs__list" role=${t}>${n.r(this)}</div>
3
+ <div class="pkt-tabs__list" role=${n}>${t.i(this)}</div>
4
4
  </div>
5
- `}};e.n([e.u({type:Boolean,reflect:!0,attribute:`arrow-nav`})],o.prototype,`arrowNav`,void 0),e.n([e.u({type:Boolean,reflect:!0,attribute:`disable-arrow-nav`})],o.prototype,`disableArrowNav`,void 0),e.n([e.u({type:String,reflect:!0,attribute:`separator-icon-name`})],o.prototype,`separatorIconName`,void 0),e.n([e.u({type:String,reflect:!0,attribute:`separator-icon-path`})],o.prototype,`separatorIconPath`,void 0),e.n([e.l()],o.prototype,`tabRefs`,void 0),e.n([e.l()],o.prototype,`disabledMap`,void 0),e.n([e.l()],o.prototype,`tabCount`,void 0),e.n([r.n({context:a}),e.l()],o.prototype,`context`,void 0);try{e.d(`pkt-tabs`)(o)}catch{console.warn(`Forsøker å definere <pkt-tabs>, men den er allerede definert`)}var s=class extends n.t{constructor(){super(),this.active=!1,this.disabled=!1,this.href=``,this.icon=``,this.controls=``,this.tag=``,this.tagSkin=`blue`,this.index=0,this.elementRef=i.t()}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index,this.disabled)})}updated(){this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index,this.disabled)}handleClick(e){if(this.disabled){e.preventDefault(),e.stopPropagation();return}this.context&&this.context.handleClick(this.index)}handleKeyDown(e){if(this.disabled&&(e.key===`Enter`||e.key===` `||e.key===`Spacebar`)){e.preventDefault(),e.stopPropagation();return}this.context&&this.context.handleKeyUp(e,this.index)}render(){let r=this.context?.useArrowNav??!0,a=this.active&&!this.disabled,o=[a?`active`:``,this.disabled?`pkt-tabs__item--disabled`:``].filter(Boolean).join(` `),s=r?`tab`:void 0,c=r?a:void 0,l=this.disabled?-1:a||!r?void 0:-1,u=`pkt-icon--small ${this.icon===`check`?`pkt-tabs__status-icon`:``}`,d=e._`
5
+ `}};e.n([e.u({type:Boolean,reflect:!0,attribute:`arrow-nav`})],o.prototype,`arrowNav`,void 0),e.n([e.u({type:Boolean,reflect:!0,attribute:`disable-arrow-nav`})],o.prototype,`disableArrowNav`,void 0),e.n([e.u({type:String,reflect:!0,attribute:`separator-icon-name`})],o.prototype,`separatorIconName`,void 0),e.n([e.u({type:String,reflect:!0,attribute:`separator-icon-path`})],o.prototype,`separatorIconPath`,void 0),e.n([e.l()],o.prototype,`tabRefs`,void 0),e.n([e.l()],o.prototype,`disabledMap`,void 0),e.n([e.l()],o.prototype,`tabCount`,void 0),e.n([r.n({context:a}),e.l()],o.prototype,`context`,void 0);try{e.d(`pkt-tabs`)(o)}catch{console.warn(`Forsøker å definere <pkt-tabs>, men den er allerede definert`)}var s=class extends t.t{constructor(){super(),this.active=!1,this.disabled=!1,this.href=``,this.icon=``,this.controls=``,this.tag=``,this.tagSkin=`blue`,this.index=0,this.elementRef=i.t()}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index,this.disabled)})}updated(){this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index,this.disabled)}handleClick(e){if(this.disabled){e.preventDefault(),e.stopPropagation();return}this.context&&this.context.handleClick(this.index)}handleKeyDown(e){if(this.disabled&&(e.key===`Enter`||e.key===` `||e.key===`Spacebar`)){e.preventDefault(),e.stopPropagation();return}this.context&&this.context.handleKeyUp(e,this.index)}render(){let r=this.context?.useArrowNav??!0,a=this.active&&!this.disabled,o=[a?`active`:``,this.disabled?`pkt-tabs__item--disabled`:``].filter(Boolean).join(` `),s=r?`tab`:void 0,c=r?a:void 0,l=this.disabled?-1:a||!r?void 0:-1,u=`pkt-icon--small ${this.icon===`check`?`pkt-tabs__status-icon`:``}`,d=e._`
6
6
  ${this.icon?e._`<pkt-icon name=${this.icon} class=${u}></pkt-icon>`:``}
7
- <span>${n.r(this)}</span>
7
+ <span>${t.i(this)}</span>
8
8
  ${this.tag?e._`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>`:``}
9
9
  `;return this.href?e._`
10
10
  <a
11
11
  ${i.n(this.elementRef)}
12
- href=${t.t(this.disabled?void 0:this.href)}
12
+ href=${n.t(this.disabled?void 0:this.href)}
13
13
  class="pkt-tabs__link ${o}"
14
- role=${t.t(s)}
15
- aria-selected=${t.t(c)}
16
- aria-disabled=${t.t(this.disabled?`true`:void 0)}
17
- aria-controls=${t.t(this.controls||void 0)}
18
- tabindex=${t.t(l)}
14
+ role=${n.t(s)}
15
+ aria-selected=${n.t(c)}
16
+ aria-disabled=${n.t(this.disabled?`true`:void 0)}
17
+ aria-controls=${n.t(this.controls||void 0)}
18
+ tabindex=${n.t(l)}
19
19
  @click=${this.handleClick}
20
20
  @keydown=${this.handleKeyDown}
21
21
  >
@@ -27,11 +27,11 @@ const e=require("./element-BOmr9YLv.cjs"),t=require("./if-defined-2mkIDgOm.cjs")
27
27
  type="button"
28
28
  class="pkt-tabs__button pkt-link-button ${o}"
29
29
  ?disabled=${this.disabled}
30
- aria-disabled=${t.t(this.disabled?`true`:void 0)}
31
- role=${t.t(s)}
32
- aria-selected=${t.t(c)}
33
- aria-controls=${t.t(this.controls||void 0)}
34
- tabindex=${t.t(l)}
30
+ aria-disabled=${n.t(this.disabled?`true`:void 0)}
31
+ role=${n.t(s)}
32
+ aria-selected=${n.t(c)}
33
+ aria-controls=${n.t(this.controls||void 0)}
34
+ tabindex=${n.t(l)}
35
35
  @click=${this.handleClick}
36
36
  @keydown=${this.handleKeyDown}
37
37
  >
@@ -0,0 +1,27 @@
1
+ const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),n=require("./format-B8meU8Tm.cjs"),r=require("./element-with-slot-D7sTqOr3.cjs");require("./icon-Dnv6LtPC.cjs");const i=require("./if-defined-2mkIDgOm.cjs");var a={name:`pkt-tag`,react:`PktTag`,"css-class":`pkt-tag`,isElement:!0,"dark-mode":!0,props:{size:{name:`Størrelse`,description:`Størrelsen på taggen`,required:!1,default:`medium`,type:[`small`,`medium`,`large`],category:`ui`},iconName:{name:`Ikon`,description:`Navnet på ikonet som skal vises i taggen`,type:`icon`,required:!1,category:`ui`},skin:{name:`Utseende`,description:`Utseendet til taggen`,required:!1,default:`blue`,type:[`blue`,`blue-light`,`blue-dark`,`green`,`red`,`beige`,`yellow`,`gray`],category:`ui`},closeTag:{name:`Lukk tag`,description:`Skal taggen ha en lukkeknapp?`,type:`boolean`,required:!1,default:!1,category:`ui`},textStyle:{name:`Tekststil`,description:`Stilen på teksten i taggen`,required:!1,default:`normal-text`,type:[`thin-text`,`normal-text`],category:`ui`},type:{name:`Type, dersom lukkeknapp`,description:`Type tag, brukes for å spesifisere om det er en knapp, submit eller reset`,required:!1,default:`button`,type:[`button`,`submit`,`reset`],category:`tech`},ariaLabel:{name:`aria-label`,description:`aria-label for taggen, brukes for tilgjengelighet`,type:`string`,required:!1,category:`accessibility`}},slots:{default:{description:`Teksten til tag`}}},o=class extends r.t{constructor(){super(),this.closeTag=a.props.closeTag.default,this.size=a.props.size.default,this.skin=a.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=a.props.type.default,this.ariaLabel=null,this.buttonTabindex=void 0,this._isClosed=!1,this._ariaDescription=null,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent(`close`,{detail:{origin:e},bubbles:!1,composed:!0})),this.dispatchEvent(new CustomEvent(`on-close`,{detail:{origin:e},bubbles:!1,composed:!0}))},this._isClosed=!1}willUpdate(e){if(super.willUpdate(e),this.closeTag&&!this.ariaLabel){let e=r.r(this).getNodes().map(e=>e.textContent??``).join(``).trim();e&&(this._ariaDescription=n.t(this.pktStrings.get(`tag`).remove,{label:e}))}}render(){let n={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},a={"pkt-tag":!0,[`pkt-tag--${this.textStyle}`]:!!this.textStyle,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,"pkt-hide":this._isClosed};return this.closeTag?e._`
2
+ <button
3
+ class=${t.t(a)}
4
+ type=${this.type}
5
+ tabindex=${i.t(this.buttonTabindex)}
6
+ @click=${this.close}
7
+ aria-label=${i.t(this.ariaLabel||void 0)}
8
+ aria-description=${i.t(this._ariaDescription||void 0)}
9
+ >
10
+ ${this.iconName&&e._`<pkt-icon
11
+ class="pkt-tag__icon"
12
+ name=${this.iconName}
13
+ aria-hidden="true"
14
+ ></pkt-icon>`}
15
+ <span>${r.i(this)}</span>
16
+ <pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
17
+ </button>
18
+ `:e._`
19
+ <span class=${t.t(n)}>
20
+ ${this.iconName&&e._`<pkt-icon
21
+ class="pkt-tag__icon"
22
+ name=${this.iconName}
23
+ aria-hidden="true"
24
+ ></pkt-icon>`}
25
+ <span>${r.i(this)}</span>
26
+ </span>
27
+ `}};e.n([e.u({type:Boolean,reflect:!0})],o.prototype,`closeTag`,void 0),e.n([e.u({type:String,reflect:!0})],o.prototype,`size`,void 0),e.n([e.u({type:String,reflect:!0})],o.prototype,`skin`,void 0),e.n([e.u({type:String,reflect:!0})],o.prototype,`textStyle`,void 0),e.n([e.u({type:String,reflect:!0})],o.prototype,`iconName`,void 0),e.n([e.u({type:String})],o.prototype,`type`,void 0),e.n([e.u({type:String})],o.prototype,`ariaLabel`,void 0),e.n([e.u({type:Number,attribute:`button-tabindex`})],o.prototype,`buttonTabindex`,void 0),e.n([e.l()],o.prototype,`_isClosed`,void 0),e.n([e.l()],o.prototype,`_ariaDescription`,void 0);try{e.d(`pkt-tag`)(o)}catch{console.warn(`Forsøker å definere <pkt-tag>, men den er allerede definert`)}var s=o;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
@@ -1,9 +1,9 @@
1
1
  import { _ as e, d as t, l as n, n as r, u as i } from "./element-mwwC2Rra.js";
2
2
  import { t as a } from "./class-map-C4hdfSfY.js";
3
- import { t as o } from "./if-defined-Bebu3LXY.js";
4
- import { t as s } from "./format-BTeSVkED.js";
5
- import { n as c, r as l, t as u } from "./element-with-slot-FD826ooP.js";
3
+ import { t as o } from "./format-BTeSVkED.js";
4
+ import { i as s, r as c, t as l } from "./element-with-slot-DQv0cbbD.js";
6
5
  import "./icon-JigbxxF7.js";
6
+ import { t as u } from "./if-defined-Bebu3LXY.js";
7
7
  var d = {
8
8
  name: "pkt-tag",
9
9
  react: "PktTag",
@@ -84,7 +84,7 @@ var d = {
84
84
  }
85
85
  },
86
86
  slots: { default: { description: "Teksten til tag" } }
87
- }, f = class extends u {
87
+ }, f = class extends l {
88
88
  constructor() {
89
89
  super(), this.closeTag = d.props.closeTag.default, this.size = d.props.size.default, this.skin = d.props.skin.default, this.textStyle = null, this.iconName = void 0, this.type = d.props.type.default, this.ariaLabel = null, this.buttonTabindex = void 0, this._isClosed = !1, this._ariaDescription = null, this.close = (e) => {
90
90
  this._isClosed = !0, this.dispatchEvent(new CustomEvent("close", {
@@ -101,7 +101,7 @@ var d = {
101
101
  willUpdate(e) {
102
102
  if (super.willUpdate(e), this.closeTag && !this.ariaLabel) {
103
103
  let e = c(this).getNodes().map((e) => e.textContent ?? "").join("").trim();
104
- e && (this._ariaDescription = s(this.pktStrings.get("tag").remove, { label: e }));
104
+ e && (this._ariaDescription = o(this.pktStrings.get("tag").remove, { label: e }));
105
105
  }
106
106
  }
107
107
  render() {
@@ -121,17 +121,17 @@ var d = {
121
121
  <button
122
122
  class=${a(n)}
123
123
  type=${this.type}
124
- tabindex=${o(this.buttonTabindex)}
124
+ tabindex=${u(this.buttonTabindex)}
125
125
  @click=${this.close}
126
- aria-label=${o(this.ariaLabel || void 0)}
127
- aria-description=${o(this._ariaDescription || void 0)}
126
+ aria-label=${u(this.ariaLabel || void 0)}
127
+ aria-description=${u(this._ariaDescription || void 0)}
128
128
  >
129
129
  ${this.iconName && e`<pkt-icon
130
130
  class="pkt-tag__icon"
131
131
  name=${this.iconName}
132
132
  aria-hidden="true"
133
133
  ></pkt-icon>`}
134
- <span>${l(this)}</span>
134
+ <span>${s(this)}</span>
135
135
  <pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
136
136
  </button>
137
137
  ` : e`
@@ -141,7 +141,7 @@ var d = {
141
141
  name=${this.iconName}
142
142
  aria-hidden="true"
143
143
  ></pkt-icon>`}
144
- <span>${l(this)}</span>
144
+ <span>${s(this)}</span>
145
145
  </span>
146
146
  `;
147
147
  }